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

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

Issue 1759873002: Assembler changes for enabling GrowHeap in Wasm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix update method for ia32/x64 Created 4 years, 9 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
OLDNEW
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
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)
titzer 2016/03/14 15:23:38 AFAICT we don't need this until we have updateable
gdeepti1 2016/03/14 20:08:14 Sounds good, removed from this CL.
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
344 RelocInfo::Mode rmode() { return rmode_; }
345
342 private: 346 private:
343 int32_t value_; 347 int32_t value_;
348 RelocInfo::Mode rmode_ = RelocInfo::NONE32;
344 349
345 friend class Assembler; 350 friend class Assembler;
346 }; 351 };
347 352
348 353
349 // ----------------------------------------------------------------------------- 354 // -----------------------------------------------------------------------------
350 // Machine instruction Operands 355 // Machine instruction Operands
351 356
352 enum ScaleFactor { 357 enum ScaleFactor {
353 times_1 = 0, 358 times_1 = 0,
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 void movw(const Operand& dst, Immediate imm); 697 void movw(const Operand& dst, Immediate imm);
693 698
694 // Move the offset of the label location relative to the current 699 // Move the offset of the label location relative to the current
695 // position (after the move) to the destination. 700 // position (after the move) to the destination.
696 void movl(const Operand& dst, Label* src); 701 void movl(const Operand& dst, Label* src);
697 702
698 // Loads a pointer into a register with a relocation mode. 703 // Loads a pointer into a register with a relocation mode.
699 void movp(Register dst, void* ptr, RelocInfo::Mode rmode); 704 void movp(Register dst, void* ptr, RelocInfo::Mode rmode);
700 705
701 // Loads a 64-bit immediate into a register. 706 // Loads a 64-bit immediate into a register.
702 void movq(Register dst, int64_t value); 707 void movq(Register dst, int64_t value,
703 void movq(Register dst, uint64_t value); 708 RelocInfo::Mode rmode = RelocInfo::NONE64);
709 void movq(Register dst, uint64_t value,
710 RelocInfo::Mode rmode = RelocInfo::NONE64);
704 711
705 void movsxbl(Register dst, Register src); 712 void movsxbl(Register dst, Register src);
706 void movsxbl(Register dst, const Operand& src); 713 void movsxbl(Register dst, const Operand& src);
707 void movsxbq(Register dst, const Operand& src); 714 void movsxbq(Register dst, const Operand& src);
708 void movsxwl(Register dst, Register src); 715 void movsxwl(Register dst, Register src);
709 void movsxwl(Register dst, const Operand& src); 716 void movsxwl(Register dst, const Operand& src);
710 void movsxwq(Register dst, const Operand& src); 717 void movsxwq(Register dst, const Operand& src);
711 void movsxlq(Register dst, Register src); 718 void movsxlq(Register dst, Register src);
712 void movsxlq(Register dst, const Operand& src); 719 void movsxlq(Register dst, const Operand& src);
713 720
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 1744
1738 void emit(byte x) { *pc_++ = x; } 1745 void emit(byte x) { *pc_++ = x; }
1739 inline void emitl(uint32_t x); 1746 inline void emitl(uint32_t x);
1740 inline void emitp(void* x, RelocInfo::Mode rmode); 1747 inline void emitp(void* x, RelocInfo::Mode rmode);
1741 inline void emitq(uint64_t x); 1748 inline void emitq(uint64_t x);
1742 inline void emitw(uint16_t x); 1749 inline void emitw(uint16_t x);
1743 inline void emit_code_target(Handle<Code> target, 1750 inline void emit_code_target(Handle<Code> target,
1744 RelocInfo::Mode rmode, 1751 RelocInfo::Mode rmode,
1745 TypeFeedbackId ast_id = TypeFeedbackId::None()); 1752 TypeFeedbackId ast_id = TypeFeedbackId::None());
1746 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); 1753 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode);
1747 void emit(Immediate x) { emitl(x.value_); } 1754 void emit(Immediate x) {
1755 if (!RelocInfo::IsNone(x.rmode_)) {
1756 RecordRelocInfo(x.rmode_);
1757 }
1758 emitl(x.value_);
1759 }
1748 1760
1749 // Emits a REX prefix that encodes a 64-bit operand size and 1761 // Emits a REX prefix that encodes a 64-bit operand size and
1750 // the top bit of both register codes. 1762 // the top bit of both register codes.
1751 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. 1763 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B.
1752 // REX.W is set. 1764 // REX.W is set.
1753 inline void emit_rex_64(XMMRegister reg, Register rm_reg); 1765 inline void emit_rex_64(XMMRegister reg, Register rm_reg);
1754 inline void emit_rex_64(Register reg, XMMRegister rm_reg); 1766 inline void emit_rex_64(Register reg, XMMRegister rm_reg);
1755 inline void emit_rex_64(Register reg, Register rm_reg); 1767 inline void emit_rex_64(Register reg, Register rm_reg);
1756 1768
1757 // Emits a REX prefix that encodes a 64-bit operand size and 1769 // Emits a REX prefix that encodes a 64-bit operand size and
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2209 Assembler* assembler_; 2221 Assembler* assembler_;
2210 #ifdef DEBUG 2222 #ifdef DEBUG
2211 int space_before_; 2223 int space_before_;
2212 #endif 2224 #endif
2213 }; 2225 };
2214 2226
2215 } // namespace internal 2227 } // namespace internal
2216 } // namespace v8 2228 } // namespace v8
2217 2229
2218 #endif // V8_X64_ASSEMBLER_X64_H_ 2230 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698