• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 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/objects/hash-table-inl.h"
6 
7 namespace v8 {
8 namespace internal {
9 
SlowReverseLookup(Object value)10 Object RegisteredSymbolTable::SlowReverseLookup(Object value) {
11   ReadOnlyRoots roots = this->GetReadOnlyRoots();
12   for (InternalIndex i : this->IterateEntries()) {
13     Object k;
14     if (!this->ToKey(roots, i, &k)) continue;
15     Object e = this->ValueAt(i);
16     if (e == value) return k;
17   }
18   return roots.undefined_value();
19 }
20 
21 }  // namespace internal
22 }  // namespace v8
23