• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015 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 
5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
7 
8 #include "src/compiler/js-operator.h"
9 #include "src/compiler/js-type-hint-lowering.h"
10 #include "src/compiler/node-observer.h"
11 #include "src/handles/handles.h"
12 #include "src/objects/code-kind.h"
13 #include "src/utils/utils.h"
14 
15 namespace v8 {
16 
17 class TickCounter;
18 
19 namespace internal {
20 
21 class BytecodeArray;
22 class FeedbackVector;
23 class SharedFunctionInfo;
24 class Zone;
25 
26 namespace compiler {
27 
28 class JSGraph;
29 class NodeObserver;
30 class SourcePositionTable;
31 
32 enum class BytecodeGraphBuilderFlag : uint8_t {
33   kSkipFirstStackAndTierupCheck = 1 << 0,
34   // TODO(neis): Remove liveness flag here when concurrent inlining is always
35   // on, because then the serializer will be the only place where we perform
36   // bytecode analysis.
37   kAnalyzeEnvironmentLiveness = 1 << 1,
38   kBailoutOnUninitialized = 1 << 2,
39 };
40 using BytecodeGraphBuilderFlags = base::Flags<BytecodeGraphBuilderFlag>;
41 
42 // Note: {invocation_frequency} is taken by reference to work around a GCC bug
43 // on AIX (v8:8193).
44 void BuildGraphFromBytecode(JSHeapBroker* broker, Zone* local_zone,
45                             SharedFunctionInfoRef const& shared_info,
46                             FeedbackCellRef const& feedback_cell,
47                             BytecodeOffset osr_offset, JSGraph* jsgraph,
48                             CallFrequency const& invocation_frequency,
49                             SourcePositionTable* source_positions,
50                             int inlining_id, CodeKind code_kind,
51                             BytecodeGraphBuilderFlags flags,
52                             TickCounter* tick_counter,
53                             ObserveNodeInfo const& observe_node_info = {});
54 
55 }  // namespace compiler
56 }  // namespace internal
57 }  // namespace v8
58 
59 #endif  // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
60