diff --git a/Cargo.lock b/Cargo.lock index b62706bfd59..4d3feb6c507 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7653,6 +7653,7 @@ version = "0.71.2" dependencies = [ "anyhow", "downcast-rs", + "expect-test", "filecheck", "indexmap 2.14.0", "insta", diff --git a/justfile b/justfile index 52d4760032e..10d20cc960c 100644 --- a/justfile +++ b/justfile @@ -40,6 +40,27 @@ benchmark-tests: # The `performance` group contains recipes related to benchmarking the performance of compiled code: # gas usages and bytecode sizes. +CURRENT_BRANCH := `git branch --show-current` + +pe2e-against-master: + echo "Performance: {{CURRENT_BRANCH}} vs master" + git clean -xfd test/perf_out + git checkout master + cargo r -p test --release -- XX # update reduced std-libs + just pa + git checkout {{CURRENT_BRANCH}} + cargo r -p test --release -- XX # update reduced std-libs + just pa + just pdl + echo "performance reports at ./test/perf_out" + +pe2e-o2-against-master: + echo "Performance: {{CURRENT_BRANCH}} vs master" + git checkout master + cd ../sway-program-collection && git clean -xfd && just a + git checkout {{CURRENT_BRANCH}} + cd ../sway-program-collection && just a && just opd + alias pe2e := perf-e2e # collect gas usages and bytecode sizes from E2E tests [group('performance')] @@ -103,7 +124,7 @@ perf-diff-latest format='md': # format: output format, either `csv` or `html` (default: `csv`) # open: for `html` output, `-o` opens the report in the default browser -alias psh := perf-snapshot-historical +#alias psh := perf-snapshot-historical # collect historic gas usages from a snapshot test that has a `forc test` output [linux] [macos] diff --git a/scripts/perf/perf-diff-latest.sh b/scripts/perf/perf-diff-latest.sh index 212766a2d6e..1bfa0bc048c 100755 --- a/scripts/perf/perf-diff-latest.sh +++ b/scripts/perf/perf-diff-latest.sh @@ -12,6 +12,14 @@ perf_diff_stats_script="./scripts/perf/perf-diff-stats.sh" categories=("e2e-gas-usages" "e2e-bytecode-sizes" "in-language-gas-usages" "in-language-bytecode-sizes") + +# macOS compatibility: gfind from `brew install findutils` +if [ -x "$(command -v gfind)" ]; then + find="gfind" +else + find="find" +fi + err() { echo "ERROR: $*" >&2 exit 1 @@ -28,8 +36,11 @@ process_category() { local category="$1" # Collect candidates: "*--*.csv", but skip "--historical-*.csv". - mapfile -t candidates < <( - find "$perf_out_dir" -maxdepth 1 -type f -name "*-${category}-*.csv" -printf "%p\n" 2>/dev/null | + candidates=() + while IFS= read -r line; do + candidates+=("$line") + done < <( + $find "$perf_out_dir" -maxdepth 1 -type f -name "*-${category}-*.csv" -printf "%p\n" 2>/dev/null | while IFS= read -r f; do base="$(basename -- "$f")" @@ -50,7 +61,10 @@ process_category() { fi # Sort by timestamp (asc) and take last two paths. - mapfile -t sorted_paths < <( + sorted_paths=() + while IFS= read -r line; do + sorted_paths+=("$line") + done < <( printf "%s\n" "${candidates[@]}" | sort -n -k1,1 | awk -F'\t' '{print $2}' | diff --git a/sway-ir/Cargo.toml b/sway-ir/Cargo.toml index 7f2982d262f..7dac3b8b234 100644 --- a/sway-ir/Cargo.toml +++ b/sway-ir/Cargo.toml @@ -26,6 +26,7 @@ sway-types.workspace = true sway-utils.workspace = true [dev-dependencies] +expect-test.workspace = true insta.workspace = true vte.workspace = true diff --git a/sway-ir/src/analysis.rs b/sway-ir/src/analysis.rs index 47ff44f2d51..7244214290f 100644 --- a/sway-ir/src/analysis.rs +++ b/sway-ir/src/analysis.rs @@ -4,3 +4,5 @@ pub mod dominator; pub use dominator::*; pub mod memory_utils; pub use memory_utils::*; +pub mod loop_analysis; +pub use loop_analysis::*; diff --git a/sway-ir/src/analysis/dominator.rs b/sway-ir/src/analysis/dominator.rs index 4d65b53f4d3..acb5a176de6 100644 --- a/sway-ir/src/analysis/dominator.rs +++ b/sway-ir/src/analysis/dominator.rs @@ -1,6 +1,6 @@ use crate::{ - block::Block, AnalysisResult, AnalysisResultT, AnalysisResults, BranchToWithArgs, Context, - Function, IrError, Pass, PassMutability, ScopedPass, Value, + block::Block, AnalysisResult, AnalysisResultT, AnalysisResults, Context, Function, IrError, + Pass, PassMutability, ScopedPass, Value, }; use indexmap::IndexSet; /// Dominator tree and related algorithms. @@ -43,6 +43,15 @@ pub struct PostOrder { } impl AnalysisResultT for PostOrder {} +impl PostOrder { + /// If `block` was found by the `PostOrder` analysis + /// it is reachable from the entry function. + #[inline(always)] + pub fn is_reachable(&self, block: &Block) -> bool { + self.block_to_po.contains_key(block) + } +} + pub const POSTORDER_NAME: &str = "postorder"; pub fn create_postorder_pass() -> Pass { @@ -62,42 +71,44 @@ pub fn compute_post_order_pass( Ok(Box::new(compute_post_order(context, &function))) } +fn post_order( + context: &Context, + block: Block, + result: &mut PostOrder, + visited: &mut FxHashSet, + counter: &mut usize, +) { + if !visited.insert(block) { + return; + } + + for successor in block.successors(context) { + post_order(context, successor.block, result, visited, counter); + } + + result.block_to_po.insert(block, *counter); + result.po_to_block.push(block); + *counter += 1; +} + /// Compute the post-order traversal of the CFG. /// /// **BEWARE: Unreachable blocks aren't part of the result.** pub fn compute_post_order(context: &Context, function: &Function) -> PostOrder { - let mut res = PostOrder { + let mut result = PostOrder { block_to_po: FxHashMap::default(), po_to_block: Vec::default(), }; - let entry = function.get_entry_block(context); let mut counter = 0; - let mut on_stack = FxHashSet::::default(); - fn post_order( - context: &Context, - n: Block, - res: &mut PostOrder, - on_stack: &mut FxHashSet, - counter: &mut usize, - ) { - if on_stack.contains(&n) { - return; - } - on_stack.insert(n); - for BranchToWithArgs { block: n_succ, .. } in n.successors(context) { - post_order(context, n_succ, res, on_stack, counter); - } - res.block_to_po.insert(n, *counter); - res.po_to_block.push(n); - *counter += 1; - } - post_order(context, entry, &mut res, &mut on_stack, &mut counter); + let mut visited = FxHashSet::::default(); + let entry = function.get_entry_block(context); + post_order(context, entry, &mut result, &mut visited, &mut counter); // We could assert the whole thing, but it'd be expensive. - assert!(res.po_to_block.last().unwrap() == &entry); + assert!(result.po_to_block.last().unwrap() == &entry); - res + result } pub const DOMINATORS_NAME: &str = "dominators"; @@ -107,56 +118,96 @@ pub fn create_dominators_pass() -> Pass { name: DOMINATORS_NAME, descr: "Dominator tree computation", deps: vec![POSTORDER_NAME], - runner: ScopedPass::FunctionPass(PassMutability::Analysis(compute_dom_tree)), + runner: ScopedPass::FunctionPass(PassMutability::Analysis(compute_dom_tree_pass)), } } +// Find the nearest common dominator of two blocks, +// using the partially computed dominator tree. +fn nearest_common_dominator_of_two_blocks( + po: &PostOrder, + dom_tree: &FxIndexMap, + mut block_a: Block, + mut block_b: Block, +) -> Block { + while block_a != block_b { + while po.block_to_po[&block_a] < po.block_to_po[&block_b] { + block_a = dom_tree[&block_a].parent.unwrap(); + } + while po.block_to_po[&block_b] < po.block_to_po[&block_a] { + block_b = dom_tree[&block_b].parent.unwrap(); + } + } + block_a +} + /// Compute the dominator tree for the CFG. -fn compute_dom_tree( +fn compute_dom_tree_pass( context: &Context, analyses: &AnalysisResults, function: Function, ) -> Result { let po: &PostOrder = analyses.get_analysis_result(function); - let mut dom_tree = DomTree::default(); - let entry = function.get_entry_block(context); + let domtree = compute_dom_tree(context, function, po)?; + Ok(Box::new(domtree)) +} + +pub(crate) fn compute_dom_tree( + context: &Context<'_>, + function: Function, + po: &PostOrder, +) -> Result { + let mut dom_tree = FxIndexMap::default(); // This is to make the algorithm happy. It'll be changed to None later. - dom_tree.0.insert(entry, DomTreeNode::new(Some(entry))); + let entry = function.get_entry_block(context); + dom_tree.insert(entry, DomTreeNode::new(Some(entry))); + // initialize the dominators tree. This allows us to do dom_tree[b] fearlessly. // Note that we just previously initialized "entry", so we skip that here. - for b in po.po_to_block.iter().take(po.po_to_block.len() - 1) { - dom_tree.0.insert(*b, DomTreeNode::new(None)); + for block in po.po_to_block.iter().take(po.po_to_block.len() - 1) { + dom_tree.insert(*block, DomTreeNode::new(None)); } + let mut changed = true; while changed { changed = false; + // For all nodes, b, in reverse postorder (except start node) - for b in po.po_to_block.iter().rev().skip(1) { - // new_idom <- first (processed) predecessor of b (pick one) - let mut new_idom = b + for block in po.po_to_block.iter().rev().skip(1) { + let current_block_po = po.block_to_po[block]; + + // new_idom <- first (processed) predecessor of `block` (pick one) + let mut new_idom = block .pred_iter(context) - .find(|p| { - // "p" may not be reachable, and hence not in dom_tree. - po.block_to_po - .get(p) - .is_some_and(|p_po| *p_po > po.block_to_po[b]) + .find(|pred| { + // "pred" may not be reachable, and hence not in the cfg. + let Some(pred_po) = po.block_to_po.get(pred) else { + return false; + }; + *pred_po > current_block_po }) .cloned() .unwrap(); + let picked_pred = new_idom; - // for all other (reachable) predecessors, p, of b: - for p in b + + // for all other (reachable) predecessors, `pred` of `block`: + // if doms[pred] already calculated + // then new_idom is the common dominator of both + for pred in block .pred_iter(context) - .filter(|p| **p != picked_pred && po.block_to_po.contains_key(p)) + .filter(|p| **p != picked_pred && po.is_reachable(p)) { - if dom_tree.0[p].parent.is_some() { - // if doms[p] already calculated - new_idom = intersect(po, &dom_tree, *p, new_idom); + if dom_tree[pred].parent.is_some() { + new_idom = + nearest_common_dominator_of_two_blocks(po, &dom_tree, *pred, new_idom); } } - let b_node = dom_tree.0.get_mut(b).unwrap(); + + // update doms[block] if needed + let b_node = dom_tree.get_mut(block).unwrap(); match b_node.parent { Some(idom) if idom == new_idom => {} _ => { @@ -167,38 +218,18 @@ fn compute_dom_tree( } } - // Find the nearest common dominator of two blocks, - // using the partially computed dominator tree. - fn intersect( - po: &PostOrder, - dom_tree: &DomTree, - mut finger1: Block, - mut finger2: Block, - ) -> Block { - while finger1 != finger2 { - while po.block_to_po[&finger1] < po.block_to_po[&finger2] { - finger1 = dom_tree.0[&finger1].parent.unwrap(); - } - while po.block_to_po[&finger2] < po.block_to_po[&finger1] { - finger2 = dom_tree.0[&finger2].parent.unwrap(); - } - } - finger1 - } - // Fix the root. - dom_tree.0.get_mut(&entry).unwrap().parent = None; + dom_tree.get_mut(&entry).unwrap().parent = None; + // Build the children. - let child_parent: Vec<_> = dom_tree - .0 - .iter() - .filter_map(|(n, n_node)| n_node.parent.map(|n_parent| (*n, n_parent))) - .collect(); - for (child, parent) in child_parent { - dom_tree.0.get_mut(&parent).unwrap().children.push(child); + for block in po.po_to_block.iter() { + let Some(parent) = dom_tree[block].parent else { + continue; + }; + dom_tree[&parent].children.push(*block); } - Ok(Box::new(dom_tree)) + Ok(DomTree(dom_tree)) } impl DomTree { diff --git a/sway-ir/src/analysis/loop_analysis.rs b/sway-ir/src/analysis/loop_analysis.rs new file mode 100644 index 00000000000..58d7a90ad18 --- /dev/null +++ b/sway-ir/src/analysis/loop_analysis.rs @@ -0,0 +1,411 @@ +use std::collections::{BTreeMap, HashMap, HashSet}; + +use crate::{ + AnalysisResult, AnalysisResultT, AnalysisResults, Block, Context, DebugWithContext, DomTree, + Function, IrError, Pass, PassMutability, PostOrder, ScopedPass, DOMINATORS_NAME, + POSTORDER_NAME, +}; + +pub const LOOP_ANALYSIS_NAME: &str = "loop analysis"; + +pub fn create_loop_analysis_pass() -> Pass { + Pass { + name: LOOP_ANALYSIS_NAME, + descr: "Loop analysis computation", + deps: vec![POSTORDER_NAME, DOMINATORS_NAME], + runner: ScopedPass::FunctionPass(PassMutability::Analysis(compute_loop_analysis_pass)), + } +} + +#[derive(Debug)] +pub struct Loop { + blocks: HashSet, +} + +pub struct LoopAnalysis { + loops: Vec, + block_to_loops: HashMap>, +} + +impl LoopAnalysis { + pub fn is_inside_loop(&self, block: &Block) -> bool { + self.block_to_loops + .get(block) + .map(|b| !b.is_empty()) + .unwrap_or_default() + } +} + +impl DebugWithContext for LoopAnalysis { + fn fmt_with_context(&self, f: &mut std::fmt::Formatter, context: &Context) -> std::fmt::Result { + let mut block_to_loops = BTreeMap::new(); + + let mut keys = self.block_to_loops.keys().collect::>(); + keys.sort_by_key(|b| b.0); + for block in keys { + let loops = self.block_to_loops.get(block).expect("key not found"); + block_to_loops.insert(block.get_label(context), loops); + } + + let mut loops = BTreeMap::new(); + for (idx, l) in self.loops.iter().enumerate() { + let mut blocks = l + .blocks + .iter() + .map(|x| x.get_label(context)) + .collect::>(); + blocks.sort(); + loops.insert(idx, blocks); + } + + f.debug_struct("LoopAnalysis") + .field("block_to_loops", &block_to_loops) + .field("loops", &loops) + .finish() + } +} + +impl AnalysisResultT for LoopAnalysis {} + +/// Compute if instructions are inside of loops or not +fn compute_loop_analysis_pass( + context: &Context, + analyses: &AnalysisResults, + function: Function, +) -> Result { + let dom_tree: &DomTree = analyses.get_analysis_result(function); + let po: &PostOrder = analyses.get_analysis_result(function); + + let result = compute_loop_analysis(context, dom_tree, po)?; + + Ok(Box::new(result)) +} + +fn compute_loop_analysis( + context: &Context<'_>, + dom_tree: &DomTree, + po: &PostOrder, +) -> Result { + // 2. **Find all Back-edges**: + // Iterate through every edge $(U, V)$ in the CFG. + // If $V$ is an ancestor of $U$ in the Dominator Tree, $(U, V)$ is a back-edge. + let mut back_edges = vec![]; + + for block in po.po_to_block.iter() { + for branch in block.successors(context) { + let successor = branch.block; + if dom_tree.dominates(successor, *block) { + back_edges.push((*block, successor)); + } + } + } + + let mut block_to_loops = HashMap::>::new(); + + // 3. **Map Blocks to Loops** + // For every back-edge $(U, V)$, find all blocks that can reach $U$ without passing through $V$. + // Mark these blocks as "part of a loop." + let mut loops = vec![]; + + for (loop_tail, loop_header) in back_edges { + let loop_id = loops.len(); + + let mut loop_blocks = HashSet::new(); + let mut q = vec![loop_tail]; + while let Some(block) = q.pop() { + if !loop_blocks.insert(block) { + continue; + } + + // Map blocks to loops + block_to_loops.entry(block).or_default().push(loop_id); + + if block == loop_header { + continue; + } + + let reachabe_preds = block + .pred_iter(context) + .filter(|block| po.is_reachable(block)); + q.extend(reachabe_preds); + } + + assert!(loop_blocks.contains(&loop_tail)); + assert!(loop_blocks.contains(&loop_header)); + + loops.push(Loop { + blocks: loop_blocks, + }); + } + + Ok(LoopAnalysis { + loops, + block_to_loops, + }) +} + +#[cfg(test)] +mod tests { + use crate::{ + compute_dom_tree, compute_post_order, loop_analysis::compute_loop_analysis, Backtrace, + DebugWithContext, + }; + use sway_features::ExperimentalFeatures; + use sway_types::SourceEngine; + + fn parse<'a>(se: &'a SourceEngine, body: &str) -> crate::Context<'a> { + let context = crate::parse( + &format!( + "script {{ + {body} + }} + + !0 = \"a.sw\" + " + ), + se, + ExperimentalFeatures::default(), + Backtrace::default(), + ) + .unwrap(); + context + } + + #[test] + fn must_id_instructions_on_while_loops() { + let se = SourceEngine::default(); + // #[inline(never)] + // fn simple_while() { + // let mut counter = 0; + // while counter < 10 { + // counter = counter + 1; + // } + // } + let ir = parse( + &se, + "fn simple_while_1() -> () { +local mut u64 counter +local u64 other_ +local u64 other_0 +local u64 other_1 + +entry(): +v169v1 = get_local __ptr u64, counter +v170v1 = const u64 0 +store v170v1 to v169v1 +br while() + +while(): +v173v1 = get_local __ptr u64, counter +v174v1 = get_local __ptr u64, other_ +v175v1 = const u64 10 +store v175v1 to v174v1 +v177v1 = load v173v1 +v178v1 = get_local __ptr u64, other_ +v179v1 = load v178v1 +v180v1 = cmp lt v177v1 v179v1 +cbr v180v1, while_body(), end_while() + +while_body(): +v182v1 = get_local __ptr u64, counter +v183v1 = get_local __ptr u64, other_0 +v184v1 = const u64 1 +store v184v1 to v183v1 +v186v1 = load v182v1 +v187v1 = get_local __ptr u64, other_0 +v188v1 = load v187v1 +v189v1 = add v186v1, v188v1 +v190v1 = get_local __ptr u64, counter +store v189v1 to v190v1 +br while() + +end_while(): +v193v1 = get_local __ptr u64, counter +v194v1 = get_local __ptr u64, other_1 +v195v1 = const u64 10 +store v195v1 to v194v1 +v197v1 = load v193v1 +v198v1 = get_local __ptr u64, other_1 +v199v1 = load v198v1 +v200v1 = cmp eq v197v1 v199v1 +v202v1 = const unit () +ret () v202v1 +}", + ); + + let function = ir + .module_iter() + .find_map(|m| { + m.function_iter(&ir) + .find(|f| f.get_name(&ir) == "simple_while_1") + }) + .unwrap(); + + let po = compute_post_order(&ir, &function); + let domtree = compute_dom_tree(&ir, function, &po).unwrap(); + let r = compute_loop_analysis(&ir, &domtree, &po).unwrap(); + expect_test::expect![[r#" + LoopAnalysis { + block_to_loops: { + "while": [ + 0, + ], + "while_body": [ + 0, + ], + }, + loops: { + 0: [ + "while", + "while_body", + ], + }, + }"#]] + .assert_eq(&format!("{:#?}", r.with_context(&ir))); + } + + #[test] + fn must_id_instructions_on_for_loops() { + let se = SourceEngine::default(); + // #[inline(never)] + // fn just_for_loop(vector: Vec) { + // let mut i = 0; + // for n in vector.iter() { + // i += 1; + // } + // } + let ir = parse( + &se, + "fn just_for_loop_15(vector: __ptr { { ptr, u64 }, u64 }) -> () { +local mut { { { ptr, u64 }, u64 }, u64 } __for_iterable_2 +local mut { u64, ( () | u64 ) } __for_value_opt_1 +local { u64, ( () | u64 ) } __ret_val +local { { { ptr, u64 }, u64 }, u64 } __struct_init_0 +local mut u64 i +local u64 n +local u64 other_ +local u64 other_0 +local u64 other_1 + +entry(vector: __ptr { { ptr, u64 }, u64 }): +v1132v1 = get_local __ptr u64, i +v1133v1 = const u64 0 +store v1133v1 to v1132v1 +v1135v1 = get_local __ptr { { { ptr, u64 }, u64 }, u64 }, __struct_init_0 +v1136v1 = const u64 0 +v1137v1 = get_elem_ptr v1135v1, __ptr { { ptr, u64 }, u64 }, v1136v1 +mem_copy_val v1137v1, vector +v1139v1 = const u64 1 +v1140v1 = get_elem_ptr v1135v1, __ptr u64, v1139v1 +v1141v1 = const u64 0 +store v1141v1 to v1140v1 +v1143v1 = get_local __ptr { { { ptr, u64 }, u64 }, u64 }, __for_iterable_2 +mem_copy_val v1143v1, v1135v1 +br while() + +while(): +v1146v1 = const bool true +cbr v1146v1, while_body(), end_while() + +while_body(): +v1148v1 = get_local __ptr { { { ptr, u64 }, u64 }, u64 }, __for_iterable_2 +v1149v1 = get_local __ptr { u64, ( () | u64 ) }, __ret_val +v1151v1 = get_local __ptr { u64, ( () | u64 ) }, __for_value_opt_1 +mem_copy_val v1151v1, v1149v1 +v1153v1 = get_local __ptr { u64, ( () | u64 ) }, __for_value_opt_1 +v1154v1 = const u64 0 +v1155v1 = get_elem_ptr v1153v1, __ptr u64, v1154v1 +v1156v1 = get_local __ptr u64, other_ +v1157v1 = const u64 1 +store v1157v1 to v1156v1 +v1159v1 = load v1155v1 +v1160v1 = get_local __ptr u64, other_ +v1161v1 = load v1160v1 +v1162v1 = cmp eq v1159v1 v1161v1 +v1163v1 = const bool false +cbr v1162v1, is_none_22_block2(v1163v1), is_none_22_block1() + +is_none_22_block1(): +v1165v1 = const bool true +br is_none_22_block2(v1165v1) + +is_none_22_block2(v1131v1: bool): +cbr v1131v1, end_while(), block1() + +block1(): +v1168v1 = get_local __ptr { u64, ( () | u64 ) }, __for_value_opt_1 +v1170v1 = get_local __ptr u64, n +v1172v1 = get_local __ptr u64, i +v1173v1 = get_local __ptr u64, n +v1174v1 = load v1173v1 +v1175v1 = load v1172v1 +v1176v1 = cmp eq v1174v1 v1175v1 +v1178v1 = get_local __ptr u64, i +v1179v1 = get_local __ptr u64, other_0 +v1180v1 = const u64 1 +store v1180v1 to v1179v1 +v1182v1 = load v1178v1 +v1183v1 = get_local __ptr u64, other_0 +v1184v1 = load v1183v1 +v1185v1 = add v1182v1, v1184v1 +v1186v1 = get_local __ptr u64, i +store v1185v1 to v1186v1 +br while() + +end_while(): +v1189v1 = get_local __ptr u64, i +v1190v1 = get_local __ptr u64, other_1 +v1191v1 = const u64 5 +store v1191v1 to v1190v1 +v1193v1 = load v1189v1 +v1194v1 = get_local __ptr u64, other_1 +v1195v1 = load v1194v1 +v1196v1 = cmp eq v1193v1 v1195v1 +v1198v1 = const unit () +ret () v1198v1 +}", + ); + + let function = ir + .module_iter() + .find_map(|m| { + m.function_iter(&ir) + .find(|f| f.get_name(&ir) == "just_for_loop_15") + }) + .unwrap(); + + let po = compute_post_order(&ir, &function); + let domtree = compute_dom_tree(&ir, function, &po).unwrap(); + let r = compute_loop_analysis(&ir, &domtree, &po).unwrap(); + expect_test::expect![[r#" + LoopAnalysis { + block_to_loops: { + "block1": [ + 0, + ], + "is_none_22_block1": [ + 0, + ], + "is_none_22_block2": [ + 0, + ], + "while": [ + 0, + ], + "while_body": [ + 0, + ], + }, + loops: { + 0: [ + "block1", + "is_none_22_block1", + "is_none_22_block2", + "while", + "while_body", + ], + }, + }"#]] + .assert_eq(&format!("{:#?}", r.with_context(&ir))); + } +} diff --git a/sway-ir/src/optimize/conditional_constprop.rs b/sway-ir/src/optimize/conditional_constprop.rs index 17d7011ff77..9d11a0a8080 100644 --- a/sway-ir/src/optimize/conditional_constprop.rs +++ b/sway-ir/src/optimize/conditional_constprop.rs @@ -24,8 +24,6 @@ pub fn ccp( analyses: &AnalysisResults, function: Function, ) -> Result { - let mut modified = false; - let dom_tree: &DomTree = analyses.get_analysis_result(function); // In the set of blocks dominated by `key`, replace all uses of `val.0` with `val.1`. @@ -61,13 +59,14 @@ pub fn ccp( } } - // lets walk the dominator tree from the root. - let root_block = function.get_entry_block(context); - if dom_region_replacements.is_empty() { return Ok(false); } + // lets walk the dominator tree from the root. + let root_block = function.get_entry_block(context); + let mut modified = false; + let mut stack = vec![(root_block, 0)]; let mut replacements = FxHashMap::default(); while let Some((block, next_child)) = stack.last().cloned() { diff --git a/sway-ir/src/optimize/inline.rs b/sway-ir/src/optimize/inline.rs index 7433b03e845..68bb08dee8d 100644 --- a/sway-ir/src/optimize/inline.rs +++ b/sway-ir/src/optimize/inline.rs @@ -27,7 +27,7 @@ pub fn create_fn_inline_pass() -> Pass { Pass { name: FN_INLINE_NAME, descr: "Function inlining", - deps: vec![], + deps: vec![/*LOOP_ANALYSIS_NAME*/], runner: ScopedPass::ModulePass(PassMutability::Transform(fn_inline)), } } @@ -74,7 +74,7 @@ pub fn metadata_to_inline(context: &Context, md_idx: Option) -> O pub fn fn_inline( context: &mut Context, - _: &AnalysisResults, + _analyses: &AnalysisResults, module: Module, ) -> Result { // Inspect ALL calls and count how often each function is called. @@ -84,7 +84,7 @@ pub fn fn_inline( .fold(HashMap::new(), |mut counts, func| { for (_block, ins) in func.instruction_iter(context) { if let Some(Instruction { - op: InstOp::Call(callee, _args), + op: InstOp::Call(callee, _), .. }) = ins.get_instruction(context) { @@ -97,6 +97,8 @@ pub fn fn_inline( counts }); + const MAX_CALLEE_INSTRUCTION_COUNT_TO_INLINE: usize = 12; + const MAX_CALLS_COUNT_TO_INLINE: u64 = 1; let inline_heuristic = |ctx: &Context, func: &Function, _call_site: &Value| { // The encoding code in the `__entry` functions contains pointer patterns that mark // escape analysis and referred symbols as incomplete. This effectively forbids optimizations @@ -118,14 +120,52 @@ pub fn fn_inline( None => {} } - // If the function is called only once then definitely inline it. - if call_counts.get(func).copied().unwrap_or(0) == 1 { + // This is disabled as we have not found it useful at this point + // Needs better exploration with other parameters. + // + // We do not deal very well with asm blocks, so avoid inlining functions with + // asm blocks with more than 1 instructions (normally transmutes) + // let has_asm_block = func + // .instruction_iter(ctx) + // .any(|(_, v)| match v.get_instruction(ctx) { + // Some(Instruction { + // op: InstOp::AsmBlock(block, ..), + // .. + // }) => block.body.len() > 1, + // _ => false, + // }); + // if has_asm_block { + // return false; + // } + + // Inline run multiple times. Every time a call is inlined, + // its call count decreases. So it is possible that a function + // called multiple times, after all inlining ends up being called just once. + // At this point this algo will think it makes sense to inline it one last time. + // + // We need improvement here. + // + // If the function is called less than the threshold, inline it. + if call_counts.get(func).copied().unwrap_or(0) <= MAX_CALLS_COUNT_TO_INLINE { return true; } + let threshold = MAX_CALLEE_INSTRUCTION_COUNT_TO_INLINE; + + // This is disabled as we have not found it useful at this point + // Needs better exploration with other parameters. + // + // If call site is inside loops, increase the threshold + // let call_site_fn = call_site.get_parent_function(ctx).unwrap(); + // let la: &LoopAnalysis = analyses.get_analysis_result(call_site_fn); + // if let Some(block) = call_site.get_parent_block(ctx) { + // if la.is_inside_loop(&block) { + // threshold = MAX_CALLEE_INSTRUCTION_COUNT_TO_INLINE * 2; + // } + // } + // If the function is (still) small then also inline it. - const MAX_INLINE_INSTRS_COUNT: usize = 12; - if func.num_instructions_incl_asm_instructions(ctx) <= MAX_INLINE_INSTRS_COUNT { + if func.num_instructions_incl_asm_instructions(ctx) <= threshold { return true; } @@ -140,6 +180,7 @@ pub fn fn_inline( for function in functions { modified |= inline_some_function_calls(context, &function, inline_heuristic)?; } + Ok(modified) } @@ -162,33 +203,41 @@ pub fn inline_all_function_calls( /// - The number of calls made to the function or if the function is called inside a loop. /// - A particular call has constant arguments implying further constant folding. /// - An attribute request, e.g., #[always_inline], #[never_inline]. -pub fn inline_some_function_calls bool>( +pub fn inline_some_function_calls( context: &mut Context, function: &Function, - predicate: F, + should_inline: impl Fn(&Context, &Function, &Value) -> bool, ) -> Result { // Find call sites which passes the predicate. // We use a RefCell so that the inliner can modify the value // when it moves other instructions (which could be in call_date) after an inline. let (call_sites, call_data): (Vec<_>, FxHashMap<_, _>) = function .instruction_iter(context) - .filter_map(|(block, call_val)| match context.values[call_val.0].value { - ValueDatum::Instruction(Instruction { - op: InstOp::Call(inlined_function, _), - .. - }) => predicate(context, &inlined_function, &call_val).then_some(( - call_val, - (call_val, RefCell::new((block, inlined_function))), - )), - _ => None, - }) + .filter_map( + |(block, call_site)| match context.values[call_site.0].value { + ValueDatum::Instruction(Instruction { + op: InstOp::Call(candidate_function, _), + .. + }) => { + if should_inline(context, &candidate_function, &call_site) { + Some(( + call_site, + (call_site, RefCell::new((block, candidate_function))), + )) + } else { + None + } + } + _ => None, + }, + ) .unzip(); for call_site in &call_sites { let call_site_in = call_data.get(call_site).unwrap(); - let (block, inlined_function) = *call_site_in.borrow(); + let (block, being_inlined) = *call_site_in.borrow(); - if function == &inlined_function { + if function == &being_inlined { // We can't inline a function into itself. continue; } @@ -198,7 +247,7 @@ pub fn inline_some_function_calls bool>( *function, block, *call_site, - inlined_function, + being_inlined, &call_data, )?; } diff --git a/sway-ir/src/optimize/memcpyopt.rs b/sway-ir/src/optimize/memcpyopt.rs index 0a99af6f7de..b32714b8b3d 100644 --- a/sway-ir/src/optimize/memcpyopt.rs +++ b/sway-ir/src/optimize/memcpyopt.rs @@ -37,13 +37,6 @@ pub fn mem_copy_opt( Ok(modified) } -struct InstInfo { - // The block containing the instruction. - block: Block, - // Relative (use only for comparison) position of instruction in `block`. - pos: usize, -} - // If the source is an Arg, we replace uses of destination with Arg. // Otherwise (`get_local`), we replace the local symbol in-place. enum ReplaceWith { @@ -67,6 +60,13 @@ fn local_copy_prop_prememcpy( ) -> Result { let mut modified = false; + struct InstInfo { + // The block containing the instruction. + block: Block, + // Relative (use only for comparison) position of instruction in `block`. + pos: usize, + } + // If the analysis result is incomplete we cannot do any safe optimizations here. // Calculating the candidates below relies on complete result of an escape analysis. let escaped_symbols = match analyses.get_analysis_result(function) { @@ -556,7 +556,8 @@ fn local_copy_prop( // optimization possible. We could track just the changes and do it // all in one go, but that would complicate the algorithm. So I've // marked this as a TODO for now (#4600). - loop { + // 100 here just to avoid infinite recursion. + for _ in 0..100 { available_copies = FxHashSet::default(); src_to_copies = IndexMap::default(); dest_to_copies = IndexMap::default(); diff --git a/sway-ir/src/pass_manager.rs b/sway-ir/src/pass_manager.rs index 34d326efad1..a3ba8b76a9b 100644 --- a/sway-ir/src/pass_manager.rs +++ b/sway-ir/src/pass_manager.rs @@ -4,14 +4,15 @@ use crate::{ create_dom_fronts_pass, create_dominators_pass, create_escaped_symbols_pass, create_fn_dedup_debug_profile_pass, create_fn_dedup_release_profile_pass, create_fn_inline_pass, create_globals_dce_pass, create_init_aggr_lowering_pass, - create_mem2reg_pass, create_memcpyopt_pass, create_memcpyprop_reverse_pass, - create_misc_demotion_pass, create_module_printer_pass, create_module_verifier_pass, - create_postorder_pass, create_ret_demotion_pass, create_simplify_cfg_pass, create_sroa_pass, - Context, Function, IrError, Module, ARG_DEMOTION_NAME, ARG_POINTEE_MUTABILITY_TAGGER_NAME, - CCP_NAME, CONST_DEMOTION_NAME, CONST_FOLDING_NAME, CSE_NAME, DCE_NAME, - FN_DEDUP_DEBUG_PROFILE_NAME, FN_DEDUP_RELEASE_PROFILE_NAME, FN_INLINE_NAME, GLOBALS_DCE_NAME, - INIT_AGGR_LOWERING_NAME, MEM2REG_NAME, MEMCPYOPT_NAME, MEMCPYPROP_REVERSE_NAME, - MISC_DEMOTION_NAME, RET_DEMOTION_NAME, SIMPLIFY_CFG_NAME, SROA_NAME, + create_loop_analysis_pass, create_mem2reg_pass, create_memcpyopt_pass, + create_memcpyprop_reverse_pass, create_misc_demotion_pass, create_module_printer_pass, + create_module_verifier_pass, create_postorder_pass, create_ret_demotion_pass, + create_simplify_cfg_pass, create_sroa_pass, Context, Function, IrError, Module, + ARG_DEMOTION_NAME, ARG_POINTEE_MUTABILITY_TAGGER_NAME, CCP_NAME, CONST_DEMOTION_NAME, + CONST_FOLDING_NAME, CSE_NAME, DCE_NAME, FN_DEDUP_DEBUG_PROFILE_NAME, + FN_DEDUP_RELEASE_PROFILE_NAME, FN_INLINE_NAME, GLOBALS_DCE_NAME, INIT_AGGR_LOWERING_NAME, + MEM2REG_NAME, MEMCPYOPT_NAME, MEMCPYPROP_REVERSE_NAME, MISC_DEMOTION_NAME, RET_DEMOTION_NAME, + SIMPLIFY_CFG_NAME, SROA_NAME, }; use downcast_rs::{impl_downcast, Downcast}; use rustc_hash::FxHashMap; @@ -364,11 +365,25 @@ impl PassManager { /// Run the `passes` and return true if the `passes` modify the initial `ir`. pub fn run(&mut self, ir: &mut Context, passes: &PassGroup) -> Result { - let mut modified = false; - for pass in passes.flatten_pass_group() { - modified |= self.actually_run(ir, pass)?; + let mut global_modified = false; + let passes = passes.flatten_pass_group(); + + // run until stabilize + for _ in 0..16 { + let mut modified = false; + + for pass in passes.iter() { + modified |= self.actually_run(ir, pass)?; + } + + if !modified { + break; + } + + global_modified |= modified; } - Ok(modified) + + Ok(global_modified) } /// Run the `passes` and return true if the `passes` modify the initial `ir`. @@ -393,10 +408,11 @@ impl PassManager { std::env::var("SWAY_FORCE_VERIFY_IR").unwrap_or_else(|_| "false".to_string()); let force_verify: bool = force_verify.parse().unwrap_or(false); - for _ in 0..2 { + let passes = passes.flatten_pass_group(); + for _ in 0..16 { let mut iter_modified = false; - for pass in passes.flatten_pass_group() { + for pass in passes.iter() { // Save IR before optimisation only when forcing verification let ir_before = if force_verify { ir.to_string() @@ -416,7 +432,7 @@ impl PassManager { iter_modified |= modified; - if print_opts.passes.contains(pass) && (!print_opts.modified_only || modified) { + if print_opts.passes.contains(*pass) && (!print_opts.modified_only || modified) { print_ir_after_pass(ir, self.lookup_registered_pass(pass).unwrap()); } @@ -534,6 +550,7 @@ pub fn register_known_passes(pm: &mut PassManager) { pm.register(create_escaped_symbols_pass()); pm.register(create_module_printer_pass()); pm.register(create_module_verifier_pass()); + pm.register(create_loop_analysis_pass()); // Lowering passes. pm.register(create_init_aggr_lowering_pass()); diff --git a/sway-ir/src/printer.rs b/sway-ir/src/printer.rs index 084aca8c922..4ea364bb9a9 100644 --- a/sway-ir/src/printer.rs +++ b/sway-ir/src/printer.rs @@ -190,18 +190,24 @@ pub fn function_print( } /// Print an instruction to stdout. -pub fn instruction_print(context: &Context, ins_value: &Value) { +/// Incomplete impl is fine here as this is only used for debugging the compiler. +pub fn instruction_print(s: &mut impl std::fmt::Write, context: &Context, ins_value: &Value) { let mut md_namer = MetadataNamer::default(); - let block = ins_value - .get_instruction(context) - .expect("Calling instruction printer on non-instruction value") - .parent; - let function = block.get_function(context); - let mut namer = Namer::new(function); - println!( - "{}", - instruction_to_doc(context, &mut md_namer, &mut namer, &block, ins_value).build() - ); + + if let Some(ins) = ins_value.get_instruction(context) { + let block = ins.parent; + let function = block.get_function(context); + let mut namer = Namer::new(function); + let _ = write!( + s, + "{}", + instruction_to_doc(context, &mut md_namer, &mut namer, &block, ins_value).build() + ); + } else if let Some(c) = ins_value.get_constant(context) { + let _ = write!(s, "const {c:?}"); + } else { + todo!(); + } } pub const MODULE_PRINTER_NAME: &str = "module-printer"; diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap index f19917478f6..14596704498 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap @@ -33,6 +33,10 @@ script { } entry_orig fn main_0() -> (), !13 { + local { __ptr u8, u64 } __anon_0 + local { __ptr u8, u64 } __anon_00 + local slice __log_arg + local slice __log_arg0 local [u8; 5] __ret_val local [u64; 5] __ret_val0 local [u64; 5] __ret_val1 @@ -51,6 +55,8 @@ script { local [u64; 25] __ret_val8 local [u64; 25] __ret_val9 local [u8; 1] array + local u8 value_ + local u8 value_0 entry(): v1930v1 = get_local __ptr [u8; 5], __ret_val @@ -100,109 +106,133 @@ script { cbr v1900v1, assert_eq_44_block0(), assert_eq_44_block1(), !33 assert_eq_44_block0(): - v1907v1 = call log_47(v815v1), !36 - v1909v1 = call log_47(v816v1), !39 + v1907v3 = get_local __ptr u8, value_, !36 + mem_copy_val v1907v3, v814v1 + v2108v1 = get_local __ptr { __ptr u8, u64 }, __anon_0, !41 + v895v1 = const u64 0 + v2109v1 = get_elem_ptr v2108v1, __ptr __ptr u8, v895v1, !42 + store v1907v3 to v2109v1, !43 + v898v1 = const u64 1 + v2111v1 = get_elem_ptr v2108v1, __ptr u64, v898v1, !44 + v648v1 = const u64 1 + store v648v1 to v2111v1, !45 + v2113v1 = cast_ptr v2108v1 to __ptr slice, !46 + v2114v1 = get_local __ptr slice, __log_arg, !36 + mem_copy_val v2114v1, v2113v1, !36 + v781v1 = const u64 14454674236531057292 + log __ptr slice v2114v1, v781v1, !36 + v1909v3 = get_local __ptr u8, value_0, !49 + store v816v1 to v1909v3, !49 + v2120v1 = get_local __ptr { __ptr u8, u64 }, __anon_00, !50 + v2121v1 = get_elem_ptr v2120v1, __ptr __ptr u8, v895v1, !51 + store v1909v3 to v2121v1, !52 + v2123v1 = get_elem_ptr v2120v1, __ptr u64, v898v1, !53 + store v648v1 to v2123v1, !54 + v2125v1 = cast_ptr v2120v1 to __ptr slice, !55 + v2126v1 = get_local __ptr slice, __log_arg0, !49 + mem_copy_val v2126v1, v2125v1, !49 + log __ptr slice v2126v1, v781v1, !49 v909v1 = const u64 18446744073709486083 - revert v909v1, !44 + revert v909v1, !60 assert_eq_44_block1(): v819v1 = const unit () ret () v819v1 } - fn array_repeat_zero_small_u8_1(mut __ret_value: __ptr [u8; 5]) -> (), !48 { + fn array_repeat_zero_small_u8_1(mut __ret_value: __ptr [u8; 5]) -> (), !64 { entry(mut __ret_value: __ptr [u8; 5]): - mem_clear_val __ret_value, !49 + mem_clear_val __ret_value, !65 v1928v1 = const unit () ret () v1928v1 } - fn array_repeat_zero_small_u16_2(mut __ret_value: __ptr [u64; 5]) -> (), !52 { + fn array_repeat_zero_small_u16_2(mut __ret_value: __ptr [u64; 5]) -> (), !68 { entry(mut __ret_value: __ptr [u64; 5]): - mem_clear_val __ret_value, !53 + mem_clear_val __ret_value, !69 v1935v1 = const unit () ret () v1935v1 } - fn array_repeat_zero_small_u256_5(mut __ret_value: __ptr [u256; 5]) -> (), !56 { + fn array_repeat_zero_small_u256_5(mut __ret_value: __ptr [u256; 5]) -> (), !72 { entry(mut __ret_value: __ptr [u256; 5]): - mem_clear_val __ret_value, !57 + mem_clear_val __ret_value, !73 v1948v1 = const unit () ret () v1948v1 } - fn array_repeat_zero_small_b256_6(mut __ret_value: __ptr [b256; 5]) -> (), !60 { + fn array_repeat_zero_small_b256_6(mut __ret_value: __ptr [b256; 5]) -> (), !76 { entry(mut __ret_value: __ptr [b256; 5]): - mem_clear_val __ret_value, !61 + mem_clear_val __ret_value, !77 v1955v1 = const unit () ret () v1955v1 } - fn array_repeat_zero_small_bool_7(mut __ret_value: __ptr [bool; 5]) -> (), !64 { + fn array_repeat_zero_small_bool_7(mut __ret_value: __ptr [bool; 5]) -> (), !80 { entry(mut __ret_value: __ptr [bool; 5]): - mem_clear_val __ret_value, !65 + mem_clear_val __ret_value, !81 v1962v1 = const unit () ret () v1962v1 } - fn array_repeat_zero_big_u8_8(mut __ret_value: __ptr [u8; 25]) -> (), !68 { + fn array_repeat_zero_big_u8_8(mut __ret_value: __ptr [u8; 25]) -> (), !84 { entry(mut __ret_value: __ptr [u8; 25]): - mem_clear_val __ret_value, !69 + mem_clear_val __ret_value, !85 v1969v1 = const unit () ret () v1969v1 } - fn array_repeat_zero_big_u32_10(mut __ret_value: __ptr [u64; 25]) -> (), !72 { + fn array_repeat_zero_big_u32_10(mut __ret_value: __ptr [u64; 25]) -> (), !88 { entry(mut __ret_value: __ptr [u64; 25]): - mem_clear_val __ret_value, !73 + mem_clear_val __ret_value, !89 v1976v1 = const unit () ret () v1976v1 } - fn array_repeat_zero_big_u256_12(mut __ret_value: __ptr [u256; 25]) -> (), !76 { + fn array_repeat_zero_big_u256_12(mut __ret_value: __ptr [u256; 25]) -> (), !92 { entry(mut __ret_value: __ptr [u256; 25]): - mem_clear_val __ret_value, !77 + mem_clear_val __ret_value, !93 v1989v1 = const unit () ret () v1989v1 } - fn array_repeat_zero_big_b256_13(mut __ret_value: __ptr [b256; 25]) -> (), !80 { + fn array_repeat_zero_big_b256_13(mut __ret_value: __ptr [b256; 25]) -> (), !96 { entry(mut __ret_value: __ptr [b256; 25]): - mem_clear_val __ret_value, !81 + mem_clear_val __ret_value, !97 v1996v1 = const unit () ret () v1996v1 } - fn array_repeat_zero_big_bool_14(mut __ret_value: __ptr [bool; 25]) -> (), !84 { + fn array_repeat_zero_big_bool_14(mut __ret_value: __ptr [bool; 25]) -> (), !100 { entry(mut __ret_value: __ptr [bool; 25]): - mem_clear_val __ret_value, !85 + mem_clear_val __ret_value, !101 v2003v1 = const unit () ret () v2003v1 } - fn small_array_repeat_15(mut __ret_value: __ptr [bool; 5]) -> (), !88 { + fn small_array_repeat_15(mut __ret_value: __ptr [bool; 5]) -> (), !104 { entry(mut __ret_value: __ptr [bool; 5]): v837v1 = const u64 0 - v838v1 = get_elem_ptr __ret_value, __ptr bool, v837v1, !89 + v838v1 = get_elem_ptr __ret_value, __ptr bool, v837v1, !105 v117v1 = const bool true - store v117v1 to v838v1, !89 + store v117v1 to v838v1, !105 v840v1 = const u64 1 - v841v1 = get_elem_ptr __ret_value, __ptr bool, v840v1, !89 - store v117v1 to v841v1, !89 + v841v1 = get_elem_ptr __ret_value, __ptr bool, v840v1, !105 + store v117v1 to v841v1, !105 v843v1 = const u64 2 - v844v1 = get_elem_ptr __ret_value, __ptr bool, v843v1, !89 - store v117v1 to v844v1, !89 + v844v1 = get_elem_ptr __ret_value, __ptr bool, v843v1, !105 + store v117v1 to v844v1, !105 v846v1 = const u64 3 - v847v1 = get_elem_ptr __ret_value, __ptr bool, v846v1, !89 - store v117v1 to v847v1, !89 + v847v1 = get_elem_ptr __ret_value, __ptr bool, v846v1, !105 + store v117v1 to v847v1, !105 v849v1 = const u64 4 - v850v1 = get_elem_ptr __ret_value, __ptr bool, v849v1, !89 - store v117v1 to v850v1, !89 + v850v1 = get_elem_ptr __ret_value, __ptr bool, v849v1, !105 + store v117v1 to v850v1, !105 v2010v1 = const unit () ret () v2010v1 } - fn big_array_repeat_16(mut __ret_value: __ptr [bool; 25]) -> (), !92 { + fn big_array_repeat_16(mut __ret_value: __ptr [bool; 25]) -> (), !108 { entry(mut __ret_value: __ptr [bool; 25]): v853v1 = const u64 0 br array_init_loop(v853v1) @@ -210,7 +240,7 @@ script { array_init_loop(mut v852v1: u64): v855v1 = get_elem_ptr __ret_value, __ptr bool, v852v1 v125v1 = const bool true - store v125v1 to v855v1, !93 + store v125v1 to v855v1, !109 v857v1 = const u64 1 v858v1 = add v852v1, v857v1 v859v1 = const u64 25 @@ -222,20 +252,20 @@ script { ret () v2017v1 } - fn u8_array_bigger_than_18_bits_17(mut __ret_value: __ptr [u8; 262145]) -> (), !96 { + fn u8_array_bigger_than_18_bits_17(mut __ret_value: __ptr [u8; 262145]) -> (), !112 { entry(mut __ret_value: __ptr [u8; 262145]): - mem_clear_val __ret_value, !97 + mem_clear_val __ret_value, !113 v2024v1 = const unit () ret () v2024v1 } - fn arrays_with_const_length_18() -> (), !100 { + fn arrays_with_const_length_18() -> (), !116 { entry(): v191v1 = const unit () ret () v191v1 } - fn decode_array_19(mut __ret_value: __ptr [u8; 1]) -> (), !103 { + fn decode_array_19(mut __ret_value: __ptr [u8; 1]) -> (), !119 { local slice __anon_00 local [u8; 1] __array_init_0 local slice __ret_val @@ -244,29 +274,29 @@ script { local slice s entry(mut __ret_value: __ptr [u8; 1]): - v247v1 = get_local __ptr [u8; 1], __array_init_0, !104 + v247v1 = get_local __ptr [u8; 1], __array_init_0, !120 v880v1 = const u64 0 - v881v1 = get_elem_ptr v247v1, __ptr u8, v880v1, !104 - v248v1 = const u8 255, !105 - store v248v1 to v881v1, !104 + v881v1 = get_elem_ptr v247v1, __ptr u8, v880v1, !120 + v248v1 = const u8 255, !121 + store v248v1 to v881v1, !120 v2040v1 = get_local __ptr slice, __ret_val v2041v1 = call to_slice_20(v247v1, v2040v1) - v252v1 = get_local __ptr slice, s, !106 + v252v1 = get_local __ptr slice, s, !122 mem_copy_val v252v1, v2040v1 - v1467v1 = get_local __ptr slice, data_, !109 + v1467v1 = get_local __ptr slice, data_, !125 mem_copy_val v1467v1, v252v1 v1922v1 = get_local __ptr slice, __tmp_arg0 mem_copy_val v1922v1, v252v1 - v1924v3 = get_local __ptr slice, __anon_00, !113 + v1924v3 = get_local __ptr slice, __anon_00, !129 mem_copy_val v1924v3, v252v1 - v2087v1 = cast_ptr v1924v3 to __ptr { ptr, u64 }, !113 + v2087v1 = cast_ptr v1924v3 to __ptr { ptr, u64 }, !129 v2074v1 = const u64 0 v2088v1 = get_elem_ptr v2087v1, __ptr ptr, v2074v1 v2089v1 = load v2088v1 v266v1 = const u64 1 - v1652v1 = asm(size: v266v1, src: v2089v1) -> __ptr [u8; 1] hp, !116 { - aloc size, !117 - mcp hp src size, !118 + v1652v1 = asm(size: v266v1, src: v2089v1) -> __ptr [u8; 1] hp, !131 { + aloc size, !132 + mcp hp src size, !133 } v2096v1 = const u64 0 v2097v1 = get_elem_ptr v1652v1, __ptr u8, v2096v1 @@ -278,52 +308,27 @@ script { ret () v2031v1 } - fn to_slice_20(mut array: __ptr [u8; 1], mut __ret_value: __ptr slice) -> (), !121 { + fn to_slice_20(mut array: __ptr [u8; 1], mut __ret_value: __ptr slice) -> (), !136 { local { ptr, u64 } __anon_0 local [u8; 1] array_ entry(array: __ptr [u8; 1], mut __ret_value: __ptr slice): v197v1 = get_local __ptr [u8; 1], array_ mem_copy_val v197v1, array - v242v1 = cast_ptr v197v1 to ptr, !122 - v929v1 = get_local __ptr { ptr, u64 }, __anon_0, !126 + v242v1 = cast_ptr v197v1 to ptr, !137 + v929v1 = get_local __ptr { ptr, u64 }, __anon_0, !141 v883v1 = const u64 0 - v938v1 = get_elem_ptr v929v1, __ptr ptr, v883v1, !127 - store v242v1 to v938v1, !128 + v938v1 = get_elem_ptr v929v1, __ptr ptr, v883v1, !142 + store v242v1 to v938v1, !143 v886v1 = const u64 1 - v940v1 = get_elem_ptr v929v1, __ptr u64, v886v1, !129 - v936v1 = const u64 1, !132 - store v936v1 to v940v1, !133 - v949v1 = cast_ptr v929v1 to __ptr slice, !136 + v940v1 = get_elem_ptr v929v1, __ptr u64, v886v1, !144 + v936v1 = const u64 1, !147 + store v936v1 to v940v1, !148 + v949v1 = cast_ptr v929v1 to __ptr slice, !151 mem_copy_val __ret_value, v949v1 v2038v1 = const unit () ret () v2038v1 } - - pub fn log_47(mut value !138: u8) -> (), !141 { - local { __ptr u8, u64 } __anon_0 - local slice __log_arg - local u8 value_ - - entry(mut value: u8): - v638v1 = get_local __ptr u8, value_ - store value to v638v1 - v1845v1 = get_local __ptr { __ptr u8, u64 }, __anon_0, !144 - v895v1 = const u64 0 - v1848v1 = get_elem_ptr v1845v1, __ptr __ptr u8, v895v1, !145 - store v638v1 to v1848v1, !146 - v898v1 = const u64 1 - v1850v1 = get_elem_ptr v1845v1, __ptr u64, v898v1, !147 - v648v1 = const u64 1 - store v648v1 to v1850v1, !148 - v1855v1 = cast_ptr v1845v1 to __ptr slice, !142 - v2043v1 = get_local __ptr slice, __log_arg - mem_copy_val v2043v1, v1855v1 - v781v1 = const u64 14454674236531057292 - log __ptr slice v2043v1, v781v1 - v785v1 = const unit () - ret () v785v1 - } } !0 = "test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/src/main..sw" @@ -363,118 +368,121 @@ script { !34 = span !22 1883 1890 !35 = fn_call_path_span !22 1883 1886 !36 = (!20 !21 !34 !35) -!37 = span !22 1900 1907 -!38 = fn_call_path_span !22 1900 1903 -!39 = (!20 !21 !37 !38) -!40 = span !22 1917 1948 -!41 = fn_call_path_span !22 1917 1923 -!42 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/revert.sw" -!43 = span !42 757 771 -!44 = (!20 !21 !40 !41 !43) -!45 = span !10 58 117 -!46 = fn_name_span !10 61 87 -!47 = inline "never" -!48 = (!45 !46 !47) -!49 = span !10 107 115 -!50 = span !10 220 282 -!51 = fn_name_span !10 223 250 -!52 = (!50 !51 !47) -!53 = span !10 271 280 -!54 = span !10 725 855 -!55 = fn_name_span !10 728 756 -!56 = (!54 !55 !47) -!57 = span !10 778 853 -!58 = span !10 1030 1156 -!59 = fn_name_span !10 1033 1061 -!60 = (!58 !59 !47) -!61 = span !10 1083 1154 -!62 = span !10 1327 1392 -!63 = fn_name_span !10 1330 1358 -!64 = (!62 !63 !47) -!65 = span !10 1380 1390 -!66 = span !10 135 194 -!67 = fn_name_span !10 138 162 -!68 = (!66 !67 !47) -!69 = span !10 183 192 -!70 = span !10 468 530 -!71 = fn_name_span !10 471 496 -!72 = (!70 !71 !47) -!73 = span !10 518 528 -!74 = span !10 873 1003 -!75 = fn_name_span !10 876 902 -!76 = (!74 !75 !47) -!77 = span !10 925 1001 -!78 = span !10 1174 1300 -!79 = fn_name_span !10 1177 1203 -!80 = (!78 !79 !47) -!81 = span !10 1226 1298 -!82 = span !10 1410 1475 -!83 = fn_name_span !10 1413 1439 -!84 = (!82 !83 !47) -!85 = span !10 1462 1473 -!86 = span !10 1536 1590 -!87 = fn_name_span !10 1539 1557 -!88 = (!86 !87 !47) -!89 = span !10 1579 1588 -!90 = span !10 1633 1687 -!91 = fn_name_span !10 1636 1652 -!92 = (!90 !91 !47) -!93 = span !10 1675 1685 -!94 = span !10 1781 1852 -!95 = fn_name_span !10 1784 1812 -!96 = (!94 !95 !47) -!97 = span !10 1837 1850 -!98 = span !10 1947 2196 -!99 = fn_name_span !10 1950 1974 -!100 = (!98 !99 !47) -!101 = span !10 3070 3173 -!102 = fn_name_span !10 3073 3085 -!103 = (!101 !102 !47) -!104 = span !10 3133 3140 -!105 = span !10 3134 3139 -!106 = span !10 3105 3142 -!107 = span !10 3147 3171 -!108 = fn_call_path_span !10 3147 3157 -!109 = (!107 !108) -!110 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/raw_slice.sw" -!111 = span !110 3718 3734 -!112 = fn_call_path_span !110 3718 3728 -!113 = (!111 !112) -!114 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/codec.sw" -!115 = span !114 57427 57542 -!116 = (!107 !108 !115) -!117 = span !114 57474 57483 -!118 = span !114 57497 57512 -!119 = span !10 3192 3320 -!120 = fn_name_span !10 3195 3203 -!121 = (!119 !120 !47) -!122 = span !10 3296 3312 -!123 = span !10 3268 3318 -!124 = fn_call_path_span !10 3268 3289 -!125 = span !110 2411 2442 -!126 = (!123 !124 !125) -!127 = (!123 !124 !125) -!128 = (!123 !124 !125) -!129 = (!123 !124 !125) -!130 = span !110 2417 2441 -!131 = fn_call_path_span !110 2423 2424 -!132 = (!123 !124 !130 !131) -!133 = (!123 !124 !125) -!134 = span !110 2400 2443 -!135 = fn_call_path_span !110 2400 2410 -!136 = (!123 !124 !134 !135) -!137 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/logging.sw" -!138 = span !137 591 596 -!139 = span !137 577 651 -!140 = fn_name_span !137 584 587 -!141 = (!139 !140) -!142 = span !137 642 647 -!143 = span !114 56610 56622 -!144 = (!142 !143) -!145 = (!142 !143) -!146 = (!142 !143) -!147 = (!142 !143) -!148 = (!142 !143) +!37 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/logging.sw" +!38 = span !37 642 647 +!39 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/codec.sw" +!40 = span !39 56610 56622 +!41 = (!20 !21 !34 !35 !38 !40) +!42 = (!20 !21 !34 !35 !38 !40) +!43 = (!20 !21 !34 !35 !38 !40) +!44 = (!20 !21 !34 !35 !38 !40) +!45 = (!20 !21 !34 !35 !38 !40) +!46 = (!20 !21 !34 !35 !38) +!47 = span !22 1900 1907 +!48 = fn_call_path_span !22 1900 1903 +!49 = (!20 !21 !47 !48) +!50 = (!20 !21 !47 !48 !38 !40) +!51 = (!20 !21 !47 !48 !38 !40) +!52 = (!20 !21 !47 !48 !38 !40) +!53 = (!20 !21 !47 !48 !38 !40) +!54 = (!20 !21 !47 !48 !38 !40) +!55 = (!20 !21 !47 !48 !38) +!56 = span !22 1917 1948 +!57 = fn_call_path_span !22 1917 1923 +!58 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/revert.sw" +!59 = span !58 757 771 +!60 = (!20 !21 !56 !57 !59) +!61 = span !10 58 117 +!62 = fn_name_span !10 61 87 +!63 = inline "never" +!64 = (!61 !62 !63) +!65 = span !10 107 115 +!66 = span !10 220 282 +!67 = fn_name_span !10 223 250 +!68 = (!66 !67 !63) +!69 = span !10 271 280 +!70 = span !10 725 855 +!71 = fn_name_span !10 728 756 +!72 = (!70 !71 !63) +!73 = span !10 778 853 +!74 = span !10 1030 1156 +!75 = fn_name_span !10 1033 1061 +!76 = (!74 !75 !63) +!77 = span !10 1083 1154 +!78 = span !10 1327 1392 +!79 = fn_name_span !10 1330 1358 +!80 = (!78 !79 !63) +!81 = span !10 1380 1390 +!82 = span !10 135 194 +!83 = fn_name_span !10 138 162 +!84 = (!82 !83 !63) +!85 = span !10 183 192 +!86 = span !10 468 530 +!87 = fn_name_span !10 471 496 +!88 = (!86 !87 !63) +!89 = span !10 518 528 +!90 = span !10 873 1003 +!91 = fn_name_span !10 876 902 +!92 = (!90 !91 !63) +!93 = span !10 925 1001 +!94 = span !10 1174 1300 +!95 = fn_name_span !10 1177 1203 +!96 = (!94 !95 !63) +!97 = span !10 1226 1298 +!98 = span !10 1410 1475 +!99 = fn_name_span !10 1413 1439 +!100 = (!98 !99 !63) +!101 = span !10 1462 1473 +!102 = span !10 1536 1590 +!103 = fn_name_span !10 1539 1557 +!104 = (!102 !103 !63) +!105 = span !10 1579 1588 +!106 = span !10 1633 1687 +!107 = fn_name_span !10 1636 1652 +!108 = (!106 !107 !63) +!109 = span !10 1675 1685 +!110 = span !10 1781 1852 +!111 = fn_name_span !10 1784 1812 +!112 = (!110 !111 !63) +!113 = span !10 1837 1850 +!114 = span !10 1947 2196 +!115 = fn_name_span !10 1950 1974 +!116 = (!114 !115 !63) +!117 = span !10 3070 3173 +!118 = fn_name_span !10 3073 3085 +!119 = (!117 !118 !63) +!120 = span !10 3133 3140 +!121 = span !10 3134 3139 +!122 = span !10 3105 3142 +!123 = span !10 3147 3171 +!124 = fn_call_path_span !10 3147 3157 +!125 = (!123 !124) +!126 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/raw_slice.sw" +!127 = span !126 3718 3734 +!128 = fn_call_path_span !126 3718 3728 +!129 = (!127 !128) +!130 = span !39 57427 57542 +!131 = (!123 !124 !130) +!132 = span !39 57474 57483 +!133 = span !39 57497 57512 +!134 = span !10 3192 3320 +!135 = fn_name_span !10 3195 3203 +!136 = (!134 !135 !63) +!137 = span !10 3296 3312 +!138 = span !10 3268 3318 +!139 = fn_call_path_span !10 3268 3289 +!140 = span !126 2411 2442 +!141 = (!138 !139 !140) +!142 = (!138 !139 !140) +!143 = (!138 !139 !140) +!144 = (!138 !139 !140) +!145 = span !126 2417 2441 +!146 = fn_call_path_span !126 2423 2424 +!147 = (!138 !139 !145 !146) +!148 = (!138 !139 !140) +!149 = span !126 2400 2443 +!150 = fn_call_path_span !126 2400 2410 +!151 = (!138 !139 !149 !150) ;; ASM: Final program ;; Program kind: Script @@ -491,97 +499,120 @@ cfei i0 ; allocate stack space for globals move $$locbase $sp ; [entry init: __entry]: set locals base register jal $$reta $pc i2 ; [call: main_0]: call function retd $zero $zero ; [entry end: __entry] return slice -pshh i531456 ; [fn init: main_0]: push used high registers 40..64 +pshh i531968 ; [fn init: main_0]: push used high registers 40..64 move $$locbase $sp ; [fn init: main_0]: set locals base register -cfei i264920 ; [fn init: main_0]: allocate: locals 264920 byte(s), call args 0 slot(s) +cfei i265000 ; [fn init: main_0]: allocate: locals 265000 byte(s), call args 0 slot(s) move $r1 $$reta ; [fn init: main_0]: save return address -move $$arg0 $$locbase ; [call: array_repeat_zero_small_u8_1]: pass argument 0 -jal $$reta $pc i87 ; [call: array_repeat_zero_small_u8_1]: call function -addi $r0 $$locbase i8 ; get offset to local __ptr [u64; 5] +addi $r0 $$locbase i64 ; get offset to local __ptr [u8; 5] +move $$arg0 $r0 ; [call: array_repeat_zero_small_u8_1]: pass argument 0 +jal $$reta $pc i109 ; [call: array_repeat_zero_small_u8_1]: call function +addi $r0 $$locbase i72 ; get offset to local __ptr [u64; 5] move $$arg0 $r0 ; [call: array_repeat_zero_small_u16_2]: pass argument 0 -jal $$reta $pc i88 ; [call: array_repeat_zero_small_u16_2]: call function -addi $r0 $$locbase i48 ; get offset to local __ptr [u64; 5] +jal $$reta $pc i110 ; [call: array_repeat_zero_small_u16_2]: call function +addi $r0 $$locbase i112 ; get offset to local __ptr [u64; 5] move $$arg0 $r0 ; [call: array_repeat_zero_small_u16_2]: pass argument 0 -jal $$reta $pc i85 ; [call: array_repeat_zero_small_u16_2]: call function -movi $r0 i32989 ; get word offset to local from base +jal $$reta $pc i107 ; [call: array_repeat_zero_small_u16_2]: call function +movi $r0 i32997 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_small_u16_2]: pass argument 0 -jal $$reta $pc i80 ; [call: array_repeat_zero_small_u16_2]: call function -movi $r0 i32994 ; get word offset to local from base +jal $$reta $pc i102 ; [call: array_repeat_zero_small_u16_2]: call function +movi $r0 i33002 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_small_u256_5]: pass argument 0 -jal $$reta $pc i79 ; [call: array_repeat_zero_small_u256_5]: call function -movi $r0 i33014 ; get word offset to local from base +jal $$reta $pc i101 ; [call: array_repeat_zero_small_u256_5]: call function +movi $r0 i33022 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_small_b256_6]: pass argument 0 -jal $$reta $pc i78 ; [call: array_repeat_zero_small_b256_6]: call function -movi $r0 i33034 ; get word offset to local from base +jal $$reta $pc i100 ; [call: array_repeat_zero_small_b256_6]: call function +movi $r0 i33042 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_small_bool_7]: pass argument 0 -jal $$reta $pc i77 ; [call: array_repeat_zero_small_bool_7]: call function -movi $r0 i33035 ; get word offset to local from base +jal $$reta $pc i99 ; [call: array_repeat_zero_small_bool_7]: call function +movi $r0 i33043 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_big_u8_8]: pass argument 0 -jal $$reta $pc i76 ; [call: array_repeat_zero_big_u8_8]: call function -movi $r0 i33039 ; get word offset to local from base +jal $$reta $pc i98 ; [call: array_repeat_zero_big_u8_8]: call function +movi $r0 i33047 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_big_u32_10]: pass argument 0 -jal $$reta $pc i75 ; [call: array_repeat_zero_big_u32_10]: call function -movi $r0 i33064 ; get word offset to local from base +jal $$reta $pc i97 ; [call: array_repeat_zero_big_u32_10]: call function +movi $r0 i33072 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_big_u32_10]: pass argument 0 -jal $$reta $pc i70 ; [call: array_repeat_zero_big_u32_10]: call function -movi $r0 i33089 ; get word offset to local from base +jal $$reta $pc i92 ; [call: array_repeat_zero_big_u32_10]: call function +movi $r0 i33097 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: array_repeat_zero_big_u32_10]: pass argument 0 -jal $$reta $pc i65 ; [call: array_repeat_zero_big_u32_10]: call function -addi $r0 $$locbase i88 ; get offset to local __ptr [u256; 25] +jal $$reta $pc i87 ; [call: array_repeat_zero_big_u32_10]: call function +addi $r0 $$locbase i152 ; get offset to local __ptr [u256; 25] move $$arg0 $r0 ; [call: array_repeat_zero_big_u256_12]: pass argument 0 -jal $$reta $pc i66 ; [call: array_repeat_zero_big_u256_12]: call function -addi $r0 $$locbase i888 ; get offset to local __ptr [b256; 25] +jal $$reta $pc i88 ; [call: array_repeat_zero_big_u256_12]: call function +addi $r0 $$locbase i952 ; get offset to local __ptr [b256; 25] move $$arg0 $r0 ; [call: array_repeat_zero_big_b256_13]: pass argument 0 -jal $$reta $pc i67 ; [call: array_repeat_zero_big_b256_13]: call function -addi $r0 $$locbase i1688 ; get offset to local __ptr [bool; 25] +jal $$reta $pc i89 ; [call: array_repeat_zero_big_b256_13]: call function +addi $r0 $$locbase i1752 ; get offset to local __ptr [bool; 25] move $$arg0 $r0 ; [call: array_repeat_zero_big_bool_14]: pass argument 0 -jal $$reta $pc i68 ; [call: array_repeat_zero_big_bool_14]: call function -addi $r0 $$locbase i1720 ; get offset to local __ptr [bool; 5] +jal $$reta $pc i90 ; [call: array_repeat_zero_big_bool_14]: call function +addi $r0 $$locbase i1784 ; get offset to local __ptr [bool; 5] move $$arg0 $r0 ; [call: small_array_repeat_15]: pass argument 0 -jal $$reta $pc i69 ; [call: small_array_repeat_15]: call function -addi $r0 $$locbase i1728 ; get offset to local __ptr [bool; 25] +jal $$reta $pc i91 ; [call: small_array_repeat_15]: call function +addi $r0 $$locbase i1792 ; get offset to local __ptr [bool; 25] move $$arg0 $r0 ; [call: big_array_repeat_16]: pass argument 0 -jal $$reta $pc i78 ; [call: big_array_repeat_16]: call function -addi $r0 $$locbase i1760 ; get offset to local __ptr [u8; 262145] +jal $$reta $pc i100 ; [call: big_array_repeat_16]: call function +addi $r0 $$locbase i1824 ; get offset to local __ptr [u8; 262145] move $$arg0 $r0 ; [call: u8_array_bigger_than_18_bits_17]: pass argument 0 -jal $$reta $pc i85 ; [call: u8_array_bigger_than_18_bits_17]: call function -jal $$reta $pc i89 ; [call: arrays_with_const_length_18]: call function -movi $r0 i33114 ; get word offset to local from base +jal $$reta $pc i107 ; [call: u8_array_bigger_than_18_bits_17]: call function +jal $$reta $pc i111 ; [call: arrays_with_const_length_18]: call function +movi $r0 i33122 ; get word offset to local from base muli $r0 $r0 i8 ; get byte offset to local from base add $r0 $$locbase $r0 ; get absolute byte offset to local move $$arg0 $r0 ; [call: decode_array_19]: pass argument 0 -jal $$reta $pc i87 ; [call: decode_array_19]: call function -lb $r0 $r0 i0 ; load byte -movi $r2 i255 ; initialize constant into register -eq $r2 $r0 $r2 +jal $$reta $pc i109 ; [call: decode_array_19]: call function +lb $r2 $r0 i0 ; load byte +movi $r3 i255 ; initialize constant into register +eq $r2 $r2 $r3 eq $r2 $r2 $zero jnzf $r2 $zero i1 -jmpf $zero i6 -move $$arg0 $r0 ; [call: log_47]: pass argument 0 -jal $$reta $pc i119 ; [call: log_47]: call function -movi $$arg0 i255 ; [call: log_47]: pass argument 0 -jal $$reta $pc i117 ; [call: log_47]: call function +jmpf $zero i28 +movi $r1 i33123 ; get word offset to local from base +muli $r1 $r1 i8 ; get byte offset to local from base +add $r1 $$locbase $r1 ; get absolute byte offset to local +mcpi $r1 $r0 i1 ; copy memory +sw $$locbase $r1 i0 ; store word +sw $$locbase $one i1 ; store word +addi $r0 $$locbase i32 ; get offset to local __ptr slice +mcpi $r0 $$locbase i16 ; copy memory load $r0 data_NonConfigurable_0; load constant from data section +lw $r1 $$locbase i4 ; load slice pointer for logging data +lw $r2 $$locbase i5 ; load slice size for logging data +logd $zero $r0 $r1 $r2 ; log slice +movi $r0 i33124 ; get word offset to local from base +muli $r0 $r0 i8 ; get byte offset to local from base +add $r0 $$locbase $r0 ; get absolute byte offset to local +movi $r1 i255 ; initialize constant into register +sb $r0 $r1 i0 ; store byte +addi $r1 $$locbase i16 ; get offset to local __ptr { __ptr u8, u64 } +sw $$locbase $r0 i2 ; store word +sw $$locbase $one i3 ; store word +addi $r0 $$locbase i48 ; get offset to local __ptr slice +mcpi $r0 $r1 i16 ; copy memory +load $r0 data_NonConfigurable_0; load constant from data section +lw $r1 $$locbase i6 ; load slice pointer for logging data +lw $r2 $$locbase i7 ; load slice size for logging data +logd $zero $r0 $r1 $r2 ; log slice +load $r0 data_NonConfigurable_1; load constant from data section rvrt $r0 -cfsi i264920 ; [fn end: main_0] free: locals 264920 byte(s), call args 0 slot(s) +cfsi i265000 ; [fn end: main_0] free: locals 265000 byte(s), call args 0 slot(s) move $$reta $r1 ; [fn end: main_0] restore return address -poph i531456 ; [fn end: main_0]: restore used high registers 40..64 +poph i531968 ; [fn end: main_0]: restore used high registers 40..64 jal $zero $$reta i0 ; [fn end: main_0] return from call pshh i524288 ; [fn init: array_repeat_zero_small_u8_1]: push used high registers 40..64 mcli $$arg0 i5 ; clear memory [u8; 5], 5 bytes @@ -646,7 +677,7 @@ jnzb $r0 $zero i4 poph i530432 ; [fn end: big_array_repeat_16]: restore used high registers 40..64 jal $zero $$reta i0 ; [fn end: big_array_repeat_16] return from call pshh i524288 ; [fn init: u8_array_bigger_than_18_bits_17]: push used high registers 40..64 -load $$tmp data_NonConfigurable_1; loading clear size in bytes +load $$tmp data_NonConfigurable_2; loading clear size in bytes mcl $$arg0 $$tmp ; clear memory [u8; 262145] poph i524288 ; [fn end: u8_array_bigger_than_18_bits_17]: restore used high registers 40..64 jal $zero $$reta i0 ; [fn end: u8_array_bigger_than_18_bits_17] return from call @@ -656,30 +687,30 @@ jal $zero $$reta i0 ; [fn end: arrays_with_const_length_18] return fro pshh i531968 ; [fn init: decode_array_19]: push used high registers 40..64 move $$locbase $sp ; [fn init: decode_array_19]: set locals base register cfei i88 ; [fn init: decode_array_19]: allocate: locals 88 byte(s), call args 0 slot(s) -move $r1 $$arg0 ; [fn init: decode_array_19]: copy argument 0 (__ret_value) -move $r2 $$reta ; [fn init: decode_array_19]: save return address -addi $r0 $$locbase i16 ; get offset to local __ptr [u8; 1] -movi $r3 i255 ; initialize constant into register -sb $r0 $r3 i0 ; store byte -addi $r3 $$locbase i24 ; get offset to local __ptr slice -move $$arg0 $r0 ; [call: to_slice_20]: pass argument 0 -move $$arg1 $r3 ; [call: to_slice_20]: pass argument 1 +move $r2 $$arg0 ; [fn init: decode_array_19]: copy argument 0 (__ret_value) +move $r3 $$reta ; [fn init: decode_array_19]: save return address +addi $r1 $$locbase i16 ; get offset to local __ptr [u8; 1] +movi $r0 i255 ; initialize constant into register +sb $r1 $r0 i0 ; store byte +addi $r0 $$locbase i24 ; get offset to local __ptr slice +move $$arg0 $r1 ; [call: to_slice_20]: pass argument 0 +move $$arg1 $r0 ; [call: to_slice_20]: pass argument 1 jal $$reta $pc i18 ; [call: to_slice_20]: call function -addi $r0 $$locbase i72 ; get offset to local __ptr slice -mcpi $r0 $r3 i16 ; copy memory -addi $r3 $$locbase i56 ; get offset to local __ptr slice -mcpi $r3 $r0 i16 ; copy memory -addi $r3 $$locbase i40 ; get offset to local __ptr slice -mcpi $r3 $r0 i16 ; copy memory -mcpi $$locbase $r0 i16 ; copy memory +addi $r1 $$locbase i72 ; get offset to local __ptr slice +mcpi $r1 $r0 i16 ; copy memory +addi $r0 $$locbase i56 ; get offset to local __ptr slice +mcpi $r0 $r1 i16 ; copy memory +addi $r0 $$locbase i40 ; get offset to local __ptr slice +mcpi $r0 $r1 i16 ; copy memory +mcpi $$locbase $r1 i16 ; copy memory lw $r0 $$locbase i0 ; load word -movi $r3 i1 ; copy ASM block argument's constant initial value to register +movi $r1 i1 ; copy ASM block argument's constant initial value to register aloc $one ; aloc size -mcp $hp $r0 $r3 ; mcp hp src size +mcp $hp $r0 $r1 ; mcp hp src size lb $r0 $hp i0 ; load byte -sb $r1 $r0 i0 ; store byte +sb $r2 $r0 i0 ; store byte cfsi i88 ; [fn end: decode_array_19] free: locals 88 byte(s), call args 0 slot(s) -move $$reta $r2 ; [fn end: decode_array_19] restore return address +move $$reta $r3 ; [fn end: decode_array_19] restore return address poph i531968 ; [fn end: decode_array_19]: restore used high registers 40..64 jal $zero $$reta i0 ; [fn end: decode_array_19] return from call pshh i528384 ; [fn init: to_slice_20]: push used high registers 40..64 @@ -693,262 +724,252 @@ mcpi $$arg1 $$locbase i16 ; copy memory cfsi i24 ; [fn end: to_slice_20] free: locals 24 byte(s), call args 0 slot(s) poph i528384 ; [fn end: to_slice_20]: restore used high registers 40..64 jal $zero $$reta i0 ; [fn end: to_slice_20] return from call -pshh i531456 ; [fn init: log_47]: push used high registers 40..64 -move $$locbase $sp ; [fn init: log_47]: set locals base register -cfei i40 ; [fn init: log_47]: allocate: locals 40 byte(s), call args 0 slot(s) -addi $r0 $$locbase i32 ; get offset to local __ptr u8 -sb $r0 $$arg0 i0 ; store byte -sw $$locbase $r0 i0 ; store word -sw $$locbase $one i1 ; store word -addi $r0 $$locbase i16 ; get offset to local __ptr slice -mcpi $r0 $$locbase i16 ; copy memory -load $r0 data_NonConfigurable_2; load constant from data section -lw $r1 $$locbase i2 ; load slice pointer for logging data -lw $r2 $$locbase i3 ; load slice size for logging data -logd $zero $r0 $r1 $r2 ; log slice -cfsi i40 ; [fn end: log_47] free: locals 40 byte(s), call args 0 slot(s) -poph i531456 ; [fn end: log_47]: restore used high registers 40..64 -jal $zero $$reta i0 ; [fn end: log_47] return from call .data: -data_NonConfigurable_0 .word 18446744073709486083 -data_NonConfigurable_1 .word 262145 -data_NonConfigurable_2 .word 14454674236531057292 +data_NonConfigurable_0 .word 14454674236531057292 +data_NonConfigurable_1 .word 18446744073709486083 +data_NonConfigurable_2 .word 262145 ;; --- START OF TARGET BYTECODE --- 0x00000000 MOVE R60 $pc ;; [26, 240, 48, 0] 0x00000004 JMPF $zero 0x4 ;; [116, 0, 0, 4] -0x00000008 ;; [0, 0, 0, 0, 0, 0, 3, 152] +0x00000008 ;; [0, 0, 0, 0, 0, 0, 3, 176] 0x00000010 ;; [0, 0, 0, 0, 0, 0, 0, 0] 0x00000018 LW R63 R60 0x1 ;; [93, 255, 192, 1] 0x0000001c ADD R63 R63 R60 ;; [16, 255, 255, 0] 0x00000020 MOVE R59 $sp ;; [26, 236, 80, 0] 0x00000024 JAL R62 $pc 0x2 ;; [153, 248, 48, 2] 0x00000028 RETD $zero $zero ;; [37, 0, 0, 0] -0x0000002c PSHH 0x81c00 ;; [150, 8, 28, 0] +0x0000002c PSHH 0x81e00 ;; [150, 8, 30, 0] 0x00000030 MOVE R59 $sp ;; [26, 236, 80, 0] -0x00000034 CFEI 0x40ad8 ;; [145, 4, 10, 216] +0x00000034 CFEI 0x40b28 ;; [145, 4, 11, 40] 0x00000038 MOVE R51 R62 ;; [26, 207, 224, 0] -0x0000003c MOVE R58 R59 ;; [26, 235, 176, 0] -0x00000040 JAL R62 $pc 0x57 ;; [153, 248, 48, 87] -0x00000044 ADDI R52 R59 0x8 ;; [80, 211, 176, 8] -0x00000048 MOVE R58 R52 ;; [26, 235, 64, 0] -0x0000004c JAL R62 $pc 0x58 ;; [153, 248, 48, 88] -0x00000050 ADDI R52 R59 0x30 ;; [80, 211, 176, 48] -0x00000054 MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000058 JAL R62 $pc 0x55 ;; [153, 248, 48, 85] -0x0000005c MOVI R52 0x80dd ;; [114, 208, 128, 221] -0x00000060 MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x00000064 ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x00000068 MOVE R58 R52 ;; [26, 235, 64, 0] -0x0000006c JAL R62 $pc 0x50 ;; [153, 248, 48, 80] -0x00000070 MOVI R52 0x80e2 ;; [114, 208, 128, 226] -0x00000074 MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x00000078 ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x0000007c MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000080 JAL R62 $pc 0x4f ;; [153, 248, 48, 79] -0x00000084 MOVI R52 0x80f6 ;; [114, 208, 128, 246] -0x00000088 MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x0000008c ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x00000090 MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000094 JAL R62 $pc 0x4e ;; [153, 248, 48, 78] -0x00000098 MOVI R52 0x810a ;; [114, 208, 129, 10] -0x0000009c MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x000000a0 ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x000000a4 MOVE R58 R52 ;; [26, 235, 64, 0] -0x000000a8 JAL R62 $pc 0x4d ;; [153, 248, 48, 77] -0x000000ac MOVI R52 0x810b ;; [114, 208, 129, 11] -0x000000b0 MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x000000b4 ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x000000b8 MOVE R58 R52 ;; [26, 235, 64, 0] -0x000000bc JAL R62 $pc 0x4c ;; [153, 248, 48, 76] -0x000000c0 MOVI R52 0x810f ;; [114, 208, 129, 15] -0x000000c4 MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x000000c8 ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x000000cc MOVE R58 R52 ;; [26, 235, 64, 0] -0x000000d0 JAL R62 $pc 0x4b ;; [153, 248, 48, 75] -0x000000d4 MOVI R52 0x8128 ;; [114, 208, 129, 40] -0x000000d8 MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x000000dc ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x000000e0 MOVE R58 R52 ;; [26, 235, 64, 0] -0x000000e4 JAL R62 $pc 0x46 ;; [153, 248, 48, 70] -0x000000e8 MOVI R52 0x8141 ;; [114, 208, 129, 65] -0x000000ec MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x000000f0 ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x000000f4 MOVE R58 R52 ;; [26, 235, 64, 0] -0x000000f8 JAL R62 $pc 0x41 ;; [153, 248, 48, 65] -0x000000fc ADDI R52 R59 0x58 ;; [80, 211, 176, 88] -0x00000100 MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000104 JAL R62 $pc 0x42 ;; [153, 248, 48, 66] -0x00000108 ADDI R52 R59 0x378 ;; [80, 211, 179, 120] -0x0000010c MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000110 JAL R62 $pc 0x43 ;; [153, 248, 48, 67] -0x00000114 ADDI R52 R59 0x698 ;; [80, 211, 182, 152] -0x00000118 MOVE R58 R52 ;; [26, 235, 64, 0] -0x0000011c JAL R62 $pc 0x44 ;; [153, 248, 48, 68] -0x00000120 ADDI R52 R59 0x6b8 ;; [80, 211, 182, 184] -0x00000124 MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000128 JAL R62 $pc 0x45 ;; [153, 248, 48, 69] -0x0000012c ADDI R52 R59 0x6c0 ;; [80, 211, 182, 192] -0x00000130 MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000134 JAL R62 $pc 0x4e ;; [153, 248, 48, 78] -0x00000138 ADDI R52 R59 0x6e0 ;; [80, 211, 182, 224] -0x0000013c MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000140 JAL R62 $pc 0x55 ;; [153, 248, 48, 85] -0x00000144 JAL R62 $pc 0x59 ;; [153, 248, 48, 89] -0x00000148 MOVI R52 0x815a ;; [114, 208, 129, 90] -0x0000014c MULI R52 R52 0x8 ;; [85, 211, 64, 8] -0x00000150 ADD R52 R59 R52 ;; [16, 211, 189, 0] -0x00000154 MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000158 JAL R62 $pc 0x57 ;; [153, 248, 48, 87] -0x0000015c LB R52 R52 0x0 ;; [92, 211, 64, 0] -0x00000160 MOVI R50 0xff ;; [114, 200, 0, 255] -0x00000164 EQ R50 R52 R50 ;; [19, 203, 76, 128] -0x00000168 EQ R50 R50 $zero ;; [19, 203, 32, 0] -0x0000016c JNZF R50 $zero 0x1 ;; [118, 200, 0, 1] -0x00000170 JMPF $zero 0x6 ;; [116, 0, 0, 6] -0x00000174 MOVE R58 R52 ;; [26, 235, 64, 0] -0x00000178 JAL R62 $pc 0x77 ;; [153, 248, 48, 119] -0x0000017c MOVI R58 0xff ;; [114, 232, 0, 255] -0x00000180 JAL R62 $pc 0x75 ;; [153, 248, 48, 117] -0x00000184 LW R52 R63 0x0 ;; [93, 211, 240, 0] -0x00000188 RVRT R52 ;; [54, 208, 0, 0] -0x0000018c CFSI 0x40ad8 ;; [146, 4, 10, 216] -0x00000190 MOVE R62 R51 ;; [26, 251, 48, 0] -0x00000194 POPH 0x81c00 ;; [152, 8, 28, 0] -0x00000198 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x0000019c PSHH 0x80000 ;; [150, 8, 0, 0] -0x000001a0 MCLI R58 0x5 ;; [112, 232, 0, 5] -0x000001a4 POPH 0x80000 ;; [152, 8, 0, 0] -0x000001a8 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000001ac PSHH 0x80000 ;; [150, 8, 0, 0] -0x000001b0 MCLI R58 0x28 ;; [112, 232, 0, 40] -0x000001b4 POPH 0x80000 ;; [152, 8, 0, 0] -0x000001b8 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000001bc PSHH 0x80000 ;; [150, 8, 0, 0] -0x000001c0 MCLI R58 0xa0 ;; [112, 232, 0, 160] -0x000001c4 POPH 0x80000 ;; [152, 8, 0, 0] -0x000001c8 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000001cc PSHH 0x80000 ;; [150, 8, 0, 0] -0x000001d0 MCLI R58 0xa0 ;; [112, 232, 0, 160] -0x000001d4 POPH 0x80000 ;; [152, 8, 0, 0] -0x000001d8 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000001dc PSHH 0x80000 ;; [150, 8, 0, 0] -0x000001e0 MCLI R58 0x5 ;; [112, 232, 0, 5] -0x000001e4 POPH 0x80000 ;; [152, 8, 0, 0] -0x000001e8 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000001ec PSHH 0x80000 ;; [150, 8, 0, 0] -0x000001f0 MCLI R58 0x19 ;; [112, 232, 0, 25] -0x000001f4 POPH 0x80000 ;; [152, 8, 0, 0] -0x000001f8 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000001fc PSHH 0x80000 ;; [150, 8, 0, 0] -0x00000200 MCLI R58 0xc8 ;; [112, 232, 0, 200] -0x00000204 POPH 0x80000 ;; [152, 8, 0, 0] -0x00000208 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x0000020c PSHH 0x80000 ;; [150, 8, 0, 0] -0x00000210 MCLI R58 0x320 ;; [112, 232, 3, 32] -0x00000214 POPH 0x80000 ;; [152, 8, 0, 0] -0x00000218 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x0000021c PSHH 0x80000 ;; [150, 8, 0, 0] -0x00000220 MCLI R58 0x320 ;; [112, 232, 3, 32] -0x00000224 POPH 0x80000 ;; [152, 8, 0, 0] -0x00000228 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x0000022c PSHH 0x80000 ;; [150, 8, 0, 0] -0x00000230 MCLI R58 0x19 ;; [112, 232, 0, 25] -0x00000234 POPH 0x80000 ;; [152, 8, 0, 0] -0x00000238 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x0000023c PSHH 0x81000 ;; [150, 8, 16, 0] -0x00000240 SB R58 $one 0x0 ;; [94, 232, 16, 0] -0x00000244 ADDI R52 R58 0x1 ;; [80, 211, 160, 1] -0x00000248 SB R52 $one 0x0 ;; [94, 208, 16, 0] -0x0000024c ADDI R52 R58 0x2 ;; [80, 211, 160, 2] -0x00000250 SB R52 $one 0x0 ;; [94, 208, 16, 0] -0x00000254 ADDI R52 R58 0x3 ;; [80, 211, 160, 3] -0x00000258 SB R52 $one 0x0 ;; [94, 208, 16, 0] -0x0000025c ADDI R52 R58 0x4 ;; [80, 211, 160, 4] -0x00000260 SB R52 $one 0x0 ;; [94, 208, 16, 0] -0x00000264 POPH 0x81000 ;; [152, 8, 16, 0] -0x00000268 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x0000026c PSHH 0x81800 ;; [150, 8, 24, 0] -0x00000270 MOVI R51 0x0 ;; [114, 204, 0, 0] -0x00000274 ADD R52 R58 R51 ;; [16, 211, 172, 192] -0x00000278 SB R52 $one 0x0 ;; [94, 208, 16, 0] -0x0000027c ADDI R51 R51 0x1 ;; [80, 207, 48, 1] -0x00000280 MOVI R52 0x19 ;; [114, 208, 0, 25] -0x00000284 LT R52 R51 R52 ;; [22, 211, 61, 0] -0x00000288 JNZB R52 $zero 0x4 ;; [119, 208, 0, 4] -0x0000028c POPH 0x81800 ;; [152, 8, 24, 0] -0x00000290 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x00000294 PSHH 0x80000 ;; [150, 8, 0, 0] -0x00000298 LW R60 R63 0x1 ;; [93, 243, 240, 1] -0x0000029c MCL R58 R60 ;; [39, 235, 192, 0] -0x000002a0 POPH 0x80000 ;; [152, 8, 0, 0] -0x000002a4 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000002a8 PSHH 0x80000 ;; [150, 8, 0, 0] -0x000002ac POPH 0x80000 ;; [152, 8, 0, 0] -0x000002b0 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x000002b4 PSHH 0x81e00 ;; [150, 8, 30, 0] -0x000002b8 MOVE R59 $sp ;; [26, 236, 80, 0] -0x000002bc CFEI 0x58 ;; [145, 0, 0, 88] -0x000002c0 MOVE R51 R58 ;; [26, 207, 160, 0] -0x000002c4 MOVE R50 R62 ;; [26, 203, 224, 0] -0x000002c8 ADDI R52 R59 0x10 ;; [80, 211, 176, 16] -0x000002cc MOVI R49 0xff ;; [114, 196, 0, 255] -0x000002d0 SB R52 R49 0x0 ;; [94, 211, 16, 0] -0x000002d4 ADDI R49 R59 0x18 ;; [80, 199, 176, 24] -0x000002d8 MOVE R58 R52 ;; [26, 235, 64, 0] -0x000002dc MOVE R57 R49 ;; [26, 231, 16, 0] -0x000002e0 JAL R62 $pc 0x12 ;; [153, 248, 48, 18] -0x000002e4 ADDI R52 R59 0x48 ;; [80, 211, 176, 72] -0x000002e8 MCPI R52 R49 0x10 ;; [96, 211, 16, 16] -0x000002ec ADDI R49 R59 0x38 ;; [80, 199, 176, 56] -0x000002f0 MCPI R49 R52 0x10 ;; [96, 199, 64, 16] -0x000002f4 ADDI R49 R59 0x28 ;; [80, 199, 176, 40] -0x000002f8 MCPI R49 R52 0x10 ;; [96, 199, 64, 16] -0x000002fc MCPI R59 R52 0x10 ;; [96, 239, 64, 16] -0x00000300 LW R52 R59 0x0 ;; [93, 211, 176, 0] -0x00000304 MOVI R49 0x1 ;; [114, 196, 0, 1] -0x00000308 ALOC $one ;; [38, 4, 0, 0] -0x0000030c MCP $hp R52 R49 ;; [40, 31, 76, 64] -0x00000310 LB R52 $hp 0x0 ;; [92, 208, 112, 0] -0x00000314 SB R51 R52 0x0 ;; [94, 207, 64, 0] -0x00000318 CFSI 0x58 ;; [146, 0, 0, 88] -0x0000031c MOVE R62 R50 ;; [26, 251, 32, 0] -0x00000320 POPH 0x81e00 ;; [152, 8, 30, 0] -0x00000324 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x00000328 PSHH 0x81000 ;; [150, 8, 16, 0] -0x0000032c MOVE R59 $sp ;; [26, 236, 80, 0] -0x00000330 CFEI 0x18 ;; [145, 0, 0, 24] -0x00000334 ADDI R52 R59 0x10 ;; [80, 211, 176, 16] -0x00000338 MCPI R52 R58 0x1 ;; [96, 211, 160, 1] -0x0000033c SW R59 R52 0x0 ;; [95, 239, 64, 0] -0x00000340 SW R59 $one 0x1 ;; [95, 236, 16, 1] -0x00000344 MCPI R57 R59 0x10 ;; [96, 231, 176, 16] -0x00000348 CFSI 0x18 ;; [146, 0, 0, 24] -0x0000034c POPH 0x81000 ;; [152, 8, 16, 0] -0x00000350 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x00000354 PSHH 0x81c00 ;; [150, 8, 28, 0] -0x00000358 MOVE R59 $sp ;; [26, 236, 80, 0] -0x0000035c CFEI 0x28 ;; [145, 0, 0, 40] -0x00000360 ADDI R52 R59 0x20 ;; [80, 211, 176, 32] -0x00000364 SB R52 R58 0x0 ;; [94, 211, 160, 0] -0x00000368 SW R59 R52 0x0 ;; [95, 239, 64, 0] -0x0000036c SW R59 $one 0x1 ;; [95, 236, 16, 1] -0x00000370 ADDI R52 R59 0x10 ;; [80, 211, 176, 16] -0x00000374 MCPI R52 R59 0x10 ;; [96, 211, 176, 16] -0x00000378 LW R52 R63 0x2 ;; [93, 211, 240, 2] -0x0000037c LW R51 R59 0x2 ;; [93, 207, 176, 2] -0x00000380 LW R50 R59 0x3 ;; [93, 203, 176, 3] -0x00000384 LOGD $zero R52 R51 R50 ;; [52, 3, 76, 242] -0x00000388 CFSI 0x28 ;; [146, 0, 0, 40] -0x0000038c POPH 0x81c00 ;; [152, 8, 28, 0] -0x00000390 JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x00000394 NOOP ;; [71, 0, 0, 0] +0x0000003c ADDI R52 R59 0x40 ;; [80, 211, 176, 64] +0x00000040 MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000044 JAL R62 $pc 0x6d ;; [153, 248, 48, 109] +0x00000048 ADDI R52 R59 0x48 ;; [80, 211, 176, 72] +0x0000004c MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000050 JAL R62 $pc 0x6e ;; [153, 248, 48, 110] +0x00000054 ADDI R52 R59 0x70 ;; [80, 211, 176, 112] +0x00000058 MOVE R58 R52 ;; [26, 235, 64, 0] +0x0000005c JAL R62 $pc 0x6b ;; [153, 248, 48, 107] +0x00000060 MOVI R52 0x80e5 ;; [114, 208, 128, 229] +0x00000064 MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x00000068 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x0000006c MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000070 JAL R62 $pc 0x66 ;; [153, 248, 48, 102] +0x00000074 MOVI R52 0x80ea ;; [114, 208, 128, 234] +0x00000078 MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x0000007c ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x00000080 MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000084 JAL R62 $pc 0x65 ;; [153, 248, 48, 101] +0x00000088 MOVI R52 0x80fe ;; [114, 208, 128, 254] +0x0000008c MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x00000090 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x00000094 MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000098 JAL R62 $pc 0x64 ;; [153, 248, 48, 100] +0x0000009c MOVI R52 0x8112 ;; [114, 208, 129, 18] +0x000000a0 MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x000000a4 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x000000a8 MOVE R58 R52 ;; [26, 235, 64, 0] +0x000000ac JAL R62 $pc 0x63 ;; [153, 248, 48, 99] +0x000000b0 MOVI R52 0x8113 ;; [114, 208, 129, 19] +0x000000b4 MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x000000b8 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x000000bc MOVE R58 R52 ;; [26, 235, 64, 0] +0x000000c0 JAL R62 $pc 0x62 ;; [153, 248, 48, 98] +0x000000c4 MOVI R52 0x8117 ;; [114, 208, 129, 23] +0x000000c8 MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x000000cc ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x000000d0 MOVE R58 R52 ;; [26, 235, 64, 0] +0x000000d4 JAL R62 $pc 0x61 ;; [153, 248, 48, 97] +0x000000d8 MOVI R52 0x8130 ;; [114, 208, 129, 48] +0x000000dc MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x000000e0 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x000000e4 MOVE R58 R52 ;; [26, 235, 64, 0] +0x000000e8 JAL R62 $pc 0x5c ;; [153, 248, 48, 92] +0x000000ec MOVI R52 0x8149 ;; [114, 208, 129, 73] +0x000000f0 MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x000000f4 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x000000f8 MOVE R58 R52 ;; [26, 235, 64, 0] +0x000000fc JAL R62 $pc 0x57 ;; [153, 248, 48, 87] +0x00000100 ADDI R52 R59 0x98 ;; [80, 211, 176, 152] +0x00000104 MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000108 JAL R62 $pc 0x58 ;; [153, 248, 48, 88] +0x0000010c ADDI R52 R59 0x3b8 ;; [80, 211, 179, 184] +0x00000110 MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000114 JAL R62 $pc 0x59 ;; [153, 248, 48, 89] +0x00000118 ADDI R52 R59 0x6d8 ;; [80, 211, 182, 216] +0x0000011c MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000120 JAL R62 $pc 0x5a ;; [153, 248, 48, 90] +0x00000124 ADDI R52 R59 0x6f8 ;; [80, 211, 182, 248] +0x00000128 MOVE R58 R52 ;; [26, 235, 64, 0] +0x0000012c JAL R62 $pc 0x5b ;; [153, 248, 48, 91] +0x00000130 ADDI R52 R59 0x700 ;; [80, 211, 183, 0] +0x00000134 MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000138 JAL R62 $pc 0x64 ;; [153, 248, 48, 100] +0x0000013c ADDI R52 R59 0x720 ;; [80, 211, 183, 32] +0x00000140 MOVE R58 R52 ;; [26, 235, 64, 0] +0x00000144 JAL R62 $pc 0x6b ;; [153, 248, 48, 107] +0x00000148 JAL R62 $pc 0x6f ;; [153, 248, 48, 111] +0x0000014c MOVI R52 0x8162 ;; [114, 208, 129, 98] +0x00000150 MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x00000154 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x00000158 MOVE R58 R52 ;; [26, 235, 64, 0] +0x0000015c JAL R62 $pc 0x6d ;; [153, 248, 48, 109] +0x00000160 LB R50 R52 0x0 ;; [92, 203, 64, 0] +0x00000164 MOVI R49 0xff ;; [114, 196, 0, 255] +0x00000168 EQ R50 R50 R49 ;; [19, 203, 44, 64] +0x0000016c EQ R50 R50 $zero ;; [19, 203, 32, 0] +0x00000170 JNZF R50 $zero 0x1 ;; [118, 200, 0, 1] +0x00000174 JMPF $zero 0x1c ;; [116, 0, 0, 28] +0x00000178 MOVI R51 0x8163 ;; [114, 204, 129, 99] +0x0000017c MULI R51 R51 0x8 ;; [85, 207, 48, 8] +0x00000180 ADD R51 R59 R51 ;; [16, 207, 188, 192] +0x00000184 MCPI R51 R52 0x1 ;; [96, 207, 64, 1] +0x00000188 SW R59 R51 0x0 ;; [95, 239, 48, 0] +0x0000018c SW R59 $one 0x1 ;; [95, 236, 16, 1] +0x00000190 ADDI R52 R59 0x20 ;; [80, 211, 176, 32] +0x00000194 MCPI R52 R59 0x10 ;; [96, 211, 176, 16] +0x00000198 LW R52 R63 0x0 ;; [93, 211, 240, 0] +0x0000019c LW R51 R59 0x4 ;; [93, 207, 176, 4] +0x000001a0 LW R50 R59 0x5 ;; [93, 203, 176, 5] +0x000001a4 LOGD $zero R52 R51 R50 ;; [52, 3, 76, 242] +0x000001a8 MOVI R52 0x8164 ;; [114, 208, 129, 100] +0x000001ac MULI R52 R52 0x8 ;; [85, 211, 64, 8] +0x000001b0 ADD R52 R59 R52 ;; [16, 211, 189, 0] +0x000001b4 MOVI R51 0xff ;; [114, 204, 0, 255] +0x000001b8 SB R52 R51 0x0 ;; [94, 211, 48, 0] +0x000001bc ADDI R51 R59 0x10 ;; [80, 207, 176, 16] +0x000001c0 SW R59 R52 0x2 ;; [95, 239, 64, 2] +0x000001c4 SW R59 $one 0x3 ;; [95, 236, 16, 3] +0x000001c8 ADDI R52 R59 0x30 ;; [80, 211, 176, 48] +0x000001cc MCPI R52 R51 0x10 ;; [96, 211, 48, 16] +0x000001d0 LW R52 R63 0x0 ;; [93, 211, 240, 0] +0x000001d4 LW R51 R59 0x6 ;; [93, 207, 176, 6] +0x000001d8 LW R50 R59 0x7 ;; [93, 203, 176, 7] +0x000001dc LOGD $zero R52 R51 R50 ;; [52, 3, 76, 242] +0x000001e0 LW R52 R63 0x1 ;; [93, 211, 240, 1] +0x000001e4 RVRT R52 ;; [54, 208, 0, 0] +0x000001e8 CFSI 0x40b28 ;; [146, 4, 11, 40] +0x000001ec MOVE R62 R51 ;; [26, 251, 48, 0] +0x000001f0 POPH 0x81e00 ;; [152, 8, 30, 0] +0x000001f4 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x000001f8 PSHH 0x80000 ;; [150, 8, 0, 0] +0x000001fc MCLI R58 0x5 ;; [112, 232, 0, 5] +0x00000200 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000204 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000208 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000020c MCLI R58 0x28 ;; [112, 232, 0, 40] +0x00000210 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000214 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000218 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000021c MCLI R58 0xa0 ;; [112, 232, 0, 160] +0x00000220 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000224 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000228 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000022c MCLI R58 0xa0 ;; [112, 232, 0, 160] +0x00000230 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000234 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000238 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000023c MCLI R58 0x5 ;; [112, 232, 0, 5] +0x00000240 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000244 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000248 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000024c MCLI R58 0x19 ;; [112, 232, 0, 25] +0x00000250 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000254 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000258 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000025c MCLI R58 0xc8 ;; [112, 232, 0, 200] +0x00000260 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000264 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000268 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000026c MCLI R58 0x320 ;; [112, 232, 3, 32] +0x00000270 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000274 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000278 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000027c MCLI R58 0x320 ;; [112, 232, 3, 32] +0x00000280 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000284 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000288 PSHH 0x80000 ;; [150, 8, 0, 0] +0x0000028c MCLI R58 0x19 ;; [112, 232, 0, 25] +0x00000290 POPH 0x80000 ;; [152, 8, 0, 0] +0x00000294 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000298 PSHH 0x81000 ;; [150, 8, 16, 0] +0x0000029c SB R58 $one 0x0 ;; [94, 232, 16, 0] +0x000002a0 ADDI R52 R58 0x1 ;; [80, 211, 160, 1] +0x000002a4 SB R52 $one 0x0 ;; [94, 208, 16, 0] +0x000002a8 ADDI R52 R58 0x2 ;; [80, 211, 160, 2] +0x000002ac SB R52 $one 0x0 ;; [94, 208, 16, 0] +0x000002b0 ADDI R52 R58 0x3 ;; [80, 211, 160, 3] +0x000002b4 SB R52 $one 0x0 ;; [94, 208, 16, 0] +0x000002b8 ADDI R52 R58 0x4 ;; [80, 211, 160, 4] +0x000002bc SB R52 $one 0x0 ;; [94, 208, 16, 0] +0x000002c0 POPH 0x81000 ;; [152, 8, 16, 0] +0x000002c4 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x000002c8 PSHH 0x81800 ;; [150, 8, 24, 0] +0x000002cc MOVI R51 0x0 ;; [114, 204, 0, 0] +0x000002d0 ADD R52 R58 R51 ;; [16, 211, 172, 192] +0x000002d4 SB R52 $one 0x0 ;; [94, 208, 16, 0] +0x000002d8 ADDI R51 R51 0x1 ;; [80, 207, 48, 1] +0x000002dc MOVI R52 0x19 ;; [114, 208, 0, 25] +0x000002e0 LT R52 R51 R52 ;; [22, 211, 61, 0] +0x000002e4 JNZB R52 $zero 0x4 ;; [119, 208, 0, 4] +0x000002e8 POPH 0x81800 ;; [152, 8, 24, 0] +0x000002ec JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x000002f0 PSHH 0x80000 ;; [150, 8, 0, 0] +0x000002f4 LW R60 R63 0x2 ;; [93, 243, 240, 2] +0x000002f8 MCL R58 R60 ;; [39, 235, 192, 0] +0x000002fc POPH 0x80000 ;; [152, 8, 0, 0] +0x00000300 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000304 PSHH 0x80000 ;; [150, 8, 0, 0] +0x00000308 POPH 0x80000 ;; [152, 8, 0, 0] +0x0000030c JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000310 PSHH 0x81e00 ;; [150, 8, 30, 0] +0x00000314 MOVE R59 $sp ;; [26, 236, 80, 0] +0x00000318 CFEI 0x58 ;; [145, 0, 0, 88] +0x0000031c MOVE R50 R58 ;; [26, 203, 160, 0] +0x00000320 MOVE R49 R62 ;; [26, 199, 224, 0] +0x00000324 ADDI R51 R59 0x10 ;; [80, 207, 176, 16] +0x00000328 MOVI R52 0xff ;; [114, 208, 0, 255] +0x0000032c SB R51 R52 0x0 ;; [94, 207, 64, 0] +0x00000330 ADDI R52 R59 0x18 ;; [80, 211, 176, 24] +0x00000334 MOVE R58 R51 ;; [26, 235, 48, 0] +0x00000338 MOVE R57 R52 ;; [26, 231, 64, 0] +0x0000033c JAL R62 $pc 0x12 ;; [153, 248, 48, 18] +0x00000340 ADDI R51 R59 0x48 ;; [80, 207, 176, 72] +0x00000344 MCPI R51 R52 0x10 ;; [96, 207, 64, 16] +0x00000348 ADDI R52 R59 0x38 ;; [80, 211, 176, 56] +0x0000034c MCPI R52 R51 0x10 ;; [96, 211, 48, 16] +0x00000350 ADDI R52 R59 0x28 ;; [80, 211, 176, 40] +0x00000354 MCPI R52 R51 0x10 ;; [96, 211, 48, 16] +0x00000358 MCPI R59 R51 0x10 ;; [96, 239, 48, 16] +0x0000035c LW R52 R59 0x0 ;; [93, 211, 176, 0] +0x00000360 MOVI R51 0x1 ;; [114, 204, 0, 1] +0x00000364 ALOC $one ;; [38, 4, 0, 0] +0x00000368 MCP $hp R52 R51 ;; [40, 31, 76, 192] +0x0000036c LB R52 $hp 0x0 ;; [92, 208, 112, 0] +0x00000370 SB R50 R52 0x0 ;; [94, 203, 64, 0] +0x00000374 CFSI 0x58 ;; [146, 0, 0, 88] +0x00000378 MOVE R62 R49 ;; [26, 251, 16, 0] +0x0000037c POPH 0x81e00 ;; [152, 8, 30, 0] +0x00000380 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000384 PSHH 0x81000 ;; [150, 8, 16, 0] +0x00000388 MOVE R59 $sp ;; [26, 236, 80, 0] +0x0000038c CFEI 0x18 ;; [145, 0, 0, 24] +0x00000390 ADDI R52 R59 0x10 ;; [80, 211, 176, 16] +0x00000394 MCPI R52 R58 0x1 ;; [96, 211, 160, 1] +0x00000398 SW R59 R52 0x0 ;; [95, 239, 64, 0] +0x0000039c SW R59 $one 0x1 ;; [95, 236, 16, 1] +0x000003a0 MCPI R57 R59 0x10 ;; [96, 231, 176, 16] +0x000003a4 CFSI 0x18 ;; [146, 0, 0, 24] +0x000003a8 POPH 0x81000 ;; [152, 8, 16, 0] +0x000003ac JAL $zero R62 0x0 ;; [153, 3, 224, 0] .data_section: -0x00000398 .word i18446744073709486083, as hex be bytes ([FF, FF, FF, FF, FF, FF, 00, 03]) -0x000003a0 .word i262145, as hex be bytes ([00, 00, 00, 00, 00, 04, 00, 01]) -0x000003a8 .word i14454674236531057292, as hex be bytes ([C8, 99, 51, A2, 4C, 6C, A2, 8C]) +0x000003b0 .word i14454674236531057292, as hex be bytes ([C8, 99, 51, A2, 4C, 6C, A2, 8C]) +0x000003b8 .word i18446744073709486083, as hex be bytes ([FF, FF, FF, FF, FF, FF, 00, 03]) +0x000003c0 .word i262145, as hex be bytes ([00, 00, 00, 00, 00, 04, 00, 01]) ;; --- END OF TARGET BYTECODE --- warning @@ -1048,7 +1069,7 @@ warning ____ Compiled script "array_repeat" with 8 warnings. - Finished release [optimized + fuel] target(s) [944 B] in ??? + Finished release [optimized + fuel] target(s) [968 B] in ??? > forc test --path test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat --verbose --release exit status: 0 @@ -1056,10 +1077,10 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert) Compiling script array_repeat (test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat) - Finished release [optimized + fuel] target(s) [1.944 KB] in ??? + Finished release [optimized + fuel] target(s) [1.968 KB] in ??? script array_repeat - Bytecode size: 1944 bytes (1.944 KB) - Bytecode hash: 0xd84e1f0af96e64ef4c4c098c44c52e6494d47aa0b5eee14850b62bbde99640fb + Bytecode size: 1968 bytes (1.968 KB) + Bytecode hash: 0xcdf04eeb3632661aefceadc092ae5c25d5a2ea82c21b39f093f281a85524bd1f Running 1 test, filtered 0 tests tested -- array_repeat diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/const_generics/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/const_generics/stdout.snap index 8547ceb51b8..56907d3ef45 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/const_generics/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/const_generics/stdout.snap @@ -35,12 +35,12 @@ warning ____ Compiled script "const_generics" with 2 warnings. - Finished debug [unoptimized + fuel] target(s) [8.816 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [8.808 KB] in ??? Running 1 test, filtered 0 tests tested -- const_generics - test run_main ... ok (???, 17769 gas) + test run_main ... ok (???, 17766 gas) debug output: [src/main.sw:154:13] a = [1, 2] [src/main.sw:158:13] [C {}].len() = 1 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type/snapshot.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type/snapshot.toml new file mode 100644 index 00000000000..88b926f2fc2 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type/snapshot.toml @@ -0,0 +1,4 @@ +cmds = [ + "forc build --path {root} --release", + "forc build --path {root} --release --ir final --asm final --bytecode | filter-fn {name} raw_ptr_write" +] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type/stdout.snap new file mode 100644 index 00000000000..85f4bcad1d8 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type/stdout.snap @@ -0,0 +1,12 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type --release +exit status: 0 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-option-result) + Compiling script eq_custom_type (test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type) + Finished release [optimized + fuel] target(s) [592 B] in ??? + +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/eq_custom_type --release --ir final --asm final --bytecode | filter-fn eq_custom_type raw_ptr_write diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/snapshot.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/snapshot.toml new file mode 100644 index 00000000000..db174d81bb0 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/snapshot.toml @@ -0,0 +1,3 @@ +cmds = [ + "forc build --path {root} --ir final --asm final | filter-fn {name} just_for_loop" +] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/src/main.sw index 3b738c5c2a5..ab14fc1cc5b 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/src/main.sw @@ -1,22 +1,24 @@ script; +#[inline(never)] +fn just_for_loop(vector: Vec) { + let mut i = 0; + for n in vector.iter() { + assert(n == i); + i += 1; + } + assert(i == 5); +} + fn test_simple_for() { let mut vector = Vec::new(); - vector.push(0); vector.push(1); vector.push(2); vector.push(3); vector.push(4); - let mut i = 0; - - for n in vector.iter() { - assert(n == i); - i += 1; - } - - assert(i == 5); + just_for_loop(vector); } fn test_for_pattern_tuple() { diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/stdout.snap new file mode 100644 index 00000000000..4359526c731 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops/stdout.snap @@ -0,0 +1,154 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/for_loops --ir final --asm final | filter-fn for_loops just_for_loop + +fn just_for_loop_15(mut vector: __ptr { { ptr, u64 }, u64 }) -> () { + local mut { { { ptr, u64 }, u64 }, u64 } __for_iterable_2 + local mut { u64, ( () | u64 ) } __for_value_opt_1 + local { u64, ( () | u64 ) } __ret_val + local { { { ptr, u64 }, u64 }, u64 } __struct_init_0 + local mut u64 i + local u64 n + local u64 other_ + local u64 other_0 + local u64 other_1 + + entry(mut vector: __ptr { { ptr, u64 }, u64 }): + v1132v1 = get_local __ptr u64, i + v1133v1 = const u64 0 + store v1133v1 to v1132v1 + v1135v1 = get_local __ptr { { { ptr, u64 }, u64 }, u64 }, __struct_init_0 + v1136v1 = const u64 0 + v1137v1 = get_elem_ptr v1135v1, __ptr { { ptr, u64 }, u64 }, v1136v1 + mem_copy_val v1137v1, vector + v1139v1 = const u64 1 + v1140v1 = get_elem_ptr v1135v1, __ptr u64, v1139v1 + v1141v1 = const u64 0 + store v1141v1 to v1140v1 + v1143v1 = get_local __ptr { { { ptr, u64 }, u64 }, u64 }, __for_iterable_2 + mem_copy_val v1143v1, v1135v1 + br while() + + while(): + v1146v1 = const bool true + cbr v1146v1, while_body(), end_while() + + while_body(): + v1148v1 = get_local __ptr { { { ptr, u64 }, u64 }, u64 }, __for_iterable_2 + v1149v1 = get_local __ptr { u64, ( () | u64 ) }, __ret_val + v1150v1 = call next_17(v1148v1, v1149v1) + v1151v1 = get_local __ptr { u64, ( () | u64 ) }, __for_value_opt_1 + mem_copy_val v1151v1, v1149v1 + v1153v1 = get_local __ptr { u64, ( () | u64 ) }, __for_value_opt_1 + v1154v1 = const u64 0 + v1155v1 = get_elem_ptr v1153v1, __ptr u64, v1154v1 + v1156v1 = get_local __ptr u64, other_ + v1157v1 = const u64 1 + store v1157v1 to v1156v1 + v1159v1 = load v1155v1 + v1160v1 = get_local __ptr u64, other_ + v1161v1 = load v1160v1 + v1162v1 = cmp eq v1159v1 v1161v1 + v1163v1 = const bool false + cbr v1162v1, is_none_22_block2(v1163v1), is_none_22_block1() + + is_none_22_block1(): + v1165v1 = const bool true + br is_none_22_block2(v1165v1) + + is_none_22_block2(mut v1131v1: bool): + cbr v1131v1, end_while(), block1() + + block1(): + v1168v1 = get_local __ptr { u64, ( () | u64 ) }, __for_value_opt_1 + v1169v1 = call unwrap_23(v1168v1) + v1170v1 = get_local __ptr u64, n + store v1169v1 to v1170v1 + v1172v1 = get_local __ptr u64, i + v1173v1 = get_local __ptr u64, n + v1174v1 = load v1173v1 + v1175v1 = load v1172v1 + v1176v1 = cmp eq v1174v1 v1175v1 + v1177v1 = call assert_25(v1176v1) + v1178v1 = get_local __ptr u64, i + v1179v1 = get_local __ptr u64, other_0 + v1180v1 = const u64 1 + store v1180v1 to v1179v1 + v1182v1 = load v1178v1 + v1183v1 = get_local __ptr u64, other_0 + v1184v1 = load v1183v1 + v1185v1 = add v1182v1, v1184v1 + v1186v1 = get_local __ptr u64, i + store v1185v1 to v1186v1 + br while() + + end_while(): + v1189v1 = get_local __ptr u64, i + v1190v1 = get_local __ptr u64, other_1 + v1191v1 = const u64 5 + store v1191v1 to v1190v1 + v1193v1 = load v1189v1 + v1194v1 = get_local __ptr u64, other_1 + v1195v1 = load v1194v1 + v1196v1 = cmp eq v1193v1 v1195v1 + v1197v1 = call assert_25(v1196v1) + v1198v1 = const unit () + ret () v1198v1 +} + + + + + + +pshh i531456 ; [fn init: just_for_loop_15]: push used high registers 40..64 +move $$locbase $sp ; [fn init: just_for_loop_15]: set locals base register +cfei i136 ; [fn init: just_for_loop_15]: allocate: locals 136 byte(s), call args 0 slot(s) +move $r0 $$arg0 ; [fn init: just_for_loop_15]: copy argument 0 (vector) +move $r1 $$reta ; [fn init: just_for_loop_15]: save return address +sw $$locbase $zero i12 ; store word +addi $r2 $$locbase i64 ; get offset to local __ptr { { { ptr, u64 }, u64 }, u64 } +mcpi $r2 $r0 i24 ; copy memory +sw $$locbase $zero i11 ; store word +mcpi $$locbase $r2 i32 ; copy memory +addi $r0 $$locbase i48 ; get offset to local __ptr { u64, ( () | u64 ) } +move $$arg0 $$locbase ; [call: next_17]: pass argument 0 +move $$arg1 $r0 ; [call: next_17]: pass argument 1 +jal $$reta $pc i37 ; [call: next_17]: call function +addi $r2 $$locbase i32 ; get offset to local __ptr { u64, ( () | u64 ) } +mcpi $r2 $r0 i16 ; copy memory +sw $$locbase $one i14 ; store word +lw $r0 $$locbase i4 ; load word +lw $r2 $$locbase i14 ; load word +eq $r0 $r0 $r2 +movi $r2 i0 ; move parameter from branch to block argument +jnzf $r0 $zero i1 +movi $r2 i1 ; move parameter from branch to block argument +jnzf $r2 $zero i15 +addi $r0 $$locbase i32 ; get offset to local __ptr { u64, ( () | u64 ) } +move $$arg0 $r0 ; [call: unwrap_23]: pass argument 0 +jal $$reta $pc i110 ; [call: unwrap_23]: call function +sw $$locbase $$retv i13 ; store word +lw $r0 $$locbase i13 ; load word +lw $r2 $$locbase i12 ; load word +eq $r0 $r0 $r2 +move $$arg0 $r0 ; [call: assert_25]: pass argument 0 +jal $$reta $pc i121 ; [call: assert_25]: call function +sw $$locbase $one i15 ; store word +lw $r0 $$locbase i12 ; load word +lw $r2 $$locbase i15 ; load word +add $r0 $r0 $r2 +sw $$locbase $r0 i12 ; store word +jmpb $zero i27 +movi $r0 i5 ; initialize constant into register +sw $$locbase $r0 i16 ; store word +lw $r0 $$locbase i12 ; load word +lw $r2 $$locbase i16 ; load word +eq $r0 $r0 $r2 +move $$arg0 $r0 ; [call: assert_25]: pass argument 0 +jal $$reta $pc i108 ; [call: assert_25]: call function +cfsi i136 ; [fn end: just_for_loop_15] free: locals 136 byte(s), call args 0 slot(s) +move $$reta $r1 ; [fn end: just_for_loop_15] restore return address +poph i531456 ; [fn end: just_for_loop_15]: restore used high registers 40..64 +jal $zero $$reta i0 ; [fn end: just_for_loop_15] return from call diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg/stdout.snap index 334dfb25e7f..08a0d5051fb 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg/stdout.snap @@ -76,7 +76,7 @@ output: tested -- dbg - test call_main ... ok (???, 117840 gas) + test call_main ... ok (???, 110115 gas) debug output: [src/main.sw:13:13] () = () [src/main.sw:15:13] true = true diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg_release/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg_release/stdout.snap index f037cb43833..850eaf4ff91 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg_release/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg_release/stdout.snap @@ -25,7 +25,11 @@ ecal $r0 $r1 $zero $zero ; ecal id fd zero zero ecal $r0 $r1 $zero $zero ; ecal id fd zero zero ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count ecal $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r5 $r6 $r3 $one ; ecal id fd buf count +ecal $r2 $r3 $r0 $one ; ecal id fd buf count ecal $r0 $r2 $zero $zero ; ecal id fd zero zero +ecal $r5 $r6 $r3 $one ; ecal id fd buf count +ecal $r2 $r3 $r0 $one ; ecal id fd buf count ecal $r0 $r2 $zero $zero ; ecal id fd zero zero ecal $r0 $r2 $zero $zero ; ecal id fd zero zero ecal $r0 $r1 $zero $zero ; ecal id fd zero zero @@ -35,5 +39,3 @@ ecal $r0 $r2 $zero $zero ; ecal id fd zero zero ecal $r0 $r1 $zero $zero ; ecal id fd zero zero ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count -ecal $r3 $r4 $$locbase $one ; ecal id fd buf count -ecal $r1 $r3 $r0 $one ; ecal id fd buf count diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap index 85196b254ba..e78a0d53cda 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap @@ -389,7 +389,6 @@ script { local mut { ptr, u64, u64 } __aggr_memcpy_07 local mut { u64, u64 } __aggr_memcpy_08 local mut slice __aggr_memcpy_09 - local { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 } __anon_0 local { ptr, u64, u64 } __anon_00 local { ptr, u64, u64 } __anon_000 local { ptr, u64, u64 } __anon_01 @@ -424,7 +423,6 @@ script { local { { ptr, u64, u64 } } __tmp_arg0 local { { ptr, u64, u64 } } __tmp_arg1 local slice __tmp_block_arg - local { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 } __tuple_init_0 local { ptr, u64 } __tuple_init_00 local { { ptr, u64, u64 } } buffer local { { ptr, u64, u64 } } buffer_ @@ -453,399 +451,359 @@ script { entry(item: __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }): v494v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, item_ mem_copy_val v494v1, item - v2807v1 = const bool false, !167 - cbr v2807v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block8(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v2807v1), !169 - - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block8(): - v532v1 = const bool false, !170 - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v532v1), !171 - - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(mut v2771v1: bool): - cbr v2771v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block10(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v2771v1), !173 - - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block10(): - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v532v1), !174 - - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(mut v2774v1: bool): - cbr v2774v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block12(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v2774v1), !176 - - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block12(): - v524v1 = const bool true, !177 - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v524v1), !178 - - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(mut v2777v1: bool): - cbr v2777v1, encode_allow_alias_22_block0(), encode_allow_alias_22_block1(), !179 - - encode_allow_alias_22_block0(): - v3216v1 = get_local __ptr { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 }, __tuple_init_0, !180 - v1466v1 = const u64 0 - v3219v1 = get_elem_ptr v3216v1, __ptr __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, v1466v1, !181 - store v494v1 to v3219v1, !182 - v1469v1 = const u64 1 - v3221v1 = get_elem_ptr v3216v1, __ptr u64, v1469v1, !183 - v558v1 = const u64 104 - store v558v1 to v3221v1, !184 - v3224v1 = get_local __ptr { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 }, __anon_0, !74 - mem_copy_val v3224v1, v3216v1 - v3226v1 = cast_ptr v3224v1 to __ptr slice, !74 - v3740v1 = get_local __ptr slice, __tmp_block_arg - mem_copy_val v3740v1, v3226v1 - br encode_allow_alias_22_block2(v3740v1), !74 - - encode_allow_alias_22_block1(): v3810v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val1 v3811v1 = call new_6(v3810v1) - v2843v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !187 + v2843v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !163 mem_copy_val v2843v1, v494v1 - v2845v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !188 + v2845v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !164 mem_copy_val v2845v1, v3810v1 v579v1 = const u64 0 - v2848v1 = get_elem_ptr v2843v1, __ptr u64, v579v1, !190 - v2849v1 = load v2848v1, !191 + v2848v1 = get_elem_ptr v2843v1, __ptr u64, v579v1, !166 + v2849v1 = load v2848v1, !167 v3704v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg mem_copy_val v3704v1, v2845v1 v3788v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val v3789v1 = call abi_encode_5(v2849v1, v3704v1, v3788v1) - v2853v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !193 + v2853v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !169 mem_copy_val v2853v1, v3788v1 v649v1 = const u64 1 - v2856v1 = get_elem_ptr v2843v1, __ptr u64, v649v1, !195 - v2861v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !198 + v2856v1 = get_elem_ptr v2843v1, __ptr u64, v649v1, !171 + v2861v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !174 mem_copy_val v2861v1, v2853v1 - v2863v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !200 + v2863v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !176 v595v1 = const u64 0 - v2865v1 = get_elem_ptr v2861v1, __ptr { ptr, u64, u64 }, v595v1, !201 + v2865v1 = get_elem_ptr v2861v1, __ptr { ptr, u64, u64 }, v595v1, !177 v3855v1 = asm(buffer: v2865v1) -> __ptr { ptr, u64, u64 } buffer { } v3932v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 mem_copy_val v3932v1, v3855v1 - v2868v1 = get_local __ptr { ptr, u64, u64 }, __anon_00, !202 + v2868v1 = get_local __ptr { ptr, u64, u64 }, __anon_00, !178 mem_copy_val v2868v1, v3932v1 v601v1 = const u64 0 - v2870v1 = get_elem_ptr v2868v1, __ptr ptr, v601v1, !203 - v2871v1 = load v2870v1, !204 + v2870v1 = get_elem_ptr v2868v1, __ptr ptr, v601v1, !179 + v2871v1 = load v2870v1, !180 v604v1 = const u64 1 - v2872v1 = get_elem_ptr v2868v1, __ptr u64, v604v1, !205 - v2873v1 = load v2872v1, !206 + v2872v1 = get_elem_ptr v2868v1, __ptr u64, v604v1, !181 + v2873v1 = load v2872v1, !182 v607v1 = const u64 2 - v2874v1 = get_elem_ptr v2868v1, __ptr u64, v607v1, !207 - v2875v1 = load v2874v1, !208 + v2874v1 = get_elem_ptr v2868v1, __ptr u64, v607v1, !183 + v2875v1 = load v2874v1, !184 v612v1 = const u64 4 - v2877v1 = add v2875v1, v612v1, !209 - v2878v1 = cmp gt v2877v1 v2873v1, !210 - cbr v2878v1, encode_allow_alias_22_abi_encode_37_abi_encode_38_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2871v1, v2873v1), !211 + v2877v1 = add v2875v1, v612v1, !185 + v2878v1 = cmp gt v2877v1 v2873v1, !186 + cbr v2878v1, encode_allow_alias_22_abi_encode_37_abi_encode_38_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2871v1, v2873v1), !187 encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(mut v2780v1: ptr, mut v2781v1: u64): - v2885v1 = get_local __ptr u64, __anon_1, !212 + v2885v1 = get_local __ptr u64, __anon_1, !188 mem_copy_val v2885v1, v2856v1 v626v1 = const u64 4 - v2887v1 = add v2885v1, v626v1, !213 - v2888v1 = cast_ptr v2887v1 to __ptr u8, !214 - v2889v1 = add v2780v1, v2875v1, !215 - v2890v1 = cast_ptr v2889v1 to __ptr u8, !216 - mem_copy_bytes v2890v1, v2888v1, 4, !217 - v2893v1 = get_local __ptr { ptr, u64, u64 }, __anon_2, !218 + v2887v1 = add v2885v1, v626v1, !189 + v2888v1 = cast_ptr v2887v1 to __ptr u8, !190 + v2889v1 = add v2780v1, v2875v1, !191 + v2890v1 = cast_ptr v2889v1 to __ptr u8, !192 + mem_copy_bytes v2890v1, v2888v1, 4, !193 + v2893v1 = get_local __ptr { ptr, u64, u64 }, __anon_2, !194 v635v1 = const u64 0 - v2894v1 = get_elem_ptr v2893v1, __ptr ptr, v635v1, !219 - store v2780v1 to v2894v1, !220 + v2894v1 = get_elem_ptr v2893v1, __ptr ptr, v635v1, !195 + store v2780v1 to v2894v1, !196 v638v1 = const u64 1 - v2896v1 = get_elem_ptr v2893v1, __ptr u64, v638v1, !221 - store v2781v1 to v2896v1, !222 + v2896v1 = get_elem_ptr v2893v1, __ptr u64, v638v1, !197 + store v2781v1 to v2896v1, !198 v641v1 = const u64 2 - v2898v1 = get_elem_ptr v2893v1, __ptr u64, v641v1, !223 - store v2877v1 to v2898v1, !224 + v2898v1 = get_elem_ptr v2893v1, __ptr u64, v641v1, !199 + store v2877v1 to v2898v1, !200 v3857v1 = asm(buffer: v2893v1) -> __ptr { ptr, u64, u64 } buffer { } v3936v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 mem_copy_val v3936v1, v3857v1 v1472v1 = const u64 0 - v2901v1 = get_elem_ptr v2863v1, __ptr { ptr, u64, u64 }, v1472v1, !225 + v2901v1 = get_elem_ptr v2863v1, __ptr { ptr, u64, u64 }, v1472v1, !201 mem_copy_val v2901v1, v3936v1 - v2905v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !227 + v2905v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !203 mem_copy_val v2905v1, v2863v1 v719v1 = const u64 2 - v2908v1 = get_elem_ptr v2843v1, __ptr u64, v719v1, !229 - v2913v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !232 + v2908v1 = get_elem_ptr v2843v1, __ptr u64, v719v1, !205 + v2913v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !208 mem_copy_val v2913v1, v2905v1 - v2915v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_00, !234 + v2915v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_00, !210 v665v1 = const u64 0 - v2917v1 = get_elem_ptr v2913v1, __ptr { ptr, u64, u64 }, v665v1, !235 + v2917v1 = get_elem_ptr v2913v1, __ptr { ptr, u64, u64 }, v665v1, !211 v3859v1 = asm(buffer: v2917v1) -> __ptr { ptr, u64, u64 } buffer { } v3941v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 mem_copy_val v3941v1, v3859v1 - v2920v1 = get_local __ptr { ptr, u64, u64 }, __anon_000, !236 + v2920v1 = get_local __ptr { ptr, u64, u64 }, __anon_000, !212 mem_copy_val v2920v1, v3941v1 v671v1 = const u64 0 - v2922v1 = get_elem_ptr v2920v1, __ptr ptr, v671v1, !237 - v2923v1 = load v2922v1, !238 + v2922v1 = get_elem_ptr v2920v1, __ptr ptr, v671v1, !213 + v2923v1 = load v2922v1, !214 v674v1 = const u64 1 - v2924v1 = get_elem_ptr v2920v1, __ptr u64, v674v1, !239 - v2925v1 = load v2924v1, !240 + v2924v1 = get_elem_ptr v2920v1, __ptr u64, v674v1, !215 + v2925v1 = load v2924v1, !216 v677v1 = const u64 2 - v2926v1 = get_elem_ptr v2920v1, __ptr u64, v677v1, !241 - v2927v1 = load v2926v1, !242 + v2926v1 = get_elem_ptr v2920v1, __ptr u64, v677v1, !217 + v2927v1 = load v2926v1, !218 v682v1 = const u64 2 - v2929v1 = add v2927v1, v682v1, !243 - v2930v1 = cmp gt v2929v1 v2925v1, !244 - cbr v2930v1, encode_allow_alias_22_abi_encode_37_abi_encode_39_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2923v1, v2925v1), !245 + v2929v1 = add v2927v1, v682v1, !219 + v2930v1 = cmp gt v2929v1 v2925v1, !220 + cbr v2930v1, encode_allow_alias_22_abi_encode_37_abi_encode_39_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2923v1, v2925v1), !221 encode_allow_alias_22_abi_encode_37_abi_encode_38_block1(): v618v1 = const u64 2 - v2881v1 = mul v2873v1, v618v1, !246 - v2882v1 = add v2881v1, v612v1, !247 - v2883v1 = asm(new_cap: v2882v1, old_ptr: v2871v1, len: v2875v1) -> __ptr u8 hp, !248 { + v2881v1 = mul v2873v1, v618v1, !222 + v2882v1 = add v2881v1, v612v1, !223 + v2883v1 = asm(new_cap: v2882v1, old_ptr: v2871v1, len: v2875v1) -> __ptr u8 hp, !224 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2883v1, v2882v1), !249 + br encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2883v1, v2882v1), !225 encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(mut v2783v1: ptr, mut v2784v1: u64): - v2937v1 = get_local __ptr u64, __anon_10, !250 + v2937v1 = get_local __ptr u64, __anon_10, !226 mem_copy_val v2937v1, v2908v1 v696v1 = const u64 6 - v2939v1 = add v2937v1, v696v1, !251 - v2940v1 = cast_ptr v2939v1 to __ptr u8, !252 - v2941v1 = add v2783v1, v2927v1, !253 - v2942v1 = cast_ptr v2941v1 to __ptr u8, !254 - mem_copy_bytes v2942v1, v2940v1, 2, !255 - v2945v1 = get_local __ptr { ptr, u64, u64 }, __anon_20, !256 + v2939v1 = add v2937v1, v696v1, !227 + v2940v1 = cast_ptr v2939v1 to __ptr u8, !228 + v2941v1 = add v2783v1, v2927v1, !229 + v2942v1 = cast_ptr v2941v1 to __ptr u8, !230 + mem_copy_bytes v2942v1, v2940v1, 2, !231 + v2945v1 = get_local __ptr { ptr, u64, u64 }, __anon_20, !232 v705v1 = const u64 0 - v2946v1 = get_elem_ptr v2945v1, __ptr ptr, v705v1, !257 - store v2783v1 to v2946v1, !258 + v2946v1 = get_elem_ptr v2945v1, __ptr ptr, v705v1, !233 + store v2783v1 to v2946v1, !234 v708v1 = const u64 1 - v2948v1 = get_elem_ptr v2945v1, __ptr u64, v708v1, !259 - store v2784v1 to v2948v1, !260 + v2948v1 = get_elem_ptr v2945v1, __ptr u64, v708v1, !235 + store v2784v1 to v2948v1, !236 v711v1 = const u64 2 - v2950v1 = get_elem_ptr v2945v1, __ptr u64, v711v1, !261 - store v2929v1 to v2950v1, !262 + v2950v1 = get_elem_ptr v2945v1, __ptr u64, v711v1, !237 + store v2929v1 to v2950v1, !238 v3861v1 = asm(buffer: v2945v1) -> __ptr { ptr, u64, u64 } buffer { } v3945v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 mem_copy_val v3945v1, v3861v1 v1475v1 = const u64 0 - v2953v1 = get_elem_ptr v2915v1, __ptr { ptr, u64, u64 }, v1475v1, !263 + v2953v1 = get_elem_ptr v2915v1, __ptr { ptr, u64, u64 }, v1475v1, !239 mem_copy_val v2953v1, v3945v1 - v2957v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !265 + v2957v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !241 mem_copy_val v2957v1, v2915v1 v784v1 = const u64 3 - v2960v1 = get_elem_ptr v2843v1, __ptr u8, v784v1, !267 - v2961v1 = load v2960v1, !268 - v2965v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_2, !271 + v2960v1 = get_elem_ptr v2843v1, __ptr u8, v784v1, !243 + v2961v1 = load v2960v1, !244 + v2965v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_2, !247 mem_copy_val v2965v1, v2957v1 - v2967v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_01, !273 + v2967v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_01, !249 v735v1 = const u64 0 - v2969v1 = get_elem_ptr v2965v1, __ptr { ptr, u64, u64 }, v735v1, !274 + v2969v1 = get_elem_ptr v2965v1, __ptr { ptr, u64, u64 }, v735v1, !250 v3863v1 = asm(buffer: v2969v1) -> __ptr { ptr, u64, u64 } buffer { } v3950v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_03 mem_copy_val v3950v1, v3863v1 - v2972v1 = get_local __ptr { ptr, u64, u64 }, __anon_01, !275 + v2972v1 = get_local __ptr { ptr, u64, u64 }, __anon_01, !251 mem_copy_val v2972v1, v3950v1 v741v1 = const u64 0 - v2974v1 = get_elem_ptr v2972v1, __ptr ptr, v741v1, !276 - v2975v1 = load v2974v1, !277 + v2974v1 = get_elem_ptr v2972v1, __ptr ptr, v741v1, !252 + v2975v1 = load v2974v1, !253 v744v1 = const u64 1 - v2976v1 = get_elem_ptr v2972v1, __ptr u64, v744v1, !278 - v2977v1 = load v2976v1, !279 + v2976v1 = get_elem_ptr v2972v1, __ptr u64, v744v1, !254 + v2977v1 = load v2976v1, !255 v747v1 = const u64 2 - v2978v1 = get_elem_ptr v2972v1, __ptr u64, v747v1, !280 - v2979v1 = load v2978v1, !281 + v2978v1 = get_elem_ptr v2972v1, __ptr u64, v747v1, !256 + v2979v1 = load v2978v1, !257 v752v1 = const u64 1 - v2981v1 = add v2979v1, v752v1, !282 - v2982v1 = cmp gt v2981v1 v2977v1, !283 - cbr v2982v1, encode_allow_alias_22_abi_encode_37_abi_encode_40_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v2975v1, v2977v1), !284 + v2981v1 = add v2979v1, v752v1, !258 + v2982v1 = cmp gt v2981v1 v2977v1, !259 + cbr v2982v1, encode_allow_alias_22_abi_encode_37_abi_encode_40_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v2975v1, v2977v1), !260 encode_allow_alias_22_abi_encode_37_abi_encode_39_block1(): v688v1 = const u64 2 - v2933v1 = mul v2925v1, v688v1, !285 - v2934v1 = add v2933v1, v682v1, !286 - v2935v1 = asm(new_cap: v2934v1, old_ptr: v2923v1, len: v2927v1) -> __ptr u8 hp, !287 { + v2933v1 = mul v2925v1, v688v1, !261 + v2934v1 = add v2933v1, v682v1, !262 + v2935v1 = asm(new_cap: v2934v1, old_ptr: v2923v1, len: v2927v1) -> __ptr u8 hp, !263 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2935v1, v2934v1), !288 + br encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2935v1, v2934v1), !264 encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(mut v2786v1: ptr, mut v2787v1: u64): - v2989v1 = add v2786v1, v2979v1, !289 - v2990v1 = cast_ptr v2989v1 to __ptr u8, !290 - store v2961v1 to v2990v1, !291 - v2993v1 = get_local __ptr { ptr, u64, u64 }, __anon_11, !292 + v2989v1 = add v2786v1, v2979v1, !265 + v2990v1 = cast_ptr v2989v1 to __ptr u8, !266 + store v2961v1 to v2990v1, !267 + v2993v1 = get_local __ptr { ptr, u64, u64 }, __anon_11, !268 v770v1 = const u64 0 - v2994v1 = get_elem_ptr v2993v1, __ptr ptr, v770v1, !293 - store v2786v1 to v2994v1, !294 + v2994v1 = get_elem_ptr v2993v1, __ptr ptr, v770v1, !269 + store v2786v1 to v2994v1, !270 v773v1 = const u64 1 - v2996v1 = get_elem_ptr v2993v1, __ptr u64, v773v1, !295 - store v2787v1 to v2996v1, !296 + v2996v1 = get_elem_ptr v2993v1, __ptr u64, v773v1, !271 + store v2787v1 to v2996v1, !272 v776v1 = const u64 2 - v2998v1 = get_elem_ptr v2993v1, __ptr u64, v776v1, !297 - store v2981v1 to v2998v1, !298 + v2998v1 = get_elem_ptr v2993v1, __ptr u64, v776v1, !273 + store v2981v1 to v2998v1, !274 v3865v1 = asm(buffer: v2993v1) -> __ptr { ptr, u64, u64 } buffer { } v3953v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_04 mem_copy_val v3953v1, v3865v1 v1478v1 = const u64 0 - v3001v1 = get_elem_ptr v2967v1, __ptr { ptr, u64, u64 }, v1478v1, !299 + v3001v1 = get_elem_ptr v2967v1, __ptr { ptr, u64, u64 }, v1478v1, !275 mem_copy_val v3001v1, v3953v1 - v3005v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !301 + v3005v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !277 mem_copy_val v3005v1, v2967v1 v892v1 = const u64 4 - v3008v1 = get_elem_ptr v2843v1, __ptr { { ptr, u64 }, u64 }, v892v1, !303 - v3012v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !306 + v3008v1 = get_elem_ptr v2843v1, __ptr { { ptr, u64 }, u64 }, v892v1, !279 + v3012v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !282 mem_copy_val v3012v1, v3008v1 - v3014v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_3, !307 + v3014v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_3, !283 mem_copy_val v3014v1, v3005v1 v804v1 = const u64 1 - v3018v1 = get_elem_ptr v3012v1, __ptr u64, v804v1, !308 - v3019v1 = load v3018v1, !309 + v3018v1 = get_elem_ptr v3012v1, __ptr u64, v804v1, !284 + v3019v1 = load v3018v1, !285 v3707v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg0 mem_copy_val v3707v1, v3014v1 v3791v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val0 v3792v1 = call abi_encode_5(v3019v1, v3707v1, v3791v1) - v3023v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !311 + v3023v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !287 mem_copy_val v3023v1, v3791v1 - v3027v1 = get_local __ptr { ptr, u64 }, __tuple_init_00, !313 + v3027v1 = get_local __ptr { ptr, u64 }, __tuple_init_00, !289 v876v1 = const u64 0 - v3029v1 = get_elem_ptr v3012v1, __ptr { ptr, u64 }, v876v1, !314 + v3029v1 = get_elem_ptr v3012v1, __ptr { ptr, u64 }, v876v1, !290 v878v1 = const u64 0 - v3030v1 = get_elem_ptr v3029v1, __ptr ptr, v878v1, !315 - v3034v1 = load v3018v1, !316 + v3030v1 = get_elem_ptr v3029v1, __ptr ptr, v878v1, !291 + v3034v1 = load v3018v1, !292 v885v1 = const u64 8 - v3039v1 = mul v3034v1, v885v1, !319 + v3039v1 = mul v3034v1, v885v1, !295 v1481v1 = const u64 0 - v3041v1 = get_elem_ptr v3027v1, __ptr ptr, v1481v1, !320 + v3041v1 = get_elem_ptr v3027v1, __ptr ptr, v1481v1, !296 mem_copy_val v3041v1, v3030v1 v1484v1 = const u64 1 - v3043v1 = get_elem_ptr v3027v1, __ptr u64, v1484v1, !321 - store v3039v1 to v3043v1, !322 - v3046v1 = get_local __ptr { { ptr, u64, u64 } }, self_10, !325 + v3043v1 = get_elem_ptr v3027v1, __ptr u64, v1484v1, !297 + store v3039v1 to v3043v1, !298 + v3046v1 = get_local __ptr { { ptr, u64, u64 } }, self_10, !301 mem_copy_val v3046v1, v3023v1 - v3048v1 = get_local __ptr { ptr, u64 }, r_, !326 + v3048v1 = get_local __ptr { ptr, u64 }, r_, !302 mem_copy_val v3048v1, v3027v1 - v3050v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_02, !328 + v3050v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_02, !304 v820v1 = const u64 0 - v3052v1 = get_elem_ptr v3046v1, __ptr { ptr, u64, u64 }, v820v1, !329 + v3052v1 = get_elem_ptr v3046v1, __ptr { ptr, u64, u64 }, v820v1, !305 v3867v1 = asm(buffer: v3052v1) -> __ptr { ptr, u64, u64 } buffer { } v3964v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_05 mem_copy_val v3964v1, v3867v1 - v3055v1 = get_local __ptr { ptr, u64, u64 }, __anon_02, !330 + v3055v1 = get_local __ptr { ptr, u64, u64 }, __anon_02, !306 mem_copy_val v3055v1, v3964v1 v826v1 = const u64 0 - v3057v1 = get_elem_ptr v3055v1, __ptr ptr, v826v1, !331 - v3058v1 = load v3057v1, !332 + v3057v1 = get_elem_ptr v3055v1, __ptr ptr, v826v1, !307 + v3058v1 = load v3057v1, !308 v829v1 = const u64 1 - v3059v1 = get_elem_ptr v3055v1, __ptr u64, v829v1, !333 - v3060v1 = load v3059v1, !334 + v3059v1 = get_elem_ptr v3055v1, __ptr u64, v829v1, !309 + v3060v1 = load v3059v1, !310 v832v1 = const u64 2 - v3061v1 = get_elem_ptr v3055v1, __ptr u64, v832v1, !335 - v3062v1 = load v3061v1, !336 - v3065v1 = get_local __ptr { ptr, u64 }, __anon_12, !337 + v3061v1 = get_elem_ptr v3055v1, __ptr u64, v832v1, !311 + v3062v1 = load v3061v1, !312 + v3065v1 = get_local __ptr { ptr, u64 }, __anon_12, !313 mem_copy_val v3065v1, v3048v1 v839v1 = const u64 1 - v3067v1 = get_elem_ptr v3065v1, __ptr u64, v839v1, !338 - v3068v1 = load v3067v1, !339 - v3069v1 = add v3062v1, v3068v1, !340 - v3070v1 = cmp gt v3069v1 v3060v1, !341 - cbr v3070v1, encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block0(v3058v1, v3060v1), !342 + v3067v1 = get_elem_ptr v3065v1, __ptr u64, v839v1, !314 + v3068v1 = load v3067v1, !315 + v3069v1 = add v3062v1, v3068v1, !316 + v3070v1 = cmp gt v3069v1 v3060v1, !317 + cbr v3070v1, encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block0(v3058v1, v3060v1), !318 encode_allow_alias_22_abi_encode_37_abi_encode_40_block1(): v758v1 = const u64 2 - v2985v1 = mul v2977v1, v758v1, !343 - v2986v1 = add v2985v1, v752v1, !344 - v2987v1 = asm(new_cap: v2986v1, old_ptr: v2975v1, len: v2979v1) -> __ptr u8 hp, !345 { + v2985v1 = mul v2977v1, v758v1, !319 + v2986v1 = add v2985v1, v752v1, !320 + v2987v1 = asm(new_cap: v2986v1, old_ptr: v2975v1, len: v2979v1) -> __ptr u8 hp, !321 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v2987v1, v2986v1), !346 + br encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v2987v1, v2986v1), !322 encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block0(mut v2790v1: ptr, mut v2791v1: u64): - v3077v1 = get_local __ptr { ptr, u64 }, __anon_21, !347 + v3077v1 = get_local __ptr { ptr, u64 }, __anon_21, !323 mem_copy_val v3077v1, v3048v1 - v3079v1 = add v2790v1, v3062v1, !348 - v3080v1 = cast_ptr v3079v1 to __ptr u8, !349 - v3081v1 = asm(item_ptr: v3077v1, len: v3062v1, addr: v3080v1, data_ptr, item_len, new_len) -> u64 new_len, !350 { + v3079v1 = add v2790v1, v3062v1, !324 + v3080v1 = cast_ptr v3079v1 to __ptr u8, !325 + v3081v1 = asm(item_ptr: v3077v1, len: v3062v1, addr: v3080v1, data_ptr, item_len, new_len) -> u64 new_len, !326 { lw item_len item_ptr i1 lw data_ptr item_ptr i0 mcp addr data_ptr item_len add new_len len item_len } - v3082v1 = get_local __ptr { ptr, u64, u64 }, __anon_3, !351 + v3082v1 = get_local __ptr { ptr, u64, u64 }, __anon_3, !327 v859v1 = const u64 0 - v3083v1 = get_elem_ptr v3082v1, __ptr ptr, v859v1, !352 - store v2790v1 to v3083v1, !353 + v3083v1 = get_elem_ptr v3082v1, __ptr ptr, v859v1, !328 + store v2790v1 to v3083v1, !329 v862v1 = const u64 1 - v3085v1 = get_elem_ptr v3082v1, __ptr u64, v862v1, !354 - store v2791v1 to v3085v1, !355 + v3085v1 = get_elem_ptr v3082v1, __ptr u64, v862v1, !330 + store v2791v1 to v3085v1, !331 v865v1 = const u64 2 - v3087v1 = get_elem_ptr v3082v1, __ptr u64, v865v1, !356 - store v3081v1 to v3087v1, !357 + v3087v1 = get_elem_ptr v3082v1, __ptr u64, v865v1, !332 + store v3081v1 to v3087v1, !333 v3869v1 = asm(buffer: v3082v1) -> __ptr { ptr, u64, u64 } buffer { } v3969v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_06 mem_copy_val v3969v1, v3869v1 v1487v1 = const u64 0 - v3090v1 = get_elem_ptr v3050v1, __ptr { ptr, u64, u64 }, v1487v1, !358 + v3090v1 = get_elem_ptr v3050v1, __ptr { ptr, u64, u64 }, v1487v1, !334 mem_copy_val v3090v1, v3969v1 - v3095v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !360 + v3095v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !336 mem_copy_val v3095v1, v3050v1 v964v1 = const u64 5 - v3098v1 = get_elem_ptr v2843v1, __ptr slice, v964v1, !362 - v3102v1 = get_local __ptr slice, self_4, !365 + v3098v1 = get_elem_ptr v2843v1, __ptr slice, v964v1, !338 + v3102v1 = get_local __ptr slice, self_4, !341 mem_copy_val v3102v1, v3098v1 - v3104v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_4, !366 + v3104v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_4, !342 mem_copy_val v3104v1, v3095v1 - v3106v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_03, !368 + v3106v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_03, !344 v908v1 = const u64 0 - v3108v1 = get_elem_ptr v3104v1, __ptr { ptr, u64, u64 }, v908v1, !369 + v3108v1 = get_elem_ptr v3104v1, __ptr { ptr, u64, u64 }, v908v1, !345 v3871v1 = asm(buffer: v3108v1) -> __ptr { ptr, u64, u64 } buffer { } v3975v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_07 mem_copy_val v3975v1, v3871v1 - v3111v1 = get_local __ptr { ptr, u64, u64 }, __anon_03, !370 + v3111v1 = get_local __ptr { ptr, u64, u64 }, __anon_03, !346 mem_copy_val v3111v1, v3975v1 v914v1 = const u64 0 - v3113v1 = get_elem_ptr v3111v1, __ptr ptr, v914v1, !371 - v3114v1 = load v3113v1, !372 + v3113v1 = get_elem_ptr v3111v1, __ptr ptr, v914v1, !347 + v3114v1 = load v3113v1, !348 v917v1 = const u64 1 - v3115v1 = get_elem_ptr v3111v1, __ptr u64, v917v1, !373 - v3116v1 = load v3115v1, !374 + v3115v1 = get_elem_ptr v3111v1, __ptr u64, v917v1, !349 + v3116v1 = load v3115v1, !350 v920v1 = const u64 2 - v3117v1 = get_elem_ptr v3111v1, __ptr u64, v920v1, !375 - v3118v1 = load v3117v1, !376 + v3117v1 = get_elem_ptr v3111v1, __ptr u64, v920v1, !351 + v3118v1 = load v3117v1, !352 v3981v1 = get_local __ptr slice, __aggr_memcpy_09 mem_copy_val v3981v1, v3102v1 v3873v1 = asm(item: v3102v1) -> __ptr { u64, u64 } item { } v3978v1 = get_local __ptr { u64, u64 }, __aggr_memcpy_08 mem_copy_val v3978v1, v3873v1 - v3122v1 = get_local __ptr { u64, u64 }, __anon_13, !377 + v3122v1 = get_local __ptr { u64, u64 }, __anon_13, !353 mem_copy_val v3122v1, v3978v1 v928v1 = const u64 1 - v3124v1 = get_elem_ptr v3122v1, __ptr u64, v928v1, !378 - v3125v1 = load v3124v1, !379 + v3124v1 = get_elem_ptr v3122v1, __ptr u64, v928v1, !354 + v3125v1 = load v3124v1, !355 v931v1 = const u64 8 - v3126v1 = add v3125v1, v931v1, !380 - v3127v1 = add v3118v1, v3126v1, !381 - v3128v1 = cmp gt v3127v1 v3116v1, !382 - cbr v3128v1, encode_allow_alias_22_abi_encode_37_abi_encode_43_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_43_block0(v3114v1, v3116v1), !383 + v3126v1 = add v3125v1, v931v1, !356 + v3127v1 = add v3118v1, v3126v1, !357 + v3128v1 = cmp gt v3127v1 v3116v1, !358 + cbr v3128v1, encode_allow_alias_22_abi_encode_37_abi_encode_43_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_43_block0(v3114v1, v3116v1), !359 encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block1(): v847v1 = const u64 2 - v3073v1 = mul v3060v1, v847v1, !384 - v3074v1 = add v3073v1, v3068v1, !385 - v3075v1 = asm(new_cap: v3074v1, old_ptr: v3058v1, len: v3062v1) -> __ptr u8 hp, !386 { + v3073v1 = mul v3060v1, v847v1, !360 + v3074v1 = add v3073v1, v3068v1, !361 + v3075v1 = asm(new_cap: v3074v1, old_ptr: v3058v1, len: v3062v1) -> __ptr u8 hp, !362 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block0(v3075v1, v3074v1), !387 + br encode_allow_alias_22_abi_encode_37_abi_encode_41_append_raw_42_block0(v3075v1, v3074v1), !363 encode_allow_alias_22_abi_encode_37_abi_encode_43_block0(mut v2794v1: ptr, mut v2795v1: u64): - v3135v1 = get_local __ptr slice, __anon_22, !388 + v3135v1 = get_local __ptr slice, __anon_22, !364 mem_copy_val v3135v1, v3981v1 - v3137v1 = add v2794v1, v3118v1, !389 - v3138v1 = cast_ptr v3137v1 to __ptr u8, !390 - v3139v1 = asm(item_ptr: v3135v1, len: v3118v1, addr: v3138v1, data_ptr, item_len, new_len) -> u64 new_len, !391 { + v3137v1 = add v2794v1, v3118v1, !365 + v3138v1 = cast_ptr v3137v1 to __ptr u8, !366 + v3139v1 = asm(item_ptr: v3135v1, len: v3118v1, addr: v3138v1, data_ptr, item_len, new_len) -> u64 new_len, !367 { lw item_len item_ptr i1 sw addr item_len i0 addi addr addr i8 @@ -854,90 +812,90 @@ script { addi new_len len i8 add new_len new_len item_len } - v3140v1 = get_local __ptr { ptr, u64, u64 }, __anon_30, !392 + v3140v1 = get_local __ptr { ptr, u64, u64 }, __anon_30, !368 v950v1 = const u64 0 - v3141v1 = get_elem_ptr v3140v1, __ptr ptr, v950v1, !393 - store v2794v1 to v3141v1, !394 + v3141v1 = get_elem_ptr v3140v1, __ptr ptr, v950v1, !369 + store v2794v1 to v3141v1, !370 v953v1 = const u64 1 - v3143v1 = get_elem_ptr v3140v1, __ptr u64, v953v1, !395 - store v2795v1 to v3143v1, !396 + v3143v1 = get_elem_ptr v3140v1, __ptr u64, v953v1, !371 + store v2795v1 to v3143v1, !372 v956v1 = const u64 2 - v3145v1 = get_elem_ptr v3140v1, __ptr u64, v956v1, !397 - store v3139v1 to v3145v1, !398 + v3145v1 = get_elem_ptr v3140v1, __ptr u64, v956v1, !373 + store v3139v1 to v3145v1, !374 v3875v1 = asm(buffer: v3140v1) -> __ptr { ptr, u64, u64 } buffer { } v3984v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_010 mem_copy_val v3984v1, v3875v1 v1490v1 = const u64 0 - v3148v1 = get_elem_ptr v3106v1, __ptr { ptr, u64, u64 }, v1490v1, !399 + v3148v1 = get_elem_ptr v3106v1, __ptr { ptr, u64, u64 }, v1490v1, !375 mem_copy_val v3148v1, v3984v1 - v3152v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_______, !401 + v3152v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_______, !377 mem_copy_val v3152v1, v3106v1 v1031v1 = const u64 6 - v3155v1 = get_elem_ptr v2843v1, __ptr u256, v1031v1, !403 - v3159v1 = get_local __ptr u256, self_5, !406 + v3155v1 = get_elem_ptr v2843v1, __ptr u256, v1031v1, !379 + v3159v1 = get_local __ptr u256, self_5, !382 mem_copy_val v3159v1, v3155v1 - v3161v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_5, !407 + v3161v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_5, !383 mem_copy_val v3161v1, v3152v1 - v3163v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_04, !409 + v3163v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_04, !385 v980v1 = const u64 0 - v3165v1 = get_elem_ptr v3161v1, __ptr { ptr, u64, u64 }, v980v1, !410 + v3165v1 = get_elem_ptr v3161v1, __ptr { ptr, u64, u64 }, v980v1, !386 v3877v1 = asm(buffer: v3165v1) -> __ptr { ptr, u64, u64 } buffer { } v3990v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_011 mem_copy_val v3990v1, v3877v1 - v3168v1 = get_local __ptr { ptr, u64, u64 }, __anon_04, !411 + v3168v1 = get_local __ptr { ptr, u64, u64 }, __anon_04, !387 mem_copy_val v3168v1, v3990v1 v986v1 = const u64 0 - v3170v1 = get_elem_ptr v3168v1, __ptr ptr, v986v1, !412 - v3171v1 = load v3170v1, !413 + v3170v1 = get_elem_ptr v3168v1, __ptr ptr, v986v1, !388 + v3171v1 = load v3170v1, !389 v989v1 = const u64 1 - v3172v1 = get_elem_ptr v3168v1, __ptr u64, v989v1, !414 - v3173v1 = load v3172v1, !415 + v3172v1 = get_elem_ptr v3168v1, __ptr u64, v989v1, !390 + v3173v1 = load v3172v1, !391 v992v1 = const u64 2 - v3174v1 = get_elem_ptr v3168v1, __ptr u64, v992v1, !416 - v3175v1 = load v3174v1, !417 + v3174v1 = get_elem_ptr v3168v1, __ptr u64, v992v1, !392 + v3175v1 = load v3174v1, !393 v997v1 = const u64 32 - v3178v1 = add v3175v1, v997v1, !418 - v3179v1 = cmp gt v3178v1 v3173v1, !419 - cbr v3179v1, encode_allow_alias_22_abi_encode_37_abi_encode_44_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_44_block0(v3171v1, v3173v1), !420 + v3178v1 = add v3175v1, v997v1, !394 + v3179v1 = cmp gt v3178v1 v3173v1, !395 + cbr v3179v1, encode_allow_alias_22_abi_encode_37_abi_encode_44_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_44_block0(v3171v1, v3173v1), !396 encode_allow_alias_22_abi_encode_37_abi_encode_43_block1(): v938v1 = const u64 2 - v3131v1 = mul v3116v1, v938v1, !421 - v3132v1 = add v3131v1, v3126v1, !422 - v3133v1 = asm(new_cap: v3132v1, old_ptr: v3114v1, len: v3118v1) -> __ptr u8 hp, !423 { + v3131v1 = mul v3116v1, v938v1, !397 + v3132v1 = add v3131v1, v3126v1, !398 + v3133v1 = asm(new_cap: v3132v1, old_ptr: v3114v1, len: v3118v1) -> __ptr u8 hp, !399 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_43_block0(v3133v1, v3132v1), !424 + br encode_allow_alias_22_abi_encode_37_abi_encode_43_block0(v3133v1, v3132v1), !400 encode_allow_alias_22_abi_encode_37_abi_encode_44_block0(mut v2797v1: ptr, mut v2798v1: u64): - v3186v1 = get_local __ptr u256, __anon_14, !425 + v3186v1 = get_local __ptr u256, __anon_14, !401 mem_copy_val v3186v1, v3159v1 - v3188v1 = add v2797v1, v3175v1, !426 - v3189v1 = cast_ptr v3188v1 to __ptr u8, !427 - mem_copy_bytes v3189v1, v3186v1, 32, !428 - v3192v1 = get_local __ptr { ptr, u64, u64 }, __anon_23, !429 + v3188v1 = add v2797v1, v3175v1, !402 + v3189v1 = cast_ptr v3188v1 to __ptr u8, !403 + mem_copy_bytes v3189v1, v3186v1, 32, !404 + v3192v1 = get_local __ptr { ptr, u64, u64 }, __anon_23, !405 v1017v1 = const u64 0 - v3193v1 = get_elem_ptr v3192v1, __ptr ptr, v1017v1, !430 - store v2797v1 to v3193v1, !431 + v3193v1 = get_elem_ptr v3192v1, __ptr ptr, v1017v1, !406 + store v2797v1 to v3193v1, !407 v1020v1 = const u64 1 - v3195v1 = get_elem_ptr v3192v1, __ptr u64, v1020v1, !432 - store v2798v1 to v3195v1, !433 + v3195v1 = get_elem_ptr v3192v1, __ptr u64, v1020v1, !408 + store v2798v1 to v3195v1, !409 v1023v1 = const u64 2 - v3197v1 = get_elem_ptr v3192v1, __ptr u64, v1023v1, !434 - store v3178v1 to v3197v1, !435 + v3197v1 = get_elem_ptr v3192v1, __ptr u64, v1023v1, !410 + store v3178v1 to v3197v1, !411 v3879v1 = asm(buffer: v3192v1) -> __ptr { ptr, u64, u64 } buffer { } v3994v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_012 mem_copy_val v3994v1, v3879v1 v1493v1 = const u64 0 - v3200v1 = get_elem_ptr v3163v1, __ptr { ptr, u64, u64 }, v1493v1, !436 + v3200v1 = get_elem_ptr v3163v1, __ptr { ptr, u64, u64 }, v1493v1, !412 mem_copy_val v3200v1, v3994v1 - v3204v1 = get_local __ptr { { ptr, u64, u64 } }, buffer________, !438 + v3204v1 = get_local __ptr { { ptr, u64, u64 } }, buffer________, !414 mem_copy_val v3204v1, v3163v1 - v3209v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !440 + v3209v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !416 mem_copy_val v3209v1, v3204v1 v3724v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg1 mem_copy_val v3724v1, v3209v1 @@ -945,28 +903,25 @@ script { v3824v1 = call as_raw_slice_7(v3724v1, v3823v1) v3742v1 = get_local __ptr slice, __tmp_block_arg mem_copy_val v3742v1, v3823v1 - br encode_allow_alias_22_block2(v3742v1), !74 + v3852v1 = get_local __ptr slice, __log_arg + mem_copy_val v3852v1, v3742v1 + v1059v1 = const u64 4579537983717831593 + log __ptr slice v3852v1, v1059v1 + v1063v1 = const unit () + ret () v1063v1 encode_allow_alias_22_abi_encode_37_abi_encode_44_block1(): v1003v1 = const u64 2 - v3182v1 = mul v3173v1, v1003v1, !441 - v3183v1 = add v3182v1, v997v1, !442 - v3184v1 = asm(new_cap: v3183v1, old_ptr: v3171v1, len: v3175v1) -> __ptr u8 hp, !443 { + v3182v1 = mul v3173v1, v1003v1, !417 + v3183v1 = add v3182v1, v997v1, !418 + v3184v1 = asm(new_cap: v3183v1, old_ptr: v3171v1, len: v3175v1) -> __ptr u8 hp, !419 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_44_block0(v3184v1, v3183v1), !444 - - encode_allow_alias_22_block2(mut v3738v1: __ptr slice): - v3852v1 = get_local __ptr slice, __log_arg - mem_copy_val v3852v1, v3738v1 - v1059v1 = const u64 4579537983717831593 - log __ptr slice v3852v1, v1059v1 - v1063v1 = const unit () - ret () v1063v1 + br encode_allow_alias_22_abi_encode_37_abi_encode_44_block0(v3184v1, v3183v1), !420 } - fn local_log_46(mut item: __ptr { u64 }) -> (), !445 { + fn local_log_46(mut item: __ptr { u64 }) -> (), !421 { local { __ptr { u64 }, u64 } __anon_0 local slice __log_arg local { u64 } item_ @@ -974,14 +929,14 @@ script { entry(item: __ptr { u64 }): v1093v1 = get_local __ptr { u64 }, item_ mem_copy_val v1093v1, item - v3303v1 = get_local __ptr { __ptr { u64 }, u64 }, __anon_0, !446 + v3303v1 = get_local __ptr { __ptr { u64 }, u64 }, __anon_0, !422 v1496v1 = const u64 0 - v3306v1 = get_elem_ptr v3303v1, __ptr __ptr { u64 }, v1496v1, !447 - store v1093v1 to v3306v1, !448 + v3306v1 = get_elem_ptr v3303v1, __ptr __ptr { u64 }, v1496v1, !423 + store v1093v1 to v3306v1, !424 v1499v1 = const u64 1 - v3308v1 = get_elem_ptr v3303v1, __ptr u64, v1499v1, !449 + v3308v1 = get_elem_ptr v3303v1, __ptr u64, v1499v1, !425 v1109v1 = const u64 8 - store v1109v1 to v3308v1, !450 + store v1109v1 to v3308v1, !426 v3313v1 = cast_ptr v3303v1 to __ptr slice, !74 v3881v1 = get_local __ptr slice, __log_arg mem_copy_val v3881v1, v3313v1 @@ -991,7 +946,7 @@ script { ret () v1162v1 } - fn local_log_51(mut item: __ptr { u64, ( { u64 } | () ) }) -> (), !451 { + fn local_log_51(mut item: __ptr { u64, ( { u64 } | () ) }) -> (), !427 { local slice __log_arg local { u64, ( { u64 } | () ) } __matched_value_1 local { { ptr, u64, u64 } } __tmp_block_arg @@ -1004,42 +959,42 @@ script { v3813v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ v3814v1 = call new_6(v3813v1) v1219v1 = const u64 0 - v3551v1 = get_elem_ptr v1170v1, __ptr u64, v1219v1, !453 + v3551v1 = get_elem_ptr v1170v1, __ptr u64, v1219v1, !429 v4065v1 = get_elem_ptr item, __ptr u64, v1219v1 - v3552v1 = load v4065v1, !454 - v1222v1 = const u64 0, !452 - v3557v1 = cmp eq v3552v1 v1222v1, !457 - cbr v3557v1, encode_allow_alias_52_abi_encode_57_block0(), encode_allow_alias_52_abi_encode_57_block1(), !458 + v3552v1 = load v4065v1, !430 + v1222v1 = const u64 0, !428 + v3557v1 = cmp eq v3552v1 v1222v1, !433 + cbr v3557v1, encode_allow_alias_52_abi_encode_57_block0(), encode_allow_alias_52_abi_encode_57_block1(), !434 encode_allow_alias_52_abi_encode_57_block0(): v1225v1 = const u64 1 v1226v1 = const u64 0 - v3577v1 = get_elem_ptr v1170v1, __ptr { u64 }, v1225v1, v1226v1, !459 + v3577v1 = get_elem_ptr v1170v1, __ptr { u64 }, v1225v1, v1226v1, !435 v3797v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__ - v1231v1 = const u64 0, !460 + v1231v1 = const u64 0, !436 v3798v1 = call abi_encode_5(v1231v1, v3813v1, v3797v1) v3836v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg v1130v1 = const u64 0 - v3837v3 = get_elem_ptr v3577v1, __ptr u64, v1130v1, !461 + v3837v3 = get_elem_ptr v3577v1, __ptr u64, v1130v1, !437 v4062v1 = load v3837v3 v4063v1 = call abi_encode_5(v4062v1, v3797v1, v3836v1) - br encode_allow_alias_52_abi_encode_57_block5(v3836v1), !462 + br encode_allow_alias_52_abi_encode_57_block5(v3836v1), !438 encode_allow_alias_52_abi_encode_57_block1(): - v3562v1 = load v3551v1, !463 - v1250v1 = const u64 1, !452 - v3567v1 = cmp eq v3562v1 v1250v1, !466 - cbr v3567v1, encode_allow_alias_52_abi_encode_57_block2(), encode_allow_alias_52_abi_encode_57_block3(), !467 + v3562v1 = load v3551v1, !439 + v1250v1 = const u64 1, !428 + v3567v1 = cmp eq v3562v1 v1250v1, !442 + cbr v3567v1, encode_allow_alias_52_abi_encode_57_block2(), encode_allow_alias_52_abi_encode_57_block3(), !443 encode_allow_alias_52_abi_encode_57_block2(): v3800v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg - v1252v1 = const u64 1, !468 + v1252v1 = const u64 1, !444 v3801v1 = call abi_encode_5(v1252v1, v3813v1, v3800v1) - br encode_allow_alias_52_abi_encode_57_block5(v3800v1), !469 + br encode_allow_alias_52_abi_encode_57_block5(v3800v1), !445 encode_allow_alias_52_abi_encode_57_block3(): - v1256v1 = const u64 14757395258967588866, !470 - revert v1256v1, !471 + v1256v1 = const u64 14757395258967588866, !446 + revert v1256v1, !447 encode_allow_alias_52_abi_encode_57_block5(mut v3766v1: __ptr { { ptr, u64, u64 } }): v3826v1 = get_local __ptr slice, __log_arg @@ -1050,7 +1005,7 @@ script { ret () v1291v1 } - fn local_log_58(mut item: __ptr { }) -> (), !472 { + fn local_log_58(mut item: __ptr { }) -> (), !448 { local slice __log_arg local { { ptr, u64, u64 } } buffer local { { ptr, u64, u64 } } buffer_ @@ -1059,7 +1014,7 @@ script { v3816v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ v3817v1 = call new_6(v3816v1) v3803v1 = get_local __ptr { { ptr, u64, u64 } }, buffer - v1346v1 = const u64 77, !473 + v1346v1 = const u64 77, !449 v3804v1 = call abi_encode_5(v1346v1, v3816v1, v3803v1) v3829v1 = get_local __ptr slice, __log_arg v3830v1 = call as_raw_slice_7(v3803v1, v3829v1) @@ -1231,319 +1186,295 @@ script { !158 = fn_call_path_span !23 6207 6209 !159 = (!157 !158) !160 = (!70 !71 !72) -!161 = span !10 56502 56526 -!162 = fn_call_path_span !10 56502 56519 -!163 = span !10 4237 4259 -!164 = fn_call_path_span !10 4237 4257 -!165 = span !0 148 205 -!166 = fn_call_path_span !0 175 177 -!167 = (!74 !161 !162 !163 !164 !165 !166) -!168 = span !0 148 359 -!169 = (!74 !161 !162 !163 !164 !168) -!170 = span !23 21526 21531 -!171 = (!74 !161 !162 !163 !164 !168) -!172 = span !0 148 389 -!173 = (!74 !161 !162 !163 !164 !172) -!174 = (!74 !161 !162 !163 !164 !172) -!175 = span !0 148 420 -!176 = (!74 !161 !162 !163 !164 !175) -!177 = span !10 5977 5981 -!178 = (!74 !161 !162 !163 !164 !175) -!179 = (!74 !161) -!180 = (!74 !75) -!181 = (!74 !75) -!182 = (!74 !75) -!183 = (!74 !75) -!184 = (!74 !75) -!185 = span !10 56658 56691 -!186 = fn_call_path_span !10 56666 56676 -!187 = (!74 !185 !186) -!188 = (!74 !185 !186) -!189 = span !13 116 122 -!190 = (!74 !185 !186 !189) -!191 = (!74 !185 !186) -!192 = span !0 543 582 -!193 = (!74 !185 !186 !192) -!194 = span !13 128 134 -!195 = (!74 !185 !186 !194) -!196 = span !0 596 621 -!197 = fn_call_path_span !0 603 613 -!198 = (!74 !185 !186 !196 !197) -!199 = span !10 5580 5663 -!200 = (!74 !185 !186 !196 !197 !199) -!201 = (!74 !185 !186 !196 !197 !86) -!202 = (!74 !185 !186 !196 !197) -!203 = (!74 !185 !186 !196 !197) -!204 = (!74 !185 !186 !196 !197) -!205 = (!74 !185 !186 !196 !197) -!206 = (!74 !185 !186 !196 !197) -!207 = (!74 !185 !186 !196 !197) -!208 = (!74 !185 !186 !196 !197) -!209 = (!74 !185 !186 !196 !197) -!210 = (!74 !185 !186 !196 !197) -!211 = (!74 !185 !186 !196 !197) -!212 = (!74 !185 !186 !196 !197) -!213 = (!74 !185 !186 !196 !197) -!214 = (!74 !185 !186 !196 !197) -!215 = (!74 !185 !186 !196 !197) -!216 = (!74 !185 !186 !196 !197) -!217 = (!74 !185 !186 !196 !197) -!218 = (!74 !185 !186 !196 !197) -!219 = (!74 !185 !186 !196 !197) -!220 = (!74 !185 !186 !196 !197) -!221 = (!74 !185 !186 !196 !197) -!222 = (!74 !185 !186 !196 !197) -!223 = (!74 !185 !186 !196 !197) -!224 = (!74 !185 !186 !196 !197) -!225 = (!74 !185 !186 !196 !197 !199) -!226 = span !0 583 622 -!227 = (!74 !185 !186 !226) -!228 = span !13 140 146 -!229 = (!74 !185 !186 !228) -!230 = span !0 636 661 -!231 = fn_call_path_span !0 643 653 -!232 = (!74 !185 !186 !230 !231) -!233 = span !10 5815 5898 -!234 = (!74 !185 !186 !230 !231 !233) -!235 = (!74 !185 !186 !230 !231 !86) -!236 = (!74 !185 !186 !230 !231) -!237 = (!74 !185 !186 !230 !231) -!238 = (!74 !185 !186 !230 !231) -!239 = (!74 !185 !186 !230 !231) -!240 = (!74 !185 !186 !230 !231) -!241 = (!74 !185 !186 !230 !231) -!242 = (!74 !185 !186 !230 !231) -!243 = (!74 !185 !186 !230 !231) -!244 = (!74 !185 !186 !230 !231) -!245 = (!74 !185 !186 !230 !231) -!246 = (!74 !185 !186 !196 !197) -!247 = (!74 !185 !186 !196 !197) -!248 = (!74 !185 !186 !196 !197) -!249 = (!74 !185 !186 !196 !197) -!250 = (!74 !185 !186 !230 !231) -!251 = (!74 !185 !186 !230 !231) -!252 = (!74 !185 !186 !230 !231) -!253 = (!74 !185 !186 !230 !231) -!254 = (!74 !185 !186 !230 !231) -!255 = (!74 !185 !186 !230 !231) -!256 = (!74 !185 !186 !230 !231) -!257 = (!74 !185 !186 !230 !231) -!258 = (!74 !185 !186 !230 !231) -!259 = (!74 !185 !186 !230 !231) -!260 = (!74 !185 !186 !230 !231) -!261 = (!74 !185 !186 !230 !231) -!262 = (!74 !185 !186 !230 !231) -!263 = (!74 !185 !186 !230 !231 !233) -!264 = span !0 623 662 -!265 = (!74 !185 !186 !264) -!266 = span !13 152 157 -!267 = (!74 !185 !186 !266) -!268 = (!74 !185 !186) -!269 = span !0 676 701 -!270 = fn_call_path_span !0 683 693 -!271 = (!74 !185 !186 !269 !270) -!272 = span !10 6048 6131 -!273 = (!74 !185 !186 !269 !270 !272) -!274 = (!74 !185 !186 !269 !270 !86) -!275 = (!74 !185 !186 !269 !270) -!276 = (!74 !185 !186 !269 !270) -!277 = (!74 !185 !186 !269 !270) -!278 = (!74 !185 !186 !269 !270) -!279 = (!74 !185 !186 !269 !270) -!280 = (!74 !185 !186 !269 !270) -!281 = (!74 !185 !186 !269 !270) -!282 = (!74 !185 !186 !269 !270) -!283 = (!74 !185 !186 !269 !270) -!284 = (!74 !185 !186 !269 !270) -!285 = (!74 !185 !186 !230 !231) -!286 = (!74 !185 !186 !230 !231) -!287 = (!74 !185 !186 !230 !231) -!288 = (!74 !185 !186 !230 !231) -!289 = (!74 !185 !186 !269 !270) -!290 = (!74 !185 !186 !269 !270) -!291 = (!74 !185 !186 !269 !270) -!292 = (!74 !185 !186 !269 !270) -!293 = (!74 !185 !186 !269 !270) -!294 = (!74 !185 !186 !269 !270) -!295 = (!74 !185 !186 !269 !270) -!296 = (!74 !185 !186 !269 !270) -!297 = (!74 !185 !186 !269 !270) -!298 = (!74 !185 !186 !269 !270) -!299 = (!74 !185 !186 !269 !270 !272) -!300 = span !0 663 702 -!301 = (!74 !185 !186 !300) -!302 = span !13 163 174 -!303 = (!74 !185 !186 !302) -!304 = span !0 716 741 -!305 = fn_call_path_span !0 723 733 -!306 = (!74 !185 !186 !304 !305) -!307 = (!74 !185 !186 !304 !305) -!308 = (!74 !185 !186 !304 !305 !99) -!309 = (!74 !185 !186 !304 !305) -!310 = span !23 21689 21730 -!311 = (!74 !185 !186 !304 !305 !310) -!312 = span !23 21761 21804 -!313 = (!74 !185 !186 !304 !305 !312) -!314 = (!74 !185 !186 !304 !305 !100) -!315 = (!74 !185 !186 !304 !305 !118) -!316 = (!74 !185 !186 !304 !305) -!317 = span !23 21776 21803 -!318 = fn_call_path_span !23 21785 21786 -!319 = (!74 !185 !186 !304 !305 !317 !318) -!320 = (!74 !185 !186 !304 !305 !312) -!321 = (!74 !185 !186 !304 !305 !312) -!322 = (!74 !185 !186 !304 !305 !312) -!323 = span !23 21743 21805 -!324 = fn_call_path_span !23 21750 21760 -!325 = (!74 !185 !186 !304 !305 !323 !324) -!326 = (!74 !185 !186 !304 !305 !323 !324) -!327 = span !10 575 653 -!328 = (!74 !185 !186 !304 !305 !323 !324 !327) -!329 = (!74 !185 !186 !304 !305 !323 !324 !86) -!330 = (!74 !185 !186 !304 !305 !323 !324) -!331 = (!74 !185 !186 !304 !305 !323 !324) -!332 = (!74 !185 !186 !304 !305 !323 !324) -!333 = (!74 !185 !186 !304 !305 !323 !324) -!334 = (!74 !185 !186 !304 !305 !323 !324) -!335 = (!74 !185 !186 !304 !305 !323 !324) -!336 = (!74 !185 !186 !304 !305 !323 !324) -!337 = (!74 !185 !186 !304 !305 !323 !324) -!338 = (!74 !185 !186 !304 !305 !323 !324) -!339 = (!74 !185 !186 !304 !305 !323 !324) -!340 = (!74 !185 !186 !304 !305 !323 !324) -!341 = (!74 !185 !186 !304 !305 !323 !324) -!342 = (!74 !185 !186 !304 !305 !323 !324) -!343 = (!74 !185 !186 !269 !270) -!344 = (!74 !185 !186 !269 !270) -!345 = (!74 !185 !186 !269 !270) -!346 = (!74 !185 !186 !269 !270) -!347 = (!74 !185 !186 !304 !305 !323 !324) -!348 = (!74 !185 !186 !304 !305 !323 !324) -!349 = (!74 !185 !186 !304 !305 !323 !324) -!350 = (!74 !185 !186 !304 !305 !323 !324) -!351 = (!74 !185 !186 !304 !305 !323 !324) -!352 = (!74 !185 !186 !304 !305 !323 !324) -!353 = (!74 !185 !186 !304 !305 !323 !324) -!354 = (!74 !185 !186 !304 !305 !323 !324) -!355 = (!74 !185 !186 !304 !305 !323 !324) -!356 = (!74 !185 !186 !304 !305 !323 !324) -!357 = (!74 !185 !186 !304 !305 !323 !324) -!358 = (!74 !185 !186 !304 !305 !323 !324 !327) -!359 = span !0 703 742 -!360 = (!74 !185 !186 !359) -!361 = span !13 180 186 -!362 = (!74 !185 !186 !361) -!363 = span !0 756 781 -!364 = fn_call_path_span !0 763 773 -!365 = (!74 !185 !186 !363 !364) -!366 = (!74 !185 !186 !363 !364) -!367 = span !10 6319 6402 -!368 = (!74 !185 !186 !363 !364 !367) -!369 = (!74 !185 !186 !363 !364 !86) -!370 = (!74 !185 !186 !363 !364) -!371 = (!74 !185 !186 !363 !364) -!372 = (!74 !185 !186 !363 !364) -!373 = (!74 !185 !186 !363 !364) -!374 = (!74 !185 !186 !363 !364) -!375 = (!74 !185 !186 !363 !364) -!376 = (!74 !185 !186 !363 !364) -!377 = (!74 !185 !186 !363 !364) -!378 = (!74 !185 !186 !363 !364) -!379 = (!74 !185 !186 !363 !364) -!380 = (!74 !185 !186 !363 !364) -!381 = (!74 !185 !186 !363 !364) -!382 = (!74 !185 !186 !363 !364) -!383 = (!74 !185 !186 !363 !364) -!384 = (!74 !185 !186 !304 !305 !323 !324) -!385 = (!74 !185 !186 !304 !305 !323 !324) -!386 = (!74 !185 !186 !304 !305 !323 !324) -!387 = (!74 !185 !186 !304 !305 !323 !324) -!388 = (!74 !185 !186 !363 !364) -!389 = (!74 !185 !186 !363 !364) -!390 = (!74 !185 !186 !363 !364) -!391 = (!74 !185 !186 !363 !364) -!392 = (!74 !185 !186 !363 !364) -!393 = (!74 !185 !186 !363 !364) -!394 = (!74 !185 !186 !363 !364) -!395 = (!74 !185 !186 !363 !364) -!396 = (!74 !185 !186 !363 !364) -!397 = (!74 !185 !186 !363 !364) -!398 = (!74 !185 !186 !363 !364) -!399 = (!74 !185 !186 !363 !364 !367) -!400 = span !0 743 782 -!401 = (!74 !185 !186 !400) -!402 = span !13 192 199 -!403 = (!74 !185 !186 !402) -!404 = span !0 796 821 -!405 = fn_call_path_span !0 803 813 -!406 = (!74 !185 !186 !404 !405) -!407 = (!74 !185 !186 !404 !405) -!408 = span !10 5111 5194 -!409 = (!74 !185 !186 !404 !405 !408) -!410 = (!74 !185 !186 !404 !405 !86) -!411 = (!74 !185 !186 !404 !405) -!412 = (!74 !185 !186 !404 !405) -!413 = (!74 !185 !186 !404 !405) -!414 = (!74 !185 !186 !404 !405) -!415 = (!74 !185 !186 !404 !405) -!416 = (!74 !185 !186 !404 !405) -!417 = (!74 !185 !186 !404 !405) -!418 = (!74 !185 !186 !404 !405) -!419 = (!74 !185 !186 !404 !405) -!420 = (!74 !185 !186 !404 !405) -!421 = (!74 !185 !186 !363 !364) -!422 = (!74 !185 !186 !363 !364) -!423 = (!74 !185 !186 !363 !364) -!424 = (!74 !185 !186 !363 !364) -!425 = (!74 !185 !186 !404 !405) -!426 = (!74 !185 !186 !404 !405) -!427 = (!74 !185 !186 !404 !405) -!428 = (!74 !185 !186 !404 !405) -!429 = (!74 !185 !186 !404 !405) -!430 = (!74 !185 !186 !404 !405) -!431 = (!74 !185 !186 !404 !405) -!432 = (!74 !185 !186 !404 !405) -!433 = (!74 !185 !186 !404 !405) -!434 = (!74 !185 !186 !404 !405) -!435 = (!74 !185 !186 !404 !405) -!436 = (!74 !185 !186 !404 !405 !408) -!437 = span !0 783 822 -!438 = (!74 !185 !186 !437) -!439 = span !10 56645 56692 -!440 = (!74 !439) -!441 = (!74 !185 !186 !404 !405) -!442 = (!74 !185 !186 !404 !405) -!443 = (!74 !185 !186 !404 !405) -!444 = (!74 !185 !186 !404 !405) -!445 = (!70 !71 !72) -!446 = (!74 !75) -!447 = (!74 !75) -!448 = (!74 !75) -!449 = (!74 !75) -!450 = (!74 !75) -!451 = (!70 !71 !72) -!452 = span !0 410 414 -!453 = (!74 !185 !186 !452) -!454 = (!74 !185 !186) -!455 = span !0 417 612 -!456 = fn_call_path_span !0 417 612 -!457 = (!74 !185 !186 !455 !456) -!458 = (!74 !185 !186 !455) -!459 = (!74 !185 !186) -!460 = span !0 471 475 -!461 = span !13 92 97 -!462 = (!74 !185 !186) -!463 = (!74 !185 !186) -!464 = span !0 614 694 -!465 = fn_call_path_span !0 614 694 -!466 = (!74 !185 !186 !464 !465) -!467 = (!74 !185 !186 !464) -!468 = span !0 648 652 -!469 = (!74 !185 !186) -!470 = span !0 404 698 -!471 = (!74 !185 !186 !470) -!472 = (!70 !71 !72) -!473 = span !13 433 438 +!161 = span !10 56658 56691 +!162 = fn_call_path_span !10 56666 56676 +!163 = (!74 !161 !162) +!164 = (!74 !161 !162) +!165 = span !13 116 122 +!166 = (!74 !161 !162 !165) +!167 = (!74 !161 !162) +!168 = span !0 543 582 +!169 = (!74 !161 !162 !168) +!170 = span !13 128 134 +!171 = (!74 !161 !162 !170) +!172 = span !0 596 621 +!173 = fn_call_path_span !0 603 613 +!174 = (!74 !161 !162 !172 !173) +!175 = span !10 5580 5663 +!176 = (!74 !161 !162 !172 !173 !175) +!177 = (!74 !161 !162 !172 !173 !86) +!178 = (!74 !161 !162 !172 !173) +!179 = (!74 !161 !162 !172 !173) +!180 = (!74 !161 !162 !172 !173) +!181 = (!74 !161 !162 !172 !173) +!182 = (!74 !161 !162 !172 !173) +!183 = (!74 !161 !162 !172 !173) +!184 = (!74 !161 !162 !172 !173) +!185 = (!74 !161 !162 !172 !173) +!186 = (!74 !161 !162 !172 !173) +!187 = (!74 !161 !162 !172 !173) +!188 = (!74 !161 !162 !172 !173) +!189 = (!74 !161 !162 !172 !173) +!190 = (!74 !161 !162 !172 !173) +!191 = (!74 !161 !162 !172 !173) +!192 = (!74 !161 !162 !172 !173) +!193 = (!74 !161 !162 !172 !173) +!194 = (!74 !161 !162 !172 !173) +!195 = (!74 !161 !162 !172 !173) +!196 = (!74 !161 !162 !172 !173) +!197 = (!74 !161 !162 !172 !173) +!198 = (!74 !161 !162 !172 !173) +!199 = (!74 !161 !162 !172 !173) +!200 = (!74 !161 !162 !172 !173) +!201 = (!74 !161 !162 !172 !173 !175) +!202 = span !0 583 622 +!203 = (!74 !161 !162 !202) +!204 = span !13 140 146 +!205 = (!74 !161 !162 !204) +!206 = span !0 636 661 +!207 = fn_call_path_span !0 643 653 +!208 = (!74 !161 !162 !206 !207) +!209 = span !10 5815 5898 +!210 = (!74 !161 !162 !206 !207 !209) +!211 = (!74 !161 !162 !206 !207 !86) +!212 = (!74 !161 !162 !206 !207) +!213 = (!74 !161 !162 !206 !207) +!214 = (!74 !161 !162 !206 !207) +!215 = (!74 !161 !162 !206 !207) +!216 = (!74 !161 !162 !206 !207) +!217 = (!74 !161 !162 !206 !207) +!218 = (!74 !161 !162 !206 !207) +!219 = (!74 !161 !162 !206 !207) +!220 = (!74 !161 !162 !206 !207) +!221 = (!74 !161 !162 !206 !207) +!222 = (!74 !161 !162 !172 !173) +!223 = (!74 !161 !162 !172 !173) +!224 = (!74 !161 !162 !172 !173) +!225 = (!74 !161 !162 !172 !173) +!226 = (!74 !161 !162 !206 !207) +!227 = (!74 !161 !162 !206 !207) +!228 = (!74 !161 !162 !206 !207) +!229 = (!74 !161 !162 !206 !207) +!230 = (!74 !161 !162 !206 !207) +!231 = (!74 !161 !162 !206 !207) +!232 = (!74 !161 !162 !206 !207) +!233 = (!74 !161 !162 !206 !207) +!234 = (!74 !161 !162 !206 !207) +!235 = (!74 !161 !162 !206 !207) +!236 = (!74 !161 !162 !206 !207) +!237 = (!74 !161 !162 !206 !207) +!238 = (!74 !161 !162 !206 !207) +!239 = (!74 !161 !162 !206 !207 !209) +!240 = span !0 623 662 +!241 = (!74 !161 !162 !240) +!242 = span !13 152 157 +!243 = (!74 !161 !162 !242) +!244 = (!74 !161 !162) +!245 = span !0 676 701 +!246 = fn_call_path_span !0 683 693 +!247 = (!74 !161 !162 !245 !246) +!248 = span !10 6048 6131 +!249 = (!74 !161 !162 !245 !246 !248) +!250 = (!74 !161 !162 !245 !246 !86) +!251 = (!74 !161 !162 !245 !246) +!252 = (!74 !161 !162 !245 !246) +!253 = (!74 !161 !162 !245 !246) +!254 = (!74 !161 !162 !245 !246) +!255 = (!74 !161 !162 !245 !246) +!256 = (!74 !161 !162 !245 !246) +!257 = (!74 !161 !162 !245 !246) +!258 = (!74 !161 !162 !245 !246) +!259 = (!74 !161 !162 !245 !246) +!260 = (!74 !161 !162 !245 !246) +!261 = (!74 !161 !162 !206 !207) +!262 = (!74 !161 !162 !206 !207) +!263 = (!74 !161 !162 !206 !207) +!264 = (!74 !161 !162 !206 !207) +!265 = (!74 !161 !162 !245 !246) +!266 = (!74 !161 !162 !245 !246) +!267 = (!74 !161 !162 !245 !246) +!268 = (!74 !161 !162 !245 !246) +!269 = (!74 !161 !162 !245 !246) +!270 = (!74 !161 !162 !245 !246) +!271 = (!74 !161 !162 !245 !246) +!272 = (!74 !161 !162 !245 !246) +!273 = (!74 !161 !162 !245 !246) +!274 = (!74 !161 !162 !245 !246) +!275 = (!74 !161 !162 !245 !246 !248) +!276 = span !0 663 702 +!277 = (!74 !161 !162 !276) +!278 = span !13 163 174 +!279 = (!74 !161 !162 !278) +!280 = span !0 716 741 +!281 = fn_call_path_span !0 723 733 +!282 = (!74 !161 !162 !280 !281) +!283 = (!74 !161 !162 !280 !281) +!284 = (!74 !161 !162 !280 !281 !99) +!285 = (!74 !161 !162 !280 !281) +!286 = span !23 21689 21730 +!287 = (!74 !161 !162 !280 !281 !286) +!288 = span !23 21761 21804 +!289 = (!74 !161 !162 !280 !281 !288) +!290 = (!74 !161 !162 !280 !281 !100) +!291 = (!74 !161 !162 !280 !281 !118) +!292 = (!74 !161 !162 !280 !281) +!293 = span !23 21776 21803 +!294 = fn_call_path_span !23 21785 21786 +!295 = (!74 !161 !162 !280 !281 !293 !294) +!296 = (!74 !161 !162 !280 !281 !288) +!297 = (!74 !161 !162 !280 !281 !288) +!298 = (!74 !161 !162 !280 !281 !288) +!299 = span !23 21743 21805 +!300 = fn_call_path_span !23 21750 21760 +!301 = (!74 !161 !162 !280 !281 !299 !300) +!302 = (!74 !161 !162 !280 !281 !299 !300) +!303 = span !10 575 653 +!304 = (!74 !161 !162 !280 !281 !299 !300 !303) +!305 = (!74 !161 !162 !280 !281 !299 !300 !86) +!306 = (!74 !161 !162 !280 !281 !299 !300) +!307 = (!74 !161 !162 !280 !281 !299 !300) +!308 = (!74 !161 !162 !280 !281 !299 !300) +!309 = (!74 !161 !162 !280 !281 !299 !300) +!310 = (!74 !161 !162 !280 !281 !299 !300) +!311 = (!74 !161 !162 !280 !281 !299 !300) +!312 = (!74 !161 !162 !280 !281 !299 !300) +!313 = (!74 !161 !162 !280 !281 !299 !300) +!314 = (!74 !161 !162 !280 !281 !299 !300) +!315 = (!74 !161 !162 !280 !281 !299 !300) +!316 = (!74 !161 !162 !280 !281 !299 !300) +!317 = (!74 !161 !162 !280 !281 !299 !300) +!318 = (!74 !161 !162 !280 !281 !299 !300) +!319 = (!74 !161 !162 !245 !246) +!320 = (!74 !161 !162 !245 !246) +!321 = (!74 !161 !162 !245 !246) +!322 = (!74 !161 !162 !245 !246) +!323 = (!74 !161 !162 !280 !281 !299 !300) +!324 = (!74 !161 !162 !280 !281 !299 !300) +!325 = (!74 !161 !162 !280 !281 !299 !300) +!326 = (!74 !161 !162 !280 !281 !299 !300) +!327 = (!74 !161 !162 !280 !281 !299 !300) +!328 = (!74 !161 !162 !280 !281 !299 !300) +!329 = (!74 !161 !162 !280 !281 !299 !300) +!330 = (!74 !161 !162 !280 !281 !299 !300) +!331 = (!74 !161 !162 !280 !281 !299 !300) +!332 = (!74 !161 !162 !280 !281 !299 !300) +!333 = (!74 !161 !162 !280 !281 !299 !300) +!334 = (!74 !161 !162 !280 !281 !299 !300 !303) +!335 = span !0 703 742 +!336 = (!74 !161 !162 !335) +!337 = span !13 180 186 +!338 = (!74 !161 !162 !337) +!339 = span !0 756 781 +!340 = fn_call_path_span !0 763 773 +!341 = (!74 !161 !162 !339 !340) +!342 = (!74 !161 !162 !339 !340) +!343 = span !10 6319 6402 +!344 = (!74 !161 !162 !339 !340 !343) +!345 = (!74 !161 !162 !339 !340 !86) +!346 = (!74 !161 !162 !339 !340) +!347 = (!74 !161 !162 !339 !340) +!348 = (!74 !161 !162 !339 !340) +!349 = (!74 !161 !162 !339 !340) +!350 = (!74 !161 !162 !339 !340) +!351 = (!74 !161 !162 !339 !340) +!352 = (!74 !161 !162 !339 !340) +!353 = (!74 !161 !162 !339 !340) +!354 = (!74 !161 !162 !339 !340) +!355 = (!74 !161 !162 !339 !340) +!356 = (!74 !161 !162 !339 !340) +!357 = (!74 !161 !162 !339 !340) +!358 = (!74 !161 !162 !339 !340) +!359 = (!74 !161 !162 !339 !340) +!360 = (!74 !161 !162 !280 !281 !299 !300) +!361 = (!74 !161 !162 !280 !281 !299 !300) +!362 = (!74 !161 !162 !280 !281 !299 !300) +!363 = (!74 !161 !162 !280 !281 !299 !300) +!364 = (!74 !161 !162 !339 !340) +!365 = (!74 !161 !162 !339 !340) +!366 = (!74 !161 !162 !339 !340) +!367 = (!74 !161 !162 !339 !340) +!368 = (!74 !161 !162 !339 !340) +!369 = (!74 !161 !162 !339 !340) +!370 = (!74 !161 !162 !339 !340) +!371 = (!74 !161 !162 !339 !340) +!372 = (!74 !161 !162 !339 !340) +!373 = (!74 !161 !162 !339 !340) +!374 = (!74 !161 !162 !339 !340) +!375 = (!74 !161 !162 !339 !340 !343) +!376 = span !0 743 782 +!377 = (!74 !161 !162 !376) +!378 = span !13 192 199 +!379 = (!74 !161 !162 !378) +!380 = span !0 796 821 +!381 = fn_call_path_span !0 803 813 +!382 = (!74 !161 !162 !380 !381) +!383 = (!74 !161 !162 !380 !381) +!384 = span !10 5111 5194 +!385 = (!74 !161 !162 !380 !381 !384) +!386 = (!74 !161 !162 !380 !381 !86) +!387 = (!74 !161 !162 !380 !381) +!388 = (!74 !161 !162 !380 !381) +!389 = (!74 !161 !162 !380 !381) +!390 = (!74 !161 !162 !380 !381) +!391 = (!74 !161 !162 !380 !381) +!392 = (!74 !161 !162 !380 !381) +!393 = (!74 !161 !162 !380 !381) +!394 = (!74 !161 !162 !380 !381) +!395 = (!74 !161 !162 !380 !381) +!396 = (!74 !161 !162 !380 !381) +!397 = (!74 !161 !162 !339 !340) +!398 = (!74 !161 !162 !339 !340) +!399 = (!74 !161 !162 !339 !340) +!400 = (!74 !161 !162 !339 !340) +!401 = (!74 !161 !162 !380 !381) +!402 = (!74 !161 !162 !380 !381) +!403 = (!74 !161 !162 !380 !381) +!404 = (!74 !161 !162 !380 !381) +!405 = (!74 !161 !162 !380 !381) +!406 = (!74 !161 !162 !380 !381) +!407 = (!74 !161 !162 !380 !381) +!408 = (!74 !161 !162 !380 !381) +!409 = (!74 !161 !162 !380 !381) +!410 = (!74 !161 !162 !380 !381) +!411 = (!74 !161 !162 !380 !381) +!412 = (!74 !161 !162 !380 !381 !384) +!413 = span !0 783 822 +!414 = (!74 !161 !162 !413) +!415 = span !10 56645 56692 +!416 = (!74 !415) +!417 = (!74 !161 !162 !380 !381) +!418 = (!74 !161 !162 !380 !381) +!419 = (!74 !161 !162 !380 !381) +!420 = (!74 !161 !162 !380 !381) +!421 = (!70 !71 !72) +!422 = (!74 !75) +!423 = (!74 !75) +!424 = (!74 !75) +!425 = (!74 !75) +!426 = (!74 !75) +!427 = (!70 !71 !72) +!428 = span !0 410 414 +!429 = (!74 !161 !162 !428) +!430 = (!74 !161 !162) +!431 = span !0 417 612 +!432 = fn_call_path_span !0 417 612 +!433 = (!74 !161 !162 !431 !432) +!434 = (!74 !161 !162 !431) +!435 = (!74 !161 !162) +!436 = span !0 471 475 +!437 = span !13 92 97 +!438 = (!74 !161 !162) +!439 = (!74 !161 !162) +!440 = span !0 614 694 +!441 = fn_call_path_span !0 614 694 +!442 = (!74 !161 !162 !440 !441) +!443 = (!74 !161 !162 !440) +!444 = span !0 648 652 +!445 = (!74 !161 !162) +!446 = span !0 404 698 +!447 = (!74 !161 !162 !446) +!448 = (!70 !71 !72) +!449 = span !13 433 438 warning --> test/src/e2e_vm_tests/test_programs/should_pass/language/logging/src/main.sw:27:5 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/stdout.snap index 85e9ff170da..d28bedc0691 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/stdout.snap @@ -7,7 +7,7 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert) Compiling script match_expressions_all (test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all) - Finished debug [unoptimized + fuel] target(s) [2.84 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [2.776 KB] in ??? > forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all --ir final --asm final --release | filter-fn match_expressions_all return_match_on_str_slice @@ -21,70 +21,70 @@ fn return_match_on_str_slice_8(mut param: __ptr slice) -> u64 { local slice __matched_value_1 entry(mut param: __ptr slice): - v263v1 = get_local __ptr slice, __matched_value_1 - mem_copy_val v263v1, param - v265v1 = get_global __ptr string<5>, __const_global - v266v1 = cast_ptr v265v1 to ptr - v267v1 = get_local __ptr { ptr, u64 }, __anon_0 - v268v1 = const u64 0 - v269v1 = get_elem_ptr v267v1, __ptr ptr, v268v1 - store v266v1 to v269v1 - v271v1 = const u64 1 - v272v1 = get_elem_ptr v267v1, __ptr u64, v271v1 - v273v1 = const u64 5 - store v273v1 to v272v1 - v275v1 = get_local __ptr slice, __anon_1 - mem_copy_bytes v275v1, v267v1, 16 - v277v1 = call eq_9(param, v275v1) - v278v1 = const u64 1 - cbr v277v1, block8(v278v1), block1() + v257v1 = get_local __ptr slice, __matched_value_1 + mem_copy_val v257v1, param + v259v1 = get_global __ptr string<5>, __const_global + v260v1 = cast_ptr v259v1 to ptr + v261v1 = get_local __ptr { ptr, u64 }, __anon_0 + v262v1 = const u64 0 + v263v1 = get_elem_ptr v261v1, __ptr ptr, v262v1 + store v260v1 to v263v1 + v265v1 = const u64 1 + v266v1 = get_elem_ptr v261v1, __ptr u64, v265v1 + v267v1 = const u64 5 + store v267v1 to v266v1 + v269v1 = get_local __ptr slice, __anon_1 + mem_copy_bytes v269v1, v261v1, 16 + v271v1 = call eq_9(param, v269v1) + v272v1 = const u64 1 + cbr v271v1, block8(v272v1), block1() block1(): - v280v1 = get_global __ptr string<7>, __const_global0 - v281v1 = cast_ptr v280v1 to ptr - v282v1 = get_local __ptr { ptr, u64 }, __anon_2 - v283v1 = const u64 0 - v284v1 = get_elem_ptr v282v1, __ptr ptr, v283v1 - store v281v1 to v284v1 - v286v1 = const u64 1 - v287v1 = get_elem_ptr v282v1, __ptr u64, v286v1 - v288v1 = const u64 7 - store v288v1 to v287v1 - v290v1 = get_local __ptr slice, __anon_3 - mem_copy_bytes v290v1, v282v1, 16 - v292v1 = call eq_9(v263v1, v290v1) - v293v1 = const u64 2 - cbr v292v1, block7(v293v1), block3() + v274v1 = get_global __ptr string<7>, __const_global0 + v275v1 = cast_ptr v274v1 to ptr + v276v1 = get_local __ptr { ptr, u64 }, __anon_2 + v277v1 = const u64 0 + v278v1 = get_elem_ptr v276v1, __ptr ptr, v277v1 + store v275v1 to v278v1 + v280v1 = const u64 1 + v281v1 = get_elem_ptr v276v1, __ptr u64, v280v1 + v282v1 = const u64 7 + store v282v1 to v281v1 + v284v1 = get_local __ptr slice, __anon_3 + mem_copy_bytes v284v1, v276v1, 16 + v286v1 = call eq_9(v257v1, v284v1) + v287v1 = const u64 2 + cbr v286v1, block7(v287v1), block3() block3(): - v295v1 = get_global __ptr string<5>, __const_global1 - v296v1 = cast_ptr v295v1 to ptr - v297v1 = get_local __ptr { ptr, u64 }, __anon_4 - v298v1 = const u64 0 - v299v1 = get_elem_ptr v297v1, __ptr ptr, v298v1 - store v296v1 to v299v1 - v301v1 = const u64 1 - v302v1 = get_elem_ptr v297v1, __ptr u64, v301v1 - v303v1 = const u64 5 - store v303v1 to v302v1 - v305v1 = get_local __ptr slice, __anon_5 - mem_copy_bytes v305v1, v297v1, 16 - v307v1 = call eq_9(v263v1, v305v1) - v308v1 = const u64 3 - cbr v307v1, block6(v308v1), block5() + v289v1 = get_global __ptr string<5>, __const_global1 + v290v1 = cast_ptr v289v1 to ptr + v291v1 = get_local __ptr { ptr, u64 }, __anon_4 + v292v1 = const u64 0 + v293v1 = get_elem_ptr v291v1, __ptr ptr, v292v1 + store v290v1 to v293v1 + v295v1 = const u64 1 + v296v1 = get_elem_ptr v291v1, __ptr u64, v295v1 + v297v1 = const u64 5 + store v297v1 to v296v1 + v299v1 = get_local __ptr slice, __anon_5 + mem_copy_bytes v299v1, v291v1, 16 + v301v1 = call eq_9(v257v1, v299v1) + v302v1 = const u64 3 + cbr v301v1, block6(v302v1), block5() block5(): - v310v1 = const u64 1000 - br block6(v310v1) + v304v1 = const u64 1000 + br block6(v304v1) - block6(mut v260v1: u64): - br block7(v260v1) + block6(mut v254v1: u64): + br block7(v254v1) - block7(mut v261v1: u64): - br block8(v261v1) + block7(mut v255v1: u64): + br block8(v255v1) - block8(mut v262v1: u64): - ret u64 v262v1 + block8(mut v256v1: u64): + ret u64 v256v1 } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap index 6b09427aacc..894475d9695 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap @@ -18,7 +18,7 @@ warning: Error message is empty ____ Compiled script "panic_handling_in_unit_tests" with 1 warning. - Finished debug [unoptimized + fuel] target(s) [7.936 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [7.928 KB] in ??? Running 2 tests, filtered 18 tests tested -- panic_handling_in_unit_tests @@ -31,7 +31,7 @@ tested -- panic_handling_in_unit_tests AsciiString { data: "This is a log from the passing test." }, log rb: 10098701174489624218 42, log rb: 1515152261580153489 raw logs: -[{"LogData":{"data":"0000000000000024546869732069732061206c6f672066726f6d207468652070617373696e6720746573742e","digest":"29d742ad9093cdf81404ff756467a44448729b85ab3c0d65197829fb61d2dd29","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":44,"pc":10832,"ptr":67107840,"ra":0,"rb":10098701174489624218}},{"LogData":{"data":"000000000000002a","digest":"a6bb133cb1e3638ad7b8a3ff0539668e9e56f9b850ef1b2a810f5422eaa6c323","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":15456,"ptr":19056,"ra":0,"rb":1515152261580153489}}] +[{"LogData":{"data":"0000000000000024546869732069732061206c6f672066726f6d207468652070617373696e6720746573742e","digest":"29d742ad9093cdf81404ff756467a44448729b85ab3c0d65197829fb61d2dd29","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":44,"pc":10832,"ptr":67107840,"ra":0,"rb":10098701174489624218}},{"LogData":{"data":"000000000000002a","digest":"a6bb133cb1e3638ad7b8a3ff0539668e9e56f9b850ef1b2a810f5422eaa6c323","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":15456,"ptr":19048,"ra":0,"rb":1515152261580153489}}] test passing_no_dbgs_or_logs ... ok (???, 69 gas) test result: OK. 2 passed; 0 failed; finished in ??? @@ -55,7 +55,7 @@ warning: Error message is empty ____ Compiled script "panic_handling_in_unit_tests" with 1 warning. - Finished debug [unoptimized + fuel] target(s) [7.936 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [7.928 KB] in ??? Running 20 tests, filtered 0 tests tested -- panic_handling_in_unit_tests @@ -150,7 +150,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "is": 10368, "len": 8, "pc": 15456, - "ptr": 19008, + "ptr": 19000, "ra": 0, "rb": 1515152261580153489 } @@ -163,7 +163,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "is": 10368, "len": 8, "pc": 15456, - "ptr": 19008, + "ptr": 19000, "ra": 0, "rb": 1515152261580153489 } @@ -203,7 +203,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "is": 10368, "len": 8, "pc": 15456, - "ptr": 19000, + "ptr": 18992, "ra": 0, "rb": 1515152261580153489 } @@ -216,7 +216,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "is": 10368, "len": 8, "pc": 15456, - "ptr": 19000, + "ptr": 18992, "ra": 0, "rb": 1515152261580153489 } @@ -287,7 +287,7 @@ B(true), log rb: 8516346929033386016 "is": 10368, "len": 0, "pc": 13264, - "ptr": 18560, + "ptr": 18552, "ra": 0, "rb": 3330666440490685604 } @@ -312,7 +312,7 @@ B(true), log rb: 8516346929033386016 "is": 10368, "len": 0, "pc": 13316, - "ptr": 18560, + "ptr": 18552, "ra": 0, "rb": 3330666440490685604 } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap index ab92f855202..fbd0bce3b56 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap @@ -142,17 +142,17 @@ output: Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling library panicking_lib (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib) Compiling contract panicking_contract (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract) - Finished release [optimized + fuel] target(s) [5.744 KB] in ??? + Finished release [optimized + fuel] target(s) [5.736 KB] in ??? Running 12 tests, filtered 0 tests tested -- panicking_contract - test test_panicking_in_contract_self_impl ... ok (???, 1087 gas) + test test_panicking_in_contract_self_impl ... ok (???, 1086 gas) revert code: 8280000000000000 ├─ panic message: panicking in contract self impl └─ panicked: in ::panicking_in_contract_self_impl └─ at panicking_contract@1.2.3, src/main.sw:22:9 - test test_directly_panicking_method ... ok (???, 1835 gas) + test test_directly_panicking_method ... ok (???, 1834 gas) revert code: 8200000000000000 ├─ panic message: Error C. ├─ panic value: C(true) @@ -160,7 +160,7 @@ tested -- panicking_contract └─ at panicking_contract@1.2.3, src/main.sw:28:9 decoded log values: C(true), log rb: 5503570629422409978 - test test_nested_panic_inlined ... ok (???, 2258 gas) + test test_nested_panic_inlined ... ok (???, 2257 gas) revert code: 8000000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -168,7 +168,7 @@ C(true), log rb: 5503570629422409978 └─ at panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_nested_panic_inlined_same_revert_code ... ok (???, 2258 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 2257 gas) revert code: 8000000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -176,7 +176,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_nested_panic_non_inlined ... ok (???, 2287 gas) + test test_nested_panic_non_inlined ... ok (???, 2286 gas) revert code: 8180000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -184,7 +184,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_nested_panic_non_inlined_same_revert_code ... ok (???, 2287 gas) + test test_nested_panic_non_inlined_same_revert_code ... ok (???, 2286 gas) revert code: 8180000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -192,35 +192,35 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_generic_panic_with_unit ... ok (???, 1543 gas) + test test_generic_panic_with_unit ... ok (???, 1542 gas) revert code: 8100000000000000 ├─ panic value: () └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 1543 gas) + test test_generic_panic_with_unit_same_revert_code ... ok (???, 1542 gas) revert code: 8100000000000000 ├─ panic value: () └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 1741 gas) + test test_generic_panic_with_str ... ok (???, 1722 gas) revert code: 8080000000000000 ├─ panic message: generic panic with string └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1784 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1765 gas) revert code: 8080000000000000 ├─ panic message: generic panic with different string └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum ... ok (???, 1769 gas) + test test_generic_panic_with_error_type_enum ... ok (???, 1768 gas) revert code: 8300000000000000 ├─ panic message: Error A. ├─ panic value: A @@ -228,7 +228,7 @@ AsciiString { data: "generic panic with different string" }, log rb: 10098701174 └─ at panicking_lib, src/lib.sw:74:5 decoded log values: A, log rb: 5503570629422409978 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 1861 gas) + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 1860 gas) revert code: 8300000000000000 ├─ panic message: Error B. ├─ panic value: B(42) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap index b2dfbed7317..eafff682bcf 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap @@ -182,12 +182,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling library panicking_lib (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib) - Finished release [optimized + fuel] target(s) [3.904 KB] in ??? + Finished release [optimized + fuel] target(s) [3.976 KB] in ??? Running 18 tests, filtered 0 tests tested -- panicking_lib - test test_nested_panic_inlined ... ok (???, 1271 gas) + test test_nested_panic_inlined ... ok (???, 1246 gas) revert code: 8000000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -195,7 +195,7 @@ tested -- panicking_lib └─ at panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 2721958641300806892 - test test_nested_panic_inlined_same_revert_code ... ok (???, 1271 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 1246 gas) revert code: 8000000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -203,7 +203,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 2721958641300806892 - test test_nested_panic_non_inlined ... ok (???, 1289 gas) + test test_nested_panic_non_inlined ... ok (???, 1266 gas) revert code: 8080000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -211,7 +211,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 2721958641300806892 - test test_nested_panic_non_inlined_same_revert_code ... ok (???, 1289 gas) + test test_nested_panic_non_inlined_same_revert_code ... ok (???, 1266 gas) revert code: 8080000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -233,21 +233,21 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 737 gas) + test test_generic_panic_with_str ... ok (???, 719 gas) revert code: 8180000000000000 ├─ panic message: generic panic with string └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 738 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 720 gas) revert code: 8180000000000000 ├─ panic message: generic panic different string └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum_variant ... ok (???, 750 gas) + test test_generic_panic_with_error_type_enum_variant ... ok (???, 725 gas) revert code: 8200000000000000 ├─ panic message: Error A. ├─ panic value: A @@ -255,7 +255,7 @@ AsciiString { data: "generic panic different string" }, log rb: 1009870117448962 └─ at panicking_lib, src/lib.sw:74:5 decoded log values: A, log rb: 2721958641300806892 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 750 gas) + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 725 gas) revert code: 8200000000000000 ├─ panic message: Error A. ├─ panic value: A @@ -282,7 +282,7 @@ A, log rb: 2721958641300806892 ├─ panic message: panic with string └─ panicked: in panicking_lib::test_panic_with_str └─ at panicking_lib, src/lib.sw:123:5 - test test_panic_with_error_type_enum ... ok (???, 855 gas) + test test_panic_with_error_type_enum ... ok (???, 830 gas) revert code: 8400000000000000 ├─ panic message: Error C. ├─ panic value: C(true) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap index 9b72c34f6bf..c9d6515bbef 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap @@ -196,14 +196,14 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 737 gas) + test test_generic_panic_with_str ... ok (???, 719 gas) revert code: 8200000000000000 ├─ panic message: generic panic with string └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 740 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 722 gas) revert code: 8200000000000000 ├─ panic message: generic panic with different string └─ panicked: in panicking_lib::generic_panic diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/snapshot.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/snapshot.toml new file mode 100644 index 00000000000..3b0b031d731 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/snapshot.toml @@ -0,0 +1,3 @@ +cmds = [ + "forc build --path {root} --ir final --asm final | filter-fn {name} call_too_big_to_be_inlined_three_times" +] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/src/main.sw index adb7cf187ae..2f27b457b94 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/src/main.sw @@ -1,12 +1,18 @@ script; -fn main() -> bool { +#[inline(never)] +fn simple_while() { let mut counter = 0; // test standard while loop: while counter < 10 { counter = counter + 1; } assert(counter == 10); +} + +fn main() -> bool { + simple_while(); + call_too_big_to_be_inlined_three_times(); // test early exit from loop with manual "break" (by invalidating the condition): let mut counter_2 = 0; @@ -41,3 +47,21 @@ fn main() -> bool { true } + +fn too_big_to_be_inlined() { + assert(1 == 1); + assert(1 == 1); +} + +// The call inside the loop will be inlined. +#[inline(never)] +fn call_too_big_to_be_inlined_three_times() { + too_big_to_be_inlined(); + too_big_to_be_inlined(); + + let mut counter = 0; + while counter < 10 { + counter = counter + 1; + too_big_to_be_inlined(); + } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/stdout.snap new file mode 100644 index 00000000000..5605c258de5 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops/stdout.snap @@ -0,0 +1,77 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/while_loops --ir final --asm final | filter-fn while_loops call_too_big_to_be_inlined_three_times + +fn call_too_big_to_be_inlined_three_times_8() -> () { + local mut u64 counter + local u64 other_ + local u64 other_0 + + entry(): + v221v1 = call too_big_to_be_inlined_9() + v222v1 = call too_big_to_be_inlined_9() + v223v1 = get_local __ptr u64, counter + v224v1 = const u64 0 + store v224v1 to v223v1 + br while() + + while(): + v227v1 = get_local __ptr u64, counter + v228v1 = get_local __ptr u64, other_ + v229v1 = const u64 10 + store v229v1 to v228v1 + v231v1 = load v227v1 + v232v1 = get_local __ptr u64, other_ + v233v1 = load v232v1 + v234v1 = cmp lt v231v1 v233v1 + cbr v234v1, while_body(), end_while() + + while_body(): + v236v1 = get_local __ptr u64, counter + v237v1 = get_local __ptr u64, other_0 + v238v1 = const u64 1 + store v238v1 to v237v1 + v240v1 = load v236v1 + v241v1 = get_local __ptr u64, other_0 + v242v1 = load v241v1 + v243v1 = add v240v1, v242v1 + v244v1 = get_local __ptr u64, counter + store v243v1 to v244v1 + v246v1 = call too_big_to_be_inlined_9() + br while() + + end_while(): + v248v1 = const unit () + ret () v248v1 +} + + + + + +pshh i531456 ; [fn init: call_too_big_to_be_inlined_three_times_8]: push used high registers 40..64 +move $$locbase $sp ; [fn init: call_too_big_to_be_inlined_three_times_8]: set locals base register +cfei i24 ; [fn init: call_too_big_to_be_inlined_three_times_8]: allocate: locals 24 byte(s), call args 0 slot(s) +move $r0 $$reta ; [fn init: call_too_big_to_be_inlined_three_times_8]: save return address +jal $$reta $pc i21 ; [call: too_big_to_be_inlined_9]: call function +jal $$reta $pc i20 ; [call: too_big_to_be_inlined_9]: call function +sw $$locbase $zero i0 ; store word +movi $r1 i10 ; initialize constant into register +sw $$locbase $r1 i1 ; store word +lw $r1 $$locbase i0 ; load word +lw $r2 $$locbase i1 ; load word +lt $r1 $r1 $r2 +jnzf $r1 $zero i1 +jmpf $zero i7 +sw $$locbase $one i2 ; store word +lw $r1 $$locbase i0 ; load word +lw $r2 $$locbase i2 ; load word +add $r1 $r1 $r2 +sw $$locbase $r1 i0 ; store word +jal $$reta $pc i6 ; [call: too_big_to_be_inlined_9]: call function +jmpb $zero i12 +cfsi i24 ; [fn end: call_too_big_to_be_inlined_three_times_8] free: locals 24 byte(s), call args 0 slot(s) +move $$reta $r0 ; [fn end: call_too_big_to_be_inlined_three_times_8] restore return address +poph i531456 ; [fn end: call_too_big_to_be_inlined_three_times_8]: restore used high registers 40..64 +jal $zero $$reta i0 ; [fn end: call_too_big_to_be_inlined_three_times_8] return from call diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/optimisations/no_locbase/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/optimisations/no_locbase/stdout.snap index 0dddc56bd78..ddbe4d1b158 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/optimisations/no_locbase/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/optimisations/no_locbase/stdout.snap @@ -11,372 +11,328 @@ pshh i530432 ; [fn init: check_no_locals_no_call_args_spills_24 move $$locbase $sp ; [fn init: check_no_locals_no_call_args_spills_24]: set locals base register cfei i520 ; [fn init: check_no_locals_no_call_args_spills_24]: allocate: locals 0 byte(s), call args 0 slot(s), register spills 520 byte(s) move $r0 $$arg0 ; [fn init: check_no_locals_no_call_args_spills_24]: copy argument 0 (a) -sw $$locbase $r0 i43 ; [spill/refill]: spill +sw $$locbase $r0 i0 ; [spill/refill]: spill move $r0 $$reta ; [fn init: check_no_locals_no_call_args_spills_24]: save return address -sw $$locbase $r0 i44 ; [spill/refill]: spill +sw $$locbase $r0 i1 ; [spill/refill]: spill jal $$reta $pc i448 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i45 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i2 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i443 ; [call: dummy_25]: call function move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i46 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r1 i3 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i438 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i47 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i4 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i433 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i48 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i5 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i428 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i49 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i6 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i423 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i50 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i7 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i418 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i51 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i8 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i413 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i52 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i9 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i408 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i53 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i10 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i403 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i54 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i11 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i398 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i55 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i12 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i393 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i56 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i13 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i388 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i57 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i14 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i383 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i58 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i15 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i378 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i59 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i16 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i373 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i60 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i17 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i368 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i61 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i18 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i363 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i62 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i19 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i358 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i63 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i20 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i353 ; [call: dummy_25]: call function -move $r1 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r1 i64 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +move $r0 $$retv ; [call: dummy_25]: copy returned value +sw $$locbase $r0 i21 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i348 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i0 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i22 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i343 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i1 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i23 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i338 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i2 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i24 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i333 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i3 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i25 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i328 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i4 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i26 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i323 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i5 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i27 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i318 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i6 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i28 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i313 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i7 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i29 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i308 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i8 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i30 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i303 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i9 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i31 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i298 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i10 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i32 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i293 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i11 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i33 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i288 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i12 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i34 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i283 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i13 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i35 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i278 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i14 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i36 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i273 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i15 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i37 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i268 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i16 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i38 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i263 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i17 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i39 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i258 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i18 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i40 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i253 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i19 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i41 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i248 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i20 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i42 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i243 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i21 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i43 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i238 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i22 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i44 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i233 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i23 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i45 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i228 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i24 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i46 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i223 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i25 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i47 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i218 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i26 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i48 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i213 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i27 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i49 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i208 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i28 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i50 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i203 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i29 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i51 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i198 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i30 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i52 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i193 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i31 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i53 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i188 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i32 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i54 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i183 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i33 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i55 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i178 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i34 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i56 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i173 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i35 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i57 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i168 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i36 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i58 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i163 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i37 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i59 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i158 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i38 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i60 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i153 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i39 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i61 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i148 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i40 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i62 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i143 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i41 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i63 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i138 ; [call: dummy_25]: call function move $r0 $$retv ; [call: dummy_25]: copy returned value -sw $$locbase $r0 i42 ; [spill/refill]: spill -lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +sw $$locbase $r0 i64 ; [spill/refill]: spill +lw $r0 $$locbase i0 ; [spill/refill]: refill from spill move $$arg0 $r0 ; [call: dummy_25]: pass argument 0 jal $$reta $pc i133 ; [call: dummy_25]: call function -lw $r0 $$locbase i45 ; [spill/refill]: refill from spill -lw $r1 $$locbase i46 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i47 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i48 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i49 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i50 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i51 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i52 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i53 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i54 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i55 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i56 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i57 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i58 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i59 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i60 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i61 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i62 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i63 ; [spill/refill]: refill from spill -add $r0 $r0 $r1 -lw $r1 $$locbase i64 ; [spill/refill]: refill from spill -add $r1 $r0 $r1 -lw $r0 $$locbase i0 ; [spill/refill]: refill from spill -add $r1 $r1 $r0 -lw $r0 $$locbase i1 ; [spill/refill]: refill from spill -add $r1 $r1 $r0 lw $r0 $$locbase i2 ; [spill/refill]: refill from spill -add $r1 $r1 $r0 -lw $r0 $$locbase i3 ; [spill/refill]: refill from spill -add $r1 $r1 $r0 +lw $r1 $$locbase i3 ; [spill/refill]: refill from spill +add $r1 $r0 $r1 lw $r0 $$locbase i4 ; [spill/refill]: refill from spill add $r1 $r1 $r0 lw $r0 $$locbase i5 ; [spill/refill]: refill from spill @@ -454,11 +410,55 @@ add $r1 $r1 $r0 lw $r0 $$locbase i41 ; [spill/refill]: refill from spill add $r1 $r1 $r0 lw $r0 $$locbase i42 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i43 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i44 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i45 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i46 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i47 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i48 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i49 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i50 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i51 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i52 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i53 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i54 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i55 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i56 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i57 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i58 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i59 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i60 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i61 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i62 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i63 ; [spill/refill]: refill from spill +add $r1 $r1 $r0 +lw $r0 $$locbase i64 ; [spill/refill]: refill from spill add $r0 $r1 $r0 add $r0 $r0 $$retv move $$retv $r0 ; [fn end: check_no_locals_no_call_args_spills_24] set return value cfsi i520 ; [fn end: check_no_locals_no_call_args_spills_24] free: locals 0 byte(s), call args 0 slot(s), register spills 520 byte(s) -lw $r0 $$locbase i44 ; [spill/refill]: refill from spill +lw $r0 $$locbase i1 ; [spill/refill]: refill from spill move $$reta $r0 ; [fn end: check_no_locals_no_call_args_spills_24] restore return address poph i530432 ; [fn end: check_no_locals_no_call_args_spills_24]: restore used high registers 40..64 jal $zero $$reta i0 ; [fn end: check_no_locals_no_call_args_spills_24] return from call diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw index 622defd9b54..62314874d05 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw @@ -35,9 +35,9 @@ fn main() -> u64 { let result = addr.return_element_of_array_of_structs(input); assert(result.id.number == 42); - let result = addr.return_element_of_array_of_strings([ - __to_str_array("111"), - __to_str_array("222"), + let result = addr.return_element_of_array_of_strings([ + __to_str_array("111"), + __to_str_array("222"), __to_str_array("333") ]); assert(sha256("111") == sha256_str_array(result)); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw index f7312e17aa7..595d149275c 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw @@ -4,7 +4,7 @@ use basic_storage_abi::{BasicStorage, Quad}; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x94db39f409a31b9f2ebcadeea44378e419208c20de90f5d8e1e33dc1523754cb; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x71dee471dbd14f3c26f34a14f0038037c3229512be350c5e2b7b9ce3330af07d; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release +const CONTRACT_ID = 0x72268c5dafea4906a600068b1b4cd664ffae5c2e65fc339f11d77ff5a044e0d9; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release fn main() -> u64 { let addr = abi(BasicStorage, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw index 6206007f002..a9d8bf4eaa4 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw @@ -5,7 +5,7 @@ use contract_with_type_aliases_abi::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x0cbeb6efe3104b460be769bdc4ea101ebf16ccc16f2d7b667ec3e1c7f5ce35b5; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x1abfbea4c0185a800d7241e86e8bdb6e80dc6d38aa5c578eaaa18b7e193dc58a; // AUTO-CONTRACT-ID ../../test_contracts/contract_with_type_aliases --release +const CONTRACT_ID = 0xb6ff0951568fbbc8be3e0bf8738c29120f5a9119b8b9eb833e44b3d139f81b10; // AUTO-CONTRACT-ID ../../test_contracts/contract_with_type_aliases --release fn main() { let caller = abi(MyContract, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw index 2e685f3c24f..0e2f16eab09 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw @@ -6,7 +6,7 @@ use std::hash::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x3bc28acd66d327b8c1b9624c1fabfc07e9ffa1b5d71c2832c3bfaaf8f4b805e9; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x4cc2ff36ff34f5c27e4b93ab1ca17ed0ed6f559d535f74f5eb61b29c0476cf2c; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release +const CONTRACT_ID = 0x5382a4b19480548c40ec7b712a569a51067ca0fc31896414fc5d2b2b60c877af; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release fn main() -> bool { let caller = abi(StorageAccess, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec/stdout.snap new file mode 100644 index 00000000000..d1ab953dc25 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec/stdout.snap @@ -0,0 +1,20 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec --logs +exit status: 0 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec + Compiling library std (sway-lib-std) + Compiling script vec (test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec) + Finished debug [unoptimized + fuel] target(s) [155.208 KB] in ??? + Running 2 tests, filtered 0 tests + +tested -- vec + + test test_main ... ok (???, 193385 gas) + test test_zst ... ok (???, 11580 gas) + +test result: OK. 2 passed; 0 failed; finished in ??? + + Finished in ??? diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec_encoding_decoding/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec_encoding_decoding/stdout.snap new file mode 100644 index 00000000000..13df4ed4863 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec_encoding_decoding/stdout.snap @@ -0,0 +1,36 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec_encoding_decoding --release --logs +exit status: 0 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec_encoding_decoding + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) + Compiling script vec_encoding_decoding (test/src/e2e_vm_tests/test_programs/should_pass/stdlib/vec_encoding_decoding) + Finished release [optimized + fuel] target(s) [10.744 KB] in ??? + Running 6 tests, filtered 0 tests + +tested -- vec_encoding_decoding + + test vec_trivial ... ok (???, 2904 gas) + decoded log values: +[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], log rb: 15402277555065905665 + test nested_vec_trivial ... ok (???, 19431 gas) + decoded log values: +[[], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5, 6], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7, 8]], log rb: 7518769745117093018 + test vec_non_trivial ... ok (???, 7028 gas) + decoded log values: +[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], log rb: 1424139416812312134 + test nested_vec_non_trivial ... ok (???, 36229 gas) + decoded log values: +[[], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5, 6], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7, 8]], log rb: 16171443785104013487 + test vec_encode_zst ... ok (???, 2750 gas) + decoded log values: +[(), (), (), (), (), (), (), (), (), ()], log rb: 7172587179247292377 + test nested_vec_zst ... ok (???, 18906 gas) + decoded log values: +[[], [()], [(), ()], [(), (), ()], [(), (), (), ()], [(), (), (), (), ()], [(), (), (), (), (), ()], [(), (), (), (), (), (), ()], [(), (), (), (), (), (), (), ()], [(), (), (), (), (), (), (), (), ()]], log rb: 15095959372321865352 + +test result: OK. 6 passed; 0 failed; finished in ??? + + Finished in ??? diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/stdout.snap index b45d263bb9a..6dec06804f2 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/stdout.snap @@ -11,35 +11,35 @@ pub fn unwrap_84(mut self: __ptr { u64, ( () | b256 ) }, mut __ret_value: __ptr local u64 other_ entry(mut self: __ptr { u64, ( () | b256 ) }, mut __ret_value: __ptr b256): - v7334v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 - mem_copy_val v7334v1, self - v7336v1 = const u64 0 - v7337v1 = get_elem_ptr self, __ptr u64, v7336v1 + v7330v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 + mem_copy_val v7330v1, self + v7332v1 = const u64 0 + v7333v1 = get_elem_ptr self, __ptr u64, v7332v1 + v7334v1 = get_local __ptr u64, other_ + v7335v1 = const u64 1 + store v7335v1 to v7334v1 + v7337v1 = load v7333v1 v7338v1 = get_local __ptr u64, other_ - v7339v1 = const u64 1 - store v7339v1 to v7338v1 - v7341v1 = load v7337v1 - v7342v1 = get_local __ptr u64, other_ - v7343v1 = load v7342v1 - v7344v1 = cmp eq v7341v1 v7343v1 - cbr v7344v1, block0(), block1() + v7339v1 = load v7338v1 + v7340v1 = cmp eq v7337v1 v7339v1 + cbr v7340v1, block0(), block1() block0(): - v7346v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 - v7347v1 = const u64 1 - v7348v1 = const u64 1 - v7349v1 = get_elem_ptr v7346v1, __ptr b256, v7347v1, v7348v1 - mem_copy_val __ret_value, v7349v1 - v7351v1 = const unit () - ret () v7351v1 + v7342v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 + v7343v1 = const u64 1 + v7344v1 = const u64 1 + v7345v1 = get_elem_ptr v7342v1, __ptr b256, v7343v1, v7344v1 + mem_copy_val __ret_value, v7345v1 + v7347v1 = const unit () + ret () v7347v1 block1(): - v7353v1 = get_local __ptr u64, code_ - v7354v1 = const u64 0 - store v7354v1 to v7353v1 - v7356v1 = get_local __ptr u64, code_ - v7357v1 = load v7356v1 - revert v7357v1 + v7349v1 = get_local __ptr u64, code_ + v7350v1 = const u64 0 + store v7350v1 to v7349v1 + v7352v1 = get_local __ptr u64, code_ + v7353v1 = load v7352v1 + revert v7353v1 } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap index b77244df672..dee3bc50d9d 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap @@ -7,44 +7,44 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [19.408 KB] in ??? + Finished release [optimized + fuel] target(s) [19.144 KB] in ??? Running 33 tests, filtered 0 tests tested -- const_of_contract_call - test cost_of_in_bool ... ok (???, 1736 gas) - test cost_of_in_u8 ... ok (???, 1704 gas) - test cost_of_in_u16 ... ok (???, 1779 gas) - test cost_of_in_u32 ... ok (???, 1888 gas) - test cost_of_in_u64 ... ok (???, 1522 gas) - test cost_of_in_u256 ... ok (???, 1603 gas) - test cost_of_in_b256 ... ok (???, 1593 gas) - test cost_of_in_str_0 ... ok (???, 1890 gas) - test cost_of_in_str_1 ... ok (???, 2007 gas) - test cost_of_in_str_8 ... ok (???, 2014 gas) - test cost_of_in_str_16 ... ok (???, 2011 gas) - test cost_of_in_str_32 ... ok (???, 2021 gas) - test cost_of_in_array_0 ... ok (???, 1550 gas) - test cost_of_in_array_1 ... ok (???, 1602 gas) - test cost_of_in_array_8 ... ok (???, 2110 gas) - test cost_of_in_array_16 ... ok (???, 1642 gas) - test cost_of_in_array_32 ... ok (???, 1691 gas) - test cost_of_in_array_64 ... ok (???, 1784 gas) - test cost_of_in_tuple_0 ... ok (???, 1520 gas) - test cost_of_in_tuple_1 ... ok (???, 1637 gas) - test cost_of_in_tuple_2 ... ok (???, 1655 gas) - test cost_of_in_tuple_3 ... ok (???, 1663 gas) - test cost_of_in_tuple_4 ... ok (???, 1650 gas) - test in_struct_u64 ... ok (???, 1625 gas) - test in_struct_u64_u64 ... ok (???, 1650 gas) - test in_struct_u64_u64_u64 ... ok (???, 1666 gas) - test in_enum_u64 ... ok (???, 1621 gas) - test in_enum_u64_u64 ... ok (???, 1623 gas) - test in_enum_u64_u64_u64 ... ok (???, 1636 gas) - test in_vec_trivial ... ok (???, 2669 gas) - test in_vec_not_trivial ... ok (???, 5868 gas) - test order_args_without_trivial_enum ... ok (???, 3049 gas) - test order_args_with_trivial_enum ... ok (???, 3213 gas) + test cost_of_in_bool ... ok (???, 1737 gas) + test cost_of_in_u8 ... ok (???, 1705 gas) + test cost_of_in_u16 ... ok (???, 1777 gas) + test cost_of_in_u32 ... ok (???, 1886 gas) + test cost_of_in_u64 ... ok (???, 1521 gas) + test cost_of_in_u256 ... ok (???, 1604 gas) + test cost_of_in_b256 ... ok (???, 1594 gas) + test cost_of_in_str_0 ... ok (???, 1857 gas) + test cost_of_in_str_1 ... ok (???, 1976 gas) + test cost_of_in_str_8 ... ok (???, 1985 gas) + test cost_of_in_str_16 ... ok (???, 1982 gas) + test cost_of_in_str_32 ... ok (???, 1992 gas) + test cost_of_in_array_0 ... ok (???, 1551 gas) + test cost_of_in_array_1 ... ok (???, 1603 gas) + test cost_of_in_array_8 ... ok (???, 2111 gas) + test cost_of_in_array_16 ... ok (???, 1643 gas) + test cost_of_in_array_32 ... ok (???, 1692 gas) + test cost_of_in_array_64 ... ok (???, 1785 gas) + test cost_of_in_tuple_0 ... ok (???, 1519 gas) + test cost_of_in_tuple_1 ... ok (???, 1623 gas) + test cost_of_in_tuple_2 ... ok (???, 1641 gas) + test cost_of_in_tuple_3 ... ok (???, 1649 gas) + test cost_of_in_tuple_4 ... ok (???, 1652 gas) + test in_struct_u64 ... ok (???, 1611 gas) + test in_struct_u64_u64 ... ok (???, 1637 gas) + test in_struct_u64_u64_u64 ... ok (???, 1652 gas) + test in_enum_u64 ... ok (???, 1618 gas) + test in_enum_u64_u64 ... ok (???, 1621 gas) + test in_enum_u64_u64_u64 ... ok (???, 1633 gas) + test in_vec_trivial ... ok (???, 2626 gas) + test in_vec_not_trivial ... ok (???, 5862 gas) + test order_args_without_trivial_enum ... ok (???, 3021 gas) + test order_args_with_trivial_enum ... ok (???, 3207 gas) test result: OK. 33 passed; 0 failed; finished in ??? @@ -219,12 +219,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [664 B] in ??? + Finished release [optimized + fuel] target(s) [648 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_enum_u64 ... ok (???, 1429 gas) + test in_enum_u64 ... ok (???, 1425 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -239,12 +239,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [704 B] in ??? + Finished release [optimized + fuel] target(s) [688 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_enum_u64_u64 ... ok (???, 1435 gas) + test in_enum_u64_u64 ... ok (???, 1431 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -259,12 +259,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [768 B] in ??? + Finished release [optimized + fuel] target(s) [752 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_enum_u64_u64_u64 ... ok (???, 1436 gas) + test in_enum_u64_u64_u64 ... ok (???, 1432 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -279,12 +279,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.992 KB] in ??? + Finished release [optimized + fuel] target(s) [1.952 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test order_args_without_trivial_enum ... ok (???, 2822 gas) + test order_args_without_trivial_enum ... ok (???, 2792 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -299,12 +299,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.288 KB] in ??? + Finished release [optimized + fuel] target(s) [2.256 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test order_args_with_trivial_enum ... ok (???, 2982 gas) + test order_args_with_trivial_enum ... ok (???, 2975 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -319,12 +319,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.008 KB] in ??? + Finished release [optimized + fuel] target(s) [1 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_0 ... ok (???, 1694 gas) + test isolated_cost_of_in_str_0 ... ok (???, 1695 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -479,12 +479,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [480 B] in ??? + Finished release [optimized + fuel] target(s) [472 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_0 ... ok (???, 1334 gas) + test isolated_cost_of_in_tuple_0 ... ok (???, 1332 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -559,7 +559,7 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [752 B] in ??? + Finished release [optimized + fuel] target(s) [640 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call @@ -639,12 +639,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [504 B] in ??? + Finished release [optimized + fuel] target(s) [496 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u64 ... ok (???, 1356 gas) + test isolated_cost_of_in_u64 ... ok (???, 1354 gas) test result: OK. 1 passed; 0 failed; finished in ??? diff --git a/test/src/in_language_tests/test_programs/raw_ptr/src/raw_ptr.sw b/test/src/in_language_tests/test_programs/raw_ptr/src/raw_ptr.sw index 0207f01196a..cbf3582e244 100644 --- a/test/src/in_language_tests/test_programs/raw_ptr/src/raw_ptr.sw +++ b/test/src/in_language_tests/test_programs/raw_ptr/src/raw_ptr.sw @@ -66,7 +66,7 @@ fn raw_ptr_copy_to_and_read() { } #[test] -fn raw_ptr_write() { +fn test_raw_ptr_write() { // Write values into a buffer. let buf_ptr = alloc::(2); buf_ptr.write(true); @@ -109,4 +109,18 @@ fn raw_ptr_overwrite_after_read() { let read_large_string_2 = buf_ptr.read::(); assert(sha256_str_array(large_string_1) == sha256_str_array(read_large_string_1)); assert(sha256_str_array(large_string_2) == sha256_str_array(read_large_string_2)); + + // calls to raw_ptr_write. + let v = [0u8; 128]; + raw_ptr_write(__addr_of(v), 0u8); + raw_ptr_write(__addr_of(v), 0u16); + raw_ptr_write(__addr_of(v), 0u32); + raw_ptr_write(__addr_of(v), 0u64); + raw_ptr_write(__addr_of(v), TestStruct { boo: false, uwu: 0 }); +} + +// We expect that each monomorphization of raw_ptr::write to be optimal +#[inline(never)] +fn raw_ptr_write(ptr: raw_ptr, value: T) { + ptr.write(value) } diff --git a/test/src/reduced_std_libs.rs b/test/src/reduced_std_libs.rs index be555aafecc..461b352932f 100644 --- a/test/src/reduced_std_libs.rs +++ b/test/src/reduced_std_libs.rs @@ -28,7 +28,8 @@ fn create_reduced_std_libs(std_lib_src_dir: &str, reduced_libs_dir: &str) -> Res let std_lib_src_dir = Path::new(std_lib_src_dir); let reduced_libs_dir = Path::new(reduced_libs_dir); - for reduced_lib_dir in get_reduced_libs(reduced_libs_dir)? { + let reduced_libs = get_reduced_libs(reduced_libs_dir).context("get reduced libs")?; + for reduced_lib_dir in reduced_libs { let reduced_lib_config = reduced_lib_dir.join("reduced_lib.config"); if !reduced_lib_config.exists() { @@ -38,12 +39,13 @@ fn create_reduced_std_libs(std_lib_src_dir: &str, reduced_libs_dir: &str) -> Res )); } - let modules = get_modules_from_config(&reduced_lib_config)?; + let modules = + get_modules_from_config(&reduced_lib_config).context("get modules from config")?; for module in modules { let std_lib_module_path = std_lib_src_dir.join(&module); let reduced_lib_module_path = reduced_lib_dir.join("src").join(&module); - copy_module(&std_lib_module_path, &reduced_lib_module_path)?; + copy_module(&std_lib_module_path, &reduced_lib_module_path).context("copy module")?; } } @@ -53,9 +55,9 @@ fn create_reduced_std_libs(std_lib_src_dir: &str, reduced_libs_dir: &str) -> Res fn get_reduced_libs(reduced_libs_dir: &Path) -> Result> { let mut reduced_libs = Vec::new(); - let entries = fs::read_dir(reduced_libs_dir)?; + let entries = fs::read_dir(reduced_libs_dir).context("reading reduced libs dir")?; for entry in entries.flatten() { - if entry.metadata()?.is_dir() { + if entry.metadata().context("entry metadata failed")?.is_dir() { reduced_libs.push(entry.path()) } } diff --git a/test/update-contract-ids.sh b/test/update-contract-ids.sh index e1f411427d8..c1497ddae6f 100755 --- a/test/update-contract-ids.sh +++ b/test/update-contract-ids.sh @@ -92,21 +92,21 @@ get_new_contract_id() { CONTRACT_ARGS=$(join_by " " ${CONTRACT_ARGS[@]}) if [[ $CONTRACT_ARGS ]]; then - PROJ=$(realpath "$FILE") - REGEX="0x[a-zA-Z0-9]{64}" + PROJ=$(realpath "$FOLDER/..") pushd "$DIR/.." > /dev/null + REGEX="0x[a-zA-Z0-9]{64}" CONTRACT_ID=$(cargo r -p forc --release -- contract-id --path $CONTRACT_ARGS 2> /dev/null | $grep -oP "$REGEX") - popd > /dev/null # if error print error and quit if [ $? -eq 0 ]; then echo "$CONTRACT_ID" else - >&2 echo "cargo r -p forc --release -- contract-id --path $CONTRACT_ARGS" - cargo r -p forc --release -- contract-id --path $CONTRACT_ARGS + cargo r -p forc --release -- build --path $CONTRACT_ARGS exit fi + + popd > /dev/null fi } @@ -148,6 +148,7 @@ update_line() { LINE=${PARTS[1]} CONTRACT_ID="$2" + if [[ $CONTRACT_ID ]]; then SED_EXPR="${LINE}s/0x[a-zA-Z0-9]*/$CONTRACT_ID/g"