Index: src/ic/x87/stub-cache-x87.cc |
diff --git a/src/ic/x87/stub-cache-x87.cc b/src/ic/x87/stub-cache-x87.cc |
index d76d0a26b74655ea92183cfd0d931c41ef031842..0de5d760fb52c8fd662315ab5f98d3e90a818de8 100644 |
--- a/src/ic/x87/stub-cache-x87.cc |
+++ b/src/ic/x87/stub-cache-x87.cc |
@@ -25,6 +25,9 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm, |
ExternalReference map_offset(isolate->stub_cache()->map_reference(table)); |
Label miss; |
+ bool is_vector_store = |
+ IC::ICUseVector(ic_kind) && |
+ (ic_kind == Code::STORE_IC || ic_kind == Code::KEYED_STORE_IC); |
// Multiply by 3 because there are 3 fields per entry (name, code, map). |
__ lea(offset, Operand(offset, offset, times_2, 0)); |
@@ -56,19 +59,28 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm, |
} |
#endif |
- if (IC::ICUseVector(ic_kind)) { |
- // The vector and slot were pushed onto the stack before starting the |
- // probe, and need to be dropped before calling the handler. |
+ // The vector and slot were pushed onto the stack before starting the |
+ // probe, and need to be dropped before calling the handler. |
+ if (is_vector_store) { |
+ // The overlap here is rather embarrassing. One does what one must. |
+ Register vector = VectorStoreICDescriptor::VectorRegister(); |
+ DCHECK(extra.is(VectorStoreICDescriptor::SlotRegister())); |
+ __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
+ __ pop(vector); |
+ __ xchg(extra, Operand(esp, 0)); |
+ // Jump to the first instruction in the code stub. |
+ __ ret(0); |
+ } else { |
__ pop(LoadWithVectorDescriptor::VectorRegister()); |
__ pop(LoadDescriptor::SlotRegister()); |
+ __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
+ __ jmp(extra); |
} |
- // Jump to the first instruction in the code stub. |
- __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
- __ jmp(extra); |
- |
__ bind(&miss); |
} else { |
+ DCHECK(ic_kind == Code::STORE_IC || ic_kind == Code::KEYED_STORE_IC); |
+ |
// Save the offset on the stack. |
__ push(offset); |
@@ -105,21 +117,21 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm, |
__ pop(offset); |
__ mov(offset, Operand::StaticArray(offset, times_1, value_offset)); |
- if (IC::ICUseVector(ic_kind)) { |
+ // Jump to the first instruction in the code stub. |
+ if (is_vector_store) { |
// The vector and slot were pushed onto the stack before starting the |
// probe, and need to be dropped before calling the handler. |
- Register vector = LoadWithVectorDescriptor::VectorRegister(); |
- Register slot = LoadDescriptor::SlotRegister(); |
- DCHECK(!offset.is(vector) && !offset.is(slot)); |
- |
+ Register vector = VectorStoreICDescriptor::VectorRegister(); |
+ DCHECK(offset.is(VectorStoreICDescriptor::SlotRegister())); |
+ __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
__ pop(vector); |
- __ pop(slot); |
+ __ xchg(offset, Operand(esp, 0)); |
+ __ ret(0); |
+ } else { |
+ __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
+ __ jmp(offset); |
} |
- // Jump to the first instruction in the code stub. |
- __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
- __ jmp(offset); |
- |
// Pop at miss. |
__ bind(&miss); |
__ pop(offset); |