-
Notifications
You must be signed in to change notification settings - Fork 5
Staged Miniwasm Interpreter #88
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
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,499 @@ | |||
package gensym.wasm.miniwasm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to change the package name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this version is stable, it will be moved to a dedicated package for staging code
// when tail call, share the continuation for returning with the callee | ||
eval(body, List(), newFrame, kont, List(kont)) | ||
// when tail call, return to the caller's return continuation | ||
eval(body, List(), newFrame, trail.last, List(trail.last)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting this!
benchmarks/wasm/staged/scratch.wat
Outdated
global.get 1 | ||
i32.const 3 | ||
global.set 2 ;; TODO: this line was compiled to global.get, fix the parser! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You only have one global here. So you can only global.get/set
0.
I guess here you want to have global.get 0
and global.set 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not intended for execution (check the comment at the top of this file). It's more like a playground to see if our compiler works for each instruction, I'm sorry didn't mention that in the first place.
It seems there are some problems in our parser, the GlobalSet
instruction is not exist in the parsed AST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a typo. Thanks for spotting that.
@virtualize | ||
trait StagedWasmEvaluator extends SAIOps { | ||
def module: ModuleInstance | ||
// NOTE: we don't need the following statements anymore, but where are they initialized? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.