Re: [v8-dev] Sharing Memory between Host and WebAssembly Module

2020-01-16 Thread Immanuel Haffner
What I am working on is (a) a research project and (b) the programs are all trust-worthy and harmless. Patching V8 sounds like an option. I would highly appreciate some guidance where to start. I am only superficially familiar with the public API yet. -- -- v8-dev mailing list

Re: [v8-dev] Sharing Memory between Host and WebAssembly Module

2020-01-16 Thread Clemens Backes
One quick and dirty way to do this would be: 1. If you need to catch memory out-of-bounds errors, disable the --wasm-trap-handler flag (in flag-definitions.h ), because there will

Re: [v8-dev] Sharing Memory between Host and WebAssembly Module

2020-01-16 Thread Immanuel Haffner
@Clements Regarding point 2, WasmInstanceObject::SetRawMemory() seems to to exactly what I want, right? How can I access this, given a v8::Object of a WebAssembly.Instance ? -- -- v8-dev mailing

Re: [v8-dev] Sharing Memory between Host and WebAssembly Module

2020-01-16 Thread Clemens Backes
Ack, SetRawMemory does exactly the right thing. If you add an API method that takes a Local (holding the wasm instance), you can implement that in api.cc via something like: i::Handle obj = Utils::OpenHandle(this); i::WasmInstanceObject::cast(*obj)->SetRawMemory(...); On Thu, Jan 16, 2020

Re: [v8-dev] Sharing Memory between Host and WebAssembly Module

2020-01-16 Thread Immanuel Haffner
@Clemens That sounds doable. I will try this! @Ben Thanks, I thought about that already but I don't know whether that would work so easily. If i remap the memory, would a WASM load at address 0 really load from the remapped memory at offset 0? I will keep this in mind as a last resort :D --

Re: [v8-dev] Sharing Memory between Host and WebAssembly Module

2020-01-16 Thread Ben Noordhuis
On Wed, Jan 15, 2020 at 5:05 PM Immanuel Haffner wrote: > To make my scenario more concrete: > I habe data in main memory, easily tens or hundreds of gigabytes. Programs > fly in requiring to access the data. Some programs are short-lived, some will > take a long time to compute. Some programs