dragome / dragome-sdk

Dragome is a tool for creating client side web applications in pure Java (JVM) language.
http://www.dragome.com
Other
80 stars 20 forks source link

Missing jvm instruction #157

Closed nicolaichuk closed 7 years ago

nicolaichuk commented 7 years ago

I have this js after run dragome compiler:

ERROR("dex:rem-float-2addr");

and then error:

Uncaught ReferenceError: ERROR is not defined

Perhaps it is relate with this issue https://sourceforge.net/p/xmlvm/mailman/message/27306854/

Opcode (hex): CA
Opcode name: rem-float/2addr vx,vy
Explanation: Calculates vx/vy and puts the result into vx. 

Example: CA10 - rem-float/2addr v0, v1
Calculates v0 % v1 and puts the result into v0. 

http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html

nicolaichuk commented 7 years ago

Also dont support

ERROR("dex:shl-int-2addr");

ERROR("dex:shl-int");

ERROR("dex:ushr-long-2addr");

fix in https://github.com/dragome/dragome-sdk/pull/156/commits/233e3699172e75faf0755b7e073b2280f7aa9990

nicolaichuk commented 7 years ago

javascript work only with 32-bit value when used bitwise operation.

https://stackoverflow.com/questions/3081271/number-of-bits-to-represent-a-number

And used 53-bit value for other integer operation

https://stackoverflow.com/questions/17320706/javascript-long-integer

I do not sure about valid mirror operation with 64-bit long value between java and javascript code. Maybe need write same wrapper over java native long value.

nicolaichuk commented 7 years ago

Create issue https://github.com/dragome/dragome-sdk/issues/161