Index: src/ic/x64/ic-x64.cc |
diff --git a/src/ic/x64/ic-x64.cc b/src/ic/x64/ic-x64.cc |
index c7345603b7459c06602b4d23e47635629effb6ce..6bedbc51845778aaf6a14240b95b56e2e6b10783 100644 |
--- a/src/ic/x64/ic-x64.cc |
+++ b/src/ic/x64/ic-x64.cc |
@@ -762,11 +762,30 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { |
} |
-// A register that isn't one of the parameters to the load ic. |
-static const Register LoadIC_TempRegister() { return rbx; } |
- |
+static void LoadIC_PushArgs(MacroAssembler* masm) { |
+ Register receiver = LoadDescriptor::ReceiverRegister(); |
+ Register name = LoadDescriptor::NameRegister(); |
+ if (FLAG_vector_ics) { |
+ Register slot = VectorLoadICDescriptor::SlotRegister(); |
+ Register vector = VectorLoadICDescriptor::VectorRegister(); |
+ DCHECK(!rdi.is(receiver) && !rdi.is(name) && !rdi.is(slot) && |
+ !rdi.is(vector)); |
+ |
+ __ PopReturnAddressTo(rdi); |
+ __ Push(receiver); |
+ __ Push(name); |
+ __ Push(slot); |
+ __ Push(vector); |
+ __ PushReturnAddressFrom(rdi); |
+ } else { |
+ DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
-static const Register KeyedLoadIC_TempRegister() { return rbx; } |
+ __ PopReturnAddressTo(rbx); |
+ __ Push(receiver); |
+ __ Push(name); |
+ __ PushReturnAddressFrom(rbx); |
+ } |
+} |
void LoadIC::GenerateMiss(MacroAssembler* masm) { |
@@ -775,25 +794,26 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { |
Counters* counters = masm->isolate()->counters(); |
__ IncrementCounter(counters->load_miss(), 1); |
- __ PopReturnAddressTo(LoadIC_TempRegister()); |
- __ Push(LoadDescriptor::ReceiverRegister()); // receiver |
- __ Push(LoadDescriptor::NameRegister()); // name |
- __ PushReturnAddressFrom(LoadIC_TempRegister()); |
+ LoadIC_PushArgs(masm); |
// Perform tail call to the entry. |
ExternalReference ref = |
ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
- __ TailCallExternalReference(ref, 2, 1); |
+ int arg_count = FLAG_vector_ics ? 4 : 2; |
+ __ TailCallExternalReference(ref, arg_count, 1); |
} |
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
// The return address is on the stack. |
+ Register receiver = LoadDescriptor::ReceiverRegister(); |
+ Register name = LoadDescriptor::NameRegister(); |
+ DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
- __ PopReturnAddressTo(LoadIC_TempRegister()); |
- __ Push(LoadDescriptor::ReceiverRegister()); // receiver |
- __ Push(LoadDescriptor::NameRegister()); // name |
- __ PushReturnAddressFrom(LoadIC_TempRegister()); |
+ __ PopReturnAddressTo(rbx); |
+ __ Push(receiver); |
+ __ Push(name); |
+ __ PushReturnAddressFrom(rbx); |
// Perform tail call to the entry. |
__ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
@@ -805,25 +825,26 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
Counters* counters = masm->isolate()->counters(); |
__ IncrementCounter(counters->keyed_load_miss(), 1); |
- __ PopReturnAddressTo(KeyedLoadIC_TempRegister()); |
- __ Push(LoadDescriptor::ReceiverRegister()); // receiver |
- __ Push(LoadDescriptor::NameRegister()); // name |
- __ PushReturnAddressFrom(KeyedLoadIC_TempRegister()); |
+ LoadIC_PushArgs(masm); |
// Perform tail call to the entry. |
ExternalReference ref = |
ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
- __ TailCallExternalReference(ref, 2, 1); |
+ int arg_count = FLAG_vector_ics ? 4 : 2; |
+ __ TailCallExternalReference(ref, arg_count, 1); |
} |
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
// The return address is on the stack. |
+ Register receiver = LoadDescriptor::ReceiverRegister(); |
+ Register name = LoadDescriptor::NameRegister(); |
+ DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
- __ PopReturnAddressTo(KeyedLoadIC_TempRegister()); |
- __ Push(LoadDescriptor::ReceiverRegister()); // receiver |
- __ Push(LoadDescriptor::NameRegister()); // name |
- __ PushReturnAddressFrom(KeyedLoadIC_TempRegister()); |
+ __ PopReturnAddressTo(rbx); |
+ __ Push(receiver); |
+ __ Push(name); |
+ __ PushReturnAddressFrom(rbx); |
// Perform tail call to the entry. |
__ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |