Hi Mark,

what do you mean? I don't have "native code" on the browser platform. We 
only have JavaScript functions, that were compiled-to from native "C" code.
My general goal is to get a Java Virtual Machine working on the Browser 
Platform via Emscripten (don't ask why :).
It's basically the same as wanting to run Python or Lua on the browser.
And a JVM uses "JNI" as the interface mechanism between Java and whatever 
the "native" platform language is (in this case Emscripten-compiled 
JavaScript). I mean, after all, JNI is just a contract how a "native" (i.e. 
JavaScript/asm.js) function is being named/exported to be able to resolve 
it dynamically at runtime.
So, the following conditions hold:
- JNI functions are initially compiled from C to JavaScript/asm.js
- Java is still just Java (i.e. Bytecode) being interpreted by a Java 
Virtual Machine (JamVM in my case)
- as the JVM is interpreting bytecode and interprets the invocation of a 
native method, it somehow needs to call a Emscripten-compiled 
JavaScript/asm.js function dynamically by name and signature (which is 
given as a string).

Cheers,
Kai

Am Freitag, 28. August 2015 18:21:25 UTC+2 schrieb キャロウ マーク:
>
>
> > On Aug 26, 2015, at 5:22 PM, Alon Zakai <[email protected] <javascript:>> 
> wrote: 
> > 
> > Why not use dlsym? 
>
> A more fundamental question is why do you want to call Emscripten-compiled 
> Javascript functions via JNI? Why not just use native code? Just curious. 
>
> I can see possible reasons why you may want to call functions in the 
> browser that only exist as Javascript but, if that is even possible, it 
> would have nothing to do with Emscripten dynamic library support. 
>
> Regards 
>
>     -Mark

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to