Title: [281208] branches/safari-612.1.27.0-branch
Revision
281208
Author
repst...@apple.com
Date
2021-08-18 12:51:34 -0700 (Wed, 18 Aug 2021)

Log Message

Cherry-pick r280505. rdar://problem/82088775

    putInlineFastReplacingStaticPropertyIfNeeded should handle custom values
    https://bugs.webkit.org/show_bug.cgi?id=227963

    Reviewed by Alexey Shvayka.

    JSTests:

    * stress/reflect-set-custom-value.js:

    Source/_javascript_Core:

    Follow up after r280463: as it turns out, putInlineFastReplacingStaticPropertyIfNeeded also needs to handle
    custom values, similar to how definePropertyOnReceiverSlow was updated. This function will be called when the
    target property of the receiver is a custom value and isn't reified. The previous test case was expanded to
    test both the reified and non-reified cases.

    * runtime/JSObject.cpp:
    (JSC::JSObject::putInlineFastReplacingStaticPropertyIfNeeded):
    * tools/JSDollarVM.cpp:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280505 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-612.1.27.0-branch/JSTests/ChangeLog (281207 => 281208)


--- branches/safari-612.1.27.0-branch/JSTests/ChangeLog	2021-08-18 19:51:29 UTC (rev 281207)
+++ branches/safari-612.1.27.0-branch/JSTests/ChangeLog	2021-08-18 19:51:34 UTC (rev 281208)
@@ -1,5 +1,41 @@
 2021-08-18  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r280505. rdar://problem/82088775
+
+    putInlineFastReplacingStaticPropertyIfNeeded should handle custom values
+    https://bugs.webkit.org/show_bug.cgi?id=227963
+    
+    Reviewed by Alexey Shvayka.
+    
+    JSTests:
+    
+    * stress/reflect-set-custom-value.js:
+    
+    Source/_javascript_Core:
+    
+    Follow up after r280463: as it turns out, putInlineFastReplacingStaticPropertyIfNeeded also needs to handle
+    custom values, similar to how definePropertyOnReceiverSlow was updated. This function will be called when the
+    target property of the receiver is a custom value and isn't reified. The previous test case was expanded to
+    test both the reified and non-reified cases.
+    
+    * runtime/JSObject.cpp:
+    (JSC::JSObject::putInlineFastReplacingStaticPropertyIfNeeded):
+    * tools/JSDollarVM.cpp:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-07-30  Tadeu Zagallo  <tzaga...@apple.com>
+
+            putInlineFastReplacingStaticPropertyIfNeeded should handle custom values
+            https://bugs.webkit.org/show_bug.cgi?id=227963
+
+            Reviewed by Alexey Shvayka.
+
+            * stress/reflect-set-custom-value.js:
+
+2021-08-18  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r280463. rdar://problem/82088775
 
     definePropertyOnReceiver should check if receiver canPerformFastPutInline

Modified: branches/safari-612.1.27.0-branch/JSTests/stress/reflect-set-custom-value.js (281207 => 281208)


--- branches/safari-612.1.27.0-branch/JSTests/stress/reflect-set-custom-value.js	2021-08-18 19:51:29 UTC (rev 281207)
+++ branches/safari-612.1.27.0-branch/JSTests/stress/reflect-set-custom-value.js	2021-08-18 19:51:34 UTC (rev 281208)
@@ -1,3 +1,14 @@
-const testGetterSetter = $vm.createCustomTestGetterSetter();
-Reflect.set({}, 'customValue', 'foo', testGetterSetter);
-testGetterSetter.customValue = 42;
+{
+    // reified
+    const testGetterSetter = $vm.createCustomTestGetterSetter();
+    Reflect.set({}, 'customValue', 'foo', testGetterSetter);
+    testGetterSetter.customValue = 42;
+}
+
+{
+    // non-reified
+    let tester = $vm.createStaticCustomValue();
+    Reflect.set({}, "testStaticValueSetFlag", 'foo', tester);
+    if (!tester.testStaticValueSetterCalled)
+        throw new Error('Custom value overriden');
+}

Modified: branches/safari-612.1.27.0-branch/Source/_javascript_Core/ChangeLog (281207 => 281208)


--- branches/safari-612.1.27.0-branch/Source/_javascript_Core/ChangeLog	2021-08-18 19:51:29 UTC (rev 281207)
+++ branches/safari-612.1.27.0-branch/Source/_javascript_Core/ChangeLog	2021-08-18 19:51:34 UTC (rev 281208)
@@ -1,5 +1,48 @@
 2021-08-18  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r280505. rdar://problem/82088775
+
+    putInlineFastReplacingStaticPropertyIfNeeded should handle custom values
+    https://bugs.webkit.org/show_bug.cgi?id=227963
+    
+    Reviewed by Alexey Shvayka.
+    
+    JSTests:
+    
+    * stress/reflect-set-custom-value.js:
+    
+    Source/_javascript_Core:
+    
+    Follow up after r280463: as it turns out, putInlineFastReplacingStaticPropertyIfNeeded also needs to handle
+    custom values, similar to how definePropertyOnReceiverSlow was updated. This function will be called when the
+    target property of the receiver is a custom value and isn't reified. The previous test case was expanded to
+    test both the reified and non-reified cases.
+    
+    * runtime/JSObject.cpp:
+    (JSC::JSObject::putInlineFastReplacingStaticPropertyIfNeeded):
+    * tools/JSDollarVM.cpp:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-07-30  Tadeu Zagallo  <tzaga...@apple.com>
+
+            putInlineFastReplacingStaticPropertyIfNeeded should handle custom values
+            https://bugs.webkit.org/show_bug.cgi?id=227963
+
+            Reviewed by Alexey Shvayka.
+
+            Follow up after r280463: as it turns out, putInlineFastReplacingStaticPropertyIfNeeded also needs to handle
+            custom values, similar to how definePropertyOnReceiverSlow was updated. This function will be called when the
+            target property of the receiver is a custom value and isn't reified. The previous test case was expanded to
+            test both the reified and non-reified cases.
+
+            * runtime/JSObject.cpp:
+            (JSC::JSObject::putInlineFastReplacingStaticPropertyIfNeeded):
+            * tools/JSDollarVM.cpp:
+
+2021-08-18  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r280463. rdar://problem/82088775
 
     definePropertyOnReceiver should check if receiver canPerformFastPutInline

Modified: branches/safari-612.1.27.0-branch/Source/_javascript_Core/runtime/JSObject.cpp (281207 => 281208)


--- branches/safari-612.1.27.0-branch/Source/_javascript_Core/runtime/JSObject.cpp	2021-08-18 19:51:29 UTC (rev 281207)
+++ branches/safari-612.1.27.0-branch/Source/_javascript_Core/runtime/JSObject.cpp	2021-08-18 19:51:34 UTC (rev 281208)
@@ -942,8 +942,7 @@
                     RELEASE_AND_RETURN(scope, customSetter(structure->globalObject(), JSValue::encode(this), JSValue::encode(value), propertyName));
             }
             // Avoid PutModePut because it fails for non-extensible structures.
-            ASSERT(!(entry->value->attributes() & PropertyAttribute::CustomValue));
-            putDirect(vm, propertyName, value, attributesForStructure(entry->value->attributes()), slot);
+            putDirect(vm, propertyName, value, attributesForStructure(entry->value->attributes()) & ~PropertyAttribute::CustomValue, slot);
             return true;
         }
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to