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