2019-11-11 14:13:20 +00:00
|
|
|
// Copyright 2019 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
extern class WasmInstanceObject extends JSObject;
|
|
|
|
|
|
|
|
extern class WasmExportedFunctionData extends Struct {
|
|
|
|
wrapper_code: Code;
|
|
|
|
instance: WasmInstanceObject;
|
|
|
|
jump_table_offset: Smi;
|
|
|
|
function_index: Smi;
|
|
|
|
// The remaining fields are for fast calling from C++. The contract is
|
|
|
|
// that they are lazily populated, and either all will be present or none.
|
|
|
|
c_wrapper_code: Object;
|
|
|
|
wasm_call_target: Smi|Foreign;
|
|
|
|
packed_args_size: Smi;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern class WasmJSFunctionData extends Struct {
|
|
|
|
callable: JSReceiver;
|
|
|
|
wrapper_code: Code;
|
|
|
|
serialized_return_count: Smi;
|
|
|
|
serialized_parameter_count: Smi;
|
|
|
|
serialized_signature: ByteArray; // PodArray<wasm::ValueType>
|
|
|
|
}
|
|
|
|
|
|
|
|
extern class WasmCapiFunctionData extends Struct {
|
|
|
|
call_target: RawPtr;
|
|
|
|
embedder_data: Foreign; // Managed<wasm::FuncData>
|
|
|
|
wrapper_code: Code;
|
|
|
|
serialized_signature: ByteArray; // PodArray<wasm::ValueType>
|
|
|
|
}
|
|
|
|
|
|
|
|
extern class WasmIndirectFunctionTable extends Struct {
|
|
|
|
size: uint32;
|
|
|
|
@if(TAGGED_SIZE_8_BYTES) optional_padding: uint32;
|
|
|
|
@ifnot(TAGGED_SIZE_8_BYTES) optional_padding: void;
|
|
|
|
sig_ids: RawPtr;
|
|
|
|
targets: RawPtr;
|
|
|
|
managed_native_allocations: Foreign|Undefined;
|
|
|
|
refs: FixedArray;
|
|
|
|
}
|
|
|
|
|
|
|
|
@generateCppClass
|
|
|
|
extern class WasmExceptionTag extends Struct {
|
2020-03-17 17:14:51 +00:00
|
|
|
// Note that this index is only useful for debugging purposes and it is not
|
|
|
|
// unique across modules. The GC however does not allow objects without at
|
|
|
|
// least one field, hence this also serves as a padding field for now.
|
2019-11-11 14:13:20 +00:00
|
|
|
index: Smi;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern class WasmModuleObject extends JSObject {
|
|
|
|
native_module: Foreign;
|
|
|
|
export_wrappers: FixedArray;
|
|
|
|
script: Script;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern class WasmTableObject extends JSObject {
|
|
|
|
entries: FixedArray;
|
2019-11-27 11:58:26 +00:00
|
|
|
current_length: Smi;
|
2019-11-11 14:13:20 +00:00
|
|
|
maximum_length: Smi|HeapNumber|Undefined;
|
|
|
|
dispatch_tables: FixedArray;
|
|
|
|
raw_type: Smi;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern class WasmMemoryObject extends JSObject {
|
|
|
|
array_buffer: JSArrayBuffer;
|
|
|
|
maximum_pages: Smi;
|
|
|
|
instances: WeakArrayList|Undefined;
|
|
|
|
}
|
|
|
|
|
2020-03-12 14:29:51 +00:00
|
|
|
type WasmValueType extends uint8 constexpr 'wasm::ValueType::Kind';
|
2020-02-26 20:12:38 +00:00
|
|
|
bitfield struct WasmGlobalObjectFlags extends uint31 {
|
|
|
|
Type: WasmValueType: 8 bit; // "type" is a reserved word.
|
|
|
|
is_mutable: bool: 1 bit;
|
|
|
|
}
|
|
|
|
|
2019-11-11 14:13:20 +00:00
|
|
|
extern class WasmGlobalObject extends JSObject {
|
|
|
|
untagged_buffer: JSArrayBuffer|Undefined;
|
|
|
|
tagged_buffer: FixedArray|Undefined;
|
|
|
|
offset: Smi;
|
2020-02-26 20:12:38 +00:00
|
|
|
flags: SmiTagged<WasmGlobalObjectFlags>;
|
2019-11-11 14:13:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extern class WasmExceptionObject extends JSObject {
|
|
|
|
serialized_signature: ByteArray; // PodArray<wasm::ValueType>
|
|
|
|
exception_tag: HeapObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
type WasmExportedFunction extends JSFunction;
|
|
|
|
|
|
|
|
extern class AsmWasmData extends Struct {
|
|
|
|
managed_native_module: Foreign; // Managed<wasm::NativeModule>
|
|
|
|
export_wrappers: FixedArray;
|
|
|
|
uses_bitset: HeapNumber;
|
|
|
|
}
|
2020-04-21 10:30:18 +00:00
|
|
|
|
|
|
|
@generateCppClass
|
|
|
|
extern class WasmStruct extends HeapObject {
|
|
|
|
}
|
2020-05-07 14:55:58 +00:00
|
|
|
|
|
|
|
@generateCppClass
|
|
|
|
extern class WasmArray extends HeapObject {
|
|
|
|
length: uint32;
|
|
|
|
|
|
|
|
@if(TAGGED_SIZE_8_BYTES) optional_padding: uint32;
|
|
|
|
@ifnot(TAGGED_SIZE_8_BYTES) optional_padding: void;
|
|
|
|
}
|