

Show HN: Jssembly – Native x86/x64/ARM Assembly via JNI Bridge in Java - dvt
https://github.com/dvx/jssembly

======
pjmlp
Nice project. Reminds me of how Squeak makes use of Assembly

[http://www.squeaksource.com/@us0cp9R3z2kMAiPd/FB3wRHMZ](http://www.squeaksource.com/@us0cp9R3z2kMAiPd/FB3wRHMZ)

------
aardvark179
How large a chunk of assembly is needed to balance out the JNI overhead? And
are you keeping an eye on Panama so you can do this insane thing faster? :-)

~~~
dvt
I'm not sure yet and I'm very interested in this problem, although it may be
JVM-specific. I have not read much on Panama, but will definitely check it
out.

------
ww520
Looks good. I imagine it can switch assembly code on the fly based on runtime
check.

~~~
dvt
Yep! It's in the works and not pushed yet, but depending on the architecture
you're running on, you should be able to execute different blocks of assembly
(or fall back to a Java-implemented method if nothing matches your
architecture).

------
stuaxo
Do individual instructions need to be passed one at a time, you may as well
accept multi line programmes..

~~~
dvt
An entire block is passed to the JNI bridge at one time; specifically, when
invoke() is called. It essentially is a function (and must follow the calling
conventions of the platform).

------
exabrial
What's something really cool you could do with this?

