Files
sdk/runtime/vm/code_comments.cc
T
Clement Skau 28a029102b [SDK] Adds --support-disassembler in PRODUCT.
This CL also addes CodeSourceMap source positions to the disassembler output.

Change-Id: I49f6cb5257394badc8a005167f906e185509a3e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125663
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-21 12:28:45 +00:00

28 lines
960 B
C++

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/code_comments.h"
namespace dart {
#if !defined(DART_PRECOMPILED_RUNTIME) && \
(!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
const Code::Comments& CreateCommentsFrom(compiler::Assembler* assembler) {
const auto& comments = assembler->comments();
Code::Comments& result = Code::Comments::New(comments.length());
for (intptr_t i = 0; i < comments.length(); i++) {
result.SetPCOffsetAt(i, comments[i]->pc_offset());
result.SetCommentAt(i, comments[i]->comment());
}
return result;
}
#endif // !defined(DART_PRECOMPILED_RUNTIME) && \
// (!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
} // namespace dart