| 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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 RelocInfo::CODE_TARGET); | 1199 RelocInfo::CODE_TARGET); |
| 1200 } else { | 1200 } else { |
| 1201 DCHECK_EQ(function_type, CallableType::kAny); | 1201 DCHECK_EQ(function_type, CallableType::kAny); |
| 1202 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1202 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 1203 tail_call_mode), | 1203 tail_call_mode), |
| 1204 RelocInfo::CODE_TARGET); | 1204 RelocInfo::CODE_TARGET); |
| 1205 } | 1205 } |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 // static | 1208 // static |
| 1209 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1209 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( |
| 1210 MacroAssembler* masm, CallableType construct_type) { |
| 1210 // ----------- S t a t e ------------- | 1211 // ----------- S t a t e ------------- |
| 1211 // -- r0 : argument count (not including receiver) | 1212 // -- r0 : argument count (not including receiver) |
| 1212 // -- r3 : new target | 1213 // -- r3 : new target |
| 1213 // -- r1 : constructor to call | 1214 // -- r1 : constructor to call |
| 1214 // -- r2 : address of the first argument | 1215 // -- r2 : address of the first argument |
| 1215 // ----------------------------------- | 1216 // ----------------------------------- |
| 1216 | 1217 |
| 1217 // Find the address of the last argument. | 1218 // Find the address of the last argument. |
| 1218 __ mov(r4, Operand(r0, LSL, kPointerSizeLog2)); | 1219 __ mov(r4, Operand(r0, LSL, kPointerSizeLog2)); |
| 1219 __ sub(r4, r2, r4); | 1220 __ sub(r4, r2, r4); |
| 1220 | 1221 |
| 1221 // Push a slot for the receiver to be constructed. | 1222 // Push a slot for the receiver to be constructed. |
| 1222 __ mov(ip, Operand::Zero()); | 1223 __ mov(ip, Operand::Zero()); |
| 1223 __ push(ip); | 1224 __ push(ip); |
| 1224 | 1225 |
| 1225 // Push the arguments. | 1226 // Push the arguments. |
| 1226 Generate_InterpreterPushArgs(masm, r2, r4, r5); | 1227 Generate_InterpreterPushArgs(masm, r2, r4, r5); |
| 1227 | 1228 |
| 1228 // Call the constructor with r0, r1, and r3 unmodified. | 1229 if (construct_type == CallableType::kJSFunction) { |
| 1229 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1230 // TODO(mythria): Change this when allocation site feedback is available. |
| 1231 // ConstructFunction initializes allocation site to undefined. |
| 1232 __ Jump(masm->isolate()->builtins()->ConstructFunction(), |
| 1233 RelocInfo::CODE_TARGET); |
| 1234 } else { |
| 1235 DCHECK_EQ(construct_type, CallableType::kAny); |
| 1236 // Call the constructor with r0, r1, and r3 unmodified. |
| 1237 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| 1238 } |
| 1230 } | 1239 } |
| 1231 | 1240 |
| 1232 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1241 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1233 // Set the return address to the correct point in the interpreter entry | 1242 // Set the return address to the correct point in the interpreter entry |
| 1234 // trampoline. | 1243 // trampoline. |
| 1235 Smi* interpreter_entry_return_pc_offset( | 1244 Smi* interpreter_entry_return_pc_offset( |
| 1236 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1245 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
| 1237 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); | 1246 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
| 1238 __ Move(r2, masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 1247 __ Move(r2, masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
| 1239 __ add(lr, r2, Operand(interpreter_entry_return_pc_offset->value() + | 1248 __ add(lr, r2, Operand(interpreter_entry_return_pc_offset->value() + |
| (...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 __ bkpt(0); | 2907 __ bkpt(0); |
| 2899 } | 2908 } |
| 2900 } | 2909 } |
| 2901 | 2910 |
| 2902 #undef __ | 2911 #undef __ |
| 2903 | 2912 |
| 2904 } // namespace internal | 2913 } // namespace internal |
| 2905 } // namespace v8 | 2914 } // namespace v8 |
| 2906 | 2915 |
| 2907 #endif // V8_TARGET_ARCH_ARM | 2916 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |