Skip to content

Commit c0f1ff2

Browse files
targosCommit Bot
authored andcommitted
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}
1 parent e9d728d commit c0f1ff2

File tree

6 files changed

+42
-17
lines changed

6 files changed

+42
-17
lines changed

BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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",

src/objects-body-descriptors.h

Lines changed: 1 addition & 1 deletion
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
static inline int SizeOf(Map* map, HeapObject* object) { return kSize; }

src/objects-inl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
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"

src/objects/hash-table-inl.h

Lines changed: 34 additions & 0 deletions
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>
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_

src/objects/hash-table.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff 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(

src/v8.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,7 @@
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',

0 commit comments

Comments
 (0)