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 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); | 2554 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); |
2555 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); | 2555 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); |
2556 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); | 2556 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); |
2557 | 2557 |
2558 // Check that both are flat one-byte strings. | 2558 // Check that both are flat one-byte strings. |
2559 const int kFlatOneByteStringMask = | 2559 const int kFlatOneByteStringMask = |
2560 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; | 2560 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
2561 const int kFlatOneByteStringTag = | 2561 const int kFlatOneByteStringTag = |
2562 kStringTag | kOneByteStringTag | kSeqStringTag; | 2562 kStringTag | kOneByteStringTag | kSeqStringTag; |
2563 // Interleave bits from both instance types and compare them in one check. | 2563 // Interleave bits from both instance types and compare them in one check. |
2564 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << 3)); | 2564 const int kShift = 8; |
| 2565 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << kShift)); |
2565 and_(scratch1, kFlatOneByteStringMask); | 2566 and_(scratch1, kFlatOneByteStringMask); |
2566 and_(scratch2, kFlatOneByteStringMask); | 2567 and_(scratch2, kFlatOneByteStringMask); |
2567 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); | 2568 shl(scratch2, kShift); |
2568 cmp(scratch1, kFlatOneByteStringTag | (kFlatOneByteStringTag << 3)); | 2569 or_(scratch1, scratch2); |
| 2570 cmp(scratch1, kFlatOneByteStringTag | (kFlatOneByteStringTag << kShift)); |
2569 j(not_equal, failure); | 2571 j(not_equal, failure); |
2570 } | 2572 } |
2571 | 2573 |
2572 | 2574 |
2573 void MacroAssembler::JumpIfNotUniqueNameInstanceType(Operand operand, | 2575 void MacroAssembler::JumpIfNotUniqueNameInstanceType(Operand operand, |
2574 Label* not_unique_name, | 2576 Label* not_unique_name, |
2575 Label::Distance distance) { | 2577 Label::Distance distance) { |
2576 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 2578 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
2577 Label succeed; | 2579 Label succeed; |
2578 test(operand, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); | 2580 test(operand, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2942 mov(eax, dividend); | 2944 mov(eax, dividend); |
2943 shr(eax, 31); | 2945 shr(eax, 31); |
2944 add(edx, eax); | 2946 add(edx, eax); |
2945 } | 2947 } |
2946 | 2948 |
2947 | 2949 |
2948 } // namespace internal | 2950 } // namespace internal |
2949 } // namespace v8 | 2951 } // namespace v8 |
2950 | 2952 |
2951 #endif // V8_TARGET_ARCH_X87 | 2953 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |