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

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

Issue 2670843002: [stubs] Also port the CallICStub to CSA. (Closed)
Patch Set: Introduce FullCodeGenerator::IntFromSlot. Created 3 years, 11 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/interface-descriptors-mips.cc ('k') | src/mips64/interface-descriptors-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/code-stubs-mips64.cc
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc
index d4025430fda9039bc6ca75252204cceccba91d29..88140442e7aa8e5283de20eeeb76d7dbca30ff90 100644
--- a/src/mips64/code-stubs-mips64.cc
+++ b/src/mips64/code-stubs-mips64.cc
@@ -1939,189 +1939,6 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
__ bind(&exit_);
}
-// Note: feedback_vector and slot are clobbered after the call.
-static void IncrementCallCount(MacroAssembler* masm, Register feedback_vector,
- Register slot) {
- __ dsrl(t0, slot, 32 - kPointerSizeLog2);
- __ Daddu(slot, feedback_vector, Operand(t0));
- __ ld(t0, FieldMemOperand(slot, FixedArray::kHeaderSize + kPointerSize));
- __ Daddu(t0, t0, Operand(Smi::FromInt(1)));
- __ sd(t0, FieldMemOperand(slot, FixedArray::kHeaderSize + kPointerSize));
-}
-
-void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
- // a0 - number of arguments
- // a1 - function
- // a3 - slot id
- // a2 - vector
- // a4 - allocation site (loaded from vector[slot])
- __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, at);
- __ Branch(miss, ne, a1, Operand(at));
-
- // Increment the call count for monomorphic function calls.
- IncrementCallCount(masm, a2, a3);
-
- __ mov(a2, a4);
- __ mov(a3, a1);
- ArrayConstructorStub stub(masm->isolate());
- __ TailCallStub(&stub);
-}
-
-
-void CallICStub::Generate(MacroAssembler* masm) {
- // a0 - number of arguments
- // a1 - function
- // a3 - slot id (Smi)
- // a2 - vector
- Label extra_checks_or_miss, call, call_function, call_count_incremented;
-
- // The checks. First, does r1 match the recorded monomorphic target?
- __ dsrl(a4, a3, 32 - kPointerSizeLog2);
- __ Daddu(a4, a2, Operand(a4));
- __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize));
-
- // We don't know that we have a weak cell. We might have a private symbol
- // or an AllocationSite, but the memory is safe to examine.
- // AllocationSite::kTransitionInfoOffset - contains a Smi or pointer to
- // FixedArray.
- // WeakCell::kValueOffset - contains a JSFunction or Smi(0)
- // Symbol::kHashFieldSlot - if the low bit is 1, then the hash is not
- // computed, meaning that it can't appear to be a pointer. If the low bit is
- // 0, then hash is computed, but the 0 bit prevents the field from appearing
- // to be a pointer.
- STATIC_ASSERT(WeakCell::kSize >= kPointerSize);
- STATIC_ASSERT(AllocationSite::kTransitionInfoOffset ==
- WeakCell::kValueOffset &&
- WeakCell::kValueOffset == Symbol::kHashFieldSlot);
-
- __ ld(a5, FieldMemOperand(a4, WeakCell::kValueOffset));
- __ Branch(&extra_checks_or_miss, ne, a1, Operand(a5));
-
- // The compare above could have been a SMI/SMI comparison. Guard against this
- // convincing us that we have a monomorphic JSFunction.
- __ JumpIfSmi(a1, &extra_checks_or_miss);
-
- __ bind(&call_function);
- // Increment the call count for monomorphic function calls.
- IncrementCallCount(masm, a2, a3);
-
- __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(),
- tail_call_mode()),
- RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg));
-
- __ bind(&extra_checks_or_miss);
- Label uninitialized, miss, not_allocation_site;
-
- __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex);
- __ Branch(&call, eq, a4, Operand(at));
-
- // Verify that a4 contains an AllocationSite
- __ ld(a5, FieldMemOperand(a4, HeapObject::kMapOffset));
- __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
- __ Branch(&not_allocation_site, ne, a5, Operand(at));
-
- HandleArrayCase(masm, &miss);
-
- __ bind(&not_allocation_site);
-
- // The following cases attempt to handle MISS cases without going to the
- // runtime.
- if (FLAG_trace_ic) {
- __ Branch(&miss);
- }
-
- __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex);
- __ Branch(&uninitialized, eq, a4, Operand(at));
-
- // We are going megamorphic. If the feedback is a JSFunction, it is fine
- // to handle it here. More complex cases are dealt with in the runtime.
- __ AssertNotSmi(a4);
- __ GetObjectType(a4, a5, a5);
- __ Branch(&miss, ne, a5, Operand(JS_FUNCTION_TYPE));
- __ dsrl(a4, a3, 32 - kPointerSizeLog2);
- __ Daddu(a4, a2, Operand(a4));
- __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex);
- __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize));
-
- __ bind(&call);
- IncrementCallCount(masm, a2, a3);
-
- __ bind(&call_count_incremented);
-
- __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()),
- RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg));
-
- __ bind(&uninitialized);
-
- // We are going monomorphic, provided we actually have a JSFunction.
- __ JumpIfSmi(a1, &miss);
-
- // Goto miss case if we do not have a function.
- __ GetObjectType(a1, a4, a4);
- __ Branch(&miss, ne, a4, Operand(JS_FUNCTION_TYPE));
-
- // Make sure the function is not the Array() function, which requires special
- // behavior on MISS.
- __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, a4);
- __ Branch(&miss, eq, a1, Operand(a4));
-
- // Make sure the function belongs to the same native context.
- __ ld(t0, FieldMemOperand(a1, JSFunction::kContextOffset));
- __ ld(t0, ContextMemOperand(t0, Context::NATIVE_CONTEXT_INDEX));
- __ ld(t1, NativeContextMemOperand());
- __ Branch(&miss, ne, t0, Operand(t1));
-
- // Store the function. Use a stub since we need a frame for allocation.
- // a2 - vector
- // a3 - slot
- // a1 - function
- {
- FrameScope scope(masm, StackFrame::INTERNAL);
- CreateWeakCellStub create_stub(masm->isolate());
- __ SmiTag(a0);
- __ Push(a0);
- __ Push(a2, a3);
- __ Push(cp, a1);
- __ CallStub(&create_stub);
- __ Pop(cp, a1);
- __ Pop(a2, a3);
- __ Pop(a0);
- __ SmiUntag(a0);
- }
-
- __ Branch(&call_function);
-
- // We are here because tracing is on or we encountered a MISS case we can't
- // handle here.
- __ bind(&miss);
- GenerateMiss(masm);
-
- __ Branch(&call_count_incremented);
-}
-
-
-void CallICStub::GenerateMiss(MacroAssembler* masm) {
- FrameScope scope(masm, StackFrame::INTERNAL);
-
- // Preserve number of arguments as Smi.
- __ SmiTag(a0);
- __ Push(a0);
-
- // Push the receiver and the function and feedback info.
- __ Push(a1, a2, a3);
-
- // Call the entry.
- __ CallRuntime(Runtime::kCallIC_Miss);
-
- // Move result to a1 and exit the internal frame.
- __ mov(a1, v0);
-
- // Restore number of arguments.
- __ Pop(a0);
- __ SmiUntag(a0);
-}
-
-
void StringCharCodeAtGenerator::GenerateSlow(
MacroAssembler* masm, EmbedMode embed_mode,
const RuntimeCallHelper& call_helper) {
« no previous file with comments | « src/mips/interface-descriptors-mips.cc ('k') | src/mips64/interface-descriptors-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698