Skip to content

The case for dropping JUMPF and non-returning functions #42

@gumb0

Description

@gumb0

Main use case for JUMPF was being able to call a non-returning helper without the requirement to have equal stack height at each call site and without the need to POP extra items before calling.

In the current spec:

  1. If such helper is implemented inside caller section (without CALLF/JUMPF), it is allowed to call it from different stack heights.

  2. If such helper is in a separate section, we can make it work without the need for non-returning flag and JUMPF: non-returning functions are declared with 0 outputs, and the requirement to not POP extra items is achieved with CALLF STOP or CALLF INVALID sequence.

The difference with JUMPF would be 4 bytes of code instead of 3 bytes and an item pushed into call stack at run-time.

cc @ekpyron @charles-cooper

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions