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

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

Issue 26410004: Use the correct version of movq for ExternalReference in X64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Drop relocation information mode parameter from emitq" Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/assembler-x64-inl.h » ('j') | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 ASSERT(rmode > RelocInfo::LAST_GCED_ENUM); 1458 ASSERT(rmode > RelocInfo::LAST_GCED_ENUM);
1459 EnsureSpace ensure_space(this); 1459 EnsureSpace ensure_space(this);
1460 emit_rex_64(dst); 1460 emit_rex_64(dst);
1461 emit(0xB8 | dst.low_bits()); 1461 emit(0xB8 | dst.low_bits());
1462 emitp(value, rmode); 1462 emitp(value, rmode);
1463 } 1463 }
1464 1464
1465 1465
1466 void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) { 1466 void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
1467 // Non-relocatable values might not need a 64-bit representation. 1467 // Non-relocatable values might not need a 64-bit representation.
1468 if (RelocInfo::IsNone(rmode)) { 1468 ASSERT(RelocInfo::IsNone(rmode));
haitao.feng 2013/10/17 06:11:48 I will submit a CL to move the movq(Register dst,
danno 2013/10/23 13:16:09 Done.
1469 if (is_uint32(value)) { 1469 if (is_uint32(value)) {
1470 movl(dst, Immediate(static_cast<int32_t>(value))); 1470 movl(dst, Immediate(static_cast<int32_t>(value)));
1471 return; 1471 } else if (is_int32(value)) {
1472 } else if (is_int32(value)) { 1472 movq(dst, Immediate(static_cast<int32_t>(value)));
1473 movq(dst, Immediate(static_cast<int32_t>(value))); 1473 } else {
1474 return;
1475 }
1476 // Value cannot be represented by 32 bits, so do a full 64 bit immediate 1474 // Value cannot be represented by 32 bits, so do a full 64 bit immediate
1477 // value. 1475 // value.
1476 EnsureSpace ensure_space(this);
1477 emit_rex_64(dst);
1478 emit(0xB8 | dst.low_bits());
1479 emitq(value);
1478 } 1480 }
1479 EnsureSpace ensure_space(this);
1480 emit_rex_64(dst);
1481 emit(0xB8 | dst.low_bits());
1482 emitq(value, rmode);
1483 } 1481 }
1484 1482
1485 1483
1486 void Assembler::movq(Register dst, ExternalReference ref) { 1484 void Assembler::movq(Register dst, ExternalReference ref) {
1487 int64_t value = reinterpret_cast<int64_t>(ref.address()); 1485 Address value = reinterpret_cast<Address>(ref.address());
1488 movq(dst, value, RelocInfo::EXTERNAL_REFERENCE); 1486 movq(dst, value, RelocInfo::EXTERNAL_REFERENCE);
1489 } 1487 }
1490 1488
1491 1489
1492 void Assembler::movq(const Operand& dst, Immediate value) { 1490 void Assembler::movq(const Operand& dst, Immediate value) {
1493 EnsureSpace ensure_space(this); 1491 EnsureSpace ensure_space(this);
1494 emit_rex_64(dst); 1492 emit_rex_64(dst);
1495 emit(0xC7); 1493 emit(0xC7);
1496 emit_operand(0, dst); 1494 emit_operand(0, dst);
1497 emit(value); 1495 emit(value);
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 bool RelocInfo::IsCodedSpecially() { 3049 bool RelocInfo::IsCodedSpecially() {
3052 // The deserializer needs to know whether a pointer is specially coded. Being 3050 // The deserializer needs to know whether a pointer is specially coded. Being
3053 // specially coded on x64 means that it is a relative 32 bit address, as used 3051 // specially coded on x64 means that it is a relative 32 bit address, as used
3054 // by branch instructions. 3052 // by branch instructions.
3055 return (1 << rmode_) & kApplyMask; 3053 return (1 << rmode_) & kApplyMask;
3056 } 3054 }
3057 3055
3058 } } // namespace v8::internal 3056 } } // namespace v8::internal
3059 3057
3060 #endif // V8_TARGET_ARCH_X64 3058 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698