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

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

Issue 1344383002: X87: Reland VectorICs: ia32 store ics need a virtual register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/ic/x87/stub-cache-x87.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 c763401d7c4435f99df09321ce82fb11c2ac62e8..2b3b804c564951ee7fb98f99033cb98a55e18861 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -4247,6 +4247,8 @@ static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register receiver,
Label next, next_loop, prepare_next;
Label load_smi_map, compare_map;
Label start_polymorphic;
+ ExternalReference virtual_register =
+ ExternalReference::vector_store_virtual_register(masm->isolate());
__ push(receiver);
__ push(vector);
@@ -4273,8 +4275,9 @@ static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register receiver,
__ pop(vector);
__ pop(receiver);
__ lea(handler, FieldOperand(handler, Code::kHeaderSize));
- __ xchg(handler, Operand(esp, 0));
- __ ret(0);
+ __ mov(Operand::StaticVariable(virtual_register), handler);
+ __ pop(handler); // Pop "value".
+ __ jmp(Operand::StaticVariable(virtual_register));
// Polymorphic, we have to loop from 2 to N
@@ -4294,12 +4297,13 @@ static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register receiver,
__ j(not_equal, &prepare_next);
__ mov(handler, FieldOperand(feedback, counter, times_half_pointer_size,
FixedArray::kHeaderSize + kPointerSize));
+ __ lea(handler, FieldOperand(handler, Code::kHeaderSize));
__ pop(key);
__ pop(vector);
__ pop(receiver);
- __ lea(handler, FieldOperand(handler, Code::kHeaderSize));
- __ xchg(handler, Operand(esp, 0));
- __ ret(0);
+ __ mov(Operand::StaticVariable(virtual_register), handler);
+ __ pop(handler); // Pop "value".
+ __ jmp(Operand::StaticVariable(virtual_register));
__ bind(&prepare_next);
__ add(counter, Immediate(Smi::FromInt(2)));
@@ -4324,6 +4328,8 @@ static void HandleMonomorphicStoreCase(MacroAssembler* masm, Register receiver,
Label* miss) {
// The store ic value is on the stack.
DCHECK(weak_cell.is(VectorStoreICDescriptor::ValueRegister()));
+ ExternalReference virtual_register =
+ ExternalReference::vector_store_virtual_register(masm->isolate());
// feedback initially contains the feedback array
Label compare_smi_map;
@@ -4340,9 +4346,10 @@ static void HandleMonomorphicStoreCase(MacroAssembler* masm, Register receiver,
FixedArray::kHeaderSize + kPointerSize));
__ lea(weak_cell, FieldOperand(weak_cell, Code::kHeaderSize));
// Put the store ic value back in it's register.
- __ xchg(weak_cell, Operand(esp, 0));
- // "return" to the handler.
- __ ret(0);
+ __ mov(Operand::StaticVariable(virtual_register), weak_cell);
+ __ pop(weak_cell); // Pop "value".
+ // jump to the handler.
+ __ jmp(Operand::StaticVariable(virtual_register));
// In microbenchmarks, it made sense to unroll this code so that the call to
// the handler is duplicated for a HeapObject receiver and a Smi receiver.
@@ -4352,10 +4359,10 @@ static void HandleMonomorphicStoreCase(MacroAssembler* masm, Register receiver,
__ mov(weak_cell, FieldOperand(vector, slot, times_half_pointer_size,
FixedArray::kHeaderSize + kPointerSize));
__ lea(weak_cell, FieldOperand(weak_cell, Code::kHeaderSize));
- // Put the store ic value back in it's register.
- __ xchg(weak_cell, Operand(esp, 0));
- // "return" to the handler.
- __ ret(0);
+ __ mov(Operand::StaticVariable(virtual_register), weak_cell);
+ __ pop(weak_cell); // Pop "value".
+ // jump to the handler.
+ __ jmp(Operand::StaticVariable(virtual_register));
}
@@ -4428,6 +4435,8 @@ static void HandlePolymorphicKeyedStoreCase(MacroAssembler* masm,
Label load_smi_map, compare_map;
Label transition_call;
Label pop_and_miss;
+ ExternalReference virtual_register =
+ ExternalReference::vector_store_virtual_register(masm->isolate());
__ push(receiver);
__ push(vector);
@@ -4464,8 +4473,9 @@ static void HandlePolymorphicKeyedStoreCase(MacroAssembler* masm,
__ pop(vector);
__ pop(receiver);
__ lea(feedback, FieldOperand(feedback, Code::kHeaderSize));
- __ xchg(feedback, Operand(esp, 0));
- __ ret(0);
+ __ mov(Operand::StaticVariable(virtual_register), feedback);
+ __ pop(feedback); // Pop "value".
+ __ jmp(Operand::StaticVariable(virtual_register));
__ bind(&transition_call);
// Oh holy hell this will be tough.
« no previous file with comments | « src/ic/x87/stub-cache-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698