Re: Questions about runtime structure "store"

What Derek said. In addition, the store _does_ in fact surface in the proposed C API for embedders, where it essentially represents an isolated instance of the Wasm VM:

  https://github.com/WebAssembly/wasm-c-api/blob/master/include/wasm.hh#L233

As you can see, a store needs to be passed to all functions in the API that allocate something, but it is otherwise an abstract object.

/Andreas


> From: Derek Schuff <dschuff@google.com>
> 
> Hi Rui,
> This is the kind of question that would be great to ask as a
> discussion on the spec repo
> (https://github.com/WebAssembly/spec/discussions), since this mailing
> list is very large and doesn't get a lot of traffic. But the short
> answer is that the store is mostly just an abstraction for
> specification purposes. Most implementations do not have a single
> concrete thing that corresponds to the store. Each of those elements
> have individual instructions (or host/embedding functions) that access
> it, e.g. loads/stores for memory, global.get/set, table.get/set or
> indirect calls, etc, as well as being initialized during
> instantiation.
> -Derek
> 
> 
> On Fri, Apr 15, 2022 at 7:33 AM Rain Wang <rainwang6188@gmail.com> wrote:
>> 
>> Hi, I'm a student from ZJU, and interested in the WASM..
>> 
>> I'm new to this area and currently working on a project which aims to verify the correctness of WASM Virtual Machines, to it's important to access the running state of a WASM program.
>> 
>> I've read the spec and find that there's a runtime structure named `store` which represents all global state that can be manipulated by WebAssembly programs. It consists of the runtime representation of all instances of functions, tables, memories, and globals, element segments, and data segments that have been allocated during the life time of the abstract machine.
>> 
>> But I found no relevant instructions that can access this structure. So does that mean `store` is just a concept which is not implemented yet?
>> 
>> Best,
>> Rui Wang

Received on Saturday, 16 April 2022 10:43:39 UTC