v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
maglev-compilation-unit.cc
Go to the documentation of this file.
1// Copyright 2022 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
12
13namespace v8 {
14namespace internal {
15namespace maglev {
16
20 info, nullptr,
21 MakeRef(info->broker(), info->broker()->CanonicalPersistentHandle(
22 function->shared())),
23 MakeRef(info->broker(), info->broker()->CanonicalPersistentHandle(
24 function->raw_feedback_cell()))) {}
25
28 compiler::SharedFunctionInfoRef shared_function_info,
29 compiler::FeedbackCellRef feedback_cell)
30 : info_(info),
31 caller_(caller),
32 shared_function_info_(shared_function_info),
33 bytecode_(shared_function_info.GetBytecodeArray(broker())),
34 feedback_cell_(feedback_cell),
35 register_count_(bytecode_->register_count()),
36 parameter_count_(bytecode_->parameter_count()),
37 max_arguments_(bytecode_->max_arguments()),
38 inlining_depth_(caller == nullptr ? 0 : caller->inlining_depth_ + 1) {
39 // Check that the parameter count in the bytecode and in the shared function
40 // info are consistent.
42 bytecode_->parameter_count(),
43 shared_function_info.internal_formal_parameter_count_with_receiver());
44}
45
48 int register_count, uint16_t parameter_count, uint16_t max_arguments)
49 : info_(info),
50 caller_(caller),
51 register_count_(register_count),
52 parameter_count_(parameter_count),
53 max_arguments_(max_arguments),
54 inlining_depth_(caller == nullptr ? 0 : caller->inlining_depth_ + 1) {}
55
59
61
65
70
76
78 const {
79 const MaglevCompilationUnit* unit = this;
80 while (unit->is_inline()) {
81 unit = unit->caller();
82 }
83 return unit;
84}
85
87 return inlining_depth_ == 0 && info_->toplevel_is_osr();
88}
89
93
94} // namespace maglev
95} // namespace internal
96} // namespace v8
int16_t parameter_count
Definition builtins.cc:67
static constexpr BytecodeOffset None()
Definition utils.h:675
compiler::SharedFunctionInfoRef shared_function_info() const
const MaglevCompilationUnit * GetTopLevelCompilationUnit() const
const compiler::OptionalBytecodeArrayRef bytecode_
MaglevCompilationUnit(MaglevCompilationInfo *info, DirectHandle< JSFunction > function)
void RegisterNode(const NodeBase *node, const MaglevCompilationUnit *unit, BytecodeOffset bytecode_offset, SourcePosition position)
base::Vector< const RegExpInstruction > bytecode_
JSHeapBroker * broker
const Handle< Object > caller_
Definition isolate.cc:1115
OptimizedCompilationInfo * info_
Definition pipeline.cc:305
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_EQ(v1, v2)
Definition logging.h:485