summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/tinywasm/src/runtime/executor/mod.rs76
-rw-r--r--crates/tinywasm/src/runtime/stack.rs2
-rw-r--r--crates/tinywasm/src/runtime/stack/blocks.rs27
-rw-r--r--crates/tinywasm/src/runtime/stack/call_stack.rs4
-rw-r--r--crates/tinywasm/tests/generated/mvp.csv2
-rw-r--r--crates/tinywasm/tests/generated/progress-mvp.svg6
6 files changed, 59 insertions, 58 deletions
diff --git a/crates/tinywasm/src/runtime/executor/mod.rs b/crates/tinywasm/src/runtime/executor/mod.rs
index 8191d83..4ce1581 100644
--- a/crates/tinywasm/src/runtime/executor/mod.rs
+++ b/crates/tinywasm/src/runtime/executor/mod.rs
@@ -2,10 +2,9 @@ use core::ops::{BitAnd, BitOr, BitXor, Neg};
use super::{DefaultRuntime, Stack};
use crate::{
- get_label_args,
log::debug,
runtime::{BlockType, LabelFrame},
- CallFrame, Error, ModuleInstance, Result, Store,
+ CallFrame, Error, LabelArgs, ModuleInstance, Result, Store,
};
use alloc::vec::Vec;
use log::info;
@@ -132,30 +131,32 @@ fn exec_one(
}
If(args, else_offset, end_offset) => {
- let end_instr_ptr = cf.instr_ptr + *end_offset;
-
- info!(
- "if it's true, we'll jump to the next instruction (@{})",
- cf.instr_ptr + 1
- );
-
- if let Some(else_offset) = else_offset {
- info!(
- "else: {:?} (@{})",
- instrs[cf.instr_ptr + else_offset],
- cf.instr_ptr + else_offset
- );
- };
-
- info!("end: {:?} (@{})", instrs[end_instr_ptr], end_instr_ptr);
-
- if stack.values.pop_t::<i32>()? != 0 {
+ if stack.values.pop_t::<i32>()? == 0 {
+ if let Some(else_offset) = else_offset {
+ log::info!("entering else at {}", cf.instr_ptr + *else_offset);
+ cf.enter_label(
+ LabelFrame {
+ instr_ptr: cf.instr_ptr + *else_offset,
+ end_instr_ptr: cf.instr_ptr + *end_offset,
+ stack_ptr: stack.values.len(), // - params,
+ args: crate::LabelArgs::new(*args, module)?,
+ ty: BlockType::Else,
+ },
+ &mut stack.values,
+ );
+ cf.instr_ptr += *else_offset;
+ } else {
+ log::info!("skipping if");
+ cf.instr_ptr += *end_offset
+ }
+ } else {
+ log::info!("entering then");
cf.enter_label(
LabelFrame {
instr_ptr: cf.instr_ptr,
end_instr_ptr: cf.instr_ptr + *end_offset,
stack_ptr: stack.values.len(), // - params,
- args: get_label_args(*args, module)?,
+ args: LabelArgs::new(*args, module)?,
ty: BlockType::If,
},
&mut stack.values,
@@ -163,6 +164,10 @@ fn exec_one(
}
}
+ // Else(_end_offset) => {
+ // // end the if block
+ // cf.break_to(0, &mut stack.values)?;
+ // }
Loop(args, end_offset) => {
// let params = stack.values.pop_block_params(*args, &module)?;
cf.enter_label(
@@ -170,7 +175,7 @@ fn exec_one(
instr_ptr: cf.instr_ptr,
end_instr_ptr: cf.instr_ptr + *end_offset,
stack_ptr: stack.values.len(), // - params,
- args: get_label_args(*args, module)?,
+ args: LabelArgs::new(*args, module)?,
ty: BlockType::Loop,
},
&mut stack.values,
@@ -183,7 +188,7 @@ fn exec_one(
instr_ptr: cf.instr_ptr,
end_instr_ptr: cf.instr_ptr + *end_offset,
stack_ptr: stack.values.len(), //- params,
- args: get_label_args(*args, module)?,
+ args: LabelArgs::new(*args, module)?,
ty: BlockType::Block,
},
&mut stack.values,
@@ -210,7 +215,7 @@ fn exec_one(
BrIf(v) => {
if stack.values.pop_t::<i32>()? > 0 {
cf.break_to(*v, &mut stack.values)?
- };
+ }
}
Return => match stack.call_stack.is_empty() {
@@ -235,21 +240,22 @@ fn exec_one(
}
}
- EndBlockFrame => {
- let blocks = &mut cf.labels;
-
- // remove the label from the label stack
- let Some(block) = blocks.pop() else {
- panic!("end: no label to end, this should have been validated by the parser");
+ Else(end_offset) => {
+ let Some(block) = cf.labels.pop() else {
+ panic!("else: no label to end, this should have been validated by the parser");
};
let res_count = block.args.results;
- info!("we want to keep {} values on the stack", res_count);
- info!("current block stack ptr: {}", block.stack_ptr);
- info!("stack: {:?}", stack.values);
+ stack.values.truncate_keep(block.stack_ptr, res_count);
+ cf.instr_ptr += *end_offset;
+ }
- // trim the lable's stack from the stack
- stack.values.truncate_keep(block.stack_ptr, res_count)
+ EndBlockFrame => {
+ // remove the label from the label stack
+ let Some(block) = cf.labels.pop() else {
+ panic!("end: no label to end, this should have been validated by the parser");
+ };
+ stack.values.truncate_keep(block.stack_ptr, block.args.results)
}
LocalGet(local_index) => stack.values.push(cf.get_local(*local_index as usize)),
diff --git a/crates/tinywasm/src/runtime/stack.rs b/crates/tinywasm/src/runtime/stack.rs
index 0912640..a7074ad 100644
--- a/crates/tinywasm/src/runtime/stack.rs
+++ b/crates/tinywasm/src/runtime/stack.rs
@@ -3,7 +3,7 @@ mod call_stack;
mod value_stack;
use self::{call_stack::CallStack, value_stack::ValueStack};
-pub(crate) use blocks::{get_label_args, BlockType, LabelFrame};
+pub(crate) use blocks::{BlockType, LabelArgs, LabelFrame};
pub(crate) use call_stack::CallFrame;
/// A WebAssembly Stack
diff --git a/crates/tinywasm/src/runtime/stack/blocks.rs b/crates/tinywasm/src/runtime/stack/blocks.rs
index 05c9043..f448492 100644
--- a/crates/tinywasm/src/runtime/stack/blocks.rs
+++ b/crates/tinywasm/src/runtime/stack/blocks.rs
@@ -18,11 +18,6 @@ impl Labels {
}
#[inline]
- pub(crate) fn top(&self) -> Option<&LabelFrame> {
- self.0.last()
- }
-
- #[inline]
/// get the block at the given index, where 0 is the top of the stack
pub(crate) fn get_relative_to_top(&self, index: usize) -> Option<&LabelFrame> {
info!("get block: {}", index);
@@ -64,19 +59,21 @@ pub(crate) enum BlockType {
Block,
}
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, Default)]
pub(crate) struct LabelArgs {
pub(crate) params: usize,
pub(crate) results: usize,
}
-pub(crate) fn get_label_args(args: BlockArgs, module: &ModuleInstance) -> Result<LabelArgs> {
- Ok(match args {
- BlockArgs::Empty => LabelArgs { params: 0, results: 0 },
- BlockArgs::Type(_) => LabelArgs { params: 0, results: 1 },
- BlockArgs::FuncType(t) => LabelArgs {
- params: module.func_ty(t).params.len(),
- results: module.func_ty(t).results.len(),
- },
- })
+impl LabelArgs {
+ pub(crate) fn new(args: BlockArgs, module: &ModuleInstance) -> Result<Self> {
+ Ok(match args {
+ BlockArgs::Empty => LabelArgs { params: 0, results: 0 },
+ BlockArgs::Type(_) => LabelArgs { params: 0, results: 1 },
+ BlockArgs::FuncType(t) => LabelArgs {
+ params: module.func_ty(t).params.len(),
+ results: module.func_ty(t).results.len(),
+ },
+ })
+ }
}
diff --git a/crates/tinywasm/src/runtime/stack/call_stack.rs b/crates/tinywasm/src/runtime/stack/call_stack.rs
index 7874c54..88daa7f 100644
--- a/crates/tinywasm/src/runtime/stack/call_stack.rs
+++ b/crates/tinywasm/src/runtime/stack/call_stack.rs
@@ -91,7 +91,6 @@ impl CallFrame {
/// Break to a block at the given index (relative to the current frame)
#[inline]
pub(crate) fn break_to(&mut self, break_to_relative: u32, value_stack: &mut super::ValueStack) -> Result<()> {
- let current_label = self.labels.top().ok_or(Error::LabelStackUnderflow)?;
let break_to = self
.labels
.get_relative_to_top(break_to_relative as usize)
@@ -109,7 +108,7 @@ impl CallFrame {
// we also want to trim the label stack to the loop (but not including the loop)
self.labels.truncate(self.labels.len() - break_to_relative as usize);
}
- BlockType::Block => {
+ BlockType::Block | BlockType::If | BlockType::Else => {
// this is a block, so we want to jump to the next instruction after the block ends (the inst_ptr will be incremented by 1 before the next instruction is executed)
self.instr_ptr = break_to.end_instr_ptr;
@@ -117,7 +116,6 @@ impl CallFrame {
self.labels
.truncate(self.labels.len() - (break_to_relative as usize + 1));
}
- _ => unimplemented!("break to block type: {:?}", current_label.ty),
}
// self.instr_ptr = block_frame.instr_ptr;
diff --git a/crates/tinywasm/tests/generated/mvp.csv b/crates/tinywasm/tests/generated/mvp.csv
index 1d10bbb..ca9bc91 100644
--- a/crates/tinywasm/tests/generated/mvp.csv
+++ b/crates/tinywasm/tests/generated/mvp.csv
@@ -2,4 +2,4 @@
0.0.4,9258,10909,[{"name":"address.wast","passed":0,"failed":54},{"name":"align.wast","passed":0,"failed":109},{"name":"binary-leb128.wast","passed":66,"failed":25},{"name":"binary.wast","passed":104,"failed":8},{"name":"block.wast","passed":0,"failed":171},{"name":"br.wast","passed":0,"failed":21},{"name":"br_if.wast","passed":0,"failed":30},{"name":"br_table.wast","passed":0,"failed":25},{"name":"call.wast","passed":0,"failed":22},{"name":"call_indirect.wast","passed":0,"failed":56},{"name":"comments.wast","passed":4,"failed":4},{"name":"const.wast","passed":702,"failed":76},{"name":"conversions.wast","passed":0,"failed":93},{"name":"custom.wast","passed":10,"failed":1},{"name":"data.wast","passed":0,"failed":61},{"name":"elem.wast","passed":0,"failed":76},{"name":"endianness.wast","passed":0,"failed":1},{"name":"exports.wast","passed":21,"failed":73},{"name":"f32.wast","passed":1005,"failed":1509},{"name":"f32_bitwise.wast","passed":1,"failed":363},{"name":"f32_cmp.wast","passed":2401,"failed":6},{"name":"f64.wast","passed":1005,"failed":1509},{"name":"f64_bitwise.wast","passed":1,"failed":363},{"name":"f64_cmp.wast","passed":2401,"failed":6},{"name":"fac.wast","passed":0,"failed":2},{"name":"float_exprs.wast","passed":269,"failed":591},{"name":"float_literals.wast","passed":34,"failed":129},{"name":"float_memory.wast","passed":0,"failed":6},{"name":"float_misc.wast","passed":138,"failed":303},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":4,"failed":75},{"name":"func_ptrs.wast","passed":0,"failed":16},{"name":"global.wast","passed":4,"failed":49},{"name":"i32.wast","passed":0,"failed":96},{"name":"i64.wast","passed":0,"failed":42},{"name":"if.wast","passed":0,"failed":118},{"name":"imports.wast","passed":1,"failed":156},{"name":"inline-module.wast","passed":0,"failed":1},{"name":"int_exprs.wast","passed":38,"failed":70},{"name":"int_literals.wast","passed":5,"failed":46},{"name":"labels.wast","passed":1,"failed":28},{"name":"left-to-right.wast","passed":0,"failed":1},{"name":"linking.wast","passed":1,"failed":66},{"name":"load.wast","passed":0,"failed":60},{"name":"local_get.wast","passed":2,"failed":34},{"name":"local_set.wast","passed":5,"failed":48},{"name":"local_tee.wast","passed":0,"failed":42},{"name":"loop.wast","passed":0,"failed":43},{"name":"memory.wast","passed":0,"failed":34},{"name":"memory_grow.wast","passed":0,"failed":19},{"name":"memory_redundancy.wast","passed":0,"failed":1},{"name":"memory_size.wast","passed":0,"failed":6},{"name":"memory_trap.wast","passed":0,"failed":172},{"name":"names.wast","passed":484,"failed":1},{"name":"nop.wast","passed":0,"failed":5},{"name":"return.wast","passed":0,"failed":21},{"name":"select.wast","passed":0,"failed":32},{"name":"skip-stack-guard-page.wast","passed":0,"failed":11},{"name":"stack.wast","passed":0,"failed":2},{"name":"start.wast","passed":0,"failed":10},{"name":"store.wast","passed":0,"failed":59},{"name":"switch.wast","passed":1,"failed":27},{"name":"token.wast","passed":16,"failed":42},{"name":"traps.wast","passed":3,"failed":33},{"name":"type.wast","passed":1,"failed":2},{"name":"unreachable.wast","passed":0,"failed":59},{"name":"unreached-invalid.wast","passed":0,"failed":118},{"name":"unwind.wast","passed":1,"failed":49},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":0,"failed":176}]
0.0.5,11135,9093,[{"name":"address.wast","passed":1,"failed":259},{"name":"align.wast","passed":108,"failed":48},{"name":"binary-leb128.wast","passed":78,"failed":13},{"name":"binary.wast","passed":107,"failed":5},{"name":"block.wast","passed":170,"failed":53},{"name":"br.wast","passed":20,"failed":77},{"name":"br_if.wast","passed":29,"failed":89},{"name":"br_table.wast","passed":24,"failed":150},{"name":"call.wast","passed":18,"failed":73},{"name":"call_indirect.wast","passed":34,"failed":136},{"name":"comments.wast","passed":5,"failed":3},{"name":"const.wast","passed":778,"failed":0},{"name":"conversions.wast","passed":25,"failed":594},{"name":"custom.wast","passed":10,"failed":1},{"name":"data.wast","passed":22,"failed":39},{"name":"elem.wast","passed":27,"failed":72},{"name":"endianness.wast","passed":1,"failed":68},{"name":"exports.wast","passed":90,"failed":6},{"name":"f32.wast","passed":1018,"failed":1496},{"name":"f32_bitwise.wast","passed":4,"failed":360},{"name":"f32_cmp.wast","passed":2407,"failed":0},{"name":"f64.wast","passed":1018,"failed":1496},{"name":"f64_bitwise.wast","passed":4,"failed":360},{"name":"f64_cmp.wast","passed":2407,"failed":0},{"name":"fac.wast","passed":1,"failed":7},{"name":"float_exprs.wast","passed":275,"failed":625},{"name":"float_literals.wast","passed":112,"failed":51},{"name":"float_memory.wast","passed":0,"failed":90},{"name":"float_misc.wast","passed":138,"failed":303},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":81,"failed":91},{"name":"func_ptrs.wast","passed":7,"failed":29},{"name":"global.wast","passed":50,"failed":60},{"name":"i32.wast","passed":85,"failed":375},{"name":"i64.wast","passed":31,"failed":385},{"name":"if.wast","passed":116,"failed":125},{"name":"imports.wast","passed":23,"failed":160},{"name":"inline-module.wast","passed":1,"failed":0},{"name":"int_exprs.wast","passed":38,"failed":70},{"name":"int_literals.wast","passed":25,"failed":26},{"name":"labels.wast","passed":13,"failed":16},{"name":"left-to-right.wast","passed":0,"failed":96},{"name":"linking.wast","passed":5,"failed":127},{"name":"load.wast","passed":59,"failed":38},{"name":"local_get.wast","passed":18,"failed":18},{"name":"local_set.wast","passed":38,"failed":15},{"name":"local_tee.wast","passed":41,"failed":56},{"name":"loop.wast","passed":42,"failed":78},{"name":"memory.wast","passed":30,"failed":49},{"name":"memory_grow.wast","passed":11,"failed":85},{"name":"memory_redundancy.wast","passed":1,"failed":7},{"name":"memory_size.wast","passed":6,"failed":36},{"name":"memory_trap.wast","passed":1,"failed":181},{"name":"names.wast","passed":484,"failed":2},{"name":"nop.wast","passed":4,"failed":84},{"name":"return.wast","passed":20,"failed":64},{"name":"select.wast","passed":28,"failed":120},{"name":"skip-stack-guard-page.wast","passed":1,"failed":10},{"name":"stack.wast","passed":2,"failed":5},{"name":"start.wast","passed":4,"failed":16},{"name":"store.wast","passed":59,"failed":9},{"name":"switch.wast","passed":2,"failed":26},{"name":"token.wast","passed":39,"failed":19},{"name":"traps.wast","passed":4,"failed":32},{"name":"type.wast","passed":3,"failed":0},{"name":"unreachable.wast","passed":0,"failed":64},{"name":"unreached-invalid.wast","passed":118,"failed":0},{"name":"unwind.wast","passed":9,"failed":41},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":176,"failed":0}]
0.1.0,17630,2598,[{"name":"address.wast","passed":5,"failed":255},{"name":"align.wast","passed":108,"failed":48},{"name":"binary-leb128.wast","passed":91,"failed":0},{"name":"binary.wast","passed":110,"failed":2},{"name":"block.wast","passed":193,"failed":30},{"name":"br.wast","passed":84,"failed":13},{"name":"br_if.wast","passed":90,"failed":28},{"name":"br_table.wast","passed":25,"failed":149},{"name":"call.wast","passed":29,"failed":62},{"name":"call_indirect.wast","passed":36,"failed":134},{"name":"comments.wast","passed":7,"failed":1},{"name":"const.wast","passed":778,"failed":0},{"name":"conversions.wast","passed":371,"failed":248},{"name":"custom.wast","passed":11,"failed":0},{"name":"data.wast","passed":47,"failed":14},{"name":"elem.wast","passed":50,"failed":49},{"name":"endianness.wast","passed":1,"failed":68},{"name":"exports.wast","passed":92,"failed":4},{"name":"f32.wast","passed":2514,"failed":0},{"name":"f32_bitwise.wast","passed":364,"failed":0},{"name":"f32_cmp.wast","passed":2407,"failed":0},{"name":"f64.wast","passed":2514,"failed":0},{"name":"f64_bitwise.wast","passed":364,"failed":0},{"name":"f64_cmp.wast","passed":2407,"failed":0},{"name":"fac.wast","passed":2,"failed":6},{"name":"float_exprs.wast","passed":761,"failed":139},{"name":"float_literals.wast","passed":163,"failed":0},{"name":"float_memory.wast","passed":6,"failed":84},{"name":"float_misc.wast","passed":437,"failed":4},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":124,"failed":48},{"name":"func_ptrs.wast","passed":10,"failed":26},{"name":"global.wast","passed":51,"failed":59},{"name":"i32.wast","passed":460,"failed":0},{"name":"i64.wast","passed":416,"failed":0},{"name":"if.wast","passed":120,"failed":121},{"name":"imports.wast","passed":74,"failed":109},{"name":"inline-module.wast","passed":1,"failed":0},{"name":"int_exprs.wast","passed":108,"failed":0},{"name":"int_literals.wast","passed":51,"failed":0},{"name":"labels.wast","passed":14,"failed":15},{"name":"left-to-right.wast","passed":1,"failed":95},{"name":"linking.wast","passed":21,"failed":111},{"name":"load.wast","passed":60,"failed":37},{"name":"local_get.wast","passed":32,"failed":4},{"name":"local_set.wast","passed":50,"failed":3},{"name":"local_tee.wast","passed":68,"failed":29},{"name":"loop.wast","passed":93,"failed":27},{"name":"memory.wast","passed":34,"failed":45},{"name":"memory_grow.wast","passed":12,"failed":84},{"name":"memory_redundancy.wast","passed":1,"failed":7},{"name":"memory_size.wast","passed":6,"failed":36},{"name":"memory_trap.wast","passed":2,"failed":180},{"name":"names.wast","passed":485,"failed":1},{"name":"nop.wast","passed":46,"failed":42},{"name":"return.wast","passed":73,"failed":11},{"name":"select.wast","passed":86,"failed":62},{"name":"skip-stack-guard-page.wast","passed":1,"failed":10},{"name":"stack.wast","passed":2,"failed":5},{"name":"start.wast","passed":9,"failed":11},{"name":"store.wast","passed":59,"failed":9},{"name":"switch.wast","passed":2,"failed":26},{"name":"token.wast","passed":58,"failed":0},{"name":"traps.wast","passed":22,"failed":14},{"name":"type.wast","passed":3,"failed":0},{"name":"unreachable.wast","passed":50,"failed":14},{"name":"unreached-invalid.wast","passed":118,"failed":0},{"name":"unwind.wast","passed":35,"failed":15},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":176,"failed":0}]
-0.2.0-alpha.0,18183,2045,[{"name":"address.wast","passed":13,"failed":247},{"name":"align.wast","passed":108,"failed":48},{"name":"binary-leb128.wast","passed":91,"failed":0},{"name":"binary.wast","passed":112,"failed":0},{"name":"block.wast","passed":215,"failed":8},{"name":"br.wast","passed":94,"failed":3},{"name":"br_if.wast","passed":107,"failed":11},{"name":"br_table.wast","passed":25,"failed":149},{"name":"call.wast","passed":52,"failed":39},{"name":"call_indirect.wast","passed":36,"failed":134},{"name":"comments.wast","passed":7,"failed":1},{"name":"const.wast","passed":778,"failed":0},{"name":"conversions.wast","passed":371,"failed":248},{"name":"custom.wast","passed":11,"failed":0},{"name":"data.wast","passed":47,"failed":14},{"name":"elem.wast","passed":54,"failed":45},{"name":"endianness.wast","passed":21,"failed":48},{"name":"exports.wast","passed":92,"failed":4},{"name":"f32.wast","passed":2514,"failed":0},{"name":"f32_bitwise.wast","passed":364,"failed":0},{"name":"f32_cmp.wast","passed":2407,"failed":0},{"name":"f64.wast","passed":2514,"failed":0},{"name":"f64_bitwise.wast","passed":364,"failed":0},{"name":"f64_cmp.wast","passed":2407,"failed":0},{"name":"fac.wast","passed":2,"failed":6},{"name":"float_exprs.wast","passed":765,"failed":135},{"name":"float_literals.wast","passed":163,"failed":0},{"name":"float_memory.wast","passed":30,"failed":60},{"name":"float_misc.wast","passed":437,"failed":4},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":132,"failed":40},{"name":"func_ptrs.wast","passed":10,"failed":26},{"name":"global.wast","passed":98,"failed":12},{"name":"i32.wast","passed":460,"failed":0},{"name":"i64.wast","passed":416,"failed":0},{"name":"if.wast","passed":126,"failed":115},{"name":"imports.wast","passed":76,"failed":107},{"name":"inline-module.wast","passed":1,"failed":0},{"name":"int_exprs.wast","passed":108,"failed":0},{"name":"int_literals.wast","passed":51,"failed":0},{"name":"labels.wast","passed":14,"failed":15},{"name":"left-to-right.wast","passed":91,"failed":5},{"name":"linking.wast","passed":19,"failed":113},{"name":"load.wast","passed":87,"failed":10},{"name":"local_get.wast","passed":32,"failed":4},{"name":"local_set.wast","passed":50,"failed":3},{"name":"local_tee.wast","passed":85,"failed":12},{"name":"loop.wast","passed":111,"failed":9},{"name":"memory.wast","passed":77,"failed":2},{"name":"memory_grow.wast","passed":73,"failed":23},{"name":"memory_redundancy.wast","passed":3,"failed":5},{"name":"memory_size.wast","passed":35,"failed":7},{"name":"memory_trap.wast","passed":3,"failed":179},{"name":"names.wast","passed":485,"failed":1},{"name":"nop.wast","passed":69,"failed":19},{"name":"return.wast","passed":81,"failed":3},{"name":"select.wast","passed":106,"failed":42},{"name":"skip-stack-guard-page.wast","passed":1,"failed":10},{"name":"stack.wast","passed":4,"failed":3},{"name":"start.wast","passed":9,"failed":11},{"name":"store.wast","passed":66,"failed":2},{"name":"switch.wast","passed":2,"failed":26},{"name":"token.wast","passed":58,"failed":0},{"name":"traps.wast","passed":22,"failed":14},{"name":"type.wast","passed":3,"failed":0},{"name":"unreachable.wast","passed":60,"failed":4},{"name":"unreached-invalid.wast","passed":118,"failed":0},{"name":"unwind.wast","passed":35,"failed":15},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":176,"failed":0}]
+0.2.0-alpha.0,18444,1784,[{"name":"address.wast","passed":13,"failed":247},{"name":"align.wast","passed":108,"failed":48},{"name":"binary-leb128.wast","passed":91,"failed":0},{"name":"binary.wast","passed":112,"failed":0},{"name":"block.wast","passed":217,"failed":6},{"name":"br.wast","passed":97,"failed":0},{"name":"br_if.wast","passed":115,"failed":3},{"name":"br_table.wast","passed":27,"failed":147},{"name":"call.wast","passed":71,"failed":20},{"name":"call_indirect.wast","passed":50,"failed":120},{"name":"comments.wast","passed":7,"failed":1},{"name":"const.wast","passed":778,"failed":0},{"name":"conversions.wast","passed":371,"failed":248},{"name":"custom.wast","passed":11,"failed":0},{"name":"data.wast","passed":47,"failed":14},{"name":"elem.wast","passed":54,"failed":45},{"name":"endianness.wast","passed":21,"failed":48},{"name":"exports.wast","passed":92,"failed":4},{"name":"f32.wast","passed":2514,"failed":0},{"name":"f32_bitwise.wast","passed":364,"failed":0},{"name":"f32_cmp.wast","passed":2407,"failed":0},{"name":"f64.wast","passed":2514,"failed":0},{"name":"f64_bitwise.wast","passed":364,"failed":0},{"name":"f64_cmp.wast","passed":2407,"failed":0},{"name":"fac.wast","passed":6,"failed":2},{"name":"float_exprs.wast","passed":829,"failed":71},{"name":"float_literals.wast","passed":163,"failed":0},{"name":"float_memory.wast","passed":30,"failed":60},{"name":"float_misc.wast","passed":437,"failed":4},{"name":"forward.wast","passed":5,"failed":0},{"name":"func.wast","passed":132,"failed":40},{"name":"func_ptrs.wast","passed":10,"failed":26},{"name":"global.wast","passed":101,"failed":9},{"name":"i32.wast","passed":460,"failed":0},{"name":"i64.wast","passed":416,"failed":0},{"name":"if.wast","passed":226,"failed":15},{"name":"imports.wast","passed":76,"failed":107},{"name":"inline-module.wast","passed":1,"failed":0},{"name":"int_exprs.wast","passed":108,"failed":0},{"name":"int_literals.wast","passed":51,"failed":0},{"name":"labels.wast","passed":17,"failed":12},{"name":"left-to-right.wast","passed":91,"failed":5},{"name":"linking.wast","passed":19,"failed":113},{"name":"load.wast","passed":90,"failed":7},{"name":"local_get.wast","passed":34,"failed":2},{"name":"local_set.wast","passed":51,"failed":2},{"name":"local_tee.wast","passed":88,"failed":9},{"name":"loop.wast","passed":113,"failed":7},{"name":"memory.wast","passed":78,"failed":1},{"name":"memory_grow.wast","passed":76,"failed":20},{"name":"memory_redundancy.wast","passed":3,"failed":5},{"name":"memory_size.wast","passed":35,"failed":7},{"name":"memory_trap.wast","passed":3,"failed":179},{"name":"names.wast","passed":485,"failed":1},{"name":"nop.wast","passed":74,"failed":14},{"name":"return.wast","passed":84,"failed":0},{"name":"select.wast","passed":110,"failed":38},{"name":"skip-stack-guard-page.wast","passed":1,"failed":10},{"name":"stack.wast","passed":7,"failed":0},{"name":"start.wast","passed":9,"failed":11},{"name":"store.wast","passed":67,"failed":1},{"name":"switch.wast","passed":2,"failed":26},{"name":"token.wast","passed":58,"failed":0},{"name":"traps.wast","passed":22,"failed":14},{"name":"type.wast","passed":3,"failed":0},{"name":"unreachable.wast","passed":64,"failed":0},{"name":"unreached-invalid.wast","passed":118,"failed":0},{"name":"unwind.wast","passed":35,"failed":15},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":176,"failed":0}]
diff --git a/crates/tinywasm/tests/generated/progress-mvp.svg b/crates/tinywasm/tests/generated/progress-mvp.svg
index 9f7e7a4..256ac7c 100644
--- a/crates/tinywasm/tests/generated/progress-mvp.svg
+++ b/crates/tinywasm/tests/generated/progress-mvp.svg
@@ -53,12 +53,12 @@ v0.1.0 (17630)
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="716,345 716,350 "/>
<text x="898" y="355" dy="0.76em" text-anchor="middle" font-family="Victor Mono" font-size="12.096774193548388" opacity="1" fill="#000000">
-v0.2.0-alpha.0 (18183)
+v0.2.0-alpha.0 (18444)
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="898,345 898,350 "/>
+<rect x="266" y="212" width="172" height="132" opacity="0.5" fill="#0000FF" stroke="none"/>
<rect x="85" y="212" width="171" height="132" opacity="0.5" fill="#0000FF" stroke="none"/>
<rect x="630" y="92" width="172" height="252" opacity="0.5" fill="#0000FF" stroke="none"/>
-<rect x="812" y="84" width="172" height="260" opacity="0.5" fill="#0000FF" stroke="none"/>
+<rect x="812" y="80" width="172" height="264" opacity="0.5" fill="#0000FF" stroke="none"/>
<rect x="448" y="185" width="172" height="159" opacity="0.5" fill="#0000FF" stroke="none"/>
-<rect x="266" y="212" width="172" height="132" opacity="0.5" fill="#0000FF" stroke="none"/>
</svg>