Index: src/x64/ic-x64.cc |
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc |
index 60403c6cfb5474e4f97dc91bbc1fba7c6ca5f85e..b6caf8c8a4bdfa00f0c1c442036772d55b111fe4 100644 |
--- a/src/x64/ic-x64.cc |
+++ b/src/x64/ic-x64.cc |
@@ -332,6 +332,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
// -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
+ ASSERT(rdx.is(ReceiverRegister())); |
+ ASSERT(rax.is(NameRegister())); |
Label slow, check_name, index_smi, index_name, property_array_property; |
Label probe_dictionary, check_number_dictionary; |
@@ -495,6 +497,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
// -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
+ ASSERT(rdx.is(ReceiverRegister())); |
+ ASSERT(rax.is(NameRegister())); |
Label miss; |
Register receiver = rdx; |
@@ -527,6 +531,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
// -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
+ ASSERT(rdx.is(ReceiverRegister())); |
+ ASSERT(rax.is(NameRegister())); |
Label slow; |
// Check that the receiver isn't a smi. |
@@ -892,6 +898,8 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
// -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
+ ASSERT(rdx.is(ReceiverRegister())); |
+ ASSERT(rax.is(NameRegister())); |
Label slow, notin; |
Operand mapped_location = |
GenerateMappedArgumentsLookup( |
@@ -956,6 +964,8 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
// -- rcx : name |
// -- rsp[0] : return address |
// ----------------------------------- |
+ ASSERT(rax.is(ReceiverRegister())); |
+ ASSERT(rcx.is(NameRegister())); |
// Probe the stub cache. |
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC); |
@@ -972,6 +982,8 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { |
// -- rcx : name |
// -- rsp[0] : return address |
// ----------------------------------- |
+ ASSERT(rax.is(ReceiverRegister())); |
+ ASSERT(rcx.is(NameRegister())); |
Label miss, slow; |
GenerateNameDictionaryReceiverCheck(masm, rax, rdx, rbx, &miss); |
@@ -991,20 +1003,22 @@ 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; } |
+ |
+ |
void LoadIC::GenerateMiss(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
- // -- rax : receiver |
- // -- rcx : name |
// -- rsp[0] : return address |
// ----------------------------------- |
Counters* counters = masm->isolate()->counters(); |
__ IncrementCounter(counters->load_miss(), 1); |
- __ PopReturnAddressTo(rbx); |
- __ Push(rax); // receiver |
- __ Push(rcx); // name |
- __ PushReturnAddressFrom(rbx); |
+ __ PopReturnAddressTo(LoadIC_TempRegister()); |
+ __ Push(ReceiverRegister()); // receiver |
+ __ Push(NameRegister()); // name |
+ __ PushReturnAddressFrom(LoadIC_TempRegister()); |
// Perform tail call to the entry. |
ExternalReference ref = |
@@ -1015,35 +1029,36 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { |
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
- // -- rax : receiver |
- // -- rcx : name |
// -- rsp[0] : return address |
// ----------------------------------- |
- __ PopReturnAddressTo(rbx); |
- __ Push(rax); // receiver |
- __ Push(rcx); // name |
- __ PushReturnAddressFrom(rbx); |
+ __ PopReturnAddressTo(LoadIC_TempRegister()); |
+ __ Push(ReceiverRegister()); // receiver |
+ __ Push(NameRegister()); // name |
+ __ PushReturnAddressFrom(LoadIC_TempRegister()); |
// Perform tail call to the entry. |
__ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
} |
+static const Register KeyedLoadIC_TempRegister() { |
+ return rbx; |
+} |
+ |
+ |
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
- // -- rax : key |
- // -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
Counters* counters = masm->isolate()->counters(); |
__ IncrementCounter(counters->keyed_load_miss(), 1); |
- __ PopReturnAddressTo(rbx); |
- __ Push(rdx); // receiver |
- __ Push(rax); // name |
- __ PushReturnAddressFrom(rbx); |
+ __ PopReturnAddressTo(KeyedLoadIC_TempRegister()); |
+ __ Push(ReceiverRegister()); // receiver |
+ __ Push(NameRegister()); // name |
+ __ PushReturnAddressFrom(KeyedLoadIC_TempRegister()); |
// Perform tail call to the entry. |
ExternalReference ref = |
@@ -1061,15 +1076,13 @@ const Register KeyedLoadIC::NameRegister() { return rax; } |
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
- // -- rax : key |
- // -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
- __ PopReturnAddressTo(rbx); |
- __ Push(rdx); // receiver |
- __ Push(rax); // name |
- __ PushReturnAddressFrom(rbx); |
+ __ PopReturnAddressTo(KeyedLoadIC_TempRegister()); |
+ __ Push(ReceiverRegister()); // receiver |
+ __ Push(NameRegister()); // name |
+ __ PushReturnAddressFrom(KeyedLoadIC_TempRegister()); |
// Perform tail call to the entry. |
__ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |