| 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 RegExpImpl::kFirstCaptureOffset), | 1567 RegExpImpl::kFirstCaptureOffset), |
| 1568 rdi); | 1568 rdi); |
| 1569 __ jmp(&next_capture); | 1569 __ jmp(&next_capture); |
| 1570 __ bind(&done); | 1570 __ bind(&done); |
| 1571 | 1571 |
| 1572 // Return last match info. | 1572 // Return last match info. |
| 1573 __ movp(rax, r15); | 1573 __ movp(rax, r15); |
| 1574 __ ret(REG_EXP_EXEC_ARGUMENT_COUNT * kPointerSize); | 1574 __ ret(REG_EXP_EXEC_ARGUMENT_COUNT * kPointerSize); |
| 1575 | 1575 |
| 1576 __ bind(&exception); | 1576 __ bind(&exception); |
| 1577 // Result must now be exception. If there is no pending exception already a | 1577 // Result must now be exception. |
| 1578 // stack overflow (on the backtrack stack) was detected in RegExp code but | |
| 1579 // haven't created the exception yet. Handle that in the runtime system. | |
| 1580 // TODO(592): Rerunning the RegExp to get the stack overflow exception. | |
| 1581 ExternalReference pending_exception_address( | 1578 ExternalReference pending_exception_address( |
| 1582 Isolate::kPendingExceptionAddress, isolate()); | 1579 Isolate::kPendingExceptionAddress, isolate()); |
| 1583 Operand pending_exception_operand = | 1580 Operand pending_exception_operand = |
| 1584 masm->ExternalOperand(pending_exception_address, rbx); | 1581 masm->ExternalOperand(pending_exception_address, rbx); |
| 1582 __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex); |
| 1585 __ movp(rax, pending_exception_operand); | 1583 __ movp(rax, pending_exception_operand); |
| 1586 __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex); | 1584 __ movp(pending_exception_operand, rdx); // Clear pending exception. |
| 1587 __ cmpp(rax, rdx); | |
| 1588 __ j(equal, &runtime); | |
| 1589 __ movp(pending_exception_operand, rdx); | |
| 1590 | 1585 |
| 1591 __ CompareRoot(rax, Heap::kTerminationExceptionRootIndex); | 1586 __ CompareRoot(rax, Heap::kTerminationExceptionRootIndex); |
| 1592 Label termination_exception; | 1587 Label termination_exception; |
| 1593 __ j(equal, &termination_exception, Label::kNear); | 1588 __ j(equal, &termination_exception, Label::kNear); |
| 1594 __ Throw(rax); | 1589 __ Throw(rax); |
| 1595 | 1590 |
| 1596 __ bind(&termination_exception); | 1591 __ bind(&termination_exception); |
| 1597 __ ThrowUncatchable(rax); | 1592 __ ThrowUncatchable(rax); |
| 1598 | 1593 |
| 1599 // Do the runtime call to execute the regexp. | 1594 // Do the runtime call to execute the regexp. |
| (...skipping 3341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4941 return_value_operand, | 4936 return_value_operand, |
| 4942 NULL); | 4937 NULL); |
| 4943 } | 4938 } |
| 4944 | 4939 |
| 4945 | 4940 |
| 4946 #undef __ | 4941 #undef __ |
| 4947 | 4942 |
| 4948 } } // namespace v8::internal | 4943 } } // namespace v8::internal |
| 4949 | 4944 |
| 4950 #endif // V8_TARGET_ARCH_X64 | 4945 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |