[Webkit-unassigned] [Bug 177031] Figure out how WSL will support field overloads like float4.xz and friends

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 15 22:23:37 PDT 2017


--- Comment #1 from Filip Pizlo <fpizlo at apple.com> ---
Here are some notes I took while pondering this.  I think I have an algorithm now.


array[index] += foo();

1. ptr = &array[index];
2. load from ptr
3. foo()
4. store to ptr

native struct Foo;
native struct Bar;
native struct Baz;

Bar operator.bar(Foo);
Foo operator.bar=(Foo, Bar);

thread Baz^ operator&.baz(thread Foo^);

Foo foo;

RMW(foo.bar, anonVar<0>, anonVar<1>, newValueExp(anonVar<0>), anonVar<1>)
=> RMW(foo, anonVar<2>, anonVar<3>,
       (anonVar<0>, anonVar<1>,
        anonVar<0> = operator.bar(anonVar<2>),
        anonVar<1> = newValueExp(anonVar<0>),
        operator.bar=(anonVar<2>, anonVar<1>)),

RMW(foo.baz, anonVar<0>, anonVar<1>, newValueExp(anonVar<0>), anonVar<1>)
=> (anonVar<0>, anonVar<1>, anonVar<2>,
    anonVar<2> = &foo.baz,
    anonVar<0> = ^anonVar<2>,
    anonVar<1> = newValueExp(anonVar<0>),
    ^anonVar<2> = anonVar<1>)

native struct Thingy;

Thingy operator.thingy(Bar);
Bar operator.thingy=(Bar, Thingy);

RMW(foo.bar.thingy, anonVar<0>, anonVar<1>, newValueExp(anonVar<0>), anonVar<1>)
=> RMW(foo.bar, anonVar<2>, anonVar<3>,
       (anonVar<0>, anonVar<1>,
        anonVar<0> = operator.thingy(anonVar<2>),
        anonVar<1> = newValueExp(anonVar<0>),
        operator.thingy=(anonVar<2>, anonVar<1>)),
=> RMW(foo, anonVar<4>, anonVar<5>,
       (anonVar<2>, anonVar<3>,
        anonVar<2> = operator.bar(anonVar<4>),
        anonVar<3> = (anonVar<0>, anonVar<1>,
                     anonVar<0> = operator.thingy(anonVar<2>),
                     anonVar<1> = newValueExp(anonVar<0>),
                     operator.thingy=(anonVar<2>, anonVar<1>)),
        operator.bar=(anonVar<4>, anonVar<3>)),

foo.bar = thingy
=> RMW(foo, anonVar<0>, anonVar<1>,
        anonVar<2> = thingy,
        operator.bar=(anonVar<0>, anonVar<2>)),

foo.baz = thingy
=> ^operator&.baz(&foo) = thingy

=> operator.bar(foo)

=> ^operator&.bar(&foo)

=> operator.bar(foo).thingy
=> operator.thingy(operator.bar(foo))

=> ^operator&.baz(&foo)
=> ^operator&.stuff(operator&.baz(&foo))


1. figure out what the load conversion would do
2. if it yields a Dereference, then use the pointer deconstruction
3. otherwise use the normal deconstruction

It's not clear if this deconstruction should happen in Checker or later.  Might be easier if it happens later. That would require factoring visitCallExpression out.  That shouldn't be hard.

First the checker would do its thing pretending that DotExpression and IndexExpression are just valid lvalues. Then a subsequent pass will convert those into calls or other things depending on context.

This would mean that the only places that have to know the & and @ tricks that CallExpression currently does are the places that handle the load case. We'll need both IndexExpression and DotExpression to know how to do it.

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

More information about the webkit-unassigned mailing list