v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
lookup-cache-inl.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_INL_H_
6#define V8_OBJECTS_LOOKUP_CACHE_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
11#include "src/objects/map.h"
13
14namespace v8 {
15namespace internal {
16
17// static
19 DCHECK(IsUniqueName(name));
20 // Uses only lower 32 bits if pointers are larger.
21 uint32_t source_hash = static_cast<uint32_t>(source.ptr()) >> kTaggedSizeLog2;
22 uint32_t name_hash = name->hash();
23 return (source_hash ^ name_hash) % kLength;
24}
25
27 int index = Hash(source, name);
28 Key& key = keys_[index];
29 // Pointers in the table might be stale, so use SafeEquals.
30 if (key.source.SafeEquals(source) && key.name.SafeEquals(name)) {
31 return results_[index];
32 }
33 return kAbsent;
34}
35
37 int result) {
39 int index = Hash(source, name);
40 Key& key = keys_[index];
42 key.name = name;
44}
45
46} // namespace internal
47} // namespace v8
48
49#endif // V8_OBJECTS_LOOKUP_CACHE_INL_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)
ZoneVector< RpoNumber > & result
InstructionOperand source
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
Definition flags.cc:2086
constexpr int kTaggedSizeLog2
Definition globals.h:543
bool IsUniqueName(Tagged< Name > obj)
#define DCHECK_NE(v1, v2)
Definition logging.h:486
#define DCHECK(condition)
Definition logging.h:482