Skip to content

Instantly share code, notes, and snippets.

@ShikaSD
Created March 31, 2020 15:41
Show Gist options
  • Save ShikaSD/1b79bff540951e46eee5e8c1302b33b9 to your computer and use it in GitHub Desktop.
Save ShikaSD/1b79bff540951e46eee5e8c1302b33b9 to your computer and use it in GitHub Desktop.
private fun ImplementationBodyCodegen.addReadResolveFunction(
block: InstructionAdapter.() -> Unit
) {
val visitor = v.newMethod(
NO_ORIGIN,
ACC_PUBLIC or ACC_SYNTHETIC,
SERIALIZABLE_READ.identifier,
"()Ljava/lang/Object;",
null,
EMPTY_STRING_ARRAY
)
visitor.visitCode()
val iv = InstructionAdapter(visitor)
iv.apply(block)
FunctionCodegen.endVisit(iv, "JVM serialization bindings")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment