I need to lower a function to JVM bytecode, using ...
# compiler
c
I need to lower a function to JVM bytecode, using a MethodVisitor I control, while my
IntrinsicMethod
is executing. For example: I'm given a
foo()
call in
IntrinsicMethod#invoke
, and I need to lower
foo
before doing what I'm expected to do in the
IntrinsicMethod#invoke
method. How would I pull that off? As well, is there a best-practice for this kind of thing to avoid messing up incremental-compilation? (I'm seeing a lot with ClassCodegen, but I'm unsure how to handle top-level functions, as experimentation says that it uses the file class that I'm not certain how I should reference. I'm also not sure if the JvmBackendContext can even be transferred between classes safely like that, and overall what I can do in this situation without invalidating IC. I could infer it from usage, but I'd prefer to ask the people who know the compiler best.)