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

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

Issue 900223006: [ia32] Assembler support for internal references. (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/ia32/assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/assembler-ia32.h
diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h
index a5d289d97084bad51e3afebfe187bf31b0496ca4..71d894d8708730dfd353ae09195fa2ba49934838 100644
--- a/src/ia32/assembler-ia32.h
+++ b/src/ia32/assembler-ia32.h
@@ -37,6 +37,8 @@
#ifndef V8_IA32_ASSEMBLER_IA32_H_
#define V8_IA32_ASSEMBLER_IA32_H_
+#include <deque>
+
#include "src/isolate.h"
#include "src/serialize.h"
@@ -357,6 +359,11 @@ class Operand BASE_EMBEDDED {
int32_t disp,
RelocInfo::Mode rmode = RelocInfo::NONE32);
+ static Operand JumpTable(Register index, ScaleFactor scale, Label* table) {
+ return Operand(index, scale, reinterpret_cast<int32_t>(table),
+ RelocInfo::INTERNAL_REFERENCE);
+ }
+
static Operand StaticVariable(const ExternalReference& ext) {
return Operand(reinterpret_cast<int32_t>(ext.address()),
RelocInfo::EXTERNAL_REFERENCE);
@@ -430,11 +437,7 @@ class Operand BASE_EMBEDDED {
class Displacement BASE_EMBEDDED {
public:
- enum Type {
- UNCONDITIONAL_JUMP,
- CODE_RELATIVE,
- OTHER
- };
+ enum Type { UNCONDITIONAL_JUMP, CODE_RELATIVE, OTHER, CODE_ABSOLUTE };
int data() const { return data_; }
Type type() const { return TypeField::decode(data_); }
@@ -804,6 +807,7 @@ class Assembler : public AssemblerBase {
void int3();
void nop();
void ret(int imm16);
+ void ud2();
// Label operations & relative jumps (PPUM Appendix D)
//
@@ -1268,6 +1272,7 @@ class Assembler : public AssemblerBase {
// inline tables, e.g., jump-tables.
void db(uint8_t data);
void dd(uint32_t data);
+ void dd(Label* label);
// Check if there is less than kGap bytes available in the buffer.
// If this is the case, we need to grow the buffer before emitting
@@ -1343,6 +1348,8 @@ class Assembler : public AssemblerBase {
void emit_operand(Register reg, const Operand& adr);
+ void emit_label(Label* label);
+
void emit_farith(int b1, int b2, int i);
// Emit vex prefix
@@ -1369,6 +1376,11 @@ class Assembler : public AssemblerBase {
friend class CodePatcher;
friend class EnsureSpace;
+ // 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_;
+
// code generation
RelocInfoWriter reloc_info_writer;
« no previous file with comments | « no previous file | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698