From: mvstanton@chromium.org Date: Mon, 23 Jun 2014 13:42:12 +0000 (+0000) Subject: Create a RegisterSpec class inside of the IC that provides: X-Git-Tag: upstream/4.7.83~8599 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3f84877261aad1ee8c85bbd546fa34cb5bc7f06;p=platform%2Fupstream%2Fv8.git Create a RegisterSpec class inside of the IC that provides: 1) symbolic names for the register (like, edx == receiver) 2) can return an array of registers 3) defines ordering when passed on the stack Code that implements or uses the IC should use this RegisterSpec instead of "knowing" what the registers are. Or at least have the RegisterSpec to validate it's assumptions. R=jkummerow@chromium.org Review URL: https://codereview.chromium.org/340363002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21939 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 033413b..2339a60 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -88,26 +88,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor( } -void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { r1, r0 }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - -void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { r1, r0 }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - void RegExpConstructResultStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { r2, r1, r0 }; @@ -118,16 +98,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor( } -void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { r1, r0 }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; -} - - void LoadFieldStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { r0 }; diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc index 1028f8f..3596bfb 100644 --- a/src/arm/ic-arm.cc +++ b/src/arm/ic-arm.cc @@ -545,6 +545,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { } +// IC register specifications +Register LoadIC::kReceiverRegister = r0; +Register LoadIC::kNameRegister = r2; +const Register LoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + +Register KeyedLoadIC::kReceiverRegister = r1; +Register KeyedLoadIC::kNameRegister = r0; +const Register KeyedLoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // ---------- S t a t e -------------- // -- lr : return address diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index 23ee05d..5372b06 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -1263,14 +1263,18 @@ Handle LoadStubCompiler::CompileLoadNonexistent(Handle type, Register* LoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { r0, r2, r3, r1, r4, r5 }; + Register receiver = LoadIC::kReceiverRegister; + Register name = LoadIC::kNameRegister; + static Register registers[] = { receiver, name, r3, r1, r4, r5 }; return registers; } Register* KeyedLoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { r1, r0, r2, r3, r4, r5 }; + Register receiver = KeyedLoadIC::kReceiverRegister; + Register name = KeyedLoadIC::kNameRegister; + static Register registers[] = { receiver, name, r2, r3, r4, r5 }; return registers; } diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc index 70ead44..decf0b0 100644 --- a/src/arm64/code-stubs-arm64.cc +++ b/src/arm64/code-stubs-arm64.cc @@ -101,40 +101,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor( } -void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { x1, x0 }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; -} - - -void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - // x1: receiver - // x0: key - static Register registers[] = { x1, x0 }; - descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - -void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - // x1: receiver - // x0: key - static Register registers[] = { x1, x0 }; - descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - void RegExpConstructResultStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { // x2: length diff --git a/src/arm64/ic-arm64.cc b/src/arm64/ic-arm64.cc index 842b3e7..62a0771 100644 --- a/src/arm64/ic-arm64.cc +++ b/src/arm64/ic-arm64.cc @@ -582,6 +582,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { } +// IC register specifications +Register LoadIC::kReceiverRegister = x0; +Register LoadIC::kNameRegister = x2; +const Register LoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + +Register KeyedLoadIC::kReceiverRegister = x1; +Register KeyedLoadIC::kNameRegister = x0; +const Register KeyedLoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // ---------- S t a t e -------------- // -- lr : return address diff --git a/src/arm64/stub-cache-arm64.cc b/src/arm64/stub-cache-arm64.cc index 9311645..0088a4d 100644 --- a/src/arm64/stub-cache-arm64.cc +++ b/src/arm64/stub-cache-arm64.cc @@ -1245,14 +1245,18 @@ Handle LoadStubCompiler::CompileLoadNonexistent(Handle type, Register* LoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { x0, x2, x3, x1, x4, x5 }; + Register receiver = LoadIC::kReceiverRegister; + Register name = LoadIC::kNameRegister; + static Register registers[] = { receiver, name, x3, x1, x4, x5 }; return registers; } Register* KeyedLoadStubCompiler::registers() { - // receiver, name/key, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { x1, x0, x2, x3, x4, x5 }; + // receiver, name, scratch1, scratch2, scratch3, scratch4. + Register receiver = KeyedLoadIC::kReceiverRegister; + Register name = KeyedLoadIC::kNameRegister; + static Register registers[] = { receiver, name, x2, x3, x4, x5 }; return registers; } diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc index 8342f9f..e3c8c14 100644 --- a/src/code-stubs-hydrogen.cc +++ b/src/code-stubs-hydrogen.cc @@ -539,9 +539,14 @@ Handle CreateAllocationSiteStub::GenerateCode() { template <> HValue* CodeStubGraphBuilder::BuildCodeStub() { HInstruction* load = BuildUncheckedMonomorphicElementAccess( - GetParameter(0), GetParameter(1), NULL, - casted_stub()->is_js_array(), casted_stub()->elements_kind(), - LOAD, NEVER_RETURN_HOLE, STANDARD_STORE); + GetParameter(KeyedLoadIC::kReceiverIndex), + GetParameter(KeyedLoadIC::kNameIndex), + NULL, + casted_stub()->is_js_array(), + casted_stub()->elements_kind(), + LOAD, + NEVER_RETURN_HOLE, + STANDARD_STORE); return load; } @@ -1371,8 +1376,8 @@ Handle FastNewContextStub::GenerateCode() { template<> HValue* CodeStubGraphBuilder::BuildCodeStub() { - HValue* receiver = GetParameter(0); - HValue* key = GetParameter(1); + HValue* receiver = GetParameter(KeyedLoadIC::kReceiverIndex); + HValue* key = GetParameter(KeyedLoadIC::kNameIndex); Add(key); @@ -1504,8 +1509,8 @@ void CodeStubGraphBuilder< HValue* CodeStubGraphBuilder::BuildCodeStub() { - HValue* receiver = GetParameter(0); - HValue* key = GetParameter(1); + HValue* receiver = GetParameter(KeyedLoadIC::kReceiverIndex); + HValue* key = GetParameter(KeyedLoadIC::kNameIndex); // Split into a smi/integer case and unique string case. HIfContinuation index_name_split_continuation(graph()->CreateBasicBlock(), diff --git a/src/code-stubs.cc b/src/code-stubs.cc index f61035e..4687fd8 100644 --- a/src/code-stubs.cc +++ b/src/code-stubs.cc @@ -512,6 +512,33 @@ void JSEntryStub::FinishCode(Handle code) { } +void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( + CodeStubInterfaceDescriptor* descriptor) { + descriptor->register_param_count_ = KeyedLoadIC::kRegisterArgumentCount; + descriptor->register_params_ = KeyedLoadIC::registers; + descriptor->deoptimization_handler_ = + FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); +} + + +void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( + CodeStubInterfaceDescriptor* descriptor) { + descriptor->register_param_count_ = KeyedLoadIC::kRegisterArgumentCount; + descriptor->register_params_ = KeyedLoadIC::registers; + descriptor->deoptimization_handler_ = + FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); +} + + +void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( + CodeStubInterfaceDescriptor* descriptor) { + descriptor->register_param_count_ = KeyedLoadIC::kRegisterArgumentCount; + descriptor->register_params_ = KeyedLoadIC::registers; + descriptor->deoptimization_handler_ = + Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; +} + + void KeyedLoadDictionaryElementPlatformStub::Generate( MacroAssembler* masm) { KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); diff --git a/src/code-stubs.h b/src/code-stubs.h index b243b56..f3dd049 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -275,7 +275,7 @@ struct CodeStubInterfaceDescriptor { // return sequence. Default value is -1, which means it is ignored. int hint_stack_parameter_count_; StubFunctionMode function_mode_; - Register* register_params_; + const Register* register_params_; // Specifies Representations for the stub's parameter. Points to an array of // Representations of the same length of the numbers of parameters to the // stub, or if NULL (the default value), Representation of each parameter diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index 9a6719b..e95e9c0 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -93,26 +93,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor( } -void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { edx, ecx }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - -void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { edx, ecx }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - void RegExpConstructResultStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { ecx, ebx, eax }; @@ -123,16 +103,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor( } -void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { edx, ecx }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; -} - - void LoadFieldStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { edx }; diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc index b0e4ca0..c36e6a4 100644 --- a/src/ia32/ic-ia32.cc +++ b/src/ia32/ic-ia32.cc @@ -1025,6 +1025,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { } +// IC register specifications +Register LoadIC::kReceiverRegister = edx; +Register LoadIC::kNameRegister = ecx; +const Register LoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + +Register KeyedLoadIC::kReceiverRegister = LoadIC::kReceiverRegister; +Register KeyedLoadIC::kNameRegister = LoadIC::kNameRegister; +const Register KeyedLoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // ----------- S t a t e ------------- // -- ecx : key diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index e70e5a2..6590488 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -1283,14 +1283,18 @@ Handle LoadStubCompiler::CompileLoadNonexistent(Handle type, Register* LoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg }; + Register receiver = LoadIC::kReceiverRegister; + Register name = LoadIC::kNameRegister; + static Register registers[] = { receiver, name, ebx, eax, edi, no_reg }; return registers; } Register* KeyedLoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg }; + Register receiver = KeyedLoadIC::kReceiverRegister; + Register name = KeyedLoadIC::kNameRegister; + static Register registers[] = { receiver, name, ebx, eax, edi, no_reg }; return registers; } diff --git a/src/ic.h b/src/ic.h index 3f55043..f2a792b 100644 --- a/src/ic.h +++ b/src/ic.h @@ -398,6 +398,15 @@ class LoadIC: public IC { class ContextualModeBits: public BitField {}; STATIC_ASSERT(static_cast(NOT_CONTEXTUAL) == 0); + enum RegisterInfo { + kReceiverIndex, + kNameIndex, + kRegisterArgumentCount + }; + static Register kReceiverRegister; + static Register kNameRegister; + static const Register registers[kRegisterArgumentCount]; + static ExtraICState ComputeExtraICState(ContextualMode contextual_mode) { return ContextualModeBits::encode(contextual_mode); } @@ -498,6 +507,10 @@ class KeyedLoadIC: public LoadIC { ASSERT(target()->is_keyed_load_stub()); } + static const Register registers[kRegisterArgumentCount]; + static Register kReceiverRegister; + static Register kNameRegister; + MUST_USE_RESULT MaybeHandle Load(Handle object, Handle key); diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 0287a9a..10359a5 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -89,26 +89,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor( } -void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { a1, a0 }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - -void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = {a1, a0 }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - void RegExpConstructResultStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { a2, a1, a0 }; @@ -119,16 +99,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor( } -void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { a1, a0 }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; -} - - void LoadFieldStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { a0 }; diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc index cbf721a..2316933 100644 --- a/src/mips/ic-mips.cc +++ b/src/mips/ic-mips.cc @@ -560,6 +560,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { } +// IC register specifications +Register LoadIC::kReceiverRegister = a0; +Register LoadIC::kNameRegister = a2; +const Register LoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + +Register KeyedLoadIC::kReceiverRegister = a1; +Register KeyedLoadIC::kNameRegister = a0; +const Register KeyedLoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // ---------- S t a t e -------------- // -- ra : return address diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index d7e7b2e..f409fe4 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -1253,14 +1253,18 @@ Handle LoadStubCompiler::CompileLoadNonexistent(Handle type, Register* LoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { a0, a2, a3, a1, t0, t1 }; + Register receiver = LoadIC::kReceiverRegister; + Register name = LoadIC::kNameRegister; + static Register registers[] = { receiver, name, a3, a1, t0, t1 }; return registers; } Register* KeyedLoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { a1, a0, a2, a3, t0, t1 }; + Register receiver = KeyedLoadIC::kReceiverRegister; + Register name = KeyedLoadIC::kNameRegister; + static Register registers[] = { receiver, name, a2, a3, t0, t1 }; return registers; } diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index 0bc5739..6ace698 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -89,26 +89,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor( } -void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { rdx, rax }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - -void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { rdx, rax }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - void RegExpConstructResultStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { rcx, rbx, rax }; @@ -119,16 +99,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor( } -void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { rdx, rax }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; -} - - void LoadFieldStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { rax }; diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc index 0cda1df..7ad3f50 100644 --- a/src/x64/ic-x64.cc +++ b/src/x64/ic-x64.cc @@ -1052,6 +1052,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { } +// IC register specifications +Register LoadIC::kReceiverRegister = rax; +Register LoadIC::kNameRegister = rcx; +const Register LoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + +Register KeyedLoadIC::kReceiverRegister = rdx; +Register KeyedLoadIC::kNameRegister = rax; +const Register KeyedLoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // ----------- S t a t e ------------- // -- rax : key diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index c5af9bb..7bc588f 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -1222,14 +1222,18 @@ Handle LoadStubCompiler::CompileLoadNonexistent(Handle type, Register* LoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { rax, rcx, rdx, rbx, rdi, r8 }; + Register receiver = LoadIC::kReceiverRegister; + Register name = LoadIC::kNameRegister; + static Register registers[] = { receiver, name, rdx, rbx, rdi, r8 }; return registers; } Register* KeyedLoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { rdx, rax, rbx, rcx, rdi, r8 }; + Register receiver = KeyedLoadIC::kReceiverRegister; + Register name = KeyedLoadIC::kNameRegister; + static Register registers[] = { receiver, name, rbx, rcx, rdi, r8 }; return registers; } diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc index 6c61fe7..2ef1d9b 100644 --- a/src/x87/code-stubs-x87.cc +++ b/src/x87/code-stubs-x87.cc @@ -92,26 +92,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor( } -void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { edx, ecx }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - -void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { edx, ecx }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); -} - - void RegExpConstructResultStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { ecx, ebx, eax }; @@ -122,16 +102,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor( } -void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( - CodeStubInterfaceDescriptor* descriptor) { - static Register registers[] = { edx, ecx }; - descriptor->register_param_count_ = 2; - descriptor->register_params_ = registers; - descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; -} - - void LoadFieldStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { static Register registers[] = { edx }; diff --git a/src/x87/ic-x87.cc b/src/x87/ic-x87.cc index 6cd9ac4..618346b 100644 --- a/src/x87/ic-x87.cc +++ b/src/x87/ic-x87.cc @@ -1025,6 +1025,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { } +// IC register specifications +Register LoadIC::kReceiverRegister = edx; +Register LoadIC::kNameRegister = ecx; +const Register LoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + +Register KeyedLoadIC::kReceiverRegister = LoadIC::kReceiverRegister; +Register KeyedLoadIC::kNameRegister = LoadIC::kNameRegister; +const Register KeyedLoadIC::registers[] = { kReceiverRegister, kNameRegister }; + + void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // ----------- S t a t e ------------- // -- ecx : key diff --git a/src/x87/stub-cache-x87.cc b/src/x87/stub-cache-x87.cc index b2ba6b1..33aafa8 100644 --- a/src/x87/stub-cache-x87.cc +++ b/src/x87/stub-cache-x87.cc @@ -1282,14 +1282,18 @@ Handle LoadStubCompiler::CompileLoadNonexistent(Handle type, Register* LoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg }; + Register receiver = LoadIC::kReceiverRegister; + Register name = LoadIC::kNameRegister; + static Register registers[] = { receiver, name, ebx, eax, edi, no_reg }; return registers; } Register* KeyedLoadStubCompiler::registers() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg }; + Register receiver = KeyedLoadIC::kReceiverRegister; + Register name = KeyedLoadIC::kNameRegister; + static Register registers[] = { receiver, name, ebx, eax, edi, no_reg }; return registers; }