Bug 203795 - [JSC] Use LinkTimeConstants and make some properties lazy
Summary: [JSC] Use LinkTimeConstants and make some properties lazy
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on: 153792
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-02 21:37 PDT by Yusuke Suzuki
Modified: 2019-11-08 13:12 PST (History)
7 users (show)

See Also:


Attachments
Patch (27.99 KB, patch)
2019-11-06 19:18 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (29.52 KB, patch)
2019-11-07 17:53 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (29.54 KB, patch)
2019-11-07 17:56 PST, Yusuke Suzuki
keith_miller: 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 2019-11-02 21:37:50 PDT
...
Comment 1 Yusuke Suzuki 2019-11-06 19:18:14 PST
Created attachment 383009 [details]
Patch
Comment 2 Yusuke Suzuki 2019-11-07 17:53:06 PST
Created attachment 383098 [details]
Patch
Comment 3 Yusuke Suzuki 2019-11-07 17:56:11 PST
Created attachment 383099 [details]
Patch
Comment 4 Keith Miller 2019-11-07 18:20:02 PST
Comment on attachment 383099 [details]
Patch

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

r=me with comments.

> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:2015
> +    if (m_mapIteratorProtocolWatchpointSet.isStillValid()) {

Can't this be an ASSERT? How can this not be valid if you haven't initialized Map.prototype? I don't think it's possible to access the Map iterator prototype object without first creating a Map.

> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:2030
> +    if (m_setIteratorProtocolWatchpointSet.isStillValid()) {

ditto.
Comment 5 Yusuke Suzuki 2019-11-07 18:47:10 PST
Comment on attachment 383099 [details]
Patch

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

Thanks!

>> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:2015
>> +    if (m_mapIteratorProtocolWatchpointSet.isStillValid()) {
> 
> Can't this be an ASSERT? How can this not be valid if you haven't initialized Map.prototype? I don't think it's possible to access the Map iterator prototype object without first creating a Map.

This can be invalid because m_mapIteratorProtocolWatchpointSet is also checked by mapIteratorPrototype's change.

> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:2020
> +    if (m_mapSetWatchpointSet.isStillValid()) {

On the other hand, this is only used here. So we can convert it to ASSERT. Fixed.

>> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:2030
>> +    if (m_setIteratorProtocolWatchpointSet.isStillValid()) {
> 
> ditto.

Ditto. This can be invalid if setIteratorPrototype is changed.

> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:2035
> +    if (m_setAddWatchpointSet.isStillValid()) {

Ditto. Fixed.
Comment 6 Yusuke Suzuki 2019-11-08 13:11:37 PST
Committed r252256: <https://trac.webkit.org/changeset/252256>
Comment 7 Radar WebKit Bug Importer 2019-11-08 13:12:15 PST
<rdar://problem/57031944>