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

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: 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..8103ea0dcd4835476b11b6a965b6a14c97d9b639 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2143,6 +2143,34 @@ class ExceptionHandlers : public Object {
};
+class CodeComments : public ValueObject {
srdjan 2012/05/17 17:22:08 Please move CodeComments inside class Code.
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
+ public:
+ enum {
+ kPCEntry = 0,
+ kCommentEntry,
+ kNumberOfEntries
+ };
srdjan 2012/05/17 17:22:08 name the enum, and why do you need it?
srdjan 2012/05/17 17:22:08 name the enum, and why do you need it?
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Discussed offline. Moved enum to private section.
+
+ static CodeComments New(int count);
srdjan 2012/05/17 17:22:08 Memory sizes are in intptr_t.
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
+
+ intptr_t Length();
+
+ intptr_t PCAt(int idx);
srdjan 2012/05/17 17:22:08 Is it PC or PCOffset?
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
+ void SetPCAt(int idx, intptr_t pc);
srdjan 2012/05/17 17:22:08 pc_offset?
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
+
+ const String& CommentAt(int idx);
srdjan 2012/05/17 17:22:08 const?
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
+ void SetCommentAt(int idx, const String& comment);
+
+ private:
+ explicit CodeComments(RawArray* comments);
+ CodeComments();
srdjan 2012/05/17 17:22:08 Remove this constructor once it becomes ZoneObject
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done.
+
+ const Array& comments_;
+
+ friend class Code;
srdjan 2012/05/17 17:22:08 Remove this once moved inside class Code, I guess.
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Moving one class into another does not make these
+};
+
+
class Code : public Object {
public:
RawInstructions* instructions() const { return raw_ptr()->instructions_; }
@@ -2180,6 +2208,9 @@ class Code : public Object {
void set_stackmaps(const Array& maps) const;
RawStackmap* GetStackmap(uword pc, Array* stackmaps, Stackmap* map) const;
+ CodeComments comments() const;
srdjan 2012/05/17 17:22:08 const CodeComments&
Vyacheslav Egorov (Google) 2012/05/17 21:16:27 Done. However both Code::Comments::New and Code::c
Ivan Posva 2012/05/22 22:40:02 Maybe the real solution should be that the code co
+ void set_comments(const CodeComments& comments) const;
+
RawLocalVarDescriptors* var_descriptors() const {
return raw_ptr()->var_descriptors_;
}

Powered by Google App Engine
This is Rietveld 408576698