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