File tree Expand file tree Collapse file tree 6 files changed +42
-17
lines changed
Expand file tree Collapse file tree 6 files changed +42
-17
lines changed Original file line number Diff line number Diff line change @@ -1782,6 +1782,7 @@ v8_source_set("v8_base") {
17821782 " src/objects/dictionary.h" ,
17831783 " src/objects/frame-array-inl.h" ,
17841784 " src/objects/frame-array.h" ,
1785+ " src/objects/hash-table-inl.h" ,
17851786 " src/objects/hash-table.h" ,
17861787 " src/objects/intl-objects.cc" ,
17871788 " src/objects/intl-objects.h" ,
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class FixedBodyDescriptor final : public BodyDescriptorBase {
9999
100100 template <typename StaticVisitor>
101101 static inline void IterateBody (HeapObject* obj, int object_size) {
102- IterateBody (obj);
102+ IterateBody<StaticVisitor> (obj);
103103 }
104104
105105 static inline int SizeOf (Map* map, HeapObject* object) { return kSize ; }
Original file line number Diff line number Diff line change 3232#include " src/lookup.h"
3333#include " src/objects.h"
3434#include " src/objects/arguments-inl.h"
35+ #include " src/objects/hash-table-inl.h"
3536#include " src/objects/hash-table.h"
3637#include " src/objects/literal-objects.h"
3738#include " src/objects/module-info.h"
Original file line number Diff line number Diff line change 1+ // Copyright 2017 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_HASH_TABLE_INL_H_
6+ #define V8_OBJECTS_HASH_TABLE_INL_H_
7+
8+ #include " src/objects/hash-table.h"
9+
10+ namespace v8 {
11+ namespace internal {
12+
13+ template <typename Derived, typename Shape>
14+ uint32_t HashTable<Derived, Shape>::Hash(Key key) {
15+ if (Shape::UsesSeed) {
16+ return Shape::SeededHash (key, GetHeap ()->HashSeed ());
17+ } else {
18+ return Shape::Hash (key);
19+ }
20+ }
21+
22+ template <typename Derived, typename Shape>
23+ uint32_t HashTable<Derived, Shape>::HashForObject(Object* object) {
24+ if (Shape::UsesSeed) {
25+ return Shape::SeededHashForObject (GetHeap ()->HashSeed (), object);
26+ } else {
27+ return Shape::HashForObject (object);
28+ }
29+ }
30+
31+ } // namespace internal
32+ } // namespace v8
33+
34+ #endif // V8_OBJECTS_HASH_TABLE_INL_H_
Original file line number Diff line number Diff line change @@ -144,22 +144,10 @@ class HashTable : public HashTableBase {
144144 typedef Shape ShapeT;
145145 typedef typename Shape::Key Key;
146146
147- // Wrapper methods
148- inline uint32_t Hash (Key key) {
149- if (Shape::UsesSeed) {
150- return Shape::SeededHash (key, GetHeap ()->HashSeed ());
151- } else {
152- return Shape::Hash (key);
153- }
154- }
155-
156- inline uint32_t HashForObject (Object* object) {
157- if (Shape::UsesSeed) {
158- return Shape::SeededHashForObject (GetHeap ()->HashSeed (), object);
159- } else {
160- return Shape::HashForObject (object);
161- }
162- }
147+ // Wrapper methods. Defined in src/objects/hash-table-inl.h
148+ // to break a cycle with src/heap/heap.h.
149+ inline uint32_t Hash (Key key);
150+ inline uint32_t HashForObject (Object* object);
163151
164152 // Returns a new HashTable object.
165153 MUST_USE_RESULT static Handle<Derived> New (
Original file line number Diff line number Diff line change 12371237 'objects/dictionary.h' ,
12381238 'objects/frame-array.h' ,
12391239 'objects/frame-array-inl.h' ,
1240+ 'objects/hash-table-inl.h' ,
12401241 'objects/hash-table.h' ,
12411242 'objects/intl-objects.cc' ,
12421243 'objects/intl-objects.h' ,
You can’t perform that action at this time.
0 commit comments