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