11cb0ef41Sopenharmony_ci// Copyright 2015 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
61cb0ef41Sopenharmony_ci#define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include "src/compiler/js-operator.h"
91cb0ef41Sopenharmony_ci#include "src/compiler/js-type-hint-lowering.h"
101cb0ef41Sopenharmony_ci#include "src/compiler/node-observer.h"
111cb0ef41Sopenharmony_ci#include "src/handles/handles.h"
121cb0ef41Sopenharmony_ci#include "src/objects/code-kind.h"
131cb0ef41Sopenharmony_ci#include "src/utils/utils.h"
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_cinamespace v8 {
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciclass TickCounter;
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_cinamespace internal {
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ciclass BytecodeArray;
221cb0ef41Sopenharmony_ciclass FeedbackVector;
231cb0ef41Sopenharmony_ciclass SharedFunctionInfo;
241cb0ef41Sopenharmony_ciclass Zone;
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_cinamespace compiler {
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ciclass JSGraph;
291cb0ef41Sopenharmony_ciclass NodeObserver;
301cb0ef41Sopenharmony_ciclass SourcePositionTable;
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_cienum class BytecodeGraphBuilderFlag : uint8_t {
331cb0ef41Sopenharmony_ci  kSkipFirstStackAndTierupCheck = 1 << 0,
341cb0ef41Sopenharmony_ci  // TODO(neis): Remove liveness flag here when concurrent inlining is always
351cb0ef41Sopenharmony_ci  // on, because then the serializer will be the only place where we perform
361cb0ef41Sopenharmony_ci  // bytecode analysis.
371cb0ef41Sopenharmony_ci  kAnalyzeEnvironmentLiveness = 1 << 1,
381cb0ef41Sopenharmony_ci  kBailoutOnUninitialized = 1 << 2,
391cb0ef41Sopenharmony_ci};
401cb0ef41Sopenharmony_ciusing BytecodeGraphBuilderFlags = base::Flags<BytecodeGraphBuilderFlag>;
411cb0ef41Sopenharmony_ci
421cb0ef41Sopenharmony_ci// Note: {invocation_frequency} is taken by reference to work around a GCC bug
431cb0ef41Sopenharmony_ci// on AIX (v8:8193).
441cb0ef41Sopenharmony_civoid BuildGraphFromBytecode(JSHeapBroker* broker, Zone* local_zone,
451cb0ef41Sopenharmony_ci                            SharedFunctionInfoRef const& shared_info,
461cb0ef41Sopenharmony_ci                            FeedbackCellRef const& feedback_cell,
471cb0ef41Sopenharmony_ci                            BytecodeOffset osr_offset, JSGraph* jsgraph,
481cb0ef41Sopenharmony_ci                            CallFrequency const& invocation_frequency,
491cb0ef41Sopenharmony_ci                            SourcePositionTable* source_positions,
501cb0ef41Sopenharmony_ci                            int inlining_id, CodeKind code_kind,
511cb0ef41Sopenharmony_ci                            BytecodeGraphBuilderFlags flags,
521cb0ef41Sopenharmony_ci                            TickCounter* tick_counter,
531cb0ef41Sopenharmony_ci                            ObserveNodeInfo const& observe_node_info = {});
541cb0ef41Sopenharmony_ci
551cb0ef41Sopenharmony_ci}  // namespace compiler
561cb0ef41Sopenharmony_ci}  // namespace internal
571cb0ef41Sopenharmony_ci}  // namespace v8
581cb0ef41Sopenharmony_ci
591cb0ef41Sopenharmony_ci#endif  // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
60