Bug 207677

Summary: Add options for debugging WASM code.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, justin_michaud, keith_miller, msaboff, rmorisset, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch. ysuzuki: review+

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