-
Notifications
You must be signed in to change notification settings - Fork 744
Implement GC basics #2607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement GC basics #2607
Conversation
Support named references for globals, locals, tables, elems Support named references for call_ref, ref_null Extend Var variables with an optional type field
243ec44
to
68fe37e
Compare
struct TypeMut { | ||
Type type; | ||
bool mutable_; | ||
}; | ||
using TypeMutVector = std::vector<TypeMut>; | ||
|
||
// Garbage Collector specific type information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a core part of the patch. It contains the (sub ...)
part of the type. It is declared as a structure, because it is not mandatory.
include/wabt/binary-reader.h
Outdated
virtual Result OnFuncType(Index index, | ||
GCTypeExtension* gc_ext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This structure is passed as a second argument, because it is a header, but it could go to the last argument since it is an extra (and optional) information. Which one you prefer?
struct RecursiveRange { | ||
Index start_index; | ||
Index type_count; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another core structure to encode (rec ...)
constructs. It represents the range.
include/wabt/type-checker.h
Outdated
std::vector<FuncType> func_types; | ||
std::vector<StructType> struct_types; | ||
std::vector<ArrayType> array_types; | ||
std::vector<RecursiveRange> recursive_ranges; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is stored in an ordered array. It cannot be stored as part of the types, because zero length (rec)
range is allowed for whatever reason.
5ddddbc
to
0de3728
Compare
Parsing / reading / writing of core structures (rec/sub) is mostly completed, validation is far from over