Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: src/x64/assembler-x64.cc

Issue 898953003: [x64] Fix strict aliasing error with GCC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698