v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
lookup-cache.h
Go to the documentation of this file.
1// Copyright 2016 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_OBJECTS_LOOKUP_CACHE_H_
6#define V8_OBJECTS_LOOKUP_CACHE_H_
7
8#include "src/objects/map.h"
9#include "src/objects/name.h"
10#include "src/objects/objects.h"
11
12namespace v8 {
13namespace internal {
14
15// Cache for mapping (map, property name) into descriptor index.
16// The cache contains both positive and negative results.
17// Descriptor index equals kNotFound means the property is absent.
18// Cleared at startup and prior to any gc.
20 public:
23 // Lookup descriptor index for (map, name).
24 // If absent, kAbsent is returned.
25 inline int Lookup(Tagged<Map> source, Tagged<Name> name);
26
27 // Update an element in the cache.
28 inline void Update(Tagged<Map> source, Tagged<Name> name, int result);
29
30 // Clear the cache.
31 void Clear();
32
33 static const int kAbsent = -2;
34
35 private:
37 for (int i = 0; i < kLength; ++i) {
41 }
42 }
43
44 static inline int Hash(Tagged<Map> source, Tagged<Name> name);
45
46 static const int kLength = 64;
51
54
55 friend class Isolate;
56};
57
58} // namespace internal
59} // namespace v8
60
61#endif // V8_OBJECTS_LOOKUP_CACHE_H_
void Update(Tagged< Map > source, Tagged< Name > name, int result)
static int Hash(Tagged< Map > source, Tagged< Name > name)
int Lookup(Tagged< Map > source, Tagged< Name > name)
DescriptorLookupCache(const DescriptorLookupCache &)=delete
DescriptorLookupCache & operator=(const DescriptorLookupCache &)=delete
ZoneVector< RpoNumber > & result
Tagged(T object) -> Tagged< T >