Changeset 249911 in webkit


Ignore:
Timestamp:
Sep 16, 2019 12:32:39 PM (5 years ago)
Author:
sbarati@apple.com
Message:

JSObject::putInlineSlow should not ignore "proto" for Proxy
https://bugs.webkit.org/show_bug.cgi?id=200386
<rdar://problem/53854946>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/proxy-proto-in-prototype-chain.js: Added.
  • stress/proxy-property-replace-structure-transition.js: Added.

Source/JavaScriptCore:

We used to ignore 'proto' in putInlineSlow when the object in question
was Proxy. There is no reason for this, and it goes against the spec. So
I've removed that condition. This also has the effect that it fixes an
assertion firing inside our inline caching code which dictates that for a
property replace that the base value's structure must be equal to the
structure when we grabbed the structure prior to the put operation.
The old code caused a weird edge case where we broke this invariant.

  • runtime/JSObject.cpp:

(JSC::JSObject::putInlineSlow):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r249861 r249911  
     12019-09-16  Saam Barati  <sbarati@apple.com>
     2
     3        JSObject::putInlineSlow should not ignore "__proto__" for Proxy
     4        https://bugs.webkit.org/show_bug.cgi?id=200386
     5        <rdar://problem/53854946>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * stress/proxy-__proto__-in-prototype-chain.js: Added.
     10        * stress/proxy-property-replace-structure-transition.js: Added.
     11
    1122019-09-13  Alexey Shvayka  <shvaikalesh@gmail.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r249885 r249911  
     12019-09-16  Saam Barati  <sbarati@apple.com>
     2
     3        JSObject::putInlineSlow should not ignore "__proto__" for Proxy
     4        https://bugs.webkit.org/show_bug.cgi?id=200386
     5        <rdar://problem/53854946>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        We used to ignore '__proto__' in putInlineSlow when the object in question
     10        was Proxy. There is no reason for this, and it goes against the spec. So
     11        I've removed that condition. This also has the effect that it fixes an
     12        assertion firing inside our inline caching code which dictates that for a
     13        property replace that the base value's structure must be equal to the
     14        structure when we grabbed the structure prior to the put operation.
     15        The old code caused a weird edge case where we broke this invariant.
     16
     17        * runtime/JSObject.cpp:
     18        (JSC::JSObject::putInlineSlow):
     19
    1202019-09-15  David Kilzer  <ddkilzer@apple.com>
    221
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r249175 r249911  
    685685    PropertyDescriptor ownDescriptor;
    686686    while (true) {
    687         if (current->type() == ProxyObjectType && propertyName != vm.propertyNames->underscoreProto) {
     687        if (current->type() == ProxyObjectType) {
    688688            ProxyObject* proxy = jsCast<ProxyObject*>(current);
    689689            PutPropertySlot slot(receiver, shouldThrow);
     
    829829            ASSERT(!(attributes & PropertyAttribute::Accessor));
    830830
    831             // If there's an existing property on the object or one of its
    832             // prototypes it should be replaced, so break here.
     831            // If there's an existing property on the base object, or on one of its
     832            // prototypes, we should store the property on the *base* object.
    833833            break;
    834834        }
     
    839839            }
    840840        }
    841         if (obj->type() == ProxyObjectType && propertyName != vm.propertyNames->underscoreProto) {
     841        if (obj->type() == ProxyObjectType) {
    842842            // FIXME: We shouldn't unconditionally perform [[Set]] here.
    843843            // We need to do more because this is observable behavior.
Note: See TracChangeset for help on using the changeset viewer.