Commit f1644a4b authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

Revert "[dict-proto] C++ implementation of SwissNameDictionary, pt. 10"

This reverts commit 8e6047e5.

Reason for revert: Tests time out on TSan: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN/36003/overview

Original change's description:
> [dict-proto] C++ implementation of SwissNameDictionary, pt. 10
>
> This CL is part of a series that adds the C++ implementation of
> SwissNameDictionary, a deterministic property backing store based on
> Swiss Tables.
>
> This CL adds the actual tests for SwissNameDictionary, defined in
> test-swiss-name-dictionary-shared-tests.h, using the infrastructure
> in test-swiss-name-dictionary-infra.[h|cc].
>
> Bug: v8:11388
> Change-Id: I5d91cede4f74b85a4101c5f2de3deda01a72edb2
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2744138
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Commit-Queue: Frank Emrich <emrich@google.com>
> Cr-Commit-Position: refs/heads/master@{#73572}

Bug: v8:11388
Change-Id: I5d11e9f847545fe2b9c561ca8441eecb204bcfa1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2779032
Auto-Submit: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#73575}
parent ef808d3b
......@@ -89,19 +89,6 @@ class JSHeapBroker;
static void Test##Name()
#endif
// Similar to TEST, but used when test definitions appear as members of a
// (probably parameterized) class. This allows re-using the given tests multiple
// times. For this to work, the following conditions must hold:
// 1. The class has a template parameter named kTestFileName of type char
// const*, which is instantiated with __FILE__ at the *use site*, in order
// to correctly associate the tests with the test suite using them.
// 2. To actually execute the tests, create an instance of the class
// containing the MEMBER_TESTs.
#define MEMBER_TEST(Name) \
CcTest register_test_##Name = \
CcTest(Test##Name, kTestFileName, #Name, true, true); \
static void Test##Name()
#define EXTENSION_LIST(V) \
V(GC_EXTENSION, "v8/gc") \
V(PRINT_EXTENSION, "v8/print") \
......
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "test/cctest/test-swiss-name-dictionary-infra.h"
#include "test/cctest/test-swiss-name-dictionary-shared-tests.h"
namespace v8 {
namespace internal {
......@@ -313,13 +312,6 @@ void CSATestRunner::CheckAgainstReference() {
CHECK(table->EqualsForTesting(*reference_));
}
// Executes the tests defined in test-swiss-name-dictionary-shared-tests.h as if
// they were defined in this file, using the CSATestRunner. See comments in
// test-swiss-name-dictionary-shared-tests.h and in
// swiss-name-dictionary-infra.h for details.
const char kCSATestFileName[] = __FILE__;
SharedSwissTableTests<CSATestRunner, kCSATestFileName> execute_shared_tests_csa;
} // namespace test_swiss_hash_table
} // namespace internal
} // namespace v8
......@@ -76,13 +76,6 @@ Handle<Name> CreateKeyWithHash(Isolate* isolate, KeyCache& keys,
int fake_hash = actual_hash;
if (key.h1_override) {
uint32_t override_with = key.h1_override.value().value;
// We cannot override h1 with 0 unless we also override h2 with a
// non-zero value. Otherwise, the overall hash may become 0 (which is
// forbidden) based on the (nondeterminstic) choice of h2.
CHECK_IMPLIES(override_with == 0,
key.h2_override && key.h2_override.value().value != 0);
fake_hash = (override_with << swiss_table::kH2Bits) |
swiss_table::H2(actual_hash);
}
......@@ -90,14 +83,8 @@ Handle<Name> CreateKeyWithHash(Isolate* isolate, KeyCache& keys,
// Unset 7 bits belonging to H2:
fake_hash &= ~((1 << swiss_table::kH2Bits) - 1);
uint8_t override_with = key.h2_override.value().value;
// Same as above, but for h2: Prevent accidentally creating 0 fake hash.
CHECK_IMPLIES(override_with == 0,
key.h1_override && key.h1_override.value().value != 0);
CHECK_LT(key.h2_override.value().value, 1 << swiss_table::kH2Bits);
fake_hash |= swiss_table::H2(override_with);
DCHECK_LT(key.h2_override.value().value, 1 << swiss_table::kH2Bits);
fake_hash |= swiss_table::H2(key.h2_override.value().value);
}
// Ensure that just doing a shift below is correct.
......@@ -109,10 +96,9 @@ Handle<Name> CreateKeyWithHash(Isolate* isolate, KeyCache& keys,
// Prepare what to put into the hash field.
uint32_t hash_field = fake_hash << Name::kHashShift;
CHECK_NE(hash_field, 0);
key_symbol->set_raw_hash_field(hash_field);
CHECK_EQ(fake_hash, key_symbol->hash());
DCHECK_EQ(fake_hash, key_symbol->hash());
}
return key_symbol;
......@@ -124,8 +110,8 @@ Handle<Name> CreateKeyWithHash(Isolate* isolate, KeyCache& keys,
// else w.r.t. hash faking when using this key before. If so, the test case
// would make inconsistent assumptions about how the hashes should be faked
// and be broken.
CHECK_EQ(cached_info.h1_override, key.h1_override);
CHECK_EQ(cached_info.h2_override, key.h2_override);
DCHECK_EQ(cached_info.h1_override, key.h1_override);
DCHECK_EQ(cached_info.h2_override, key.h2_override);
return cached_info.key_symbol;
}
......
......@@ -28,7 +28,7 @@ using IndexOpt = base::Optional<InternalIndex>;
static const ValueOpt kNoValue;
static const PropertyDetailsOpt kNoDetails;
static const base::Optional<int> kNoInt;
static const IndexOpt kIndexUnknown;
static const IndexOpt kNoIndex;
static const std::vector<int> interesting_initial_capacities = {
4,
......
This diff is collapsed.
......@@ -5,7 +5,6 @@
#include "src/objects/swiss-name-dictionary-inl.h"
#include "test/cctest/cctest.h"
#include "test/cctest/test-swiss-name-dictionary-infra.h"
#include "test/cctest/test-swiss-name-dictionary-shared-tests.h"
namespace v8 {
namespace internal {
......@@ -214,14 +213,6 @@ TEST(SizeFor) {
CHECK_EQ(SwissNameDictionary::SizeFor(8), size_8);
}
// Executes the tests defined in test-swiss-name-dictionary-shared-tests.h as if
// they were defined in this file, using the RuntimeTestRunner. See comments in
// test-swiss-name-dictionary-shared-tests.h and in
// swiss-name-dictionary-infra.h for details.
const char kRuntimeTestFileName[] = __FILE__;
SharedSwissTableTests<RuntimeTestRunner, kRuntimeTestFileName>
execute_shared_tests_runtime;
} // namespace test_swiss_hash_table
} // namespace internal
} // namespace v8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment