From 130746bc856f5c2eb5672cceb0e1304ee2c95b1e Mon Sep 17 00:00:00 2001 From: johannst Date: Wed, 28 Feb 2024 18:32:44 +0000 Subject: deploy: 7cc72737a0140f5f71e9d83d4f87503eb4c7604f --- tiny_vm/all.html | 3 +- tiny_vm/enum.TinyInsn.html | 55 ++++++++++++++++++------------------ tiny_vm/enum.TinyReg.html | 29 ++++++++++--------- tiny_vm/fn.make_tinyvm_fib.html | 3 +- tiny_vm/fn.make_tinyvm_jit_perf.html | 3 +- tiny_vm/fn.make_tinyvm_jit_test.html | 3 +- tiny_vm/index.html | 12 ++++---- tiny_vm/struct.Fixup.html | 27 +++++++++--------- tiny_vm/struct.PhysAddr.html | 23 +++++++-------- tiny_vm/struct.TinyVm.html | 39 ++++++++++++------------- 10 files changed, 104 insertions(+), 93 deletions(-) (limited to 'tiny_vm') diff --git a/tiny_vm/all.html b/tiny_vm/all.html index f24eb24..9cc640d 100644 --- a/tiny_vm/all.html +++ b/tiny_vm/all.html @@ -1 +1,2 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate +
\ No newline at end of file diff --git a/tiny_vm/enum.TinyInsn.html b/tiny_vm/enum.TinyInsn.html index b57d716..6e991f8 100644 --- a/tiny_vm/enum.TinyInsn.html +++ b/tiny_vm/enum.TinyInsn.html @@ -1,32 +1,33 @@ -TinyInsn in tiny_vm - Rust

Enum tiny_vm::TinyInsn

source ·
pub enum TinyInsn {
+TinyInsn in tiny_vm - Rust
+    

Enum tiny_vm::TinyInsn

source ·
pub enum TinyInsn {
     Halt,
-    LoadImm(TinyReg, u16),
-    Load(TinyReg, u16),
-    Store(TinyReg, u16),
+    LoadImm(TinyReg, u16),
+    Load(TinyReg, u16),
+    Store(TinyReg, u16),
     Add(TinyReg, TinyReg),
-    Addi(TinyReg, i16),
-    Branch(usize),
-    BranchZero(TinyReg, usize),
+    Addi(TinyReg, i16),
+    Branch(usize),
+    BranchZero(TinyReg, usize),
 }
Expand description

The instructions for the TinyVm.

-

Variants§

§

Halt

Halt the VM.

-
§

LoadImm(TinyReg, u16)

Load the immediate value into the register reg = imm.

-
§

Load(TinyReg, u16)

Load a value from the memory (absolute addressing) into the register reg = mem[imm].

-
§

Store(TinyReg, u16)

Store a value from the register into the memory (absolute addressing) mem[imm] = reg.

+

Variants§

§

Halt

Halt the VM.

+
§

LoadImm(TinyReg, u16)

Load the immediate value into the register reg = imm.

+
§

Load(TinyReg, u16)

Load a value from the memory (absolute addressing) into the register reg = mem[imm].

+
§

Store(TinyReg, u16)

Store a value from the register into the memory (absolute addressing) mem[imm] = reg.

§

Add(TinyReg, TinyReg)

Add the register to the register reg1 += reg2.

-
§

Addi(TinyReg, i16)

Add the immediate to the register reg += imm.

-
§

Branch(usize)

Jump unconditional (absolute addressing) pc = disp.

-
§

BranchZero(TinyReg, usize)

Jump if the register is zero (absolute addressing) pc = (reg == 0) ? disp : pc++.

-

Trait Implementations§

source§

impl Clone for TinyInsn

source§

fn clone(&self) -> TinyInsn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyInsn

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<TinyInsn> for TinyInsn

source§

fn eq(&self, other: &TinyInsn) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for TinyInsn

source§

impl StructuralPartialEq for TinyInsn

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+
§

Addi(TinyReg, i16)

Add the immediate to the register reg += imm.

+
§

Branch(usize)

Jump unconditional (absolute addressing) pc = disp.

+
§

BranchZero(TinyReg, usize)

Jump if the register is zero (absolute addressing) pc = (reg == 0) ? disp : pc++.

+

Trait Implementations§

source§

impl Clone for TinyInsn

source§

fn clone(&self) -> TinyInsn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyInsn

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for TinyInsn

source§

fn eq(&self, other: &TinyInsn) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for TinyInsn

source§

impl StructuralPartialEq for TinyInsn

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/tiny_vm/enum.TinyReg.html b/tiny_vm/enum.TinyReg.html index 52b2104..242b768 100644 --- a/tiny_vm/enum.TinyReg.html +++ b/tiny_vm/enum.TinyReg.html @@ -1,19 +1,20 @@ -TinyReg in tiny_vm - Rust

Enum tiny_vm::TinyReg

source ·
pub enum TinyReg {
+TinyReg in tiny_vm - Rust
+    

Enum tiny_vm::TinyReg

source ·
pub enum TinyReg {
     A,
     B,
     C,
 }
Expand description

The registers for the TinyVm.

-

Variants§

Trait Implementations§

source§

impl Clone for TinyReg

source§

fn clone(&self) -> TinyReg

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyReg

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<TinyReg> for TinyReg

source§

fn eq(&self, other: &TinyReg) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for TinyReg

source§

impl StructuralPartialEq for TinyReg

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

Variants§

Trait Implementations§

source§

impl Clone for TinyReg

source§

fn clone(&self) -> TinyReg

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyReg

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for TinyReg

source§

fn eq(&self, other: &TinyReg) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for TinyReg

source§

impl StructuralPartialEq for TinyReg

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/tiny_vm/fn.make_tinyvm_fib.html b/tiny_vm/fn.make_tinyvm_fib.html index 4ccf6e5..0c8dff8 100644 --- a/tiny_vm/fn.make_tinyvm_fib.html +++ b/tiny_vm/fn.make_tinyvm_fib.html @@ -1,2 +1,3 @@ -make_tinyvm_fib in tiny_vm - Rust

Function tiny_vm::make_tinyvm_fib

source ·
pub fn make_tinyvm_fib(start_n: u16) -> Vec<TinyInsn>
Expand description

Generate a guest program to compute the fiibonacci sequence for n.

+make_tinyvm_fib in tiny_vm - Rust +

Function tiny_vm::make_tinyvm_fib

source ·
pub fn make_tinyvm_fib(start_n: u16) -> Vec<TinyInsn>
Expand description

Generate a guest program to compute the fiibonacci sequence for n.

\ No newline at end of file diff --git a/tiny_vm/fn.make_tinyvm_jit_perf.html b/tiny_vm/fn.make_tinyvm_jit_perf.html index 28089e3..76e6f00 100644 --- a/tiny_vm/fn.make_tinyvm_jit_perf.html +++ b/tiny_vm/fn.make_tinyvm_jit_perf.html @@ -1,2 +1,3 @@ -make_tinyvm_jit_perf in tiny_vm - Rust
pub fn make_tinyvm_jit_perf() -> Vec<TinyInsn>
Expand description

Generate a simple count down loop to crunch some instructions.

+make_tinyvm_jit_perf in tiny_vm - Rust +
pub fn make_tinyvm_jit_perf() -> Vec<TinyInsn>
Expand description

Generate a simple count down loop to crunch some instructions.

\ No newline at end of file diff --git a/tiny_vm/fn.make_tinyvm_jit_test.html b/tiny_vm/fn.make_tinyvm_jit_test.html index 903f42c..e30ab34 100644 --- a/tiny_vm/fn.make_tinyvm_jit_test.html +++ b/tiny_vm/fn.make_tinyvm_jit_test.html @@ -1,2 +1,3 @@ -make_tinyvm_jit_test in tiny_vm - Rust
pub fn make_tinyvm_jit_test() -> Vec<TinyInsn>
Expand description

Generate a test program for the jit.

+make_tinyvm_jit_test in tiny_vm - Rust +
pub fn make_tinyvm_jit_test() -> Vec<TinyInsn>
Expand description

Generate a test program for the jit.

\ No newline at end of file diff --git a/tiny_vm/index.html b/tiny_vm/index.html index 0323d25..72eb51e 100644 --- a/tiny_vm/index.html +++ b/tiny_vm/index.html @@ -1,8 +1,10 @@ -tiny_vm - Rust

Crate tiny_vm

source ·
Expand description

TinyVm example.

-

This example introduces as simple 16 bit virtual machine the TinyVm. The VM consits of -three registers defined in TinyReg, a separate data and insutrction memory and a small +tiny_vm - Rust

+

Crate tiny_vm

source ·
Expand description

TinyVm example.

+

This example introduces a simple 16 bit virtual machine the TinyVm. The VM consists of +three registers defined in TinyReg, a separate data and instruction memory and a small set of instructions TinyInsn, sufficient to implement a guest program to compute the -fiibonacci sequence.

+Fibonacci sequence.

The TinyVm implements a simple just-in-time (JIT) compiler to demonstrate the juicebox_asm crate. Additionally, it implements a reference interpreter.

@@ -31,4 +33,4 @@ fiibonacci sequence.

assert_eq!(8, vm.icnt); assert_eq!(4, vm.pc); }
-

Structs

  • A minial fixup utility to implement jump labels when constructing guest programs.
  • A guest physical address.
  • The TinyVm virtual machine state.

Enums

Functions

\ No newline at end of file +

Structs

  • A minial fixup utility to implement jump labels when constructing guest programs.
  • A guest physical address.
  • The TinyVm virtual machine state.

Enums

Functions

\ No newline at end of file diff --git a/tiny_vm/struct.Fixup.html b/tiny_vm/struct.Fixup.html index 83e7fb1..d7376ec 100644 --- a/tiny_vm/struct.Fixup.html +++ b/tiny_vm/struct.Fixup.html @@ -1,14 +1,15 @@ -Fixup in tiny_vm - Rust

Struct tiny_vm::Fixup

source ·
pub struct Fixup { /* private fields */ }
Expand description

A minial fixup utility to implement jump labels when constructing guest programs.

-

Implementations§

source§

impl Fixup

source

pub fn new(pc: usize) -> Self

Create a new Fixup at the current pc.

-
source

pub fn bind(self, prog: &mut Vec<TinyInsn>)

Bind the Fixup to the current location of prog and resolve the Fixup.

-

Auto Trait Implementations§

§

impl RefUnwindSafe for Fixup

§

impl Send for Fixup

§

impl Sync for Fixup

§

impl Unpin for Fixup

§

impl UnwindSafe for Fixup

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+Fixup in tiny_vm - Rust +

Struct tiny_vm::Fixup

source ·
pub struct Fixup { /* private fields */ }
Expand description

A minial fixup utility to implement jump labels when constructing guest programs.

+

Implementations§

source§

impl Fixup

source

pub fn new(pc: usize) -> Self

Create a new Fixup at the current pc.

+
source

pub fn bind(self, prog: &mut Vec<TinyInsn>)

Bind the Fixup to the current location of prog and resolve the Fixup.

+

Auto Trait Implementations§

§

impl RefUnwindSafe for Fixup

§

impl Send for Fixup

§

impl Sync for Fixup

§

impl Unpin for Fixup

§

impl UnwindSafe for Fixup

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/tiny_vm/struct.PhysAddr.html b/tiny_vm/struct.PhysAddr.html index 574570b..adf56e4 100644 --- a/tiny_vm/struct.PhysAddr.html +++ b/tiny_vm/struct.PhysAddr.html @@ -1,12 +1,13 @@ -PhysAddr in tiny_vm - Rust

Struct tiny_vm::PhysAddr

source ·
pub struct PhysAddr(pub u16);
Expand description

A guest physical address.

-

Tuple Fields§

§0: u16

Trait Implementations§

source§

impl Into<usize> for PhysAddr

source§

fn into(self) -> usize

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+PhysAddr in tiny_vm - Rust +

Struct tiny_vm::PhysAddr

source ·
pub struct PhysAddr(pub u16);
Expand description

A guest physical address.

+

Tuple Fields§

§0: u16

Trait Implementations§

source§

impl Into<usize> for PhysAddr

source§

fn into(self) -> usize

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/tiny_vm/struct.TinyVm.html b/tiny_vm/struct.TinyVm.html index 890ce75..8c5171d 100644 --- a/tiny_vm/struct.TinyVm.html +++ b/tiny_vm/struct.TinyVm.html @@ -1,21 +1,22 @@ -TinyVm in tiny_vm - Rust

Struct tiny_vm::TinyVm

source ·
pub struct TinyVm { /* private fields */ }
Expand description

The TinyVm virtual machine state.

-

Implementations§

source§

impl TinyVm

source

pub fn new(code: Vec<TinyInsn>) -> Self

Create a new TinyVm and initialize the instruction memory from code.

-
source

pub fn read_reg(&self, reg: TinyReg) -> u16

Read guest register.

-
source

pub fn write_reg(&mut self, reg: TinyReg, val: u16)

Write guest register.

-
source

pub fn read_mem(&self, paddr: PhysAddr) -> u16

Read guest data memory.

-
source

pub fn write_mem(&mut self, paddr: PhysAddr, val: u16)

Write guest data memory.

-
source

pub fn dump(&self)

Dump the VM state to stdout.

-
source

pub fn interp(&mut self)

Run in interpreter mode until the next TinyInsn::Halt instruction is hit.

-
source

pub fn jit(&mut self)

Run in JIT mode until the next TinyInsn::Halt instruction is hit. Translate guest +TinyVm in tiny_vm - Rust

+

Struct tiny_vm::TinyVm

source ·
pub struct TinyVm { /* private fields */ }
Expand description

The TinyVm virtual machine state.

+

Implementations§

source§

impl TinyVm

source

pub fn new(code: Vec<TinyInsn>) -> Self

Create a new TinyVm and initialize the instruction memory from code.

+
source

pub fn read_reg(&self, reg: TinyReg) -> u16

Read guest register.

+
source

pub fn write_reg(&mut self, reg: TinyReg, val: u16)

Write guest register.

+
source

pub fn read_mem(&self, paddr: PhysAddr) -> u16

Read guest data memory.

+
source

pub fn write_mem(&mut self, paddr: PhysAddr, val: u16)

Write guest data memory.

+
source

pub fn dump(&self)

Dump the VM state to stdout.

+
source

pub fn interp(&mut self)

Run in interpreter mode until the next TinyInsn::Halt instruction is hit.

+
source

pub fn jit(&mut self)

Run in JIT mode until the next TinyInsn::Halt instruction is hit. Translate guest basic blocks on demand.

-

Auto Trait Implementations§

§

impl RefUnwindSafe for TinyVm

§

impl !Send for TinyVm

§

impl !Sync for TinyVm

§

impl Unpin for TinyVm

§

impl UnwindSafe for TinyVm

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

Auto Trait Implementations§

§

impl RefUnwindSafe for TinyVm

§

impl !Send for TinyVm

§

impl !Sync for TinyVm

§

impl Unpin for TinyVm

§

impl UnwindSafe for TinyVm

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file -- cgit v1.2.3