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_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 2635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2646 // convincing us that we have a monomorphic JSFunction. | 2646 // convincing us that we have a monomorphic JSFunction. |
2647 __ JumpIfSmi(a1, &extra_checks_or_miss); | 2647 __ JumpIfSmi(a1, &extra_checks_or_miss); |
2648 | 2648 |
2649 // Increment the call count for monomorphic function calls. | 2649 // Increment the call count for monomorphic function calls. |
2650 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); | 2650 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); |
2651 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); | 2651 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
2652 __ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2652 __ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
2653 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); | 2653 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
2654 | 2654 |
2655 __ bind(&call_function); | 2655 __ bind(&call_function); |
2656 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()), | 2656 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
| 2657 tail_call_mode()), |
2657 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), | 2658 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), |
2658 USE_DELAY_SLOT); | 2659 USE_DELAY_SLOT); |
2659 __ li(a0, Operand(argc)); // In delay slot. | 2660 __ li(a0, Operand(argc)); // In delay slot. |
2660 | 2661 |
2661 __ bind(&extra_checks_or_miss); | 2662 __ bind(&extra_checks_or_miss); |
2662 Label uninitialized, miss, not_allocation_site; | 2663 Label uninitialized, miss, not_allocation_site; |
2663 | 2664 |
2664 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 2665 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2665 __ Branch(&call, eq, t0, Operand(at)); | 2666 __ Branch(&call, eq, t0, Operand(at)); |
2666 | 2667 |
(...skipping 18 matching lines...) Expand all Loading... |
2685 // We are going megamorphic. If the feedback is a JSFunction, it is fine | 2686 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
2686 // to handle it here. More complex cases are dealt with in the runtime. | 2687 // to handle it here. More complex cases are dealt with in the runtime. |
2687 __ AssertNotSmi(t0); | 2688 __ AssertNotSmi(t0); |
2688 __ GetObjectType(t0, t1, t1); | 2689 __ GetObjectType(t0, t1, t1); |
2689 __ Branch(&miss, ne, t1, Operand(JS_FUNCTION_TYPE)); | 2690 __ Branch(&miss, ne, t1, Operand(JS_FUNCTION_TYPE)); |
2690 __ Lsa(t0, a2, a3, kPointerSizeLog2 - kSmiTagSize); | 2691 __ Lsa(t0, a2, a3, kPointerSizeLog2 - kSmiTagSize); |
2691 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 2692 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2692 __ sw(at, FieldMemOperand(t0, FixedArray::kHeaderSize)); | 2693 __ sw(at, FieldMemOperand(t0, FixedArray::kHeaderSize)); |
2693 | 2694 |
2694 __ bind(&call); | 2695 __ bind(&call); |
2695 __ Jump(masm->isolate()->builtins()->Call(convert_mode()), | 2696 __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), |
2696 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), | 2697 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), |
2697 USE_DELAY_SLOT); | 2698 USE_DELAY_SLOT); |
2698 __ li(a0, Operand(argc)); // In delay slot. | 2699 __ li(a0, Operand(argc)); // In delay slot. |
2699 | 2700 |
2700 __ bind(&uninitialized); | 2701 __ bind(&uninitialized); |
2701 | 2702 |
2702 // We are going monomorphic, provided we actually have a JSFunction. | 2703 // We are going monomorphic, provided we actually have a JSFunction. |
2703 __ JumpIfSmi(a1, &miss); | 2704 __ JumpIfSmi(a1, &miss); |
2704 | 2705 |
2705 // Goto miss case if we do not have a function. | 2706 // Goto miss case if we do not have a function. |
(...skipping 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5617 return_value_operand, NULL); | 5618 return_value_operand, NULL); |
5618 } | 5619 } |
5619 | 5620 |
5620 | 5621 |
5621 #undef __ | 5622 #undef __ |
5622 | 5623 |
5623 } // namespace internal | 5624 } // namespace internal |
5624 } // namespace v8 | 5625 } // namespace v8 |
5625 | 5626 |
5626 #endif // V8_TARGET_ARCH_MIPS | 5627 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |