Skip to content

Commit 11c7e01

Browse files
Zuzana Svetlikovagibfahn
Zuzana Svetlikova
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 Backport-PR-URL: #13574 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 04fb72f commit 11c7e01

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
@@ -36,6 +36,27 @@
3636
namespace v8 {
3737
namespace internal {
3838

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

deps/v8/src/objects.h

+4-16
Original file line numberDiff line numberDiff line change
@@ -3261,22 +3261,10 @@ class HashTableBase : public FixedArray {
32613261
template <typename Derived, typename Shape, typename Key>
32623262
class HashTable : public HashTableBase {
32633263
public:
3264-
// Wrapper methods
3265-
inline uint32_t Hash(Key key) {
3266-
if (Shape::UsesSeed) {
3267-
return Shape::SeededHash(key, GetHeap()->HashSeed());
3268-
} else {
3269-
return Shape::Hash(key);
3270-
}
3271-
}
3272-
3273-
inline uint32_t HashForObject(Key key, Object* object) {
3274-
if (Shape::UsesSeed) {
3275-
return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
3276-
} else {
3277-
return Shape::HashForObject(key, object);
3278-
}
3279-
}
3264+
// Wrapper methods. Defined in src/objects-inl.h
3265+
// to break a cycle with src/heap/heap.h.
3266+
inline uint32_t Hash(Key key);
3267+
inline uint32_t HashForObject(Key key, Object* object);
32803268

32813269
// Returns a new HashTable object.
32823270
MUST_USE_RESULT static Handle<Derived> New(

0 commit comments

Comments
 (0)