V8 Project
node-aux-data-inl.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_NODE_AUX_DATA_INL_H_
6
#define V8_COMPILER_NODE_AUX_DATA_INL_H_
7
8
#include "
src/compiler/graph.h
"
9
#include "
src/compiler/node.h
"
10
#include "
src/compiler/node-aux-data.h
"
11
12
namespace
v8
{
13
namespace
internal {
14
namespace
compiler {
15
16
template
<
class
T>
17
NodeAuxData<T>::NodeAuxData
(
Zone
* zone)
18
: aux_data_(zone) {}
19
20
21
template
<
class
T>
22
void
NodeAuxData<T>::Set
(Node* node,
const
T
& data) {
23
int
id
= node->id();
24
if
(
id
>=
static_cast<
int
>
(aux_data_.size())) {
25
aux_data_.resize(
id
+ 1);
26
}
27
aux_data_[id] = data;
28
}
29
30
31
template
<
class
T>
32
T
NodeAuxData<T>::Get
(Node* node) {
33
int
id
= node->id();
34
if
(
id
>=
static_cast<
int
>
(aux_data_.size())) {
35
return
T
();
36
}
37
return
aux_data_[id];
38
}
39
}
40
}
41
}
// namespace v8::internal::compiler
42
43
#endif
v8::internal::Zone
Definition:
zone.h:37
v8::internal::compiler::NodeAuxData::NodeAuxData
NodeAuxData(Zone *zone)
Definition:
node-aux-data-inl.h:17
v8::internal::compiler::NodeAuxData::Set
void Set(Node *node, const T &data)
Definition:
node-aux-data-inl.h:22
v8::internal::compiler::NodeAuxData::Get
T Get(Node *node)
Definition:
node-aux-data-inl.h:32
graph.h
v8
Debugger support for the V8 JavaScript engine.
Definition:
accessors.cc:20
node-aux-data.h
node.h
T
#define T(name, string, precedence)
Definition:
token.cc:25
mnt
V8SourceCode
src
compiler
node-aux-data-inl.h
Generated on Tue Jul 1 2025 02:36:32 for V8 Project by
1.9.1