v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtin-compiler.cc
Go to the documentation of this file.
1// Copyright 2024 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
6
15
17
18inline constexpr char kBuiltinCompilationZoneName[] =
19 "builtin-compilation-zone";
20
22 Isolate* isolate, Builtin builtin, TurboshaftAssemblerGenerator generator,
23 std::function<compiler::CallDescriptor*(Zone*)> call_descriptor_builder,
24 const char* name, const AssemblerOptions& options, CodeKind code_kind,
25 std::optional<BytecodeHandlerData> bytecode_handler_data) {
26 using namespace compiler::turboshaft; // NOLINT(build/namespaces)
27 DCHECK_EQ(code_kind == CodeKind::BYTECODE_HANDLER,
28 bytecode_handler_data.has_value());
29
30 compiler::ZoneStats zone_stats(isolate->allocator());
33 OptimizedCompilationInfo info(base::CStrVector(name), zone, code_kind,
34 builtin);
35 compiler::CallDescriptor* call_descriptor = call_descriptor_builder(zone);
36
38 &info, options);
39 data.InitializeBuiltinComponent(call_descriptor,
40 std::move(bytecode_handler_data));
41 data.InitializeGraphComponent(nullptr);
42 ZoneWithName<kTempZoneName> temp_zone(&zone_stats, kTempZoneName);
43 generator(&data, isolate, data.graph(), temp_zone);
44
47 &data, call_descriptor, builtin, name,
49 .ToHandleChecked();
50 return code;
51}
52
53} // namespace v8::internal::compiler::turboshaft
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
static const ProfileDataFromFile * TryRead(const char *name)
static MaybeHandle< Code > GenerateCodeForTurboshaftBuiltin(turboshaft::PipelineData *turboshaft_data, CallDescriptor *call_descriptor, Builtin builtin, const char *debug_name, const ProfileDataFromFile *profile_data)
Definition pipeline.cc:2518
Handle< Code > code
Handle< SharedFunctionInfo > info
Vector< const char > CStrVector(const char *data)
Definition vector.h:331
DirectHandle< Code > BuildWithTurboshaftAssemblerImpl(Isolate *isolate, Builtin builtin, TurboshaftAssemblerGenerator generator, std::function< compiler::CallDescriptor *(Zone *)> call_descriptor_builder, const char *name, const AssemblerOptions &options, CodeKind code_kind, std::optional< BytecodeHandlerData > bytecode_handler_data)
void(*)(compiler::turboshaft::PipelineData *, Isolate *, compiler::turboshaft::Graph &, Zone *) TurboshaftAssemblerGenerator
#define DCHECK_EQ(v1, v2)
Definition logging.h:485