| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // (5) One byte sequential. Load regexp code for one byte. | 418 // (5) One byte sequential. Load regexp code for one byte. |
| 419 // (E) Carry on. | 419 // (E) Carry on. |
| 420 /// [...] | 420 /// [...] |
| 421 | 421 |
| 422 // Deferred code at the end of the stub: | 422 // Deferred code at the end of the stub: |
| 423 // (6) Long external string? If not, go to (10). | 423 // (6) Long external string? If not, go to (10). |
| 424 // (7) External string. Make it, offset-wise, look like a sequential string. | 424 // (7) External string. Make it, offset-wise, look like a sequential string. |
| 425 // (8) Is the external string one byte? If yes, go to (5). | 425 // (8) Is the external string one byte? If yes, go to (5). |
| 426 // (9) Two byte sequential. Load regexp code for two byte. Go to (E). | 426 // (9) Two byte sequential. Load regexp code for two byte. Go to (E). |
| 427 // (10) Short external string or not a string? If yes, bail out to runtime. | 427 // (10) Short external string or not a string? If yes, bail out to runtime. |
| 428 // (11) Sliced string. Replace subject with parent. Go to (1). | 428 // (11) Sliced or thin string. Replace subject with parent. Go to (1). |
| 429 | 429 |
| 430 Label seq_one_byte_string /* 5 */, seq_two_byte_string /* 9 */, | 430 Label seq_one_byte_string /* 5 */, seq_two_byte_string /* 9 */, |
| 431 external_string /* 7 */, check_underlying /* 1 */, | 431 external_string /* 7 */, check_underlying /* 1 */, |
| 432 not_seq_nor_cons /* 6 */, check_code /* E */, not_long_external /* 10 */; | 432 not_seq_nor_cons /* 6 */, check_code /* E */, not_long_external /* 10 */; |
| 433 | 433 |
| 434 __ bind(&check_underlying); | 434 __ bind(&check_underlying); |
| 435 // (1) Sequential two byte? If yes, go to (9). | 435 // (1) Sequential two byte? If yes, go to (9). |
| 436 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); | 436 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); |
| 437 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); | 437 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
| 438 | 438 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 __ Move(ecx, Immediate(0)); // Type is two byte. | 726 __ Move(ecx, Immediate(0)); // Type is two byte. |
| 727 __ jmp(&check_code); // Go to (E). | 727 __ jmp(&check_code); // Go to (E). |
| 728 | 728 |
| 729 // (10) Not a string or a short external string? If yes, bail out to runtime. | 729 // (10) Not a string or a short external string? If yes, bail out to runtime. |
| 730 __ bind(¬_long_external); | 730 __ bind(¬_long_external); |
| 731 // Catch non-string subject or short external string. | 731 // Catch non-string subject or short external string. |
| 732 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag !=0); | 732 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag !=0); |
| 733 __ test(ebx, Immediate(kIsNotStringMask | kShortExternalStringTag)); | 733 __ test(ebx, Immediate(kIsNotStringMask | kShortExternalStringTag)); |
| 734 __ j(not_zero, &runtime); | 734 __ j(not_zero, &runtime); |
| 735 | 735 |
| 736 // (11) Sliced string. Replace subject with parent. Go to (1). | 736 // (11) Sliced or thin string. Replace subject with parent. Go to (1). |
| 737 Label thin_string; |
| 738 __ cmp(ebx, Immediate(kThinStringTag)); |
| 739 __ j(equal, &thin_string, Label::kNear); |
| 737 // Load offset into edi and replace subject string with parent. | 740 // Load offset into edi and replace subject string with parent. |
| 738 __ mov(edi, FieldOperand(eax, SlicedString::kOffsetOffset)); | 741 __ mov(edi, FieldOperand(eax, SlicedString::kOffsetOffset)); |
| 739 __ mov(eax, FieldOperand(eax, SlicedString::kParentOffset)); | 742 __ mov(eax, FieldOperand(eax, SlicedString::kParentOffset)); |
| 740 __ jmp(&check_underlying); // Go to (1). | 743 __ jmp(&check_underlying); // Go to (1). |
| 744 |
| 745 __ bind(&thin_string); |
| 746 __ mov(eax, FieldOperand(eax, ThinString::kActualOffset)); |
| 747 __ jmp(&check_underlying); // Go to (1). |
| 741 #endif // V8_INTERPRETED_REGEXP | 748 #endif // V8_INTERPRETED_REGEXP |
| 742 } | 749 } |
| 743 | 750 |
| 744 | 751 |
| 745 static int NegativeComparisonResult(Condition cc) { | 752 static int NegativeComparisonResult(Condition cc) { |
| 746 DCHECK(cc != equal); | 753 DCHECK(cc != equal); |
| 747 DCHECK((cc == less) || (cc == less_equal) | 754 DCHECK((cc == less) || (cc == less_equal) |
| 748 || (cc == greater) || (cc == greater_equal)); | 755 || (cc == greater) || (cc == greater_equal)); |
| 749 return (cc == greater || cc == greater_equal) ? LESS : GREATER; | 756 return (cc == greater || cc == greater_equal) ? LESS : GREATER; |
| 750 } | 757 } |
| (...skipping 3468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4219 kStackUnwindSpace, nullptr, return_value_operand, | 4226 kStackUnwindSpace, nullptr, return_value_operand, |
| 4220 NULL); | 4227 NULL); |
| 4221 } | 4228 } |
| 4222 | 4229 |
| 4223 #undef __ | 4230 #undef __ |
| 4224 | 4231 |
| 4225 } // namespace internal | 4232 } // namespace internal |
| 4226 } // namespace v8 | 4233 } // namespace v8 |
| 4227 | 4234 |
| 4228 #endif // V8_TARGET_ARCH_X87 | 4235 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |