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

Unified Diff: src/assembler.h

Issue 700263003: Rearrange emit vs emitIAS. Wait till function is done before dumping text. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: remove comment... might end up using the iterator Created 6 years, 1 month 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/IceTranslator.cpp ('k') | src/assembler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index dcb83ed68b39b69485f63e2b27c6e17029875739..37963c4c393794c07424c44832855ecd51b19f37 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -162,8 +162,10 @@ public:
// Returns the position in the instruction stream.
intptr_t GetPosition() const { return cursor_ - contents_; }
- // For bringup only.
- AssemblerFixup *GetLatestFixup(intptr_t position) const;
+ // List of pool-allocated fixups.
+ typedef std::vector<AssemblerFixup *> FixupList;
+ FixupList::const_iterator fixups_begin() const { return fixups_.begin(); }
+ FixupList::const_iterator fixups_end() const { return fixups_.end(); }
private:
// The limit is set to kMinimumGap bytes before the end of the data area.
@@ -175,7 +177,7 @@ private:
uintptr_t cursor_;
uintptr_t limit_;
Assembler &assembler_;
- std::vector<AssemblerFixup *> fixups_;
+ FixupList fixups_;
#ifndef NDEBUG
bool fixups_processed_;
#endif // !NDEBUG
@@ -206,7 +208,7 @@ class Assembler {
Assembler &operator=(const Assembler &) = delete;
public:
- Assembler() {}
+ Assembler() : buffer_(*this) {}
virtual ~Assembler() {}
// Allocate a chunk of bytes using the per-Assembler allocator.
@@ -226,8 +228,13 @@ public:
virtual void BindCfgNodeLabel(SizeT NodeNumber) = 0;
+ void emitIASBytes(GlobalContext *Ctx) const;
+
private:
llvm::BumpPtrAllocator Allocator;
+
+protected:
+ AssemblerBuffer buffer_;
};
} // end of namespace Ice
« no previous file with comments | « src/IceTranslator.cpp ('k') | src/assembler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698