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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 // Jump to the construct function. | 1242 // Jump to the construct function. |
1243 __ add(pc, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1243 __ add(pc, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1244 | 1244 |
1245 } else { | 1245 } else { |
1246 DCHECK_EQ(construct_type, CallableType::kAny); | 1246 DCHECK_EQ(construct_type, CallableType::kAny); |
1247 // Call the constructor with r0, r1, and r3 unmodified. | 1247 // Call the constructor with r0, r1, and r3 unmodified. |
1248 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1248 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
1249 } | 1249 } |
1250 } | 1250 } |
1251 | 1251 |
| 1252 // static |
| 1253 void Builtins::Generate_InterpreterPushArgsAndConstructArray( |
| 1254 MacroAssembler* masm) { |
| 1255 // ----------- S t a t e ------------- |
| 1256 // -- r0 : argument count (not including receiver) |
| 1257 // -- r1 : target to call verified to be Array function |
| 1258 // -- r2 : allocation site feedback if available, undefined otherwise. |
| 1259 // -- r3 : address of the first argument |
| 1260 // ----------------------------------- |
| 1261 |
| 1262 // Find the address of the last argument. |
| 1263 __ add(r4, r0, Operand(1)); // Add one for receiver. |
| 1264 __ mov(r4, Operand(r4, LSL, kPointerSizeLog2)); |
| 1265 __ sub(r4, r3, r4); |
| 1266 |
| 1267 // TODO(mythria): Add a stack check before pushing arguments. |
| 1268 // Push the arguments. |
| 1269 Generate_InterpreterPushArgs(masm, r3, r4, r5); |
| 1270 |
| 1271 // Array constructor expects constructor in r3. It is same as r1 here. |
| 1272 __ mov(r3, r1); |
| 1273 |
| 1274 ArrayConstructorStub stub(masm->isolate()); |
| 1275 __ TailCallStub(&stub); |
| 1276 } |
| 1277 |
1252 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1278 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
1253 // Set the return address to the correct point in the interpreter entry | 1279 // Set the return address to the correct point in the interpreter entry |
1254 // trampoline. | 1280 // trampoline. |
1255 Smi* interpreter_entry_return_pc_offset( | 1281 Smi* interpreter_entry_return_pc_offset( |
1256 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1282 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
1257 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); | 1283 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
1258 __ Move(r2, masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 1284 __ Move(r2, masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
1259 __ add(lr, r2, Operand(interpreter_entry_return_pc_offset->value() + | 1285 __ add(lr, r2, Operand(interpreter_entry_return_pc_offset->value() + |
1260 Code::kHeaderSize - kHeapObjectTag)); | 1286 Code::kHeaderSize - kHeapObjectTag)); |
1261 | 1287 |
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2951 __ bkpt(0); | 2977 __ bkpt(0); |
2952 } | 2978 } |
2953 } | 2979 } |
2954 | 2980 |
2955 #undef __ | 2981 #undef __ |
2956 | 2982 |
2957 } // namespace internal | 2983 } // namespace internal |
2958 } // namespace v8 | 2984 } // namespace v8 |
2959 | 2985 |
2960 #endif // V8_TARGET_ARCH_ARM | 2986 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |