diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc index 7b8e5e85b68..4c56935c42d 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc @@ -883,7 +883,8 @@ void FlowGraphCompiler::EmitFrameEntry() { } __ CompareImmediate(R3, GetOptimizationThreshold()); ASSERT(function_reg == R8); - __ Branch(Address(THR, Thread::optimize_entry_offset()), GE); + __ Branch(Address(THR, compiler::target::Thread::optimize_entry_offset()), + GE); } __ Comment("Enter frame"); if (flow_graph().IsCompiledForOsr()) { diff --git a/runtime/vm/compiler/runtime_api.h b/runtime/vm/compiler/runtime_api.h index f6231cea03b..5f0f76b2788 100644 --- a/runtime/vm/compiler/runtime_api.h +++ b/runtime/vm/compiler/runtime_api.h @@ -626,6 +626,7 @@ class Thread : public AllStatic { static word dart_stream_offset(); static word async_stack_trace_offset(); static word predefined_symbols_address_offset(); + static word optimize_entry_offset(); static word deoptimize_entry_offset(); static word megamorphic_call_checked_entry_offset(); static word active_exception_offset(); @@ -690,6 +691,7 @@ class Thread : public AllStatic { static word stack_overflow_shared_with_fpu_regs_stub_offset(); static word lazy_deopt_from_return_stub_offset(); static word lazy_deopt_from_throw_stub_offset(); + static word optimize_stub_offset(); static word deoptimize_stub_offset(); static word enter_safepoint_stub_offset(); static word exit_safepoint_stub_offset(); diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h index 4b1687a0c33..bf791bc004a 100644 --- a/runtime/vm/compiler/runtime_offsets_extracted.h +++ b/runtime/vm/compiler/runtime_offsets_extracted.h @@ -211,6 +211,9 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word Thread_call_to_runtime_stub_offset = 132; static constexpr dart::compiler::target::word Thread_dart_stream_offset = 644; +static constexpr dart::compiler::target::word Thread_optimize_entry_offset = + 224; +static constexpr dart::compiler::target::word Thread_optimize_stub_offset = 156; static constexpr dart::compiler::target::word Thread_deoptimize_entry_offset = 228; static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset = @@ -561,6 +564,9 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word Thread_call_to_runtime_stub_offset = 256; static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1296; +static constexpr dart::compiler::target::word Thread_optimize_entry_offset = + 440; +static constexpr dart::compiler::target::word Thread_optimize_stub_offset = 304; static constexpr dart::compiler::target::word Thread_deoptimize_entry_offset = 448; static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset = @@ -912,6 +918,9 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word Thread_call_to_runtime_stub_offset = 132; static constexpr dart::compiler::target::word Thread_dart_stream_offset = 608; +static constexpr dart::compiler::target::word Thread_optimize_entry_offset = + 224; +static constexpr dart::compiler::target::word Thread_optimize_stub_offset = 156; static constexpr dart::compiler::target::word Thread_deoptimize_entry_offset = 228; static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset = @@ -1258,6 +1267,9 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word Thread_call_to_runtime_stub_offset = 256; static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1384; +static constexpr dart::compiler::target::word Thread_optimize_entry_offset = + 440; +static constexpr dart::compiler::target::word Thread_optimize_stub_offset = 304; static constexpr dart::compiler::target::word Thread_deoptimize_entry_offset = 448; static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset = diff --git a/runtime/vm/compiler/runtime_offsets_list.h b/runtime/vm/compiler/runtime_offsets_list.h index 3f5ef949f1f..74264ca3f15 100644 --- a/runtime/vm/compiler/runtime_offsets_list.h +++ b/runtime/vm/compiler/runtime_offsets_list.h @@ -157,6 +157,8 @@ NOT_IN_DBC(FIELD(Thread, call_to_runtime_entry_point_offset)) \ NOT_IN_DBC(FIELD(Thread, call_to_runtime_stub_offset)) \ FIELD(Thread, dart_stream_offset) \ + NOT_IN_DBC(FIELD(Thread, optimize_entry_offset)) \ + NOT_IN_DBC(FIELD(Thread, optimize_stub_offset)) \ NOT_IN_DBC(FIELD(Thread, deoptimize_entry_offset)) \ NOT_IN_DBC(FIELD(Thread, deoptimize_stub_offset)) \ FIELD(Thread, double_abs_address_offset) \ diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc index f2fcc877969..dd3b49f4fcd 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm.cc @@ -2960,7 +2960,7 @@ void StubCodeCompiler::GenerateDeoptForRewindStub(Assembler* assembler) { // R8: function to be reoptimized. // R4: argument descriptor (preserved). void StubCodeCompiler::GenerateOptimizeFunctionStub(Assembler* assembler) { - __ ldr(CODE_REG, Address(THR, Thread::optimize_stub_offset())); + __ ldr(CODE_REG, Address(THR, target::Thread::optimize_stub_offset())); __ EnterStubFrame(); __ Push(R4); __ LoadImmediate(IP, 0); diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc index 7bebb69fbd4..97dcff4d41e 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm64.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc @@ -3032,7 +3032,7 @@ void StubCodeCompiler::GenerateDeoptForRewindStub(Assembler* assembler) { // R6: function to be re-optimized. // R4: argument descriptor (preserved). void StubCodeCompiler::GenerateOptimizeFunctionStub(Assembler* assembler) { - __ LoadFromOffset(CODE_REG, THR, Thread::optimize_stub_offset()); + __ LoadFromOffset(CODE_REG, THR, target::Thread::optimize_stub_offset()); __ EnterStubFrame(); __ Push(R4); // Setup space on stack for the return value. diff --git a/runtime/vm/compiler/stub_code_compiler_ia32.cc b/runtime/vm/compiler/stub_code_compiler_ia32.cc index dc4e3ecf340..bb5aeccd4ea 100644 --- a/runtime/vm/compiler/stub_code_compiler_ia32.cc +++ b/runtime/vm/compiler/stub_code_compiler_ia32.cc @@ -2484,7 +2484,7 @@ void StubCodeCompiler::GenerateDeoptForRewindStub(Assembler* assembler) { // EBX: function to be reoptimized. // EDX: argument descriptor (preserved). void StubCodeCompiler::GenerateOptimizeFunctionStub(Assembler* assembler) { - __ movl(CODE_REG, Address(THR, Thread::optimize_stub_offset())); + __ movl(CODE_REG, Address(THR, target::Thread::optimize_stub_offset())); __ EnterStubFrame(); __ pushl(EDX); __ pushl(Immediate(0)); // Setup space on stack for return value. diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc index 040214730ad..414bedb900e 100644 --- a/runtime/vm/compiler/stub_code_compiler_x64.cc +++ b/runtime/vm/compiler/stub_code_compiler_x64.cc @@ -3046,7 +3046,7 @@ void StubCodeCompiler::GenerateDeoptForRewindStub(Assembler* assembler) { // RDI: function to be reoptimized. // R10: argument descriptor (preserved). void StubCodeCompiler::GenerateOptimizeFunctionStub(Assembler* assembler) { - __ movq(CODE_REG, Address(THR, Thread::optimize_stub_offset())); + __ movq(CODE_REG, Address(THR, target::Thread::optimize_stub_offset())); __ EnterStubFrame(); __ pushq(R10); // Preserve args descriptor. __ pushq(Immediate(0)); // Result slot.