Chromium Code Reviews| Index: runtime/vm/assembler_ia32.cc |
| diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc |
| index 2197700ca71fb04be420f8e257d7433808172a5b..107d33256eea9c40a9bf3a130d8bb720d6099269 100644 |
| --- a/runtime/vm/assembler_ia32.cc |
| +++ b/runtime/vm/assembler_ia32.cc |
| @@ -14,6 +14,7 @@ |
| namespace dart { |
| DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); |
| +DEFINE_FLAG(bool, code_comments, false, "Include comments into disassembly"); |
|
srdjan
2012/05/17 17:22:08
and code.
Vyacheslav Egorov (Google)
2012/05/17 21:16:27
Done.
|
| class DirectCallRelocation : public AssemblerFixup { |
| @@ -1559,6 +1560,27 @@ void Assembler::EmitGenericShift(int rm, |
| EmitOperand(rm, Operand(operand)); |
| } |
| + |
| +void Assembler::Comment(const char* comment) { |
| + if (FLAG_code_comments) { |
| + comments_.Add(new CodeComment(buffer_.GetPosition(), |
| + String::Handle(String::New(comment)))); |
| + } |
| +} |
| + |
| + |
| +CodeComments Assembler::GetComments() { |
| + CodeComments comments = CodeComments::New(comments_.length()); |
|
srdjan
2012/05/17 17:22:08
Make CodeComments ZoneObject and return "const Cod
Vyacheslav Egorov (Google)
2012/05/17 21:16:27
Done.
|
| + |
| + for (int i = 0; i < comments_.length(); i++) { |
|
srdjan
2012/05/17 17:22:08
intptr_t
Vyacheslav Egorov (Google)
2012/05/17 21:16:27
Done.
|
| + comments.SetPCAt(i, comments_[i]->pc()); |
| + comments.SetCommentAt(i, comments_[i]->comment()); |
| + } |
| + |
| + return comments; |
| +} |
| + |
| + |
| } // namespace dart |
| #endif // defined TARGET_ARCH_IA32 |