|
| 1 | +From 116d78a457473837092190b2a9187b660813258d Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= <mic.besace@gmail.com> |
| 3 | +Date: Tue, 20 Jun 2017 13:14:38 +0200 |
| 4 | +Subject: [PATCH 5/5] Fix GCC 7 build errors |
| 5 | + |
| 6 | +BUG=chromium:691681 |
| 7 | +R=franzih@chromium.org |
| 8 | + |
| 9 | +Change-Id: Id7e5698487f16dc217a804f6d3f24da7213c72b9 |
| 10 | +Reviewed-on: https://chromium-review.googlesource.com/530227 |
| 11 | +Commit-Queue: Toon Verwaest <verwaest@chromium.org> |
| 12 | +Reviewed-by: Toon Verwaest <verwaest@chromium.org> |
| 13 | +Cr-Commit-Position: refs/heads/master@{#46045} |
| 14 | +--- |
| 15 | + BUILD.gn | 1 + |
| 16 | + src/objects-body-descriptors.h | 2 +- |
| 17 | + src/objects-inl.h | 2 ++ |
| 18 | + src/objects/hash-table-inl.h | 34 ++++++++++++++++++++++++++++++++++ |
| 19 | + src/objects/hash-table.h | 20 ++++---------------- |
| 20 | + src/v8.gyp | 1 + |
| 21 | + 6 files changed, 43 insertions(+), 17 deletions(-) |
| 22 | + create mode 100644 src/objects/hash-table-inl.h |
| 23 | + |
| 24 | +diff --git a/BUILD.gn b/BUILD.gn |
| 25 | +index 80ff7340b1..becf4177c1 100644 |
| 26 | +--- a/BUILD.gn |
| 27 | ++++ b/BUILD.gn |
| 28 | +@@ -1717,6 +1717,7 @@ v8_source_set("v8_base") { |
| 29 | + "src/objects/dictionary.h", |
| 30 | + "src/objects/frame-array-inl.h", |
| 31 | + "src/objects/frame-array.h", |
| 32 | ++ "src/objects/hash-table-inl.h", |
| 33 | + "src/objects/hash-table.h", |
| 34 | + "src/objects/literal-objects.cc", |
| 35 | + "src/objects/literal-objects.h", |
| 36 | +diff --git a/src/objects-body-descriptors.h b/src/objects-body-descriptors.h |
| 37 | +index 9f080eb755..b201c20fbb 100644 |
| 38 | +--- a/src/objects-body-descriptors.h |
| 39 | ++++ b/src/objects-body-descriptors.h |
| 40 | +@@ -99,7 +99,7 @@ class FixedBodyDescriptor final : public BodyDescriptorBase { |
| 41 | + |
| 42 | + template <typename StaticVisitor> |
| 43 | + static inline void IterateBody(HeapObject* obj, int object_size) { |
| 44 | +- IterateBody(obj); |
| 45 | ++ IterateBody<StaticVisitor>(obj); |
| 46 | + } |
| 47 | + }; |
| 48 | + |
| 49 | +diff --git a/src/objects-inl.h b/src/objects-inl.h |
| 50 | +index 4b819d43f4..07b62cc140 100644 |
| 51 | +--- a/src/objects-inl.h |
| 52 | ++++ b/src/objects-inl.h |
| 53 | +@@ -31,6 +31,8 @@ |
| 54 | + #include "src/lookup-cache-inl.h" |
| 55 | + #include "src/lookup.h" |
| 56 | + #include "src/objects.h" |
| 57 | ++#include "src/objects/hash-table-inl.h" |
| 58 | ++#include "src/objects/hash-table.h" |
| 59 | + #include "src/objects/literal-objects.h" |
| 60 | + #include "src/objects/module-info.h" |
| 61 | + #include "src/objects/regexp-match-info.h" |
| 62 | +diff --git a/src/objects/hash-table-inl.h b/src/objects/hash-table-inl.h |
| 63 | +new file mode 100644 |
| 64 | +index 0000000000..7b2db38495 |
| 65 | +--- /dev/null |
| 66 | ++++ b/src/objects/hash-table-inl.h |
| 67 | +@@ -0,0 +1,34 @@ |
| 68 | ++// Copyright 2017 the V8 project authors. All rights reserved. |
| 69 | ++// Use of this source code is governed by a BSD-style license that can be |
| 70 | ++// found in the LICENSE file. |
| 71 | ++ |
| 72 | ++#ifndef V8_OBJECTS_HASH_TABLE_INL_H_ |
| 73 | ++#define V8_OBJECTS_HASH_TABLE_INL_H_ |
| 74 | ++ |
| 75 | ++#include "src/objects/hash-table.h" |
| 76 | ++ |
| 77 | ++namespace v8 { |
| 78 | ++namespace internal { |
| 79 | ++ |
| 80 | ++template <typename Derived, typename Shape, typename Key> |
| 81 | ++uint32_t HashTable<Derived, Shape, Key>::Hash(Key key) { |
| 82 | ++ if (Shape::UsesSeed) { |
| 83 | ++ return Shape::SeededHash(key, GetHeap()->HashSeed()); |
| 84 | ++ } else { |
| 85 | ++ return Shape::Hash(key); |
| 86 | ++ } |
| 87 | ++} |
| 88 | ++ |
| 89 | ++template <typename Derived, typename Shape, typename Key> |
| 90 | ++uint32_t HashTable<Derived, Shape, Key>::HashForObject(Key key, Object* object) { |
| 91 | ++ if (Shape::UsesSeed) { |
| 92 | ++ return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object); |
| 93 | ++ } else { |
| 94 | ++ return Shape::HashForObject(key, object); |
| 95 | ++ } |
| 96 | ++} |
| 97 | ++ |
| 98 | ++} // namespace internal |
| 99 | ++} // namespace v8 |
| 100 | ++ |
| 101 | ++#endif // V8_OBJECTS_HASH_TABLE_INL_H_ |
| 102 | +diff --git a/src/objects/hash-table.h b/src/objects/hash-table.h |
| 103 | +index 221598b711..3a351e3e16 100644 |
| 104 | +--- a/src/objects/hash-table.h |
| 105 | ++++ b/src/objects/hash-table.h |
| 106 | +@@ -135,22 +135,10 @@ class HashTable : public HashTableBase { |
| 107 | + public: |
| 108 | + typedef Shape ShapeT; |
| 109 | + |
| 110 | +- // Wrapper methods |
| 111 | +- inline uint32_t Hash(Key key) { |
| 112 | +- if (Shape::UsesSeed) { |
| 113 | +- return Shape::SeededHash(key, GetHeap()->HashSeed()); |
| 114 | +- } else { |
| 115 | +- return Shape::Hash(key); |
| 116 | +- } |
| 117 | +- } |
| 118 | +- |
| 119 | +- inline uint32_t HashForObject(Key key, Object* object) { |
| 120 | +- if (Shape::UsesSeed) { |
| 121 | +- return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object); |
| 122 | +- } else { |
| 123 | +- return Shape::HashForObject(key, object); |
| 124 | +- } |
| 125 | +- } |
| 126 | ++ // Wrapper methods. Defined in src/objects/hash-table-inl.h |
| 127 | ++ // to break a cycle with src/heap/heap.h. |
| 128 | ++ inline uint32_t Hash(Key key); |
| 129 | ++ inline uint32_t HashForObject(Key key, Object* object); |
| 130 | + |
| 131 | + // Returns a new HashTable object. |
| 132 | + MUST_USE_RESULT static Handle<Derived> New( |
| 133 | +diff --git a/src/v8.gyp b/src/v8.gyp |
| 134 | +index 1f94a0680a..a8efcdcf3f 100644 |
| 135 | +--- a/src/v8.gyp |
| 136 | ++++ b/src/v8.gyp |
| 137 | +@@ -1118,6 +1118,7 @@ |
| 138 | + 'objects/dictionary.h', |
| 139 | + 'objects/frame-array.h', |
| 140 | + 'objects/frame-array-inl.h', |
| 141 | ++ 'objects/hash-table-inl.h', |
| 142 | + 'objects/hash-table.h', |
| 143 | + 'objects/literal-objects.cc', |
| 144 | + 'objects/literal-objects.h', |
| 145 | +-- |
| 146 | +2.13.3 |
| 147 | + |
0 commit comments