v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
compiler-source-position-table.cc
Go to the documentation of this file.
1// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
9
10namespace v8 {
11namespace internal {
12namespace compiler {
13
27
29 : graph_(graph),
30 decorator_(nullptr),
31 current_position_(SourcePosition::Unknown()),
32 table_(graph->zone()) {}
33
40
50
52 return table_.Get(node);
53}
57
63
64void SourcePositionTable::PrintJson(std::ostream& os) const {
65 os << "{";
66 bool needs_comma = false;
67 for (auto i : table_) {
68 SourcePosition pos = i.second;
69 if (pos.IsKnown()) {
70 if (needs_comma) {
71 os << ",";
72 }
73 os << "\"" << i.first << "\" : ";
74 pos.PrintJson(os);
75 needs_comma = true;
76 }
77 }
78 os << "}";
79}
80
81} // namespace compiler
82} // namespace internal
83} // namespace v8
SourcePosition pos
T * New(Args &&... args)
Definition zone.h:114
void SetSourcePosition(Node *node, SourcePosition position)
NodeAuxData< SourcePosition, UnknownSourcePosition > table_
void AddDecorator(GraphDecorator *decorator)
void RemoveDecorator(GraphDecorator *decorator)
SourcePositionTable * source_positions
int position
Definition liveedit.cc:290
SourcePositionTable *const table_
Definition pipeline.cc:227
#define DCHECK_NULL(val)
Definition logging.h:491
#define DCHECK_NOT_NULL(val)
Definition logging.h:492
#define DCHECK(condition)
Definition logging.h:482
TFGraph * graph_