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