[Webkit-unassigned] [Bug 161847] New: FastBitVector should have efficient and easy-to-use vector-vector operations

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Sep 11 10:45:55 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=161847

            Bug ID: 161847
           Summary: FastBitVector should have efficient and easy-to-use
                    vector-vector operations
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: fpizlo at apple.com

Given this:

FastBitVector a;
FastBitVector b;
FastBitVector c;

I want to be able to say things like:

Set a to some weird combination of the others, with the implementation being a single loop and no copying:
a = ((~a) & b) + c;

Express merge, filter, and exclude using operators, to be consistent:
a &= ~c;

Rapidly iterate over some combination of vectors.
(a & ~(b | c)).forEachSetBit([&] (size_t index) { ... });

We can make this work by having operator&, operator|, and operator~ return a view of the input bitvectors, which supports all immutable FastBitVector operations and combines the uint32_t* words array on-the-fly.  For example, if you do:

auto merge = a | b;

Then 'merge' will have an internal FastBitVector type that supports all const FastBitVector ops. While a FastBitVector points to a uint32_t* m_words and accesses that words array directly on each bit access, the 'merge' vector uses a FastBitVectorOWords adapter that, when asked for a word at an index, will or together the words at that index in a and b.  Template magic makes this invisible and free.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160911/5a9b900a/attachment.html>


More information about the webkit-unassigned mailing list