Things have been running well but now I am hitting some barriers.
I need to be able to work with Long's, for example Thread.sleep(long)
Problem 1: The emitter was generating Llong; as the parameter type, I was able to fix this by extending _primativeMappings with long
_primitiveMappings = {
typeSystem.CharType: CHAR_TYPE.getDescriptor(),
typeSystem.BoolType: BOOLEAN_TYPE.getDescriptor(),
typeSystem.IntType: INT_TYPE.getDescriptor(),
typeSystem.VoidType: VOID_TYPE.getDescriptor(),
typeSystem.LongType: LONG_TYPE.getDescriptor(), #<<< Added to generate long param's
}
Problem 2: The emitter is generating integer literals for long parameters
eg.
44: iconst_0 <<<<<<<<<<< should be lconst
45: invokestatic java.lang.Thread.sleep (J)V (61)
I have added a LCONST generator
def LCONST(value as int):
if value == 0 :
emitInstruction Opcodes.LCONST_0
elif value == 1 :
emitInstruction Opcodes.LCONST_1
else:
LDC java.lang.Long(value)
and extended 'OnIntegerLiteralExpression'
override def OnIntegerLiteralExpression(node as IntegerLiteralExpression):
if node.IsLong :
LCONST node.Value
else:
ICONST node.Value
But now I am stuck. I need a suggestion of how to use the parameter signatures to generate a long LiteralExpression
Thanks for any suggestions.