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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 RelocInfo::CODE_TARGET); | 1191 RelocInfo::CODE_TARGET); |
1192 } else { | 1192 } else { |
1193 DCHECK_EQ(function_type, CallableType::kAny); | 1193 DCHECK_EQ(function_type, CallableType::kAny); |
1194 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1194 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
1195 tail_call_mode), | 1195 tail_call_mode), |
1196 RelocInfo::CODE_TARGET); | 1196 RelocInfo::CODE_TARGET); |
1197 } | 1197 } |
1198 } | 1198 } |
1199 | 1199 |
1200 // static | 1200 // static |
1201 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1201 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( |
| 1202 MacroAssembler* masm, CallableType construct_type) { |
1202 // ----------- S t a t e ------------- | 1203 // ----------- S t a t e ------------- |
1203 // -- a0 : argument count (not including receiver) | 1204 // -- a0 : argument count (not including receiver) |
1204 // -- a3 : new target | 1205 // -- a3 : new target |
1205 // -- a1 : constructor to call | 1206 // -- a1 : constructor to call |
1206 // -- a2 : address of the first argument | 1207 // -- a2 : allocation site feedback if available, undefined otherwise. |
| 1208 // -- t4 : address of the first argument |
1207 // ----------------------------------- | 1209 // ----------------------------------- |
1208 | 1210 |
1209 // Find the address of the last argument. | 1211 // Find the address of the last argument. |
1210 __ sll(t0, a0, kPointerSizeLog2); | 1212 __ sll(t0, a0, kPointerSizeLog2); |
1211 __ Subu(t0, a2, Operand(t0)); | 1213 __ Subu(t0, t4, Operand(t0)); |
1212 | 1214 |
1213 // Push a slot for the receiver. | 1215 // Push a slot for the receiver. |
1214 __ push(zero_reg); | 1216 __ push(zero_reg); |
1215 | 1217 |
1216 // Push the arguments. | 1218 // Push the arguments. |
1217 Label loop_header, loop_check; | 1219 Label loop_header, loop_check; |
1218 __ Branch(&loop_check); | 1220 __ Branch(&loop_check); |
1219 __ bind(&loop_header); | 1221 __ bind(&loop_header); |
1220 __ lw(t1, MemOperand(a2)); | 1222 __ lw(t1, MemOperand(t4)); |
1221 __ Addu(a2, a2, Operand(-kPointerSize)); | 1223 __ Addu(t4, t4, Operand(-kPointerSize)); |
1222 __ push(t1); | 1224 __ push(t1); |
1223 __ bind(&loop_check); | 1225 __ bind(&loop_check); |
1224 __ Branch(&loop_header, gt, a2, Operand(t0)); | 1226 __ Branch(&loop_header, gt, t4, Operand(t0)); |
1225 | 1227 |
1226 // Call the constructor with a0, a1, and a3 unmodified. | 1228 __ AssertUndefinedOrAllocationSite(a2, t0); |
1227 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1229 if (construct_type == CallableType::kJSFunction) { |
| 1230 __ AssertFunction(a1); |
| 1231 |
| 1232 // Tail call to the function-specific construct stub (still in the caller |
| 1233 // context at this point). |
| 1234 __ lw(t0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 1235 __ lw(t0, FieldMemOperand(t0, SharedFunctionInfo::kConstructStubOffset)); |
| 1236 __ Addu(at, t0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1237 __ Jump(at); |
| 1238 } else { |
| 1239 DCHECK_EQ(construct_type, CallableType::kAny); |
| 1240 // Call the constructor with a0, a1, and a3 unmodified. |
| 1241 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| 1242 } |
1228 } | 1243 } |
1229 | 1244 |
1230 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1245 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
1231 // Set the return address to the correct point in the interpreter entry | 1246 // Set the return address to the correct point in the interpreter entry |
1232 // trampoline. | 1247 // trampoline. |
1233 Smi* interpreter_entry_return_pc_offset( | 1248 Smi* interpreter_entry_return_pc_offset( |
1234 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1249 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
1235 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); | 1250 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
1236 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); | 1251 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); |
1237 __ Addu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + | 1252 __ Addu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3001 __ break_(0xCC); | 3016 __ break_(0xCC); |
3002 } | 3017 } |
3003 } | 3018 } |
3004 | 3019 |
3005 #undef __ | 3020 #undef __ |
3006 | 3021 |
3007 } // namespace internal | 3022 } // namespace internal |
3008 } // namespace v8 | 3023 } // namespace v8 |
3009 | 3024 |
3010 #endif // V8_TARGET_ARCH_MIPS | 3025 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |