Bug 200362 - [JSC] OSR entry to Wasm OMG
Summary: [JSC] OSR entry to Wasm OMG
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: 200329 200759
Blocks: 228595
  Show dependency treegraph
 
Reported: 2019-08-01 14:41 PDT by Yusuke Suzuki
Modified: 2021-07-29 11:24 PDT (History)
10 users (show)

See Also:


Attachments
Patch (8.94 KB, patch)
2019-08-02 20:24 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (81.21 KB, patch)
2019-08-05 22:21 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (84.35 KB, patch)
2019-08-05 23:28 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews114 for mac-highsierra (3.25 MB, application/zip)
2019-08-06 01:01 PDT, EWS Watchlist
no flags Details
Patch (84.47 KB, patch)
2019-08-06 11:50 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (86.82 KB, patch)
2019-08-06 15:23 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (95.72 KB, patch)
2019-08-07 11:15 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (99.47 KB, patch)
2019-08-07 11:20 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (109.25 KB, patch)
2019-08-07 20:27 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (112.67 KB, patch)
2019-08-08 01:20 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (111.73 KB, patch)
2019-08-08 23:41 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (122.31 KB, patch)
2019-08-12 18:55 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (126.21 KB, patch)
2019-08-12 19:53 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (150.92 KB, patch)
2019-08-12 23:22 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (152.42 KB, patch)
2019-08-13 01:22 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (161.83 KB, patch)
2019-08-13 18:37 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (176.50 KB, patch)
2019-08-13 23:56 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (176.39 KB, patch)
2019-08-14 02:52 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (178.06 KB, patch)
2019-08-15 00:38 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (180.86 KB, patch)
2019-08-15 14:48 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (181.25 KB, patch)
2019-08-15 15:03 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (181.51 KB, patch)
2019-08-15 23:49 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (185.01 KB, patch)
2019-08-16 14:00 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (184.96 KB, patch)
2019-08-16 14:09 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (187.25 KB, patch)
2019-08-18 04:07 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (187.35 KB, patch)
2019-08-18 04:12 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (187.44 KB, patch)
2019-08-19 01:16 PDT, Yusuke Suzuki
msaboff: 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-08-01 14:41:45 PDT
gcc-loops-wasm shows that we should do OSR entry to execute hot code in OMG.
Comment 1 Yusuke Suzuki 2019-08-02 15:06:15 PDT
By using bug 200329's patch, we get the following output.
This indicates that gcc-loops-wasm stays on BBQ tier because the hottest function includes the loop inside it and we cannot tier up to OMG!


Starting JetStream2
Running gcc-loops-wasm:
    Startup: 227.273
    Run time: 0.588
    Score: 11.561


Startup: 227.273
Runtime: 0.588

Total Score:  11.561



Sampling rate: 1000.000000 microseconds
Top functions as <numSamples  'functionName:sourceID'>
  2603    '<?>.wasm-function[38]:-1'
  1494    '<?>.wasm-function[39]:-1'
  1004    '<?>.wasm-function[36]:-1'
   965    '<?>.wasm-function[35]:-1'
   325    '<?>.wasm-function[34]:-1'
   202    '<?>.wasm-function[546]:-1'
    16    '<?>.wasm-function[40]:-1'
     3    'loadString:-1'
     3    '<?>.wasm-function[37]:-1'
     2    'load:-1'
     1    'prepareToRun:2'
     1    '(unknown):-1'


Sampling rate: 1000.000000 microseconds
Hottest bytecodes as <numSamples   'functionName#hash:JITType:bytecodeIndex'>
  2603    '<?>.wasm-function[38]#<nil>:BBQ:<nil>'
  1494    '<?>.wasm-function[39]#<nil>:BBQ:<nil>'
  1004    '<?>.wasm-function[36]#<nil>:BBQ:<nil>'
   965    '<?>.wasm-function[35]#<nil>:BBQ:<nil>'
   324    '<?>.wasm-function[34]#<nil>:OMG:<nil>'
   202    '<?>.wasm-function[546]#<nil>:OMG:<nil>'
    16    '<?>.wasm-function[40]#<nil>:BBQ:<nil>'
     3    'loadString#<nil>:None:<nil>'
     3    '<?>.wasm-function[37]#<nil>:BBQ:<nil>'
     2    'load#<nil>:None:<nil>'
     1    'createStandardStreams#Asr3FY:LLInt:387'
     1    'filter#CXE8tr:Baseline:81'
     1    'newPromiseCapability#DzQl2X:Baseline:91'
     1    'prepareToRun#DqWFYU:LLInt:129'
     1    'callRuntimeCallbacks#EYZrDM:LLInt:200'
     1    'updateGlobalBufferViews#AqvIC2:LLInt:85'
     1    '(unknown)#<nil>:None:<nil>'
     1    '#<nil>:None:<nil>'
     1    '<?>.wasm-function[34]#<nil>:BBQ:<nil>'
     1    'doRun#C0pLVZ:LLInt:20191'
     1    '#A7TOIG:LLInt:22'
     1    'instantiateArrayBuffer#ALPYQ8:LLInt:22'
     1    'fulfillPromise#AuvX5q:Baseline:95'
Comment 2 Yusuke Suzuki 2019-08-02 20:24:15 PDT
Created attachment 375479 [details]
Patch
Comment 3 Yusuke Suzuki 2019-08-05 22:21:22 PDT
Created attachment 375601 [details]
Patch
Comment 4 EWS Watchlist 2019-08-05 22:23:44 PDT
Attachment 375601 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmInstance.h:154:  The parameter name "size" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:247:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:249:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
Total errors found: 3 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Yusuke Suzuki 2019-08-05 23:28:49 PDT
Created attachment 375604 [details]
Patch
Comment 6 EWS Watchlist 2019-08-05 23:30:00 PDT
Attachment 375604 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp:1728:  One line control clauses should not use braces.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/wasm/WasmInstance.h:154:  The parameter name "size" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:247:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:249:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
Total errors found: 4 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 EWS Watchlist 2019-08-06 01:01:39 PDT
Comment on attachment 375604 [details]
Patch

Attachment 375604 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/12867878

New failing tests:
workers/wasm-hashset.html
Comment 8 EWS Watchlist 2019-08-06 01:01:40 PDT
Created attachment 375613 [details]
Archive of layout-test-results from ews114 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 9 Yusuke Suzuki 2019-08-06 11:50:00 PDT
Created attachment 375636 [details]
Patch
Comment 10 EWS Watchlist 2019-08-06 11:51:45 PDT
Attachment 375636 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp:1728:  One line control clauses should not use braces.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/wasm/WasmInstance.h:154:  The parameter name "size" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:248:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:250:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
Total errors found: 4 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 EWS Watchlist 2019-08-06 13:55:23 PDT
Comment on attachment 375636 [details]
Patch

Attachment 375636 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12870069

New failing tests:
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-ftl-eager-no-cjit-validate-phases
Comment 12 Yusuke Suzuki 2019-08-06 15:23:21 PDT
Created attachment 375652 [details]
Patch
Comment 13 Yusuke Suzuki 2019-08-07 11:15:35 PDT
Created attachment 375715 [details]
Patch
Comment 14 Yusuke Suzuki 2019-08-07 11:20:57 PDT
Created attachment 375719 [details]
Patch
Comment 15 EWS Watchlist 2019-08-07 11:23:48 PDT
Attachment 375719 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:248:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:250:  Extra space before last semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
ERROR: Source/JavaScriptCore/wasm/WasmInstance.h:154:  The parameter name "size" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp:1722:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 4 in 24 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 16 Yusuke Suzuki 2019-08-07 11:35:35 PDT
<rdar://problem/53833250>
Comment 17 EWS Watchlist 2019-08-07 14:38:41 PDT
Comment on attachment 375719 [details]
Patch

Attachment 375719 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12875060

New failing tests:
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-no-ftl
Comment 18 Yusuke Suzuki 2019-08-07 20:27:32 PDT
Created attachment 375784 [details]
Patch
Comment 19 EWS Watchlist 2019-08-07 22:34:36 PDT
Comment on attachment 375784 [details]
Patch

Attachment 375784 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12877458

New failing tests:
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-llint
Comment 20 Yusuke Suzuki 2019-08-08 01:20:25 PDT
Created attachment 375788 [details]
Patch
Comment 21 EWS Watchlist 2019-08-08 03:24:07 PDT
Comment on attachment 375788 [details]
Patch

Attachment 375788 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12878263

New failing tests:
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-llint
Comment 22 Yusuke Suzuki 2019-08-08 23:41:56 PDT
Created attachment 375895 [details]
Patch
Comment 23 Yusuke Suzuki 2019-08-09 03:31:27 PDT
Now, gcc-loops-wasm's Runtime score gets 4x higher. I'll fix the thing bloating OSR entry code in Air, and finalize this patch :)
Comment 24 Yusuke Suzuki 2019-08-12 18:55:20 PDT
Created attachment 376126 [details]
Patch
Comment 25 Yusuke Suzuki 2019-08-12 19:53:41 PDT
Created attachment 376130 [details]
Patch
Comment 26 Yusuke Suzuki 2019-08-12 23:22:06 PDT
Created attachment 376139 [details]
Patch
Comment 27 Yusuke Suzuki 2019-08-13 01:22:57 PDT
Created attachment 376146 [details]
Patch
Comment 28 Yusuke Suzuki 2019-08-13 18:37:27 PDT
Created attachment 376227 [details]
Patch
Comment 29 Yusuke Suzuki 2019-08-13 23:56:07 PDT
Created attachment 376240 [details]
Patch
Comment 30 EWS Watchlist 2019-08-14 00:00:00 PDT
Attachment 376240 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 49 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 31 EWS Watchlist 2019-08-14 02:07:23 PDT
Comment on attachment 376240 [details]
Patch

Attachment 376240 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12909069

New failing tests:
wasm.yaml/wasm/stress/osr-entry-basic.js.wasm-no-air
wasm.yaml/wasm/stress/osr-entry-many-locals-f32.js.wasm-no-air
wasm.yaml/wasm/stress/osr-entry-many-stacks-f32.js.wasm-no-air
Comment 32 Yusuke Suzuki 2019-08-14 02:52:58 PDT
Created attachment 376255 [details]
Patch
Comment 33 EWS Watchlist 2019-08-14 02:56:19 PDT
Attachment 376255 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 49 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 34 EWS Watchlist 2019-08-14 05:03:58 PDT
Comment on attachment 376255 [details]
Patch

Attachment 376255 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12909856

New failing tests:
wasm.yaml/wasm/stress/osr-entry-many-stacks-f32.js.wasm-no-air
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-no-ftl
Comment 35 Yusuke Suzuki 2019-08-15 00:38:20 PDT
Created attachment 376366 [details]
Patch
Comment 36 EWS Watchlist 2019-08-15 00:39:42 PDT
Attachment 376366 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 47 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 37 Yusuke Suzuki 2019-08-15 14:48:57 PDT
Created attachment 376424 [details]
Patch
Comment 38 EWS Watchlist 2019-08-15 14:51:05 PDT
Attachment 376424 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 47 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 39 Yusuke Suzuki 2019-08-15 15:03:07 PDT
Created attachment 376426 [details]
Patch
Comment 40 EWS Watchlist 2019-08-15 15:06:27 PDT
Attachment 376426 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 47 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 41 Yusuke Suzuki 2019-08-15 23:49:17 PDT
Created attachment 376474 [details]
Patch
Comment 42 EWS Watchlist 2019-08-15 23:52:11 PDT
Attachment 376474 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:203:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 47 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 43 Yusuke Suzuki 2019-08-16 14:00:05 PDT
Created attachment 376536 [details]
Patch

Add wasm-eager
Comment 44 EWS Watchlist 2019-08-16 14:02:31 PDT
Attachment 376536 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:203:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 49 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 45 Yusuke Suzuki 2019-08-16 14:09:18 PDT
Created attachment 376537 [details]
Patch

Add wasm-eager
Comment 46 EWS Watchlist 2019-08-16 14:10:54 PDT
Attachment 376537 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:203:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 49 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 47 Yusuke Suzuki 2019-08-18 04:07:06 PDT
Created attachment 376633 [details]
Patch

Rebaseline
Comment 48 EWS Watchlist 2019-08-18 04:08:43 PDT
Attachment 376633 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:203:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 48 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 49 Yusuke Suzuki 2019-08-18 04:12:50 PDT
Created attachment 376634 [details]
Patch

Rebaseline
Comment 50 EWS Watchlist 2019-08-18 04:14:57 PDT
Attachment 376634 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:203:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 48 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 51 Yusuke Suzuki 2019-08-19 00:31:09 PDT
Comment on attachment 376634 [details]
Patch

std::make_unique things are replaced to makeUnique later.
Comment 52 Yusuke Suzuki 2019-08-19 01:16:59 PDT
Created attachment 376675 [details]
Patch

Rebaseline, using makeUnique
Comment 53 EWS Watchlist 2019-08-19 01:22:11 PDT
Attachment 376675 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:203:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:1064:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 48 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 54 Michael Saboff 2019-08-19 15:51:40 PDT
Comment on attachment 376675 [details]
Patch

r=me
Comment 55 Yusuke Suzuki 2019-08-19 17:21:35 PDT
Committed r248878: <https://trac.webkit.org/changeset/248878>