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

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

Issue 295383004: Refactor CallICStub to use a different stub for each customization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 7 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/mips/code-stubs-mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index a63288f2cb59ee4df39109fff6e69e3384ebbfb2..181e9f89644d873c06ea53796bf31f1d46da563e 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2364,13 +2364,19 @@ static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
}
-void CallICStub::Generate_MonomorphicArray(MacroAssembler* masm, Label* miss) {
+void CallIC_ArrayStub::Generate(MacroAssembler* masm) {
// rdi - function
- // rbx - feedback vector
// rdx - slot id (as integer)
+ Label miss;
+ int argc = state_.arg_count();
+ ParameterCount actual(argc);
+
+ EmitLoadTypeFeedbackVector(masm, rbx);
+ __ SmiToInteger32(rdx, rdx);
+
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rcx);
__ cmpq(rdi, rcx);
- __ j(not_equal, miss);
+ __ j(not_equal, &miss);
__ movq(rax, Immediate(arg_count()));
__ movp(rbx, FieldOperand(rbx, rdx, times_pointer_size,
@@ -2380,26 +2386,9 @@ void CallICStub::Generate_MonomorphicArray(MacroAssembler* masm, Label* miss) {
__ AssertUndefinedOrAllocationSite(rbx);
ArrayConstructorStub stub(masm->isolate(), arg_count());
__ TailCallStub(&stub);
-}
-
-
-void CallICStub::Generate_CustomFeedbackCall(MacroAssembler* masm) {
- // rdi - function
- // rbx - feedback vector
- // rdx - slot id
- Label miss;
-
- __ SmiToInteger32(rdx, rdx);
-
- if (state_.stub_type() == CallIC::MONOMORPHIC_ARRAY) {
- Generate_MonomorphicArray(masm, &miss);
- } else {
- // So far there is only one customer for our custom feedback scheme.
- UNREACHABLE();
- }
__ bind(&miss);
- GenerateMiss(masm);
+ GenerateMiss(masm, IC::kCallIC_Customization_Miss);
// The slow case, we need this no matter what to complete a call after a miss.
CallFunctionNoFeedback(masm,
@@ -2426,11 +2415,6 @@ void CallICStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, rbx);
- if (state_.stub_type() != CallIC::DEFAULT) {
- Generate_CustomFeedbackCall(masm);
- return;
- }
-
// The checks. First, does rdi match the recorded monomorphic target?
__ SmiToInteger32(rdx, rdx);
__ cmpq(rdi, FieldOperand(rbx, rdx, times_pointer_size,
@@ -2482,7 +2466,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// We are here because tracing is on or we are going monomorphic.
__ bind(&miss);
- GenerateMiss(masm);
+ GenerateMiss(masm, IC::kCallIC_Miss);
// the slow case
__ bind(&slow_start);
@@ -2498,7 +2482,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
}
-void CallICStub::GenerateMiss(MacroAssembler* masm) {
+void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) {
// Get the receiver of the function from the stack; 1 ~ return address.
__ movp(rcx, Operand(rsp, (state_.arg_count() + 1) * kPointerSize));
@@ -2513,7 +2497,7 @@ void CallICStub::GenerateMiss(MacroAssembler* masm) {
__ Push(rdx);
// Call the entry.
- ExternalReference miss = ExternalReference(IC_Utility(IC::kCallIC_Miss),
+ ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698