Bug 207677 - Add options for debugging WASM code.
Summary: Add options for debugging WASM code.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-12 19:50 PST by Mark Lam
Modified: 2020-02-13 08:03 PST (History)
9 users (show)

See Also:


Attachments
proposed patch. (15.26 KB, patch)
2020-02-12 19:57 PST, Mark Lam
ysuzuki: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2020-02-12 19:50:13 PST
Specifically ...

    JSC_useBBQJIT                            - allows the BBQ JIT to be used if true
    JSC_useOMGJIT                            - allows the OMG JIT to be used if true
    JSC_useWasmLLIntPrologueOSR              - allows prologue OSR from Wasm LLInt if true
    JSC_useWasmLLIntLoopOSR                  - allows loop OSR from Wasm LLInt if true
    JSC_useWasmLLIntEpilogueOSR              - allows epilogue OSR from Wasm LLInt if true
    JSC_wasmFunctionIndexRangeToCompile=N:M  - wasm function index range to allow compilation on, e.g. 1:100
Comment 1 Radar WebKit Bug Importer 2020-02-12 19:51:16 PST
<rdar://problem/59411390>
Comment 2 Mark Lam 2020-02-12 19:57:59 PST
Created attachment 390611 [details]
proposed patch.
Comment 3 Yusuke Suzuki 2020-02-12 20:08:50 PST
Comment on attachment 390611 [details]
proposed patch.

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

r=me with one comment.

> Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:98
> +    if (!Options::wasmFunctionIndexRangeToCompile().isInRange(codeBlock->functionIndex()))

This functionIndex is per-wasm-module thing. If we have two wasm modules, they can have the same function index for different functions.
Currently, I think this is OK. But maybe, should we introduce dfgWhitelist like mechanism instead?
Comment 4 Mark Lam 2020-02-12 20:10:09 PST
(In reply to Yusuke Suzuki from comment #3)
> > Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:98
> > +    if (!Options::wasmFunctionIndexRangeToCompile().isInRange(codeBlock->functionIndex()))
> 
> This functionIndex is per-wasm-module thing. If we have two wasm modules,
> they can have the same function index for different functions.
> Currently, I think this is OK. But maybe, should we introduce dfgWhitelist
> like mechanism instead?

Yes, I understood this to be the case.  It will do for now.  Thanks.
Comment 5 Mark Lam 2020-02-12 20:12:30 PST
Thanks for the review.  Landed in r256500: <http://trac.webkit.org/r256500>.
Comment 6 Tadeu Zagallo 2020-02-13 08:03:19 PST
These should all have been wrapped in UNLIKELY