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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 __ bind(&success); | 624 __ bind(&success); |
625 __ mov(eax, Operand(esp, kJSRegExpOffset)); | 625 __ mov(eax, Operand(esp, kJSRegExpOffset)); |
626 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset)); | 626 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset)); |
627 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset)); | 627 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset)); |
628 // Calculate number of capture registers (number_of_captures + 1) * 2. | 628 // Calculate number of capture registers (number_of_captures + 1) * 2. |
629 STATIC_ASSERT(kSmiTag == 0); | 629 STATIC_ASSERT(kSmiTag == 0); |
630 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1); | 630 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1); |
631 __ add(edx, Immediate(2)); // edx was a smi. | 631 __ add(edx, Immediate(2)); // edx was a smi. |
632 | 632 |
633 // edx: Number of capture registers | 633 // edx: Number of capture registers |
634 // Load last_match_info which is still known to be a fast case JSArray. | 634 // Load last_match_info which is still known to be a fast-elements JSObject. |
635 // Check that the fourth object is a JSArray object. | 635 // Check that the fourth object is a JSObject. |
636 __ mov(eax, Operand(esp, kLastMatchInfoOffset)); | 636 __ mov(eax, Operand(esp, kLastMatchInfoOffset)); |
637 __ JumpIfSmi(eax, &runtime); | 637 __ JumpIfSmi(eax, &runtime); |
638 __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx); | 638 __ CmpObjectType(eax, JS_OBJECT_TYPE, ebx); |
639 __ j(not_equal, &runtime); | 639 __ j(not_equal, &runtime); |
640 // Check that the JSArray is in fast case. | 640 // Check that the object has fast elements. |
641 __ mov(ebx, FieldOperand(eax, JSArray::kElementsOffset)); | 641 __ mov(ebx, FieldOperand(eax, JSArray::kElementsOffset)); |
642 __ mov(eax, FieldOperand(ebx, HeapObject::kMapOffset)); | 642 __ mov(eax, FieldOperand(ebx, HeapObject::kMapOffset)); |
643 __ cmp(eax, factory->fixed_array_map()); | 643 __ cmp(eax, factory->fixed_array_map()); |
644 __ j(not_equal, &runtime); | 644 __ j(not_equal, &runtime); |
645 // Check that the last match info has space for the capture registers and the | 645 // Check that the last match info has space for the capture registers and the |
646 // additional information. | 646 // additional information. |
647 __ mov(eax, FieldOperand(ebx, FixedArray::kLengthOffset)); | 647 __ mov(eax, FieldOperand(ebx, FixedArray::kLengthOffset)); |
648 __ SmiUntag(eax); | 648 __ SmiUntag(eax); |
649 __ sub(eax, Immediate(RegExpImpl::kLastMatchOverhead)); | 649 __ sub(eax, Immediate(RegExpImpl::kLastMatchOverhead)); |
650 __ cmp(edx, eax); | 650 __ cmp(edx, eax); |
(...skipping 4626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5277 kStackUnwindSpace, nullptr, return_value_operand, | 5277 kStackUnwindSpace, nullptr, return_value_operand, |
5278 NULL); | 5278 NULL); |
5279 } | 5279 } |
5280 | 5280 |
5281 #undef __ | 5281 #undef __ |
5282 | 5282 |
5283 } // namespace internal | 5283 } // namespace internal |
5284 } // namespace v8 | 5284 } // namespace v8 |
5285 | 5285 |
5286 #endif // V8_TARGET_ARCH_X87 | 5286 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |