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

Unified Diff: runtime/vm/assembler_x64.h

Issue 10407019: Extend assembler with ability to produce comments for the generated code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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: runtime/vm/assembler_x64.h
diff --git a/runtime/vm/assembler_x64.h b/runtime/vm/assembler_x64.h
index b4b0ee8744d57c605991194f5274429714ceea8b..2d2db8e2bf2ead6bdf24d7cb23246d04936e6fb6 100644
--- a/runtime/vm/assembler_x64.h
+++ b/runtime/vm/assembler_x64.h
@@ -530,6 +530,9 @@ class Assembler : public ValueObject {
void Align(int alignment, int offset);
void Bind(Label* label);
+ void Comment(const char* format, ...);
+ CodeComments GetComments();
srdjan 2012/05/17 17:22:08 ditto from ia32
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
+
int CodeSize() const { return buffer_.Size(); }
int prolog_offset() const { return prolog_offset_; }
const ZoneGrowableArray<int>& GetPointerOffsets() const {
@@ -552,6 +555,21 @@ class Assembler : public ValueObject {
AssemblerBuffer buffer_;
int prolog_offset_;
+ class CodeComment : public ZoneAllocated {
+ public:
+ CodeComment(intptr_t pc, const String& comment)
+ : pc_(pc), comment_(comment) { }
+
+ intptr_t pc() const { return pc_; }
+ const String& comment() const { return comment_; }
+
+ private:
+ intptr_t pc_;
+ const String& comment_;
+ };
+
+ GrowableArray<CodeComment*> comments_;
+
inline void EmitUint8(uint8_t value);
inline void EmitInt32(int32_t value);
inline void EmitInt64(int64_t value);

Powered by Google App Engine
This is Rietveld 408576698