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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); | 2406 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); |
2407 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); | 2407 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); |
2408 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); | 2408 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); |
2409 | 2409 |
2410 // Check that both are flat one-byte strings. | 2410 // Check that both are flat one-byte strings. |
2411 const int kFlatOneByteStringMask = | 2411 const int kFlatOneByteStringMask = |
2412 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; | 2412 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
2413 const int kFlatOneByteStringTag = | 2413 const int kFlatOneByteStringTag = |
2414 kStringTag | kOneByteStringTag | kSeqStringTag; | 2414 kStringTag | kOneByteStringTag | kSeqStringTag; |
2415 // Interleave bits from both instance types and compare them in one check. | 2415 // Interleave bits from both instance types and compare them in one check. |
2416 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << 3)); | 2416 const int kShift = 8; |
| 2417 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << kShift)); |
2417 and_(scratch1, kFlatOneByteStringMask); | 2418 and_(scratch1, kFlatOneByteStringMask); |
2418 and_(scratch2, kFlatOneByteStringMask); | 2419 and_(scratch2, kFlatOneByteStringMask); |
2419 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); | 2420 shl(scratch2, kShift); |
2420 cmp(scratch1, kFlatOneByteStringTag | (kFlatOneByteStringTag << 3)); | 2421 or_(scratch1, scratch2); |
| 2422 cmp(scratch1, kFlatOneByteStringTag | (kFlatOneByteStringTag << kShift)); |
2421 j(not_equal, failure); | 2423 j(not_equal, failure); |
2422 } | 2424 } |
2423 | 2425 |
2424 | 2426 |
2425 void MacroAssembler::JumpIfNotUniqueNameInstanceType(Operand operand, | 2427 void MacroAssembler::JumpIfNotUniqueNameInstanceType(Operand operand, |
2426 Label* not_unique_name, | 2428 Label* not_unique_name, |
2427 Label::Distance distance) { | 2429 Label::Distance distance) { |
2428 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 2430 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
2429 Label succeed; | 2431 Label succeed; |
2430 test(operand, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); | 2432 test(operand, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2794 mov(eax, dividend); | 2796 mov(eax, dividend); |
2795 shr(eax, 31); | 2797 shr(eax, 31); |
2796 add(edx, eax); | 2798 add(edx, eax); |
2797 } | 2799 } |
2798 | 2800 |
2799 | 2801 |
2800 } // namespace internal | 2802 } // namespace internal |
2801 } // namespace v8 | 2803 } // namespace v8 |
2802 | 2804 |
2803 #endif // V8_TARGET_ARCH_X87 | 2805 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |