blargwargl, im doing some code gen for java, i hav...
# compiler
blargwargl, im doing some code gen for java, i have this on stack
... double1, double2, double3, arrayRef
where double1..3 are primative double types, and arrayRef is a DoubleArray. I want to put these doubles into the array.
arrayRef, index, value.
Problem is, i cant swap double3 and arrayRef. double3 is a category2, and arrayRef is a category 1. There is no DUP bytecode for this swap where the stack has got a category 1 type on top, and a category 2 type below. kotlinc (and javac) are both smart enough to know the array will need to be created before pushing these values to the stack, so they push their array on the stack and then pus the values to store into that array on stack. Smart. Can i really not do this without a local variable? Am I missing something?
by soltuion was to kick the problem to the runtime, and INVOKE_STATIC a function that acts exactly like DASTORE does but mixing the arguments around :\