summaryrefslogtreecommitdiff
path: root/deps/v8/src/maglev/maglev-compiler.h
blob: 9e9ee1ca1bfff1b2dd6ef209d49c2ecfab78b328 (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
// Copyright 2021 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_MAGLEV_MAGLEV_COMPILER_H_
#define V8_MAGLEV_MAGLEV_COMPILER_H_

#include "src/common/globals.h"
#include "src/compiler/bytecode-analysis.h"
#include "src/compiler/heap-refs.h"
#include "src/maglev/maglev-compilation-unit.h"

namespace v8 {
namespace internal {

namespace compiler {
class JSHeapBroker;
}

namespace maglev {

class Graph;

class MaglevCompiler : public AllStatic {
 public:
  // May be called from any thread.
  static bool Compile(LocalIsolate* local_isolate,
                      MaglevCompilationInfo* compilation_info);

  // Called on the main thread after Compile has completed.
  // TODO(v8:7700): Move this to a different class?
  static MaybeHandle<Code> GenerateCode(
      Isolate* isolate, MaglevCompilationInfo* compilation_info);
};

}  // namespace maglev
}  // namespace internal
}  // namespace v8

#endif  // V8_MAGLEV_MAGLEV_COMPILER_H_