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

Unified Diff: src/IceAssembler.h

Issue 1397933002: Start incorporating the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit and add URL. 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 | « src/DartARM32/assembler_arm.cc ('k') | 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 8247e66cf1af8f27cdf3d686781cdbc5673dc821..2f5a505363f329f5b544d6378032c35ab155bca6 100644
--- a/src/IceAssembler.h
+++ b/src/IceAssembler.h
@@ -64,17 +64,20 @@ public:
return Position - kWordSize;
}
+ void setPosition(intptr_t NewValue) { Position = NewValue; }
+
bool isBound() const { return Position < 0; }
bool isLinked() const { return Position > 0; }
+
virtual bool isUnused() const { return Position == 0; }
-protected:
void bindTo(intptr_t position) {
assert(!isBound());
Position = -position - kWordSize;
assert(isBound());
}
+protected:
void linkTo(intptr_t position) {
assert(!isBound());
Position = position + kWordSize;
@@ -83,7 +86,6 @@ protected:
intptr_t Position = 0;
-private:
// TODO(jvoung): why are labels offset by this?
static constexpr uint32_t kWordSize = sizeof(uint32_t);
};
@@ -272,7 +274,7 @@ public:
return Buffer.createFixup(Kind, Value);
}
- void emitIASBytes(GlobalContext *Ctx) const;
+ void emitIASBytes() const;
bool getInternal() const { return IsInternal; }
void setInternal(bool Internal) { IsInternal = Internal; }
const IceString &getFunctionName() { return FunctionName; }
@@ -286,8 +288,8 @@ public:
AssemblerKind getKind() const { return Kind; }
protected:
- explicit Assembler(AssemblerKind Kind)
- : Kind(Kind), Allocator(), Buffer(*this) {}
+ explicit Assembler(AssemblerKind Kind, GlobalContext *Ctx)
+ : Kind(Kind), Allocator(), Ctx(Ctx), Buffer(*this) {}
private:
const AssemblerKind Kind;
@@ -305,6 +307,7 @@ private:
bool Preliminary = false;
protected:
+ GlobalContext *Ctx;
// Buffer's constructor uses the Allocator, so it needs to appear after it.
// TODO(jpp): dependencies on construction order are a nice way of shooting
// yourself in the foot. Fix this.
« no previous file with comments | « src/DartARM32/assembler_arm.cc ('k') | src/IceAssembler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698