[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 04:23:05 PDT 2017


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

--- Comment #2 from Yusuke Suzuki <utatane.tea at gmail.com> ---
(In reply to Yusuke Suzuki from comment #1)
> 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(...);
>     ....
> }

At that time, we need extra carefully construct this defineProperty function to be inlined.

-- 
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/278c5178/attachment.html>


More information about the webkit-unassigned mailing list