| Index: runtime/vm/assembler_x64.cc
|
| diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
|
| index b2c6614bccc291bc2134a57a246f992f0878f091..2d98b949e0e3d1a94698e54f93044c49bd64e703 100644
|
| --- a/runtime/vm/assembler_x64.cc
|
| +++ b/runtime/vm/assembler_x64.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");
|
|
|
|
|
| void Assembler::InitializeMemoryWithBreakpoints(uword data, int length) {
|
| @@ -1516,6 +1517,34 @@ void Assembler::EmitGenericShift(bool wide,
|
| EmitOperand(rm, Operand(operand));
|
| }
|
|
|
| +
|
| +void Assembler::Comment(const char* format, ...) {
|
| + if (FLAG_code_comments) {
|
| + char buffer[1024];
|
| +
|
| + va_list args;
|
| + va_start(args, format);
|
| + OS::VSNPrint(buffer, sizeof(buffer), format, args);
|
| + va_end(args);
|
| +
|
| + comments_.Add(new CodeComment(buffer_.GetPosition(),
|
| + String::Handle(String::New(buffer))));
|
| + }
|
| +}
|
| +
|
| +
|
| +CodeComments Assembler::GetComments() {
|
| + CodeComments comments = CodeComments::New(comments_.length());
|
| +
|
| + for (int i = 0; i < comments_.length(); i++) {
|
| + comments.SetPCAt(i, comments_[i]->pc());
|
| + comments.SetCommentAt(i, comments_[i]->comment());
|
| + }
|
| +
|
| + return comments;
|
| +}
|
| +
|
| +
|
| } // namespace dart
|
|
|
| #endif // defined TARGET_ARCH_X64
|
|
|