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

Unified Diff: runtime/vm/assembler_ia32.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
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.cc » ('j') | runtime/vm/disassembler_ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.h
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index bcb2f755b671fb4e6995e8607c5ed6c533b93bf7..1cb69eccc3ae2796b2e5192d6cefa27f87cd2fac 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -279,7 +279,7 @@ class Label : public ValueObject {
class Assembler : public ValueObject {
public:
- Assembler() : buffer_(), prolog_offset_(-1) { }
+ Assembler() : buffer_(), prolog_offset_(-1), comments_() { }
~Assembler() { }
static const bool kNearJump = true;
@@ -561,10 +561,30 @@ class Assembler : public ValueObject {
static void InitializeMemoryWithBreakpoints(uword data, int length);
+ void Comment(const char* comment);
+ const Code::Comments& GetCodeComments() const;
+
private:
AssemblerBuffer buffer_;
int prolog_offset_;
+ class CodeComment : public ZoneAllocated {
+ public:
+ CodeComment(intptr_t pc_offset, const String& comment)
+ : pc_offset_(pc_offset), comment_(comment) { }
+
+ intptr_t pc_offset() const { return pc_offset_; }
+ const String& comment() const { return comment_; }
+
+ private:
+ intptr_t pc_offset_;
+ const String& comment_;
+
+ DISALLOW_COPY_AND_ASSIGN(CodeComment);
+ };
+
+ GrowableArray<CodeComment*> comments_;
+
inline void EmitUint8(uint8_t value);
inline void EmitInt32(int32_t value);
inline void EmitRegisterOperand(int rm, int reg);
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.cc » ('j') | runtime/vm/disassembler_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698