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

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: Review comments 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(Smi* value) { 337 explicit Immediate(Smi* value) {
338 DCHECK(SmiValuesAre31Bits()); // Only available for 31-bit SMI. 338 DCHECK(SmiValuesAre31Bits()); // Only available for 31-bit SMI.
339 value_ = static_cast<int32_t>(reinterpret_cast<intptr_t>(value)); 339 value_ = static_cast<int32_t>(reinterpret_cast<intptr_t>(value));
340 } 340 }
341 341
342 RelocInfo::Mode rmode() { return rmode_; }
Yang 2016/03/15 07:44:18 This cannot be anything other than NONE32. Why do
gdeepti1 2016/03/16 06:05:26 Left over from Immediate constructor, removed now.
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 void movw(const Operand& dst, Immediate imm); 695 void movw(const Operand& dst, Immediate imm);
693 696
694 // Move the offset of the label location relative to the current 697 // Move the offset of the label location relative to the current
695 // position (after the move) to the destination. 698 // position (after the move) to the destination.
696 void movl(const Operand& dst, Label* src); 699 void movl(const Operand& dst, Label* src);
697 700
698 // Loads a pointer into a register with a relocation mode. 701 // Loads a pointer into a register with a relocation mode.
699 void movp(Register dst, void* ptr, RelocInfo::Mode rmode); 702 void movp(Register dst, void* ptr, RelocInfo::Mode rmode);
700 703
701 // Loads a 64-bit immediate into a register. 704 // Loads a 64-bit immediate into a register.
702 void movq(Register dst, int64_t value); 705 void movq(Register dst, int64_t value,
703 void movq(Register dst, uint64_t value); 706 RelocInfo::Mode rmode = RelocInfo::NONE64);
707 void movq(Register dst, uint64_t value,
708 RelocInfo::Mode rmode = RelocInfo::NONE64);
704 709
705 void movsxbl(Register dst, Register src); 710 void movsxbl(Register dst, Register src);
706 void movsxbl(Register dst, const Operand& src); 711 void movsxbl(Register dst, const Operand& src);
707 void movsxbq(Register dst, const Operand& src); 712 void movsxbq(Register dst, const Operand& src);
708 void movsxwl(Register dst, Register src); 713 void movsxwl(Register dst, Register src);
709 void movsxwl(Register dst, const Operand& src); 714 void movsxwl(Register dst, const Operand& src);
710 void movsxwq(Register dst, const Operand& src); 715 void movsxwq(Register dst, const Operand& src);
711 void movsxlq(Register dst, Register src); 716 void movsxlq(Register dst, Register src);
712 void movsxlq(Register dst, const Operand& src); 717 void movsxlq(Register dst, const Operand& src);
713 718
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 1742
1738 void emit(byte x) { *pc_++ = x; } 1743 void emit(byte x) { *pc_++ = x; }
1739 inline void emitl(uint32_t x); 1744 inline void emitl(uint32_t x);
1740 inline void emitp(void* x, RelocInfo::Mode rmode); 1745 inline void emitp(void* x, RelocInfo::Mode rmode);
1741 inline void emitq(uint64_t x); 1746 inline void emitq(uint64_t x);
1742 inline void emitw(uint16_t x); 1747 inline void emitw(uint16_t x);
1743 inline void emit_code_target(Handle<Code> target, 1748 inline void emit_code_target(Handle<Code> target,
1744 RelocInfo::Mode rmode, 1749 RelocInfo::Mode rmode,
1745 TypeFeedbackId ast_id = TypeFeedbackId::None()); 1750 TypeFeedbackId ast_id = TypeFeedbackId::None());
1746 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); 1751 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode);
1747 void emit(Immediate x) { emitl(x.value_); } 1752 void emit(Immediate x) {
1753 if (!RelocInfo::IsNone(x.rmode_)) {
Yang 2016/03/15 07:44:18 This seems like dead code.
gdeepti1 2016/03/16 06:05:26 Done.
1754 RecordRelocInfo(x.rmode_);
1755 }
1756 emitl(x.value_);
1757 }
1748 1758
1749 // Emits a REX prefix that encodes a 64-bit operand size and 1759 // Emits a REX prefix that encodes a 64-bit operand size and
1750 // the top bit of both register codes. 1760 // 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. 1761 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B.
1752 // REX.W is set. 1762 // REX.W is set.
1753 inline void emit_rex_64(XMMRegister reg, Register rm_reg); 1763 inline void emit_rex_64(XMMRegister reg, Register rm_reg);
1754 inline void emit_rex_64(Register reg, XMMRegister rm_reg); 1764 inline void emit_rex_64(Register reg, XMMRegister rm_reg);
1755 inline void emit_rex_64(Register reg, Register rm_reg); 1765 inline void emit_rex_64(Register reg, Register rm_reg);
1756 1766
1757 // Emits a REX prefix that encodes a 64-bit operand size and 1767 // 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_; 2219 Assembler* assembler_;
2210 #ifdef DEBUG 2220 #ifdef DEBUG
2211 int space_before_; 2221 int space_before_;
2212 #endif 2222 #endif
2213 }; 2223 };
2214 2224
2215 } // namespace internal 2225 } // namespace internal
2216 } // namespace v8 2226 } // namespace v8
2217 2227
2218 #endif // V8_X64_ASSEMBLER_X64_H_ 2228 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698