blob: 024175c8408808e99290515df7243c77d086fe8c (
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
|
// Copyright 2022 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.
#include "src/maglev/maglev.h"
#include "src/common/globals.h"
#include "src/maglev/maglev-compilation-info.h"
#include "src/maglev/maglev-compiler.h"
namespace v8 {
namespace internal {
MaybeHandle<CodeT> Maglev::Compile(Isolate* isolate,
Handle<JSFunction> function) {
DCHECK(v8_flags.maglev);
std::unique_ptr<maglev::MaglevCompilationInfo> info =
maglev::MaglevCompilationInfo::New(isolate, function);
maglev::MaglevCompiler::Compile(isolate->main_thread_local_isolate(),
info.get());
return maglev::MaglevCompiler::GenerateCode(isolate, info.get());
}
} // namespace internal
} // namespace v8
|