| 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 __ cmp(eax, 1); | 1589 __ cmp(eax, 1); |
| 1590 // We expect exactly one result since we force the called regexp to behave | 1590 // We expect exactly one result since we force the called regexp to behave |
| 1591 // as non-global. | 1591 // as non-global. |
| 1592 __ j(equal, &success); | 1592 __ j(equal, &success); |
| 1593 Label failure; | 1593 Label failure; |
| 1594 __ cmp(eax, NativeRegExpMacroAssembler::FAILURE); | 1594 __ cmp(eax, NativeRegExpMacroAssembler::FAILURE); |
| 1595 __ j(equal, &failure); | 1595 __ j(equal, &failure); |
| 1596 __ cmp(eax, NativeRegExpMacroAssembler::EXCEPTION); | 1596 __ cmp(eax, NativeRegExpMacroAssembler::EXCEPTION); |
| 1597 // If not exception it can only be retry. Handle that in the runtime system. | 1597 // If not exception it can only be retry. Handle that in the runtime system. |
| 1598 __ j(not_equal, &runtime); | 1598 __ j(not_equal, &runtime); |
| 1599 // Result must now be exception. If there is no pending exception already a | 1599 |
| 1600 // stack overflow (on the backtrack stack) was detected in RegExp code but | 1600 // Result must now be exception. |
| 1601 // haven't created the exception yet. Handle that in the runtime system. | |
| 1602 // TODO(592): Rerunning the RegExp to get the stack overflow exception. | |
| 1603 ExternalReference pending_exception(Isolate::kPendingExceptionAddress, | 1601 ExternalReference pending_exception(Isolate::kPendingExceptionAddress, |
| 1604 isolate()); | 1602 isolate()); |
| 1605 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); | 1603 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); |
| 1606 __ mov(eax, Operand::StaticVariable(pending_exception)); | 1604 __ mov(eax, Operand::StaticVariable(pending_exception)); |
| 1607 __ cmp(edx, eax); | |
| 1608 __ j(equal, &runtime); | |
| 1609 // For exception, throw the exception again. | |
| 1610 | 1605 |
| 1611 // Clear the pending exception variable. | 1606 // Clear pending exception. |
| 1612 __ mov(Operand::StaticVariable(pending_exception), edx); | 1607 __ mov(Operand::StaticVariable(pending_exception), edx); |
| 1613 | 1608 |
| 1614 // Special handling of termination exceptions which are uncatchable | 1609 // Special handling of termination exceptions which are uncatchable |
| 1615 // by javascript code. | 1610 // by javascript code. |
| 1616 __ cmp(eax, factory->termination_exception()); | 1611 __ cmp(eax, factory->termination_exception()); |
| 1617 Label throw_termination_exception; | 1612 Label throw_termination_exception; |
| 1618 __ j(equal, &throw_termination_exception, Label::kNear); | 1613 __ j(equal, &throw_termination_exception, Label::kNear); |
| 1619 | 1614 |
| 1620 // Handle normal exception by following handler chain. | 1615 // Handle normal exception by following handler chain. |
| 1621 __ Throw(eax); | 1616 __ Throw(eax); |
| (...skipping 3366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4988 Operand(ebp, 7 * kPointerSize), | 4983 Operand(ebp, 7 * kPointerSize), |
| 4989 NULL); | 4984 NULL); |
| 4990 } | 4985 } |
| 4991 | 4986 |
| 4992 | 4987 |
| 4993 #undef __ | 4988 #undef __ |
| 4994 | 4989 |
| 4995 } } // namespace v8::internal | 4990 } } // namespace v8::internal |
| 4996 | 4991 |
| 4997 #endif // V8_TARGET_ARCH_IA32 | 4992 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |