Bug 224072

Summary: Introduce LexicalScopeFeatures to enable future bytecode optimizations
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, cdumez, cmarcelo, ews-watchlist, gyuyoung.kim, keith_miller, mark.lam, msaboff, ryuan.choi, saam, sergio, smoley, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch none

Description Alexey Shvayka 2021-04-01 12:46:17 PDT
Introduce LexicalScopeFeatures to enable future bytecode optimizations
Comment 1 Alexey Shvayka 2021-04-01 12:57:39 PDT
Created attachment 424944 [details]
Patch
Comment 2 Alexey Shvayka 2021-04-02 12:23:51 PDT
Created attachment 425040 [details]
Patch

Fix --debug build and make LexicalScopeFeatures constructor / static methods explicit.
Comment 3 Keith Miller 2021-04-06 11:49:21 PDT
Comment on attachment 425040 [details]
Patch

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

r=me with some nits.

> Source/JavaScriptCore/ChangeLog:9
> +        statement, direct `eval`, or certain variable names only within the current executable:

Typo: "to reason about" => "of reasoning about" and "of with statement" => "of with statements"

> Source/JavaScriptCore/ChangeLog:27
> +        If ResolveNode would know that unforgeable global properties are not shadowed and there

Nit: "would know" => "knew"

> Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h:257
>      unsigned m_firstLineOffset : 31;

This probably shouldn't be a bit field or other bit fields should be shuffled around to repack the struct.
Comment 4 Radar WebKit Bug Importer 2021-04-07 14:43:03 PDT
<rdar://problem/76366251>
Comment 5 Alexey Shvayka 2021-06-03 14:57:38 PDT
Created attachment 430502 [details]
Patch

Update ChangeLog, drop OptionSet to align with other features and use bit fields, add LexicalScopeFeatures to more classes, remove now unused StrictModeFeature and ArrowFunctionContextFeature, and fix bit fields packing.
Comment 6 Alexey Shvayka 2021-06-03 14:58:12 PDT
(In reply to Alexey Shvayka from comment #5)
> Created attachment 430502 [details]
> Patch

                                 sizeof (r278401)   sizeof (patch)

UnlinkedCodeBlock                      160              160
UnlinkedFunctionExecutable              96               96
ScopeNode                              304              304
FunctionMetadataNode                   144              144
SourceProviderCacheItem                 32               32
CachedCodeBlock                        464              464
CachedFunctionExecutableMetadata         4                4
ScriptExecutable                        72               72
Comment 7 Alexey Shvayka 2021-06-03 15:24:59 PDT
Created attachment 430507 [details]
Patch

Fix --debug build.
Comment 8 EWS 2021-06-07 18:43:21 PDT
Committed r278588 (238578@main): <https://commits.webkit.org/238578@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430507 [details].