From 28d6d14ad5d2c761fc7538abe94bb64a3f43843a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marja=20H=C3=B6ltt=C3=A4?= Date: Fri, 23 Jun 2017 14:21:39 +0200 Subject: [PATCH] [iwyu] Include isolate.h less. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the include from: assembler.h (moved Isolate::AddressId to globals.h / IsolateAddressId) counters.h (ditto) elements.h (trivial) keys.h (trivial + iwyu fixes) property.h (trivial) transitions.h (trivial) vm-state.h (trivial) heap/code-stats.h (trivial + drive-by iwyuing) BUG=v8:5294 Change-Id: I36b8c07d4edf4177f1a987a393569f5191167ed3 Reviewed-on: https://chromium-review.googlesource.com/532879 Reviewed-by: Michael Starzinger Commit-Queue: Marja Hölttä Cr-Commit-Position: refs/heads/master@{#46176} --- src/arm/code-stubs-arm.cc | 26 ++++++++++++------------- src/arm/deoptimizer-arm.cc | 3 ++- src/arm/macro-assembler-arm.cc | 21 +++++++++++++------- src/arm64/code-stubs-arm64.cc | 20 +++++++++---------- src/arm64/deoptimizer-arm64.cc | 3 ++- src/arm64/macro-assembler-arm64.cc | 16 +++++++-------- src/assembler.cc | 14 +++++++++---- src/assembler.h | 11 +++-------- src/builtins/arm/builtins-arm.cc | 2 +- src/builtins/arm64/builtins-arm64.cc | 2 +- src/builtins/builtins-regexp-gen.cc | 4 ++-- src/builtins/ia32/builtins-ia32.cc | 2 +- src/builtins/mips/builtins-mips.cc | 2 +- src/builtins/mips64/builtins-mips64.cc | 2 +- src/builtins/ppc/builtins-ppc.cc | 2 +- src/builtins/s390/builtins-s390.cc | 2 +- src/builtins/x64/builtins-x64.cc | 4 ++-- src/builtins/x87/builtins-x87.cc | 2 +- src/counters-inl.h | 2 ++ src/counters.h | 1 - src/elements.h | 1 - src/external-reference-table.cc | 4 ++-- src/globals.h | 21 ++++++++++++++++++++ src/heap/code-stats.h | 11 ++++++----- src/heap/gc-tracer.h | 1 + src/ia32/code-stubs-ia32.cc | 27 +++++++++++++------------- src/ia32/deoptimizer-ia32.cc | 3 ++- src/ia32/macro-assembler-ia32.cc | 20 ++++++++++++------- src/isolate.cc | 5 ++--- src/isolate.h | 24 +---------------------- src/keys.h | 2 +- src/mips/code-stubs-mips.cc | 22 ++++++++++----------- src/mips/deoptimizer-mips.cc | 3 ++- src/mips/macro-assembler-mips.cc | 21 +++++++++++++------- src/mips64/code-stubs-mips64.cc | 22 ++++++++++----------- src/mips64/deoptimizer-mips64.cc | 3 ++- src/mips64/macro-assembler-mips64.cc | 21 +++++++++++++------- src/ppc/code-stubs-ppc.cc | 24 ++++++++++++----------- src/ppc/deoptimizer-ppc.cc | 3 ++- src/ppc/macro-assembler-ppc.cc | 21 +++++++++++++------- src/property.h | 1 - src/s390/code-stubs-s390.cc | 24 ++++++++++++----------- src/s390/deoptimizer-s390.cc | 3 ++- src/s390/macro-assembler-s390.cc | 21 +++++++++++++------- src/transitions.h | 1 - src/vm-state.h | 1 - src/x64/code-stubs-x64.cc | 23 +++++++++++----------- src/x64/deoptimizer-x64.cc | 3 ++- src/x64/macro-assembler-x64.cc | 17 +++++++++------- src/x87/code-stubs-x87.cc | 27 +++++++++++++------------- src/x87/deoptimizer-x87.cc | 3 ++- src/x87/macro-assembler-x87.cc | 20 ++++++++++++------- 52 files changed, 304 insertions(+), 240 deletions(-) diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index de6a915530..c2a29fa970 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -909,7 +909,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { if (FLAG_debug_code) { Label okay; ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); __ mov(r3, Operand(pending_exception_address)); __ ldr(r3, MemOperand(r3)); __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); @@ -938,15 +938,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set r0 to // contain the current pending exception, don't clobber it. @@ -1026,8 +1026,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { StackFrame::Type marker = type(); __ mov(r7, Operand(StackFrame::TypeToMarker(marker))); __ mov(r6, Operand(StackFrame::TypeToMarker(marker))); - __ mov(r5, - Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(r5, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ ldr(r5, MemOperand(r5)); __ mov(ip, Operand(-1)); // Push a bad frame pointer to fail if it is used. __ stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | @@ -1038,7 +1038,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // If this is the outermost JS call, set js_entry_sp value. Label non_outermost_js; - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); __ mov(r5, Operand(ExternalReference(js_entry_sp))); __ ldr(r6, MemOperand(r5)); __ cmp(r6, Operand::Zero()); @@ -1067,8 +1067,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // field in the JSEnv and return a failure sentinel. Coming in here the // fp will be invalid because the PushStackHandler below sets it to 0 to // signal the existence of the JSEntry frame. - __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, - isolate()))); + __ mov(ip, Operand(ExternalReference( + IsolateAddressId::kPendingExceptionAddress, isolate()))); } __ str(r0, MemOperand(ip)); __ LoadRoot(r0, Heap::kExceptionRootIndex); @@ -1123,8 +1123,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Restore the top frame descriptors from the stack. __ pop(r3); - __ mov(ip, - Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ str(r3, MemOperand(ip)); // Reset the stack to the callee saved registers. diff --git a/src/arm/deoptimizer-arm.cc b/src/arm/deoptimizer-arm.cc index b33b977879..a6015c4824 100644 --- a/src/arm/deoptimizer-arm.cc +++ b/src/arm/deoptimizer-arm.cc @@ -148,7 +148,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { // handle this a bit differently. __ stm(db_w, sp, restored_regs | sp.bit() | lr.bit() | pc.bit()); - __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ str(fp, MemOperand(ip)); const int kSavedRegistersAreaSize = diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index 6dcce75c80..8ea3367984 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -1432,9 +1432,11 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset)); // Save the frame pointer and the context in top. - mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); str(fp, MemOperand(ip)); - mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(ip, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); str(cp, MemOperand(ip)); // Optionally save all double registers. @@ -1494,16 +1496,19 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, // Clear top frame. mov(r3, Operand::Zero()); - mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); str(r3, MemOperand(ip)); // Restore current context from top and clear it in debug mode. if (restore_context) { - mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(ip, Operand(ExternalReference(IsolateAddressId::kContextAddress, + isolate()))); ldr(cp, MemOperand(ip)); } #ifdef DEBUG - mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(ip, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); str(r3, MemOperand(ip)); #endif @@ -1840,7 +1845,8 @@ void MacroAssembler::PushStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); // Link the current handler as the next handler. - mov(r6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + mov(r6, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); ldr(r5, MemOperand(r6)); push(r5); @@ -1852,7 +1858,8 @@ void MacroAssembler::PushStackHandler() { void MacroAssembler::PopStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); pop(r1); - mov(ip, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + mov(ip, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); add(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); str(r1, MemOperand(ip)); } diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc index 4845b8c7e2..e2f0b2251d 100644 --- a/src/arm64/code-stubs-arm64.cc +++ b/src/arm64/code-stubs-arm64.cc @@ -1041,15 +1041,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ Bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set x0 to // contain the current pending exception, don't clobber it. @@ -1137,7 +1137,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used. __ Mov(x13, bad_frame_pointer); __ Mov(x12, StackFrame::TypeToMarker(marker)); - __ Mov(x11, ExternalReference(Isolate::kCEntryFPAddress, isolate())); + __ Mov(x11, ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())); __ Ldr(x10, MemOperand(x11)); __ Push(x13, x12, xzr, x10); @@ -1147,7 +1147,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Push the JS entry frame marker. Also set js_entry_sp if this is the // outermost JS call. Label non_outermost_js, done; - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); __ Mov(x10, ExternalReference(js_entry_sp)); __ Ldr(x11, MemOperand(x10)); __ Cbnz(x11, &non_outermost_js); @@ -1186,8 +1186,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // field in the JSEnv and return a failure sentinel. Coming in here the // fp will be invalid because the PushTryHandler below sets it to 0 to // signal the existence of the JSEntry frame. - __ Mov(x10, Operand(ExternalReference(Isolate::kPendingExceptionAddress, - isolate()))); + __ Mov(x10, Operand(ExternalReference( + IsolateAddressId::kPendingExceptionAddress, isolate()))); } __ Str(code_entry, MemOperand(x10)); __ LoadRoot(x0, Heap::kExceptionRootIndex); @@ -1247,7 +1247,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Restore the top frame descriptors from the stack. __ Pop(x10); - __ Mov(x11, ExternalReference(Isolate::kCEntryFPAddress, isolate())); + __ Mov(x11, ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())); __ Str(x10, MemOperand(x11)); // Reset the stack to the callee saved registers. diff --git a/src/arm64/deoptimizer-arm64.cc b/src/arm64/deoptimizer-arm64.cc index 1790d97283..d20c51525a 100644 --- a/src/arm64/deoptimizer-arm64.cc +++ b/src/arm64/deoptimizer-arm64.cc @@ -133,7 +133,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { saved_registers.Combine(fp); __ PushCPURegList(saved_registers); - __ Mov(x3, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ Mov(x3, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ Str(fp, MemOperand(x3)); const int kSavedRegistersAreaSize = diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc index eebace37ef..785ff639dc 100644 --- a/src/arm64/macro-assembler-arm64.cc +++ b/src/arm64/macro-assembler-arm64.cc @@ -2936,11 +2936,11 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, const Register& scratch, STATIC_ASSERT((-3 * kPointerSize) == ExitFrameConstants::kCodeOffset); // Save the frame pointer and context pointer in the top frame. - Mov(scratch, Operand(ExternalReference(Isolate::kCEntryFPAddress, + Mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); Str(fp, MemOperand(scratch)); - Mov(scratch, Operand(ExternalReference(Isolate::kContextAddress, - isolate()))); + Mov(scratch, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); Str(cp, MemOperand(scratch)); STATIC_ASSERT((-3 * kPointerSize) == ExitFrameConstants::kLastExitFrameField); @@ -2996,19 +2996,19 @@ void MacroAssembler::LeaveExitFrame(bool restore_doubles, // Restore the context pointer from the top frame. if (restore_context) { - Mov(scratch, Operand(ExternalReference(Isolate::kContextAddress, + Mov(scratch, Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); Ldr(cp, MemOperand(scratch)); } if (emit_debug_code()) { // Also emit debug code to clear the cp in the top frame. - Mov(scratch, Operand(ExternalReference(Isolate::kContextAddress, + Mov(scratch, Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); Str(xzr, MemOperand(scratch)); } // Clear the frame pointer from the top frame. - Mov(scratch, Operand(ExternalReference(Isolate::kCEntryFPAddress, + Mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); Str(xzr, MemOperand(scratch)); @@ -3087,7 +3087,7 @@ void MacroAssembler::PushStackHandler() { // (See JSEntryStub::GenerateBody().) // Link the current handler as the next handler. - Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); + Mov(x11, ExternalReference(IsolateAddressId::kHandlerAddress, isolate())); Ldr(x10, MemOperand(x11)); Push(x10); @@ -3099,7 +3099,7 @@ void MacroAssembler::PushStackHandler() { void MacroAssembler::PopStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); Pop(x10); - Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); + Mov(x11, ExternalReference(IsolateAddressId::kHandlerAddress, isolate())); Drop(StackHandlerConstants::kSize - kXRegSize, kByteSizeInBytes); Str(x10, MemOperand(x11)); } diff --git a/src/assembler.cc b/src/assembler.cc index 3fda7d84ba..5e448694ea 100644 --- a/src/assembler.cc +++ b/src/assembler.cc @@ -55,6 +55,7 @@ #include "src/ic/ic.h" #include "src/ic/stub-cache.h" #include "src/interpreter/interpreter.h" +#include "src/isolate.h" #include "src/ostreams.h" #include "src/regexp/jsregexp.h" #include "src/regexp/regexp-macro-assembler.h" @@ -890,10 +891,8 @@ ExternalReference ExternalReference::interpreter_dispatch_counters( ExternalReference::ExternalReference(StatsCounter* counter) : address_(reinterpret_cast
(counter->GetInternalPointer())) {} - -ExternalReference::ExternalReference(Isolate::AddressId id, Isolate* isolate) - : address_(isolate->get_address_from_id(id)) {} - +ExternalReference::ExternalReference(IsolateAddressId id, Isolate* isolate) + : address_(isolate->get_address_from_id(id)) {} ExternalReference::ExternalReference(const SCTableReference& table_ref) : address_(table_ref.address()) {} @@ -954,6 +953,13 @@ ExternalReference ExternalReference::date_cache_stamp(Isolate* isolate) { return ExternalReference(isolate->date_cache()->stamp_address()); } +void ExternalReference::set_redirector( + Isolate* isolate, ExternalReferenceRedirector* redirector) { + // We can't stack them. + DCHECK(isolate->external_reference_redirector() == NULL); + isolate->set_external_reference_redirector( + reinterpret_cast(redirector)); +} ExternalReference ExternalReference::stress_deopt_count(Isolate* isolate) { return ExternalReference(isolate->stress_deopt_count_address()); diff --git a/src/assembler.h b/src/assembler.h index d165e70b9e..62eba36476 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -41,7 +41,6 @@ #include "src/builtins/builtins.h" #include "src/deoptimize-reason.h" #include "src/globals.h" -#include "src/isolate.h" #include "src/label.h" #include "src/log.h" #include "src/register-configuration.h" @@ -55,6 +54,7 @@ class ApiFunction; namespace internal { // Forward declarations. +class Isolate; class SourcePosition; class StatsCounter; @@ -852,7 +852,7 @@ class ExternalReference BASE_EMBEDDED { explicit ExternalReference(StatsCounter* counter); - ExternalReference(Isolate::AddressId id, Isolate* isolate); + ExternalReference(IsolateAddressId id, Isolate* isolate); explicit ExternalReference(const SCTableReference& table_ref); @@ -1078,12 +1078,7 @@ class ExternalReference BASE_EMBEDDED { // This lets you register a function that rewrites all external references. // Used by the ARM simulator to catch calls to external references. static void set_redirector(Isolate* isolate, - ExternalReferenceRedirector* redirector) { - // We can't stack them. - DCHECK(isolate->external_reference_redirector() == NULL); - isolate->set_external_reference_redirector( - reinterpret_cast(redirector)); - } + ExternalReferenceRedirector* redirector); static ExternalReference stress_deopt_count(Isolate* isolate); diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc index c47a430d73..0c4efc98f0 100644 --- a/src/builtins/arm/builtins-arm.cc +++ b/src/builtins/arm/builtins-arm.cc @@ -873,7 +873,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ mov(cp, Operand(context_address)); __ ldr(cp, MemOperand(cp)); diff --git a/src/builtins/arm64/builtins-arm64.cc b/src/builtins/arm64/builtins-arm64.cc index ad6eab5ea8..064dda9c80 100644 --- a/src/builtins/arm64/builtins-arm64.cc +++ b/src/builtins/arm64/builtins-arm64.cc @@ -897,7 +897,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - __ Mov(scratch, Operand(ExternalReference(Isolate::kContextAddress, + __ Mov(scratch, Operand(ExternalReference(IsolateAddressId::kContextAddress, masm->isolate()))); __ Ldr(cp, MemOperand(scratch)); diff --git a/src/builtins/builtins-regexp-gen.cc b/src/builtins/builtins-regexp-gen.cc index 066f5bf14f..95ae7e6410 100644 --- a/src/builtins/builtins-regexp-gen.cc +++ b/src/builtins/builtins-regexp-gen.cc @@ -532,8 +532,8 @@ Node* RegExpBuiltinsAssembler::RegExpExecInternal(Node* const context, { // A stack overflow was detected in RegExp code. #ifdef DEBUG - Node* const pending_exception_address = ExternalConstant( - ExternalReference(Isolate::kPendingExceptionAddress, isolate())); + Node* const pending_exception_address = ExternalConstant(ExternalReference( + IsolateAddressId::kPendingExceptionAddress, isolate())); CSA_ASSERT(this, IsTheHole(Load(MachineType::AnyTagged(), pending_exception_address))); #endif // DEBUG diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc index b6c228361b..f8feabfe31 100644 --- a/src/builtins/ia32/builtins-ia32.cc +++ b/src/builtins/ia32/builtins-ia32.cc @@ -405,7 +405,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ mov(esi, Operand::StaticVariable(context_address)); diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc index 76a5839f20..2c2299a8cc 100644 --- a/src/builtins/mips/builtins-mips.cc +++ b/src/builtins/mips/builtins-mips.cc @@ -738,7 +738,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ li(cp, Operand(context_address)); __ lw(cp, MemOperand(cp)); diff --git a/src/builtins/mips64/builtins-mips64.cc b/src/builtins/mips64/builtins-mips64.cc index cec78ce13a..11f2bd2fb3 100644 --- a/src/builtins/mips64/builtins-mips64.cc +++ b/src/builtins/mips64/builtins-mips64.cc @@ -872,7 +872,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ li(cp, Operand(context_address)); __ Ld(cp, MemOperand(cp)); diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc index f805818c81..ae5fa828a0 100644 --- a/src/builtins/ppc/builtins-ppc.cc +++ b/src/builtins/ppc/builtins-ppc.cc @@ -899,7 +899,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ mov(cp, Operand(context_address)); __ LoadP(cp, MemOperand(cp)); diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc index ce3679cca8..7534a3ea91 100644 --- a/src/builtins/s390/builtins-s390.cc +++ b/src/builtins/s390/builtins-s390.cc @@ -890,7 +890,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ mov(cp, Operand(context_address)); __ LoadP(cp, MemOperand(cp)); diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc index 1fee163899..191f297606 100644 --- a/src/builtins/x64/builtins-x64.cc +++ b/src/builtins/x64/builtins-x64.cc @@ -436,7 +436,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ movp(rsi, masm->ExternalOperand(context_address)); @@ -473,7 +473,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ movp(rsi, masm->ExternalOperand(context_address)); diff --git a/src/builtins/x87/builtins-x87.cc b/src/builtins/x87/builtins-x87.cc index fe73fcbb6f..f58e1c233f 100644 --- a/src/builtins/x87/builtins-x87.cc +++ b/src/builtins/x87/builtins-x87.cc @@ -310,7 +310,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, FrameScope scope(masm, StackFrame::INTERNAL); // Setup the context (we need to use the caller context from the isolate). - ExternalReference context_address(Isolate::kContextAddress, + ExternalReference context_address(IsolateAddressId::kContextAddress, masm->isolate()); __ mov(esi, Operand::StaticVariable(context_address)); diff --git a/src/counters-inl.h b/src/counters-inl.h index ce77806cdc..66e66bd517 100644 --- a/src/counters-inl.h +++ b/src/counters-inl.h @@ -7,6 +7,8 @@ #include "src/counters.h" +#include "src/isolate.h" + namespace v8 { namespace internal { diff --git a/src/counters.h b/src/counters.h index 2a13bf6a6d..ba6223ae5b 100644 --- a/src/counters.h +++ b/src/counters.h @@ -11,7 +11,6 @@ #include "src/base/platform/elapsed-timer.h" #include "src/base/platform/time.h" #include "src/globals.h" -#include "src/isolate.h" #include "src/objects.h" #include "src/runtime/runtime.h" #include "src/tracing/trace-event.h" diff --git a/src/elements.h b/src/elements.h index 5184b29765..b05e1020b8 100644 --- a/src/elements.h +++ b/src/elements.h @@ -6,7 +6,6 @@ #define V8_ELEMENTS_H_ #include "src/elements-kind.h" -#include "src/isolate.h" #include "src/keys.h" #include "src/objects.h" diff --git a/src/external-reference-table.cc b/src/external-reference-table.cc index b9f557910c..d6380c1d8f 100644 --- a/src/external-reference-table.cc +++ b/src/external-reference-table.cc @@ -408,8 +408,8 @@ void ExternalReferenceTable::AddIsolateAddresses(Isolate* isolate) { #undef BUILD_NAME_LITERAL }; - for (int i = 0; i < Isolate::kIsolateAddressCount; ++i) { - Add(isolate->get_address_from_id(static_cast(i)), + for (int i = 0; i < IsolateAddressId::kIsolateAddressCount; ++i) { + Add(isolate->get_address_from_id(static_cast(i)), address_names[i]); } } diff --git a/src/globals.h b/src/globals.h index 119ead5af9..0f848976bf 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1457,6 +1457,27 @@ inline std::ostream& operator<<(std::ostream& os, enum class ConcurrencyMode { kNotConcurrent, kConcurrent }; +#define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \ + C(Handler, handler) \ + C(CEntryFP, c_entry_fp) \ + C(CFunction, c_function) \ + C(Context, context) \ + C(PendingException, pending_exception) \ + C(PendingHandlerContext, pending_handler_context) \ + C(PendingHandlerCode, pending_handler_code) \ + C(PendingHandlerOffset, pending_handler_offset) \ + C(PendingHandlerFP, pending_handler_fp) \ + C(PendingHandlerSP, pending_handler_sp) \ + C(ExternalCaughtException, external_caught_exception) \ + C(JSEntrySP, js_entry_sp) + +enum IsolateAddressId { +#define DECLARE_ENUM(CamelName, hacker_name) k##CamelName##Address, + FOR_EACH_ISOLATE_ADDRESS_NAME(DECLARE_ENUM) +#undef DECLARE_ENUM + kIsolateAddressCount +}; + } // namespace internal } // namespace v8 diff --git a/src/heap/code-stats.h b/src/heap/code-stats.h index 499c9fa5ac..fa106d6435 100644 --- a/src/heap/code-stats.h +++ b/src/heap/code-stats.h @@ -2,14 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/assembler.h" -#include "src/heap/spaces.h" -#include "src/isolate.h" -#include "src/objects.h" - namespace v8 { namespace internal { +class Isolate; +class HeapObject; +class LargeObjectSpace; +class PagedSpace; +class RelocIterator; + class CodeStatistics { public: // Collect statistics related to code size. diff --git a/src/heap/gc-tracer.h b/src/heap/gc-tracer.h index da8c4965e2..6e3e875b94 100644 --- a/src/heap/gc-tracer.h +++ b/src/heap/gc-tracer.h @@ -10,6 +10,7 @@ #include "src/base/ring-buffer.h" #include "src/counters.h" #include "src/globals.h" +#include "src/heap/heap.h" #include "testing/gtest/include/gtest/gtest_prod.h" // nogncheck namespace v8 { diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index a4e3e8effa..27a36329ae 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -1056,7 +1056,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); Label okay; ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); __ cmp(edx, Operand::StaticVariable(pending_exception_address)); // Cannot use check here as it attempts to generate call into runtime. __ j(equal, &okay, Label::kNear); @@ -1073,15 +1073,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set eax to // contain the current pending exception, don't clobber it. @@ -1131,7 +1131,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Push marker in two places. StackFrame::Type marker = type(); __ push(Immediate(StackFrame::TypeToMarker(marker))); // marker - ExternalReference context_address(Isolate::kContextAddress, isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); __ push(Operand::StaticVariable(context_address)); // context // Save callee-saved registers (C calling conventions). __ push(edi); @@ -1139,11 +1140,11 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ push(ebx); // Save copies of the top frame descriptor on the stack. - ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate()); + ExternalReference c_entry_fp(IsolateAddressId::kCEntryFPAddress, isolate()); __ push(Operand::StaticVariable(c_entry_fp)); // If this is the outermost JS call, set js_entry_sp value. - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); __ cmp(Operand::StaticVariable(js_entry_sp), Immediate(0)); __ j(not_equal, ¬_outermost_js, Label::kNear); __ mov(Operand::StaticVariable(js_entry_sp), ebp); @@ -1159,8 +1160,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { handler_offset_ = handler_entry.pos(); // Caught exception: Store result (exception) in the pending exception // field in the JSEnv and return a failure sentinel. - ExternalReference pending_exception(Isolate::kPendingExceptionAddress, - isolate()); + ExternalReference pending_exception( + IsolateAddressId::kPendingExceptionAddress, isolate()); __ mov(Operand::StaticVariable(pending_exception), eax); __ mov(eax, Immediate(isolate()->factory()->exception())); __ jmp(&exit); @@ -1200,8 +1201,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ bind(¬_outermost_js_2); // Restore the top frame descriptor from the stack. - __ pop(Operand::StaticVariable(ExternalReference( - Isolate::kCEntryFPAddress, isolate()))); + __ pop(Operand::StaticVariable( + ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); // Restore callee-saved registers (C calling conventions). __ pop(ebx); diff --git a/src/ia32/deoptimizer-ia32.cc b/src/ia32/deoptimizer-ia32.cc index 1f6785352a..ec54e27575 100644 --- a/src/ia32/deoptimizer-ia32.cc +++ b/src/ia32/deoptimizer-ia32.cc @@ -213,7 +213,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { __ pushad(); - ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); + ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress, + isolate()); __ mov(Operand::StaticVariable(c_entry_fp_address), ebp); const int kSavedRegistersAreaSize = diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc index 885448bcf1..aa03cd072d 100644 --- a/src/ia32/macro-assembler-ia32.cc +++ b/src/ia32/macro-assembler-ia32.cc @@ -1005,9 +1005,12 @@ void MacroAssembler::EnterExitFramePrologue(StackFrame::Type frame_type) { push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot. // Save the frame pointer and the context in top. - ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); - ExternalReference context_address(Isolate::kContextAddress, isolate()); - ExternalReference c_function_address(Isolate::kCFunctionAddress, isolate()); + ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress, + isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); + ExternalReference c_function_address(IsolateAddressId::kCFunctionAddress, + isolate()); mov(Operand::StaticVariable(c_entry_fp_address), ebp); mov(Operand::StaticVariable(context_address), esi); mov(Operand::StaticVariable(c_function_address), ebx); @@ -1091,7 +1094,8 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { // Restore current context from top and clear it in debug mode. - ExternalReference context_address(Isolate::kContextAddress, isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); if (restore_context) { mov(esi, Operand::StaticVariable(context_address)); } @@ -1100,7 +1104,7 @@ void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { #endif // Clear the top frame. - ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, + ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress, isolate()); mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0)); } @@ -1120,7 +1124,8 @@ void MacroAssembler::PushStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); // Link the current handler as the next handler. - ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); + ExternalReference handler_address(IsolateAddressId::kHandlerAddress, + isolate()); push(Operand::StaticVariable(handler_address)); // Set this new handler as the current one. @@ -1130,7 +1135,8 @@ void MacroAssembler::PushStackHandler() { void MacroAssembler::PopStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); - ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); + ExternalReference handler_address(IsolateAddressId::kHandlerAddress, + isolate()); pop(Operand::StaticVariable(handler_address)); add(esp, Immediate(StackHandlerConstants::kSize - kPointerSize)); } diff --git a/src/isolate.cc b/src/isolate.cc index d84f1a1a03..ad8905ba09 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -197,8 +197,7 @@ void Isolate::InitializeOncePerProcess() { thread_data_table_ = new Isolate::ThreadDataTable(); } - -Address Isolate::get_address_from_id(Isolate::AddressId id) { +Address Isolate::get_address_from_id(IsolateAddressId id) { return isolate_addresses_[id]; } @@ -2676,7 +2675,7 @@ bool Isolate::Init(Deserializer* des) { heap_.SetStackLimits(); #define ASSIGN_ELEMENT(CamelName, hacker_name) \ - isolate_addresses_[Isolate::k##CamelName##Address] = \ + isolate_addresses_[IsolateAddressId::k##CamelName##Address] = \ reinterpret_cast
(hacker_name##_address()); FOR_EACH_ISOLATE_ADDRESS_NAME(ASSIGN_ELEMENT) #undef ASSIGN_ELEMENT diff --git a/src/isolate.h b/src/isolate.h index 66af826b5b..2923af3731 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -193,20 +193,6 @@ class CompilationManager; RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle()) -#define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \ - C(Handler, handler) \ - C(CEntryFP, c_entry_fp) \ - C(CFunction, c_function) \ - C(Context, context) \ - C(PendingException, pending_exception) \ - C(PendingHandlerContext, pending_handler_context) \ - C(PendingHandlerCode, pending_handler_code) \ - C(PendingHandlerOffset, pending_handler_offset) \ - C(PendingHandlerFP, pending_handler_fp) \ - C(PendingHandlerSP, pending_handler_sp) \ - C(ExternalCaughtException, external_caught_exception) \ - C(JSEntrySP, js_entry_sp) - #define FOR_WITH_HANDLE_SCOPE(isolate, loop_var_type, init, loop_var, \ limit_check, increment, body) \ do { \ @@ -508,14 +494,6 @@ class Isolate { DISALLOW_COPY_AND_ASSIGN(PerIsolateThreadData); }; - - enum AddressId { -#define DECLARE_ENUM(CamelName, hacker_name) k##CamelName##Address, - FOR_EACH_ISOLATE_ADDRESS_NAME(DECLARE_ENUM) -#undef DECLARE_ENUM - kIsolateAddressCount - }; - static void InitializeOncePerProcess(); // Returns the PerIsolateThreadData for the current thread (or NULL if one is @@ -587,7 +565,7 @@ class Isolate { // Mutex for serializing access to break control structures. base::RecursiveMutex* break_access() { return &break_access_; } - Address get_address_from_id(AddressId id); + Address get_address_from_id(IsolateAddressId id); // Access to top context (where the current function object was created). Context* context() { return thread_local_top_.context_; } diff --git a/src/keys.h b/src/keys.h index c5ac93c098..0db12d96ba 100644 --- a/src/keys.h +++ b/src/keys.h @@ -5,8 +5,8 @@ #ifndef V8_KEYS_H_ #define V8_KEYS_H_ -#include "src/isolate.h" #include "src/objects.h" +#include "src/objects/hash-table.h" namespace v8 { namespace internal { diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 9c48cba2b1..84d1d132c8 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -1029,7 +1029,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { if (FLAG_debug_code) { Label okay; ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); __ li(a2, Operand(pending_exception_address)); __ lw(a2, MemOperand(a2)); __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); @@ -1057,15 +1057,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set v0 to // contain the current pending exception, don't clobber it. @@ -1142,7 +1142,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { StackFrame::Type marker = type(); __ li(t2, Operand(StackFrame::TypeToMarker(marker))); __ li(t1, Operand(StackFrame::TypeToMarker(marker))); - __ li(t0, Operand(ExternalReference(Isolate::kCEntryFPAddress, + __ li(t0, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate))); __ lw(t0, MemOperand(t0)); __ Push(t3, t2, t1, t0); @@ -1167,7 +1167,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // If this is the outermost JS call, set js_entry_sp value. Label non_outermost_js; - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate); __ li(t1, Operand(ExternalReference(js_entry_sp))); __ lw(t2, MemOperand(t1)); __ Branch(&non_outermost_js, ne, t2, Operand(zero_reg)); @@ -1190,8 +1190,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // field in the JSEnv and return a failure sentinel. Coming in here the // fp will be invalid because the PushStackHandler below sets it to 0 to // signal the existence of the JSEntry frame. - __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress, - isolate))); + __ li(t0, Operand(ExternalReference( + IsolateAddressId::kPendingExceptionAddress, isolate))); __ sw(v0, MemOperand(t0)); // We come back from 'invoke'. result is in v0. __ LoadRoot(v0, Heap::kExceptionRootIndex); __ b(&exit); // b exposes branch delay slot. @@ -1251,7 +1251,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Restore the top frame descriptors from the stack. __ pop(t1); - __ li(t0, Operand(ExternalReference(Isolate::kCEntryFPAddress, + __ li(t0, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate))); __ sw(t1, MemOperand(t0)); diff --git a/src/mips/deoptimizer-mips.cc b/src/mips/deoptimizer-mips.cc index 0c2d2c7544..b024f7813f 100644 --- a/src/mips/deoptimizer-mips.cc +++ b/src/mips/deoptimizer-mips.cc @@ -140,7 +140,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { } } - __ li(a2, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ li(a2, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ sw(fp, MemOperand(a2)); const int kSavedRegistersAreaSize = diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 9758e6d81c..e580d6210c 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -4181,7 +4181,8 @@ void MacroAssembler::PushStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); // Link the current handler as the next handler. - li(t2, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + li(t2, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); lw(t1, MemOperand(t2)); push(t1); @@ -4194,7 +4195,8 @@ void MacroAssembler::PopStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); pop(a1); Addu(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); - li(at, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + li(at, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); sw(a1, MemOperand(at)); } @@ -5644,9 +5646,11 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, sw(t8, MemOperand(fp, ExitFrameConstants::kCodeOffset)); // Save the frame pointer and the context in top. - li(t8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); sw(fp, MemOperand(t8)); - li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); sw(cp, MemOperand(t8)); const int frame_alignment = MacroAssembler::ActivationFrameAlignment(); @@ -5697,16 +5701,19 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, } // Clear top frame. - li(t8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); sw(zero_reg, MemOperand(t8)); // Restore current context from top and clear it in debug mode. if (restore_context) { - li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + li(t8, Operand(ExternalReference(IsolateAddressId::kContextAddress, + isolate()))); lw(cp, MemOperand(t8)); } #ifdef DEBUG - li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); sw(a3, MemOperand(t8)); #endif diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc index 26f5f4b6f5..0173ba7563 100644 --- a/src/mips64/code-stubs-mips64.cc +++ b/src/mips64/code-stubs-mips64.cc @@ -1026,7 +1026,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { if (FLAG_debug_code) { Label okay; ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); __ li(a2, Operand(pending_exception_address)); __ Ld(a2, MemOperand(a2)); __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); @@ -1054,15 +1054,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set v0 to // contain the current pending exception, don't clobber it. @@ -1139,7 +1139,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { StackFrame::Type marker = type(); __ li(a6, Operand(StackFrame::TypeToMarker(marker))); __ li(a5, Operand(StackFrame::TypeToMarker(marker))); - ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate); + ExternalReference c_entry_fp(IsolateAddressId::kCEntryFPAddress, isolate); __ li(a4, Operand(c_entry_fp)); __ Ld(a4, MemOperand(a4)); __ Push(a7, a6, a5, a4); @@ -1164,7 +1164,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // If this is the outermost JS call, set js_entry_sp value. Label non_outermost_js; - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate); __ li(a5, Operand(ExternalReference(js_entry_sp))); __ Ld(a6, MemOperand(a5)); __ Branch(&non_outermost_js, ne, a6, Operand(zero_reg)); @@ -1187,8 +1187,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // field in the JSEnv and return a failure sentinel. Coming in here the // fp will be invalid because the PushStackHandler below sets it to 0 to // signal the existence of the JSEntry frame. - __ li(a4, Operand(ExternalReference(Isolate::kPendingExceptionAddress, - isolate))); + __ li(a4, Operand(ExternalReference( + IsolateAddressId::kPendingExceptionAddress, isolate))); __ Sd(v0, MemOperand(a4)); // We come back from 'invoke'. result is in v0. __ LoadRoot(v0, Heap::kExceptionRootIndex); __ b(&exit); // b exposes branch delay slot. @@ -1248,7 +1248,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Restore the top frame descriptors from the stack. __ pop(a5); - __ li(a4, Operand(ExternalReference(Isolate::kCEntryFPAddress, + __ li(a4, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate))); __ Sd(a5, MemOperand(a4)); diff --git a/src/mips64/deoptimizer-mips64.cc b/src/mips64/deoptimizer-mips64.cc index 804a176bce..7cdfb47964 100644 --- a/src/mips64/deoptimizer-mips64.cc +++ b/src/mips64/deoptimizer-mips64.cc @@ -141,7 +141,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { } } - __ li(a2, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ li(a2, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ Sd(fp, MemOperand(a2)); const int kSavedRegistersAreaSize = diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc index 3163bbeb90..59e7f21dd8 100644 --- a/src/mips64/macro-assembler-mips64.cc +++ b/src/mips64/macro-assembler-mips64.cc @@ -4514,7 +4514,8 @@ void MacroAssembler::PushStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); // Link the current handler as the next handler. - li(a6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + li(a6, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); Ld(a5, MemOperand(a6)); push(a5); @@ -4528,7 +4529,8 @@ void MacroAssembler::PopStackHandler() { pop(a1); Daddu(sp, sp, Operand(static_cast(StackHandlerConstants::kSize - kPointerSize))); - li(at, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + li(at, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); Sd(a1, MemOperand(at)); } @@ -6167,9 +6169,11 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, Sd(t8, MemOperand(fp, ExitFrameConstants::kCodeOffset)); // Save the frame pointer and the context in top. - li(t8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); Sd(fp, MemOperand(t8)); - li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); Sd(cp, MemOperand(t8)); const int frame_alignment = MacroAssembler::ActivationFrameAlignment(); @@ -6218,16 +6222,19 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, } // Clear top frame. - li(t8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); Sd(zero_reg, MemOperand(t8)); // Restore current context from top and clear it in debug mode. if (restore_context) { - li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + li(t8, Operand(ExternalReference(IsolateAddressId::kContextAddress, + isolate()))); Ld(cp, MemOperand(t8)); } #ifdef DEBUG - li(t8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + li(t8, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); Sd(a3, MemOperand(t8)); #endif diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc index 0fe2223bab..b1cac3d17c 100644 --- a/src/ppc/code-stubs-ppc.cc +++ b/src/ppc/code-stubs-ppc.cc @@ -975,7 +975,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { if (FLAG_debug_code) { Label okay; ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); __ mov(r6, Operand(pending_exception_address)); __ LoadP(r6, MemOperand(r6)); @@ -1005,15 +1005,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set r3 to // contain the current pending exception, don't clobber it. @@ -1103,7 +1103,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ push(r0); __ push(r0); // Save copies of the top frame descriptor on the stack. - __ mov(r8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(r8, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ LoadP(r0, MemOperand(r8)); __ push(r0); @@ -1112,7 +1113,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // If this is the outermost JS call, set js_entry_sp value. Label non_outermost_js; - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); __ mov(r8, Operand(ExternalReference(js_entry_sp))); __ LoadP(r9, MemOperand(r8)); __ cmpi(r9, Operand::Zero()); @@ -1136,8 +1137,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // field in the JSEnv and return a failure sentinel. Coming in here the // fp will be invalid because the PushStackHandler below sets it to 0 to // signal the existence of the JSEntry frame. - __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, - isolate()))); + __ mov(ip, Operand(ExternalReference( + IsolateAddressId::kPendingExceptionAddress, isolate()))); __ StoreP(r3, MemOperand(ip)); __ LoadRoot(r3, Heap::kExceptionRootIndex); @@ -1194,7 +1195,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Restore the top frame descriptors from the stack. __ pop(r6); - __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ StoreP(r6, MemOperand(ip)); // Reset the stack to the callee saved registers. diff --git a/src/ppc/deoptimizer-ppc.cc b/src/ppc/deoptimizer-ppc.cc index 142b398b43..0d57dcbdc2 100644 --- a/src/ppc/deoptimizer-ppc.cc +++ b/src/ppc/deoptimizer-ppc.cc @@ -147,7 +147,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { } } - __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ StoreP(fp, MemOperand(ip)); const int kSavedRegistersAreaSize = diff --git a/src/ppc/macro-assembler-ppc.cc b/src/ppc/macro-assembler-ppc.cc index 1d4025f26b..4c080572a3 100644 --- a/src/ppc/macro-assembler-ppc.cc +++ b/src/ppc/macro-assembler-ppc.cc @@ -1163,9 +1163,11 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, StoreP(r8, MemOperand(fp, ExitFrameConstants::kCodeOffset)); // Save the frame pointer and the context in top. - mov(r8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + mov(r8, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); StoreP(fp, MemOperand(r8)); - mov(r8, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(r8, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); StoreP(cp, MemOperand(r8)); // Optionally save all volatile double registers. @@ -1228,16 +1230,19 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, // Clear top frame. li(r6, Operand::Zero()); - mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); StoreP(r6, MemOperand(ip)); // Restore current context from top and clear it in debug mode. if (restore_context) { - mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(ip, Operand(ExternalReference(IsolateAddressId::kContextAddress, + isolate()))); LoadP(cp, MemOperand(ip)); } #ifdef DEBUG - mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(ip, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); StoreP(r6, MemOperand(ip)); #endif @@ -1562,7 +1567,8 @@ void MacroAssembler::PushStackHandler() { // Link the current handler as the next handler. // Preserve r3-r7. - mov(r8, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + mov(r8, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); LoadP(r0, MemOperand(r8)); push(r0); @@ -1576,7 +1582,8 @@ void MacroAssembler::PopStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); pop(r4); - mov(ip, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + mov(ip, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); StoreP(r4, MemOperand(ip)); } diff --git a/src/property.h b/src/property.h index ab183d9e9f..5c744a1bd7 100644 --- a/src/property.h +++ b/src/property.h @@ -8,7 +8,6 @@ #include #include "src/factory.h" -#include "src/isolate.h" namespace v8 { namespace internal { diff --git a/src/s390/code-stubs-s390.cc b/src/s390/code-stubs-s390.cc index ae0e39f13a..a1b12953c8 100644 --- a/src/s390/code-stubs-s390.cc +++ b/src/s390/code-stubs-s390.cc @@ -935,7 +935,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { if (FLAG_debug_code) { Label okay; ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); __ mov(r1, Operand(pending_exception_address)); __ LoadP(r1, MemOperand(r1)); __ CompareRoot(r1, Heap::kTheHoleValueRootIndex); @@ -964,15 +964,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set r3 to // contain the current pending exception, don't clobber it. @@ -1074,7 +1074,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ Load(r9, Operand(StackFrame::TypeToMarker(marker))); __ Load(r8, Operand(StackFrame::TypeToMarker(marker))); // Save copies of the top frame descriptor on the stack. - __ mov(r7, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(r7, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ LoadP(r7, MemOperand(r7)); __ StoreMultipleP(r7, r10, MemOperand(sp, kPointerSize)); // Set up frame pointer for the frame to be pushed. @@ -1085,7 +1086,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // If this is the outermost JS call, set js_entry_sp value. Label non_outermost_js; - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); __ mov(r7, Operand(ExternalReference(js_entry_sp))); __ LoadAndTestP(r8, MemOperand(r7)); __ bne(&non_outermost_js, Label::kNear); @@ -1109,8 +1110,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // field in the JSEnv and return a failure sentinel. Coming in here the // fp will be invalid because the PushStackHandler below sets it to 0 to // signal the existence of the JSEntry frame. - __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, - isolate()))); + __ mov(ip, Operand(ExternalReference( + IsolateAddressId::kPendingExceptionAddress, isolate()))); __ StoreP(r2, MemOperand(ip)); __ LoadRoot(r2, Heap::kExceptionRootIndex); @@ -1170,7 +1171,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Restore the top frame descriptors from the stack. __ pop(r5); - __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ StoreP(r5, MemOperand(ip)); // Reset the stack to the callee saved registers. diff --git a/src/s390/deoptimizer-s390.cc b/src/s390/deoptimizer-s390.cc index a0ca01849e..62942ed5fb 100644 --- a/src/s390/deoptimizer-s390.cc +++ b/src/s390/deoptimizer-s390.cc @@ -134,7 +134,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { __ lay(sp, MemOperand(sp, -kNumberOfRegisters * kPointerSize)); __ StoreMultipleP(r0, sp, MemOperand(sp)); // Save all 16 registers - __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); __ StoreP(fp, MemOperand(ip)); const int kSavedRegistersAreaSize = diff --git a/src/s390/macro-assembler-s390.cc b/src/s390/macro-assembler-s390.cc index 18d51046f2..cbb24c515a 100644 --- a/src/s390/macro-assembler-s390.cc +++ b/src/s390/macro-assembler-s390.cc @@ -1084,9 +1084,11 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, StoreP(r1, MemOperand(fp, ExitFrameConstants::kCodeOffset)); // Save the frame pointer and the context in top. - mov(r1, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + mov(r1, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); StoreP(fp, MemOperand(r1)); - mov(r1, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(r1, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); StoreP(cp, MemOperand(r1)); // Optionally save all volatile double registers. @@ -1145,16 +1147,19 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, } // Clear top frame. - mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); + mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, + isolate()))); StoreP(MemOperand(ip), Operand(0, kRelocInfo_NONEPTR), r0); // Restore current context from top and clear it in debug mode. if (restore_context) { - mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(ip, Operand(ExternalReference(IsolateAddressId::kContextAddress, + isolate()))); LoadP(cp, MemOperand(ip)); } #ifdef DEBUG - mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); + mov(ip, + Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); StoreP(MemOperand(ip), Operand(0, kRelocInfo_NONEPTR), r0); #endif @@ -1473,7 +1478,8 @@ void MacroAssembler::PushStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); // Link the current handler as the next handler. - mov(r7, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + mov(r7, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); // Buy the full stack frame for 5 slots. lay(sp, MemOperand(sp, -StackHandlerConstants::kSize)); @@ -1491,7 +1497,8 @@ void MacroAssembler::PopStackHandler() { // Pop the Next Handler into r3 and store it into Handler Address reference. Pop(r3); - mov(ip, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); + mov(ip, + Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); StoreP(r3, MemOperand(ip)); } diff --git a/src/transitions.h b/src/transitions.h index 3c07759ff3..62a8933c5e 100644 --- a/src/transitions.h +++ b/src/transitions.h @@ -7,7 +7,6 @@ #include "src/checks.h" #include "src/elements-kind.h" -#include "src/isolate.h" #include "src/objects.h" #include "src/objects/descriptor-array.h" #include "src/objects/map.h" diff --git a/src/vm-state.h b/src/vm-state.h index 29cbf39593..38852e5571 100644 --- a/src/vm-state.h +++ b/src/vm-state.h @@ -7,7 +7,6 @@ #include "src/allocation.h" #include "src/counters.h" -#include "src/isolate.h" namespace v8 { namespace internal { diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index a1e408de3f..36f3477eb5 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -957,7 +957,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { Label okay; __ LoadRoot(r14, Heap::kTheHoleValueRootIndex); ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); Operand pending_exception_operand = masm->ExternalOperand(pending_exception_address); __ cmpp(r14, pending_exception_operand); @@ -974,15 +974,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set rax to // contain the current pending exception, don't clobber it. @@ -1032,7 +1032,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Push the stack frame type. __ Push(Immediate(StackFrame::TypeToMarker(type()))); // context slot - ExternalReference context_address(Isolate::kContextAddress, isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); __ Load(kScratchRegister, context_address); __ Push(kScratchRegister); // context // Save callee-saved registers (X64/X32/Win64 calling conventions). @@ -1067,14 +1068,14 @@ void JSEntryStub::Generate(MacroAssembler* masm) { } // Save copies of the top frame descriptor on the stack. - ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate()); + ExternalReference c_entry_fp(IsolateAddressId::kCEntryFPAddress, isolate()); { Operand c_entry_fp_operand = masm->ExternalOperand(c_entry_fp); __ Push(c_entry_fp_operand); } // If this is the outermost JS call, set js_entry_sp value. - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); __ Load(rax, js_entry_sp); __ testp(rax, rax); __ j(not_zero, ¬_outermost_js); @@ -1094,8 +1095,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { handler_offset_ = handler_entry.pos(); // Caught exception: Store result (exception) in the pending exception // field in the JSEnv and return a failure sentinel. - ExternalReference pending_exception(Isolate::kPendingExceptionAddress, - isolate()); + ExternalReference pending_exception( + IsolateAddressId::kPendingExceptionAddress, isolate()); __ Store(pending_exception, rax); __ LoadRoot(rax, Heap::kExceptionRootIndex); __ jmp(&exit); diff --git a/src/x64/deoptimizer-x64.cc b/src/x64/deoptimizer-x64.cc index 611a3c6c21..78a2ed8e16 100644 --- a/src/x64/deoptimizer-x64.cc +++ b/src/x64/deoptimizer-x64.cc @@ -142,7 +142,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { const int kSavedRegistersAreaSize = kNumberOfRegisters * kRegisterSize + kDoubleRegsSize + kFloatRegsSize; - __ Store(ExternalReference(Isolate::kCEntryFPAddress, isolate()), rbp); + __ Store(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()), + rbp); // We use this to keep the value of the fifth argument temporarily. // Unfortunately we can't store it directly in r8 (used for passing diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index a67609339f..2f0f9b8e3a 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -3435,7 +3435,8 @@ void MacroAssembler::PushStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); // Link the current handler as the next handler. - ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); + ExternalReference handler_address(IsolateAddressId::kHandlerAddress, + isolate()); Push(ExternalOperand(handler_address)); // Set this new handler as the current one. @@ -3445,7 +3446,8 @@ void MacroAssembler::PushStackHandler() { void MacroAssembler::PopStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); - ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); + ExternalReference handler_address(IsolateAddressId::kHandlerAddress, + isolate()); Pop(ExternalOperand(handler_address)); addp(rsp, Immediate(StackHandlerConstants::kSize - kPointerSize)); } @@ -4203,9 +4205,9 @@ void MacroAssembler::EnterExitFramePrologue(bool save_rax, movp(r14, rax); // Backup rax in callee-save register. } - Store(ExternalReference(Isolate::kCEntryFPAddress, isolate()), rbp); - Store(ExternalReference(Isolate::kContextAddress, isolate()), rsi); - Store(ExternalReference(Isolate::kCFunctionAddress, isolate()), rbx); + Store(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()), rbp); + Store(ExternalReference(IsolateAddressId::kContextAddress, isolate()), rsi); + Store(ExternalReference(IsolateAddressId::kCFunctionAddress, isolate()), rbx); } @@ -4304,7 +4306,8 @@ void MacroAssembler::LeaveApiExitFrame(bool restore_context) { void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { // Restore current context from top and clear it in debug mode. - ExternalReference context_address(Isolate::kContextAddress, isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); Operand context_operand = ExternalOperand(context_address); if (restore_context) { movp(rsi, context_operand); @@ -4314,7 +4317,7 @@ void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { #endif // Clear the top frame. - ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, + ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress, isolate()); Operand c_entry_fp_operand = ExternalOperand(c_entry_fp_address); movp(c_entry_fp_operand, Immediate(0)); diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc index e374810e6e..f6624794c0 100644 --- a/src/x87/code-stubs-x87.cc +++ b/src/x87/code-stubs-x87.cc @@ -1094,7 +1094,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); Label okay; ExternalReference pending_exception_address( - Isolate::kPendingExceptionAddress, isolate()); + IsolateAddressId::kPendingExceptionAddress, isolate()); __ cmp(edx, Operand::StaticVariable(pending_exception_address)); // Cannot use check here as it attempts to generate call into runtime. __ j(equal, &okay, Label::kNear); @@ -1111,15 +1111,15 @@ void CEntryStub::Generate(MacroAssembler* masm) { __ bind(&exception_returned); ExternalReference pending_handler_context_address( - Isolate::kPendingHandlerContextAddress, isolate()); + IsolateAddressId::kPendingHandlerContextAddress, isolate()); ExternalReference pending_handler_code_address( - Isolate::kPendingHandlerCodeAddress, isolate()); + IsolateAddressId::kPendingHandlerCodeAddress, isolate()); ExternalReference pending_handler_offset_address( - Isolate::kPendingHandlerOffsetAddress, isolate()); + IsolateAddressId::kPendingHandlerOffsetAddress, isolate()); ExternalReference pending_handler_fp_address( - Isolate::kPendingHandlerFPAddress, isolate()); + IsolateAddressId::kPendingHandlerFPAddress, isolate()); ExternalReference pending_handler_sp_address( - Isolate::kPendingHandlerSPAddress, isolate()); + IsolateAddressId::kPendingHandlerSPAddress, isolate()); // Ask the runtime for help to determine the handler. This will set eax to // contain the current pending exception, don't clobber it. @@ -1179,7 +1179,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Push marker in two places. int marker = type(); __ push(Immediate(Smi::FromInt(marker))); // marker - ExternalReference context_address(Isolate::kContextAddress, isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); __ push(Operand::StaticVariable(context_address)); // context // Save callee-saved registers (C calling conventions). __ push(edi); @@ -1187,11 +1188,11 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ push(ebx); // Save copies of the top frame descriptor on the stack. - ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate()); + ExternalReference c_entry_fp(IsolateAddressId::kCEntryFPAddress, isolate()); __ push(Operand::StaticVariable(c_entry_fp)); // If this is the outermost JS call, set js_entry_sp value. - ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); __ cmp(Operand::StaticVariable(js_entry_sp), Immediate(0)); __ j(not_equal, ¬_outermost_js, Label::kNear); __ mov(Operand::StaticVariable(js_entry_sp), ebp); @@ -1207,8 +1208,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { handler_offset_ = handler_entry.pos(); // Caught exception: Store result (exception) in the pending exception // field in the JSEnv and return a failure sentinel. - ExternalReference pending_exception(Isolate::kPendingExceptionAddress, - isolate()); + ExternalReference pending_exception( + IsolateAddressId::kPendingExceptionAddress, isolate()); __ mov(Operand::StaticVariable(pending_exception), eax); __ mov(eax, Immediate(isolate()->factory()->exception())); __ jmp(&exit); @@ -1248,8 +1249,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ bind(¬_outermost_js_2); // Restore the top frame descriptor from the stack. - __ pop(Operand::StaticVariable(ExternalReference( - Isolate::kCEntryFPAddress, isolate()))); + __ pop(Operand::StaticVariable( + ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()))); // Restore callee-saved registers (C calling conventions). __ pop(ebx); diff --git a/src/x87/deoptimizer-x87.cc b/src/x87/deoptimizer-x87.cc index a198284da5..db97d8d3f4 100644 --- a/src/x87/deoptimizer-x87.cc +++ b/src/x87/deoptimizer-x87.cc @@ -198,7 +198,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { __ pushad(); - ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); + ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress, + isolate()); __ mov(Operand::StaticVariable(c_entry_fp_address), ebp); // GP registers are safe to use now. diff --git a/src/x87/macro-assembler-x87.cc b/src/x87/macro-assembler-x87.cc index 67aa6b1104..9e84d934ca 100644 --- a/src/x87/macro-assembler-x87.cc +++ b/src/x87/macro-assembler-x87.cc @@ -919,9 +919,12 @@ void MacroAssembler::EnterExitFramePrologue(StackFrame::Type frame_type) { push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot. // Save the frame pointer and the context in top. - ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); - ExternalReference context_address(Isolate::kContextAddress, isolate()); - ExternalReference c_function_address(Isolate::kCFunctionAddress, isolate()); + ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress, + isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); + ExternalReference c_function_address(IsolateAddressId::kCFunctionAddress, + isolate()); mov(Operand::StaticVariable(c_entry_fp_address), ebp); mov(Operand::StaticVariable(context_address), esi); mov(Operand::StaticVariable(c_function_address), ebx); @@ -999,7 +1002,8 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { // Restore current context from top and clear it in debug mode. - ExternalReference context_address(Isolate::kContextAddress, isolate()); + ExternalReference context_address(IsolateAddressId::kContextAddress, + isolate()); if (restore_context) { mov(esi, Operand::StaticVariable(context_address)); } @@ -1008,7 +1012,7 @@ void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { #endif // Clear the top frame. - ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, + ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress, isolate()); mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0)); } @@ -1028,7 +1032,8 @@ void MacroAssembler::PushStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); // Link the current handler as the next handler. - ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); + ExternalReference handler_address(IsolateAddressId::kHandlerAddress, + isolate()); push(Operand::StaticVariable(handler_address)); // Set this new handler as the current one. @@ -1038,7 +1043,8 @@ void MacroAssembler::PushStackHandler() { void MacroAssembler::PopStackHandler() { STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); - ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); + ExternalReference handler_address(IsolateAddressId::kHandlerAddress, + isolate()); pop(Operand::StaticVariable(handler_address)); add(esp, Immediate(StackHandlerConstants::kSize - kPointerSize)); }