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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 Register number_of_capture_registers = x12; | 1641 Register number_of_capture_registers = x12; |
1642 | 1642 |
1643 // Calculate number of capture registers (number_of_captures + 1) * 2 | 1643 // Calculate number of capture registers (number_of_captures + 1) * 2 |
1644 // and store it in the last match info. | 1644 // and store it in the last match info. |
1645 __ Ldrsw(x10, | 1645 __ Ldrsw(x10, |
1646 UntagSmiFieldMemOperand(regexp_data, | 1646 UntagSmiFieldMemOperand(regexp_data, |
1647 JSRegExp::kIrregexpCaptureCountOffset)); | 1647 JSRegExp::kIrregexpCaptureCountOffset)); |
1648 __ Add(x10, x10, x10); | 1648 __ Add(x10, x10, x10); |
1649 __ Add(number_of_capture_registers, x10, 2); | 1649 __ Add(number_of_capture_registers, x10, 2); |
1650 | 1650 |
1651 // Check that the fourth object is a JSArray object. | 1651 // Check that the fourth object is a JSObject. |
1652 DCHECK(jssp.Is(__ StackPointer())); | 1652 DCHECK(jssp.Is(__ StackPointer())); |
1653 __ Peek(x10, kLastMatchInfoOffset); | 1653 __ Peek(x10, kLastMatchInfoOffset); |
1654 __ JumpIfSmi(x10, &runtime); | 1654 __ JumpIfSmi(x10, &runtime); |
1655 __ JumpIfNotObjectType(x10, x11, x11, JS_ARRAY_TYPE, &runtime); | 1655 __ JumpIfNotObjectType(x10, x11, x11, JS_OBJECT_TYPE, &runtime); |
1656 | 1656 |
1657 // Check that the JSArray is the fast case. | 1657 // Check that the object has fast elements. |
1658 __ Ldr(last_match_info_elements, | 1658 __ Ldr(last_match_info_elements, |
1659 FieldMemOperand(x10, JSArray::kElementsOffset)); | 1659 FieldMemOperand(x10, JSObject::kElementsOffset)); |
1660 __ Ldr(x10, | 1660 __ Ldr(x10, |
1661 FieldMemOperand(last_match_info_elements, HeapObject::kMapOffset)); | 1661 FieldMemOperand(last_match_info_elements, HeapObject::kMapOffset)); |
1662 __ JumpIfNotRoot(x10, Heap::kFixedArrayMapRootIndex, &runtime); | 1662 __ JumpIfNotRoot(x10, Heap::kFixedArrayMapRootIndex, &runtime); |
1663 | 1663 |
1664 // Check that the last match info has space for the capture registers and the | 1664 // Check that the last match info has space for the capture registers and the |
1665 // additional information (overhead). | 1665 // additional information (overhead). |
1666 // (number_of_captures + 1) * 2 + overhead <= last match info size | 1666 // (number_of_captures + 1) * 2 + overhead <= last match info size |
1667 // (number_of_captures * 2) + 2 + overhead <= last match info size | 1667 // (number_of_captures * 2) + 2 + overhead <= last match info size |
1668 // number_of_capture_registers + overhead <= last match info size | 1668 // number_of_capture_registers + overhead <= last match info size |
1669 __ Ldrsw(x10, | 1669 __ Ldrsw(x10, |
(...skipping 3905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5575 kStackUnwindSpace, NULL, spill_offset, | 5575 kStackUnwindSpace, NULL, spill_offset, |
5576 return_value_operand, NULL); | 5576 return_value_operand, NULL); |
5577 } | 5577 } |
5578 | 5578 |
5579 #undef __ | 5579 #undef __ |
5580 | 5580 |
5581 } // namespace internal | 5581 } // namespace internal |
5582 } // namespace v8 | 5582 } // namespace v8 |
5583 | 5583 |
5584 #endif // V8_TARGET_ARCH_ARM64 | 5584 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |