dowdiness/js_engine/interpreter/runtime does not have a README file
pub(open) trait ExecutorActivationFrame {
fn step(Self, Interpreter) -> ExecutorActivationStep raise
fn deliver_activation_completion(Self, ExecutorActivationCompletion) -> Unit raise
}pub(open) trait ExecutorCode {
fn start(Self, Interpreter, PreparedExecutorActivation) -> &ExecutorActivationFrame raise
}pub(all) struct ArrayData {
elements : Array[Value]
bag : PropertyBag
length_writable : Bool
holes : Map[Int, Unit]
extensible : Bool
}pub(all) struct Binding {
value : Value
kind : BindingKind
initialized : Bool
annex_b_hoisted : Bool
is_parameter : Bool
}pub(all) enum BuiltinCtorPrototypeInstall {
FrozenAtInstall
PreBagged
AssignAtInstall
}pub(all) enum Callable {
UserFunc(FuncData)
ArrowFunc(FuncData)
UserFuncExt(FuncDataExt)
ArrowFuncExt(FuncDataExt)
NativeCallable(String, (Array[Value]) -> Value raise)
NativeCallableWithContext(String, (CallContext, Array[Value]) -> Value raise)
NonConstructableCallable(String, (Array[Value]) -> Value raise)
BoundFunc(Value, Value, Array[Value])
FuncCallMethod(Value)
FuncApplyMethod(Value)
MethodCallable(String, (Value, Array[Value]) -> Value raise)
InterpreterCallable(String, (Interpreter, Value, Array[Value]) -> Value raise)
InterpreterCallableWithContext(String, (Interpreter, CallContext, Value, Array[Value]) -> Value raise)
ExecutorCallable(ExecutorCallableData)
NonConstructableInterpreterCallable(String, (Interpreter, Array[Value]) -> Value raise)
ConstructorOnlyCallable(String, (Interpreter, Array[Value]) -> Value raise)
ClassConstructor(ClassConstructorData)
}pub(all) struct ClassConstructorData {
name : String
proto : Value
super_ctor : Value?
ctor_fn : (Array[Param], String?, Array[Stmt])?
closure : Environment
super_proto : Value
instance_fields : Array[ClassFieldInit]
private_instance_fields : Array[ClassFieldInit]
source_text : String?
private_brand : Value
private_methods : Map[String, Value]
}pub(all) struct Environment {
bindings : Map[String, Binding]
parent : Environment?
is_var_scope : Bool
with_object : Value?
realm_state : RealmState?
interpreter_context : Interpreter?
error_class_names : Map[String, Unit]
markers : Map[String, Bool]
}fn Environment::def(self : Environment, name : String, value : Value, kind : BindingKind) -> Unit raisepub(all) struct ExecutionPolicy {
// private fields
}fn ExecutionPolicy::new(step_budget : Int64, stack_depth_limit : Int64, interruption : InterruptionHandle) -> Result[ExecutionPolicy, ExecutionPolicyError]pub(all) struct ExecutionPolicyError {
// private fields
}pub enum ExecutorActivationCompletion {
ExecutorActivationCompletionNormal(Value)
ExecutorActivationCompletionAbrupt(Error)
}pub enum ExecutorActivationStep {
ExecutorActivationContinue
ExecutorActivationNormal(Value)
ExecutorActivationReturn(Value)
ExecutorActivationCall(ExecutorCallRequest)
ExecutorActivationConstruct(ExecutorConstructRequest)
ExecutorActivationPropertyGet(ExecutorPropertyGetRequest)
}pub struct ExecutorCallableData {
// private fields
}fn ExecutorCallableData::start_frame(self : ExecutorCallableData, interp : Interpreter, prepared : PreparedExecutorActivation) -> &ExecutorActivationFrame raisepub(all) struct FuncData {
name : String?
params : Array[String]
body : Array[Stmt]
closure : Environment
strict : Bool
has_name_binding : Bool
is_method : Bool
source_text : String?
}pub(all) struct FuncDataExt {
name : String?
params : Array[Param]
rest_param : String?
body : Array[Stmt]
closure : Environment
strict : Bool
has_name_binding : Bool
is_method : Bool
source_text : String?
}fn FunctionRealmProtos::FunctionRealmProtos(function_proto? : Value?, object_proto? : Value?, string_proto? : Value?, number_proto? : Value?, boolean_proto? : Value?, symbol_proto? : Value?, array_proto? : Value?, map_proto? : Value?, set_proto? : Value?, promise_proto? : Value?, constructor_prototype_registry? : Value?) -> FunctionRealmProtospub(all) enum GenState {
SuspendedStart
Executing
SuspendedYield
Completed
}pub(all) struct GeneratorObject {
id : Int
state : GenState
body : Array[Stmt]
strict : Bool
params : Array[String]
params_ext : Array[Param]?
rest_param : String?
closure : Environment
is_async : Bool
name : String?
interpreter : Interpreter
args : Array[Value]
this_val : Value
env : Environment?
pc : Int
yield_value : Value
resuming : Bool
resume_action : ResumeAction
try_resume_phase : Int
try_resume_yield_base : Int
try_resume_error : Value
try_resume_result : Signal
try_resume_pending_error : Error?
loop_env_stack : Array[Environment]
loop_yield_base_stack : Array[Int]
stmt_resume_index_stack : Array[Int]
stmt_resume_env_stack : Array[Environment]
stmt_resume_value_stack : Array[Value]
for_of_iterator : Value
for_of_next : Value
for_of_iterator_stack : Array[Value]
for_of_next_stack : Array[Value]
for_of_resume : Bool
for_of_awaiting_next : Bool
dstr_iterator_stack : Array[Value]
delegate_iterator : Value
delegate_next : Value
delegating : Bool
yield_index : Int
resume_at_yield : Int
yield_resume_values : Map[Int, Value]
}pub(all) struct HostEnv {
output : Array[String]
microtask_queue : Array[Microtask]
timer_queue : PriorityQueue[TimerTask]
timer_id_counter : Ref[Int]
timer_insertion_counter : Ref[Int]
cancelled_timer_ids : Map[Int, Bool]
module_loader : ModuleLoader?
}pub(all) enum InternalSlotKey {
StringData
NumberData
BooleanData
SymbolData
PrimitiveValue
ArrayLength
TypedArrayName
ViewedArrayBuffer
ArrayBufferID
ByteOffset
ByteLength
ArrayBufferByteLength
DateValue
ExportName
NamespaceObject
ExportValue
SyncIterator
SyncNextMethod
SourceText
PrivateBrandStore
} derive(Eq, Hash, Debug)pub(all) struct Interpreter {
host : HostEnv
global : Environment
global_this : Value
annex_b : Bool
realm_state : RealmState
module_registry : Map[String, Map[String, Value]]
module_exports : Map[String, Value]
module_export_bindings : Array[(String, String)]
generator_objects : Map[Int, GeneratorObject]
gen_id_counter : Ref[Int]
symbols : SymbolState
stdlib_hooks : StdlibHooks
in_nonarrow_param_default_eval : Bool
param_default_eval_var_conflicts : Set[String]?
}fn Interpreter::array_define_own_property(self : Interpreter, arr : ArrayData, key : Value, partial : PartialDescriptor, loc : Loc) -> Bool raisefn Interpreter::array_set_length(self : Interpreter, arr : ArrayData, partial : PartialDescriptor) -> Bool raisefn Interpreter::assign_compiled_name(self : Interpreter, ctx : ExecContext, env : Environment, name : String, value : Value) -> Value raisefn Interpreter::call_direct_eval_or_shadowed(self : Interpreter, callee : Value, args : Array[Value], env : Environment, loc : Loc, caller_strict~ : Bool) -> Value raisefn Interpreter::call_value(self : Interpreter, callee : Value, this_val : Value, args : Array[Value], loc : Loc) -> Value raisefn Interpreter::construct_value(self : Interpreter, ctor : Value, args : Array[Value], loc : Loc, proto_override? : Value?, new_target? : Value?) -> Value raisefn Interpreter::copy_object_spread_properties(self : Interpreter, target : Value, source : Value, loc : Loc) -> Unit raisefn Interpreter::define_compiled_binding(self : Interpreter, env : Environment, kind : VarKind, name : String, value : Value, has_initializer : Bool) -> Unit raisefn Interpreter::define_own_property(self : Interpreter, val : Value, key : Value, partial : PartialDescriptor, loc : Loc) -> Bool raisefn Interpreter::define_simple_arguments_object(self : Interpreter, env : Environment, args : Array[Value], callee : Value, strict : Bool, params : Array[String]) -> Unit raisefn Interpreter::define_unmapped_arguments_object(self : Interpreter, env : Environment, args : Array[Value], callee : Value, strict : Bool) -> Unit raisefn Interpreter::delete_property_key(self : Interpreter, obj : Value, key : Value, strict? : Bool) -> Bool raisefn Interpreter::enqueue_microtask(self : Interpreter, callback : Value, args : Array[Value]) -> Unitfn Interpreter::eval_destructure_assign(self : Interpreter, ctx : ExecContext, pattern : Pattern, value : Value, env : Environment) -> Value raisefn Interpreter::eval_super_computed_call_reference(self : Interpreter, env : Environment, key : Value, loc : Loc) -> (Value, Value) raisefn Interpreter::eval_super_computed_property(self : Interpreter, env : Environment, key : Value, loc : Loc) -> Value raisefn Interpreter::eval_super_property(self : Interpreter, env : Environment, prop : String, loc : Loc) -> Value raisefn Interpreter::eval_super_property_call_reference(self : Interpreter, env : Environment, prop : String, loc : Loc) -> (Value, Value) raisefn Interpreter::eval_update_computed_property(self : Interpreter, ctx : ExecContext, obj : Value, key : Value, op : UpdateOp, prefix : Bool, member_loc : Loc, loc : Loc) -> Value raisefn Interpreter::eval_update_property(self : Interpreter, ctx : ExecContext, obj : Value, prop : String, op : UpdateOp, prefix : Bool, member_loc : Loc, loc : Loc) -> Value raisefn Interpreter::get_cached_tagged_template_object(self : Interpreter, key : String, quasis : Array[(String, String?)]) -> Valuefn Interpreter::get_compiled_name(self : Interpreter, env : Environment, name : String) -> Value raisefn Interpreter::get_computed_property(self : Interpreter, obj : Value, key : Value, loc : Loc) -> Value raisefn Interpreter::get_iterator_next_method(self : Interpreter, iterator : Value, loc : Loc) -> Value raisefn Interpreter::get_own_property(self : Interpreter, val : Value, key : Value) -> (PropDescriptor, Value)? raisefn Interpreter::get_property(self : Interpreter, obj : Value, prop : String, loc : Loc) -> Value raisefn Interpreter::get_property_key_with_receiver(self : Interpreter, target : Value, key : Value, receiver : Value, loc : Loc) -> Value raisefn Interpreter::get_prototype_from_constructor(self : Interpreter, ctor : Value, loc : Loc) -> Value raisefn Interpreter::iterator_result_value(self : Interpreter, iter_result : Value, loc : Loc) -> Value raisefn Interpreter::iterator_step_result(self : Interpreter, iterator : Value, next_method : Value, loc : Loc) -> Value? raisefn Interpreter::iterator_step_value(self : Interpreter, iterator : Value, next_method : Value, loc : Loc) -> Value? raisefn Interpreter::new(annex_b? : Bool, module_loader? : ModuleLoader?, setup_builtins? : (Environment, Array[String], RealmState, Bool) -> Unit, setup_harness? : (Environment, Array[String], Value) -> Unit, stdlib_hooks? : StdlibHooks) -> Interpreterfn Interpreter::ordinary_define_own_property(self : Interpreter, val : Value, key : Value, partial : PartialDescriptor, loc : Loc) -> Bool raisefn Interpreter::partial_descriptor_from_attrs(self : Interpreter, attrs : Value, loc : Loc) -> PartialDescriptor raisefn Interpreter::perform_eval(self : Interpreter, code : String, caller_env : Environment, direct : Bool, caller_strict? : Bool) -> Value raisefn Interpreter::prepare_executor_callable_call(self : Interpreter, executable : ExecutorCallableData, callee : Value, this_value : Value, args : Array[Value]) -> PreparedExecutorActivation raisefn Interpreter::register_module(self : Interpreter, specifier : String, exports : Map[String, Value]) -> Unitfn Interpreter::run_bounded(self : Interpreter, stmts : Array[Stmt], policy : ExecutionPolicy) -> Value raisefn Interpreter::run_compiled_script(self : Interpreter, stmts : Array[Stmt], eval : (ExecContext, Environment) -> Value raise) -> Value raisefn Interpreter::run_executor_activation_coordinator(self : Interpreter, root : &ExecutorActivationFrame) -> ExecutorActivationStep raisefn Interpreter::run_microtasks_observed(self : Interpreter) -> Result[Unit, MicrotaskRunFailure] raisefn Interpreter::run_modules(self : Interpreter, modules : Array[(String, String)]) -> Map[String, Value] raisefn Interpreter::set_computed_property(self : Interpreter, obj : Value, key : Value, value : Value, loc : Loc, strict? : Bool, receiver? : Value) -> Value raisefn Interpreter::set_property(self : Interpreter, obj : Value, prop : String, value : Value, loc : Loc, strict? : Bool, receiver? : Value) -> Value raisefn Interpreter::to_primitive_default(self : Interpreter, obj_val : Value, data : ObjectData) -> Value raisefn Interpreter::typeof_compiled_name(self : Interpreter, ctx : ExecContext, env : Environment, name : String) -> Value raisefn Interpreter::update_compiled_name(self : Interpreter, ctx : ExecContext, env : Environment, name : String, op : UpdateOp, prefix : Bool, _loc : Loc) -> Value raisefn Interpreter::validate_block_early_errors(_self : Interpreter, stmts : Array[Stmt], strict_context : Bool) -> Unit raisefn[T] Interpreter::with_execution_policy(self : Interpreter, policy : ExecutionPolicy, action : () -> T raise) -> T raisepub(all) struct InterruptionHandle {
// private fields
}pub struct MicrotaskRunFailure {
cause_ : Error
source_identity_ : String?
}pub(all) struct ObjectData {
bag : PropertyBag
prototype : Value
callable : Callable?
class_name : String
extensible : Bool
arraybuffer_state : ArrayBufferState?
}pub(all) struct PromiseData {
state : PromiseState
result : Value
fulfill_reactions : Array[PromiseReaction]
reject_reactions : Array[PromiseReaction]
is_handled : Bool
bag : PropertyBag
extensible : Bool
prototype : Value?
}pub(all) struct PromiseReaction {
handler : Value?
resolve : Value
reject : Value
reaction_type : PromiseReactionType
}pub(all) enum PromiseState {
Pending
Fulfilled
Rejected
}pub(all) struct PropertyBag {
properties : Map[String, Value]
symbol_properties : Map[Int, Value]
descriptors : Map[String, PropDescriptor]
symbol_descriptors : Map[Int, PropDescriptor]
internal_slots : Map[InternalSlotKey, Value]
host_slots : Map[Int, Value]
}pub(all) struct RealmState {
symbols : SymbolState
well_known_symbols : WellKnownSymbols
runtime_iterator_prototypes : RuntimeIteratorPrototypeCaches
active_overrides : Ref[FunctionRealmProtos?]
active_source_identity : Ref[String?]
constructor_prototype_registry : Value
observing_source_failure : Ref[Bool]
observed_source_failure : Ref[Error?]
observed_source_identity : Ref[String?]
object_prototype : Ref[Value?]
function_prototype : Ref[Value?]
string_prototype : Ref[Value?]
number_prototype : Ref[Value?]
boolean_prototype : Ref[Value?]
symbol_prototype : Ref[Value?]
array_prototype : Ref[Value?]
map_prototype : Ref[Value?]
set_prototype : Ref[Value?]
regexp_prototype : Ref[Value?]
promise_prototype : Ref[Value?]
weakmap_prototype : Ref[Value?]
weakset_prototype : Ref[Value?]
arraybuffer_state : ArrayBufferState
arraybuffer_id_counter : Ref[Int]
arraybuffer_store : Map[Int, Array[Int]]
detached_buffers : Map[Int, Bool]
weakmap_id_counter : Ref[Int]
weakmap_storage : Map[Int, Array[(Value, Value)]]
weakmap_id_table : Array[(ObjectData, Int)]
weakset_id_counter : Ref[Int]
weakset_storage : Map[Int, Array[Value]]
weakset_id_table : Array[(ObjectData, Int)]
// private fields
}fn RealmState::register_constructor_prototype(self : RealmState, name : String, constructor_value : Value) -> Unitpub(all) struct RuntimeIteratorPrototypeCaches {
iterator_proto : Ref[Value?]
array_iterator_proto : Ref[Value?]
string_iterator_proto : Ref[Value?]
map_iterator_proto : Ref[Value?]
set_iterator_proto : Ref[Value?]
regexp_string_iterator_proto : Ref[Value?]
async_iterator_proto : Ref[Value?]
async_from_sync_iterator_proto : Ref[Value?]
}pub(all) struct SetData {
values : Array[Value]
tombstones : Set[Int]?
iteration_depth : Int
prototype : Value?
bag : PropertyBag
extensible : Bool
}pub struct SourceObservedFailure {
cause_ : Error
source_identity_ : String?
}pub(all) struct StdlibHooks {
get_string_method : (String, String, RealmState, Bool) -> Value
get_number_method : (Value, String, RealmState) -> Value
get_array_method_with_interp : (ArrayData, String, RealmState) -> Value
get_map_method : (MapData, String, RealmState) -> Value
get_set_method : (SetData, String, RealmState) -> Value
get_promise_method : (PromiseData, String, RealmState) -> Value
make_regexp_object : (RealmState, String, String) -> Value raise
typedarray_get_index : (ObjectData, Int, RealmState) -> Value
typedarray_set_index : (ObjectData, Int, Double, RealmState) -> Unit
typedarray_is_valid_index : (ObjectData, Int, RealmState) -> Bool
create_realm : () -> Interpreter
}pub(all) struct SymbolData {
id : Int
description : String?
}pub(all) struct SymbolState {
symbol_id_counter : Ref[Int]
all_symbols : Map[Int, SymbolData]
global_symbol_registry : Map[String, SymbolData]
symbol_registry_reverse : Map[Int, String]
well_known_symbols_cache : Ref[WellKnownSymbols?]
}pub struct TimerRunFailure {
cause_ : Error
phase_ : TimerRunFailurePhase
source_identity_ : String?
}pub enum TimerRunFailurePhase {
TimerQueueDispatch
TimerCallback
IntervalCallback
MicrotaskCheckpoint
}pub(all) enum Value {
Number(Double)
String_(String)
Bool(Bool)
Null
Undefined
Object(ObjectData)
Array(ArrayData)
Symbol(SymbolData)
Map(MapData)
Set(SetData)
Promise(PromiseData)
Proxy(ProxyData)
}pub(all) struct WellKnownSymbols {
iterator : SymbolData
async_iterator : SymbolData
has_instance : SymbolData
is_concat_spreadable : SymbolData
to_primitive : SymbolData
to_string_tag : SymbolData
match_sym : SymbolData
match_all : SymbolData
replace : SymbolData
search : SymbolData
species : SymbolData
split : SymbolData
unscopables : SymbolData
}fn create_data_property_or_throw(interp : Interpreter, target : Value, index : Int64, value : Value) -> Unit raisefn enqueue_promise_reaction_job(interp : Interpreter, reaction : PromiseReaction, argument : Value) -> Unitfn eval_delete_computed_property(interp : Interpreter, obj : Value, key : Value, strict : Bool) -> Value raisefn eval_delete_identifier(interp : Interpreter, ctx : ExecContext, env : Environment, name : String) -> Value raisefn eval_delete_property(interp : Interpreter, obj : Value, prop : String, strict : Bool) -> Value raisefn eval_unary_value_op(op : UnaryOp, value : Value, loc : Loc, interp? : Interpreter?) -> Value raisefn execution_control_failure_code(error : Error) -> String?fn executor_activation_construct(ctor : Value, args : Array[Value], loc : Loc) -> ExecutorActivationStepfn executor_activation_property_get(target : Value, property_name : String, loc : Loc) -> ExecutorActivationStepfn get_array_iterator_override(arr : ArrayData, well_known_symbols~ : WellKnownSymbols) -> (Value?, Value?)fn install_builtin_accessor(data : ObjectData, name : String, getter : Value?, setter : Value?) -> Unitfn install_realm_pinned_builtin_constructor(env : Environment, realm_proto_cache : Ref[Value?], ctor_name : String, ctor : Value, proto : Value, prototype_install? : BuiltinCtorPrototypeInstall, wire_proto_constructor? : Bool) -> Unitfn is_js_catchable_error(err : Error) -> Boolfn is_typedarray_class(name : String) -> Boolfn lookup_symbol_property_chain(obj_val : Value, data : ObjectData, sym_id : Int, interp? : Interpreter?) -> Value? raisefn[T : ExecutorCode] make_classified_executor_arrow_function(params : Array[String], closure : Environment, strict : Bool, code : T, source_body : Array[Stmt], rest_param? : String?) -> Valuefn[T : ExecutorCode] make_classified_executor_function(name : String?, params : Array[String], closure : Environment, strict : Bool, code : T, source_body : Array[Stmt], rest_param? : String?, constructable? : Bool, call_self_name? : Bool, define_arguments_object? : Bool) -> Valuefn[T : ExecutorCode] make_executor_arrow_function(params : Array[String], closure : Environment, strict : Bool, code : T, rest_param? : String?) -> Valuefn[T : ExecutorCode] make_executor_function(name : String?, params : Array[String], closure : Environment, strict : Bool, code : T, rest_param? : String?, constructable? : Bool, call_self_name? : Bool, define_arguments_object? : Bool) -> Valuefn make_interp_method_func(name~ : String, length? : Int, realm_state? : RealmState?, func : (Interpreter, Value, Array[Value]) -> Value raise) -> Valuefn make_interp_method_func_with_context(name~ : String, length? : Int, func : (Interpreter, CallContext, Value, Array[Value]) -> Value raise) -> Valuefn make_interp_static_func(name~ : String, length? : Int, func : (Interpreter, Array[Value]) -> Value raise) -> Valuefn make_native_func(name~ : String, length? : Int, realm_state? : RealmState?, func : (Array[Value]) -> Value raise) -> Valuefn[T] observe_source_failure(realm_state : RealmState, eval : () -> T raise) -> Result[T, SourceObservedFailure]fn proxy_define_property(interp : Interpreter, proxy_data : ProxyData, key : Value, partial : PartialDescriptor) -> Bool raisefn proxy_get(interp : Interpreter, proxy_data : ProxyData, key : String, receiver : Value) -> Value raisefn proxy_get_own_property(interp : Interpreter, proxy_data : ProxyData, key : Value) -> (PropDescriptor, Value)? raisefn proxy_set(interp : Interpreter, proxy_data : ProxyData, key : String, value : Value, receiver : Value, strict : Bool) -> Value raisefn proxy_set_prototype_of(interp : Interpreter, proxy_data : ProxyData, proto : Value) -> Bool raisefn set_array_iterator_override(arr : ArrayData, well_known_symbols~ : WellKnownSymbols, getter : Value?, value : Value?) -> Unitfn setup_async_function_constructor(env : Environment, well_known_symbols~ : WellKnownSymbols) -> Unitfn setup_async_generator_function_constructor(env : Environment, well_known_symbols~ : WellKnownSymbols) -> Unitfn setup_generator_function_constructor(env : Environment, global_this : Value, well_known_symbols~ : WellKnownSymbols) -> Unitfn utf16_length(s : String) -> Intfn validate_non_configurable(existing : PropDescriptor, prop_display : String, is_accessor : Bool, is_data : Bool, has_value : Bool, new_writable : Bool?, new_enumerable : Bool?, new_configurable : Bool?, new_getter : Value?, new_setter : Value?, get_old_value : () -> Value, get_new_value : () -> Value?) -> Unit raisefn[T] with_source_identity(realm_state : RealmState, source_identity : String?, eval : () -> T raise) -> T raisePure MoonBit cross-target embedded JavaScript engine
Dependencies