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/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 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 RelocInfo::CODE_TARGET); | 1183 RelocInfo::CODE_TARGET); |
1184 } else { | 1184 } else { |
1185 DCHECK_EQ(function_type, CallableType::kAny); | 1185 DCHECK_EQ(function_type, CallableType::kAny); |
1186 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1186 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
1187 tail_call_mode), | 1187 tail_call_mode), |
1188 RelocInfo::CODE_TARGET); | 1188 RelocInfo::CODE_TARGET); |
1189 } | 1189 } |
1190 } | 1190 } |
1191 | 1191 |
1192 // static | 1192 // static |
1193 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( | 1193 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
1194 MacroAssembler* masm, CallableType construct_type) { | |
1195 // ----------- S t a t e ------------- | 1194 // ----------- S t a t e ------------- |
1196 // -- a0 : argument count (not including receiver) | 1195 // -- a0 : argument count (not including receiver) |
1197 // -- a3 : new target | 1196 // -- a3 : new target |
1198 // -- a1 : constructor to call | 1197 // -- a1 : constructor to call |
1199 // -- a2 : allocation site feedback if available, undefined otherwise. | 1198 // -- a2 : address of the first argument |
1200 // -- a4 : address of the first argument | |
1201 // ----------------------------------- | 1199 // ----------------------------------- |
1202 | 1200 |
1203 // Find the address of the last argument. | 1201 // Find the address of the last argument. |
1204 __ dsll(t0, a0, kPointerSizeLog2); | 1202 __ dsll(t0, a0, kPointerSizeLog2); |
1205 __ Dsubu(t0, a4, Operand(t0)); | 1203 __ Dsubu(t0, a2, Operand(t0)); |
1206 | 1204 |
1207 // Push a slot for the receiver. | 1205 // Push a slot for the receiver. |
1208 __ push(zero_reg); | 1206 __ push(zero_reg); |
1209 | 1207 |
1210 // Push the arguments. | 1208 // Push the arguments. |
1211 Label loop_header, loop_check; | 1209 Label loop_header, loop_check; |
1212 __ Branch(&loop_check); | 1210 __ Branch(&loop_check); |
1213 __ bind(&loop_header); | 1211 __ bind(&loop_header); |
1214 __ ld(t1, MemOperand(a4)); | 1212 __ ld(t1, MemOperand(a2)); |
1215 __ Daddu(a4, a4, Operand(-kPointerSize)); | 1213 __ Daddu(a2, a2, Operand(-kPointerSize)); |
1216 __ push(t1); | 1214 __ push(t1); |
1217 __ bind(&loop_check); | 1215 __ bind(&loop_check); |
1218 __ Branch(&loop_header, gt, a4, Operand(t0)); | 1216 __ Branch(&loop_header, gt, a2, Operand(t0)); |
1219 | 1217 |
1220 __ AssertUndefinedOrAllocationSite(a2, t0); | 1218 // Call the constructor with a0, a1, and a3 unmodified. |
1221 if (construct_type == CallableType::kJSFunction) { | 1219 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
1222 __ AssertFunction(a1); | |
1223 | |
1224 // Tail call to the function-specific construct stub (still in the caller | |
1225 // context at this point). | |
1226 __ ld(a4, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | |
1227 __ ld(a4, FieldMemOperand(a4, SharedFunctionInfo::kConstructStubOffset)); | |
1228 __ Daddu(at, a4, Operand(Code::kHeaderSize - kHeapObjectTag)); | |
1229 __ Jump(at); | |
1230 } else { | |
1231 DCHECK_EQ(construct_type, CallableType::kAny); | |
1232 // Call the constructor with a0, a1, and a3 unmodified. | |
1233 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
1234 } | |
1235 } | 1220 } |
1236 | 1221 |
1237 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1222 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
1238 // Set the return address to the correct point in the interpreter entry | 1223 // Set the return address to the correct point in the interpreter entry |
1239 // trampoline. | 1224 // trampoline. |
1240 Smi* interpreter_entry_return_pc_offset( | 1225 Smi* interpreter_entry_return_pc_offset( |
1241 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1226 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
1242 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); | 1227 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
1243 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); | 1228 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); |
1244 __ Daddu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + | 1229 __ Daddu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + |
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3012 __ break_(0xCC); | 2997 __ break_(0xCC); |
3013 } | 2998 } |
3014 } | 2999 } |
3015 | 3000 |
3016 #undef __ | 3001 #undef __ |
3017 | 3002 |
3018 } // namespace internal | 3003 } // namespace internal |
3019 } // namespace v8 | 3004 } // namespace v8 |
3020 | 3005 |
3021 #endif // V8_TARGET_ARCH_MIPS64 | 3006 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |