Closed Bug 1523993 Opened 5 years ago Closed 5 years ago

Enhance wasm debugging capabilities

Categories

(Core :: JavaScript: WebAssembly, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: bbouvier, Assigned: bbouvier)

References

Details

Attachments

(2 files, 3 obsolete files)

  • with the possibility to control whether fast paths are enabled at run time, through env variables or other ways (see bug 1522458 comment 6).
  • allow to print all the values of arguments / return values at wasm call sites and on wasm imports.
Assignee: nobody → bbouvier
Status: NEW → ASSIGNED
Attached patch 1.patch (obsolete) — Splinter Review

This does the first part of this bug; see commit message.

I haven't gone as far as adding the javascript.options.environment about:config pref yet, because it would require parsing flags etc., and I'd like Spidermonkey to have a unified way to do so before doing it for wasm flags.

Attachment #9040438 - Flags: review?(luke)
Comment on attachment 9040438 [details] [diff] [review]
1.patch

Review of attachment 9040438 [details] [diff] [review]:
-----------------------------------------------------------------

I like the idea of having WASM_CODEGEN_DEBUG defined in debug builds (so that it doesn't bitrot) but I don't see where that happens in this patch.

::: js/src/jit/JitOptions.h
@@ +77,5 @@
>  #endif
> +#ifdef WASM_CODEGEN_DEBUG
> +  bool enableWasmJitExit;
> +  bool enableWasmJitEntry;
> +  bool enableWasmIonInlining;

nit: "inlining" makes me think of something we're not doing; how about "enableWasmFastJitEntry" or something?
Attachment #9040438 - Flags: review?(luke) → review+
Attached patch 1.patch (obsolete) — Splinter Review

Oops, forgot to fold the moz.configure patch.

Attachment #9040438 - Attachment is obsolete: true
Attachment #9040479 - Flags: review?(luke)
Comment on attachment 9040479 [details] [diff] [review]
1.patch

Review of attachment 9040479 [details] [diff] [review]:
-----------------------------------------------------------------

(Note also the "enableWasmFastJitEntry" suggestion in comment 2.)
Attachment #9040479 - Flags: review?(luke) → review+

(In reply to Luke Wagner [:luke] from comment #2)

Comment on attachment 9040438 [details] [diff] [review]
1.patch

Review of attachment 9040438 [details] [diff] [review]:

I like the idea of having WASM_CODEGEN_DEBUG defined in debug builds (so
that it doesn't bitrot) but I don't see where that happens in this patch.

::: js/src/jit/JitOptions.h
@@ +77,5 @@

#endif
+#ifdef WASM_CODEGEN_DEBUG

  • bool enableWasmJitExit;
  • bool enableWasmJitEntry;
  • bool enableWasmIonInlining;

nit: "inlining" makes me think of something we're not doing; how about
"enableWasmFastJitEntry" or something?

I can understand this is misstating that it's inlining wasm into ion, which is not the case indeed. Technically, we're inlining the entry into the Ion caller, so fast jit entry sounds awkward to describe this. Maybe enableWasmIonFastCalls? (the few trials I've done with inline in the name make it sound confusing)

Attached patch 2.spew.patch (obsolete) — Splinter Review

This adds a new configure option --enable-wasm-codegen-debug, which defaults
to true in debug builds (disable otherwise).

It's a first type so as to be able to use this in both the shell and browser,
using the env variables JIT_OPTION_{JitOption field name}.

Attachment #9040693 - Attachment description: Bug 1523993: Add JitOptions to disable wasm fast paths; r?luke → Bug 1523993: Add JitOptions to disable wasm fast paths; r=luke
Attachment #9040694 - Attachment description: Bug 1523993: Spew debug information for wasm calls; r?luke → Bug 1523993: Spew debug information for wasm calls; r=luke
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/454d1b05007a
Add JitOptions to disable wasm fast paths; r=luke
https://hg.mozilla.org/integration/autoland/rev/e8a0e28d1443
Spew debug information for wasm calls; r=luke
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a66a76627b3
Add JitOptions to disable wasm fast paths; r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/de9bc20a8ed5
Spew debug information for wasm calls; r=luke

Thanks for the backout; Maybe<> arguments have to be const&.

Flags: needinfo?(bbouvier)
Attachment #9040479 - Attachment is obsolete: true
Attachment #9040688 - Attachment is obsolete: true
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9d7ef0c0e5d
Expose AddressOf in WasmBuiltins.h; r=bustage
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1986c84c8302
Add js/Printf.h to WasmStubs.cpp; r=bustage
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: