Chromium Code Reviews| Index: src/ia32/ic-ia32.cc |
| diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc |
| index 0b3d110d1148948a7c5a4f0cc8234d2cfd4a3c5d..4ad3cf645d8cb8b07807f37a61c047c5835a8fe8 100644 |
| --- a/src/ia32/ic-ia32.cc |
| +++ b/src/ia32/ic-ia32.cc |
| @@ -388,6 +388,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
| // -- edx : receiver |
| // -- esp[0] : return address |
| // ----------------------------------- |
| + ASSERT(edx.is(ReceiverRegister())); |
| + ASSERT(ecx.is(NameRegister())); |
| Label slow, check_name, index_smi, index_name, property_array_property; |
| Label probe_dictionary, check_number_dictionary; |
| @@ -566,6 +568,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
| // -- edx : receiver |
| // -- esp[0] : return address |
| // ----------------------------------- |
| + ASSERT(edx.is(ReceiverRegister())); |
| + ASSERT(ecx.is(NameRegister())); |
| Label miss; |
| Register receiver = edx; |
| @@ -598,6 +602,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
| // -- edx : receiver |
| // -- esp[0] : return address |
| // ----------------------------------- |
| + ASSERT(edx.is(ReceiverRegister())); |
| + ASSERT(ecx.is(NameRegister())); |
| Label slow; |
| // Check that the receiver isn't a smi. |
| @@ -640,6 +646,8 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
| // -- edx : receiver |
| // -- esp[0] : return address |
| // ----------------------------------- |
| + ASSERT(edx.is(ReceiverRegister())); |
| + ASSERT(ecx.is(NameRegister())); |
| Label slow, notin; |
| Factory* factory = masm->isolate()->factory(); |
| Operand mapped_location = |
| @@ -930,6 +938,8 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
| // -- edx : receiver |
| // -- esp[0] : return address |
| // ----------------------------------- |
| + ASSERT(edx.is(ReceiverRegister())); |
| + ASSERT(ecx.is(NameRegister())); |
| // Probe the stub cache. |
| Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC); |
| @@ -947,6 +957,9 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { |
| // -- edx : receiver |
| // -- esp[0] : return address |
| // ----------------------------------- |
| + ASSERT(edx.is(ReceiverRegister())); |
|
Jakob Kummerow
2014/06/25 10:59:12
I'm not too happy with these ASSERTs, as opposed t
mvstanton
2014/06/25 15:10:27
Okay, yep. I'm cautious because when code starts m
|
| + ASSERT(ecx.is(NameRegister())); |
| + |
| Label miss, slow; |
| GenerateNameDictionaryReceiverCheck(masm, edx, eax, ebx, &miss); |
| @@ -966,19 +979,22 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { |
| } |
| -void LoadIC::GenerateMiss(MacroAssembler* masm) { |
| - // ----------- S t a t e ------------- |
| - // -- ecx : name |
| - // -- edx : receiver |
| - // -- esp[0] : return address |
| - // ----------------------------------- |
| +// A register that isn't one of the parameters to the load ic. |
| +static const Register LoadIC_TempRegister() { return ebx; } |
|
Jakob Kummerow
2014/06/25 10:59:12
As discussed, I think medium-term we want to defin
mvstanton
2014/06/25 15:10:27
Okay, thanks. I will keep it this way for now. I'm
|
| + |
| +void LoadIC::GenerateMiss(MacroAssembler* masm) { |
| + // ----------- S t a t e ------------------ |
| + // -- ReceiverRegister() : receiver |
|
Jakob Kummerow
2014/06/25 10:59:12
Arguably this entire comment block could now be re
mvstanton
2014/06/25 15:10:27
It's a super-redundant comment, so I'll take it ou
|
| + // -- NameRegister() : name |
| + // -- esp[0] : return address |
| + // ---------------------------------------- |
| __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); |
| - __ pop(ebx); |
| - __ push(edx); // receiver |
| - __ push(ecx); // name |
| - __ push(ebx); // return address |
| + __ pop(LoadIC_TempRegister()); |
| + __ push(ReceiverRegister()); // receiver |
| + __ push(NameRegister()); // name |
| + __ push(LoadIC_TempRegister()); // return address |
| // Perform tail call to the entry. |
| ExternalReference ref = |
| @@ -988,35 +1004,39 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { |
| void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| - // ----------- S t a t e ------------- |
| - // -- ecx : key |
| - // -- edx : receiver |
| - // -- esp[0] : return address |
| - // ----------------------------------- |
| - |
| - __ pop(ebx); |
| - __ push(edx); // receiver |
| - __ push(ecx); // name |
| - __ push(ebx); // return address |
| + // ----------- S t a t e ------------------ |
| + // -- ReceiverRegister() : receiver |
| + // -- NameRegister() : name |
| + // -- esp[0] : return address |
| + // ---------------------------------------- |
| + __ pop(LoadIC_TempRegister()); |
| + __ push(ReceiverRegister()); // receiver |
| + __ push(NameRegister()); // name |
| + __ push(LoadIC_TempRegister()); // return address |
| // Perform tail call to the entry. |
| __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
| } |
| -void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| - // ----------- S t a t e ------------- |
| - // -- ecx : key |
| - // -- edx : receiver |
| - // -- esp[0] : return address |
| - // ----------------------------------- |
| +// A register that isn't one of the parameters to the load ic. |
| +static const Register KeyedLoadIC_TempRegister() { |
| + return LoadIC_TempRegister(); |
| +} |
| + |
| +void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| + // ----------- S t a t e ------------------ |
| + // -- ReceiverRegister() : receiver |
| + // -- NameRegister() : name |
| + // -- esp[0] : return address |
| + // ---------------------------------------- |
| __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); |
| - __ pop(ebx); |
| - __ push(edx); // receiver |
| - __ push(ecx); // name |
| - __ push(ebx); // return address |
| + __ pop(KeyedLoadIC_TempRegister()); |
| + __ push(ReceiverRegister()); // receiver |
| + __ push(NameRegister()); // name |
| + __ push(KeyedLoadIC_TempRegister()); // return address |
| // Perform tail call to the entry. |
| ExternalReference ref = |
| @@ -1039,16 +1059,15 @@ const Register KeyedLoadIC::NameRegister() { return LoadIC::NameRegister(); } |
| void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| - // ----------- S t a t e ------------- |
| - // -- ecx : key |
| - // -- edx : receiver |
| - // -- esp[0] : return address |
| - // ----------------------------------- |
| - |
| - __ pop(ebx); |
| - __ push(edx); // receiver |
| - __ push(ecx); // name |
| - __ push(ebx); // return address |
| + // ----------- S t a t e ------------------ |
| + // -- ReceiverRegister() : receiver |
| + // -- NameRegister() : name |
| + // -- esp[0] : return address |
| + // ---------------------------------------- |
| + __ pop(KeyedLoadIC_TempRegister()); |
| + __ push(ReceiverRegister()); // receiver |
| + __ push(NameRegister()); // name |
| + __ push(KeyedLoadIC_TempRegister()); // return address |
| // Perform tail call to the entry. |
| __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |