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

Unified Diff: src/ia32/code-stubs-ia32.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/code-stubs.cc ('k') | src/ic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index 5547ba25e86294c7838a7885f0374535f4afb76c..6cbb90cf21f258c707d6355a6c37df5474780fbd 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -2470,13 +2470,18 @@ static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
}
-void CallICStub::Generate_MonomorphicArray(MacroAssembler* masm, Label* miss) {
+void CallIC_ArrayStub::Generate(MacroAssembler* masm) {
// edi - function
- // ebx - feedback vector
// edx - slot id
+ Label miss;
+ int argc = state_.arg_count();
+ ParameterCount actual(argc);
+
+ EmitLoadTypeFeedbackVector(masm, ebx);
+
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
__ cmp(edi, ecx);
- __ j(not_equal, miss);
+ __ j(not_equal, &miss);
__ mov(eax, arg_count());
__ mov(ebx, FieldOperand(ebx, edx, times_half_pointer_size,
@@ -2485,24 +2490,9 @@ void CallICStub::Generate_MonomorphicArray(MacroAssembler* masm, Label* miss) {
__ AssertUndefinedOrAllocationSite(ebx);
ArrayConstructorStub stub(masm->isolate(), arg_count());
__ TailCallStub(&stub);
-}
-
-
-void CallICStub::Generate_CustomFeedbackCall(MacroAssembler* masm) {
- // edi - function
- // ebx - feedback vector
- // edx - slot id
- Label miss;
-
- 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,
@@ -2527,11 +2517,6 @@ void CallICStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, ebx);
- if (state_.stub_type() != CallIC::DEFAULT) {
- Generate_CustomFeedbackCall(masm);
- return;
- }
-
// The checks. First, does edi match the recorded monomorphic target?
__ cmp(edi, FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize));
@@ -2582,7 +2567,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);
@@ -2600,7 +2585,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.
__ mov(ecx, Operand(esp, (state_.arg_count() + 1) * kPointerSize));
@@ -2614,7 +2599,7 @@ void CallICStub::GenerateMiss(MacroAssembler* masm) {
__ push(edx);
// 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/code-stubs.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698