Index: src/arm/ic-arm.cc |
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc |
index 506ab64d716864f83968a093132f452eb39dd864..7e6252146d7c3ccf163b060c009362c60d3f2396 100644 |
--- a/src/arm/ic-arm.cc |
+++ b/src/arm/ic-arm.cc |
@@ -316,6 +316,8 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
// -- lr : return address |
// -- r0 : receiver |
// ----------------------------------- |
+ ASSERT(r0.is(ReceiverRegister())); |
+ ASSERT(r2.is(NameRegister())); |
// Probe the stub cache. |
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC); |
@@ -333,6 +335,9 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { |
// -- lr : return address |
// -- r0 : receiver |
// ----------------------------------- |
+ ASSERT(r0.is(ReceiverRegister())); |
+ ASSERT(r2.is(NameRegister())); |
+ |
Label miss, slow; |
GenerateNameDictionaryReceiverCheck(masm, r0, r1, r3, r4, &miss); |
@@ -351,18 +356,20 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { |
} |
+// A register that isn't one of the parameters to the load ic. |
+static const Register LoadIC_TempRegister() { return r3; } |
+ |
+ |
void LoadIC::GenerateMiss(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
- // -- r2 : name |
// -- lr : return address |
- // -- r0 : receiver |
// ----------------------------------- |
Isolate* isolate = masm->isolate(); |
__ IncrementCounter(isolate->counters()->load_miss(), 1, r3, r4); |
- __ mov(r3, r0); |
- __ Push(r3, r2); |
+ __ mov(LoadIC_TempRegister(), ReceiverRegister()); |
+ __ Push(LoadIC_TempRegister(), NameRegister()); |
// Perform tail call to the entry. |
ExternalReference ref = |
@@ -373,13 +380,11 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { |
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
// ---------- S t a t e -------------- |
- // -- r2 : name |
// -- lr : return address |
- // -- r0 : receiver |
// ----------------------------------- |
- __ mov(r3, r0); |
- __ Push(r3, r2); |
+ __ mov(LoadIC_TempRegister(), ReceiverRegister()); |
+ __ Push(LoadIC_TempRegister(), NameRegister()); |
__ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
} |
@@ -476,6 +481,8 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
// -- r0 : key |
// -- r1 : receiver |
// ----------------------------------- |
+ ASSERT(r1.is(ReceiverRegister())); |
+ ASSERT(r0.is(NameRegister())); |
Label slow, notin; |
MemOperand mapped_location = |
GenerateMappedArgumentsLookup(masm, r1, r0, r2, r3, r4, ¬in, &slow); |
@@ -528,14 +535,12 @@ void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { |
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
// ---------- S t a t e -------------- |
// -- lr : return address |
- // -- r0 : key |
- // -- r1 : receiver |
// ----------------------------------- |
Isolate* isolate = masm->isolate(); |
__ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); |
- __ Push(r1, r0); |
+ __ Push(ReceiverRegister(), NameRegister()); |
// Perform tail call to the entry. |
ExternalReference ref = |
@@ -555,11 +560,9 @@ const Register KeyedLoadIC::NameRegister() { return r0; } |
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
// ---------- S t a t e -------------- |
// -- lr : return address |
- // -- r0 : key |
- // -- r1 : receiver |
// ----------------------------------- |
- __ Push(r1, r0); |
+ __ Push(ReceiverRegister(), NameRegister()); |
__ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
} |
@@ -571,6 +574,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
// -- r0 : key |
// -- r1 : receiver |
// ----------------------------------- |
+ ASSERT(r1.is(ReceiverRegister())); |
+ ASSERT(r0.is(NameRegister())); |
Label slow, check_name, index_smi, index_name, property_array_property; |
Label probe_dictionary, check_number_dictionary; |
@@ -742,6 +747,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
// -- r0 : key (index) |
// -- r1 : receiver |
// ----------------------------------- |
+ ASSERT(r1.is(ReceiverRegister())); |
+ ASSERT(r0.is(NameRegister())); |
Label miss; |
Register receiver = r1; |
@@ -774,6 +781,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
// -- r0 : key |
// -- r1 : receiver |
// ----------------------------------- |
+ ASSERT(r1.is(ReceiverRegister())); |
+ ASSERT(r0.is(NameRegister())); |
Label slow; |
// Check that the receiver isn't a smi. |