bytecodealliance / bytecodealliance/wasmtime

Cranelift: generate stackmaps that are compatible with SpiderMonkey

Open
#2,281 0 comments 0 reactions 0 assignees View on GitHub
bug cranelift
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

Currently, Cranelift (with the new backend) generates stackmaps (meaning, maps that show the ref-typeness or otherwise of each word of stack). There is one stackmap per function. The stackmaps cover the function's frame. Assuming a grow-down stack, the stack map covers the address range whose upper end is the pushed return address (or thereabouts), and extends downwards to cover all of the compiler-created temporaries, down to and including the outgoing parameter area for each call (for calls that pass args in memory).

This is unfortunately incompatible with SpiderMonkey's stackmap conventions, and complicates interworking with SpiderMonkey-compiled code. In the SM convention, each function's incoming parameter area is covered by its own stackmap (not the caller's), and the outgoing parameter area(s) are *not* covered by its own stackmap -- those are covered by the callee's. For one thing, this makes it easier to implement tail calls in the presence of stackmaps.

Hence this bug is a placeholder, for work on changing CL to use SpiderMonkey's conventions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.