Implement a poor man's jump table.

We will eventually support real jump tables, but for now just expand
br_table into a sequence of conditional branches.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-25 10:56:14 -07:00
parent 29dfcf5dfb
commit fdb97da21b
4 changed files with 53 additions and 0 deletions

View File

@@ -39,6 +39,11 @@ impl JumpTableData {
}
}
/// Get the number of table entries.
pub fn len(&self) -> usize {
self.table.len()
}
/// Set a table entry.
///
/// The table will grow as needed to fit `idx`.