Revision: 21601
Author: [email protected]
Date: Mon Jun 2 11:34:45 2014 UTC
Log: X87: Refactor CallICStub to use a different stub for each
customization.
port r21564 (a39968c)
Original commit message:
This gives us much more room to customize on different functions, by
using MajorKey to differentiate them.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/307823003
http://code.google.com/p/v8/source/detail?r=21601
Modified:
/branches/bleeding_edge/src/x87/code-stubs-x87.cc
=======================================
--- /branches/bleeding_edge/src/x87/code-stubs-x87.cc Mon Jun 2 07:02:24
2014 UTC
+++ /branches/bleeding_edge/src/x87/code-stubs-x87.cc Mon Jun 2 11:34:45
2014 UTC
@@ -2142,13 +2142,18 @@
}
-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,
@@ -2157,24 +2162,9 @@
__ 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,
@@ -2199,11 +2189,6 @@
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));
@@ -2254,7 +2239,7 @@
// 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);
@@ -2272,7 +2257,7 @@
}
-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));
@@ -2286,7 +2271,7 @@
__ push(edx);
// Call the entry.
- ExternalReference miss =
ExternalReference(IC_Utility(IC::kCallIC_Miss),
+ ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.