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

Unified Diff: runtime/vm/object.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: address Srdjan comments 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/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index c4be8a68f70a98f252c934a1395b47bceb965122..d8e942746654638bccc95b59642a025859ea7cd4 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2180,6 +2180,39 @@ class Code : public Object {
void set_stackmaps(const Array& maps) const;
RawStackmap* GetStackmap(uword pc, Array* stackmaps, Stackmap* map) const;
+ class Comments : public ZoneAllocated {
+ public:
+ static Comments& New(intptr_t count);
+
+ intptr_t Length() const;
+
+ void SetPCOffsetAt(intptr_t idx, intptr_t pc_offset);
+ void SetCommentAt(intptr_t idx, const String& comment);
+
+ intptr_t PCOffsetAt(intptr_t idx) const;
+ const String& CommentAt(intptr_t idx) const;
+
+ private:
+ explicit Comments(const Array& comments);
+
+ // Layout of entries describing comments.
+ enum {
+ kPCOffsetEntry = 0, // PC offset to a comment as a Smi.
+ kCommentEntry, // Comment text as a String.
+ kNumberOfEntries
+ };
+
+ const Array& comments_;
+
+ friend class Code;
+
+ DISALLOW_COPY_AND_ASSIGN(Comments);
+ };
+
+
+ const Comments& comments() const;
+ void set_comments(const Comments& comments) const;
+
RawLocalVarDescriptors* var_descriptors() const {
return raw_ptr()->var_descriptors_;
}

Powered by Google App Engine
This is Rietveld 408576698