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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 1332563003: Vector ICs: No more patching for call ics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix x64 build break. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/ic/ic-inl.h ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after
2680 2680
2681 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { 2681 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
2682 __ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 2682 __ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
2683 __ lw(vector, FieldMemOperand(vector, 2683 __ lw(vector, FieldMemOperand(vector,
2684 JSFunction::kSharedFunctionInfoOffset)); 2684 JSFunction::kSharedFunctionInfoOffset));
2685 __ lw(vector, FieldMemOperand(vector, 2685 __ lw(vector, FieldMemOperand(vector,
2686 SharedFunctionInfo::kFeedbackVectorOffset)); 2686 SharedFunctionInfo::kFeedbackVectorOffset));
2687 } 2687 }
2688 2688
2689 2689
2690 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { 2690 void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
2691 // a1 - function 2691 // a1 - function
2692 // a3 - slot id 2692 // a3 - slot id
2693 // a2 - vector 2693 // a2 - vector
2694 Label miss; 2694 // t0 - loaded from vector[slot]
2695
2696 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, at); 2695 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, at);
2697 __ Branch(&miss, ne, a1, Operand(at)); 2696 __ Branch(miss, ne, a1, Operand(at));
2698 2697
2699 __ li(a0, Operand(arg_count())); 2698 __ li(a0, Operand(arg_count()));
2700 __ sll(at, a3, kPointerSizeLog2 - kSmiTagSize);
2701 __ Addu(at, a2, Operand(at));
2702 __ lw(t0, FieldMemOperand(at, FixedArray::kHeaderSize));
2703
2704 // Verify that t0 contains an AllocationSite
2705 __ lw(t1, FieldMemOperand(t0, HeapObject::kMapOffset));
2706 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
2707 __ Branch(&miss, ne, t1, Operand(at));
2708 2699
2709 // Increment the call count for monomorphic function calls. 2700 // Increment the call count for monomorphic function calls.
2710 __ sll(at, a3, kPointerSizeLog2 - kSmiTagSize); 2701 __ sll(at, a3, kPointerSizeLog2 - kSmiTagSize);
2711 __ Addu(at, a2, Operand(at)); 2702 __ Addu(at, a2, Operand(at));
2712 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); 2703 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
2713 __ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); 2704 __ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
2714 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); 2705 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
2715 2706
2716 __ mov(a2, t0); 2707 __ mov(a2, t0);
2717 __ mov(a3, a1); 2708 __ mov(a3, a1);
2718 ArrayConstructorStub stub(masm->isolate(), arg_count()); 2709 ArrayConstructorStub stub(masm->isolate(), arg_count());
2719 __ TailCallStub(&stub); 2710 __ TailCallStub(&stub);
2720
2721 __ bind(&miss);
2722 GenerateMiss(masm);
2723
2724 // The slow case, we need this no matter what to complete a call after a miss.
2725 __ li(a0, Operand(arg_count()));
2726 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2727 } 2711 }
2728 2712
2729 2713
2730 void CallICStub::Generate(MacroAssembler* masm) { 2714 void CallICStub::Generate(MacroAssembler* masm) {
2731 // a1 - function 2715 // a1 - function
2732 // a3 - slot id (Smi) 2716 // a3 - slot id (Smi)
2733 // a2 - vector 2717 // a2 - vector
2734 const int with_types_offset = 2718 const int with_types_offset =
2735 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); 2719 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
2736 const int generic_offset = 2720 const int generic_offset =
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 2775
2792 __ bind(&slow); 2776 __ bind(&slow);
2793 EmitSlowCase(masm, argc); 2777 EmitSlowCase(masm, argc);
2794 2778
2795 if (CallAsMethod()) { 2779 if (CallAsMethod()) {
2796 __ bind(&wrap); 2780 __ bind(&wrap);
2797 EmitWrapCase(masm, argc, &cont); 2781 EmitWrapCase(masm, argc, &cont);
2798 } 2782 }
2799 2783
2800 __ bind(&extra_checks_or_miss); 2784 __ bind(&extra_checks_or_miss);
2801 Label uninitialized, miss; 2785 Label uninitialized, miss, not_allocation_site;
2802 2786
2803 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); 2787 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex);
2804 __ Branch(&slow_start, eq, t0, Operand(at)); 2788 __ Branch(&slow_start, eq, t0, Operand(at));
2805 2789
2790 // Verify that t0 contains an AllocationSite
2791 __ lw(t1, FieldMemOperand(t0, HeapObject::kMapOffset));
2792 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
2793 __ Branch(&not_allocation_site, ne, t1, Operand(at));
2794
2795 HandleArrayCase(masm, &miss);
2796
2797 __ bind(&not_allocation_site);
2798
2806 // The following cases attempt to handle MISS cases without going to the 2799 // The following cases attempt to handle MISS cases without going to the
2807 // runtime. 2800 // runtime.
2808 if (FLAG_trace_ic) { 2801 if (FLAG_trace_ic) {
2809 __ Branch(&miss); 2802 __ Branch(&miss);
2810 } 2803 }
2811 2804
2812 __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex); 2805 __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex);
2813 __ Branch(&uninitialized, eq, t0, Operand(at)); 2806 __ Branch(&uninitialized, eq, t0, Operand(at));
2814 2807
2815 // We are going megamorphic. If the feedback is a JSFunction, it is fine 2808 // We are going megamorphic. If the feedback is a JSFunction, it is fine
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 } 2880 }
2888 2881
2889 2882
2890 void CallICStub::GenerateMiss(MacroAssembler* masm) { 2883 void CallICStub::GenerateMiss(MacroAssembler* masm) {
2891 FrameScope scope(masm, StackFrame::INTERNAL); 2884 FrameScope scope(masm, StackFrame::INTERNAL);
2892 2885
2893 // Push the receiver and the function and feedback info. 2886 // Push the receiver and the function and feedback info.
2894 __ Push(a1, a2, a3); 2887 __ Push(a1, a2, a3);
2895 2888
2896 // Call the entry. 2889 // Call the entry.
2897 Runtime::FunctionId id = GetICState() == DEFAULT 2890 __ CallRuntime(Runtime::kCallIC_Miss, 3);
2898 ? Runtime::kCallIC_Miss
2899 : Runtime::kCallIC_Customization_Miss;
2900 __ CallRuntime(id, 3);
2901 2891
2902 // Move result to a1 and exit the internal frame. 2892 // Move result to a1 and exit the internal frame.
2903 __ mov(a1, v0); 2893 __ mov(a1, v0);
2904 } 2894 }
2905 2895
2906 2896
2907 // StringCharCodeAtGenerator. 2897 // StringCharCodeAtGenerator.
2908 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { 2898 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
2909 DCHECK(!t0.is(index_)); 2899 DCHECK(!t0.is(index_));
2910 DCHECK(!t0.is(result_)); 2900 DCHECK(!t0.is(result_));
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
4492 } 4482 }
4493 4483
4494 4484
4495 void CallICTrampolineStub::Generate(MacroAssembler* masm) { 4485 void CallICTrampolineStub::Generate(MacroAssembler* masm) {
4496 EmitLoadTypeFeedbackVector(masm, a2); 4486 EmitLoadTypeFeedbackVector(masm, a2);
4497 CallICStub stub(isolate(), state()); 4487 CallICStub stub(isolate(), state());
4498 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); 4488 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4499 } 4489 }
4500 4490
4501 4491
4502 void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) {
4503 EmitLoadTypeFeedbackVector(masm, a2);
4504 CallIC_ArrayStub stub(isolate(), state());
4505 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4506 }
4507
4508
4509 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } 4492 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); }
4510 4493
4511 4494
4512 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { 4495 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) {
4513 GenerateImpl(masm, true); 4496 GenerateImpl(masm, true);
4514 } 4497 }
4515 4498
4516 4499
4517 static void HandleArrayCases(MacroAssembler* masm, Register feedback, 4500 static void HandleArrayCases(MacroAssembler* masm, Register feedback,
4518 Register receiver_map, Register scratch1, 4501 Register receiver_map, Register scratch1,
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
5764 MemOperand(fp, 6 * kPointerSize), NULL); 5747 MemOperand(fp, 6 * kPointerSize), NULL);
5765 } 5748 }
5766 5749
5767 5750
5768 #undef __ 5751 #undef __
5769 5752
5770 } // namespace internal 5753 } // namespace internal
5771 } // namespace v8 5754 } // namespace v8
5772 5755
5773 #endif // V8_TARGET_ARCH_MIPS 5756 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/ic-inl.h ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698