Bug 224072 - Introduce LexicalScopeFeatures to enable future bytecode optimizations
Summary: Introduce LexicalScopeFeatures to enable future bytecode optimizations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-01 12:46 PDT by Alexey Shvayka
Modified: 2021-06-07 18:43 PDT (History)
15 users (show)

See Also:


Attachments
Patch (52.98 KB, patch)
2021-04-01 12:57 PDT, Alexey Shvayka
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (54.63 KB, patch)
2021-04-02 12:23 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (88.64 KB, patch)
2021-06-03 14:57 PDT, Alexey Shvayka
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (88.65 KB, patch)
2021-06-03 15:24 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].