summaryrefslogtreecommitdiffstats
path: root/chromium/v8/src/compiler/basic-block-instrumentor.h
blob: 372dfb4256d1f96b75df47eaf9a6a975fd695ab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_COMPILER_BASIC_BLOCK_INSTRUMENTOR_H_
#define V8_COMPILER_BASIC_BLOCK_INSTRUMENTOR_H_

#include "src/diagnostics/basic-block-profiler.h"
#include "src/utils/allocation.h"

namespace v8 {
namespace internal {

class OptimizedCompilationInfo;

namespace compiler {

class Graph;
class Schedule;

class BasicBlockInstrumentor : public AllStatic {
 public:
  static BasicBlockProfilerData* Instrument(OptimizedCompilationInfo* info,
                                            Graph* graph, Schedule* schedule,
                                            Isolate* isolate);
};

// A profiler which works when reorder_builtins flag was set as true, it will
// store the call graph between builtins, the call graph will be used to reorder
// builtins.
class BasicBlockCallGraphProfiler : public AllStatic {
 public:
  // The method will iterate all the basic blocks and visit all the nodes inside
  // the block, if there is a Call/TailCall node to another builtin, it will
  // save a record line (like builtin A calls builtin B at block N).
  static void StoreCallGraph(OptimizedCompilationInfo* info,
                             Schedule* schedule);
};

}  // namespace compiler
}  // namespace internal
}  // namespace v8

#endif  // V8_COMPILER_BASIC_BLOCK_INSTRUMENTOR_H_