[Webkit-unassigned] [Bug 172888] [JSC] Create a fast path to Object.defineProperty

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jun 3 02:52:02 PDT 2017


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

Yusuke Suzuki <utatane.tea at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fpizlo at apple.com,
                   |                            |sbarati at apple.com,
                   |                            |utatane.tea at gmail.com

--- Comment #1 from Yusuke Suzuki <utatane.tea at gmail.com> ---
The following is the design in my mind

We can find that Object.defineProperty is frequently called in some realistic frameworks such as Ember.js.
Object.defineProperty is typically used in the following form.

Object.defineProperty(object, name, {
    // property descriptor object
});

If we can create Object.defineProperty's prologue in JS, we can encourage Object Allocation Sinking to sink the above property descriptor object.
My design is simple. We already have some bytecodes like op_define_data_property / op_define_accessor_property.
So, let's add bytecode intrinsic for them and wrap them with JS function.

function defineProperty(object, name, descriptor) {
    // Retrieve necessary values.
    var enumerable = descriptor.enumerable;
    ...
    // And call intrinsics.
    if (accessor property)
        @defineAccessorProperty(...);
    else
        @defineDataProperty(...);
    ....
}

-- 
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/20170603/72f8e63a/attachment.html>


More information about the webkit-unassigned mailing list