New issue
Advanced search Search tips

Issue 715430 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Feature

Blocking:
issue 737522



Sign in to add a comment

WTF::HashTable v2

Project Member Reported by yutak@chromium.org, Apr 26 2017

Issue description

Currently, WTF::HashTable is waaaaay too complex. That causes several
problems:

* It's not very obvious how to write custom hash traits or hash
  functions.
* There are two kinds of hash traits: HashTraits and hash functions
  (DefaultHash and the like).
* HashTraits itself is very complex and nobody really knows which
  trait does what. Each trait controls rather random aspects, and
  the criteria for a "complete" HashTraits is not very obvious.
* It has 7 template parameters; that's too many and we can probably
  reduce them to 4: Key, Value, (New)HashTableTraits, Allocator, putting
  all the traits information in HashTableTraits.

We need to create a set of well-defined, easy-to-customize hash table
traits, and clean up existing implementation.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d9e025eb1e744fb28cf8354d8ac42c572215183c

commit d9e025eb1e744fb28cf8354d8ac42c572215183c
Author: yutak <yutak@chromium.org>
Date: Fri Apr 28 06:56:47 2017

WTF::HashTraits: Remove unnecessary Peek() functions.

Peek() always takes a reference to an existing slot in a table. Therefore,
Peek() does not take a nullptr_t value, since nullptr_t is not stored in
the backing buffer.

BUG=715430
R=tzik@chromium.org

Review-Url: https://codereview.chromium.org/2844583004
Cr-Commit-Position: refs/heads/master@{#467920}

[modify] https://crrev.com/d9e025eb1e744fb28cf8354d8ac42c572215183c/third_party/WebKit/Source/platform/wtf/HashTraits.h

Comment 2 by yutak@chromium.org, Aug 29 2017

Labels: -Type-Bug -Pri-3 Pri-1 Type-Feature
Owner: yutak@chromium.org
Status: Started (was: Available)
Summary: WTF::HashTable v2 (was: Refactor WTF::HashTable)
Design doc:
https://docs.google.com/document/d/1-N-vUWg790wJc1CHCC4C_v-HtQNg9n9w5Y_6KtaKFlU/edit?usp=sharing
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8a7beb2d32b280e05602449bfc5e4123ae5d8c58

commit 8a7beb2d32b280e05602449bfc5e4123ae5d8c58
Author: Yuta Kitamura <yutak@chromium.org>
Date: Wed Aug 30 09:07:07 2017

WTF experimental: Add README.md.

This directory will contain work-in-progress implementation of HashTable v2.

For HashTable v2, see the design doc below:
    https://docs.google.com/document/d/1-N-vUWg790wJc1CHCC4C_v-HtQNg9n9w5Y_6KtaKFlU/edit?usp=sharing

Bug: 715430
Change-Id: I9be0554fcbae162b87e35ba2fe98c19282c4f29f
Reviewed-on: https://chromium-review.googlesource.com/641072
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498406}
[add] https://crrev.com/8a7beb2d32b280e05602449bfc5e4123ae5d8c58/third_party/WebKit/Source/platform/wtf/experimental/README.md

Project Member

Comment 4 by bugdroid1@chromium.org, Sep 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/34aae082912351a13973d87e34c4698f5d72901a

commit 34aae082912351a13973d87e34c4698f5d72901a
Author: Yuta Kitamura <yutak@chromium.org>
Date: Wed Sep 13 09:58:13 2017

WTF HashTable v2: Add ContainerTypeOperations.

ContainerTypeOperations is a class template representing type traits for
various generic container operations, such as storage initialization or
bulk copy. This can be used, for instance, to use memcpy for efficient
copying for specific types. This will be used in HashTable v2 (see bug).

The set of operations are mostly inspired by Vector's traits. This traits
is intended to become the unified traits that can be applied to any WTF
containers (currently, Vector and HashTable have separate sets of traits).

This patch only provides a basic implementation that should work for any
types. Specializations for other types will be added later.

Bug: 715430
Change-Id: Ie1fb852942e4f6210eef26cad7606833c5d1949f
Reviewed-on: https://chromium-review.googlesource.com/641290
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501580}
[modify] https://crrev.com/34aae082912351a13973d87e34c4698f5d72901a/third_party/WebKit/Source/platform/wtf/BUILD.gn
[add] https://crrev.com/34aae082912351a13973d87e34c4698f5d72901a/third_party/WebKit/Source/platform/wtf/experimental/ContainerTypeOperations.h
[add] https://crrev.com/34aae082912351a13973d87e34c4698f5d72901a/third_party/WebKit/Source/platform/wtf/experimental/ContainerTypeOperationsTest.cpp

Comment 5 by peria@chromium.org, Sep 18 2017

Blocking: 737522
Project Member

Comment 6 by bugdroid1@chromium.org, Sep 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/02bc3fe3d15fbb897cd251310199d38814130ab0

commit 02bc3fe3d15fbb897cd251310199d38814130ab0
Author: Yuta Kitamura <yutak@chromium.org>
Date: Tue Sep 26 11:00:34 2017

HashTable v2: Add CompleteContainerTypeOperations<TypeOps, T>.

This patch separates the ability to supplement missing traits functions from
Complete*d*ContainerTypeOperations<T>. It turns out the upcoming changes
will require the ability to complete arbitrary ContainerTypeOperations
implementations, not just ContainerTypeOperations<T>.

BUG=715430

Change-Id: I49828fd8e8f68ff97eb5f5117e6bdf0351ddcc9b
Reviewed-on: https://chromium-review.googlesource.com/681534
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504332}
[modify] https://crrev.com/02bc3fe3d15fbb897cd251310199d38814130ab0/third_party/WebKit/Source/platform/wtf/experimental/ContainerTypeOperations.h

Sign in to add a comment