| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 kRoundToZero = 0x3 | 327 kRoundToZero = 0x3 |
| 328 }; | 328 }; |
| 329 | 329 |
| 330 | 330 |
| 331 // ----------------------------------------------------------------------------- | 331 // ----------------------------------------------------------------------------- |
| 332 // Machine instruction Immediates | 332 // Machine instruction Immediates |
| 333 | 333 |
| 334 class Immediate BASE_EMBEDDED { | 334 class Immediate BASE_EMBEDDED { |
| 335 public: | 335 public: |
| 336 explicit Immediate(int32_t value) : value_(value) {} | 336 explicit Immediate(int32_t value) : value_(value) {} |
| 337 explicit Immediate(int32_t value, RelocInfo::Mode rmode) |
| 338 : value_(value), rmode_(rmode) {} |
| 337 explicit Immediate(Smi* value) { | 339 explicit Immediate(Smi* value) { |
| 338 DCHECK(SmiValuesAre31Bits()); // Only available for 31-bit SMI. | 340 DCHECK(SmiValuesAre31Bits()); // Only available for 31-bit SMI. |
| 339 value_ = static_cast<int32_t>(reinterpret_cast<intptr_t>(value)); | 341 value_ = static_cast<int32_t>(reinterpret_cast<intptr_t>(value)); |
| 340 } | 342 } |
| 341 | 343 |
| 342 private: | 344 private: |
| 343 int32_t value_; | 345 int32_t value_; |
| 346 RelocInfo::Mode rmode_ = RelocInfo::NONE32; |
| 344 | 347 |
| 345 friend class Assembler; | 348 friend class Assembler; |
| 346 }; | 349 }; |
| 347 | 350 |
| 348 | 351 |
| 349 // ----------------------------------------------------------------------------- | 352 // ----------------------------------------------------------------------------- |
| 350 // Machine instruction Operands | 353 // Machine instruction Operands |
| 351 | 354 |
| 352 enum ScaleFactor { | 355 enum ScaleFactor { |
| 353 times_1 = 0, | 356 times_1 = 0, |
| (...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 | 1751 |
| 1749 void emit(byte x) { *pc_++ = x; } | 1752 void emit(byte x) { *pc_++ = x; } |
| 1750 inline void emitl(uint32_t x); | 1753 inline void emitl(uint32_t x); |
| 1751 inline void emitp(void* x, RelocInfo::Mode rmode); | 1754 inline void emitp(void* x, RelocInfo::Mode rmode); |
| 1752 inline void emitq(uint64_t x); | 1755 inline void emitq(uint64_t x); |
| 1753 inline void emitw(uint16_t x); | 1756 inline void emitw(uint16_t x); |
| 1754 inline void emit_code_target(Handle<Code> target, | 1757 inline void emit_code_target(Handle<Code> target, |
| 1755 RelocInfo::Mode rmode, | 1758 RelocInfo::Mode rmode, |
| 1756 TypeFeedbackId ast_id = TypeFeedbackId::None()); | 1759 TypeFeedbackId ast_id = TypeFeedbackId::None()); |
| 1757 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); | 1760 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); |
| 1758 void emit(Immediate x) { emitl(x.value_); } | 1761 void emit(Immediate x) { |
| 1762 if (!RelocInfo::IsNone(x.rmode_)) { |
| 1763 RecordRelocInfo(x.rmode_); |
| 1764 } |
| 1765 emitl(x.value_); |
| 1766 } |
| 1759 | 1767 |
| 1760 // Emits a REX prefix that encodes a 64-bit operand size and | 1768 // Emits a REX prefix that encodes a 64-bit operand size and |
| 1761 // the top bit of both register codes. | 1769 // the top bit of both register codes. |
| 1762 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. | 1770 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. |
| 1763 // REX.W is set. | 1771 // REX.W is set. |
| 1764 inline void emit_rex_64(XMMRegister reg, Register rm_reg); | 1772 inline void emit_rex_64(XMMRegister reg, Register rm_reg); |
| 1765 inline void emit_rex_64(Register reg, XMMRegister rm_reg); | 1773 inline void emit_rex_64(Register reg, XMMRegister rm_reg); |
| 1766 inline void emit_rex_64(Register reg, Register rm_reg); | 1774 inline void emit_rex_64(Register reg, Register rm_reg); |
| 1767 | 1775 |
| 1768 // Emits a REX prefix that encodes a 64-bit operand size and | 1776 // Emits a REX prefix that encodes a 64-bit operand size and |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2220 Assembler* assembler_; | 2228 Assembler* assembler_; |
| 2221 #ifdef DEBUG | 2229 #ifdef DEBUG |
| 2222 int space_before_; | 2230 int space_before_; |
| 2223 #endif | 2231 #endif |
| 2224 }; | 2232 }; |
| 2225 | 2233 |
| 2226 } // namespace internal | 2234 } // namespace internal |
| 2227 } // namespace v8 | 2235 } // namespace v8 |
| 2228 | 2236 |
| 2229 #endif // V8_X64_ASSEMBLER_X64_H_ | 2237 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |