-
Notifications
You must be signed in to change notification settings - Fork 1
/
w3Frame.h
41 lines (35 loc) · 1.06 KB
/
w3Frame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// A WebAssembly codebase by Jay Krell
//
// https://webassembly.github.io/spec/core/binary/index.html
// https://webassembly.github.io/spec/core/_download/WebAssembly.pdf
#pragma once
struct w3ModuleInstance;
struct w3Module;
struct w3Interp;
struct w3StackValue;
struct w3Code;
struct w3Frame
{
// FUTURE spec return_arity
size_t function_index; // replace with pointer?
w3ModuleInstance* module_instance;
w3Module* module;
// w3Frame* next; // TODO remove this; it is on stack
w3Code* code;
size_t param_count;
size_t local_only_count;
size_t param_and_local_count;
w3Tag* local_only_types;
w3Tag* param_types;
w3FunctionType* function_type;
// TODO locals/params
// This should just be stack pointer, to another stack,
// along with type information (module->module->locals_types[])
w3Interp* interp;
size_t locals; // index in stack to start of params and locals, params first
w3Frame ()
{
ZeroMem(this, sizeof(*this));
}
w3StackValue& Local (size_t index);
};