Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: src/x87/code-stubs-x87.cc

Issue 2357163003: [ic][ia32][x87] Pass value, slot and vector to StoreIC and KeyedStoreIC through the stack. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/full-codegen/full-codegen.cc ('K') | « src/interface-descriptors.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index f36d51e04a034d7e5143fc8318ad2ba40498f06d..4d14535604db2d8ac33414924e2b7fdfdd359ad7 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -3483,6 +3483,28 @@ void StoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Register slot = StoreWithVectorDescriptor::SlotRegister(); // edi
Label miss;
+ if (StoreWithVectorDescriptor::kPassLastArgsOnStack) {
+ // Current stack layout:
+ // - esp[8] -- value
+ // - esp[4] -- slot
+ // - esp[0] -- return address
+ STATIC_ASSERT(StoreDescriptor::kStackArgumentsCount == 2);
+ STATIC_ASSERT(StoreWithVectorDescriptor::kStackArgumentsCount == 3);
+ if (in_frame) {
+ __ RecordComment("[ StoreDescriptor -> StoreWithVectorDescriptor");
+ // If the vector is not on the stack, then insert the vector beneath
+ // return address in order to prepare for calling handler with
+ // StoreWithVector calling convention.
+ __ push(Operand(esp, 0));
+ __ mov(Operand(esp, 4), StoreWithVectorDescriptor::VectorRegister());
+ __ RecordComment("]");
+ } else {
+ __ mov(vector, Operand(esp, 1 * kPointerSize));
+ }
+ __ mov(slot, Operand(esp, 2 * kPointerSize));
+ __ mov(value, Operand(esp, 3 * kPointerSize));
+ }
+
__ push(value);
Register scratch = value;
@@ -3624,12 +3646,23 @@ static void HandlePolymorphicKeyedStoreCase(MacroAssembler* masm,
__ pop(vector);
__ pop(receiver);
__ pop(value);
- {
- // Put vector and slot beneath return address.
- __ push(vector);
- __ push(Operand(esp, 1 * kPointerSize)); // push return address
- __ mov(Operand(esp, 2 * kPointerSize), slot);
- }
+ // Ensure that the transition handler we are going to call has the same
+ // number of stack arguments which means that we don't have to adapt them
+ // before the call.
+ STATIC_ASSERT(StoreWithVectorDescriptor::kStackArgumentsCount == 3);
+ STATIC_ASSERT(StoreTransitionDescriptor::kStackArgumentsCount == 3);
+ STATIC_ASSERT(StoreWithVectorDescriptor::kParameterCount -
+ StoreWithVectorDescriptor::kValue ==
+ StoreTransitionDescriptor::kParameterCount -
+ StoreTransitionDescriptor::kValue);
+ STATIC_ASSERT(StoreWithVectorDescriptor::kParameterCount -
+ StoreWithVectorDescriptor::kSlot ==
+ StoreTransitionDescriptor::kParameterCount -
+ StoreTransitionDescriptor::kSlot);
+ STATIC_ASSERT(StoreWithVectorDescriptor::kParameterCount -
+ StoreWithVectorDescriptor::kVector ==
+ StoreTransitionDescriptor::kParameterCount -
+ StoreTransitionDescriptor::kVector);
__ jmp(Operand::StaticVariable(virtual_register));
__ bind(&prepare_next);
@@ -3657,6 +3690,28 @@ void KeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Register slot = StoreWithVectorDescriptor::SlotRegister(); // edi
Label miss;
+ if (StoreWithVectorDescriptor::kPassLastArgsOnStack) {
+ // Current stack layout:
+ // - esp[8] -- value
+ // - esp[4] -- slot
+ // - esp[0] -- return address
+ STATIC_ASSERT(StoreDescriptor::kStackArgumentsCount == 2);
+ STATIC_ASSERT(StoreWithVectorDescriptor::kStackArgumentsCount == 3);
+ if (in_frame) {
+ __ RecordComment("[ StoreDescriptor -> StoreWithVectorDescriptor");
+ // If the vector is not on the stack, then insert the vector beneath
+ // return address in order to prepare for calling handler with
+ // StoreWithVector calling convention.
+ __ push(Operand(esp, 0));
+ __ mov(Operand(esp, 4), StoreWithVectorDescriptor::VectorRegister());
+ __ RecordComment("]");
+ } else {
+ __ mov(vector, Operand(esp, 1 * kPointerSize));
+ }
+ __ mov(slot, Operand(esp, 2 * kPointerSize));
+ __ mov(value, Operand(esp, 3 * kPointerSize));
+ }
+
__ push(value);
Register scratch = value;
« src/full-codegen/full-codegen.cc ('K') | « src/interface-descriptors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698