Implement jump tables (#453)
* Add 'jump_table_entry' and 'indirect_jump' instructions. * Update CodeSink to keep track of code size. Pretty up clif-util's disassembly output. * Only disassemble the machine portion of output. Pretty print the read-only data after it. * Update switch frontend code to use new br_table instruction w/ default.
This commit is contained in:
committed by
Dan Gohman
parent
de1d82b4ba
commit
79cea5e18b
@@ -443,7 +443,17 @@ pub fn write_operands(
|
||||
write!(w, " {} {}, {}, {}", cond, args[0], args[1], destination)?;
|
||||
write_ebb_args(w, &args[2..])
|
||||
}
|
||||
BranchTable { arg, table, .. } => write!(w, " {}, {}", arg, table),
|
||||
BranchTable {
|
||||
arg,
|
||||
destination,
|
||||
table,
|
||||
..
|
||||
} => write!(w, " {}, {}, {}", arg, destination, table),
|
||||
BranchTableBase { table, .. } => write!(w, " {}", table),
|
||||
BranchTableEntry {
|
||||
args, imm, table, ..
|
||||
} => write!(w, " {}, {}, {}, {}", args[0], args[1], imm, table),
|
||||
IndirectJump { arg, table, .. } => write!(w, " {}, {}", arg, table),
|
||||
Call {
|
||||
func_ref, ref args, ..
|
||||
} => write!(w, " {}({})", func_ref, DisplayValues(args.as_slice(pool))),
|
||||
|
||||
Reference in New Issue
Block a user