Skip to content

Commit 0ba74db

Browse files
committed
deps: backport c0f1ff2 from upstream V8
Original commit message: Fix GCC 7 build errors BUG=chromium:691681 [email protected] Change-Id: Id7e5698487f16dc217a804f6d3f24da7213c72b9 Reviewed-on: https://chromium-review.googlesource.com/530227 Commit-Queue: Toon Verwaest <[email protected]> Reviewed-by: Toon Verwaest <[email protected]> Cr-Commit-Position: refs/heads/master@{#46045} PR-URL: #13517 Fixes: #10388 Refs: #12392 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 25b4d87 commit 0ba74db

File tree

6 files changed

+42
-17
lines changed

6 files changed

+42
-17
lines changed

deps/v8/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,7 @@ v8_source_set("v8_base") {
17171717
"src/objects/dictionary.h",
17181718
"src/objects/frame-array-inl.h",
17191719
"src/objects/frame-array.h",
1720+
"src/objects/hash-table-inl.h",
17201721
"src/objects/hash-table.h",
17211722
"src/objects/literal-objects.cc",
17221723
"src/objects/literal-objects.h",

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

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "src/lookup-cache-inl.h"
3232
#include "src/lookup.h"
3333
#include "src/objects.h"
34+
#include "src/objects/hash-table-inl.h"
3435
#include "src/objects/literal-objects.h"
3536
#include "src/objects/module-info.h"
3637
#include "src/objects/regexp-match-info.h"

deps/v8/src/objects/hash-table-inl.h

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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, typename Key>
14+
uint32_t HashTable<Derived, Shape, Key>::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, typename Key>
23+
uint32_t HashTable<Derived, Shape, Key>::HashForObject(Key key, Object* object) {
24+
if (Shape::UsesSeed) {
25+
return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
26+
} else {
27+
return Shape::HashForObject(key, object);
28+
}
29+
}
30+
31+
} // namespace internal
32+
} // namespace v8
33+
34+
#endif // V8_OBJECTS_HASH_TABLE_INL_H_

deps/v8/src/objects/hash-table.h

+4-16
Original file line numberDiff line numberDiff line change
@@ -135,22 +135,10 @@ class HashTable : public HashTableBase {
135135
public:
136136
typedef Shape ShapeT;
137137

138-
// Wrapper methods
139-
inline uint32_t Hash(Key key) {
140-
if (Shape::UsesSeed) {
141-
return Shape::SeededHash(key, GetHeap()->HashSeed());
142-
} else {
143-
return Shape::Hash(key);
144-
}
145-
}
146-
147-
inline uint32_t HashForObject(Key key, Object* object) {
148-
if (Shape::UsesSeed) {
149-
return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
150-
} else {
151-
return Shape::HashForObject(key, object);
152-
}
153-
}
138+
// Wrapper methods. Defined in src/objects/hash-table-inl.h
139+
// to break a cycle with src/heap/heap.h
140+
inline uint32_t Hash(Key key);
141+
inline uint32_t HashForObject(Key key, Object* object);
154142

155143
// Returns a new HashTable object.
156144
MUST_USE_RESULT static Handle<Derived> New(

deps/v8/src/v8.gyp

+1
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@
11181118
'objects/dictionary.h',
11191119
'objects/frame-array.h',
11201120
'objects/frame-array-inl.h',
1121+
'objects/hash-table-inl.h',
11211122
'objects/hash-table.h',
11221123
'objects/literal-objects.cc',
11231124
'objects/literal-objects.h',

0 commit comments

Comments
 (0)