mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
Change TypeLookup values from simple index (usize) to a TypeMeta
TypeMeta constains the index and the subtype. This allows retrieving the subtype based on the actual value being bound, as opposed to the struct type. (I.e. it returns the correct subtype when a Zig class is a proxy for another using the Self declaration). Internally store the subtype as an enum. Reduces @sizeOf(TaggedAnyOpaque) from 32 to 16. Finally, sub_type renamed to subtype for consistency with v8.
This commit is contained in:
20
src/runtime/subtype.zig
Normal file
20
src/runtime/subtype.zig
Normal file
@@ -0,0 +1,20 @@
|
||||
pub const SubType = enum {
|
||||
@"error",
|
||||
array,
|
||||
arraybuffer,
|
||||
dataview,
|
||||
date,
|
||||
generator,
|
||||
iterator,
|
||||
map,
|
||||
node,
|
||||
promise,
|
||||
proxy,
|
||||
regexp,
|
||||
set,
|
||||
typedarray,
|
||||
wasmvalue,
|
||||
weakmap,
|
||||
weakset,
|
||||
webassemblymemory,
|
||||
};
|
||||
Reference in New Issue
Block a user