| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 // We are not trying to catch interruptions (e.g. debug break and | 1239 // We are not trying to catch interruptions (e.g. debug break and |
| 1240 // preemption) here, so the "real stack limit" is checked. | 1240 // preemption) here, so the "real stack limit" is checked. |
| 1241 Label enough_stack_space; | 1241 Label enough_stack_space; |
| 1242 __ LoadRoot(x10, Heap::kRealStackLimitRootIndex); | 1242 __ LoadRoot(x10, Heap::kRealStackLimitRootIndex); |
| 1243 __ Ldr(function, MemOperand(fp, kFunctionOffset)); | 1243 __ Ldr(function, MemOperand(fp, kFunctionOffset)); |
| 1244 // Make x10 the space we have left. The stack might already be overflowed | 1244 // Make x10 the space we have left. The stack might already be overflowed |
| 1245 // here which will cause x10 to become negative. | 1245 // here which will cause x10 to become negative. |
| 1246 // TODO(jbramley): Check that the stack usage here is safe. | 1246 // TODO(jbramley): Check that the stack usage here is safe. |
| 1247 __ Sub(x10, jssp, x10); | 1247 __ Sub(x10, jssp, x10); |
| 1248 // Check if the arguments will overflow the stack. | 1248 // Check if the arguments will overflow the stack. |
| 1249 __ Cmp(x10, Operand(argc, LSR, kSmiShift - kPointerSizeLog2)); | 1249 __ Cmp(x10, Operand::UntagSmiAndScale(argc, kPointerSizeLog2)); |
| 1250 __ B(gt, &enough_stack_space); | 1250 __ B(gt, &enough_stack_space); |
| 1251 // There is not enough stack space, so use a builtin to throw an appropriate | 1251 // There is not enough stack space, so use a builtin to throw an appropriate |
| 1252 // error. | 1252 // error. |
| 1253 __ Push(function, argc); | 1253 __ Push(function, argc); |
| 1254 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 1254 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); |
| 1255 // We should never return from the APPLY_OVERFLOW builtin. | 1255 // We should never return from the APPLY_OVERFLOW builtin. |
| 1256 if (__ emit_debug_code()) { | 1256 if (__ emit_debug_code()) { |
| 1257 __ Unreachable(); | 1257 __ Unreachable(); |
| 1258 } | 1258 } |
| 1259 | 1259 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1556 __ Unreachable(); | 1556 __ Unreachable(); |
| 1557 } | 1557 } |
| 1558 } | 1558 } |
| 1559 | 1559 |
| 1560 | 1560 |
| 1561 #undef __ | 1561 #undef __ |
| 1562 | 1562 |
| 1563 } } // namespace v8::internal | 1563 } } // namespace v8::internal |
| 1564 | 1564 |
| 1565 #endif // V8_TARGET_ARCH_ARM | 1565 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |