Skip to content

Commit

Permalink
README update for mutable globals issue #16
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed Jul 20, 2018
1 parent e936457 commit dd33676
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,16 @@ In the WebAssembly MVP a table is just a set of function pointers. This is store

#### Globals

Globals are stored as fields on the class. A non-import global is simply a field, but an import global is a
`MethodHandle` to the getter (and would be a `MethodHandle` to the setter if mutable globals were supported). Any values
for the globals are set in the constructor.
Globals are stored as fields on the class. A non-import global is simply a field that is final if not mutable. An import
global is a `MethodHandle` to the getter and a `MethodHandle` to the setter if mutable. Any values for the globals are
set in the constructor.

#### Imports

The constructor accepts all imports as params. Memory is imported via a `ByteBuffer` param, then function
imports as `MethodHandle` params, then global imports as `MethodHandle` params, then a `MethodHandle` array param for an
imported table. All of these values are set as fields in the constructor.
imports as `MethodHandle` params, then global imports as `MethodHandle` params (one for getter and another for setter if
mutable), then a `MethodHandle` array param for an imported table. All of these values are set as fields in the
constructor.

#### Exports

Expand Down

0 comments on commit dd33676

Please sign in to comment.