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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 // a2 - vector | 2049 // a2 - vector |
2050 // t0 - loaded from vector[slot] | 2050 // t0 - loaded from vector[slot] |
2051 __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, at); | 2051 __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, at); |
2052 __ Branch(miss, ne, a1, Operand(at)); | 2052 __ Branch(miss, ne, a1, Operand(at)); |
2053 | 2053 |
2054 __ li(a0, Operand(arg_count())); | 2054 __ li(a0, Operand(arg_count())); |
2055 | 2055 |
2056 // Increment the call count for monomorphic function calls. | 2056 // Increment the call count for monomorphic function calls. |
2057 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); | 2057 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); |
2058 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); | 2058 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
2059 __ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2059 __ Addu(a3, a3, Operand(Smi::FromInt(1))); |
2060 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); | 2060 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
2061 | 2061 |
2062 __ mov(a2, t0); | 2062 __ mov(a2, t0); |
2063 __ mov(a3, a1); | 2063 __ mov(a3, a1); |
2064 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 2064 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
2065 __ TailCallStub(&stub); | 2065 __ TailCallStub(&stub); |
2066 } | 2066 } |
2067 | 2067 |
2068 | 2068 |
2069 void CallICStub::Generate(MacroAssembler* masm) { | 2069 void CallICStub::Generate(MacroAssembler* masm) { |
(...skipping 25 matching lines...) Expand all Loading... |
2095 __ lw(t1, FieldMemOperand(t0, WeakCell::kValueOffset)); | 2095 __ lw(t1, FieldMemOperand(t0, WeakCell::kValueOffset)); |
2096 __ Branch(&extra_checks_or_miss, ne, a1, Operand(t1)); | 2096 __ Branch(&extra_checks_or_miss, ne, a1, Operand(t1)); |
2097 | 2097 |
2098 // The compare above could have been a SMI/SMI comparison. Guard against this | 2098 // The compare above could have been a SMI/SMI comparison. Guard against this |
2099 // convincing us that we have a monomorphic JSFunction. | 2099 // convincing us that we have a monomorphic JSFunction. |
2100 __ JumpIfSmi(a1, &extra_checks_or_miss); | 2100 __ JumpIfSmi(a1, &extra_checks_or_miss); |
2101 | 2101 |
2102 // Increment the call count for monomorphic function calls. | 2102 // Increment the call count for monomorphic function calls. |
2103 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); | 2103 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); |
2104 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); | 2104 __ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
2105 __ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2105 __ Addu(a3, a3, Operand(Smi::FromInt(1))); |
2106 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); | 2106 __ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
2107 | 2107 |
2108 __ bind(&call_function); | 2108 __ bind(&call_function); |
2109 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), | 2109 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
2110 tail_call_mode()), | 2110 tail_call_mode()), |
2111 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), | 2111 RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), |
2112 USE_DELAY_SLOT); | 2112 USE_DELAY_SLOT); |
2113 __ li(a0, Operand(argc)); // In delay slot. | 2113 __ li(a0, Operand(argc)); // In delay slot. |
2114 | 2114 |
2115 __ bind(&extra_checks_or_miss); | 2115 __ bind(&extra_checks_or_miss); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 __ Branch(&miss, eq, a1, Operand(t0)); | 2166 __ Branch(&miss, eq, a1, Operand(t0)); |
2167 | 2167 |
2168 // Make sure the function belongs to the same native context. | 2168 // Make sure the function belongs to the same native context. |
2169 __ lw(t0, FieldMemOperand(a1, JSFunction::kContextOffset)); | 2169 __ lw(t0, FieldMemOperand(a1, JSFunction::kContextOffset)); |
2170 __ lw(t0, ContextMemOperand(t0, Context::NATIVE_CONTEXT_INDEX)); | 2170 __ lw(t0, ContextMemOperand(t0, Context::NATIVE_CONTEXT_INDEX)); |
2171 __ lw(t1, NativeContextMemOperand()); | 2171 __ lw(t1, NativeContextMemOperand()); |
2172 __ Branch(&miss, ne, t0, Operand(t1)); | 2172 __ Branch(&miss, ne, t0, Operand(t1)); |
2173 | 2173 |
2174 // Initialize the call counter. | 2174 // Initialize the call counter. |
2175 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); | 2175 __ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize); |
2176 __ li(t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2176 __ li(t0, Operand(Smi::FromInt(1))); |
2177 __ sw(t0, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); | 2177 __ sw(t0, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
2178 | 2178 |
2179 // Store the function. Use a stub since we need a frame for allocation. | 2179 // Store the function. Use a stub since we need a frame for allocation. |
2180 // a2 - vector | 2180 // a2 - vector |
2181 // a3 - slot | 2181 // a3 - slot |
2182 // a1 - function | 2182 // a1 - function |
2183 { | 2183 { |
2184 FrameScope scope(masm, StackFrame::INTERNAL); | 2184 FrameScope scope(masm, StackFrame::INTERNAL); |
2185 CreateWeakCellStub create_stub(masm->isolate()); | 2185 CreateWeakCellStub create_stub(masm->isolate()); |
2186 __ Push(a1); | 2186 __ Push(a1); |
(...skipping 3437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5624 kStackUnwindSpace, kInvalidStackOffset, | 5624 kStackUnwindSpace, kInvalidStackOffset, |
5625 return_value_operand, NULL); | 5625 return_value_operand, NULL); |
5626 } | 5626 } |
5627 | 5627 |
5628 #undef __ | 5628 #undef __ |
5629 | 5629 |
5630 } // namespace internal | 5630 } // namespace internal |
5631 } // namespace v8 | 5631 } // namespace v8 |
5632 | 5632 |
5633 #endif // V8_TARGET_ARCH_MIPS | 5633 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |