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

Unified Diff: src/IceAssembler.h

Issue 1418523002: Add hybrid assembler concept to ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 2 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/IceAssembler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssembler.h
diff --git a/src/IceAssembler.h b/src/IceAssembler.h
index 2f5a505363f329f5b544d6378032c35ab155bca6..5e7815d321718308611d1f995edb7d45b41f0099 100644
--- a/src/IceAssembler.h
+++ b/src/IceAssembler.h
@@ -174,6 +174,20 @@ public:
/// Create and track a fixup in the current function.
AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value);
+ /// Create and track a textual fixup in the current function.
+ AssemblerTextFixup *createTextFixup(const std::string &Text,
+ size_t BytesUsed);
+
+ /// Mark that an attempt was made to emit, but failed. Hence, in order to
+ /// continue, one must emit a text fixup.
+ void setNeedsTextFixup() { TextFixupNeeded = true; }
+
+ /// Returns true if last emit failed and needs a text fixup.
+ bool needsTextFixup() const { return TextFixupNeeded; }
+
+ /// Installs a created fixup, after it has been allocated.
+ void installFixup(AssemblerFixup *F);
+
const FixupRefList &fixups() const { return Fixups; }
void setSize(intptr_t NewSize) {
@@ -194,6 +208,9 @@ private:
Assembler &Assemblr;
/// List of pool-allocated fixups relative to the current function.
FixupRefList Fixups;
+ // True if a textual fixup is needed, because the assembler was unable to
+ // emit the last request.
+ bool TextFixupNeeded;
uintptr_t cursor() const { return Cursor; }
uintptr_t limit() const { return Limit; }
@@ -268,12 +285,24 @@ public:
// Return a view of all the bytes of code for the current function.
llvm::StringRef getBufferView() const;
+ /// Emit a fixup at the current location.
+ void emitFixup(AssemblerFixup *Fixup) { Buffer.emitFixup(Fixup); }
+
const FixupRefList &fixups() const { return Buffer.fixups(); }
AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value) {
return Buffer.createFixup(Kind, Value);
}
+ AssemblerTextFixup *createTextFixup(const std::string &Text,
+ size_t BytesUsed) {
+ return Buffer.createTextFixup(Text, BytesUsed);
+ }
+
+ void setNeedsTextFixup() { Buffer.setNeedsTextFixup(); }
+
+ bool needsTextFixup() const { return Buffer.needsTextFixup(); }
+
void emitIASBytes() const;
bool getInternal() const { return IsInternal; }
void setInternal(bool Internal) { IsInternal = Internal; }
@@ -306,6 +335,9 @@ private:
/// fully committed (Preliminary=false).
bool Preliminary = false;
+ /// Installs a created fixup, after it has been allocated.
+ void installFixup(AssemblerFixup *F) { Buffer.installFixup(F); }
+
protected:
GlobalContext *Ctx;
// Buffer's constructor uses the Allocator, so it needs to appear after it.
« no previous file with comments | « no previous file | src/IceAssembler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698