v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
common-node-cache.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_COMMON_NODE_CACHE_H_
6#define V8_COMPILER_COMMON_NODE_CACHE_H_
7
9
10namespace v8 {
11namespace internal {
12namespace compiler {
13
14// Bundles various caches for common nodes.
15class CommonNodeCache final {
16 public:
29 ~CommonNodeCache() = default;
30
33
34 Node** FindInt32Constant(int32_t value) {
35 return int32_constants_.Find(value);
36 }
37
38 Node** FindInt64Constant(int64_t value) {
39 return int64_constants_.Find(value);
40 }
41
42 Node** FindTaggedIndexConstant(int32_t value) {
43 return tagged_index_constants_.Find(value);
44 }
45
46 Node** FindFloat32Constant(float value) {
47 // We canonicalize float constants at the bit representation level.
49 }
50
51 Node** FindFloat64Constant(double value) {
52 // We canonicalize double constants at the bit representation level.
54 }
55
57
58 Node** FindPointerConstant(intptr_t value) {
59 return pointer_constants_.Find(value);
60 }
61
62 Node** FindNumberConstant(double value) {
63 // We canonicalize double constants at the bit representation level.
65 }
66
68
70 return relocatable_int32_constants_.Find(std::make_pair(value, rmode));
71 }
72
74 return relocatable_int64_constants_.Find(std::make_pair(value, rmode));
75 }
76
77 // Return all nodes from the cache.
79
80 private:
92};
93
94} // namespace compiler
95} // namespace internal
96} // namespace v8
97
98#endif // V8_COMPILER_COMMON_NODE_CACHE_H_
void GetCachedNodes(ZoneVector< Node * > *nodes)
Node ** FindRelocatableInt32Constant(int32_t value, RelocInfoMode rmode)
Node ** FindExternalConstant(ExternalReference value)
Node ** FindRelocatableInt64Constant(int64_t value, RelocInfoMode rmode)
CommonNodeCache & operator=(const CommonNodeCache &)=delete
CommonNodeCache(const CommonNodeCache &)=delete
Node ** FindHeapConstant(Handle< HeapObject > value)
V8_INLINE Dest bit_cast(Source const &source)
Definition macros.h:95
NodeCache< RelocInt64Key > RelocInt64NodeCache
Definition node-cache.h:67
NodeCache< int64_t > Int64NodeCache
Definition node-cache.h:59
Int64NodeCache IntPtrNodeCache
Definition node-cache.h:71
NodeCache< int32_t > Int32NodeCache
Definition node-cache.h:58
NodeCache< RelocInt32Key > RelocInt32NodeCache
Definition node-cache.h:66