Flutter Engine
The Flutter Engine
code_comments.cc
Go to the documentation of this file.
1// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4#include "vm/globals.h" // For INCLUDE_IL_PRINTER
5#if defined(INCLUDE_IL_PRINTER)
6
7#include "vm/code_comments.h"
8#if !defined(DART_PRECOMPILED_RUNTIME)
10#endif // !defined(DART_PRECOMPILED_RUNTIME)
11#include "vm/object.h"
12
13namespace dart {
14
15#if !defined(DART_PRECOMPILED_RUNTIME)
16const CodeComments& CreateCommentsFrom(compiler::Assembler* assembler) {
17 const auto& comments = assembler->comments();
18 Code::Comments& result = Code::Comments::New(comments.length());
19
20 for (intptr_t i = 0; i < comments.length(); i++) {
21 result.SetPCOffsetAt(i, comments[i]->pc_offset());
22 result.SetCommentAt(i, comments[i]->comment());
23 }
24
25 return result;
26}
27#endif // !defined(DART_PRECOMPILED_RUNTIME)
28
29} // namespace dart
30#endif // defined(INCLUDE_IL_PRINTER)
GAsyncResult * result
Definition: dart_vm.cc:33