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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 __ b(eq, &throw_termination_exception); | 1137 __ b(eq, &throw_termination_exception); |
1138 | 1138 |
1139 // Handle normal exception. | 1139 // Handle normal exception. |
1140 __ Throw(r0); | 1140 __ Throw(r0); |
1141 | 1141 |
1142 __ bind(&throw_termination_exception); | 1142 __ bind(&throw_termination_exception); |
1143 __ ThrowUncatchable(r0); | 1143 __ ThrowUncatchable(r0); |
1144 } | 1144 } |
1145 | 1145 |
1146 | 1146 |
1147 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { | 1147 void JSEntryStub::Generate(MacroAssembler* masm) { |
1148 // r0: code entry | 1148 // r0: code entry |
1149 // r1: function | 1149 // r1: function |
1150 // r2: receiver | 1150 // r2: receiver |
1151 // r3: argc | 1151 // r3: argc |
1152 // [sp+0]: argv | 1152 // [sp+0]: argv |
1153 | 1153 |
1154 Label invoke, handler_entry, exit; | 1154 Label invoke, handler_entry, exit; |
1155 | 1155 |
1156 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 1156 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
1157 | 1157 |
(...skipping 18 matching lines...) Expand all Loading... |
1176 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; | 1176 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; |
1177 offset_to_argv += kNumDoubleCalleeSaved * kDoubleSize; | 1177 offset_to_argv += kNumDoubleCalleeSaved * kDoubleSize; |
1178 __ ldr(r4, MemOperand(sp, offset_to_argv)); | 1178 __ ldr(r4, MemOperand(sp, offset_to_argv)); |
1179 | 1179 |
1180 // Push a frame with special values setup to mark it as an entry frame. | 1180 // Push a frame with special values setup to mark it as an entry frame. |
1181 // r0: code entry | 1181 // r0: code entry |
1182 // r1: function | 1182 // r1: function |
1183 // r2: receiver | 1183 // r2: receiver |
1184 // r3: argc | 1184 // r3: argc |
1185 // r4: argv | 1185 // r4: argv |
1186 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 1186 int marker = type(); |
1187 if (FLAG_enable_ool_constant_pool) { | 1187 if (FLAG_enable_ool_constant_pool) { |
1188 __ mov(r8, Operand(isolate()->factory()->empty_constant_pool_array())); | 1188 __ mov(r8, Operand(isolate()->factory()->empty_constant_pool_array())); |
1189 } | 1189 } |
1190 __ mov(r7, Operand(Smi::FromInt(marker))); | 1190 __ mov(r7, Operand(Smi::FromInt(marker))); |
1191 __ mov(r6, Operand(Smi::FromInt(marker))); | 1191 __ mov(r6, Operand(Smi::FromInt(marker))); |
1192 __ mov(r5, | 1192 __ mov(r5, |
1193 Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 1193 Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
1194 __ ldr(r5, MemOperand(r5)); | 1194 __ ldr(r5, MemOperand(r5)); |
1195 __ mov(ip, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 1195 __ mov(ip, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
1196 __ stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | | 1196 __ stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 // Invoke the function by calling through JS entry trampoline builtin. | 1257 // Invoke the function by calling through JS entry trampoline builtin. |
1258 // Notice that we cannot store a reference to the trampoline code directly in | 1258 // Notice that we cannot store a reference to the trampoline code directly in |
1259 // this stub, because runtime stubs are not traversed when doing GC. | 1259 // this stub, because runtime stubs are not traversed when doing GC. |
1260 | 1260 |
1261 // Expected registers by Builtins::JSEntryTrampoline | 1261 // Expected registers by Builtins::JSEntryTrampoline |
1262 // r0: code entry | 1262 // r0: code entry |
1263 // r1: function | 1263 // r1: function |
1264 // r2: receiver | 1264 // r2: receiver |
1265 // r3: argc | 1265 // r3: argc |
1266 // r4: argv | 1266 // r4: argv |
1267 if (is_construct) { | 1267 if (type() == StackFrame::ENTRY_CONSTRUCT) { |
1268 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, | 1268 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, |
1269 isolate()); | 1269 isolate()); |
1270 __ mov(ip, Operand(construct_entry)); | 1270 __ mov(ip, Operand(construct_entry)); |
1271 } else { | 1271 } else { |
1272 ExternalReference entry(Builtins::kJSEntryTrampoline, isolate()); | 1272 ExternalReference entry(Builtins::kJSEntryTrampoline, isolate()); |
1273 __ mov(ip, Operand(entry)); | 1273 __ mov(ip, Operand(entry)); |
1274 } | 1274 } |
1275 __ ldr(ip, MemOperand(ip)); // deref address | 1275 __ ldr(ip, MemOperand(ip)); // deref address |
1276 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1276 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1277 | 1277 |
(...skipping 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4679 MemOperand(fp, 6 * kPointerSize), | 4679 MemOperand(fp, 6 * kPointerSize), |
4680 NULL); | 4680 NULL); |
4681 } | 4681 } |
4682 | 4682 |
4683 | 4683 |
4684 #undef __ | 4684 #undef __ |
4685 | 4685 |
4686 } } // namespace v8::internal | 4686 } } // namespace v8::internal |
4687 | 4687 |
4688 #endif // V8_TARGET_ARCH_ARM | 4688 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |