Re: [v8-users] WASM not working on Android (embedded)

2020-02-21 Thread Darin Dimitrov
I managed to resolve this by replacing the global.WebAssembly object with a Proxy which intercepts the "compile" and "instantiate" methods. When one of those methods is called I start a background thread which is polling the main looper at regular intervals, pumps the message loop and executes a

Re: [v8-users] WASM not working on Android (embedded)

2020-01-18 Thread ibon
Hi Darin, I do embed v8 on android on a regular basis. Unlike you, I run v8 bound to gl thread, and as a rule of thumb for performance reasons always on a different than the main thread. I need to, at least, run `v8::platform::PumpMessageLoop(&platform, isolate_);` to have promises executed. I

Re: [v8-users] WASM not working on Android (embedded)

2020-01-17 Thread Darin Dimitrov
Thanks Clemens. I would be very happy if someone more familiar could provide some insight. Any pointers in the Google Chrome source code for Android would also be helpful. I suppose they have already faced this problem and implemented it properly. On Thursday, January 16, 2020 at 3:41:22 PM U

Re: [v8-users] WASM not working on Android (embedded)

2020-01-16 Thread Clemens Backes
On Thu, Jan 16, 2020 at 2:23 PM Darin Dimitrov wrote: > Thanks Clemens. > > This works fine but it blocks the main thread. What would be the best > approach to handle this in an Android app? Would writing a custom platform > help in this case? > I don't know about Android development, and I am n

Re: [v8-users] WASM not working on Android (embedded)

2020-01-16 Thread Darin Dimitrov
Thanks Clemens. This works fine but it blocks the main thread. What would be the best approach to handle this in an Android app? Would writing a custom platform help in this case? On Wednesday, January 15, 2020 at 5:12:39 PM UTC+2, Clemens Hammacher wrote: > > Hi Darin, > > WebAssembly.instan

Re: [v8-users] WASM not working on Android (embedded)

2020-01-15 Thread Clemens Backes
Hi Darin, WebAssembly.instantiate works asynchronously, so you have to keep your program running for a while to wait for the asynchronous result, and keep pumping the message loop and running microtasks to actually execute the compilation tasks and promise resolution tasks that get added from the

[v8-users] WASM not working on Android (embedded)

2020-01-15 Thread Darin Dimitrov
I have embedded V8 (7.8.279.19) inside my Android application and tried executing a script that compiles a WebAssembly module. Unfortunately the promise returned by the "WebAssembly.compile" method is never completed (neither the "then" or the "catch" methods are invoked). The same happens with