Skip to content

Implement compiler using class file api #9

@bitterfox

Description

@bitterfox

https://openjdk.org/jeps/457

Java 22 introduced ClassFile API as Preview, let's support real compiler using ClassFile API

  • Create class for JsonCompilerBridge
    • This creates byte codes for each json elements
  • Compiler creates class file with byte codes
    • ClassFile compile(JsonAST)
    • class A {Json process(Object x, Object y, Object z);}
    • load class file and create Method Handle
  • JsonStringTemplateProcessor caches MethodHandle class file and call A.process(value[0], value[1], value[2]) through MethodHandle
JsonCompilerBridge#createJsonString(String strs)
// add str to constant pool

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions