OLD | NEW |
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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 2643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2654 | 2654 |
2655 | 2655 |
2656 void CallICStub::Generate(MacroAssembler* masm) { | 2656 void CallICStub::Generate(MacroAssembler* masm) { |
2657 // a1 - function | 2657 // a1 - function |
2658 // a3 - slot id (Smi) | 2658 // a3 - slot id (Smi) |
2659 // a2 - vector | 2659 // a2 - vector |
2660 const int with_types_offset = | 2660 const int with_types_offset = |
2661 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); | 2661 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); |
2662 const int generic_offset = | 2662 const int generic_offset = |
2663 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); | 2663 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); |
2664 Label extra_checks_or_miss, call; | 2664 Label extra_checks_or_miss, call, call_function; |
2665 int argc = arg_count(); | 2665 int argc = arg_count(); |
2666 ParameterCount actual(argc); | 2666 ParameterCount actual(argc); |
2667 | 2667 |
2668 // The checks. First, does r1 match the recorded monomorphic target? | 2668 // The checks. First, does r1 match the recorded monomorphic target? |
2669 __ dsrl(a4, a3, 32 - kPointerSizeLog2); | 2669 __ dsrl(a4, a3, 32 - kPointerSizeLog2); |
2670 __ Daddu(a4, a2, Operand(a4)); | 2670 __ Daddu(a4, a2, Operand(a4)); |
2671 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize)); | 2671 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize)); |
2672 | 2672 |
2673 // We don't know that we have a weak cell. We might have a private symbol | 2673 // We don't know that we have a weak cell. We might have a private symbol |
2674 // or an AllocationSite, but the memory is safe to examine. | 2674 // or an AllocationSite, but the memory is safe to examine. |
(...skipping 16 matching lines...) Expand all Loading... |
2691 // convincing us that we have a monomorphic JSFunction. | 2691 // convincing us that we have a monomorphic JSFunction. |
2692 __ JumpIfSmi(a1, &extra_checks_or_miss); | 2692 __ JumpIfSmi(a1, &extra_checks_or_miss); |
2693 | 2693 |
2694 // Increment the call count for monomorphic function calls. | 2694 // Increment the call count for monomorphic function calls. |
2695 __ dsrl(t0, a3, 32 - kPointerSizeLog2); | 2695 __ dsrl(t0, a3, 32 - kPointerSizeLog2); |
2696 __ Daddu(a3, a2, Operand(t0)); | 2696 __ Daddu(a3, a2, Operand(t0)); |
2697 __ ld(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); | 2697 __ ld(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); |
2698 __ Daddu(t0, t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2698 __ Daddu(t0, t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
2699 __ sd(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); | 2699 __ sd(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); |
2700 | 2700 |
2701 __ bind(&call); | 2701 __ bind(&call_function); |
2702 __ li(a0, Operand(argc)); | 2702 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()), |
2703 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2703 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), |
| 2704 USE_DELAY_SLOT); |
| 2705 __ li(a0, Operand(argc)); // In delay slot. |
2704 | 2706 |
2705 __ bind(&extra_checks_or_miss); | 2707 __ bind(&extra_checks_or_miss); |
2706 Label uninitialized, miss, not_allocation_site; | 2708 Label uninitialized, miss, not_allocation_site; |
2707 | 2709 |
2708 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 2710 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2709 __ Branch(&call, eq, a4, Operand(at)); | 2711 __ Branch(&call, eq, a4, Operand(at)); |
2710 | 2712 |
2711 // Verify that a4 contains an AllocationSite | 2713 // Verify that a4 contains an AllocationSite |
2712 __ ld(a5, FieldMemOperand(a4, HeapObject::kMapOffset)); | 2714 __ ld(a5, FieldMemOperand(a4, HeapObject::kMapOffset)); |
2713 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 2715 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
(...skipping 20 matching lines...) Expand all Loading... |
2734 __ dsrl(a4, a3, 32 - kPointerSizeLog2); | 2736 __ dsrl(a4, a3, 32 - kPointerSizeLog2); |
2735 __ Daddu(a4, a2, Operand(a4)); | 2737 __ Daddu(a4, a2, Operand(a4)); |
2736 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 2738 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2737 __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); | 2739 __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); |
2738 // We have to update statistics for runtime profiling. | 2740 // We have to update statistics for runtime profiling. |
2739 __ ld(a4, FieldMemOperand(a2, with_types_offset)); | 2741 __ ld(a4, FieldMemOperand(a2, with_types_offset)); |
2740 __ Dsubu(a4, a4, Operand(Smi::FromInt(1))); | 2742 __ Dsubu(a4, a4, Operand(Smi::FromInt(1))); |
2741 __ sd(a4, FieldMemOperand(a2, with_types_offset)); | 2743 __ sd(a4, FieldMemOperand(a2, with_types_offset)); |
2742 __ ld(a4, FieldMemOperand(a2, generic_offset)); | 2744 __ ld(a4, FieldMemOperand(a2, generic_offset)); |
2743 __ Daddu(a4, a4, Operand(Smi::FromInt(1))); | 2745 __ Daddu(a4, a4, Operand(Smi::FromInt(1))); |
2744 __ Branch(USE_DELAY_SLOT, &call); | 2746 __ sd(a4, FieldMemOperand(a2, generic_offset)); |
2745 __ sd(a4, FieldMemOperand(a2, generic_offset)); // In delay slot. | 2747 |
| 2748 __ bind(&call); |
| 2749 __ Jump(masm->isolate()->builtins()->Call(convert_mode()), |
| 2750 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), |
| 2751 USE_DELAY_SLOT); |
| 2752 __ li(a0, Operand(argc)); // In delay slot. |
2746 | 2753 |
2747 __ bind(&uninitialized); | 2754 __ bind(&uninitialized); |
2748 | 2755 |
2749 // We are going monomorphic, provided we actually have a JSFunction. | 2756 // We are going monomorphic, provided we actually have a JSFunction. |
2750 __ JumpIfSmi(a1, &miss); | 2757 __ JumpIfSmi(a1, &miss); |
2751 | 2758 |
2752 // Goto miss case if we do not have a function. | 2759 // Goto miss case if we do not have a function. |
2753 __ GetObjectType(a1, a4, a4); | 2760 __ GetObjectType(a1, a4, a4); |
2754 __ Branch(&miss, ne, a4, Operand(JS_FUNCTION_TYPE)); | 2761 __ Branch(&miss, ne, a4, Operand(JS_FUNCTION_TYPE)); |
2755 | 2762 |
(...skipping 25 matching lines...) Expand all Loading... |
2781 // a3 - slot | 2788 // a3 - slot |
2782 // a1 - function | 2789 // a1 - function |
2783 { | 2790 { |
2784 FrameScope scope(masm, StackFrame::INTERNAL); | 2791 FrameScope scope(masm, StackFrame::INTERNAL); |
2785 CreateWeakCellStub create_stub(masm->isolate()); | 2792 CreateWeakCellStub create_stub(masm->isolate()); |
2786 __ Push(a1); | 2793 __ Push(a1); |
2787 __ CallStub(&create_stub); | 2794 __ CallStub(&create_stub); |
2788 __ Pop(a1); | 2795 __ Pop(a1); |
2789 } | 2796 } |
2790 | 2797 |
2791 __ Branch(&call); | 2798 __ Branch(&call_function); |
2792 | 2799 |
2793 // We are here because tracing is on or we encountered a MISS case we can't | 2800 // We are here because tracing is on or we encountered a MISS case we can't |
2794 // handle here. | 2801 // handle here. |
2795 __ bind(&miss); | 2802 __ bind(&miss); |
2796 GenerateMiss(masm); | 2803 GenerateMiss(masm); |
2797 | 2804 |
2798 __ Branch(&call); | 2805 __ Branch(&call); |
2799 } | 2806 } |
2800 | 2807 |
2801 | 2808 |
(...skipping 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5605 MemOperand(fp, 6 * kPointerSize), NULL); | 5612 MemOperand(fp, 6 * kPointerSize), NULL); |
5606 } | 5613 } |
5607 | 5614 |
5608 | 5615 |
5609 #undef __ | 5616 #undef __ |
5610 | 5617 |
5611 } // namespace internal | 5618 } // namespace internal |
5612 } // namespace v8 | 5619 } // namespace v8 |
5613 | 5620 |
5614 #endif // V8_TARGET_ARCH_MIPS64 | 5621 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |