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