Add Thread::optimize_(stub|entry) to runtime_api.h

Bug: https://github.com/dart-lang/sdk/issues/36839
Change-Id: Iab35c6bb322492872577545aaacc5147a76f2708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105920
Auto-Submit: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Liam Appelbe 2019-06-13 19:57:35 +00:00 committed by commit-bot@chromium.org
parent d6eac664ee
commit 0f91731f98
8 changed files with 22 additions and 5 deletions

View file

@ -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()) {

View file

@ -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();

View file

@ -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 =

View file

@ -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) \

View file

@ -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);

View file

@ -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.

View file

@ -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.

View file

@ -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.