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

Unified Diff: src/x64/ic-x64.cc

Issue 583008: Eliminate *IC::Generate() function on all platforms. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/ic-x64.cc
===================================================================
--- src/x64/ic-x64.cc (revision 3816)
+++ src/x64/ic-x64.cc (working copy)
@@ -228,26 +228,40 @@
}
-void KeyedLoadIC::Generate(MacroAssembler* masm,
- ExternalReference const& f) {
+void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rsp[0] : return address
// -- rsp[8] : name
// -- rsp[16] : receiver
// -----------------------------------
- __ movq(rax, Operand(rsp, kPointerSize));
- __ movq(rcx, Operand(rsp, 2 * kPointerSize));
__ pop(rbx);
- __ push(rcx); // receiver
- __ push(rax); // name
+ __ push(Operand(rsp, 1 * kPointerSize)); // receiver
+ __ push(Operand(rsp, 1 * kPointerSize)); // name
__ push(rbx); // return address
// Perform tail call to the entry.
- __ TailCallRuntime(f, 2, 1);
+ __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedLoadIC_Miss)), 2, 1);
}
+void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
+ // ----------- S t a t e -------------
+ // -- rsp[0] : return address
+ // -- rsp[8] : name
+ // -- rsp[16] : receiver
+ // -----------------------------------
+
+ __ pop(rbx);
+ __ push(Operand(rsp, 1 * kPointerSize)); // receiver
+ __ push(Operand(rsp, 1 * kPointerSize)); // name
+ __ push(rbx); // return address
+
+ // Perform tail call to the entry.
+ __ TailCallRuntime(ExternalReference(Runtime::kKeyedGetProperty), 2, 1);
+}
+
+
void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rsp[0] : return address
@@ -317,7 +331,7 @@
// Slow case: Load name and receiver from stack and jump to runtime.
__ bind(&slow);
__ IncrementCounter(&Counters::keyed_load_generic_slow, 1);
- Generate(masm, ExternalReference(Runtime::kKeyedGetProperty));
+ GenerateRuntimeGetProperty(masm);
__ bind(&check_string);
// The key is not a smi.
// Is it a string?
@@ -555,21 +569,30 @@
// Slow case: Load name and receiver from stack and jump to runtime.
__ bind(&slow);
__ IncrementCounter(&Counters::keyed_load_external_array_slow, 1);
- Generate(masm, ExternalReference(Runtime::kKeyedGetProperty));
+ GenerateRuntimeGetProperty(masm);
}
-void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
+void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
// ----------- S t a t e -------------
- // -- rsp[0] : return address
- // -- rsp[8] : name
+ // -- rax : value
+ // -- rsp[0] : return address
+ // -- rsp[8] : key
// -- rsp[16] : receiver
// -----------------------------------
- Generate(masm, ExternalReference(IC_Utility(kKeyedLoadIC_Miss)));
+
+ __ pop(rcx);
+ __ push(Operand(rsp, 1 * kPointerSize)); // receiver
+ __ push(Operand(rsp, 1 * kPointerSize)); // key
+ __ push(rax); // value
+ __ push(rcx); // return address
+
+ // Do tail-call to runtime routine.
+ __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1);
}
-void KeyedStoreIC::Generate(MacroAssembler* masm, ExternalReference const& f) {
+void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : value
// -- rsp[0] : return address
@@ -584,7 +607,7 @@
__ push(rcx); // return address
// Do tail-call to runtime routine.
- __ TailCallRuntime(f, 3, 1);
+ __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1);
}
@@ -659,7 +682,7 @@
// Slow case: call runtime.
__ bind(&slow);
- Generate(masm, ExternalReference(Runtime::kSetProperty));
+ GenerateRuntimeSetProperty(masm);
// Check whether the elements is a pixel array.
// rax: value
@@ -923,7 +946,7 @@
// Slow case: call runtime.
__ bind(&slow);
- Generate(masm, ExternalReference(Runtime::kSetProperty));
+ GenerateRuntimeSetProperty(masm);
}
@@ -1153,22 +1176,20 @@
}
-void LoadIC::Generate(MacroAssembler* masm, ExternalReference const& f) {
+void LoadIC::GenerateMiss(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rcx : name
// -- rsp[0] : return address
// -- rsp[8] : receiver
// -----------------------------------
- __ movq(rax, Operand(rsp, kPointerSize));
-
__ pop(rbx);
- __ push(rax); // receiver
+ __ push(Operand(rsp, 0)); // receiver
__ push(rcx); // name
__ push(rbx); // return address
// Perform tail call to the entry.
- __ TailCallRuntime(f, 2, 1);
+ __ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1);
}
@@ -1224,17 +1245,6 @@
}
-void LoadIC::GenerateMiss(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- rcx : name
- // -- rsp[0] : return address
- // -- rsp[8] : receiver
- // -----------------------------------
-
- Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss)));
-}
-
-
void LoadIC::GenerateNormal(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rcx : name
@@ -1278,7 +1288,7 @@
// Cache miss: Restore receiver from stack and jump to runtime.
__ bind(&miss);
__ movq(rax, Operand(rsp, 1 * kPointerSize));
- Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss)));
+ GenerateMiss(masm);
}
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698