Simple dynamic language using invokedynamic

Rémi Forax forax at univ-mlv.fr
Mon Jun 22 06:28:31 PDT 2009


Chanwit Kaewkasi a écrit :
> Hi Remi,
>
>   
>> Hi Chanwit,
>> run with -Xint, the JIT doesn't work in b61,
>> I think it should work with latest patches from mlvm repo.
>>     
>
> Yes, I did run with -Xint and JVM crashed. With out -Xint, the program
> was just not be able to run.
> They had different error messages.
>
>   
>> About your generated code, you use BIPUSH 1 instead of ICONST_1
>> and in the static initializer, you can use LDC with a class (a Type in ASM)
>> instead of loading a String and relying on Class.forName().
>>     
>
> Thank you for your suggestion. LDC to load an ASM Type is just great.
>
>   
>> What disassembler do you use ?
>> I have noticed that INVOKEDYNAMIC is printed with a receiver
>> an I fear I have forget to patch that in ASM sources.
>>     
>
> You have good eyes ;-) It's Andrei Loskutov's Bytecode Outline plugin
> with my ASM patch.
>   
Thank you, I will check with him.

>   
>> This week end, I have hacked the backport to be able to run invokedynamic,
>> Could you please try to run your example with it ?
>>
>> Donwload it here:
>> http://code.google.com/p/jvm-language-runtime/source/browse/#svn/trunk/invokedynamic-backport
>>
>> run ant to create the jsr292-backport.jar, it has a dependency encoded
>> in the jar
>> on asm3.2-all.jar
>>
>> And run your example (with java5 or java6) :
>> java -javaagent:lib/jsr292-backport.jar ...
>>     
>
> You use an agent? Does this mean I can just run my code unmodified?
>   
Yes, you can use your code without modification.
The agent intercept the bytecode after the bytecode is loaded and before 
the class is defined
and even recompile the bytecode at runtime if the code is hot.

> I will try it and let you know.
>   
Thank you again.

> Chanwit
>
>   
Rémi



More information about the mlvm-dev mailing list