Bug 216222

Summary: [JSC] Special property caching should check Structure's cacheability
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, ryanhaddad, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 216061    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch saam: review+

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>