pub(super) struct BytecodeBackend {
instructions: Vec<Instruction>,
bool_register_count: u32,
int_register_count: u32,
float_register_count: u32,
now_register: Option<FloatRegister>,
}Fields§
§instructions: Vec<Instruction>§bool_register_count: u32§int_register_count: u32§float_register_count: u32§now_register: Option<FloatRegister>Implementations§
Source§impl BytecodeBackend
impl BytecodeBackend
pub(super) fn new() -> Self
pub(super) fn finish(self, schema: Arc<ContextSchema>) -> BytecodeProgram
fn bool_register(&mut self) -> BoolValue
fn int_register(&mut self) -> IntValue
fn float_register(&mut self) -> FloatValue
Source§impl BytecodeBackend
impl BytecodeBackend
fn direct_float_comparison_guard_suffix( &self, value: BoolValue, ) -> Option<FloatComparisonGuardSuffix>
fn timestamp_guard_suffix( &self, value: BoolValue, ) -> Option<TimestampGuardSuffix>
fn timestamp_active_suffix(&self, end: usize, value: BoolValue) -> Option<usize>
fn cooldown_guard_suffix(&self, value: BoolValue) -> Option<CooldownGuardSuffix>
fn cooldown_guard_suffix_without_bypass( &self, value: BoolValue, ) -> Option<CooldownGuardSuffix>
fn cooldown_guard_suffix_with_bypass( &self, value: BoolValue, ) -> Option<CooldownGuardSuffix>
fn begin_bool_chain( &mut self, first: BoolValue, short_circuit_value: bool, ) -> BoolChain
fn push_bool_chain( &mut self, chain: &mut BoolChain, value: BoolValue, short_circuit_value: bool, )
fn finish_bool_chain( &mut self, chain: BoolChain, completed_value: bool, ) -> BoolValue
fn emit_float_binary( &mut self, lhs: FloatValue, rhs: FloatValue, instruction: impl FnOnce(FloatRegister, FloatValue, FloatValue) -> Instruction, ) -> FloatValue
fn emit_float_unary( &mut self, value: FloatValue, instruction: impl FnOnce(FloatRegister, FloatValue) -> Instruction, ) -> FloatValue
fn emit_float_compare( &mut self, lhs: FloatValue, rhs: FloatValue, instruction: impl FnOnce(BoolRegister, FloatValue, FloatValue) -> Instruction, ) -> BoolValue
fn emit_int_compare( &mut self, lhs: IntValue, rhs: IntValue, instruction: impl FnOnce(BoolRegister, IntValue, IntValue) -> Instruction, ) -> BoolValue
fn emit_bool_binary( &mut self, lhs: BoolValue, rhs: BoolValue, instruction: impl FnOnce(BoolRegister, BoolValue, BoolValue) -> Instruction, ) -> BoolValue
Trait Implementations§
Source§impl Debug for BytecodeBackend
impl Debug for BytecodeBackend
Source§impl RotationBackend for BytecodeBackend
impl RotationBackend for BytecodeBackend
type Bool = BoolValue
type Int = IntValue
type Float = FloatValue
type AndChain = BoolChain
type OrChain = BoolChain
type CastGuard = CastGuard
fn const_bool(&mut self, v: bool) -> Self::Bool
fn const_i32(&mut self, v: i32) -> Self::Int
fn const_i64(&mut self, v: i64) -> Self::Int
fn const_f64(&mut self, v: f64) -> Self::Float
fn load_bool(&mut self, offset: usize) -> Self::Bool
fn load_i32(&mut self, offset: usize) -> Self::Int
fn load_f64(&mut self, offset: usize) -> Self::Float
fn store_bool(&mut self, offset: usize, v: Self::Bool)
fn store_i32(&mut self, offset: usize, v: Self::Int)
fn store_f64(&mut self, offset: usize, v: Self::Float)
fn now(&mut self) -> Self::Float
fn add_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
fn sub_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
fn mul_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
Source§fn safe_div_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
fn safe_div_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
Returns 0.0 for any /0 (mirrors [
wowlab_types::numeric::safe_div]).Source§fn true_mod_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
fn true_mod_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
Mirrors [
wowlab_types::numeric::true_mod].fn min_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
fn max_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Float
fn floor_f(&mut self, v: Self::Float) -> Self::Float
fn ceil_f(&mut self, v: Self::Float) -> Self::Float
fn abs_f(&mut self, v: Self::Float) -> Self::Float
fn cmp_gt_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
fn cmp_gte_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
fn cmp_lt_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
fn cmp_lte_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
Source§fn cmp_eq_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
fn cmp_eq_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
Epsilon-aware (mirrors [
wowlab_types::numeric::float_eq]).Source§fn cmp_ne_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
fn cmp_ne_f(&mut self, a: Self::Float, b: Self::Float) -> Self::Bool
Epsilon-aware (mirrors [
wowlab_types::numeric::float_ne]).fn cmp_eq_i(&mut self, a: Self::Int, b: Self::Int) -> Self::Bool
fn cmp_ne_i(&mut self, a: Self::Int, b: Self::Int) -> Self::Bool
fn cmp_gt_i(&mut self, a: Self::Int, b: Self::Int) -> Self::Bool
fn cmp_gte_i(&mut self, a: Self::Int, b: Self::Int) -> Self::Bool
fn cmp_lt_i(&mut self, a: Self::Int, b: Self::Int) -> Self::Bool
fn cmp_lte_i(&mut self, a: Self::Int, b: Self::Int) -> Self::Bool
fn and_b(&mut self, a: Self::Bool, b: Self::Bool) -> Self::Bool
fn or_b(&mut self, a: Self::Bool, b: Self::Bool) -> Self::Bool
fn not_b(&mut self, a: Self::Bool) -> Self::Bool
fn begin_and(&mut self, first: Self::Bool) -> Self::AndChain
fn push_and(&mut self, chain: &mut Self::AndChain, value: Self::Bool)
fn finish_and(&mut self, chain: Self::AndChain) -> Self::Bool
fn begin_or(&mut self, first: Self::Bool) -> Self::OrChain
fn push_or(&mut self, chain: &mut Self::OrChain, value: Self::Bool)
fn finish_or(&mut self, chain: Self::OrChain) -> Self::Bool
fn begin_cast_guard(&mut self, first: Self::Bool) -> Self::CastGuard
fn push_cast_guard(&mut self, guard: &mut Self::CastGuard, value: Self::Bool)
fn finish_cast_guard( &mut self, guard: Self::CastGuard, spell_id: u32, empower_rank: u8, ) -> Self::Bool
fn bool_to_float(&mut self, v: Self::Bool) -> Self::Float
fn bool_to_int(&mut self, v: Self::Bool) -> Self::Int
fn int_to_float(&mut self, v: Self::Int) -> Self::Float
fn int_to_bool(&mut self, v: Self::Int) -> Self::Bool
Source§fn float_to_bool(&mut self, v: Self::Float) -> Self::Bool
fn float_to_bool(&mut self, v: Self::Float) -> Self::Bool
Exact
v != 0.0.Source§fn float_to_int(&mut self, v: Self::Float) -> Self::Int
fn float_to_int(&mut self, v: Self::Float) -> Self::Int
v as i64 (truncates).fn select_f( &mut self, cond: Self::Bool, t: Self::Float, f: Self::Float, ) -> Self::Float
fn select_i( &mut self, cond: Self::Bool, t: Self::Int, f: Self::Int, ) -> Self::Int
fn select_b( &mut self, cond: Self::Bool, t: Self::Bool, f: Self::Bool, ) -> Self::Bool
fn return_cast_if(&mut self, cond: Self::Bool, spell_id: u32, empower_rank: u8)
fn return_wait_if(&mut self, cond: Self::Bool, seconds: f32)
fn return_pool_if(&mut self, cond: Self::Bool, target: f32)
fn return_use_item_if( &mut self, cond: Self::Bool, gear_slot: u8, empower_rank: u8, )
fn return_none(&mut self)
fn record_action(&mut self, _record: ActionRecord<'_>)
fn record_action_guarded( &mut self, _list_id: &str, _action_index: usize, _action: &RotationAction, _is_terminator: bool, _guard_held: Self::Bool, _failing: &Condition, )
fn begin_list_recording(&mut self, _list_id: &str)
fn end_list_recording(&mut self)
Auto Trait Implementations§
impl Freeze for BytecodeBackend
impl RefUnwindSafe for BytecodeBackend
impl Send for BytecodeBackend
impl Sync for BytecodeBackend
impl Unpin for BytecodeBackend
impl UnsafeUnpin for BytecodeBackend
impl UnwindSafe for BytecodeBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more