v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
build-graph-phase.cc
Go to the documentation of this file.
1// Copyright 2023 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
7#include <optional>
8
11#include "src/compiler/phase.h"
15
17
18std::optional<BailoutReason> BuildGraphPhase::Run(
19 PipelineData* data, Zone* temp_zone,
20 compiler::TFPipelineData* turbofan_data, Linkage* linkage) {
21 Schedule* schedule = turbofan_data->schedule();
22 turbofan_data->reset_schedule();
24
26#if V8_ENABLE_WEBASSEMBLY
27 turbofan_data->js_wasm_calls_sidetable();
28#else
29 nullptr;
30#endif // V8_ENABLE_WEBASSEMBLY
31
32 UnparkedScopeIfNeeded scope(data->broker());
33
34 // Construct a new graph.
36 turbofan_data->source_positions());
38 turbofan_data->node_origins());
39 data->InitializeGraphComponentWithGraphZone(turbofan_data->ReleaseGraphZone(),
40 source_positions, node_origins);
41
42 if (auto bailout = turboshaft::BuildGraph(data, schedule, temp_zone, linkage,
44 return bailout;
45 }
46 return {};
47}
48
49} // namespace v8::internal::compiler::turboshaft
Schedule * schedule
turboshaft::ZoneWithName< kGraphZoneName > ReleaseGraphZone()
SourcePositionTable * source_positions() const
JsWasmCallsSidetable * js_wasm_calls_sidetable
SourcePositionTable * source_positions
Linkage * linkage
std::optional< BailoutReason > BuildGraph(PipelineData *data, Schedule *schedule, Zone *phase_zone, Linkage *linkage, JsWasmCallsSidetable *js_wasm_calls_sidetable)
#define DCHECK_NOT_NULL(val)
Definition logging.h:492
std::optional< BailoutReason > Run(PipelineData *data, Zone *temp_zone, compiler::TFPipelineData *turbofan_data, Linkage *linkage)