| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2533 // Check that both are flat one-byte strings. | 2533 // Check that both are flat one-byte strings. |
| 2534 DCHECK(kNotStringTag != 0); | 2534 DCHECK(kNotStringTag != 0); |
| 2535 const int kFlatOneByteStringMask = | 2535 const int kFlatOneByteStringMask = |
| 2536 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; | 2536 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
| 2537 const int kFlatOneByteStringTag = | 2537 const int kFlatOneByteStringTag = |
| 2538 kStringTag | kOneByteStringTag | kSeqStringTag; | 2538 kStringTag | kOneByteStringTag | kSeqStringTag; |
| 2539 | 2539 |
| 2540 andl(scratch1, Immediate(kFlatOneByteStringMask)); | 2540 andl(scratch1, Immediate(kFlatOneByteStringMask)); |
| 2541 andl(scratch2, Immediate(kFlatOneByteStringMask)); | 2541 andl(scratch2, Immediate(kFlatOneByteStringMask)); |
| 2542 // Interleave the bits to check both scratch1 and scratch2 in one test. | 2542 // Interleave the bits to check both scratch1 and scratch2 in one test. |
| 2543 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << 3)); | 2543 const int kShift = 8; |
| 2544 leap(scratch1, Operand(scratch1, scratch2, times_8, 0)); | 2544 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << kShift)); |
| 2545 shlp(scratch2, Immediate(kShift)); |
| 2546 orp(scratch1, scratch2); |
| 2545 cmpl(scratch1, | 2547 cmpl(scratch1, |
| 2546 Immediate(kFlatOneByteStringTag + (kFlatOneByteStringTag << 3))); | 2548 Immediate(kFlatOneByteStringTag + (kFlatOneByteStringTag << kShift))); |
| 2547 j(not_equal, on_fail, near_jump); | 2549 j(not_equal, on_fail, near_jump); |
| 2548 } | 2550 } |
| 2549 | 2551 |
| 2550 | 2552 |
| 2551 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte( | 2553 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte( |
| 2552 Register instance_type, Register scratch, Label* failure, | 2554 Register instance_type, Register scratch, Label* failure, |
| 2553 Label::Distance near_jump) { | 2555 Label::Distance near_jump) { |
| 2554 if (!scratch.is(instance_type)) { | 2556 if (!scratch.is(instance_type)) { |
| 2555 movl(scratch, instance_type); | 2557 movl(scratch, instance_type); |
| 2556 } | 2558 } |
| (...skipping 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5433 movl(rax, dividend); | 5435 movl(rax, dividend); |
| 5434 shrl(rax, Immediate(31)); | 5436 shrl(rax, Immediate(31)); |
| 5435 addl(rdx, rax); | 5437 addl(rdx, rax); |
| 5436 } | 5438 } |
| 5437 | 5439 |
| 5438 | 5440 |
| 5439 } // namespace internal | 5441 } // namespace internal |
| 5440 } // namespace v8 | 5442 } // namespace v8 |
| 5441 | 5443 |
| 5442 #endif // V8_TARGET_ARCH_X64 | 5444 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |