| Index: runtime/vm/assembler_ia32.cc
|
| diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
|
| index 2197700ca71fb04be420f8e257d7433808172a5b..a62ce8114255ea45efa66d726cbc84bf47408c1b 100644
|
| --- a/runtime/vm/assembler_ia32.cc
|
| +++ b/runtime/vm/assembler_ia32.cc
|
| @@ -14,6 +14,8 @@
|
| namespace dart {
|
|
|
| DEFINE_FLAG(bool, print_stop_message, true, "Print stop message.");
|
| +DEFINE_FLAG(bool, code_comments, false,
|
| + "Include comments into code and disassembly");
|
|
|
|
|
| class DirectCallRelocation : public AssemblerFixup {
|
| @@ -1559,6 +1561,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))));
|
| + }
|
| +}
|
| +
|
| +
|
| +const Code::Comments& Assembler::GetCodeComments() const {
|
| + Code::Comments& comments = Code::Comments::New(comments_.length());
|
| +
|
| + for (intptr_t i = 0; i < comments_.length(); i++) {
|
| + comments.SetPCOffsetAt(i, comments_[i]->pc_offset());
|
| + comments.SetCommentAt(i, comments_[i]->comment());
|
| + }
|
| +
|
| + return comments;
|
| +}
|
| +
|
| +
|
| } // namespace dart
|
|
|
| #endif // defined TARGET_ARCH_IA32
|
|
|