chromium/v8/test/cctest/test-swiss-name-dictionary-csa.cc

// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <optional>

#include "src/codegen/code-stub-assembler-inl.h"
#include "src/codegen/cpu-features.h"
#include "src/objects/objects-inl.h"
#include "src/objects/swiss-name-dictionary-inl.h"
#include "test/cctest/compiler/function-tester.h"
#include "test/cctest/test-swiss-name-dictionary-infra.h"
#include "test/cctest/test-swiss-name-dictionary-shared-tests.h"
#include "test/common/code-assembler-tester.h"

namespace v8 {
namespace internal {
namespace test_swiss_hash_table {

#include "src/codegen/define-code-stub-assembler-macros.inc"

// The non-SIMD SwissNameDictionary implementation requires 64 bit integer
// operations, which CSA/Torque don't offer on 32 bit platforms. Therefore, we
// cannot run the CSA version of the tests on 32 bit platforms. The only
// exception is IA32, where we can use SSE and don't need 64 bit integers.
// TODO(v8:11330) The Torque SIMD implementation is not specific to SSE (like
// the C++ one), but works on other platforms. It should be possible to create a
// workaround where on 32 bit, non-IA32 platforms we use the "portable", non-SSE
// implementation on the C++ side (which uses a group size of 8) and create a
// special version of the SIMD Torque implementation that works for group size 8
// instead of 16.
#if V8_TARGET_ARCH_64_BIT || V8_TARGET_ARCH_IA32

// Executes tests by executing CSA/Torque versions of dictionary operations.
// See RuntimeTestRunner for description of public functions.
class CSATestRunner {};

CSATestRunner::CSATestRunner(Isolate* isolate, int initial_capacity,
                             KeyCache& keys)
    :{}

void CSATestRunner::Add(Handle<Name> key, Handle<Object> value,
                        PropertyDetails details) {}

void CSATestRunner::Allocate(Handle<Smi> capacity) {}

InternalIndex CSATestRunner::FindEntry(Handle<Name> key) {}

Handle<FixedArray> CSATestRunner::GetData(InternalIndex entry) {}

void CSATestRunner::CheckCounts(std::optional<int> capacity,
                                std::optional<int> elements,
                                std::optional<int> deleted) {}

void CSATestRunner::CheckEnumerationOrder(
    const std::vector<std::string>& expected_keys) {}

void CSATestRunner::Put(InternalIndex entry, Handle<Object> new_value,
                        PropertyDetails new_details) {}

void CSATestRunner::Delete(InternalIndex entry) {}

void CSATestRunner::RehashInplace() {}

void CSATestRunner::Shrink() {}

void CSATestRunner::CheckCopy() {}

void CSATestRunner::VerifyHeap() {}

void CSATestRunner::PrintTable() {}

Handle<Code> CSATestRunner::create_find_entry(Isolate* isolate) {}

Handle<Code> CSATestRunner::create_get_data(Isolate* isolate) {}

Handle<Code> CSATestRunner::create_put(Isolate* isolate) {}

Handle<Code> CSATestRunner::create_delete(Isolate* isolate) {}

Handle<Code> CSATestRunner::create_add(Isolate* isolate) {}

Handle<Code> CSATestRunner::create_allocate(Isolate* isolate) {}

Handle<Code> CSATestRunner::create_get_counts(Isolate* isolate) {}

Handle<Code> CSATestRunner::create_copy(Isolate* isolate) {}

void CSATestRunner::CheckAgainstReference() {}

// 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[] =;
SharedSwissTableTests<CSATestRunner, kCSATestFileName> execute_shared_tests_csa;

#endif

#include "src/codegen/undef-code-stub-assembler-macros.inc"

}  // namespace test_swiss_hash_table
}  // namespace internal
}  // namespace v8