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