Skip to content

Commit 25b851b

Browse files
bnoordhuisevanlucas
authored andcommitted
v8: fix build errors with g++ 7
This is a local patch because upstream fixed it differently by moving large chunks of code out of objects.h. We cannot easily back-port those changes due to their size and invasiveness. Fixes: #10388 PR-URL: #12392 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e8595c5 commit 25b851b

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

deps/v8/src/objects-body-descriptors.h

+1-1
Original file line numberDiff line numberDiff 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

deps/v8/src/objects-inl.h

+21
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@
3939
namespace v8 {
4040
namespace internal {
4141

42+
template <typename Derived, typename Shape, typename Key>
43+
uint32_t HashTable<Derived, Shape, Key>::Hash(Key key) {
44+
if (Shape::UsesSeed) {
45+
return Shape::SeededHash(key, GetHeap()->HashSeed());
46+
} else {
47+
return Shape::Hash(key);
48+
}
49+
}
50+
51+
52+
template <typename Derived, typename Shape, typename Key>
53+
uint32_t HashTable<Derived, Shape, Key>::HashForObject(Key key,
54+
Object* object) {
55+
if (Shape::UsesSeed) {
56+
return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
57+
} else {
58+
return Shape::HashForObject(key, object);
59+
}
60+
}
61+
62+
4263
PropertyDetails::PropertyDetails(Smi* smi) {
4364
value_ = smi->value();
4465
}

deps/v8/src/objects.h

+4-16
Original file line numberDiff line numberDiff line change
@@ -3352,22 +3352,10 @@ class HashTable : public HashTableBase {
33523352
public:
33533353
typedef Shape ShapeT;
33543354

3355-
// Wrapper methods
3356-
inline uint32_t Hash(Key key) {
3357-
if (Shape::UsesSeed) {
3358-
return Shape::SeededHash(key, GetHeap()->HashSeed());
3359-
} else {
3360-
return Shape::Hash(key);
3361-
}
3362-
}
3363-
3364-
inline uint32_t HashForObject(Key key, Object* object) {
3365-
if (Shape::UsesSeed) {
3366-
return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
3367-
} else {
3368-
return Shape::HashForObject(key, object);
3369-
}
3370-
}
3355+
// Wrapper methods. Defined in src/objects-inl.h
3356+
// to break a cycle with src/heap/heap.h.
3357+
inline uint32_t Hash(Key key);
3358+
inline uint32_t HashForObject(Key key, Object* object);
33713359

33723360
// Returns a new HashTable object.
33733361
MUST_USE_RESULT static Handle<Derived> New(

0 commit comments

Comments
 (0)