| 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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 | 1754 |
| 1752 void emit(byte x) { *pc_++ = x; } | 1755 void emit(byte x) { *pc_++ = x; } |
| 1753 inline void emitl(uint32_t x); | 1756 inline void emitl(uint32_t x); |
| 1754 inline void emitp(void* x, RelocInfo::Mode rmode); | 1757 inline void emitp(void* x, RelocInfo::Mode rmode); |
| 1755 inline void emitq(uint64_t x); | 1758 inline void emitq(uint64_t x); |
| 1756 inline void emitw(uint16_t x); | 1759 inline void emitw(uint16_t x); |
| 1757 inline void emit_code_target(Handle<Code> target, | 1760 inline void emit_code_target(Handle<Code> target, |
| 1758 RelocInfo::Mode rmode, | 1761 RelocInfo::Mode rmode, |
| 1759 TypeFeedbackId ast_id = TypeFeedbackId::None()); | 1762 TypeFeedbackId ast_id = TypeFeedbackId::None()); |
| 1760 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); | 1763 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); |
| 1761 void emit(Immediate x) { emitl(x.value_); } | 1764 void emit(Immediate x) { |
| 1765 if (!RelocInfo::IsNone(x.rmode_)) { |
| 1766 RecordRelocInfo(x.rmode_); |
| 1767 } |
| 1768 emitl(x.value_); |
| 1769 } |
| 1762 | 1770 |
| 1763 // Emits a REX prefix that encodes a 64-bit operand size and | 1771 // Emits a REX prefix that encodes a 64-bit operand size and |
| 1764 // the top bit of both register codes. | 1772 // the top bit of both register codes. |
| 1765 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. | 1773 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. |
| 1766 // REX.W is set. | 1774 // REX.W is set. |
| 1767 inline void emit_rex_64(XMMRegister reg, Register rm_reg); | 1775 inline void emit_rex_64(XMMRegister reg, Register rm_reg); |
| 1768 inline void emit_rex_64(Register reg, XMMRegister rm_reg); | 1776 inline void emit_rex_64(Register reg, XMMRegister rm_reg); |
| 1769 inline void emit_rex_64(Register reg, Register rm_reg); | 1777 inline void emit_rex_64(Register reg, Register rm_reg); |
| 1770 | 1778 |
| 1771 // Emits a REX prefix that encodes a 64-bit operand size and | 1779 // 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... |
| 2223 Assembler* assembler_; | 2231 Assembler* assembler_; |
| 2224 #ifdef DEBUG | 2232 #ifdef DEBUG |
| 2225 int space_before_; | 2233 int space_before_; |
| 2226 #endif | 2234 #endif |
| 2227 }; | 2235 }; |
| 2228 | 2236 |
| 2229 } // namespace internal | 2237 } // namespace internal |
| 2230 } // namespace v8 | 2238 } // namespace v8 |
| 2231 | 2239 |
| 2232 #endif // V8_X64_ASSEMBLER_X64_H_ | 2240 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |