Skip to content
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

Whamm intrinsification baseline (wasm to wasm call) #222

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

thelongmarch-azx
Copy link
Contributor

No description provided.

Comment on lines +1539 to +1541
OUT.puts("JIT code: ");
masm.printCodeBytes(OUT);
OUT.ln();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes debugging easier, since we can see the exact assembly generated for each opcode

@thelongmarch-azx thelongmarch-azx marked this pull request as ready for review November 25, 2024 01:43
@thelongmarch-azx thelongmarch-azx changed the title Whamm intrinsification Whamm intrinsification baseline (wasm to wasm call) Nov 25, 2024
@thelongmarch-azx thelongmarch-azx marked this pull request as draft November 25, 2024 01:45
@thelongmarch-azx thelongmarch-azx marked this pull request as ready for review November 25, 2024 03:23
Copy link
Owner

@titzer titzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with minor suggestions.

@@ -106,6 +106,11 @@ component X86_64Runtime {
if (ret != null) return stack.throw(ret);
return ret;
}
def runtime_materialize_frame_accessor() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about calling this runtime_getFrameAccessorMetaRef()and returning the metaref, since it's needed by the caller?


new(w, regConfig: RegConfig) super(Target.tagging, regConfig) {
scratch = G(regConfig.scratch);
}

def printCodeBytes(sb: StringBuilder) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a little more local state; how about keeping track of the offset of the bytecode start in the SPC? Partially because we should consider saving that for use at runtime, e.g. to compute the PC at frame walking instead of storing it as is done now.

@@ -39,6 +39,13 @@ component Target {
if (Trace.compiler) {
Trace.OUT.put2("func[%d].target_code: break *0x%x", f.func_index, addr - Pointer.NULL)
.put2(" disass 0x%x, 0x%x", addr - Pointer.NULL, end - Pointer.NULL).ln();
var cur_byte = addr;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about guarding this behind a new trace flag --trace-asm?

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.

3 participants