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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 __ bind(&success); | 803 __ bind(&success); |
804 __ mov(eax, Operand(esp, kJSRegExpOffset)); | 804 __ mov(eax, Operand(esp, kJSRegExpOffset)); |
805 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset)); | 805 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset)); |
806 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset)); | 806 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset)); |
807 // Calculate number of capture registers (number_of_captures + 1) * 2. | 807 // Calculate number of capture registers (number_of_captures + 1) * 2. |
808 STATIC_ASSERT(kSmiTag == 0); | 808 STATIC_ASSERT(kSmiTag == 0); |
809 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1); | 809 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1); |
810 __ add(edx, Immediate(2)); // edx was a smi. | 810 __ add(edx, Immediate(2)); // edx was a smi. |
811 | 811 |
812 // edx: Number of capture registers | 812 // edx: Number of capture registers |
813 // Load last_match_info which is still known to be a fast case JSArray. | 813 // Load last_match_info which is still known to be a fast-elements JSObject. |
814 // Check that the fourth object is a JSArray object. | 814 // Check that the fourth object is a JSObject. |
815 __ mov(eax, Operand(esp, kLastMatchInfoOffset)); | 815 __ mov(eax, Operand(esp, kLastMatchInfoOffset)); |
816 __ JumpIfSmi(eax, &runtime); | 816 __ JumpIfSmi(eax, &runtime); |
817 __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx); | 817 __ CmpObjectType(eax, JS_OBJECT_TYPE, ebx); |
818 __ j(not_equal, &runtime); | 818 __ j(not_equal, &runtime); |
819 // Check that the JSArray is in fast case. | 819 // Check that the object has fast elements. |
820 __ mov(ebx, FieldOperand(eax, JSArray::kElementsOffset)); | 820 __ mov(ebx, FieldOperand(eax, JSArray::kElementsOffset)); |
821 __ mov(eax, FieldOperand(ebx, HeapObject::kMapOffset)); | 821 __ mov(eax, FieldOperand(ebx, HeapObject::kMapOffset)); |
822 __ cmp(eax, factory->fixed_array_map()); | 822 __ cmp(eax, factory->fixed_array_map()); |
823 __ j(not_equal, &runtime); | 823 __ j(not_equal, &runtime); |
824 // Check that the last match info has space for the capture registers and the | 824 // Check that the last match info has space for the capture registers and the |
825 // additional information. | 825 // additional information. |
826 __ mov(eax, FieldOperand(ebx, FixedArray::kLengthOffset)); | 826 __ mov(eax, FieldOperand(ebx, FixedArray::kLengthOffset)); |
827 __ SmiUntag(eax); | 827 __ SmiUntag(eax); |
828 __ sub(eax, Immediate(RegExpImpl::kLastMatchOverhead)); | 828 __ sub(eax, Immediate(RegExpImpl::kLastMatchOverhead)); |
829 __ cmp(edx, eax); | 829 __ cmp(edx, eax); |
(...skipping 4656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5486 kStackUnwindSpace, nullptr, return_value_operand, | 5486 kStackUnwindSpace, nullptr, return_value_operand, |
5487 NULL); | 5487 NULL); |
5488 } | 5488 } |
5489 | 5489 |
5490 #undef __ | 5490 #undef __ |
5491 | 5491 |
5492 } // namespace internal | 5492 } // namespace internal |
5493 } // namespace v8 | 5493 } // namespace v8 |
5494 | 5494 |
5495 #endif // V8_TARGET_ARCH_IA32 | 5495 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |