Cranelift: refactoring of unwind info (#2289)
* factor common code * move fde/unwind emit to more abstract level * code_len -> function_size * speedup block scanning * better function_size calciulation * Rename UnwindCode enums
This commit is contained in:
@@ -993,7 +993,7 @@ fn insert_common_epilogues(
|
||||
pos.goto_last_inst(block);
|
||||
if let Some(inst) = pos.current_inst() {
|
||||
if pos.func.dfg[inst].opcode().is_return() {
|
||||
insert_common_epilogue(inst, stack_size, pos, reg_type, csrs, sp_arg_index);
|
||||
insert_common_epilogue(inst, block, stack_size, pos, reg_type, csrs, sp_arg_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1003,6 +1003,7 @@ fn insert_common_epilogues(
|
||||
/// This is used by common calling conventions such as System V.
|
||||
fn insert_common_epilogue(
|
||||
inst: ir::Inst,
|
||||
block: ir::Block,
|
||||
stack_size: i64,
|
||||
pos: &mut EncCursor,
|
||||
reg_type: ir::types::Type,
|
||||
@@ -1062,12 +1063,13 @@ fn insert_common_epilogue(
|
||||
assert!(csrs.iter(FPR).len() == 0);
|
||||
}
|
||||
|
||||
pos.func.epilogues_start.push(
|
||||
pos.func.epilogues_start.push((
|
||||
first_fpr_load
|
||||
.or(sp_adjust_inst)
|
||||
.or(first_csr_pop_inst)
|
||||
.unwrap_or(fp_pop_inst),
|
||||
);
|
||||
block,
|
||||
));
|
||||
}
|
||||
|
||||
#[cfg(feature = "unwind")]
|
||||
|
||||
Reference in New Issue
Block a user