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

Unified Diff: src/x64/assembler-x64.h

Issue 887013003: [x64] Assembler support for internal references and RIP relative addressing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/x64/assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698