wrench-0.0.6.3
Safe HaskellNone
LanguageHaskell2010

Wrench.Isa.Wasm32.State

Description

The machine's state and every primitive that touches it: where code, data and the two stacks sit in memory, the counted word/byte accessors, and the operand and control stacks -- the latter including the binary format of a control record, since the format and the LIFO discipline that gives it meaning are one thing.

Synopsis

The state

data Wasm32St w Source #

The machine state.

Constructors

Wasm32St 

Fields

Instances

Instances details
Show w => Show (Wasm32St w) Source # 
Instance details

Defined in Wrench.Isa.Wasm32.State

Methods

showsPrec :: Int -> Wasm32St w -> ShowS #

show :: Wasm32St w -> String #

showList :: [Wasm32St w] -> ShowS #

IsWord w => InitState (Wasm32St w) Source # 
Instance details

Defined in Wrench.Isa.Wasm32.Execute

Methods

initState :: Int -> MemOf (Wasm32St w) -> StdGen -> Wasm32St w Source #

IsWord w => Inspectable (Wasm32St w) Source # 
Instance details

Defined in Wrench.Isa.Wasm32.Report

Associated Types

type WordOf (Wasm32St w) 
Instance details

Defined in Wrench.Isa.Wasm32.Report

type WordOf (Wasm32St w) = w
type IsaOf (Wasm32St w) 
Instance details

Defined in Wrench.Isa.Wasm32.Report

type IsaOf (Wasm32St w) = Wasm32Isa w w
IsWord w => Machine (Wasm32St w) (Wasm32Isa w w) w Source # 
Instance details

Defined in Wrench.Isa.Wasm32.Execute

type IsaOf (Wasm32St w) Source # 
Instance details

Defined in Wrench.Isa.Wasm32.Report

type IsaOf (Wasm32St w) = Wasm32Isa w w
type MemOf (Wasm32St w) Source # 
Instance details

Defined in Wrench.Isa.Wasm32.State

type MemOf (Wasm32St w) = IoMem (Wasm32Isa w w) w
type WordOf (Wasm32St w) Source # 
Instance details

Defined in Wrench.Isa.Wasm32.Report

type WordOf (Wasm32St w) = w

Memory map

Memory access

setWord :: IsWord w => Int -> w -> State (Wasm32St w) () Source #

setByte :: IsWord w => Int -> Word8 -> State (Wasm32St w) () Source #

Operand stack

pushValue :: IsWord w => w -> State (Wasm32St w) () Source #

Locals

Scan cache

Branch cache

data BranchEntry w Source #

A taken br or br_if: where it was, the control record it read and that record's words, and where it went.

Constructors

BranchEntry 

Fields

Instances

Instances details
Show w => Show (BranchEntry w) Source # 
Instance details

Defined in Wrench.Isa.Wasm32.State

Control stack

data Scope Source #

Instances

Instances details
Show Scope Source # 
Instance details

Defined in Wrench.Isa.Wasm32.State

Methods

showsPrec :: Int -> Scope -> ShowS #

show :: Scope -> String #

showList :: [Scope] -> ShowS #

Eq Scope Source # 
Instance details

Defined in Wrench.Isa.Wasm32.State

Methods

(==) :: Scope -> Scope -> Bool #

(/=) :: Scope -> Scope -> Bool #

BitPack Scope Source # 
Instance details

Defined in Wrench.Isa.Wasm32.State

Methods

unpack :: IsWord w => BitGet w Scope Source #

pack :: IsWord w => Scope -> BitPut w () Source #

Control-record encoding