v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
osr.h
Go to the documentation of this file.
1
// Copyright 2014 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
5
#ifndef V8_COMPILER_OSR_H_
6
#define V8_COMPILER_OSR_H_
7
8
#include <stddef.h>
9
10
#include "
src/base/macros.h
"
11
12
namespace
v8
{
13
namespace
internal
{
14
15
class
OptimizedCompilationInfo;
16
17
namespace
compiler {
18
19
class
Frame;
20
21
// Encapsulates logic relating to OSR compilations as well has handles some
22
// details of the frame layout.
23
class
OsrHelper
{
24
public
:
25
explicit
OsrHelper
(
OptimizedCompilationInfo
* info);
26
27
// Prepares the frame w.r.t. OSR.
28
V8_EXPORT_PRIVATE
void
SetupFrame
(
Frame
* frame);
29
30
// Returns the number of unoptimized frame slots for this OSR.
31
size_t
UnoptimizedFrameSlots
() {
return
stack_slot_count_
; }
32
33
// Returns the environment index of the first stack slot.
34
static
int
FirstStackSlotIndex
(
int
parameter_count
) {
35
// TurboFan environments do not contain the context.
36
return
1 +
parameter_count
;
// receiver + params
37
}
38
39
private
:
40
size_t
parameter_count_
;
41
size_t
stack_slot_count_
;
42
};
43
44
}
// namespace compiler
45
}
// namespace internal
46
}
// namespace v8
47
48
#endif
// V8_COMPILER_OSR_H_
parameter_count
int16_t parameter_count
Definition
builtins.cc:67
v8::internal::OptimizedCompilationInfo
Definition
optimized-compilation-info.h:54
v8::internal::compiler::Frame
Definition
frame.h:91
v8::internal::compiler::OsrHelper
Definition
osr.h:23
v8::internal::compiler::OsrHelper::parameter_count_
size_t parameter_count_
Definition
osr.h:40
v8::internal::compiler::OsrHelper::SetupFrame
V8_EXPORT_PRIVATE void SetupFrame(Frame *frame)
Definition
osr.cc:21
v8::internal::compiler::OsrHelper::stack_slot_count_
size_t stack_slot_count_
Definition
osr.h:41
v8::internal::compiler::OsrHelper::UnoptimizedFrameSlots
size_t UnoptimizedFrameSlots()
Definition
osr.h:31
v8::internal::compiler::OsrHelper::OsrHelper
OsrHelper(OptimizedCompilationInfo *info)
Definition
osr.cc:15
v8::internal::compiler::OsrHelper::FirstStackSlotIndex
static int FirstStackSlotIndex(int parameter_count)
Definition
osr.h:34
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
macros.h
V8_EXPORT_PRIVATE
#define V8_EXPORT_PRIVATE
Definition
macros.h:460
src
compiler
osr.h
Generated on Sun Apr 6 2025 21:08:52 for v8 by
1.12.0