rename PrimOpPhase
This commit is contained in:
+45
-44
@@ -10,7 +10,7 @@ pub use context::*;
|
||||
pub use control::*;
|
||||
pub use conv::*;
|
||||
pub use eq::*;
|
||||
use fix_bytecode::PrimOpPhase;
|
||||
use fix_bytecode::Continuation;
|
||||
use fix_error::Error;
|
||||
use fix_runtime::{BytecodeReader, Machine, Step, VmRuntimeCtx};
|
||||
use gc_arena::Mutation;
|
||||
@@ -19,42 +19,42 @@ pub use list::*;
|
||||
pub use path::*;
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
pub fn dispatch_primop<'gc, M: Machine<'gc>>(
|
||||
pub fn dispatch_cont<'gc, M: Machine<'gc>>(
|
||||
m: &mut M,
|
||||
ctx: &mut impl VmRuntimeCtx,
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> Step {
|
||||
use PrimOpPhase::*;
|
||||
let phase_disc = reader.read_u8();
|
||||
let Ok(phase) = PrimOpPhase::try_from(phase_disc) else {
|
||||
use Continuation::*;
|
||||
let cont = reader.read_u8();
|
||||
let Ok(cont) = Continuation::try_from(cont) else {
|
||||
return m.finish_err(Error::eval_error("invalid primop phase"));
|
||||
};
|
||||
match phase {
|
||||
Abort => abort(m, ctx, reader, mc),
|
||||
match cont {
|
||||
PAbort => abort(m, ctx, reader, mc),
|
||||
|
||||
All => all_entry(m, reader, mc),
|
||||
AllCallPred => all_call_pred(m, reader, mc),
|
||||
AllCheck => all_check(m, reader, mc),
|
||||
PAll => all_entry(m, reader, mc),
|
||||
PAllCallPred => all_call_pred(m, reader, mc),
|
||||
PAllCheck => all_check(m, reader, mc),
|
||||
|
||||
Any => any_entry(m, reader, mc),
|
||||
AnyCallPred => any_call_pred(m, reader, mc),
|
||||
AnyCheck => any_check(m, reader, mc),
|
||||
PAny => any_entry(m, reader, mc),
|
||||
PAnyCallPred => any_call_pred(m, reader, mc),
|
||||
PAnyCheck => any_check(m, reader, mc),
|
||||
|
||||
DeepSeq => deep_seq_force_top(m, reader, mc),
|
||||
DeepSeqPush => deep_seq_push(m, reader, mc),
|
||||
DeepSeqLoop => deep_seq_loop(m, reader, mc),
|
||||
Seq => seq(m, reader, mc),
|
||||
PDeepSeq => deep_seq_force_top(m, reader, mc),
|
||||
PDeepSeqPush => deep_seq_push(m, reader, mc),
|
||||
PDeepSeqLoop => deep_seq_loop(m, reader, mc),
|
||||
PSeq => seq(m, reader, mc),
|
||||
|
||||
FilterForceList => filter_force_list(m, reader, mc),
|
||||
FilterCallPred => filter_call_pred(m, reader, mc),
|
||||
FilterCheck => filter_check(m, reader, mc),
|
||||
PFilterForceList => filter_force_list(m, reader, mc),
|
||||
PFilterCallPred => filter_call_pred(m, reader, mc),
|
||||
PFilterCheck => filter_check(m, reader, mc),
|
||||
|
||||
FoldlStrict => foldl_strict_entry(m, reader, mc),
|
||||
FoldlStrictEmpty => foldl_strict_empty(m, reader, mc),
|
||||
FoldlStrictCall1 => foldl_strict_call1(m, reader, mc),
|
||||
FoldlStrictCall2 => foldl_strict_call2(m, reader, mc),
|
||||
FoldlStrictUpdate => foldl_strict_update(m, reader, mc),
|
||||
PFoldlStrict => foldl_strict_entry(m, reader, mc),
|
||||
PFoldlStrictEmpty => foldl_strict_empty(m, reader, mc),
|
||||
PFoldlStrictCall1 => foldl_strict_call1(m, reader, mc),
|
||||
PFoldlStrictCall2 => foldl_strict_call2(m, reader, mc),
|
||||
PFoldlStrictUpdate => foldl_strict_update(m, reader, mc),
|
||||
|
||||
ForceResultShallow => force_result_shallow(m, ctx, reader, mc),
|
||||
ForceResultShallowPush => force_result_shallow_push(m, ctx, reader, mc),
|
||||
@@ -68,29 +68,30 @@ pub fn dispatch_primop<'gc, M: Machine<'gc>>(
|
||||
CallFunctor1 => call_functor_1(m, reader, mc),
|
||||
CallFunctor2 => call_functor_2(m, reader, mc),
|
||||
|
||||
Import => import(m, ctx, reader, mc),
|
||||
ImportFinalize => import_finalize(m, ctx, reader),
|
||||
ScopedImport => scoped_import(m, ctx, reader, mc),
|
||||
ScopedImportFinalize => scoped_import_finalize(m, ctx, reader, mc),
|
||||
PImport => import(m, ctx, reader, mc),
|
||||
PImportFinalize => import_finalize(m, ctx, reader),
|
||||
PScopedImport => scoped_import(m, ctx, reader, mc),
|
||||
PScopedImportFinalize => scoped_import_finalize(m, ctx, reader, mc),
|
||||
|
||||
PathExists => path_exists(m, ctx, reader, mc),
|
||||
ToPath => to_path(m, ctx, reader, mc),
|
||||
IsPath => is_path(m, reader, mc),
|
||||
ToString => to_string(m, ctx, reader, mc),
|
||||
TypeOf => type_of(m, ctx, reader, mc),
|
||||
PPathExists => path_exists(m, ctx, reader, mc),
|
||||
PToPath => to_path(m, ctx, reader, mc),
|
||||
PIsPath => is_path(m, reader, mc),
|
||||
PToString => to_string(m, ctx, reader, mc),
|
||||
PTypeOf => type_of(m, ctx, reader, mc),
|
||||
|
||||
HasContext => has_context(m, ctx, reader, mc),
|
||||
GetContext => get_context(m, ctx, reader, mc),
|
||||
AppendContext => append_context(m, ctx, reader, mc),
|
||||
AppendContextLoop => append_context_loop(m, ctx, reader, mc),
|
||||
AppendContextEntryForced => append_context_entry_forced(m, ctx, reader, mc),
|
||||
AppendContextOutputsForced => append_context_outputs_forced(m, ctx, reader, mc),
|
||||
AppendContextOutputElementLoop => append_context_output_element_loop(m, ctx, reader, mc),
|
||||
AppendContextOutputElementForced => {
|
||||
PHasContext => has_context(m, ctx, reader, mc),
|
||||
PGetContext => get_context(m, ctx, reader, mc),
|
||||
PAppendContext => append_context(m, ctx, reader, mc),
|
||||
PAppendContextLoop => append_context_loop(m, ctx, reader, mc),
|
||||
PAppendContextEntryForced => append_context_entry_forced(m, ctx, reader, mc),
|
||||
PAppendContextOutputsForced => append_context_outputs_forced(m, ctx, reader, mc),
|
||||
PAppendContextOutputElementLoop => append_context_output_element_loop(m, ctx, reader, mc),
|
||||
PAppendContextOutputElementForced => {
|
||||
append_context_output_element_forced(m, ctx, reader, mc)
|
||||
}
|
||||
UnsafeDiscardStringContext => unsafe_discard_string_context(m, ctx, reader, mc),
|
||||
UnsafeDiscardOutputDependency => unsafe_discard_output_dependency(m, ctx, reader, mc),
|
||||
|
||||
PUnsafeDiscardStringContext => unsafe_discard_string_context(m, ctx, reader, mc),
|
||||
PUnsafeDiscardOutputDependency => unsafe_discard_output_dependency(m, ctx, reader, mc),
|
||||
|
||||
phase => todo!("primop phase {phase:?}"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user