Skip to content

Support a "spegetti stack" #455

@PaulBone

Description

@PaulBone

Add a stack structure that can allow us to re-use stack frames. There's lots of different stratergies but I'm partial to a spagetti stack that makes use of the GC to clean up frames. Something like.

  • Adding a new frame uses a bump-pointer allocation (just like a regular stack frame).
  • Capturing marks the frame as captured (mark parents?!)
  • Returning "pops" the frame only if it is topmost AND not captured.
  • The GC cleans and compacts the stack, removing captured-but-not-referenced frames.

If stack frames are not captured, it means that this part of the program isn't making use of continuations or similar features, or only captures them but never replays them. Then the Plasma abstract machine modle should work as near as possible to native execution, especially with regard to something like the x86 shadow stack.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions