| 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 : address of the first argument |
| 1199 // ----------------------------------- | 1200 // ----------------------------------- |
| 1200 | 1201 |
| 1201 // Find the address of the last argument. | 1202 // Find the address of the last argument. |
| 1202 __ dsll(t0, a0, kPointerSizeLog2); | 1203 __ dsll(t0, a0, kPointerSizeLog2); |
| 1203 __ Dsubu(t0, a2, Operand(t0)); | 1204 __ Dsubu(t0, a2, Operand(t0)); |
| 1204 | 1205 |
| 1205 // Push a slot for the receiver. | 1206 // Push a slot for the receiver. |
| 1206 __ push(zero_reg); | 1207 __ push(zero_reg); |
| 1207 | 1208 |
| 1208 // Push the arguments. | 1209 // Push the arguments. |
| 1209 Label loop_header, loop_check; | 1210 Label loop_header, loop_check; |
| 1210 __ Branch(&loop_check); | 1211 __ Branch(&loop_check); |
| 1211 __ bind(&loop_header); | 1212 __ bind(&loop_header); |
| 1212 __ ld(t1, MemOperand(a2)); | 1213 __ ld(t1, MemOperand(a2)); |
| 1213 __ Daddu(a2, a2, Operand(-kPointerSize)); | 1214 __ Daddu(a2, a2, Operand(-kPointerSize)); |
| 1214 __ push(t1); | 1215 __ push(t1); |
| 1215 __ bind(&loop_check); | 1216 __ bind(&loop_check); |
| 1216 __ Branch(&loop_header, gt, a2, Operand(t0)); | 1217 __ Branch(&loop_header, gt, a2, Operand(t0)); |
| 1217 | 1218 |
| 1218 // Call the constructor with a0, a1, and a3 unmodified. | 1219 if (construct_type == CallableType::kJSFunction) { |
| 1219 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1220 // TODO(mythria): Change this when allocation site feedback is available. |
| 1221 // ConstructFunction initializes allocation site to undefined. |
| 1222 __ Jump(masm->isolate()->builtins()->ConstructFunction(), |
| 1223 RelocInfo::CODE_TARGET); |
| 1224 } else { |
| 1225 DCHECK_EQ(construct_type, CallableType::kAny); |
| 1226 // Call the constructor with a0, a1, and a3 unmodified. |
| 1227 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| 1228 } |
| 1220 } | 1229 } |
| 1221 | 1230 |
| 1222 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1231 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1223 // Set the return address to the correct point in the interpreter entry | 1232 // Set the return address to the correct point in the interpreter entry |
| 1224 // trampoline. | 1233 // trampoline. |
| 1225 Smi* interpreter_entry_return_pc_offset( | 1234 Smi* interpreter_entry_return_pc_offset( |
| 1226 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1235 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
| 1227 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); | 1236 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
| 1228 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); | 1237 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); |
| 1229 __ Daddu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + | 1238 __ Daddu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + |
| (...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 __ break_(0xCC); | 2985 __ break_(0xCC); |
| 2977 } | 2986 } |
| 2978 } | 2987 } |
| 2979 | 2988 |
| 2980 #undef __ | 2989 #undef __ |
| 2981 | 2990 |
| 2982 } // namespace internal | 2991 } // namespace internal |
| 2983 } // namespace v8 | 2992 } // namespace v8 |
| 2984 | 2993 |
| 2985 #endif // V8_TARGET_ARCH_MIPS64 | 2994 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |