Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.
This repository was archived by the owner on Jul 4, 2022. It is now read-only.

feat(compiler): function to push bytecode size onto the stack #21

@exp-table

Description

@exp-table

In order to support arbitrary-sized arrays as arguments of the constructor, we have to know the bytecode size beforehand, so we can use it along with the CODESIZE opcode to parse the arguments bits.

Following an exchange with @JetJadeja on Twitter, a potential solution is to define a reserved keyword, which the compiler knows to replace with a  PUSH operation of the bytecode size.

I have a working PoC here. We probably want to change the keyword as I am using scodesize__, along with OperationType.SCODESIZE and the replacement that is done at the end of the compile function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions