Skip to content

prettyprint_node function is too large for Chicory AOT #3963

@headius

Description

@headius

The prettyprint_node function in prettyprint.c is almost 9000 lines long. This is far too big for Chicory's WASM-to-JVM compiler to cope with:

[ERROR] Failed to execute goal com.dylibso.chicory:chicory-compiler-maven-plugin:1.6.1:compile (prism) on project prism-parser-wasm: Execution prism of goal com.dylibso.chicory:chicory-compiler-maven-plugin:1.6.1:compile failed: WASM function size exceeds the Java method size limits and cannot be compiled to Java bytecode. It can only be run in the interpreter. Either reduce the size of the function or enable the interpreter fallback mode: WASM function index: 290 (name: prettyprint_node): Method too large: org/ruby_lang/prism/wasm/PrismParserMachineFuncGroup_0.func_290 (IIIILcom/dylibso/chicory/runtime/Memory;Lcom/dylibso/chicory/runtime/Instance;)V -> [Help 1]

Is there any reason we couldn't split this up into a few smaller methods, perhaps by moving the switch bodies and other grouped chunks of code to other functions?

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