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

Unified Diff: src/assembler.h

Issue 930733002: Subzero: Add sandboxing for x86-32. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add bundle alignment to the instruction emission loop 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
Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index dfd8cd123bfdc09418d095c80666b1be53c322f8..ecdda3781db41994e3ece9670a47e799a4cddcf3 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -115,6 +115,11 @@ public:
const FixupRefList &fixups() const { return fixups_; }
+ void setSize(intptr_t NewSize) {
+ assert(NewSize < Size());
+ cursor_ = contents_ + NewSize;
+ }
+
private:
// The limit is set to kMinimumGap bytes before the end of the data area.
// This leaves enough space for the longest possible instruction and allows
@@ -194,6 +199,11 @@ public:
void setInternal(bool Internal) { IsInternal = Internal; }
const IceString &getFunctionName() { return FunctionName; }
void setFunctionName(const IceString &NewName) { FunctionName = NewName; }
+ intptr_t getBufferSize() const { return buffer_.Size(); }
+ // Roll back to a (smaller) size.
+ void setBufferSize(intptr_t NewSize) { buffer_.setSize(NewSize); }
+ // Add nop padding of a particular width.
+ virtual void padWithNop(intptr_t Padding) = 0;
private:
ArenaAllocator<32 * 1024> Allocator;
« src/IceCfgNode.cpp ('K') | « src/IceTargetLoweringX8632.cpp ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698