|
|
@ -89,9 +89,8 @@ A64EmitX64::BlockDescriptor A64EmitX64::Emit(IR::Block& block) noexcept { |
|
|
// Start emitting.
|
|
|
// Start emitting.
|
|
|
code.align(); |
|
|
code.align(); |
|
|
const auto* const entrypoint = code.getCurr(); |
|
|
const auto* const entrypoint = code.getCurr(); |
|
|
|
|
|
|
|
|
// code.mov(code.qword[rsp + ABI_SHADOW_SPACE + offsetof(StackLayout, abi_base_pointer)], rbp);
|
|
|
|
|
|
// code.lea(rbp, code.ptr[rsp + ABI_SHADOW_SPACE - 8]);
|
|
|
|
|
|
|
|
|
code.mov(code.qword[rsp + ABI_SHADOW_SPACE + offsetof(StackLayout, abi_base_pointer)], rbp); |
|
|
|
|
|
code.lea(rbp, code.ptr[rsp + ABI_SHADOW_SPACE + offsetof(StackLayout, abi_base_pointer) - 8]); |
|
|
|
|
|
|
|
|
DEBUG_ASSERT(block.GetCondition() == IR::Cond::AL); |
|
|
DEBUG_ASSERT(block.GetCondition() == IR::Cond::AL); |
|
|
typedef void (EmitX64::*EmitHandlerFn)(EmitContext& context, IR::Inst* inst); |
|
|
typedef void (EmitX64::*EmitHandlerFn)(EmitContext& context, IR::Inst* inst); |
|
|
@ -143,19 +142,13 @@ finish_this_inst: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
reg_alloc.AssertNoMoreUses(); |
|
|
reg_alloc.AssertNoMoreUses(); |
|
|
|
|
|
|
|
|
if (conf.enable_cycle_counting) { |
|
|
|
|
|
|
|
|
if (conf.enable_cycle_counting) |
|
|
EmitAddCycles(block.CycleCount()); |
|
|
EmitAddCycles(block.CycleCount()); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//code.mov(rbp, code.qword[rsp + ABI_SHADOW_SPACE + offsetof(StackLayout, abi_base_pointer)]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
code.mov(rbp, code.qword[rsp + ABI_SHADOW_SPACE + offsetof(StackLayout, abi_base_pointer)]); |
|
|
EmitTerminal(block.GetTerminal(), ctx.Location().SetSingleStepping(false), ctx.IsSingleStep()); |
|
|
EmitTerminal(block.GetTerminal(), ctx.Location().SetSingleStepping(false), ctx.IsSingleStep()); |
|
|
code.int3(); |
|
|
code.int3(); |
|
|
|
|
|
|
|
|
for (auto& deferred_emit : ctx.deferred_emits) { |
|
|
|
|
|
|
|
|
for (auto& deferred_emit : ctx.deferred_emits) |
|
|
deferred_emit(); |
|
|
deferred_emit(); |
|
|
} |
|
|
|
|
|
code.int3(); |
|
|
code.int3(); |
|
|
|
|
|
|
|
|
const size_t size = size_t(code.getCurr() - entrypoint); |
|
|
const size_t size = size_t(code.getCurr() - entrypoint); |
|
|
|