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

Unified Diff: src/IceAssemblerARM32.h

Issue 1426513004: Fix ARM emit() methods to count instructions generated. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 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 | « no previous file | src/IceAssemblerARM32.cpp » ('j') | src/IceAssemblerARM32.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerARM32.h
diff --git a/src/IceAssemblerARM32.h b/src/IceAssemblerARM32.h
index 1c2528c21c675b11595696fd293274b6848d8508..76e95897ec994a72cd356f454464abeae08d5e27 100644
--- a/src/IceAssemblerARM32.h
+++ b/src/IceAssemblerARM32.h
@@ -137,6 +137,18 @@ public:
return false;
}
+ /// Used inside InstARM32::emitUsingTextFixup() to define the beginning of the
+ /// first assembly instruction to be emitted.
+ void startFirstInst() { TextInstCount = 1; }
Jim Stichnoth 2015/11/04 23:45:26 Bikeshedding a bit. It would be nice if the gette
Karl 2015/11/05 16:18:40 Done.
+
+ /// Used inside InstARM32::emit() methods to define the beginning of the next
+ /// assembly instruction being emitted.
+ void startNextInst() { ++TextInstCount; }
+
+ /// Returns the number of emitted instructions since the last call
+ /// to startFirstInst().
+ size_t getNumberEmittedInsts() const { return TextInstCount; }
+
void bind(Label *label);
// List of instructions implemented by integrated assembler.
@@ -196,7 +208,7 @@ public:
return Asm->getKind() == Asm_ARM32;
}
- void emitTextInst(const std::string &Text, SizeT InstSize = sizeof(IValueT));
+ void emitTextInst(const std::string &Text, SizeT InstSize);
private:
// A vector of pool-allocated x86 labels for CFG nodes.
@@ -204,6 +216,9 @@ private:
LabelVector CfgNodeLabels;
// A vector of pool-allocated x86 labels for Local labels.
LabelVector LocalLabels;
+ // Counter used to count number of instructions emitted inside
+ // InstARM32::emit() methods, when run inside InstARM32::emitUsingTextFixup().
+ size_t TextInstCount = 0;
Label *getOrCreateLabel(SizeT Number, LabelVector &Labels);
« no previous file with comments | « no previous file | src/IceAssemblerARM32.cpp » ('j') | src/IceAssemblerARM32.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698