Bug 216222 - [JSC] Special property caching should check Structure's cacheability
Summary: [JSC] Special property caching should check Structure's cacheability
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
: 216262 (view as bug list)
Depends on: 216061
Blocks:
  Show dependency treegraph
 
Reported: 2020-09-05 22:12 PDT by Yusuke Suzuki
Modified: 2020-09-08 00:21 PDT (History)
8 users (show)

See Also:


Attachments
Patch (10.62 KB, patch)
2020-09-05 23:53 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (10.49 KB, patch)
2020-09-06 00:02 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (10.33 KB, patch)
2020-09-06 00:04 PDT, Yusuke Suzuki
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-09-05 22:12:01 PDT
[JSC] ModuleNamespaceObject's property caching has different mechanism than IC
Comment 1 Yusuke Suzuki 2020-09-05 23:53:02 PDT
Created attachment 408116 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-09-05 23:53:47 PDT
<rdar://problem/68415681>
Comment 3 Yusuke Suzuki 2020-09-05 23:58:29 PDT
Comment on attachment 408116 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408116&action=review

> JSTests/stress/not-cache-over-uncacheable-dictionary.js:14
> +function shouldBe(actual, expected) {
> +    if (actual !== expected)
> +        throw new Error('bad value: ' + actual);
> +}
> +
> +var object = {};
> +$vm.toUncacheableDictionary(object);
> +shouldBe(String(object), `[object Object]`);
> +shouldBe(String(object), `[object Object]`);
> +shouldBe(String(object), `[object Object]`);
> +object[Symbol.toStringTag] = "OK";
> +shouldBe(String(object), `[object OK]`);
> +shouldBe(String(object), `[object OK]`);
> +shouldBe(String(object), `[object OK]`);

This test does not fail without this patch while we were caching. This is because we are relying on watchpoints for properties instead of structure ID.
But in this patch, we changed the code not to cache properties in uncacheable-dictionary. So testing it here is nice.
Comment 4 Yusuke Suzuki 2020-09-06 00:02:34 PDT
Created attachment 408117 [details]
Patch
Comment 5 Yusuke Suzuki 2020-09-06 00:04:16 PDT
Created attachment 408118 [details]
Patch
Comment 6 Ryan Haddad 2020-09-07 22:33:19 PDT
*** Bug 216262 has been marked as a duplicate of this bug. ***
Comment 7 Saam Barati 2020-09-07 23:30:58 PDT
Comment on attachment 408118 [details]
Patch

r=me
Comment 8 Yusuke Suzuki 2020-09-08 00:21:15 PDT
Committed r266715: <https://trac.webkit.org/changeset/266715>