Index: src/x64/assembler-x64.h |
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h |
index b973495bfae08f81aeffd9812952f703717a1693..330daf6490cec148186c7089d0dc3d66d602b35c 100644 |
--- a/src/x64/assembler-x64.h |
+++ b/src/x64/assembler-x64.h |
@@ -37,6 +37,8 @@ |
#ifndef V8_X64_ASSEMBLER_X64_H_ |
#define V8_X64_ASSEMBLER_X64_H_ |
+#include <deque> |
+ |
#include "src/serialize.h" |
namespace v8 { |
@@ -408,6 +410,9 @@ class Operand BASE_EMBEDDED { |
// this must not overflow. |
Operand(const Operand& base, int32_t offset); |
+ // [rip + disp/r] |
+ explicit Operand(Label* label); |
+ |
// Checks whether either base or index register is the given register. |
// Does not check the "reg" part of the Operand. |
bool AddressUsesRegister(Register reg) const; |
@@ -421,7 +426,7 @@ class Operand BASE_EMBEDDED { |
private: |
byte rex_; |
- byte buf_[6]; |
+ byte buf_[9]; |
// The number of bytes of buf_ in use. |
byte len_; |
@@ -437,6 +442,7 @@ class Operand BASE_EMBEDDED { |
// Needs to be called after set_sib, not before it. |
inline void set_disp8(int disp); |
inline void set_disp32(int disp); |
+ inline void set_disp64(int64_t disp); // for labels. |
friend class Assembler; |
}; |
@@ -888,6 +894,7 @@ class Assembler : public AssemblerBase { |
void int3(); |
void nop(); |
void ret(int imm16); |
+ void ud2(); |
void setcc(Condition cc, Register reg); |
// Label operations & relative jumps (PPUM Appendix D) |
@@ -934,6 +941,7 @@ class Assembler : public AssemblerBase { |
// Jump near absolute indirect (r64) |
void jmp(Register adr); |
+ void jmp(const Operand& src); |
// Conditional jumps |
void j(Condition cc, |
@@ -1344,6 +1352,7 @@ class Assembler : public AssemblerBase { |
// Used for inline tables, e.g., jump-tables. |
void db(uint8_t data); |
void dd(uint32_t data); |
+ void dq(Label* label); |
PositionsRecorder* positions_recorder() { return &positions_recorder_; } |
@@ -1371,9 +1380,6 @@ class Assembler : public AssemblerBase { |
// Call near indirect |
void call(const Operand& operand); |
- // Jump near absolute indirect (m64) |
- void jmp(const Operand& src); |
- |
private: |
byte* addr_at(int pos) { return buffer_ + pos; } |
uint32_t long_at(int pos) { |
@@ -1811,6 +1817,11 @@ class Assembler : public AssemblerBase { |
// code generation |
RelocInfoWriter reloc_info_writer; |
+ // Internal reference positions, required for (potential) patching in |
+ // GrowBuffer(); contains only those internal references whose labels |
+ // are already bound. |
+ std::deque<int> internal_reference_positions_; |
+ |
List< Handle<Code> > code_targets_; |
PositionsRecorder positions_recorder_; |