v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
refs-map.cc
Go to the documentation of this file.
1
// Copyright 2018 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
#include "
src/compiler/refs-map.h
"
6
7
namespace
v8
{
8
namespace
internal
{
9
namespace
compiler {
10
11
using
UnderlyingMap
=
12
base::TemplateHashMapImpl
<
Address
,
ObjectData
*,
AddressMatcher
,
13
ZoneAllocationPolicy
>;
14
15
RefsMap::RefsMap
(uint32_t capacity,
AddressMatcher
match,
Zone
* zone)
16
:
UnderlyingMap
(capacity, match,
ZoneAllocationPolicy
(zone)) {}
17
18
RefsMap::RefsMap
(
const
RefsMap
* other,
Zone
* zone)
19
:
UnderlyingMap
(other,
ZoneAllocationPolicy
(zone)) {}
20
21
RefsMap::Entry
*
RefsMap::Lookup
(
const
Address
&
key
)
const
{
22
return
UnderlyingMap::Lookup
(
key
,
Hash
(
key
));
23
}
24
25
RefsMap::Entry
*
RefsMap::LookupOrInsert
(
const
Address
&
key
) {
26
return
UnderlyingMap::LookupOrInsert
(
key
,
RefsMap::Hash
(
key
),
27
[]() {
return
nullptr
; });
28
}
29
30
ObjectData
*
RefsMap::Remove
(
const
Address
&
key
) {
31
return
UnderlyingMap::Remove
(
key
,
RefsMap::Hash
(
key
));
32
}
33
34
uint32_t
RefsMap::Hash
(
Address
addr) {
return
static_cast<
uint32_t
>
(addr); }
35
36
}
// namespace compiler
37
}
// namespace internal
38
}
// namespace v8
v8::base::TemplateHashMapImpl< Address, ObjectData *, AddressMatcher, ZoneAllocationPolicy >
v8::base::TemplateHashMapImpl< Address, ObjectData *, AddressMatcher, ZoneAllocationPolicy >::LookupOrInsert
Entry * LookupOrInsert(const Address &key, uint32_t hash)
Definition
hashmap.h:223
v8::base::TemplateHashMapImpl< Address, ObjectData *, AddressMatcher, ZoneAllocationPolicy >::Remove
ObjectData * Remove(const Address &key, uint32_t hash)
Definition
hashmap.h:265
v8::base::TemplateHashMapImpl< Address, ObjectData *, AddressMatcher, ZoneAllocationPolicy >::Lookup
Entry * Lookup(const Address &key, uint32_t hash) const
Definition
hashmap.h:214
v8::internal::ZoneAllocationPolicy
Definition
zone.h:354
v8::internal::Zone
Definition
zone.h:43
v8::internal::compiler::AddressMatcher
Definition
refs-map.h:17
v8::internal::compiler::ObjectData
Definition
heap-refs.cc:76
v8::internal::compiler::RefsMap
Definition
refs-map.h:34
v8::internal::compiler::RefsMap::RefsMap
RefsMap(uint32_t capacity, AddressMatcher match, Zone *zone)
Definition
refs-map.cc:15
v8::internal::compiler::RefsMap::Remove
ObjectData * Remove(const Address &key)
Definition
refs-map.cc:30
v8::internal::compiler::RefsMap::Hash
static uint32_t Hash(Address addr)
Definition
refs-map.cc:34
v8::internal::compiler::RefsMap::Lookup
Entry * Lookup(const Address &key) const
Definition
refs-map.cc:21
v8::internal::compiler::RefsMap::LookupOrInsert
Entry * LookupOrInsert(const Address &key)
Definition
refs-map.cc:25
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8::internal::key
int32_t key
Definition
external-reference.cc:1415
v8::internal::Address
Address
Definition
api-callbacks-inl.h:36
v8
Definition
api-arguments-inl.h:19
refs-map.h
v8::base::TemplateHashMapEntry
Definition
hashmap-entry.h:25
src
compiler
refs-map.cc
Generated on Sun Apr 6 2025 21:08:52 for v8 by
1.12.0