Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file types.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385exceptionTrapofstring(** Structure *)(** Types *)typenonrecnum_type=|I32|I64|F32|F64typenonrecref_type=|Func_ref|Extern_reftypenonrecval_type=|Num_typeofnum_type|Ref_typeofref_typetypenonrecparam=stringoption*val_typetypenonrecparam_type=paramlisttypenonrecresult_=val_typetypenonrecresult_type=result_listtypenonrecfunc_type=param_type*result_typetypenonreclimits={min:int;max:intoption}typenonrecmem_type=limitstypenonrectable_type=limits*ref_typetypenonrecmut=|Const|Vartypenonrecglobal_type=mut*val_typetypenonrecextern_type=|Funcofstringoption*func_type|Tableofstringoption*table_type|Memofstringoption*mem_type|Globalofstringoption*global_type(** Instructions *)typenonrecnn=|S32|S64typenonrecsx=|U|Stypenonreciunop=|Clz|Ctz|Popcnttypenonrecfunop=|Abs|Neg|Sqrt|Ceil|Floor|Trunc|Nearesttypenonrecibinop=|Add|Sub|Mul|Divofsx|Remofsx|And|Or|Xor|Shl|Shrofsx|Rotl|Rotrtypenonrecfbinop=|Add|Sub|Mul|Div|Min|Max|Copysigntypenonrecitestop=Eqztypenonrecirelop=|Eq|Ne|Ltofsx|Gtofsx|Leofsx|Geofsxtypenonrecfrelop=|Eq|Ne|Lt|Gt|Le|Getypeindice=|Rawofint|Symbolicofstringtypememarg={offset:int;align:int}type'indiceblock_type=|Bt_indof'indice|Bt_rawof('indiceoption*func_type)(* the indice option is the optional typeuse, if it's some it must be equal to the func_type *)type('indice,'bt)instr'=(* { desc : instr_desc
; loc : Lexing.position
}
and instr_desc =*)(* Numeric Instructions *)|I32_constofInt32.t|I64_constofInt64.t|F32_constofFloat32.t|F64_constofFloat64.t|I_unopofnn*iunop|F_unopofnn*funop|I_binopofnn*ibinop|F_binopofnn*fbinop|I_testopofnn*itestop|I_relopofnn*irelop|F_relopofnn*frelop|I_extend8_sofnn|I_extend16_sofnn|I64_extend32_s|I32_wrap_i64|I64_extend_i32ofsx|I_trunc_fofnn*nn*sx|I_trunc_sat_fofnn*nn*sx|F32_demote_f64|F64_promote_f32|F_convert_iofnn*nn*sx|I_reinterpret_fofnn*nn|F_reinterpret_iofnn*nn(* Reference instructions *)|Ref_nullofref_type|Ref_is_null|Ref_funcof'indice(* Parametric instructions *)|Drop|Selectofval_typelistoption(* Variable instructions *)|Local_getof'indice|Local_setof'indice|Local_teeof'indice|Global_getof'indice|Global_setof'indice(* Table instructions *)|Table_getof'indice|Table_setof'indice|Table_sizeof'indice|Table_growof'indice|Table_fillof'indice|Table_copyof'indice*'indice|Table_initof'indice*'indice|Elem_dropof'indice(* Memory instructions *)|I_loadofnn*memarg|F_loadofnn*memarg|I_storeofnn*memarg|F_storeofnn*memarg|I_load8ofnn*sx*memarg|I_load16ofnn*sx*memarg|I64_load32ofsx*memarg|I_store8ofnn*memarg|I_store16ofnn*memarg|I64_store32ofmemarg|Memory_size|Memory_grow|Memory_fill|Memory_copy|Memory_initof'indice|Data_dropof'indice(* Control instructions *)|Nop|Unreachable|Blockofstringoption*'btoption*('indice,'bt)expr'|Loopofstringoption*'btoption*('indice,'bt)expr'|If_elseofstringoption*'btoption*('indice,'bt)expr'*('indice,'bt)expr'|Brof'indice|Br_ifof'indice|Br_tableof'indicearray*'indice|Return|Callof'indice|Call_indirectof'indice*'btand('indice,'bt)expr'=('indice,'bt)instr'listtypeinstr=(indice,indiceblock_type)instr'typesimplified_instr=(int,intblock_type)instr'typeexpr=(indice,indiceblock_type)expr'typesimplified_expr=(int,intblock_type)expr'typeresult_expr=(int,func_type)expr'(* TODO: func and expr should also be parametrised on block type:
using block_type before simplify and directly an indice after *)type('indice,'bt)func'={type_f:'bt;locals:paramlist;body:('indice,'bt)expr';id:stringoption}type'indicefunc=('indice,'indiceblock_type)func'(* Tables & Memories *)typetable=stringoption*table_typetypemem=stringoption*mem_typetype'exprglobal'={type_:global_type;init:'expr;id:stringoption}typeglobal=(indice,indiceblock_type)expr'global'type('indice,'expr)elem_mode=|Elem_passive|Elem_activeof'indice*'expr|Elem_declarativetype('indice,'expr)elem'={id:stringoption;type_:ref_type;init:'exprlist;mode:('indice,'expr)elem_mode}typeelem=(indiceoption,(indice,indiceblock_type)expr')elem'type('indice,'expr)data_mode=|Data_passive|Data_activeof'indice*'exprtype('indice,'expr)data'={id:stringoption;init:string;mode:('indice,'expr)data_mode}typedata=(indiceoption,(indice,indiceblock_type)expr')data'(* Modules *)typeimport_desc=|Import_funcofstringoption*indiceblock_type|Import_tableofstringoption*table_type|Import_memofstringoption*mem_type|Import_globalofstringoption*global_typetypeimport={module_:string;name:string;desc:import_desc}type'indiceexport_desc'=|Export_funcof'indiceoption|Export_tableof'indiceoption|Export_memof'indiceoption|Export_globalof'indiceoptiontypeexport_desc=indiceexport_desc'type'indiceexport'={name:string;desc:'indiceexport_desc'}typeexport=indiceexport'typetype_=stringoption*func_typetypemodule_field=|MTypeoftype_|MGlobalofglobal|MTableoftable|MMemofmem|MFuncofindicefunc|MElemofelem|MDataofdata|MStartofindice|MImportofimport|MExportofexporttypemodule_={id:stringoption;fields:module_fieldlist}typeconst=|Const_I32ofInt32.t|Const_I64ofInt64.t|Const_F32ofFloat32.t|Const_F64ofFloat64.t|Const_nullofref_type|Const_hostofinttypeaction=|Invokeofstringoption*string*constlist|Getofstringoption*stringtyperesult_const=|Literalofconst|Nan_canonofnn|Nan_arithofnntyperesult=|Result_constofresult_const|Result_extern_ref|Result_func_reftypeassert_=|Assert_returnofaction*resultlist|Assert_trapofaction*string|Assert_trap_moduleofmodule_*string|Assert_malformedofmodule_*string|Assert_malformed_quoteofstringlist*string|Assert_malformed_binaryofstringlist*string|Assert_invalidofmodule_*string|Assert_invalid_quoteofstringlist*string|Assert_invalid_binaryofstringlist*string|Assert_exhaustionofaction*string|Assert_unlinkableofmodule_*stringtypecmd=|Moduleofmodule_|Assertofassert_|Registerofstring*stringoption|Actionofactiontypescript=cmdlistmoduleConst=structtypenonrecibinop=|Add|Sub|Multypeinstr=|I32_constofInt32.t|I64_constofInt64.t|F32_constofFloat32.t|F64_constofFloat64.t|Ref_nullofref_type|Ref_funcofint|Global_getofint|I_binopofnn*ibinoptypeexpr=instrlistend