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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 __ cmp(r0, Operand(1)); | 2509 __ cmp(r0, Operand(1)); |
2510 // We expect exactly one result since we force the called regexp to behave | 2510 // We expect exactly one result since we force the called regexp to behave |
2511 // as non-global. | 2511 // as non-global. |
2512 __ b(eq, &success); | 2512 __ b(eq, &success); |
2513 Label failure; | 2513 Label failure; |
2514 __ cmp(r0, Operand(NativeRegExpMacroAssembler::FAILURE)); | 2514 __ cmp(r0, Operand(NativeRegExpMacroAssembler::FAILURE)); |
2515 __ b(eq, &failure); | 2515 __ b(eq, &failure); |
2516 __ cmp(r0, Operand(NativeRegExpMacroAssembler::EXCEPTION)); | 2516 __ cmp(r0, Operand(NativeRegExpMacroAssembler::EXCEPTION)); |
2517 // If not exception it can only be retry. Handle that in the runtime system. | 2517 // If not exception it can only be retry. Handle that in the runtime system. |
2518 __ b(ne, &runtime); | 2518 __ b(ne, &runtime); |
2519 // Result must now be exception. If there is no pending exception already a | 2519 |
2520 // stack overflow (on the backtrack stack) was detected in RegExp code but | 2520 // Result must now be exception. |
2521 // haven't created the exception yet. Handle that in the runtime system. | |
2522 // TODO(592): Rerunning the RegExp to get the stack overflow exception. | |
2523 __ mov(r1, Operand(isolate()->factory()->the_hole_value())); | 2521 __ mov(r1, Operand(isolate()->factory()->the_hole_value())); |
2524 __ mov(r2, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 2522 __ mov(r2, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
2525 isolate()))); | 2523 isolate()))); |
2526 __ ldr(r0, MemOperand(r2, 0)); | 2524 __ ldr(r0, MemOperand(r2, 0)); |
2527 __ cmp(r0, r1); | |
2528 __ b(eq, &runtime); | |
2529 | |
2530 __ str(r1, MemOperand(r2, 0)); // Clear pending exception. | 2525 __ str(r1, MemOperand(r2, 0)); // Clear pending exception. |
2531 | 2526 |
2532 // Check if the exception is a termination. If so, throw as uncatchable. | 2527 // Check if the exception is a termination. If so, throw as uncatchable. |
2533 __ CompareRoot(r0, Heap::kTerminationExceptionRootIndex); | 2528 __ CompareRoot(r0, Heap::kTerminationExceptionRootIndex); |
2534 | 2529 |
2535 Label termination_exception; | 2530 Label termination_exception; |
2536 __ b(eq, &termination_exception); | 2531 __ b(eq, &termination_exception); |
2537 | 2532 |
2538 __ Throw(r0); | 2533 __ Throw(r0); |
2539 | 2534 |
(...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5072 MemOperand(fp, 6 * kPointerSize), | 5067 MemOperand(fp, 6 * kPointerSize), |
5073 NULL); | 5068 NULL); |
5074 } | 5069 } |
5075 | 5070 |
5076 | 5071 |
5077 #undef __ | 5072 #undef __ |
5078 | 5073 |
5079 } } // namespace v8::internal | 5074 } } // namespace v8::internal |
5080 | 5075 |
5081 #endif // V8_TARGET_ARCH_ARM | 5076 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |