Skip to content

Experimental interpreter tracing code. #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Experimental interpreter tracing code. #137

wants to merge 1 commit into from

Conversation

sunfishcode
Copy link
Member

This PR isn't ready as-is; I'm just looking for feedback.

I've found this debugging feature, which which prints out all values of all operations as they are executed, to be quite handy. The patch here could be prettier, and it'd be nice to print the opcode too, but my main question is: This patch breaks the "tail call" property of eval_expr, which was mentioned a while ago as an important property; is there a convenient way to do what this patch is doing with doing that?

@rossberg
Copy link
Member

Yes, tail calls are essential to the current formulation of the operational semantics. If you break it then e.g. a loop will no longer run in constant space but blow the stack. Other constructs like blocks and if would also eat up stack space linear in nesting depth.

The loop issue could be avoided by implementing it with a loop instead of a tail call, but of course that would no longer be declarative, i.e., "speccy". Maybe that's okay in this isolated case. The linearity in nesting depth could not be avoided, however.

@sunfishcode sunfishcode deleted the trace branch October 23, 2015 21:19
Connicpu pushed a commit to Connicpu/wasm-spec that referenced this pull request May 11, 2020
* add syntax highlighting

* Update Overview.md
Connicpu pushed a commit to Connicpu/wasm-spec that referenced this pull request Jun 7, 2020
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Mar 2, 2023
This updates the explainer text according to the new spec we agreed in
the 09-15-2020 CG meeting and discussions afterwards.

The following are modifications and clarifications we made after the
09-15-2020 CG meeting, and the relevant issue posts, if any:
https://github.com/WebAssembly/meetings/blob/master/main/2020/CG-09-15.md

- `catch_br` wasm renamed to `delegate` (WebAssembly#133)
- `rethrow` gains an immediate argument (WebAssembly#126)
- Removed dependences on the reference types proposal and the multivalue
  proposal. The multivalue proposal was previously listed as dependent
  because 1. `try` is basically a `block`, so it can have multivalue
  input/output 2. `br_on_exn` can extract multiple values from a
  `block`. We don't have `br_on_exn` anymore, and I'm not sure 1 is a
  strong enough reason to make it a dependence.
- Mention `rethrow` cannot rethrow exceptions caught by `unwind` (WebAssembly#142
  and WebAssembly#137)
- Mention some runtimes, especially web VMs, can attach stack traces to
  the exception object, implying stack traces are not required for all
  VMs
- Update label/validation rules for `delegate` and `rethrow` (WebAssembly#146)
- Finalize opcodes for `delegate` (0x18) and `catch_all` (0x19) (WebAssembly#145
  and WebAssembly#147)

I believe this resolves many previous issue threads, so I'll close them.
Please reopen them if you think there are things left for discussions in
those issues.

Resolves WebAssembly#113, resolves WebAssembly#126, resolves WebAssembly#127, resolves WebAssembly#128, resolves
WebAssembly#130, resolves WebAssembly#142, resolves WebAssembly#145, resolves WebAssembly#146, resolves WebAssembly#147.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants