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 #include "src/x64/assembler-x64.h" | 5 #include "src/x64/assembler-x64.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 const unsigned length = adr.len_; | 478 const unsigned length = adr.len_; |
479 DCHECK(length > 0); | 479 DCHECK(length > 0); |
480 | 480 |
481 // Emit updated ModR/M byte containing the given register. | 481 // Emit updated ModR/M byte containing the given register. |
482 DCHECK((adr.buf_[0] & 0x38) == 0); | 482 DCHECK((adr.buf_[0] & 0x38) == 0); |
483 *pc_++ = adr.buf_[0] | code << 3; | 483 *pc_++ = adr.buf_[0] | code << 3; |
484 | 484 |
485 // Recognize RIP relative addressing. | 485 // Recognize RIP relative addressing. |
486 if (adr.buf_[0] == 5) { | 486 if (adr.buf_[0] == 5) { |
487 DCHECK_EQ(9u, length); | 487 DCHECK_EQ(9u, length); |
488 Label* label = *reinterpret_cast<Label* const*>(&adr.buf_[1]); | 488 Label* label = *bit_cast<Label* const*>(&adr.buf_[1]); |
489 if (label->is_bound()) { | 489 if (label->is_bound()) { |
490 int offset = label->pos() - pc_offset() - sizeof(int32_t); | 490 int offset = label->pos() - pc_offset() - sizeof(int32_t); |
491 DCHECK_GE(0, offset); | 491 DCHECK_GE(0, offset); |
492 emitl(offset); | 492 emitl(offset); |
493 } else if (label->is_linked()) { | 493 } else if (label->is_linked()) { |
494 emitl(label->pos()); | 494 emitl(label->pos()); |
495 label->link_to(pc_offset() - sizeof(int32_t)); | 495 label->link_to(pc_offset() - sizeof(int32_t)); |
496 } else { | 496 } else { |
497 DCHECK(label->is_unused()); | 497 DCHECK(label->is_unused()); |
498 int32_t current = pc_offset(); | 498 int32_t current = pc_offset(); |
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3487 | 3487 |
3488 | 3488 |
3489 bool RelocInfo::IsInConstantPool() { | 3489 bool RelocInfo::IsInConstantPool() { |
3490 return false; | 3490 return false; |
3491 } | 3491 } |
3492 | 3492 |
3493 | 3493 |
3494 } } // namespace v8::internal | 3494 } } // namespace v8::internal |
3495 | 3495 |
3496 #endif // V8_TARGET_ARCH_X64 | 3496 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |