diff --git a/sway-ir/src/analysis/memory_utils.rs b/sway-ir/src/analysis/memory_utils.rs index 75a435b0312..d0ed76970e5 100644 --- a/sway-ir/src/analysis/memory_utils.rs +++ b/sway-ir/src/analysis/memory_utils.rs @@ -14,6 +14,167 @@ use crate::{ pub const ESCAPED_SYMBOLS_NAME: &str = "escaped-symbols"; +/// A leaf, non-aggregate, element of a type's GEP shape (see [gep_shape]). +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum LayoutLeaf { + /// A single byte: `bool` or `u8`. + Byte, + /// An 8-byte word: `u16`/`u32`/`u64` or a (typed or untyped) pointer. + /// + /// A pointer and an integer word are deliberately folded into the same leaf kind. + /// We intentionally do not distinguish the two here; doing + /// so would only reject genuinely interchangeable reinterpretations without + /// buying any additional safety. + /// + /// This is part of what lets a `slice` be reinterpreted as `{ ptr, u64 }`. A side + /// effect is that e.g., `{ u64, u64 }` and `slice` are also GEP-equivalent. + /// That is still true and safe for every consumer, which only relies on offsets + /// and sizes lining up, never on a slot being "a pointer" vs. "an integer". + Word, + /// A 32-byte scalar: `b256` or `u256`. + Wide, + /// A string array of the given byte length. + StringArray(u64), +} + +/// The GEP-addressable shape of a type: either a non-aggregate leaf, or +/// an indexable aggregate broken into its ordered children, each tagged with its +/// byte offset relative to the aggregate's base. +/// +/// It preserves the tree structure, so that **a `get_elem_ptr` index +/// chain valid in one type designates the same element in an equivalent type**. +/// +/// This is what [types_are_gep_equivalent] compares. +enum GepShape { + Leaf(LayoutLeaf), + /// Ordered `(offset, child_type)` pairs of an indexable aggregate. + Aggregate(Vec<(u64, Type)>), +} + +/// Returns `ty`'s [GepShape], or `None` for a [Type] whose layout we deliberately +/// refuse to reason about (currently unions and unused integer widths). +/// +/// The offset arithmetic mirrors [Type::get_indexed_offset] and [Type::size]: +/// struct fields are word-aligned, array elements are tightly packed, and a +/// `slice` (fat pointer) is modelled as `{ ptr, u64 }`. +fn gep_shape(context: &Context, ty: Type) -> Option { + // TODO-MEMLAY: Warning! Here we make an assumption about the memory layout of structs and arrays. + // The memory layout of structs and arrays can be changed in the future. + use crate::TypeContent::*; + Some(match ty.get_content(context) { + // Zero-sized types have no indexable children. + Never | Unit => GepShape::Aggregate(vec![]), + Bool | Uint(8) => GepShape::Leaf(LayoutLeaf::Byte), + Uint(16) | Uint(32) | Uint(64) | Pointer | TypedPointer(_) => { + GepShape::Leaf(LayoutLeaf::Word) + } + Uint(256) | B256 => GepShape::Leaf(LayoutLeaf::Wide), + // Any other integer width is unexpected. + Uint(_) => return None, + StringArray(n) => GepShape::Leaf(LayoutLeaf::StringArray(*n)), + // A slice / string slice is a fat pointer, GEP-equivalent to `{ ptr, u64 }`. + Slice | TypedSlice(_) | StringSlice => GepShape::Aggregate(vec![ + (0, Type::get_ptr(context)), + (8, Type::get_uint64(context)), + ]), + Array(elem_ty, count) => { + // Array elements are tightly packed. + let elem_size = elem_ty.size(context).in_bytes(); + GepShape::Aggregate((0..*count).map(|i| (i * elem_size, *elem_ty)).collect()) + } + Struct(fields) => { + // Struct fields are aligned to word boundaries. + let mut offset = 0; + let mut children = Vec::with_capacity(fields.len()); + for field_ty in fields { + children.push((offset, *field_ty)); + offset += field_ty.size(context).in_bytes_aligned(); + } + GepShape::Aggregate(children) + } + // We deliberately do not support unions. + Union(_) => return None, + }) +} + +/// Returns `true` if `a` and `b` are GEP-equivalent: the same chain of +/// `get_elem_ptr` indices is valid in both and lands on the same byte offset on +/// a GEP-equivalent element. Equivalently, they have identical GEP trees down to +/// [LayoutLeaf]s. +/// +/// E.g.: `[u64; 4]` and `[[u64; 2]; 2]` flatten to the same four [LayoutLeaf::Word]s +/// but are not GEP-equivalent, because, e.g, the index `[1]` selects a `u64` in the +/// first and a `[u64; 2]` sub-array in the second. In contrast `[[u64; 2]; 2]` and +/// `{ { u64, u64 }, { u64, u64 } }` are GEP-equivalent. +/// +/// Its primary purpose is to recognize that a `slice` and a `{ ptr, u64 }` struct +/// are interchangeable, so that memory analyses can safely see through a +/// layout-preserving `cast_ptr` between them without ever attributing an index in +/// one type's basis to an incompatible element of the other. +/// +/// The predicate is intentionally conservative: whenever it cannot prove `a` and `b` +/// are GEP-equivalent (e.g., for unions) it returns `false`. +pub fn types_are_gep_equivalent(context: &Context, a: Type, b: Type) -> bool { + // Fast path for the common (and cheap) case of the *same* interned type. + // + // We deliberately use identity equality (`==` on the interned key) here and + // not `Type::eq`: `Type::eq` considers a union equal to any of its + // variants (a type-compatibility notion), which is not what we want here. + if a == b { + return true; + } + + // Differently-sized types can never be GEP-equivalent. + if a.size(context).in_bytes() != b.size(context).in_bytes() { + return false; + } + + match (gep_shape(context, a), gep_shape(context, b)) { + (Some(GepShape::Leaf(la)), Some(GepShape::Leaf(lb))) => la == lb, + (Some(GepShape::Aggregate(ca)), Some(GepShape::Aggregate(cb))) => { + ca.len() == cb.len() + && ca + .iter() + .zip(cb.iter()) + .all(|(&(off_a, ty_a), &(off_b, ty_b))| { + off_a == off_b && types_are_gep_equivalent(context, ty_a, ty_b) + }) + } + // A leaf vs. an aggregate (e.g. `b256` vs. `[u64; 4]`), or an opaque type + // (a union or an unexpected integer width) are not GEP-equivalent. + _ => false, + } +} + +/// Returns `true` if a `cast_ptr` from a value of type `from_ptr_ty` to type +/// `to_ptr_ty` is layout-preserving: both are pointers and their pointee +/// types are GEP-equivalent (see [types_are_gep_equivalent]). +/// +/// When a `cast_ptr` is layout-preserving, any GEP/load/store/memcpy access +/// performed through the cast pointer touches exactly the same bytes, and via +/// the same index chain, the same element that it would through the original +/// pointer, so memory analyses can safely track symbols straight through the +/// cast. For any other cast the function returns `false` and the `cast_ptr` acts +/// as an opaque barrier to memory analysis. +pub fn cast_ptr_preserves_layout(context: &Context, from_ptr_ty: Type, to_ptr_ty: Type) -> bool { + match ( + from_ptr_ty.get_pointee_type(context), + to_ptr_ty.get_pointee_type(context), + ) { + (Some(from), Some(to)) => types_are_gep_equivalent(context, from, to), + _ => false, + } +} + +/// Returns `true` if the `ptr_to_cast` is a pointer whose cast to `to_ty` pointer +/// is layout-preserving (see [cast_ptr_preserves_layout]). +fn is_layout_preserving_cast_ptr(context: &Context, ptr_to_cast: Value, to_ty: Type) -> bool { + match ptr_to_cast.get_type(context) { + Some(from_ty) => cast_ptr_preserves_layout(context, from_ty, to_ty), + None => false, + } +} + pub fn create_escaped_symbols_pass() -> Pass { Pass { name: ESCAPED_SYMBOLS_NAME, @@ -309,16 +470,22 @@ fn get_symbols(context: &Context, val: Value, gep_only: bool) -> ReferredSymbols is_complete, ), ValueDatum::Instruction(Instruction { - op: InstOp::CastPtr(ptr_to_cast, _), + op: InstOp::CastPtr(ptr_to_cast, to_ty), .. - }) if !gep_only => get_symbols_rec( - context, - symbols, - visited, - ptr_to_cast, - gep_only, - is_complete, - ), + }) if !gep_only || is_layout_preserving_cast_ptr(context, ptr_to_cast, to_ty) => { + // For non-GEP tracking we always follow a `cast_ptr`. For GEP-only + // tracking we may follow it too, but only when it is + // layout-preserving: then a GEP through the cast addresses the same + // bytes of the same symbol as a GEP through the original pointer. + get_symbols_rec( + context, + symbols, + visited, + ptr_to_cast, + gep_only, + is_complete, + ) + } ValueDatum::Argument(arg) => { get_argument_symbols(context, symbols, visited, arg, gep_only, is_complete) } @@ -430,7 +597,19 @@ fn compute_escaped_symbols(context: &Context, function: &Function) -> EscapedSym !callee.is_arg_immutable(context, *arg_idx) }) .for_each(|(_, v)| add_from_val(&mut result, v, &mut is_complete)), - InstOp::CastPtr(ptr, _) => add_from_val(&mut result, ptr, &mut is_complete), + InstOp::CastPtr(ptr, to_ty) => { + // A layout-preserving `cast_ptr` (e.g. `slice` <-> `{ ptr, u64 }`) + // merely reinterprets the pointer; it does not, by itself, let the + // pointee escape. The symbols behind `ptr` remain fully trackable + // through the cast (see `get_symbols`), and any genuinely escaping + // later use of the cast result is still caught when that use is + // visited. For any other cast we can no longer reason about the + // accesses performed through it, so we conservatively treat the + // pointee as escaped. + if !is_layout_preserving_cast_ptr(context, *ptr, *to_ty) { + add_from_val(&mut result, ptr, &mut is_complete) + } + } InstOp::Cmp(_, _, _) => (), InstOp::ConditionalBranch { .. } => (), InstOp::ContractCall { params, .. } => { @@ -771,3 +950,259 @@ pub fn pointee_size(context: &Context, ptr_val: Value) -> u64 { .size(context) .in_bytes() } + +#[cfg(test)] +mod tests { + use once_cell::sync::Lazy; + use sway_features::ExperimentalFeatures; + use sway_types::SourceEngine; + + use super::{cast_ptr_preserves_layout, types_are_gep_equivalent}; + use crate::{Backtrace, Context, Type}; + + static SOURCE_ENGINE: Lazy = Lazy::new(SourceEngine::default); + + fn create_context() -> Context<'static> { + Context::new( + &SOURCE_ENGINE, + ExperimentalFeatures::default(), + Backtrace::default(), + ) + } + + #[test] + /// A `slice` is a fat pointer laid out as `{ ptr, u64 }`, so the two are + /// layout-compatible even though they are different types. + fn slice_and_ptr_u64_struct_have_same_layout() { + let mut context = create_context(); + + let ptr = Type::get_ptr(&context); + let u64_ty = Type::get_uint64(&context); + let slice = Type::get_slice(&context); + let ptr_u64 = Type::new_struct(&mut context, vec![ptr, u64_ty]); + + assert!(types_are_gep_equivalent(&context, slice, ptr_u64)); + assert!(types_are_gep_equivalent(&context, ptr_u64, slice)); + // Reflexivity. + assert!(types_are_gep_equivalent(&context, slice, slice)); + } + + #[test] + /// Two words are two words, regardless of whether they are spelled as a + /// struct, a two-element array, or a slice. + fn two_word_aggregates_have_same_layout() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let ptr = Type::get_ptr(&context); + let struct_u64_u64 = Type::new_struct(&mut context, vec![u64_ty, u64_ty]); + let array_u64_2 = Type::new_array(&mut context, u64_ty, 2); + let struct_ptr_u64 = Type::new_struct(&mut context, vec![ptr, u64_ty]); + + assert!(types_are_gep_equivalent( + &context, + struct_u64_u64, + array_u64_2 + )); + assert!(types_are_gep_equivalent( + &context, + struct_u64_u64, + struct_ptr_u64 + )); + } + + #[test] + /// A 32-byte scalar (`b256`) is not layout-compatible with a 32-byte + /// aggregate of four words. + fn scalar_and_aggregate_of_same_size_differ() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let b256 = Type::get_b256(&context); + let array_u64_4 = Type::new_array(&mut context, u64_ty, 4); + let struct_u64_4 = Type::new_struct(&mut context, vec![u64_ty, u64_ty, u64_ty, u64_ty]); + + assert_eq!(b256.size(&context).in_bytes(), 32); + assert_eq!(array_u64_4.size(&context).in_bytes(), 32); + + assert!(!types_are_gep_equivalent(&context, b256, array_u64_4)); + assert!(!types_are_gep_equivalent(&context, b256, struct_u64_4)); + } + + #[test] + /// Differently-sized types are never layout-compatible. + fn different_sizes_differ() { + let mut context = create_context(); + + let ptr = Type::get_ptr(&context); + let u64_ty = Type::get_uint64(&context); + let slice = Type::get_slice(&context); // 16 bytes + let struct_ptr_u64_u64 = Type::new_struct(&mut context, vec![ptr, u64_ty, u64_ty]); // 24 bytes + + assert!(!types_are_gep_equivalent( + &context, + slice, + struct_ptr_u64_u64 + )); + } + + #[test] + /// The word granularity must line up: a struct whose first field is a byte + /// is not compatible with one whose first field is a word, even at equal + /// total size (padding differs). + fn byte_vs_word_layout_differs() { + let mut context = create_context(); + + let u8_ty = Type::get_uint8(&context); + let u64_ty = Type::get_uint64(&context); + // { u8, u64 }: u8 padded to a word, then u64 => [Byte@0, Word@8], 16 bytes. + let struct_u8_u64 = Type::new_struct(&mut context, vec![u8_ty, u64_ty]); + // { u64, u64 }: [Word@0, Word@8], 16 bytes. + let struct_u64_u64 = Type::new_struct(&mut context, vec![u64_ty, u64_ty]); + + assert_eq!(struct_u8_u64.size(&context).in_bytes(), 16); + assert_eq!(struct_u64_u64.size(&context).in_bytes(), 16); + assert!(!types_are_gep_equivalent( + &context, + struct_u8_u64, + struct_u64_u64 + )); + } + + #[test] + /// A union (and an enum, which is `{ tag, union }`) must never be considered + /// layout-compatible with one of its variants, even though `Type::eq` treats + /// them as equal. + fn union_and_variant_differ() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let t1 = Type::new_struct(&mut context, vec![u64_ty]); // { u64 } + let t2 = Type::new_struct(&mut context, vec![u64_ty, u64_ty]); // { u64, u64 } + let variants = Type::new_union(&mut context, vec![u64_ty, t1, t2]); + + // The union is as large as its biggest variant (16 bytes), the small + // variant is 8 bytes: clearly different layouts. + assert!(!types_are_gep_equivalent(&context, variants, u64_ty)); + assert!(!types_are_gep_equivalent(&context, variants, t1)); + // Even against the largest variant, we conservatively refuse (we do + // not reason about union layouts at all). + assert!(!types_are_gep_equivalent(&context, variants, t2)); + + // The exact enum-payload shape from the failing test: `{ u64, }` + // vs. `{ u64, u64 }`. `Type::eq` would call these equal; we must not. + let enum_ty = Type::new_struct(&mut context, vec![u64_ty, variants]); + assert!(enum_ty.eq(&context, &t2)); // sanity: `Type::eq` is permissive here + assert!(!types_are_gep_equivalent(&context, enum_ty, t2)); + } + + #[test] + /// `cast_ptr_preserves_layout` compares the pointee types of two pointer + /// types. + fn cast_ptr_predicate_compares_pointees() { + let mut context = create_context(); + + let ptr = Type::get_ptr(&context); + let u64_ty = Type::get_uint64(&context); + let slice = Type::get_slice(&context); + let ptr_u64 = Type::new_struct(&mut context, vec![ptr, u64_ty]); + let b256 = Type::get_b256(&context); + let array_u64_4 = Type::new_array(&mut context, u64_ty, 4); + + let slice_ptr = Type::new_typed_pointer(&mut context, slice); + let ptr_u64_ptr = Type::new_typed_pointer(&mut context, ptr_u64); + let b256_ptr = Type::new_typed_pointer(&mut context, b256); + let array_ptr = Type::new_typed_pointer(&mut context, array_u64_4); + + // Layout-preserving: `slice*` <-> `{ ptr, u64 }*`. + assert!(cast_ptr_preserves_layout(&context, slice_ptr, ptr_u64_ptr)); + // Not layout-preserving: `b256*` <-> `[u64; 4]*`. + assert!(!cast_ptr_preserves_layout(&context, b256_ptr, array_ptr)); + } + + // GEP-equivalence (structural) tests. + // + // Two pointee types are only interchangeable when they are GEP-equivalent: + // the same chain of GEP indices must be valid in both and must land on the + // same byte offset or same leaf element. + + #[test] + /// `[u64; 4]` and `[[u64; 2]; 2]` flatten to the same four words, but the GEP + /// index chain `[i]` lands on a `u64` in the first and on a `[u64; 2]` sub-array + /// in the second. They are not GEP-equivalent. + fn flat_and_nested_arrays_are_not_gep_equivalent() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let arr4 = Type::new_array(&mut context, u64_ty, 4); // [u64; 4] + let inner = Type::new_array(&mut context, u64_ty, 2); // [u64; 2] + let nested = Type::new_array(&mut context, inner, 2); // [[u64; 2]; 2] + + assert_eq!( + arr4.size(&context).in_bytes(), + nested.size(&context).in_bytes() + ); + assert!(!types_are_gep_equivalent(&context, arr4, nested)); + } + + #[test] + /// `{ u64, u64, u64, u64 }` and `{ { u64, u64 }, { u64, u64 } }` share the same + /// leaves but expose different GEP trees (four flat fields vs. two sub-structs). + fn flat_and_nested_structs_are_not_gep_equivalent() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let flat = Type::new_struct(&mut context, vec![u64_ty, u64_ty, u64_ty, u64_ty]); + let pair = Type::new_struct(&mut context, vec![u64_ty, u64_ty]); + let nested = Type::new_struct(&mut context, vec![pair, pair]); + + assert!(!types_are_gep_equivalent(&context, flat, nested)); + } + + #[test] + /// A flat `[u64; 4]` and a nested `{ { u64, u64 }, { u64, u64 } }`. The chain `[i]` + /// selects a leaf word in the array and a sub-struct in the struct. Not equivalent. + fn flat_array_and_nested_struct_are_not_gep_equivalent() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let arr4 = Type::new_array(&mut context, u64_ty, 4); + let pair = Type::new_struct(&mut context, vec![u64_ty, u64_ty]); + let nested = Type::new_struct(&mut context, vec![pair, pair]); + + assert!(!types_are_gep_equivalent(&context, arr4, nested)); + } + + #[test] + /// `[[u64; 2]; 2]` and `{ { u64, u64 }, { u64, u64 } }` expose the same 2x2 GEP + /// tree at the same offsets: `[i, j]` designates the same word in both. An array + /// node and a struct node of the same shape are GEP-equivalent. + fn nested_array_and_nested_struct_are_gep_equivalent() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let inner_arr = Type::new_array(&mut context, u64_ty, 2); // [u64; 2] + let nested_arr = Type::new_array(&mut context, inner_arr, 2); // [[u64; 2]; 2] + let pair = Type::new_struct(&mut context, vec![u64_ty, u64_ty]); // { u64, u64 } + let nested_struct = Type::new_struct(&mut context, vec![pair, pair]); + + assert!(types_are_gep_equivalent( + &context, + nested_arr, + nested_struct + )); + } + + #[test] + /// A flat `[u64; 4]` and a flat `{ u64, u64, u64, u64 }` both expose four + /// word-sized children at 0/8/16/24, so `[i]` matches. GEP-equivalent. + fn flat_array_and_flat_struct_are_gep_equivalent() { + let mut context = create_context(); + + let u64_ty = Type::get_uint64(&context); + let arr4 = Type::new_array(&mut context, u64_ty, 4); + let flat = Type::new_struct(&mut context, vec![u64_ty, u64_ty, u64_ty, u64_ty]); + + assert!(types_are_gep_equivalent(&context, arr4, flat)); + } +} diff --git a/sway-ir/src/irtype.rs b/sway-ir/src/irtype.rs index 359c4ee0ad4..f970d1db315 100644 --- a/sway-ir/src/irtype.rs +++ b/sway-ir/src/irtype.rs @@ -478,9 +478,21 @@ impl Type { }) } - /// What's the offset, in bytes, of the indexed element? - /// Returns `None` on invalid indices. - /// Panics if `self` is not an aggregate (struct, union, or array). + /// Returns the offset, in bytes, of the indexed element of an aggregate `self`. + /// + /// Returns `None`: + /// - on invalid `indices`. + /// - if `self` is not an aggregate (struct, union, or array). + /// + /// Note that the function accepts both invalid `indices` and `self` not + /// being an aggregate as a valid input. It is up to the caller to decide + /// what to do in case of `None` being returned. + /// E.g.: + /// - SROA internally guarantees that `self` is an aggregate and that + /// `indices` are valid and `expect`s a valid offset. + /// - Memcpyopt can try to index into a `slice` (not an aggregate) as a result of + /// a valid inspection of a `{ ptr, u64 }` the `slice` got `cast_ptr`ed into, + /// and simply bail out if `None` is return (as a semantically valid result). pub fn get_indexed_offset(&self, context: &Context, indices: &[u64]) -> Option { indices .iter() @@ -505,12 +517,7 @@ impl Type { + (union_size_in_bytes - field_ty.size(context).in_bytes()), ) }) - } else { - assert!( - ty.is_array(context), - "Expected aggregate type. Got {}.", - ty.as_string(context) - ); + } else if ty.is_array(context) { // size_of_element * idx will be the offset of idx. ty.get_array_elem_type(context).map(|elm_ty| { let prev_idxs_offset = ty @@ -521,6 +528,8 @@ impl Type { * idx; (elm_ty, accum_offset + prev_idxs_offset) }) + } else { + None } }) .map(|pair| pair.1) diff --git a/sway-ir/src/optimize/memcpyopt.rs b/sway-ir/src/optimize/memcpyopt.rs index 0a99af6f7de..16c8d38a2c8 100644 --- a/sway-ir/src/optimize/memcpyopt.rs +++ b/sway-ir/src/optimize/memcpyopt.rs @@ -457,6 +457,12 @@ fn local_copy_prop( struct ReplGep { base: Symbol, + // When the memcpy's source symbol has a different (but layout-identical) + // type than its destination symbol - i.e. the memcpy copies through a + // layout-preserving `cast_ptr` - we must re-interpret the base symbol as + // the destination's pointee type before indexing into it. This holds the + // pointer type to `cast_ptr` the base to or `None` when no cast is needed. + cast_base_to: Option, elem_ptr_ty: Type, indices: Vec, } @@ -523,7 +529,44 @@ fn local_copy_prop( .get_type(context) .get_pointee_type(context) .unwrap(); - if memcpy_src_sym_type == memcpy_dst_sym_type + + // The memcpy copies the whole destination symbol, iff the + // source symbol has the same layout as the destination. + // If the two symbol types are identical we can index the + // source directly. If they only share a layout (the memcpy + // went through a layout-preserving `cast_ptr`) we index it + // after re-interpreting it as the destination's type. + let same_type = memcpy_src_sym_type == memcpy_dst_sym_type; + let same_layout = same_type + || memory_utils::types_are_gep_equivalent( + context, + memcpy_src_sym_type, + memcpy_dst_sym_type, + ); + + // In the `cast_ptr` crossing case we re-interpret the source as + // `memcpy_dst_sym_type` and index it with `new_indices`. + // + // Those indices were computed against the access pointer, + // whose type can differ from `memcpy_dst_sym_type` when the + // symbol is reached through a layout-preserving cast (e.g. + // via a block argument. + // + // E.g., let's say the original symbol is a slice that gets + // passed as block argument via `cast_ptr` to `{ ptr, u64 }`. + // In this case, the access sees the block parameter as `{ ptr, u64 }` + // while the symbol passed as the block argument stays a + // non-indexable `slice`. + // + // We want to only proceed if the indices are actually valid for the + // `memcpy_dst_sym_type`. + let indices_valid_for_dst = same_type + || memcpy_dst_sym_type + .get_value_indexed_offset(context, &new_indices) + .is_some(); + + if same_layout + && indices_valid_for_dst && memcpy_dst_sym_type.size(context).in_bytes() == copy_len { replacements.insert( @@ -532,6 +575,8 @@ fn local_copy_prop( src_val_ptr, Replacement::NewGep(ReplGep { base: memcpy_src_sym, + cast_base_to: (!same_type) + .then(|| memcpy_dst_sym.get_type(context)), elem_ptr_ty: src_val_ptr.get_type(context).unwrap(), indices: new_indices, }), @@ -770,11 +815,12 @@ fn local_copy_prop( to_replace, Replacement::NewGep(ReplGep { base, + cast_base_to, elem_ptr_ty, indices, }), ) => { - let base = match base { + let mut base = match base { Symbol::Local(local) => { let base = Value::new_instruction( context, @@ -788,6 +834,16 @@ fn local_copy_prop( block_arg.block.get_arg(context, block_arg.idx).unwrap() } }; + // Re-interpret the base as the destination symbol's type + // when the memcpy went through a layout-preserving cast. + if let Some(cast_to) = cast_base_to { + base = Value::new_instruction( + context, + block, + InstOp::CastPtr(base, cast_to), + ); + new_insts.push(base); + } let v = Value::new_instruction( context, block, diff --git a/sway-ir/src/optimize/sroa.rs b/sway-ir/src/optimize/sroa.rs index 840c9aed98b..2d020be36ba 100644 --- a/sway-ir/src/optimize/sroa.rs +++ b/sway-ir/src/optimize/sroa.rs @@ -449,7 +449,7 @@ fn profitability(context: &Context, function: Function, candidates: &mut FxHashS } } -/// Only the following aggregates can be scalarised: +/// Only a following aggregate can be scalarised: /// 1. Does not escape. /// 2. Is always accessed via a scalar (register sized) field. /// i.e., The entire aggregate or a sub-aggregate isn't loaded / stored. diff --git a/sway-ir/tests/memcpyopt_castptr/collapse_through_layout_preserving_cast.ir b/sway-ir/tests/memcpyopt_castptr/collapse_through_layout_preserving_cast.ir new file mode 100644 index 00000000000..725d6223145 --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/collapse_through_layout_preserving_cast.ir @@ -0,0 +1,38 @@ +// A chain of `mem_copy_val`s that alternates between a `{ ptr, u64 }` local and +// a `slice` local (which have an identical memory layout) via `cast_ptr`. +// +// This mirrors the shape produced by usual `raw_slice` handlings. +// +// The expected result is: +// - intermediate copies through the layout-preserving casts must collapse, +// - the final read of the length field must come straight from `b` (through an inserted, layout-preserving cast), +// - the redundant copy into `c` must be gone. + +script { + entry fn main(p: __ptr b256) -> u64 { + local { ptr, u64 } a + local slice b + local { ptr, u64 } c + + entry(p: __ptr b256): + va = get_local __ptr { ptr, u64 }, a + i0 = const u64 0 + pa0 = get_elem_ptr va, __ptr ptr, i0 + pc = cast_ptr p to ptr + store pc to pa0 + i1 = const u64 1 + pa1 = get_elem_ptr va, __ptr u64, i1 + c32 = const u64 32 + store c32 to pa1 + vcast = cast_ptr va to __ptr slice + vb = get_local __ptr slice, b + mem_copy_val vb, vcast + vcast2 = cast_ptr vb to __ptr { ptr, u64 } + vc = get_local __ptr { ptr, u64 }, c + mem_copy_val vc, vcast2 + j1 = const u64 1 + vlen_p = get_elem_ptr vc, __ptr u64, j1 + vlen = load vlen_p + ret u64 vlen + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/collapse_through_layout_preserving_cast.ir.snap b/sway-ir/tests/memcpyopt_castptr/collapse_through_layout_preserving_cast.ir.snap new file mode 100644 index 00000000000..74edbca562d --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/collapse_through_layout_preserving_cast.ir.snap @@ -0,0 +1,37 @@ +--- +source: sway-ir/tests/tests.rs +--- +Modified: true + +script { + entry fn main(p: __ptr b256) -> u64 { + local { ptr, u64 } a + local slice b +- local { ptr, u64 } c + + entry(mut p: __ptr b256): + v2v1 = get_local __ptr { ptr, u64 }, a + v3v1 = const u64 0 + v4v1 = get_elem_ptr v2v1, __ptr ptr, v3v1 + v5v1 = cast_ptr p to ptr + store v5v1 to v4v1 + v7v1 = const u64 1 + v8v1 = get_elem_ptr v2v1, __ptr u64, v7v1 + v9v1 = const u64 32 + store v9v1 to v8v1 + v11v1 = cast_ptr v2v1 to __ptr slice + v12v1 = get_local __ptr slice, b + mem_copy_val v12v1, v11v1 +- v14v1 = cast_ptr v12v1 to __ptr { ptr, u64 } +- v15v1 = get_local __ptr { ptr, u64 }, c +- mem_copy_val v15v1, v14v1 ++ v21v1 = get_local __ptr slice, b ++ v22v1 = cast_ptr v21v1 to __ptr { ptr, u64 } + v17v1 = const u64 1 +- v18v1 = get_elem_ptr v15v1, __ptr u64, v17v1 +- v19v1 = load v18v1 ++ v23v1 = get_elem_ptr v22v1, __ptr u64, v17v1 ++ v19v1 = load v23v1 + ret u64 v19v1 + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_collapse_different_layout_cast.ir b/sway-ir/tests/memcpyopt_castptr/no_collapse_different_layout_cast.ir new file mode 100644 index 00000000000..fba741bad76 --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_collapse_different_layout_cast.ir @@ -0,0 +1,30 @@ +// The `cast_ptr`s here reinterpret between `[u64; 4]` and `b256`. +// +// The optimization must not fire: +// - both `mem_copy_val`s are preserved, +// - the length is still read out of `c`. + +script { + entry fn main() -> u64 { + local [u64; 4] a + local b256 b + local [u64; 4] c + + entry(): + va = get_local __ptr [u64; 4], a + i0 = const u64 0 + e0 = get_elem_ptr va, __ptr u64, i0 + c32 = const u64 32 + store c32 to e0 + vcast = cast_ptr va to __ptr b256 + vb = get_local __ptr b256, b + mem_copy_val vb, vcast + vcast2 = cast_ptr vb to __ptr [u64; 4] + vc = get_local __ptr [u64; 4], c + mem_copy_val vc, vcast2 + j0 = const u64 0 + ep = get_elem_ptr vc, __ptr u64, j0 + vlen = load ep + ret u64 vlen + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_collapse_different_layout_cast.ir.snap b/sway-ir/tests/memcpyopt_castptr/no_collapse_different_layout_cast.ir.snap new file mode 100644 index 00000000000..1a3ab122700 --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_collapse_different_layout_cast.ir.snap @@ -0,0 +1,29 @@ +--- +source: sway-ir/tests/tests.rs +--- +Modified: false + +script { + entry fn main() -> u64 { + local [u64; 4] a + local b256 b + local [u64; 4] c + + entry(): + v1v1 = get_local __ptr [u64; 4], a + v2v1 = const u64 0 + v3v1 = get_elem_ptr v1v1, __ptr u64, v2v1 + v4v1 = const u64 32 + store v4v1 to v3v1 + v6v1 = cast_ptr v1v1 to __ptr b256 + v7v1 = get_local __ptr b256, b + mem_copy_val v7v1, v6v1 + v9v1 = cast_ptr v7v1 to __ptr [u64; 4] + v10v1 = get_local __ptr [u64; 4], c + mem_copy_val v10v1, v9v1 + v12v1 = const u64 0 + v13v1 = get_elem_ptr v10v1, __ptr u64, v12v1 + v14v1 = load v13v1 + ret u64 v14v1 + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_collapse_tree_mismatch_cast.ir b/sway-ir/tests/memcpyopt_castptr/no_collapse_tree_mismatch_cast.ir new file mode 100644 index 00000000000..cb0a2ce2a92 --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_collapse_tree_mismatch_cast.ir @@ -0,0 +1,32 @@ +// The `cast_ptr`s here reinterpret between `[u64; 4]` and `[[u64; 2]; 2]`. +// The two types have the same byte layout four words, +// but they are not GEP-equivalent. +// +// The layout-preserving `cast_ptr` must only be seen through +// when the pointee types are GEP-equivalent, so the optimization must not fire: +// - both `mem_copy_val`s are preserved, +// - the length is still read out of `c`. + +script { + entry fn main() -> u64 { + local [u64; 4] a + local [[u64; 2]; 2] b + local [u64; 4] c + + entry(): + va = get_local __ptr [u64; 4], a + i3 = const u64 3 + pa3 = get_elem_ptr va, __ptr u64, i3 + c40 = const u64 40 + store c40 to pa3 + vcast = cast_ptr va to __ptr [[u64; 2]; 2] + vb = get_local __ptr [[u64; 2]; 2], b + mem_copy_val vb, vcast + vcast2 = cast_ptr vb to __ptr [u64; 4] + vc = get_local __ptr [u64; 4], c + mem_copy_val vc, vcast2 + ep = get_elem_ptr vc, __ptr u64, i3 + vlen = load ep + ret u64 vlen + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_collapse_tree_mismatch_cast.ir.snap b/sway-ir/tests/memcpyopt_castptr/no_collapse_tree_mismatch_cast.ir.snap new file mode 100644 index 00000000000..3dcb44ff0a7 --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_collapse_tree_mismatch_cast.ir.snap @@ -0,0 +1,28 @@ +--- +source: sway-ir/tests/tests.rs +--- +Modified: false + +script { + entry fn main() -> u64 { + local [u64; 4] a + local [[u64; 2]; 2] b + local [u64; 4] c + + entry(): + v1v1 = get_local __ptr [u64; 4], a + v2v1 = const u64 3 + v3v1 = get_elem_ptr v1v1, __ptr u64, v2v1 + v4v1 = const u64 40 + store v4v1 to v3v1 + v6v1 = cast_ptr v1v1 to __ptr [[u64; 2]; 2] + v7v1 = get_local __ptr [[u64; 2]; 2], b + mem_copy_val v7v1, v6v1 + v9v1 = cast_ptr v7v1 to __ptr [u64; 4] + v10v1 = get_local __ptr [u64; 4], c + mem_copy_val v10v1, v9v1 + v12v1 = get_elem_ptr v10v1, __ptr u64, v2v1 + v13v1 = load v12v1 + ret u64 v13v1 + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_collapse_when_escaped_through_asm.ir b/sway-ir/tests/memcpyopt_castptr/no_collapse_when_escaped_through_asm.ir new file mode 100644 index 00000000000..901c1e4c35b --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_collapse_when_escaped_through_asm.ir @@ -0,0 +1,34 @@ +// The casts here are layout-preserving (`{ ptr, u64 }` <-> `slice`), +// but the copied-into pointer `c` also escapes into an `asm` block. Escape +// analysis must still treat `c` as escaped, so the copy propagation must not +// fire and the `mem_copy_val` into `c` is preserved. + +script { + entry fn main() -> u64 { + local { ptr, u64 } a + local slice b + local { ptr, u64 } c + + entry(): + va = get_local __ptr { ptr, u64 }, a + i1 = const u64 1 + pa1 = get_elem_ptr va, __ptr u64, i1 + c32 = const u64 32 + store c32 to pa1 + vcast = cast_ptr va to __ptr slice + vb = get_local __ptr slice, b + mem_copy_val vb, vcast + vcast2 = cast_ptr vb to __ptr { ptr, u64 } + vc = get_local __ptr { ptr, u64 }, c + mem_copy_val vc, vcast2 + i0 = const u64 0 + vptr = get_elem_ptr vc, __ptr ptr, i0 + vesc = asm(ptr: vptr) -> u64 { + lw result ptr i1 + } + jl = const u64 1 + vlen_p = get_elem_ptr vc, __ptr u64, jl + vlen = load vlen_p + ret u64 vlen + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_collapse_when_escaped_through_asm.ir.snap b/sway-ir/tests/memcpyopt_castptr/no_collapse_when_escaped_through_asm.ir.snap new file mode 100644 index 00000000000..73a6253365c --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_collapse_when_escaped_through_asm.ir.snap @@ -0,0 +1,34 @@ +--- +source: sway-ir/tests/tests.rs +--- +Modified: false + +script { + entry fn main() -> u64 { + local { ptr, u64 } a + local slice b + local { ptr, u64 } c + + entry(): + v1v1 = get_local __ptr { ptr, u64 }, a + v2v1 = const u64 1 + v3v1 = get_elem_ptr v1v1, __ptr u64, v2v1 + v4v1 = const u64 32 + store v4v1 to v3v1 + v6v1 = cast_ptr v1v1 to __ptr slice + v7v1 = get_local __ptr slice, b + mem_copy_val v7v1, v6v1 + v9v1 = cast_ptr v7v1 to __ptr { ptr, u64 } + v10v1 = get_local __ptr { ptr, u64 }, c + mem_copy_val v10v1, v9v1 + v12v1 = const u64 0 + v13v1 = get_elem_ptr v10v1, __ptr ptr, v12v1 + v14v1 = asm(ptr: v13v1) -> u64 { + lw result ptr i1 + } + v15v1 = const u64 1 + v16v1 = get_elem_ptr v10v1, __ptr u64, v15v1 + v17v1 = load v16v1 + ret u64 v17v1 + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_panic_cast_through_block_arg.ir b/sway-ir/tests/memcpyopt_castptr/no_panic_cast_through_block_arg.ir new file mode 100644 index 00000000000..a0b5abd429d --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_panic_cast_through_block_arg.ir @@ -0,0 +1,41 @@ +// This test proves that the issue discussed in this review comment is fixed: +// https://github.com/FuelLabs/sway/pull/7688#discussion_r3594711802 +// +// The core of the issue was that `get_gep_referred_symbols` follows a +// layout-preserving `cast_ptr` (`slice` -> `{ ptr, u64 }`), and the cast +// result reaches a `get_elem_ptr` through a block argument (`vp`). +// +// For the block argument, `combine_indices` short-circuits to `Some([])` +// instead of following the cast in the predecessor, so the field index `1` +// (which belongs to the `{ ptr, u64 }` view) ends up +// being resolved against the symbol's original `slice` pointee type. +// +// This is now handled as a valid case and gracefully. The `memcpyopt` pass +// simply does not optimize and runs to completion without panicking. + +script { + entry fn main(p: __ptr b256) -> u64 { + local slice s + local { ptr, u64 } src + + entry(p: __ptr b256): + vs = get_local __ptr slice, s + vc = cast_ptr vs to __ptr { ptr, u64 } + br next(vc) + + next(vp: __ptr { ptr, u64 }): + vsrc = get_local __ptr { ptr, u64 }, src + i0 = const u64 0 + s0 = get_elem_ptr vsrc, __ptr ptr, i0 + pc = cast_ptr p to ptr + store pc to s0 + i1 = const u64 1 + s1 = get_elem_ptr vsrc, __ptr u64, i1 + c32 = const u64 32 + store c32 to s1 + mem_copy_val vp, vsrc + g1 = get_elem_ptr vp, __ptr u64, i1 + vlen = load g1 + ret u64 vlen + } +} diff --git a/sway-ir/tests/memcpyopt_castptr/no_panic_cast_through_block_arg.ir.snap b/sway-ir/tests/memcpyopt_castptr/no_panic_cast_through_block_arg.ir.snap new file mode 100644 index 00000000000..48a00192b46 --- /dev/null +++ b/sway-ir/tests/memcpyopt_castptr/no_panic_cast_through_block_arg.ir.snap @@ -0,0 +1,31 @@ +--- +source: sway-ir/tests/tests.rs +--- +Modified: false + +script { + entry fn main(p: __ptr b256) -> u64 { + local slice s + local { ptr, u64 } src + + entry(mut p: __ptr b256): + v3v1 = get_local __ptr slice, s + v4v1 = cast_ptr v3v1 to __ptr { ptr, u64 } + br next(v4v1) + + next(v2v1: __ptr { ptr, u64 }): + v6v1 = get_local __ptr { ptr, u64 }, src + v7v1 = const u64 0 + v8v1 = get_elem_ptr v6v1, __ptr ptr, v7v1 + v9v1 = cast_ptr p to ptr + store v9v1 to v8v1 + v11v1 = const u64 1 + v12v1 = get_elem_ptr v6v1, __ptr u64, v11v1 + v13v1 = const u64 32 + store v13v1 to v12v1 + mem_copy_val v2v1, v6v1 + v16v1 = get_elem_ptr v2v1, __ptr u64, v11v1 + v17v1 = load v16v1 + ret u64 v17v1 + } +} diff --git a/sway-ir/tests/tests.rs b/sway-ir/tests/tests.rs index 0d0f436e996..8b40c63c9db 100644 --- a/sway-ir/tests/tests.rs +++ b/sway-ir/tests/tests.rs @@ -13,9 +13,9 @@ use sway_ir::{ create_mem2reg_pass, create_memcpyopt_pass, create_memcpyprop_reverse_pass, create_misc_demotion_pass, create_postorder_pass, create_ret_demotion_pass, create_simplify_cfg_pass, metadata_to_inline, optimize as opt, register_known_passes, - Backtrace, Context, Function, IrError, PassGroup, PassManager, Value, DCE_NAME, - FN_DEDUP_DEBUG_PROFILE_NAME, FN_DEDUP_RELEASE_PROFILE_NAME, GLOBALS_DCE_NAME, MEM2REG_NAME, - SROA_NAME, + Backtrace, Context, Function, IrError, PassGroup, PassManager, Value, + ARG_POINTEE_MUTABILITY_TAGGER_NAME, DCE_NAME, FN_DEDUP_DEBUG_PROFILE_NAME, + FN_DEDUP_RELEASE_PROFILE_NAME, GLOBALS_DCE_NAME, MEM2REG_NAME, MEMCPYOPT_NAME, SROA_NAME, }; use sway_types::SourceEngine; @@ -510,6 +510,25 @@ fn memcpyopt() { // ------------------------------------------------------------------------------------------------- +// Runs `memcpyopt` followed by `dce`, mirroring the order in which they run in +// the real optimization pipeline. This tests the copy propagation through +// layout-preserving `cast_ptr`s and lets `dce` remove the now-redundant copies. +#[allow(clippy::needless_collect)] +#[test] +fn memcpyopt_castptr() { + run_tests("memcpyopt_castptr", |_first_line, ir: &mut Context| { + let mut pass_mgr = PassManager::default(); + register_known_passes(&mut pass_mgr); + let mut pass_group = PassGroup::default(); + pass_group.append_pass(ARG_POINTEE_MUTABILITY_TAGGER_NAME); + pass_group.append_pass(MEMCPYOPT_NAME); + pass_group.append_pass(DCE_NAME); + pass_mgr.run(ir, &pass_group).unwrap() + }) +} + +// ------------------------------------------------------------------------------------------------- + #[allow(clippy::needless_collect)] #[test] fn memcpy_prop() { 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 1358c68b6e7..da247d85f34 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 @@ -236,7 +236,6 @@ script { } fn decode_array_19(mut __ret_value: __ptr [u8; 1]) -> (), !103 { - local slice __anon_00 local [u8; 1] __array_init_0 local slice __ret_val local slice __tmp_arg0 @@ -257,66 +256,64 @@ script { mem_copy_val v1352v1, v252v1 v1778v1 = get_local __ptr slice, __tmp_arg0 mem_copy_val v1778v1, v252v1 - v1780v3 = get_local __ptr slice, __anon_00, !113 - mem_copy_val v1780v3, v252v1 - v1943v1 = cast_ptr v1780v3 to __ptr { ptr, u64 }, !113 - v1930v1 = const u64 0 - v1944v1 = get_elem_ptr v1943v1, __ptr ptr, v1930v1 - v1945v1 = load v1944v1 + v1780v3 = cast_ptr v1778v1 to __ptr { ptr, u64 } + v289v1 = const u64 0 + v1930v1 = get_elem_ptr v1780v3, __ptr ptr, v289v1 + v1931v1 = load v1930v1 v266v1 = const u64 1 - v1508v1 = asm(size: v266v1, src: v1945v1) -> __ptr [u8; 1] hp, !116 { - aloc size, !117 - mcp hp src size, !118 + v1508v1 = asm(size: v266v1, src: v1931v1) -> __ptr [u8; 1] hp, !112 { + aloc size, !113 + mcp hp src size, !114 } - v1952v1 = const u64 0 - v1953v1 = get_elem_ptr v1508v1, __ptr u8, v1952v1 - v1954v1 = load v1953v1 - v1959v1 = const u64 0 - v1960v1 = get_elem_ptr __ret_value, __ptr u8, v1959v1 - store v1954v1 to v1960v1 + v1938v1 = const u64 0 + v1939v1 = get_elem_ptr v1508v1, __ptr u8, v1938v1 + v1940v1 = load v1939v1 + v1945v1 = const u64 0 + v1946v1 = get_elem_ptr __ret_value, __ptr u8, v1945v1 + store v1940v1 to v1946v1 v1887v1 = const unit () ret () v1887v1 } - fn to_slice_20(mut array: __ptr [u8; 1], mut __ret_value: __ptr slice) -> (), !121 { - local { ptr, u64 } __anon_0 + fn to_slice_20(mut array: __ptr [u8; 1], mut __ret_value: __ptr slice) -> (), !117 { + local { ptr, u64 } __tuple_init_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 - v886v1 = get_local __ptr { ptr, u64 }, __anon_0, !126 + v242v1 = cast_ptr v197v1 to ptr, !118 + v886v1 = get_local __ptr { ptr, u64 }, __tuple_init_0, !123 v841v1 = const u64 0 - v895v1 = get_elem_ptr v886v1, __ptr ptr, v841v1, !127 - store v242v1 to v895v1, !128 + v895v1 = get_elem_ptr v886v1, __ptr ptr, v841v1, !124 + store v242v1 to v895v1, !125 v844v1 = const u64 1 - v897v1 = get_elem_ptr v886v1, __ptr u64, v844v1, !129 - v893v1 = const u64 1, !132 - store v893v1 to v897v1, !133 - v906v1 = cast_ptr v886v1 to __ptr slice, !136 + v897v1 = get_elem_ptr v886v1, __ptr u64, v844v1, !126 + v893v1 = const u64 1, !129 + store v893v1 to v897v1, !130 + v906v1 = cast_ptr v886v1 to __ptr slice, !133 mem_copy_val __ret_value, v906v1 v1894v1 = const unit () ret () v1894v1 } - pub fn log_45(mut value !138: u8) -> (), !141 { - local { __ptr u8, u64 } __anon_0 + pub fn log_45(mut value !135: u8) -> (), !138 { local slice __log_arg + local { __ptr u8, u64 } __tuple_init_0 local u8 value_ entry(mut value: u8): v596v1 = get_local __ptr u8, value_ store value to v596v1 - v1701v1 = get_local __ptr { __ptr u8, u64 }, __anon_0, !144 + v1701v1 = get_local __ptr { __ptr u8, u64 }, __tuple_init_0, !141 v853v1 = const u64 0 - v1704v1 = get_elem_ptr v1701v1, __ptr __ptr u8, v853v1, !145 - store v596v1 to v1704v1, !146 + v1704v1 = get_elem_ptr v1701v1, __ptr __ptr u8, v853v1, !142 + store v596v1 to v1704v1, !143 v856v1 = const u64 1 - v1706v1 = get_elem_ptr v1701v1, __ptr u64, v856v1, !147 + v1706v1 = get_elem_ptr v1701v1, __ptr u64, v856v1, !144 v606v1 = const u64 1 - store v606v1 to v1706v1, !148 - v1711v1 = cast_ptr v1701v1 to __ptr slice, !142 + store v606v1 to v1706v1, !145 + v1711v1 = cast_ptr v1701v1 to __ptr slice, !139 v1899v1 = get_local __ptr slice, __log_arg mem_copy_val v1899v1, v1711v1 v739v1 = const u64 14454674236531057292 @@ -424,9 +421,9 @@ eq $r2 $r2 $zero jnzf $r2 $zero i1 jmpf $zero i6 move $$arg0 $r0 ; [call: log_45]: pass argument 0 -jal $$reta $pc i119 ; [call: log_45]: call function -movi $$arg0 i255 ; [call: log_45]: pass argument 0 jal $$reta $pc i117 ; [call: log_45]: call function +movi $$arg0 i255 ; [call: log_45]: pass argument 0 +jal $$reta $pc i115 ; [call: log_45]: call function load $r0 data_NonConfigurable_0; load constant from data section rvrt $r0 cfsi i264920 ; [fn end: main_0] free: locals 264920 byte(s), call args 0 slot(s) @@ -505,30 +502,28 @@ poph i524288 ; [fn end: arrays_with_const_length_18]: restore u jal $zero $$reta i0 ; [fn end: arrays_with_const_length_18] return from call 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) +cfei i72 ; [fn init: decode_array_19]: allocate: locals 72 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 -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 +movi $r0 i255 ; initialize constant into register +sb $$locbase $r0 i0 ; store byte +addi $r0 $$locbase i8 ; get offset to local __ptr slice +move $$arg0 $$locbase ; [call: to_slice_20]: pass argument 0 +move $$arg1 $r0 ; [call: to_slice_20]: pass argument 1 +jal $$reta $pc i17 ; [call: to_slice_20]: call function 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 -lw $r0 $$locbase i0 ; load word +addi $r0 $$locbase i40 ; get offset to local __ptr slice +mcpi $r0 $r3 i16 ; copy memory +addi $r0 $$locbase i24 ; get offset to local __ptr slice +mcpi $r0 $r3 i16 ; copy memory +lw $r0 $$locbase i3 ; load word movi $r3 i1 ; copy ASM block argument's constant initial value to register aloc $one ; aloc size mcp $hp $r0 $r3 ; mcp hp src size lb $r0 $hp i0 ; load byte sb $r1 $r0 i0 ; store byte -cfsi i88 ; [fn end: decode_array_19] free: locals 88 byte(s), call args 0 slot(s) +cfsi i72 ; [fn end: decode_array_19] free: locals 72 byte(s), call args 0 slot(s) move $$reta $r2 ; [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 @@ -548,13 +543,13 @@ move $$locbase $sp ; [fn init: log_45]: set locals base register cfei i40 ; [fn init: log_45]: 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 +addi $r1 $$locbase i16 ; get offset to local __ptr { __ptr u8, u64 } +sw $$locbase $r0 i2 ; store word +sw $$locbase $one i3 ; store word +mcpi $$locbase $r1 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 +lw $r1 $$locbase i0 ; load slice pointer for logging data +lw $r2 $$locbase i1 ; load slice size for logging data logd $zero $r0 $r1 $r2 ; log slice cfsi i40 ; [fn end: log_45] free: locals 40 byte(s), call args 0 slot(s) poph i531456 ; [fn end: log_45]: restore used high registers 40..64 @@ -569,7 +564,7 @@ data_NonConfigurable_2 .word 14454674236531057292 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, 144] 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] @@ -659,9 +654,9 @@ data_NonConfigurable_2 .word 14454674236531057292 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] +0x00000178 JAL R62 $pc 0x75 ;; [153, 248, 48, 117] 0x0000017c MOVI R58 0xff ;; [114, 232, 0, 255] -0x00000180 JAL R62 $pc 0x75 ;; [153, 248, 48, 117] +0x00000180 JAL R62 $pc 0x73 ;; [153, 248, 48, 115] 0x00000184 LW R52 R63 0x0 ;; [93, 211, 240, 0] 0x00000188 RVRT R52 ;; [54, 208, 0, 0] 0x0000018c CFSI 0x40ad8 ;; [146, 4, 10, 216] @@ -740,65 +735,63 @@ data_NonConfigurable_2 .word 14454674236531057292 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] +0x000002bc CFEI 0x48 ;; [145, 0, 0, 72] 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] +0x000002c8 MOVI R52 0xff ;; [114, 208, 0, 255] +0x000002cc SB R59 R52 0x0 ;; [94, 239, 64, 0] +0x000002d0 ADDI R52 R59 0x8 ;; [80, 211, 176, 8] +0x000002d4 MOVE R58 R59 ;; [26, 235, 176, 0] +0x000002d8 MOVE R57 R52 ;; [26, 231, 64, 0] +0x000002dc JAL R62 $pc 0x11 ;; [153, 248, 48, 17] +0x000002e0 ADDI R49 R59 0x38 ;; [80, 199, 176, 56] +0x000002e4 MCPI R49 R52 0x10 ;; [96, 199, 64, 16] +0x000002e8 ADDI R52 R59 0x28 ;; [80, 211, 176, 40] +0x000002ec MCPI R52 R49 0x10 ;; [96, 211, 16, 16] +0x000002f0 ADDI R52 R59 0x18 ;; [80, 211, 176, 24] +0x000002f4 MCPI R52 R49 0x10 ;; [96, 211, 16, 16] +0x000002f8 LW R52 R59 0x3 ;; [93, 211, 176, 3] +0x000002fc MOVI R49 0x1 ;; [114, 196, 0, 1] +0x00000300 ALOC $one ;; [38, 4, 0, 0] +0x00000304 MCP $hp R52 R49 ;; [40, 31, 76, 64] +0x00000308 LB R52 $hp 0x0 ;; [92, 208, 112, 0] +0x0000030c SB R51 R52 0x0 ;; [94, 207, 64, 0] +0x00000310 CFSI 0x48 ;; [146, 0, 0, 72] +0x00000314 MOVE R62 R50 ;; [26, 251, 32, 0] +0x00000318 POPH 0x81e00 ;; [152, 8, 30, 0] +0x0000031c JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000320 PSHH 0x81000 ;; [150, 8, 16, 0] +0x00000324 MOVE R59 $sp ;; [26, 236, 80, 0] +0x00000328 CFEI 0x18 ;; [145, 0, 0, 24] +0x0000032c ADDI R52 R59 0x10 ;; [80, 211, 176, 16] +0x00000330 MCPI R52 R58 0x1 ;; [96, 211, 160, 1] +0x00000334 SW R59 R52 0x0 ;; [95, 239, 64, 0] +0x00000338 SW R59 $one 0x1 ;; [95, 236, 16, 1] +0x0000033c MCPI R57 R59 0x10 ;; [96, 231, 176, 16] +0x00000340 CFSI 0x18 ;; [146, 0, 0, 24] +0x00000344 POPH 0x81000 ;; [152, 8, 16, 0] +0x00000348 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x0000034c PSHH 0x81c00 ;; [150, 8, 28, 0] +0x00000350 MOVE R59 $sp ;; [26, 236, 80, 0] +0x00000354 CFEI 0x28 ;; [145, 0, 0, 40] +0x00000358 ADDI R52 R59 0x20 ;; [80, 211, 176, 32] +0x0000035c SB R52 R58 0x0 ;; [94, 211, 160, 0] +0x00000360 ADDI R51 R59 0x10 ;; [80, 207, 176, 16] +0x00000364 SW R59 R52 0x2 ;; [95, 239, 64, 2] +0x00000368 SW R59 $one 0x3 ;; [95, 236, 16, 3] +0x0000036c MCPI R59 R51 0x10 ;; [96, 239, 48, 16] +0x00000370 LW R52 R63 0x2 ;; [93, 211, 240, 2] +0x00000374 LW R51 R59 0x0 ;; [93, 207, 176, 0] +0x00000378 LW R50 R59 0x1 ;; [93, 203, 176, 1] +0x0000037c LOGD $zero R52 R51 R50 ;; [52, 3, 76, 242] +0x00000380 CFSI 0x28 ;; [146, 0, 0, 40] +0x00000384 POPH 0x81c00 ;; [152, 8, 28, 0] +0x00000388 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x0000038c NOOP ;; [71, 0, 0, 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]) +0x00000390 .word i18446744073709486083, as hex be bytes ([FF, FF, FF, FF, FF, FF, 00, 03]) +0x00000398 .word i262145, as hex be bytes ([00, 00, 00, 00, 00, 04, 00, 01]) +0x000003a0 .word i14454674236531057292, as hex be bytes ([C8, 99, 51, A2, 4C, 6C, A2, 8C]) ;; --- END OF TARGET BYTECODE --- warning @@ -898,7 +891,7 @@ warning ____ Compiled script "array_repeat" with 8 warnings. - Finished release [optimized + fuel] target(s) [944 B] in ??? + Finished release [optimized + fuel] target(s) [936 B] in ??? > forc test --path test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat --verbose --release exit status: 0 @@ -906,10 +899,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.936 KB] in ??? script array_repeat - Bytecode size: 1944 bytes (1.944 KB) - Bytecode hash: 0xd84e1f0af96e64ef4c4c098c44c52e6494d47aa0b5eee14850b62bbde99640fb + Bytecode size: 1936 bytes (1.936 KB) + Bytecode hash: 0x8f31268a4d4bdcd008334b262554ac979ecee5b0ead6158a3b1e252ea9196b57 Running 1 test, filtered 0 tests tested -- array_repeat diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_consts/json_abi_oracle_new_encoding.release.json b/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_consts/json_abi_oracle_new_encoding.release.json index d1881f641ff..bc28d5bf1fa 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_consts/json_abi_oracle_new_encoding.release.json +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_consts/json_abi_oracle_new_encoding.release.json @@ -63,97 +63,97 @@ "concreteTypeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903", "indirect": false, "name": "BOOL", - "offset": 3232 + "offset": 3160 }, { "concreteTypeId": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b", "indirect": false, "name": "U8", - "offset": 3424 + "offset": 3352 }, { "concreteTypeId": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b", "indirect": false, "name": "ANOTHER_U8", - "offset": 3160 + "offset": 3088 }, { "concreteTypeId": "29881aad8730c5ab11d275376323d8e4ff4179aae8ccb6c13fe4902137e162ef", "indirect": false, "name": "U16", - "offset": 3368 + "offset": 3296 }, { "concreteTypeId": "d7649d428b9ff33d188ecbf38a7e4d8fd167fa01b2e10fe9a8f9308e52f1d7cc", "indirect": false, "name": "U32", - "offset": 3408 + "offset": 3336 }, { "concreteTypeId": "d7649d428b9ff33d188ecbf38a7e4d8fd167fa01b2e10fe9a8f9308e52f1d7cc", "indirect": false, "name": "U64", - "offset": 3416 + "offset": 3344 }, { "concreteTypeId": "1b5759d94094368cfd443019e7ca5ec4074300e544e5ea993a979f5da627261e", "indirect": false, "name": "U256", - "offset": 3376 + "offset": 3304 }, { "concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b", "indirect": false, "name": "B256", - "offset": 3200 + "offset": 3128 }, { "concreteTypeId": "81fc10c4681a3271cf2d66b2ec6fbc8ed007a442652930844fcf11818c295bff", "indirect": false, "name": "CONFIGURABLE_STRUCT", - "offset": 3320 + "offset": 3248 }, { "concreteTypeId": "a2922861f03be8a650595dd76455b95383a61b46dd418f02607fa2e00dc39d5c", "indirect": false, "name": "CONFIGURABLE_ENUM_A", - "offset": 3240 + "offset": 3168 }, { "concreteTypeId": "a2922861f03be8a650595dd76455b95383a61b46dd418f02607fa2e00dc39d5c", "indirect": false, "name": "CONFIGURABLE_ENUM_B", - "offset": 3280 + "offset": 3208 }, { "concreteTypeId": "4926d35d1a5157936b0a29bc126b8aace6d911209a5c130e9b716b0c73643ea6", "indirect": false, "name": "ARRAY_BOOL", - "offset": 3168 + "offset": 3096 }, { "concreteTypeId": "776fb5a3824169d6736138565fdc20aad684d9111266a5ff6d5c675280b7e199", "indirect": false, "name": "ARRAY_U64", - "offset": 3176 + "offset": 3104 }, { "concreteTypeId": "c998ca9a5f221fe7b5c66ae70c8a9562b86d964408b00d17f883c906bc1fe4be", "indirect": false, "name": "TUPLE_BOOL_U64", - "offset": 3352 + "offset": 3280 }, { "concreteTypeId": "94f0fa95c830be5e4f711963e83259fe7e8bc723278ab6ec34449e791a99b53a", "indirect": false, "name": "STR_4", - "offset": 3344 + "offset": 3272 }, { "concreteTypeId": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b", "indirect": false, "name": "NOT_USED", - "offset": 3336 + "offset": 3264 } ], "encodingVersion": "1", 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 8246787fded..b324c64b26e 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.56 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [8.52 KB] in ??? Running 1 test, filtered 0 tests tested -- const_generics - test run_main ... ok (???, 17643 gas) + test run_main ... ok (???, 16897 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/intrinsics/dbg/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg/stdout.snap index 16525b67134..f318ed4376f 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 @@ -71,12 +71,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg Compiling library std (sway-lib-std) Compiling script dbg (test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg) - Finished debug [unoptimized + fuel] target(s) [35.104 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [35.024 KB] in ??? Running 1 test, filtered 0 tests tested -- dbg - test call_main ... ok (???, 110840 gas) + test call_main ... ok (???, 106813 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..52c2cb8bc7a 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 @@ -19,21 +19,60 @@ ecal $r3 $r0 $r1 $r2 ; ecal id fd buf count > forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/dbg_release --release --asm final | sub ecal ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count 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 $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r3 $r4 $r1 $r2 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count ecal $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r3 $r4 $r1 $r2 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count 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 $r2 $r3 $r0 $r1 ; ecal id fd buf count ecal $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r4 $r7 $r2 $r3 ; ecal id fd buf count +ecal $r3 $r4 $r0 $r2 ; ecal id fd buf count ecal $r0 $r2 $zero $zero ; ecal id fd zero zero +ecal $r4 $r6 $r2 $r3 ; ecal id fd buf count +ecal $r3 $r4 $r0 $r2 ; 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 $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count ecal $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r3 $r4 $r1 $r2 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r3 $r4 $r1 $r2 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count ecal $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r4 $r6 $r2 $r3 ; ecal id fd buf count +ecal $r3 $r4 $r0 $r2 ; ecal id fd buf count ecal $r0 $r2 $zero $zero ; ecal id fd zero zero +ecal $r4 $r6 $r2 $r3 ; ecal id fd buf count +ecal $r3 $r4 $r0 $r2 ; ecal id fd buf count ecal $r0 $r2 $zero $zero ; ecal id fd zero zero +ecal $r3 $r4 $r1 $r2 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count ecal $r0 $r1 $zero $zero ; ecal id fd zero zero +ecal $r7 $r8 $r3 $r4 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r1 $r2 $r0 $one ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r1 $r2 $r0 $one ; ecal id fd buf count +ecal $r2 $r3 $r1 $r0 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r6 $r7 $r4 $r5 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count +ecal $r2 $r3 $r0 $r1 ; ecal id fd buf count 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 +ecal $r5 $r6 $r0 $r3 ; ecal id fd buf count +ecal $r3 $r4 $r0 $r2 ; ecal id fd buf count diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/transmute/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/transmute/stdout.snap index 5ce0dcac47d..7c61b29d7aa 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/transmute/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/transmute/stdout.snap @@ -9,19 +9,19 @@ fn transmute_by_reference_7(mut __ret_value: __ptr u256) -> () { local __ptr u256 v entry(mut __ret_value: __ptr u256): - v709v1 = get_local __ptr [u8; 32], __array_init_0 - mem_clear_val v709v1 - v711v1 = get_local __ptr [u8; 32], bytes - mem_copy_val v711v1, v709v1 - v713v1 = get_local __ptr [u8; 32], bytes - v714v1 = cast_ptr v713v1 to __ptr u256 - v715v1 = get_local __ptr __ptr u256, v - store v714v1 to v715v1 - v717v1 = get_local __ptr __ptr u256, v - v718v1 = load v717v1 - mem_copy_val __ret_value, v718v1 - v720v1 = const unit () - ret () v720v1 + v687v1 = get_local __ptr [u8; 32], __array_init_0 + mem_clear_val v687v1 + v689v1 = get_local __ptr [u8; 32], bytes + mem_copy_val v689v1, v687v1 + v691v1 = get_local __ptr [u8; 32], bytes + v692v1 = cast_ptr v691v1 to __ptr u256 + v693v1 = get_local __ptr __ptr u256, v + store v692v1 to v693v1 + v695v1 = get_local __ptr __ptr u256, v + v696v1 = load v695v1 + mem_copy_val __ret_value, v696v1 + v698v1 = const unit () + ret () v698v1 } 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 c635f7f260d..5bc610fe540 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 @@ -140,14 +140,14 @@ script { } fn local_log_1(mut item !69: u64) -> (), !73 { - local { __ptr u64, u64 } __anon_0 local slice __log_arg + local { __ptr u64, u64 } __tuple_init_0 local u64 item_ entry(mut item: u64): v18v1 = get_local __ptr u64, item_ store item to v18v1 - v1536v1 = get_local __ptr { __ptr u64, u64 }, __anon_0, !76 + v1536v1 = get_local __ptr { __ptr u64, u64 }, __tuple_init_0, !76 v1442v1 = const u64 0 v1539v1 = get_elem_ptr v1536v1, __ptr __ptr u64, v1442v1, !77 store v18v1 to v1539v1, !78 @@ -180,10 +180,10 @@ script { v51v1 = get_elem_ptr v46v1, __ptr { ptr, u64, u64 }, v50v1, !86 v3842v1 = asm(buffer: v51v1) -> __ptr { ptr, u64, u64 } buffer { } - v3904v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v3904v1, v3842v1 + v3903v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v3903v1, v3842v1 v54v1 = get_local __ptr { ptr, u64, u64 }, __anon_0 - mem_copy_val v54v1, v3904v1 + mem_copy_val v54v1, v3903v1 v56v1 = const u64 0 v57v1 = get_elem_ptr v54v1, __ptr ptr, v56v1 v58v1 = load v57v1 @@ -214,11 +214,11 @@ script { store v70v1 to v92v1 v3844v1 = asm(buffer: v84v1) -> __ptr { ptr, u64, u64 } buffer { } - v3907v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 - mem_copy_val v3907v1, v3844v1 + v3906v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + mem_copy_val v3906v1, v3844v1 v1448v1 = const u64 0 v1449v1 = get_elem_ptr v48v1, __ptr { ptr, u64, u64 }, v1448v1, !85 - mem_copy_val v1449v1, v3907v1 + mem_copy_val v1449v1, v3906v1 mem_copy_val __ret_value, v48v1 v3786v1 = const unit () ret () v3786v1 @@ -258,11 +258,11 @@ script { store v104v1 to v113v1 v3846v1 = asm(buffer: v105v1) -> __ptr { ptr, u64, u64 } buffer { } - v3911v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v3911v1, v3846v1 + v3910v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v3910v1, v3846v1 v1451v1 = const u64 0 v1452v1 = get_elem_ptr v101v1, __ptr { ptr, u64, u64 }, v1451v1, !90 - mem_copy_val v1452v1, v3911v1 + mem_copy_val v1452v1, v3910v1 mem_copy_val __ret_value, v101v1 v3808v1 = const unit () ret () v3808v1 @@ -280,24 +280,24 @@ script { v128v1 = get_elem_ptr v124v1, __ptr { ptr, u64, u64 }, v127v1, !86 v3848v1 = asm(buffer: v128v1) -> __ptr { ptr, u64, u64 } buffer { } - v4028v1 = const u64 0 - v4029v1 = get_elem_ptr v3848v1, __ptr ptr, v4028v1 - v4030v1 = load v4029v1 - v4034v1 = const u64 2 - v4035v1 = get_elem_ptr v3848v1, __ptr u64, v4034v1 - v4036v1 = load v4035v1 + v4025v1 = const u64 0 + v4026v1 = get_elem_ptr v3848v1, __ptr ptr, v4025v1 + v4027v1 = load v4026v1 + v4031v1 = const u64 2 + v4032v1 = get_elem_ptr v3848v1, __ptr u64, v4031v1 + v4033v1 = load v4032v1 v142v1 = get_local __ptr { ptr, u64 }, __anon_1 v143v1 = const u64 0 v144v1 = get_elem_ptr v142v1, __ptr ptr, v143v1 - store v4030v1 to v144v1 + store v4027v1 to v144v1 v146v1 = const u64 1 v147v1 = get_elem_ptr v142v1, __ptr u64, v146v1 - store v4036v1 to v147v1 + store v4033v1 to v147v1 v3850v1 = asm(s: v142v1) -> __ptr slice s { } - v3921v1 = get_local __ptr slice, __aggr_memcpy_00 - mem_copy_val v3921v1, v3850v1 - mem_copy_val __ret_value, v3921v1 + v3920v1 = get_local __ptr slice, __aggr_memcpy_00 + mem_copy_val v3920v1, v3850v1 + mem_copy_val __ret_value, v3920v1 v3821v1 = const unit () ret () v3821v1 } @@ -517,10 +517,10 @@ script { v2865v1 = get_elem_ptr v2861v1, __ptr { ptr, u64, u64 }, v595v1, !201 v3855v1 = asm(buffer: v2865v1) -> __ptr { ptr, u64, u64 } buffer { } - v3932v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v3932v1, v3855v1 + v3931v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v3931v1, v3855v1 v2868v1 = get_local __ptr { ptr, u64, u64 }, __anon_00, !202 - mem_copy_val v2868v1, v3932v1 + mem_copy_val v2868v1, v3931v1 v601v1 = const u64 0 v2870v1 = get_elem_ptr v2868v1, __ptr ptr, v601v1, !203 v2871v1 = load v2870v1, !204 @@ -556,11 +556,11 @@ script { store v2877v1 to v2898v1, !224 v3857v1 = asm(buffer: v2893v1) -> __ptr { ptr, u64, u64 } buffer { } - v3936v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 - mem_copy_val v3936v1, v3857v1 + v3935v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + mem_copy_val v3935v1, v3857v1 v1472v1 = const u64 0 v2901v1 = get_elem_ptr v2863v1, __ptr { ptr, u64, u64 }, v1472v1, !225 - mem_copy_val v2901v1, v3936v1 + mem_copy_val v2901v1, v3935v1 v2905v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !227 mem_copy_val v2905v1, v2863v1 v719v1 = const u64 2 @@ -572,10 +572,10 @@ script { v2917v1 = get_elem_ptr v2913v1, __ptr { ptr, u64, u64 }, v665v1, !235 v3859v1 = asm(buffer: v2917v1) -> __ptr { ptr, u64, u64 } buffer { } - v3941v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 - mem_copy_val v3941v1, v3859v1 + v3940v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 + mem_copy_val v3940v1, v3859v1 v2920v1 = get_local __ptr { ptr, u64, u64 }, __anon_000, !236 - mem_copy_val v2920v1, v3941v1 + mem_copy_val v2920v1, v3940v1 v671v1 = const u64 0 v2922v1 = get_elem_ptr v2920v1, __ptr ptr, v671v1, !237 v2923v1 = load v2922v1, !238 @@ -621,11 +621,11 @@ script { store v2929v1 to v2950v1, !262 v3861v1 = asm(buffer: v2945v1) -> __ptr { ptr, u64, u64 } buffer { } - v3945v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 - mem_copy_val v3945v1, v3861v1 + v3944v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 + mem_copy_val v3944v1, v3861v1 v1475v1 = const u64 0 v2953v1 = get_elem_ptr v2915v1, __ptr { ptr, u64, u64 }, v1475v1, !263 - mem_copy_val v2953v1, v3945v1 + mem_copy_val v2953v1, v3944v1 v2957v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !265 mem_copy_val v2957v1, v2915v1 v784v1 = const u64 3 @@ -638,10 +638,10 @@ script { v2969v1 = get_elem_ptr v2965v1, __ptr { ptr, u64, u64 }, v735v1, !274 v3863v1 = asm(buffer: v2969v1) -> __ptr { ptr, u64, u64 } buffer { } - v3950v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_03 - mem_copy_val v3950v1, v3863v1 + v3949v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_03 + mem_copy_val v3949v1, v3863v1 v2972v1 = get_local __ptr { ptr, u64, u64 }, __anon_01, !275 - mem_copy_val v2972v1, v3950v1 + mem_copy_val v2972v1, v3949v1 v741v1 = const u64 0 v2974v1 = get_elem_ptr v2972v1, __ptr ptr, v741v1, !276 v2975v1 = load v2974v1, !277 @@ -682,11 +682,11 @@ script { store v2981v1 to v2998v1, !298 v3865v1 = asm(buffer: v2993v1) -> __ptr { ptr, u64, u64 } buffer { } - v3953v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_04 - mem_copy_val v3953v1, v3865v1 + v3952v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_04 + mem_copy_val v3952v1, v3865v1 v1478v1 = const u64 0 v3001v1 = get_elem_ptr v2967v1, __ptr { ptr, u64, u64 }, v1478v1, !299 - mem_copy_val v3001v1, v3953v1 + mem_copy_val v3001v1, v3952v1 v3005v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !301 mem_copy_val v3005v1, v2967v1 v892v1 = const u64 4 @@ -727,10 +727,10 @@ script { v3052v1 = get_elem_ptr v3046v1, __ptr { ptr, u64, u64 }, v820v1, !329 v3867v1 = asm(buffer: v3052v1) -> __ptr { ptr, u64, u64 } buffer { } - v3964v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_05 - mem_copy_val v3964v1, v3867v1 + v3963v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_05 + mem_copy_val v3963v1, v3867v1 v3055v1 = get_local __ptr { ptr, u64, u64 }, __anon_02, !330 - mem_copy_val v3055v1, v3964v1 + mem_copy_val v3055v1, v3963v1 v826v1 = const u64 0 v3057v1 = get_elem_ptr v3055v1, __ptr ptr, v826v1, !331 v3058v1 = load v3057v1, !332 @@ -782,11 +782,11 @@ script { store v3081v1 to v3087v1, !357 v3869v1 = asm(buffer: v3082v1) -> __ptr { ptr, u64, u64 } buffer { } - v3969v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_06 - mem_copy_val v3969v1, v3869v1 + v3968v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_06 + mem_copy_val v3968v1, v3869v1 v1487v1 = const u64 0 v3090v1 = get_elem_ptr v3050v1, __ptr { ptr, u64, u64 }, v1487v1, !358 - mem_copy_val v3090v1, v3969v1 + mem_copy_val v3090v1, v3968v1 v3095v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !360 mem_copy_val v3095v1, v3050v1 v964v1 = const u64 5 @@ -800,10 +800,10 @@ script { v3108v1 = get_elem_ptr v3104v1, __ptr { ptr, u64, u64 }, v908v1, !369 v3871v1 = asm(buffer: v3108v1) -> __ptr { ptr, u64, u64 } buffer { } - v3975v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_07 - mem_copy_val v3975v1, v3871v1 + v3974v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_07 + mem_copy_val v3974v1, v3871v1 v3111v1 = get_local __ptr { ptr, u64, u64 }, __anon_03, !370 - mem_copy_val v3111v1, v3975v1 + mem_copy_val v3111v1, v3974v1 v914v1 = const u64 0 v3113v1 = get_elem_ptr v3111v1, __ptr ptr, v914v1, !371 v3114v1 = load v3113v1, !372 @@ -813,14 +813,14 @@ script { v920v1 = const u64 2 v3117v1 = get_elem_ptr v3111v1, __ptr u64, v920v1, !375 v3118v1 = load v3117v1, !376 - v3981v1 = get_local __ptr slice, __aggr_memcpy_09 - mem_copy_val v3981v1, v3102v1 + v3980v1 = get_local __ptr slice, __aggr_memcpy_09 + mem_copy_val v3980v1, v3102v1 v3873v1 = asm(item: v3102v1) -> __ptr { u64, u64 } item { } - v3978v1 = get_local __ptr { u64, u64 }, __aggr_memcpy_08 - mem_copy_val v3978v1, v3873v1 + v3977v1 = get_local __ptr { u64, u64 }, __aggr_memcpy_08 + mem_copy_val v3977v1, v3873v1 v3122v1 = get_local __ptr { u64, u64 }, __anon_13, !377 - mem_copy_val v3122v1, v3978v1 + mem_copy_val v3122v1, v3977v1 v928v1 = const u64 1 v3124v1 = get_elem_ptr v3122v1, __ptr u64, v928v1, !378 v3125v1 = load v3124v1, !379 @@ -842,7 +842,7 @@ script { 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 - mem_copy_val v3135v1, v3981v1 + mem_copy_val v3135v1, v3980v1 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 { @@ -866,11 +866,11 @@ script { store v3139v1 to v3145v1, !398 v3875v1 = asm(buffer: v3140v1) -> __ptr { ptr, u64, u64 } buffer { } - v3984v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_010 - mem_copy_val v3984v1, v3875v1 + v3983v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_010 + mem_copy_val v3983v1, v3875v1 v1490v1 = const u64 0 v3148v1 = get_elem_ptr v3106v1, __ptr { ptr, u64, u64 }, v1490v1, !399 - mem_copy_val v3148v1, v3984v1 + mem_copy_val v3148v1, v3983v1 v3152v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_______, !401 mem_copy_val v3152v1, v3106v1 v1031v1 = const u64 6 @@ -884,10 +884,10 @@ script { v3165v1 = get_elem_ptr v3161v1, __ptr { ptr, u64, u64 }, v980v1, !410 v3877v1 = asm(buffer: v3165v1) -> __ptr { ptr, u64, u64 } buffer { } - v3990v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_011 - mem_copy_val v3990v1, v3877v1 + v3989v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_011 + mem_copy_val v3989v1, v3877v1 v3168v1 = get_local __ptr { ptr, u64, u64 }, __anon_04, !411 - mem_copy_val v3168v1, v3990v1 + mem_copy_val v3168v1, v3989v1 v986v1 = const u64 0 v3170v1 = get_elem_ptr v3168v1, __ptr ptr, v986v1, !412 v3171v1 = load v3170v1, !413 @@ -930,11 +930,11 @@ script { store v3178v1 to v3197v1, !435 v3879v1 = asm(buffer: v3192v1) -> __ptr { ptr, u64, u64 } buffer { } - v3994v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_012 - mem_copy_val v3994v1, v3879v1 + v3993v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_012 + mem_copy_val v3993v1, v3879v1 v1493v1 = const u64 0 v3200v1 = get_elem_ptr v3163v1, __ptr { ptr, u64, u64 }, v1493v1, !436 - mem_copy_val v3200v1, v3994v1 + mem_copy_val v3200v1, v3993v1 v3204v1 = get_local __ptr { { ptr, u64, u64 } }, buffer________, !438 mem_copy_val v3204v1, v3163v1 v3209v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !440 @@ -967,14 +967,14 @@ script { } fn local_log_46(mut item: __ptr { u64 }) -> (), !445 { - local { __ptr { u64 }, u64 } __anon_0 local slice __log_arg + local { __ptr { u64 }, u64 } __tuple_init_0 local { u64 } item_ 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 }, __tuple_init_0, !446 v1496v1 = const u64 0 v3306v1 = get_elem_ptr v3303v1, __ptr __ptr { u64 }, v1496v1, !447 store v1093v1 to v3306v1, !448 @@ -1005,8 +1005,8 @@ script { v3814v1 = call new_6(v3813v1) v1219v1 = const u64 0 v3551v1 = get_elem_ptr v1170v1, __ptr u64, v1219v1, !453 - v4065v1 = get_elem_ptr item, __ptr u64, v1219v1 - v3552v1 = load v4065v1, !454 + v4062v1 = get_elem_ptr item, __ptr u64, v1219v1 + v3552v1 = load v4062v1, !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 @@ -1021,8 +1021,8 @@ script { v3836v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg v1130v1 = const u64 0 v3837v3 = get_elem_ptr v3577v1, __ptr u64, v1130v1, !461 - v4062v1 = load v3837v3 - v4063v1 = call abi_encode_5(v4062v1, v3797v1, v3836v1) + v4059v1 = load v3837v3 + v4060v1 = call abi_encode_5(v4059v1, v3797v1, v3836v1) br encode_allow_alias_52_abi_encode_57_block5(v3836v1), !462 encode_allow_alias_52_abi_encode_57_block1(): diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap index 48166ebab67..364a4eee827 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap @@ -232,8 +232,6 @@ script { local { ptr, u64, u64 } __anon_000 local { ptr, u64, u64 } __anon_01 local { ptr, u64, u64 } __anon_02 - local slice __anon_03 - local slice __anon_04 local slice __anon_1 local string<3> __anon_10 local { ptr, u64 } __anon_100 @@ -543,20 +541,18 @@ script { mem_copy_val v4564v1, v1043v1 v4566v3 = get_local __ptr string<3>, a_ mem_copy_val v4566v3, v4562v1 - v4711v1 = get_local __ptr slice, __anon_03, !304 - mem_copy_val v4711v1, v4564v1 - v4713v1 = cast_ptr v4711v1 to __ptr { ptr, u64 }, !304 - v4714v1 = get_local __ptr { ptr, u64 }, __tuple_1_, !307 - mem_copy_val v4714v1, v4713v1 + v4710v1 = cast_ptr v4564v1 to __ptr { ptr, u64 }, !304 + v4711v1 = get_local __ptr { ptr, u64 }, __tuple_1_, !307 + mem_copy_val v4711v1, v4710v1 v998v1 = const u64 0 - v4717v1 = get_elem_ptr v4714v1, __ptr ptr, v998v1, !308 - v4718v1 = load v4717v1, !304 + v4713v1 = get_elem_ptr v4711v1, __ptr ptr, v998v1, !308 + v4714v1 = load v4713v1, !304 v1021v1 = const u64 3, !309 - v4719v1 = asm(a: v4566v3, b: v4718v1, len: v1021v1, r) -> bool r, !310 { + v4715v1 = asm(a: v4566v3, b: v4714v1, len: v1021v1, r) -> bool r, !310 { meq r a b len, !311 } v951v1 = const bool false, !313 - v1047v3 = cmp eq v4719v1 v951v1, !319 + v1047v3 = cmp eq v4715v1 v951v1, !319 cbr v1047v3, assert_54_block0(), assert_54_block1(), !320 assert_54_block0(): @@ -613,17 +609,15 @@ script { mem_copy_val v4569v1, v1099v1 v4571v3 = get_local __ptr string<3>, a_0 mem_copy_val v4571v3, v4567v1 - v4723v1 = get_local __ptr slice, __anon_04, !304 - mem_copy_val v4723v1, v4569v1 - v4725v1 = cast_ptr v4723v1 to __ptr { ptr, u64 }, !304 - v4726v1 = get_local __ptr { ptr, u64 }, __tuple_1_0, !307 - mem_copy_val v4726v1, v4725v1 - v4729v1 = get_elem_ptr v4726v1, __ptr ptr, v998v1, !308 - v4730v1 = load v4729v1, !304 - v4731v1 = asm(a: v4571v3, b: v4730v1, len: v1021v1, r) -> bool r, !310 { + v4719v1 = cast_ptr v4569v1 to __ptr { ptr, u64 }, !304 + v4720v1 = get_local __ptr { ptr, u64 }, __tuple_1_0, !307 + mem_copy_val v4720v1, v4719v1 + v4722v1 = get_elem_ptr v4720v1, __ptr ptr, v998v1, !308 + v4723v1 = load v4722v1, !304 + v4724v1 = asm(a: v4571v3, b: v4723v1, len: v1021v1, r) -> bool r, !310 { meq r a b len, !311 } - v1103v3 = cmp eq v4731v1 v951v1, !347 + v1103v3 = cmp eq v4724v1 v951v1, !347 cbr v1103v3, assert_54_block018(), assert_54_block119(), !348 assert_54_block018(): @@ -1236,12 +1230,12 @@ jmpb $zero i81 pshl i8388608 ; [fn init: main_32]: push used low registers 16..40 pshh i532479 ; [fn init: main_32]: push used high registers 40..64 move $$locbase $sp ; [fn init: main_32]: set locals base register -cfei i1312 ; [fn init: main_32]: allocate: locals 1312 byte(s), call args 0 slot(s) +cfei i1280 ; [fn init: main_32]: allocate: locals 1280 byte(s), call args 0 slot(s) move $r5 $$arg1 ; [fn init: main_32]: copy argument 1 (__ret_value) move $r4 $$reta ; [fn init: main_32]: save return address -addi $r6 $$locbase i1136 ; get offset to local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] +addi $r6 $$locbase i1104 ; get offset to local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] mcpi $r6 $$arg0 i48 ; copy memory -addi $r0 $$locbase i496 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i464 ; get offset to local __ptr { { ptr, u64, u64 } } movi $r1 i1024 ; initialize constant into register aloc $r1 addi $r1 $$locbase i128 ; get offset to local __ptr { ptr, u64, u64 } @@ -1251,65 +1245,63 @@ sw $$locbase $r2 i17 ; store word sw $$locbase $zero i18 ; store word mcpi $$locbase $r1 i24 ; copy memory mcpi $r0 $$locbase i24 ; copy memory -addi $r13 $$locbase i1240 ; get offset to local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] +addi $r13 $$locbase i1208 ; get offset to local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] mcpi $r13 $r6 i48 ; copy memory -addi $r1 $$locbase i800 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r1 $$locbase i768 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r1 $r0 i24 ; copy memory -addi $r12 $$locbase i920 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r12 $$locbase i888 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r12 $r1 i24 ; copy memory movi $r11 i0 ; move parameter from branch to block argument movi $r0 i2 ; initialize constant into register lt $r0 $r11 $r0 -jnzf $r0 $zero i104 -addi $r0 $$locbase i776 ; get offset to local __ptr { { ptr, u64, u64 } } +jnzf $r0 $zero i100 +addi $r0 $$locbase i744 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r12 i24 ; copy memory -addi $r1 $$locbase i1288 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r1 $$locbase i1256 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r1 $r0 i24 ; copy memory addi $r0 $$locbase i72 ; get offset to local __ptr { ptr, u64, u64 } mcpi $r0 $r1 i24 ; copy memory addi $r1 $$locbase i176 ; get offset to local __ptr { ptr, u64, u64 } mcpi $r1 $r0 i24 ; copy memory addi $r2 $r1 i16 ; get offset to aggregate element -addi $r3 $$locbase i256 ; get offset to local __ptr { ptr, u64 } +addi $r3 $$locbase i224 ; get offset to local __ptr { ptr, u64 } mcpi $r3 $r1 i8 ; copy memory addi $r0 $r3 i8 ; get offset to aggregate element mcpi $r0 $r2 i8 ; copy memory addi $r0 $$locbase i96 ; get offset to local __ptr slice mcpi $r0 $r3 i16 ; copy memory -addi $r1 $$locbase i712 ; get offset to local __ptr slice +addi $r1 $$locbase i680 ; get offset to local __ptr slice mcpi $r1 $r0 i16 ; copy memory -addi $r0 $$locbase i328 ; get offset to local __ptr slice +addi $r0 $$locbase i296 ; 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 i41 ; load slice pointer for logging data -lw $r2 $$locbase i42 ; load slice size for logging data +lw $r1 $$locbase i37 ; load slice pointer for logging data +lw $r2 $$locbase i38 ; load slice size for logging data logd $zero $r0 $r1 $r2 ; log slice addr $r0 data_NonConfigurable_1; get __const_global's address in data section addi $r1 $$locbase i112 ; get offset to local __ptr { ptr, u64 } sw $$locbase $r0 i14 ; store word movi $r0 i3 ; initialize constant into register sw $$locbase $r0 i15 ; store word -addi $r0 $$locbase i232 ; get offset to local __ptr slice +addi $r0 $$locbase i200 ; get offset to local __ptr slice mcpi $r0 $r1 i16 ; copy memory -addi $r1 $$locbase i640 ; get offset to local __ptr string<3> +addi $r1 $$locbase i608 ; get offset to local __ptr string<3> mcpi $r1 $r6 i8 ; copy memory -addi $r2 $$locbase i648 ; get offset to local __ptr slice +addi $r2 $$locbase i616 ; get offset to local __ptr slice mcpi $r2 $r0 i16 ; copy memory -addi $r0 $$locbase i760 ; get offset to local __ptr string<3> +addi $r0 $$locbase i728 ; get offset to local __ptr string<3> mcpi $r0 $r1 i8 ; copy memory -addi $r1 $$locbase i200 ; get offset to local __ptr slice +addi $r1 $$locbase i696 ; get offset to local __ptr { ptr, u64 } mcpi $r1 $r2 i16 ; copy memory -addi $r2 $$locbase i728 ; get offset to local __ptr { ptr, u64 } -mcpi $r2 $r1 i16 ; copy memory -lw $r1 $$locbase i91 ; load word +lw $r1 $$locbase i87 ; load word movi $r2 i3 ; initialize constant into register meq $r0 $r0 $r1 $r2 ; meq r a b len eq $r0 $r0 $zero -jnzf $r0 $zero i57 +jnzf $r0 $zero i55 addi $r0 $r6 i8 ; get offset to aggregate element -addi $r1 $$locbase i344 ; get offset to local __ptr { u64, ( u64 | u64 ) } +addi $r1 $$locbase i312 ; get offset to local __ptr { u64, ( u64 | u64 ) } mcpi $r1 $r0 i16 ; copy memory -lw $r0 $$locbase i43 ; load word +lw $r0 $$locbase i39 ; load word eq $r0 $r0 $zero jnzf $r0 $zero i1 rvrt $one @@ -1317,34 +1309,32 @@ lw $r0 $r1 i1 ; load word movi $r1 i1338 ; initialize constant into register eq $r0 $r0 $r1 eq $r0 $r0 $zero -jnzf $r0 $zero i43 +jnzf $r0 $zero i41 addi $r0 $r6 i24 ; add array element offset to array base addr $r1 data_NonConfigurable_2; get __const_global0's address in data section -addi $r2 $$locbase i272 ; get offset to local __ptr { ptr, u64 } -sw $$locbase $r1 i34 ; store word +addi $r2 $$locbase i240 ; get offset to local __ptr { ptr, u64 } +sw $$locbase $r1 i30 ; store word movi $r1 i3 ; initialize constant into register -sw $$locbase $r1 i35 ; store word -addi $r1 $$locbase i312 ; get offset to local __ptr slice +sw $$locbase $r1 i31 ; store word +addi $r1 $$locbase i280 ; get offset to local __ptr slice mcpi $r1 $r2 i16 ; copy memory -addi $r2 $$locbase i664 ; get offset to local __ptr string<3> +addi $r2 $$locbase i632 ; get offset to local __ptr string<3> mcpi $r2 $r0 i8 ; copy memory -addi $r3 $$locbase i672 ; get offset to local __ptr slice +addi $r3 $$locbase i640 ; get offset to local __ptr slice mcpi $r3 $r1 i16 ; copy memory -addi $r1 $$locbase i768 ; get offset to local __ptr string<3> +addi $r1 $$locbase i736 ; get offset to local __ptr string<3> mcpi $r1 $r2 i8 ; copy memory -addi $r2 $$locbase i216 ; get offset to local __ptr slice +addi $r2 $$locbase i712 ; get offset to local __ptr { ptr, u64 } mcpi $r2 $r3 i16 ; copy memory -addi $r3 $$locbase i744 ; get offset to local __ptr { ptr, u64 } -mcpi $r3 $r2 i16 ; copy memory -lw $r2 $$locbase i93 ; load word +lw $r2 $$locbase i89 ; load word movi $r3 i3 ; initialize constant into register meq $r1 $r1 $r2 $r3 ; meq r a b len eq $r1 $r1 $zero jnzf $r1 $zero i18 addi $r0 $r0 i8 ; get offset to aggregate element -addi $r1 $$locbase i376 ; get offset to local __ptr { u64, ( u64 | u64 ) } +addi $r1 $$locbase i344 ; get offset to local __ptr { u64, ( u64 | u64 ) } mcpi $r1 $r0 i16 ; copy memory -lw $r0 $$locbase i47 ; load word +lw $r0 $$locbase i43 ; load word eq $r0 $r0 $one jnzf $r0 $zero i2 movi $r0 i2 ; initialize constant into register @@ -1353,8 +1343,8 @@ lw $r0 $r1 i1 ; load word eq $r0 $r0 $one eq $r0 $r0 $zero jnzf $r0 $zero i4 -addi $r0 $$locbase i488 ; get offset to local __ptr { u64 } -sw $$locbase $one i61 ; store word +addi $r0 $$locbase i456 ; get offset to local __ptr { u64 } +sw $$locbase $one i57 ; store word mcpi $r5 $r0 i8 ; copy memory jmpf $zero i119 load $r0 data_NonConfigurable_3; load constant from data section @@ -1367,19 +1357,19 @@ load $r0 data_NonConfigurable_3; load constant from data section rvrt $r0 muli $r0 $r11 i24 ; get offset to array element add $r0 $r13 $r0 ; add array element offset to array base -addi $r1 $$locbase i1200 ; get offset to local __ptr { { string<3> }, { u64, ( u64 | u64 ) } } +addi $r1 $$locbase i1168 ; get offset to local __ptr { { string<3> }, { u64, ( u64 | u64 ) } } mcpi $r1 $r0 i24 ; copy memory -addi $r0 $$locbase i824 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i792 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r12 i24 ; copy memory -addi $r2 $$locbase i1184 ; get offset to local __ptr { string<3> } +addi $r2 $$locbase i1152 ; get offset to local __ptr { string<3> } mcpi $r2 $r1 i8 ; copy memory -addi $r3 $$locbase i848 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r3 $$locbase i816 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r3 $r0 i24 ; copy memory -addi $r0 $$locbase i1192 ; get offset to local __ptr string<3> +addi $r0 $$locbase i1160 ; get offset to local __ptr string<3> mcpi $r0 $r2 i8 ; copy memory -addi $r2 $$locbase i872 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i840 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r2 $r3 i24 ; copy memory -addi $r3 $$locbase i520 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r3 $$locbase i488 ; get offset to local __ptr { { ptr, u64, u64 } } addi $r7 $$locbase i24 ; get offset to local __ptr { ptr, u64, u64 } mcpi $r7 $r2 i24 ; copy memory addi $r2 $$locbase i152 ; get offset to local __ptr { ptr, u64, u64 } @@ -1396,29 +1386,29 @@ addi $r10 $r9 i3 aloc $r10 mcp $hp $r2 $r7 move $r2 $hp ; move parameter from branch to block argument -addi $r9 $$locbase i248 ; get offset to local __ptr string<3> +addi $r9 $$locbase i216 ; get offset to local __ptr string<3> mcpi $r9 $r0 i8 ; copy memory add $r0 $r2 $r7 mcpi $r0 $r9 i3 ; copy memory -addi $r0 $$locbase i288 ; get offset to local __ptr { ptr, u64, u64 } -sw $$locbase $r2 i36 ; store word -sw $$locbase $r10 i37 ; store word -sw $$locbase $r8 i38 ; store word +addi $r0 $$locbase i256 ; get offset to local __ptr { ptr, u64, u64 } +sw $$locbase $r2 i32 ; store word +sw $$locbase $r10 i33 ; store word +sw $$locbase $r8 i34 ; store word addi $r2 $$locbase i48 ; get offset to local __ptr { ptr, u64, u64 } mcpi $r2 $r0 i24 ; copy memory mcpi $r3 $r2 i24 ; copy memory -addi $r0 $$locbase i968 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i936 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r3 i24 ; copy memory -addi $r2 $$locbase i944 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i912 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r2 $r0 i24 ; copy memory addi $r0 $r1 i8 ; get offset to aggregate element -addi $r1 $$locbase i1224 ; get offset to local __ptr { u64, ( u64 | u64 ) } +addi $r1 $$locbase i1192 ; get offset to local __ptr { u64, ( u64 | u64 ) } mcpi $r1 $r0 i16 ; copy memory -addi $r0 $$locbase i896 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i864 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r2 i24 ; copy memory -addi $r2 $$locbase i360 ; get offset to local __ptr { u64, ( u64 | u64 ) } +addi $r2 $$locbase i328 ; get offset to local __ptr { u64, ( u64 | u64 ) } mcpi $r2 $r1 i16 ; copy memory -lw $r1 $$locbase i45 ; load word +lw $r1 $$locbase i41 ; load word eq $r1 $r1 $zero jnzf $r1 $zero i27 lw $r1 $r2 i0 ; load word @@ -1427,56 +1417,56 @@ jnzf $r1 $zero i2 load $r0 data_NonConfigurable_4; load constant from data section rvrt $r0 lw $r1 $r2 i1 ; load word -addi $r2 $$locbase i592 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i560 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r2 $r0 i24 ; copy memory -addi $r0 $$locbase i440 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i408 ; get offset to local __ptr { { ptr, u64, u64 } } movi $$arg0 i1 ; [call: abi_encode_51]: pass argument 0 move $$arg1 $r2 ; [call: abi_encode_51]: pass argument 1 move $$arg2 $r0 ; [call: abi_encode_51]: pass argument 2 jal $$reta $pc i48 ; [call: abi_encode_51]: call function -addi $r2 $$locbase i1064 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i1032 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r2 $r0 i24 ; copy memory -addi $r0 $$locbase i616 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i584 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r2 i24 ; copy memory -addi $r2 $$locbase i464 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i432 ; get offset to local __ptr { { ptr, u64, u64 } } move $$arg0 $r1 ; [call: abi_encode_51]: pass argument 0 move $$arg1 $r0 ; [call: abi_encode_51]: pass argument 1 move $$arg2 $r2 ; [call: abi_encode_51]: pass argument 2 jal $$reta $pc i39 ; [call: abi_encode_51]: call function -addi $r0 $$locbase i1088 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i1056 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r2 i24 ; copy memory -addi $r1 $$locbase i688 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r1 $$locbase i656 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r1 $r0 i24 ; copy memory jmpf $zero i21 lw $r1 $r2 i1 ; load word -addi $r2 $$locbase i544 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i512 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r2 $r0 i24 ; copy memory -addi $r0 $$locbase i392 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i360 ; get offset to local __ptr { { ptr, u64, u64 } } movi $$arg0 i0 ; [call: abi_encode_51]: pass argument 0 move $$arg1 $r2 ; [call: abi_encode_51]: pass argument 1 move $$arg2 $r0 ; [call: abi_encode_51]: pass argument 2 jal $$reta $pc i26 ; [call: abi_encode_51]: call function -addi $r2 $$locbase i992 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i960 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r2 $r0 i24 ; copy memory -addi $r0 $$locbase i568 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i536 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r2 i24 ; copy memory -addi $r2 $$locbase i416 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r2 $$locbase i384 ; get offset to local __ptr { { ptr, u64, u64 } } move $$arg0 $r1 ; [call: abi_encode_51]: pass argument 0 move $$arg1 $r0 ; [call: abi_encode_51]: pass argument 1 move $$arg2 $r2 ; [call: abi_encode_51]: pass argument 2 jal $$reta $pc i17 ; [call: abi_encode_51]: call function -addi $r0 $$locbase i1040 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i1008 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r2 i24 ; copy memory -addi $r1 $$locbase i688 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r1 $$locbase i656 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r1 $r0 i24 ; copy memory -addi $r0 $$locbase i1112 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r0 $$locbase i1080 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r0 $r1 i24 ; copy memory -addi $r1 $$locbase i1016 ; get offset to local __ptr { { ptr, u64, u64 } } +addi $r1 $$locbase i984 ; get offset to local __ptr { { ptr, u64, u64 } } mcpi $r1 $r0 i24 ; copy memory mcpi $r12 $r1 i24 ; copy memory addi $r11 $r11 i1 -jmpb $zero i216 -cfsi i1312 ; [fn end: main_32] free: locals 1312 byte(s), call args 0 slot(s) +jmpb $zero i212 +cfsi i1280 ; [fn end: main_32] free: locals 1280 byte(s), call args 0 slot(s) move $$reta $r4 ; [fn end: main_32] restore return address poph i532479 ; [fn end: main_32]: restore used high registers 40..64 popl i8388608 ; [fn end: main_32]: restore used low registers 16..40 @@ -1527,7 +1517,7 @@ data_NonConfigurable_4 .word 14757395258967588866 0x00000000 MOVE R60 $pc ;; [26, 240, 48, 0] 0x00000004 JMPF $zero 0x4 ;; [116, 0, 0, 4] -0x00000008 ;; [0, 0, 0, 0, 0, 0, 6, 8] +0x00000008 ;; [0, 0, 0, 0, 0, 0, 5, 248] 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] @@ -1630,12 +1620,12 @@ data_NonConfigurable_4 .word 14757395258967588866 0x000001a0 PSHL 0x800000 ;; [149, 128, 0, 0] 0x000001a4 PSHH 0x81fff ;; [150, 8, 31, 255] 0x000001a8 MOVE R59 $sp ;; [26, 236, 80, 0] -0x000001ac CFEI 0x520 ;; [145, 0, 5, 32] +0x000001ac CFEI 0x500 ;; [145, 0, 5, 0] 0x000001b0 MOVE R47 R57 ;; [26, 191, 144, 0] 0x000001b4 MOVE R48 R62 ;; [26, 195, 224, 0] -0x000001b8 ADDI R46 R59 0x470 ;; [80, 187, 180, 112] +0x000001b8 ADDI R46 R59 0x450 ;; [80, 187, 180, 80] 0x000001bc MCPI R46 R58 0x30 ;; [96, 187, 160, 48] -0x000001c0 ADDI R52 R59 0x1f0 ;; [80, 211, 177, 240] +0x000001c0 ADDI R52 R59 0x1d0 ;; [80, 211, 177, 208] 0x000001c4 MOVI R51 0x400 ;; [114, 204, 4, 0] 0x000001c8 ALOC R51 ;; [38, 204, 0, 0] 0x000001cc ADDI R51 R59 0x80 ;; [80, 207, 176, 128] @@ -1645,276 +1635,272 @@ data_NonConfigurable_4 .word 14757395258967588866 0x000001dc SW R59 $zero 0x12 ;; [95, 236, 0, 18] 0x000001e0 MCPI R59 R51 0x18 ;; [96, 239, 48, 24] 0x000001e4 MCPI R52 R59 0x18 ;; [96, 211, 176, 24] -0x000001e8 ADDI R39 R59 0x4d8 ;; [80, 159, 180, 216] +0x000001e8 ADDI R39 R59 0x4b8 ;; [80, 159, 180, 184] 0x000001ec MCPI R39 R46 0x30 ;; [96, 158, 224, 48] -0x000001f0 ADDI R51 R59 0x320 ;; [80, 207, 179, 32] +0x000001f0 ADDI R51 R59 0x300 ;; [80, 207, 179, 0] 0x000001f4 MCPI R51 R52 0x18 ;; [96, 207, 64, 24] -0x000001f8 ADDI R40 R59 0x398 ;; [80, 163, 179, 152] +0x000001f8 ADDI R40 R59 0x378 ;; [80, 163, 179, 120] 0x000001fc MCPI R40 R51 0x18 ;; [96, 163, 48, 24] 0x00000200 MOVI R41 0x0 ;; [114, 164, 0, 0] 0x00000204 MOVI R52 0x2 ;; [114, 208, 0, 2] 0x00000208 LT R52 R41 R52 ;; [22, 210, 157, 0] -0x0000020c JNZF R52 $zero 0x68 ;; [118, 208, 0, 104] -0x00000210 ADDI R52 R59 0x308 ;; [80, 211, 179, 8] +0x0000020c JNZF R52 $zero 0x64 ;; [118, 208, 0, 100] +0x00000210 ADDI R52 R59 0x2e8 ;; [80, 211, 178, 232] 0x00000214 MCPI R52 R40 0x18 ;; [96, 210, 128, 24] -0x00000218 ADDI R51 R59 0x508 ;; [80, 207, 181, 8] +0x00000218 ADDI R51 R59 0x4e8 ;; [80, 207, 180, 232] 0x0000021c MCPI R51 R52 0x18 ;; [96, 207, 64, 24] 0x00000220 ADDI R52 R59 0x48 ;; [80, 211, 176, 72] 0x00000224 MCPI R52 R51 0x18 ;; [96, 211, 48, 24] 0x00000228 ADDI R51 R59 0xb0 ;; [80, 207, 176, 176] 0x0000022c MCPI R51 R52 0x18 ;; [96, 207, 64, 24] 0x00000230 ADDI R50 R51 0x10 ;; [80, 203, 48, 16] -0x00000234 ADDI R49 R59 0x100 ;; [80, 199, 177, 0] +0x00000234 ADDI R49 R59 0xe0 ;; [80, 199, 176, 224] 0x00000238 MCPI R49 R51 0x8 ;; [96, 199, 48, 8] 0x0000023c ADDI R52 R49 0x8 ;; [80, 211, 16, 8] 0x00000240 MCPI R52 R50 0x8 ;; [96, 211, 32, 8] 0x00000244 ADDI R52 R59 0x60 ;; [80, 211, 176, 96] 0x00000248 MCPI R52 R49 0x10 ;; [96, 211, 16, 16] -0x0000024c ADDI R51 R59 0x2c8 ;; [80, 207, 178, 200] +0x0000024c ADDI R51 R59 0x2a8 ;; [80, 207, 178, 168] 0x00000250 MCPI R51 R52 0x10 ;; [96, 207, 64, 16] -0x00000254 ADDI R52 R59 0x148 ;; [80, 211, 177, 72] +0x00000254 ADDI R52 R59 0x128 ;; [80, 211, 177, 40] 0x00000258 MCPI R52 R51 0x10 ;; [96, 211, 48, 16] 0x0000025c LW R52 R63 0x0 ;; [93, 211, 240, 0] -0x00000260 LW R51 R59 0x29 ;; [93, 207, 176, 41] -0x00000264 LW R50 R59 0x2a ;; [93, 203, 176, 42] +0x00000260 LW R51 R59 0x25 ;; [93, 207, 176, 37] +0x00000264 LW R50 R59 0x26 ;; [93, 203, 176, 38] 0x00000268 LOGD $zero R52 R51 R50 ;; [52, 3, 76, 242] 0x0000026c ADDI R52 R63 0x8 ;; [80, 211, 240, 8] 0x00000270 ADDI R51 R59 0x70 ;; [80, 207, 176, 112] 0x00000274 SW R59 R52 0xe ;; [95, 239, 64, 14] 0x00000278 MOVI R52 0x3 ;; [114, 208, 0, 3] 0x0000027c SW R59 R52 0xf ;; [95, 239, 64, 15] -0x00000280 ADDI R52 R59 0xe8 ;; [80, 211, 176, 232] +0x00000280 ADDI R52 R59 0xc8 ;; [80, 211, 176, 200] 0x00000284 MCPI R52 R51 0x10 ;; [96, 211, 48, 16] -0x00000288 ADDI R51 R59 0x280 ;; [80, 207, 178, 128] +0x00000288 ADDI R51 R59 0x260 ;; [80, 207, 178, 96] 0x0000028c MCPI R51 R46 0x8 ;; [96, 206, 224, 8] -0x00000290 ADDI R50 R59 0x288 ;; [80, 203, 178, 136] +0x00000290 ADDI R50 R59 0x268 ;; [80, 203, 178, 104] 0x00000294 MCPI R50 R52 0x10 ;; [96, 203, 64, 16] -0x00000298 ADDI R52 R59 0x2f8 ;; [80, 211, 178, 248] +0x00000298 ADDI R52 R59 0x2d8 ;; [80, 211, 178, 216] 0x0000029c MCPI R52 R51 0x8 ;; [96, 211, 48, 8] -0x000002a0 ADDI R51 R59 0xc8 ;; [80, 207, 176, 200] +0x000002a0 ADDI R51 R59 0x2b8 ;; [80, 207, 178, 184] 0x000002a4 MCPI R51 R50 0x10 ;; [96, 207, 32, 16] -0x000002a8 ADDI R50 R59 0x2d8 ;; [80, 203, 178, 216] -0x000002ac MCPI R50 R51 0x10 ;; [96, 203, 48, 16] -0x000002b0 LW R51 R59 0x5b ;; [93, 207, 176, 91] -0x000002b4 MOVI R50 0x3 ;; [114, 200, 0, 3] -0x000002b8 MEQ R52 R52 R51 R50 ;; [41, 211, 76, 242] -0x000002bc EQ R52 R52 $zero ;; [19, 211, 64, 0] -0x000002c0 JNZF R52 $zero 0x39 ;; [118, 208, 0, 57] -0x000002c4 ADDI R52 R46 0x8 ;; [80, 210, 224, 8] -0x000002c8 ADDI R51 R59 0x158 ;; [80, 207, 177, 88] -0x000002cc MCPI R51 R52 0x10 ;; [96, 207, 64, 16] -0x000002d0 LW R52 R59 0x2b ;; [93, 211, 176, 43] -0x000002d4 EQ R52 R52 $zero ;; [19, 211, 64, 0] -0x000002d8 JNZF R52 $zero 0x1 ;; [118, 208, 0, 1] -0x000002dc RVRT $one ;; [54, 4, 0, 0] -0x000002e0 LW R52 R51 0x1 ;; [93, 211, 48, 1] -0x000002e4 MOVI R51 0x53a ;; [114, 204, 5, 58] -0x000002e8 EQ R52 R52 R51 ;; [19, 211, 76, 192] -0x000002ec EQ R52 R52 $zero ;; [19, 211, 64, 0] -0x000002f0 JNZF R52 $zero 0x2b ;; [118, 208, 0, 43] -0x000002f4 ADDI R52 R46 0x18 ;; [80, 210, 224, 24] -0x000002f8 ADDI R51 R63 0x10 ;; [80, 207, 240, 16] -0x000002fc ADDI R50 R59 0x110 ;; [80, 203, 177, 16] -0x00000300 SW R59 R51 0x22 ;; [95, 239, 48, 34] -0x00000304 MOVI R51 0x3 ;; [114, 204, 0, 3] -0x00000308 SW R59 R51 0x23 ;; [95, 239, 48, 35] -0x0000030c ADDI R51 R59 0x138 ;; [80, 207, 177, 56] -0x00000310 MCPI R51 R50 0x10 ;; [96, 207, 32, 16] -0x00000314 ADDI R50 R59 0x298 ;; [80, 203, 178, 152] -0x00000318 MCPI R50 R52 0x8 ;; [96, 203, 64, 8] -0x0000031c ADDI R49 R59 0x2a0 ;; [80, 199, 178, 160] -0x00000320 MCPI R49 R51 0x10 ;; [96, 199, 48, 16] -0x00000324 ADDI R51 R59 0x300 ;; [80, 207, 179, 0] -0x00000328 MCPI R51 R50 0x8 ;; [96, 207, 32, 8] -0x0000032c ADDI R50 R59 0xd8 ;; [80, 203, 176, 216] -0x00000330 MCPI R50 R49 0x10 ;; [96, 203, 16, 16] -0x00000334 ADDI R49 R59 0x2e8 ;; [80, 199, 178, 232] -0x00000338 MCPI R49 R50 0x10 ;; [96, 199, 32, 16] -0x0000033c LW R50 R59 0x5d ;; [93, 203, 176, 93] -0x00000340 MOVI R49 0x3 ;; [114, 196, 0, 3] -0x00000344 MEQ R51 R51 R50 R49 ;; [41, 207, 60, 177] -0x00000348 EQ R51 R51 $zero ;; [19, 207, 48, 0] -0x0000034c JNZF R51 $zero 0x12 ;; [118, 204, 0, 18] -0x00000350 ADDI R52 R52 0x8 ;; [80, 211, 64, 8] -0x00000354 ADDI R51 R59 0x178 ;; [80, 207, 177, 120] -0x00000358 MCPI R51 R52 0x10 ;; [96, 207, 64, 16] -0x0000035c LW R52 R59 0x2f ;; [93, 211, 176, 47] -0x00000360 EQ R52 R52 $one ;; [19, 211, 64, 64] -0x00000364 JNZF R52 $zero 0x2 ;; [118, 208, 0, 2] -0x00000368 MOVI R52 0x2 ;; [114, 208, 0, 2] -0x0000036c RVRT R52 ;; [54, 208, 0, 0] -0x00000370 LW R52 R51 0x1 ;; [93, 211, 48, 1] -0x00000374 EQ R52 R52 $one ;; [19, 211, 64, 64] -0x00000378 EQ R52 R52 $zero ;; [19, 211, 64, 0] -0x0000037c JNZF R52 $zero 0x4 ;; [118, 208, 0, 4] -0x00000380 ADDI R52 R59 0x1e8 ;; [80, 211, 177, 232] -0x00000384 SW R59 $one 0x3d ;; [95, 236, 16, 61] -0x00000388 MCPI R47 R52 0x8 ;; [96, 191, 64, 8] -0x0000038c JMPF $zero 0x77 ;; [116, 0, 0, 119] +0x000002a8 LW R51 R59 0x57 ;; [93, 207, 176, 87] +0x000002ac MOVI R50 0x3 ;; [114, 200, 0, 3] +0x000002b0 MEQ R52 R52 R51 R50 ;; [41, 211, 76, 242] +0x000002b4 EQ R52 R52 $zero ;; [19, 211, 64, 0] +0x000002b8 JNZF R52 $zero 0x37 ;; [118, 208, 0, 55] +0x000002bc ADDI R52 R46 0x8 ;; [80, 210, 224, 8] +0x000002c0 ADDI R51 R59 0x138 ;; [80, 207, 177, 56] +0x000002c4 MCPI R51 R52 0x10 ;; [96, 207, 64, 16] +0x000002c8 LW R52 R59 0x27 ;; [93, 211, 176, 39] +0x000002cc EQ R52 R52 $zero ;; [19, 211, 64, 0] +0x000002d0 JNZF R52 $zero 0x1 ;; [118, 208, 0, 1] +0x000002d4 RVRT $one ;; [54, 4, 0, 0] +0x000002d8 LW R52 R51 0x1 ;; [93, 211, 48, 1] +0x000002dc MOVI R51 0x53a ;; [114, 204, 5, 58] +0x000002e0 EQ R52 R52 R51 ;; [19, 211, 76, 192] +0x000002e4 EQ R52 R52 $zero ;; [19, 211, 64, 0] +0x000002e8 JNZF R52 $zero 0x29 ;; [118, 208, 0, 41] +0x000002ec ADDI R52 R46 0x18 ;; [80, 210, 224, 24] +0x000002f0 ADDI R51 R63 0x10 ;; [80, 207, 240, 16] +0x000002f4 ADDI R50 R59 0xf0 ;; [80, 203, 176, 240] +0x000002f8 SW R59 R51 0x1e ;; [95, 239, 48, 30] +0x000002fc MOVI R51 0x3 ;; [114, 204, 0, 3] +0x00000300 SW R59 R51 0x1f ;; [95, 239, 48, 31] +0x00000304 ADDI R51 R59 0x118 ;; [80, 207, 177, 24] +0x00000308 MCPI R51 R50 0x10 ;; [96, 207, 32, 16] +0x0000030c ADDI R50 R59 0x278 ;; [80, 203, 178, 120] +0x00000310 MCPI R50 R52 0x8 ;; [96, 203, 64, 8] +0x00000314 ADDI R49 R59 0x280 ;; [80, 199, 178, 128] +0x00000318 MCPI R49 R51 0x10 ;; [96, 199, 48, 16] +0x0000031c ADDI R51 R59 0x2e0 ;; [80, 207, 178, 224] +0x00000320 MCPI R51 R50 0x8 ;; [96, 207, 32, 8] +0x00000324 ADDI R50 R59 0x2c8 ;; [80, 203, 178, 200] +0x00000328 MCPI R50 R49 0x10 ;; [96, 203, 16, 16] +0x0000032c LW R50 R59 0x59 ;; [93, 203, 176, 89] +0x00000330 MOVI R49 0x3 ;; [114, 196, 0, 3] +0x00000334 MEQ R51 R51 R50 R49 ;; [41, 207, 60, 177] +0x00000338 EQ R51 R51 $zero ;; [19, 207, 48, 0] +0x0000033c JNZF R51 $zero 0x12 ;; [118, 204, 0, 18] +0x00000340 ADDI R52 R52 0x8 ;; [80, 211, 64, 8] +0x00000344 ADDI R51 R59 0x158 ;; [80, 207, 177, 88] +0x00000348 MCPI R51 R52 0x10 ;; [96, 207, 64, 16] +0x0000034c LW R52 R59 0x2b ;; [93, 211, 176, 43] +0x00000350 EQ R52 R52 $one ;; [19, 211, 64, 64] +0x00000354 JNZF R52 $zero 0x2 ;; [118, 208, 0, 2] +0x00000358 MOVI R52 0x2 ;; [114, 208, 0, 2] +0x0000035c RVRT R52 ;; [54, 208, 0, 0] +0x00000360 LW R52 R51 0x1 ;; [93, 211, 48, 1] +0x00000364 EQ R52 R52 $one ;; [19, 211, 64, 64] +0x00000368 EQ R52 R52 $zero ;; [19, 211, 64, 0] +0x0000036c JNZF R52 $zero 0x4 ;; [118, 208, 0, 4] +0x00000370 ADDI R52 R59 0x1c8 ;; [80, 211, 177, 200] +0x00000374 SW R59 $one 0x39 ;; [95, 236, 16, 57] +0x00000378 MCPI R47 R52 0x8 ;; [96, 191, 64, 8] +0x0000037c JMPF $zero 0x77 ;; [116, 0, 0, 119] +0x00000380 LW R52 R63 0x3 ;; [93, 211, 240, 3] +0x00000384 RVRT R52 ;; [54, 208, 0, 0] +0x00000388 LW R52 R63 0x3 ;; [93, 211, 240, 3] +0x0000038c RVRT R52 ;; [54, 208, 0, 0] 0x00000390 LW R52 R63 0x3 ;; [93, 211, 240, 3] 0x00000394 RVRT R52 ;; [54, 208, 0, 0] 0x00000398 LW R52 R63 0x3 ;; [93, 211, 240, 3] 0x0000039c RVRT R52 ;; [54, 208, 0, 0] -0x000003a0 LW R52 R63 0x3 ;; [93, 211, 240, 3] -0x000003a4 RVRT R52 ;; [54, 208, 0, 0] -0x000003a8 LW R52 R63 0x3 ;; [93, 211, 240, 3] -0x000003ac RVRT R52 ;; [54, 208, 0, 0] -0x000003b0 MULI R52 R41 0x18 ;; [85, 210, 144, 24] -0x000003b4 ADD R52 R39 R52 ;; [16, 210, 125, 0] -0x000003b8 ADDI R51 R59 0x4b0 ;; [80, 207, 180, 176] -0x000003bc MCPI R51 R52 0x18 ;; [96, 207, 64, 24] -0x000003c0 ADDI R52 R59 0x338 ;; [80, 211, 179, 56] -0x000003c4 MCPI R52 R40 0x18 ;; [96, 210, 128, 24] -0x000003c8 ADDI R50 R59 0x4a0 ;; [80, 203, 180, 160] -0x000003cc MCPI R50 R51 0x8 ;; [96, 203, 48, 8] -0x000003d0 ADDI R49 R59 0x350 ;; [80, 199, 179, 80] -0x000003d4 MCPI R49 R52 0x18 ;; [96, 199, 64, 24] -0x000003d8 ADDI R52 R59 0x4a8 ;; [80, 211, 180, 168] -0x000003dc MCPI R52 R50 0x8 ;; [96, 211, 32, 8] -0x000003e0 ADDI R50 R59 0x368 ;; [80, 203, 179, 104] -0x000003e4 MCPI R50 R49 0x18 ;; [96, 203, 16, 24] -0x000003e8 ADDI R49 R59 0x208 ;; [80, 199, 178, 8] -0x000003ec ADDI R45 R59 0x18 ;; [80, 183, 176, 24] -0x000003f0 MCPI R45 R50 0x18 ;; [96, 183, 32, 24] -0x000003f4 ADDI R50 R59 0x98 ;; [80, 203, 176, 152] -0x000003f8 MCPI R50 R45 0x18 ;; [96, 202, 208, 24] -0x000003fc LW R50 R59 0x13 ;; [93, 203, 176, 19] -0x00000400 LW R42 R59 0x14 ;; [93, 171, 176, 20] -0x00000404 LW R45 R59 0x15 ;; [93, 183, 176, 21] -0x00000408 ADDI R44 R45 0x3 ;; [80, 178, 208, 3] -0x0000040c GT R43 R44 R42 ;; [21, 174, 202, 128] -0x00000410 JNZF R43 $zero 0x1 ;; [118, 172, 0, 1] -0x00000414 JMPF $zero 0x5 ;; [116, 0, 0, 5] -0x00000418 MULI R43 R42 0x2 ;; [85, 174, 160, 2] -0x0000041c ADDI R42 R43 0x3 ;; [80, 170, 176, 3] -0x00000420 ALOC R42 ;; [38, 168, 0, 0] -0x00000424 MCP $hp R50 R45 ;; [40, 31, 43, 64] -0x00000428 MOVE R50 $hp ;; [26, 200, 112, 0] -0x0000042c ADDI R43 R59 0xf8 ;; [80, 175, 176, 248] -0x00000430 MCPI R43 R52 0x8 ;; [96, 175, 64, 8] -0x00000434 ADD R52 R50 R45 ;; [16, 211, 43, 64] -0x00000438 MCPI R52 R43 0x3 ;; [96, 210, 176, 3] -0x0000043c ADDI R52 R59 0x120 ;; [80, 211, 177, 32] -0x00000440 SW R59 R50 0x24 ;; [95, 239, 32, 36] -0x00000444 SW R59 R42 0x25 ;; [95, 238, 160, 37] -0x00000448 SW R59 R44 0x26 ;; [95, 238, 192, 38] -0x0000044c ADDI R50 R59 0x30 ;; [80, 203, 176, 48] -0x00000450 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] -0x00000454 MCPI R49 R50 0x18 ;; [96, 199, 32, 24] -0x00000458 ADDI R52 R59 0x3c8 ;; [80, 211, 179, 200] -0x0000045c MCPI R52 R49 0x18 ;; [96, 211, 16, 24] -0x00000460 ADDI R50 R59 0x3b0 ;; [80, 203, 179, 176] -0x00000464 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] -0x00000468 ADDI R52 R51 0x8 ;; [80, 211, 48, 8] -0x0000046c ADDI R51 R59 0x4c8 ;; [80, 207, 180, 200] -0x00000470 MCPI R51 R52 0x10 ;; [96, 207, 64, 16] -0x00000474 ADDI R52 R59 0x380 ;; [80, 211, 179, 128] -0x00000478 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] -0x0000047c ADDI R50 R59 0x168 ;; [80, 203, 177, 104] -0x00000480 MCPI R50 R51 0x10 ;; [96, 203, 48, 16] -0x00000484 LW R51 R59 0x2d ;; [93, 207, 176, 45] -0x00000488 EQ R51 R51 $zero ;; [19, 207, 48, 0] -0x0000048c JNZF R51 $zero 0x1b ;; [118, 204, 0, 27] -0x00000490 LW R51 R50 0x0 ;; [93, 207, 32, 0] -0x00000494 EQ R51 R51 $one ;; [19, 207, 48, 64] -0x00000498 JNZF R51 $zero 0x2 ;; [118, 204, 0, 2] -0x0000049c LW R52 R63 0x4 ;; [93, 211, 240, 4] -0x000004a0 RVRT R52 ;; [54, 208, 0, 0] -0x000004a4 LW R51 R50 0x1 ;; [93, 207, 32, 1] -0x000004a8 ADDI R50 R59 0x250 ;; [80, 203, 178, 80] -0x000004ac MCPI R50 R52 0x18 ;; [96, 203, 64, 24] -0x000004b0 ADDI R52 R59 0x1b8 ;; [80, 211, 177, 184] -0x000004b4 MOVI R58 0x1 ;; [114, 232, 0, 1] -0x000004b8 MOVE R57 R50 ;; [26, 231, 32, 0] -0x000004bc MOVE R56 R52 ;; [26, 227, 64, 0] -0x000004c0 JAL R62 $pc 0x30 ;; [153, 248, 48, 48] -0x000004c4 ADDI R50 R59 0x428 ;; [80, 203, 180, 40] -0x000004c8 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] -0x000004cc ADDI R52 R59 0x268 ;; [80, 211, 178, 104] -0x000004d0 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] -0x000004d4 ADDI R50 R59 0x1d0 ;; [80, 203, 177, 208] -0x000004d8 MOVE R58 R51 ;; [26, 235, 48, 0] -0x000004dc MOVE R57 R52 ;; [26, 231, 64, 0] -0x000004e0 MOVE R56 R50 ;; [26, 227, 32, 0] -0x000004e4 JAL R62 $pc 0x27 ;; [153, 248, 48, 39] -0x000004e8 ADDI R52 R59 0x440 ;; [80, 211, 180, 64] -0x000004ec MCPI R52 R50 0x18 ;; [96, 211, 32, 24] -0x000004f0 ADDI R51 R59 0x2b0 ;; [80, 207, 178, 176] -0x000004f4 MCPI R51 R52 0x18 ;; [96, 207, 64, 24] -0x000004f8 JMPF $zero 0x15 ;; [116, 0, 0, 21] -0x000004fc LW R51 R50 0x1 ;; [93, 207, 32, 1] -0x00000500 ADDI R50 R59 0x220 ;; [80, 203, 178, 32] -0x00000504 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] -0x00000508 ADDI R52 R59 0x188 ;; [80, 211, 177, 136] -0x0000050c MOVI R58 0x0 ;; [114, 232, 0, 0] -0x00000510 MOVE R57 R50 ;; [26, 231, 32, 0] -0x00000514 MOVE R56 R52 ;; [26, 227, 64, 0] -0x00000518 JAL R62 $pc 0x1a ;; [153, 248, 48, 26] -0x0000051c ADDI R50 R59 0x3e0 ;; [80, 203, 179, 224] -0x00000520 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] -0x00000524 ADDI R52 R59 0x238 ;; [80, 211, 178, 56] -0x00000528 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] -0x0000052c ADDI R50 R59 0x1a0 ;; [80, 203, 177, 160] -0x00000530 MOVE R58 R51 ;; [26, 235, 48, 0] -0x00000534 MOVE R57 R52 ;; [26, 231, 64, 0] -0x00000538 MOVE R56 R50 ;; [26, 227, 32, 0] -0x0000053c JAL R62 $pc 0x11 ;; [153, 248, 48, 17] -0x00000540 ADDI R52 R59 0x410 ;; [80, 211, 180, 16] -0x00000544 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] -0x00000548 ADDI R51 R59 0x2b0 ;; [80, 207, 178, 176] +0x000003a0 MULI R52 R41 0x18 ;; [85, 210, 144, 24] +0x000003a4 ADD R52 R39 R52 ;; [16, 210, 125, 0] +0x000003a8 ADDI R51 R59 0x490 ;; [80, 207, 180, 144] +0x000003ac MCPI R51 R52 0x18 ;; [96, 207, 64, 24] +0x000003b0 ADDI R52 R59 0x318 ;; [80, 211, 179, 24] +0x000003b4 MCPI R52 R40 0x18 ;; [96, 210, 128, 24] +0x000003b8 ADDI R50 R59 0x480 ;; [80, 203, 180, 128] +0x000003bc MCPI R50 R51 0x8 ;; [96, 203, 48, 8] +0x000003c0 ADDI R49 R59 0x330 ;; [80, 199, 179, 48] +0x000003c4 MCPI R49 R52 0x18 ;; [96, 199, 64, 24] +0x000003c8 ADDI R52 R59 0x488 ;; [80, 211, 180, 136] +0x000003cc MCPI R52 R50 0x8 ;; [96, 211, 32, 8] +0x000003d0 ADDI R50 R59 0x348 ;; [80, 203, 179, 72] +0x000003d4 MCPI R50 R49 0x18 ;; [96, 203, 16, 24] +0x000003d8 ADDI R49 R59 0x1e8 ;; [80, 199, 177, 232] +0x000003dc ADDI R45 R59 0x18 ;; [80, 183, 176, 24] +0x000003e0 MCPI R45 R50 0x18 ;; [96, 183, 32, 24] +0x000003e4 ADDI R50 R59 0x98 ;; [80, 203, 176, 152] +0x000003e8 MCPI R50 R45 0x18 ;; [96, 202, 208, 24] +0x000003ec LW R50 R59 0x13 ;; [93, 203, 176, 19] +0x000003f0 LW R42 R59 0x14 ;; [93, 171, 176, 20] +0x000003f4 LW R45 R59 0x15 ;; [93, 183, 176, 21] +0x000003f8 ADDI R44 R45 0x3 ;; [80, 178, 208, 3] +0x000003fc GT R43 R44 R42 ;; [21, 174, 202, 128] +0x00000400 JNZF R43 $zero 0x1 ;; [118, 172, 0, 1] +0x00000404 JMPF $zero 0x5 ;; [116, 0, 0, 5] +0x00000408 MULI R43 R42 0x2 ;; [85, 174, 160, 2] +0x0000040c ADDI R42 R43 0x3 ;; [80, 170, 176, 3] +0x00000410 ALOC R42 ;; [38, 168, 0, 0] +0x00000414 MCP $hp R50 R45 ;; [40, 31, 43, 64] +0x00000418 MOVE R50 $hp ;; [26, 200, 112, 0] +0x0000041c ADDI R43 R59 0xd8 ;; [80, 175, 176, 216] +0x00000420 MCPI R43 R52 0x8 ;; [96, 175, 64, 8] +0x00000424 ADD R52 R50 R45 ;; [16, 211, 43, 64] +0x00000428 MCPI R52 R43 0x3 ;; [96, 210, 176, 3] +0x0000042c ADDI R52 R59 0x100 ;; [80, 211, 177, 0] +0x00000430 SW R59 R50 0x20 ;; [95, 239, 32, 32] +0x00000434 SW R59 R42 0x21 ;; [95, 238, 160, 33] +0x00000438 SW R59 R44 0x22 ;; [95, 238, 192, 34] +0x0000043c ADDI R50 R59 0x30 ;; [80, 203, 176, 48] +0x00000440 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] +0x00000444 MCPI R49 R50 0x18 ;; [96, 199, 32, 24] +0x00000448 ADDI R52 R59 0x3a8 ;; [80, 211, 179, 168] +0x0000044c MCPI R52 R49 0x18 ;; [96, 211, 16, 24] +0x00000450 ADDI R50 R59 0x390 ;; [80, 203, 179, 144] +0x00000454 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] +0x00000458 ADDI R52 R51 0x8 ;; [80, 211, 48, 8] +0x0000045c ADDI R51 R59 0x4a8 ;; [80, 207, 180, 168] +0x00000460 MCPI R51 R52 0x10 ;; [96, 207, 64, 16] +0x00000464 ADDI R52 R59 0x360 ;; [80, 211, 179, 96] +0x00000468 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] +0x0000046c ADDI R50 R59 0x148 ;; [80, 203, 177, 72] +0x00000470 MCPI R50 R51 0x10 ;; [96, 203, 48, 16] +0x00000474 LW R51 R59 0x29 ;; [93, 207, 176, 41] +0x00000478 EQ R51 R51 $zero ;; [19, 207, 48, 0] +0x0000047c JNZF R51 $zero 0x1b ;; [118, 204, 0, 27] +0x00000480 LW R51 R50 0x0 ;; [93, 207, 32, 0] +0x00000484 EQ R51 R51 $one ;; [19, 207, 48, 64] +0x00000488 JNZF R51 $zero 0x2 ;; [118, 204, 0, 2] +0x0000048c LW R52 R63 0x4 ;; [93, 211, 240, 4] +0x00000490 RVRT R52 ;; [54, 208, 0, 0] +0x00000494 LW R51 R50 0x1 ;; [93, 207, 32, 1] +0x00000498 ADDI R50 R59 0x230 ;; [80, 203, 178, 48] +0x0000049c MCPI R50 R52 0x18 ;; [96, 203, 64, 24] +0x000004a0 ADDI R52 R59 0x198 ;; [80, 211, 177, 152] +0x000004a4 MOVI R58 0x1 ;; [114, 232, 0, 1] +0x000004a8 MOVE R57 R50 ;; [26, 231, 32, 0] +0x000004ac MOVE R56 R52 ;; [26, 227, 64, 0] +0x000004b0 JAL R62 $pc 0x30 ;; [153, 248, 48, 48] +0x000004b4 ADDI R50 R59 0x408 ;; [80, 203, 180, 8] +0x000004b8 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] +0x000004bc ADDI R52 R59 0x248 ;; [80, 211, 178, 72] +0x000004c0 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] +0x000004c4 ADDI R50 R59 0x1b0 ;; [80, 203, 177, 176] +0x000004c8 MOVE R58 R51 ;; [26, 235, 48, 0] +0x000004cc MOVE R57 R52 ;; [26, 231, 64, 0] +0x000004d0 MOVE R56 R50 ;; [26, 227, 32, 0] +0x000004d4 JAL R62 $pc 0x27 ;; [153, 248, 48, 39] +0x000004d8 ADDI R52 R59 0x420 ;; [80, 211, 180, 32] +0x000004dc MCPI R52 R50 0x18 ;; [96, 211, 32, 24] +0x000004e0 ADDI R51 R59 0x290 ;; [80, 207, 178, 144] +0x000004e4 MCPI R51 R52 0x18 ;; [96, 207, 64, 24] +0x000004e8 JMPF $zero 0x15 ;; [116, 0, 0, 21] +0x000004ec LW R51 R50 0x1 ;; [93, 207, 32, 1] +0x000004f0 ADDI R50 R59 0x200 ;; [80, 203, 178, 0] +0x000004f4 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] +0x000004f8 ADDI R52 R59 0x168 ;; [80, 211, 177, 104] +0x000004fc MOVI R58 0x0 ;; [114, 232, 0, 0] +0x00000500 MOVE R57 R50 ;; [26, 231, 32, 0] +0x00000504 MOVE R56 R52 ;; [26, 227, 64, 0] +0x00000508 JAL R62 $pc 0x1a ;; [153, 248, 48, 26] +0x0000050c ADDI R50 R59 0x3c0 ;; [80, 203, 179, 192] +0x00000510 MCPI R50 R52 0x18 ;; [96, 203, 64, 24] +0x00000514 ADDI R52 R59 0x218 ;; [80, 211, 178, 24] +0x00000518 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] +0x0000051c ADDI R50 R59 0x180 ;; [80, 203, 177, 128] +0x00000520 MOVE R58 R51 ;; [26, 235, 48, 0] +0x00000524 MOVE R57 R52 ;; [26, 231, 64, 0] +0x00000528 MOVE R56 R50 ;; [26, 227, 32, 0] +0x0000052c JAL R62 $pc 0x11 ;; [153, 248, 48, 17] +0x00000530 ADDI R52 R59 0x3f0 ;; [80, 211, 179, 240] +0x00000534 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] +0x00000538 ADDI R51 R59 0x290 ;; [80, 207, 178, 144] +0x0000053c MCPI R51 R52 0x18 ;; [96, 207, 64, 24] +0x00000540 ADDI R52 R59 0x438 ;; [80, 211, 180, 56] +0x00000544 MCPI R52 R51 0x18 ;; [96, 211, 48, 24] +0x00000548 ADDI R51 R59 0x3d8 ;; [80, 207, 179, 216] 0x0000054c MCPI R51 R52 0x18 ;; [96, 207, 64, 24] -0x00000550 ADDI R52 R59 0x458 ;; [80, 211, 180, 88] -0x00000554 MCPI R52 R51 0x18 ;; [96, 211, 48, 24] -0x00000558 ADDI R51 R59 0x3f8 ;; [80, 207, 179, 248] -0x0000055c MCPI R51 R52 0x18 ;; [96, 207, 64, 24] -0x00000560 MCPI R40 R51 0x18 ;; [96, 163, 48, 24] -0x00000564 ADDI R41 R41 0x1 ;; [80, 166, 144, 1] -0x00000568 JMPB $zero 0xd8 ;; [117, 0, 0, 216] -0x0000056c CFSI 0x520 ;; [146, 0, 5, 32] -0x00000570 MOVE R62 R48 ;; [26, 251, 0, 0] -0x00000574 POPH 0x81fff ;; [152, 8, 31, 255] -0x00000578 POPL 0x800000 ;; [151, 128, 0, 0] -0x0000057c JAL $zero R62 0x0 ;; [153, 3, 224, 0] -0x00000580 PSHH 0x81f80 ;; [150, 8, 31, 128] -0x00000584 MOVE R59 $sp ;; [26, 236, 80, 0] -0x00000588 CFEI 0x90 ;; [145, 0, 0, 144] -0x0000058c ADDI R52 R59 0x78 ;; [80, 211, 176, 120] -0x00000590 MCPI R52 R57 0x18 ;; [96, 211, 144, 24] -0x00000594 ADDI R51 R59 0x60 ;; [80, 207, 176, 96] -0x00000598 MCPI R59 R52 0x18 ;; [96, 239, 64, 24] -0x0000059c ADDI R52 R59 0x30 ;; [80, 211, 176, 48] -0x000005a0 MCPI R52 R59 0x18 ;; [96, 211, 176, 24] -0x000005a4 LW R52 R59 0x6 ;; [93, 211, 176, 6] -0x000005a8 LW R47 R59 0x7 ;; [93, 191, 176, 7] -0x000005ac LW R50 R59 0x8 ;; [93, 203, 176, 8] -0x000005b0 ADDI R49 R50 0x8 ;; [80, 199, 32, 8] -0x000005b4 GT R48 R49 R47 ;; [21, 195, 27, 192] -0x000005b8 JNZF R48 $zero 0x1 ;; [118, 192, 0, 1] -0x000005bc JMPF $zero 0x5 ;; [116, 0, 0, 5] -0x000005c0 MULI R48 R47 0x2 ;; [85, 194, 240, 2] -0x000005c4 ADDI R47 R48 0x8 ;; [80, 191, 0, 8] -0x000005c8 ALOC R47 ;; [38, 188, 0, 0] -0x000005cc MCP $hp R52 R50 ;; [40, 31, 76, 128] -0x000005d0 MOVE R52 $hp ;; [26, 208, 112, 0] -0x000005d4 ADD R50 R52 R50 ;; [16, 203, 76, 128] -0x000005d8 SW R50 R58 0x0 ;; [95, 203, 160, 0] -0x000005dc ADDI R50 R59 0x48 ;; [80, 203, 176, 72] -0x000005e0 SW R59 R52 0x9 ;; [95, 239, 64, 9] -0x000005e4 SW R59 R47 0xa ;; [95, 238, 240, 10] -0x000005e8 SW R59 R49 0xb ;; [95, 239, 16, 11] -0x000005ec ADDI R52 R59 0x18 ;; [80, 211, 176, 24] -0x000005f0 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] -0x000005f4 MCPI R51 R52 0x18 ;; [96, 207, 64, 24] -0x000005f8 MCPI R56 R51 0x18 ;; [96, 227, 48, 24] -0x000005fc CFSI 0x90 ;; [146, 0, 0, 144] -0x00000600 POPH 0x81f80 ;; [152, 8, 31, 128] -0x00000604 JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000550 MCPI R40 R51 0x18 ;; [96, 163, 48, 24] +0x00000554 ADDI R41 R41 0x1 ;; [80, 166, 144, 1] +0x00000558 JMPB $zero 0xd4 ;; [117, 0, 0, 212] +0x0000055c CFSI 0x500 ;; [146, 0, 5, 0] +0x00000560 MOVE R62 R48 ;; [26, 251, 0, 0] +0x00000564 POPH 0x81fff ;; [152, 8, 31, 255] +0x00000568 POPL 0x800000 ;; [151, 128, 0, 0] +0x0000056c JAL $zero R62 0x0 ;; [153, 3, 224, 0] +0x00000570 PSHH 0x81f80 ;; [150, 8, 31, 128] +0x00000574 MOVE R59 $sp ;; [26, 236, 80, 0] +0x00000578 CFEI 0x90 ;; [145, 0, 0, 144] +0x0000057c ADDI R52 R59 0x78 ;; [80, 211, 176, 120] +0x00000580 MCPI R52 R57 0x18 ;; [96, 211, 144, 24] +0x00000584 ADDI R51 R59 0x60 ;; [80, 207, 176, 96] +0x00000588 MCPI R59 R52 0x18 ;; [96, 239, 64, 24] +0x0000058c ADDI R52 R59 0x30 ;; [80, 211, 176, 48] +0x00000590 MCPI R52 R59 0x18 ;; [96, 211, 176, 24] +0x00000594 LW R52 R59 0x6 ;; [93, 211, 176, 6] +0x00000598 LW R47 R59 0x7 ;; [93, 191, 176, 7] +0x0000059c LW R50 R59 0x8 ;; [93, 203, 176, 8] +0x000005a0 ADDI R49 R50 0x8 ;; [80, 199, 32, 8] +0x000005a4 GT R48 R49 R47 ;; [21, 195, 27, 192] +0x000005a8 JNZF R48 $zero 0x1 ;; [118, 192, 0, 1] +0x000005ac JMPF $zero 0x5 ;; [116, 0, 0, 5] +0x000005b0 MULI R48 R47 0x2 ;; [85, 194, 240, 2] +0x000005b4 ADDI R47 R48 0x8 ;; [80, 191, 0, 8] +0x000005b8 ALOC R47 ;; [38, 188, 0, 0] +0x000005bc MCP $hp R52 R50 ;; [40, 31, 76, 128] +0x000005c0 MOVE R52 $hp ;; [26, 208, 112, 0] +0x000005c4 ADD R50 R52 R50 ;; [16, 203, 76, 128] +0x000005c8 SW R50 R58 0x0 ;; [95, 203, 160, 0] +0x000005cc ADDI R50 R59 0x48 ;; [80, 203, 176, 72] +0x000005d0 SW R59 R52 0x9 ;; [95, 239, 64, 9] +0x000005d4 SW R59 R47 0xa ;; [95, 238, 240, 10] +0x000005d8 SW R59 R49 0xb ;; [95, 239, 16, 11] +0x000005dc ADDI R52 R59 0x18 ;; [80, 211, 176, 24] +0x000005e0 MCPI R52 R50 0x18 ;; [96, 211, 32, 24] +0x000005e4 MCPI R51 R52 0x18 ;; [96, 207, 64, 24] +0x000005e8 MCPI R56 R51 0x18 ;; [96, 227, 48, 24] +0x000005ec CFSI 0x90 ;; [146, 0, 0, 144] +0x000005f0 POPH 0x81f80 ;; [152, 8, 31, 128] +0x000005f4 JAL $zero R62 0x0 ;; [153, 3, 224, 0] .data_section: -0x00000608 .word i3647243719605075626, as hex be bytes ([32, 9D, 9C, D6, CC, 55, BE, AA]) -0x00000610 .bytes as hex ([73, 65, 74]), len i3, as ascii "set" -0x00000618 .bytes as hex ([61, 64, 64]), len i3, as ascii "add" -0x00000620 .word i18446744073709486084, as hex be bytes ([FF, FF, FF, FF, FF, FF, 00, 04]) -0x00000628 .word i14757395258967588866, as hex be bytes ([CC, CC, CC, CC, CC, CC, 00, 02]) +0x000005f8 .word i3647243719605075626, as hex be bytes ([32, 9D, 9C, D6, CC, 55, BE, AA]) +0x00000600 .bytes as hex ([73, 65, 74]), len i3, as ascii "set" +0x00000608 .bytes as hex ([61, 64, 64]), len i3, as ascii "add" +0x00000610 .word i18446744073709486084, as hex be bytes ([FF, FF, FF, FF, FF, FF, 00, 04]) +0x00000618 .word i14757395258967588866, as hex be bytes ([CC, CC, CC, CC, CC, CC, 00, 02]) ;; --- END OF TARGET BYTECODE --- - Finished release [optimized + fuel] target(s) [1.584 KB] in ??? + Finished release [optimized + fuel] target(s) [1.568 KB] in ??? 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 0323e5ff2c3..8bf69208b62 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.784 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [2.712 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 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 ebd0b3973ef..e07d99d9a37 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,12 +18,12 @@ warning: Error message is empty ____ Compiled script "panic_handling_in_unit_tests" with 1 warning. - Finished debug [unoptimized + fuel] target(s) [7.712 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [7.664 KB] in ??? Running 2 tests, filtered 18 tests tested -- panic_handling_in_unit_tests - test passing_dbgs_and_logs ... ok (???, 2681 gas) + test passing_dbgs_and_logs ... ok (???, 2596 gas) debug output: [src/main.sw:23:13] "This is a passing test containing `__dbg` outputs." = "This is a passing test containing `__dbg` outputs." [src/main.sw:25:13] x = 42 @@ -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":10800,"ptr":67107840,"ra":0,"rb":10098701174489624218}},{"LogData":{"data":"000000000000002a","digest":"a6bb133cb1e3638ad7b8a3ff0539668e9e56f9b850ef1b2a810f5422eaa6c323","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":15248,"ptr":18832,"ra":0,"rb":1515152261580153489}}] +[{"LogData":{"data":"0000000000000024546869732069732061206c6f672066726f6d207468652070617373696e6720746573742e","digest":"29d742ad9093cdf81404ff756467a44448729b85ab3c0d65197829fb61d2dd29","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":44,"pc":10800,"ptr":67107840,"ra":0,"rb":10098701174489624218}},{"LogData":{"data":"000000000000002a","digest":"a6bb133cb1e3638ad7b8a3ff0539668e9e56f9b850ef1b2a810f5422eaa6c323","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":15212,"ptr":18768,"ra":0,"rb":1515152261580153489}}] test passing_no_dbgs_or_logs ... ok (???, 69 gas) test result: OK. 2 passed; 0 failed; finished in ??? @@ -55,28 +55,28 @@ warning: Error message is empty ____ Compiled script "panic_handling_in_unit_tests" with 1 warning. - Finished debug [unoptimized + fuel] target(s) [7.712 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [7.664 KB] in ??? Running 20 tests, filtered 0 tests tested -- panic_handling_in_unit_tests - test passing_dbgs_and_logs ... ok (???, 2681 gas) + test passing_dbgs_and_logs ... ok (???, 2596 gas) test passing_no_dbgs_or_logs ... ok (???, 69 gas) test failing_revert_intrinsic ... FAILED (???, 71 gas) - test failing_revert_function_with_dbgs_and_logs ... FAILED (???, 2633 gas) - test failing_error_signal_assert ... FAILED (???, 375 gas) - test failing_error_signal_assert_eq ... FAILED (???, 2200 gas) - test failing_error_signal_assert_ne ... FAILED (???, 2194 gas) - test failing_error_signal_require_str_error ... FAILED (???, 819 gas) + test failing_revert_function_with_dbgs_and_logs ... FAILED (???, 2552 gas) + test failing_error_signal_assert ... FAILED (???, 327 gas) + test failing_error_signal_assert_eq ... FAILED (???, 2143 gas) + test failing_error_signal_assert_ne ... FAILED (???, 2137 gas) + test failing_error_signal_require_str_error ... FAILED (???, 818 gas) test failing_error_signal_require_enum_error ... FAILED (???, 928 gas) - test failing_panic_no_arg ... FAILED (???, 571 gas) - test failing_panic_unit_arg ... FAILED (???, 571 gas) + test failing_panic_no_arg ... FAILED (???, 568 gas) + test failing_panic_unit_arg ... FAILED (???, 568 gas) test failing_panic_const_eval_str_arg ... FAILED (???, 71 gas) test failing_panic_const_eval_empty_str_arg ... FAILED (???, 71 gas) test failing_panic_const_eval_whitespace_str_arg ... FAILED (???, 71 gas) - test failing_panic_non_const_eval_str_arg ... FAILED (???, 806 gas) - test failing_panic_non_const_eval_str_empty_arg ... FAILED (???, 787 gas) - test failing_panic_non_const_eval_str_whitespace_arg ... FAILED (???, 790 gas) + test failing_panic_non_const_eval_str_arg ... FAILED (???, 805 gas) + test failing_panic_non_const_eval_str_empty_arg ... FAILED (???, 786 gas) + test failing_panic_non_const_eval_str_whitespace_arg ... FAILED (???, 789 gas) test failing_panic_error_enum_arg ... FAILED (???, 903 gas) test failing_panic_error_enum_arg_with_empty_msg ... FAILED (???, 1010 gas) test failing_panic_error_enum_arg_with_whitespace_msg ... FAILED (???, 1030 gas) @@ -149,8 +149,8 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 15248, - "ptr": 18784, + "pc": 15212, + "ptr": 18720, "ra": 0, "rb": 1515152261580153489 } @@ -162,8 +162,8 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 15248, - "ptr": 18784, + "pc": 15212, + "ptr": 18720, "ra": 0, "rb": 1515152261580153489 } @@ -202,8 +202,8 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 15248, - "ptr": 18776, + "pc": 15212, + "ptr": 18712, "ra": 0, "rb": 1515152261580153489 } @@ -215,8 +215,8 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 15248, - "ptr": 18776, + "pc": 15212, + "ptr": 18712, "ra": 0, "rb": 1515152261580153489 } @@ -287,7 +287,7 @@ B(true), log rb: 8516346929033386016 "is": 10368, "len": 0, "pc": 13096, - "ptr": 18336, + "ptr": 18288, "ra": 0, "rb": 3330666440490685604 } @@ -312,7 +312,7 @@ B(true), log rb: 8516346929033386016 "is": 10368, "len": 0, "pc": 13148, - "ptr": 18336, + "ptr": 18288, "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 28a280aade4..d9a43eeaad7 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 @@ -8,17 +8,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 debug [unoptimized + fuel] target(s) [7.952 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [7.928 KB] in ??? Running 12 tests, filtered 0 tests tested -- panicking_contract - test test_panicking_in_contract_self_impl ... ok (???, 1450 gas) + test test_panicking_in_contract_self_impl ... ok (???, 1440 gas) revert code: 828000000000000c ├─ 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 (???, 2288 gas) + test test_directly_panicking_method ... ok (???, 2278 gas) revert code: 820000000000000b ├─ panic message: Error C. ├─ panic value: C(true) @@ -26,7 +26,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 (???, 2784 gas) + test test_nested_panic_inlined ... ok (???, 2774 gas) revert code: 8000000000c01001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -38,7 +38,7 @@ C(true), log rb: 5503570629422409978 └─ at panicking_contract@1.2.3, src/main.sw:32:9 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 (???, 2784 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 2774 gas) revert code: 8000000000c01001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -50,7 +50,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_contract@1.2.3, src/main.sw:32:9 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 (???, 2844 gas) + test test_nested_panic_non_inlined ... ok (???, 2834 gas) revert code: 8180000002804808 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -62,7 +62,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_contract@1.2.3, src/main.sw:40: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 (???, 2844 gas) + test test_nested_panic_non_inlined_same_revert_code ... ok (???, 2834 gas) revert code: 8180000002804808 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -74,7 +74,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:40: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 (???, 1896 gas) + test test_generic_panic_with_unit ... ok (???, 1882 gas) revert code: 8100000000003806 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic @@ -83,7 +83,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:48:9 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 1896 gas) + test test_generic_panic_with_unit_same_revert_code ... ok (???, 1882 gas) revert code: 8100000000003806 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic @@ -92,7 +92,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:48:9 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 2113 gas) + test test_generic_panic_with_str ... ok (???, 2102 gas) revert code: 8080000000002804 ├─ panic message: generic panic with string ├─ panicked: in panicking_lib::generic_panic @@ -101,7 +101,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:56:9 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 2256 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 2245 gas) revert code: 808000000000d019 ├─ panic message: generic panic with different string ├─ panicked: in panicking_lib::generic_panic @@ -110,7 +110,7 @@ AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 └─ at panicking_contract@1.2.3, src/main.sw:60:9 decoded log values: AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum ... ok (???, 2207 gas) + test test_generic_panic_with_error_type_enum ... ok (???, 2197 gas) revert code: 830000000000700d ├─ panic message: Error A. ├─ panic value: A @@ -120,7 +120,7 @@ AsciiString { data: "generic panic with different string" }, log rb: 10098701174 └─ at panicking_contract@1.2.3, src/main.sw:64:9 decoded log values: A, log rb: 5503570629422409978 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2390 gas) + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2380 gas) revert code: 830000000000e01b ├─ 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 25da6406e7d..f6e8fdd7064 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 @@ -7,12 +7,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 debug [unoptimized + fuel] target(s) [6.496 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [6.472 KB] in ??? Running 18 tests, filtered 0 tests tested -- panicking_lib - test test_nested_panic_inlined ... ok (???, 1519 gas) + test test_nested_panic_inlined ... ok (???, 1518 gas) revert code: 8000000000001001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -24,7 +24,7 @@ tested -- panicking_lib └─ at panicking_lib, src/lib.sw:55: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 (???, 1519 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 1518 gas) revert code: 8000000000001801 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) @@ -36,7 +36,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_lib, src/lib.sw:60: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 (???, 1537 gas) + test test_nested_panic_non_inlined ... ok (???, 1536 gas) revert code: 8080000000002804 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -48,7 +48,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_lib, src/lib.sw:65:5 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 (???, 1537 gas) + test test_nested_panic_non_inlined_same_revert_code ... ok (???, 1536 gas) revert code: 8080000000003004 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -60,7 +60,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_lib, src/lib.sw:70:5 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 2721958641300806892 - test test_generic_panic_with_unit ... ok (???, 575 gas) + test test_generic_panic_with_unit ... ok (???, 572 gas) revert code: 8100000000000007 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic @@ -69,7 +69,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_lib, src/lib.sw:83:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 575 gas) + test test_generic_panic_with_unit_same_revert_code ... ok (???, 572 gas) revert code: 8100000000000008 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic @@ -78,7 +78,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_lib, src/lib.sw:88:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 789 gas) + test test_generic_panic_with_str ... ok (???, 788 gas) revert code: 8180000000000009 ├─ panic message: generic panic with string ├─ panicked: in panicking_lib::generic_panic @@ -87,7 +87,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_lib, src/lib.sw:93:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 790 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 789 gas) revert code: 818000000000000a ├─ panic message: generic panic different string ├─ panicked: in panicking_lib::generic_panic @@ -96,7 +96,7 @@ AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 └─ at panicking_lib, src/lib.sw:98:5 decoded log values: AsciiString { data: "generic panic different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum_variant ... ok (???, 855 gas) + test test_generic_panic_with_error_type_enum_variant ... ok (???, 854 gas) revert code: 820000000000000b ├─ panic message: Error A. ├─ panic value: A @@ -106,7 +106,7 @@ AsciiString { data: "generic panic different string" }, log rb: 1009870117448962 └─ at panicking_lib, src/lib.sw:103:5 decoded log values: A, log rb: 2721958641300806892 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 855 gas) + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 854 gas) revert code: 820000000000000c ├─ panic message: Error A. ├─ panic value: A @@ -116,14 +116,14 @@ A, log rb: 2721958641300806892 └─ at panicking_lib, src/lib.sw:108:5 decoded log values: A, log rb: 2721958641300806892 - test test_panic_without_arg ... ok (???, 571 gas) + test test_panic_without_arg ... ok (???, 568 gas) revert code: 8280000000000000 ├─ panic value: () └─ panicked: in panicking_lib::test_panic_without_arg └─ at panicking_lib, src/lib.sw:113:5 decoded log values: (), log rb: 3330666440490685604 - test test_panic_with_unit ... ok (???, 571 gas) + test test_panic_with_unit ... ok (???, 568 gas) revert code: 8300000000000000 ├─ panic value: () └─ panicked: in panicking_lib::test_panic_with_unit @@ -135,7 +135,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 (???, 985 gas) + test test_panic_with_error_type_enum ... ok (???, 984 gas) revert code: 8400000000000000 ├─ panic message: Error C. ├─ panic value: C(true) @@ -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.872 KB] in ??? + Finished release [optimized + fuel] target(s) [3.864 KB] in ??? Running 18 tests, filtered 0 tests tested -- panicking_lib - test test_nested_panic_inlined ... ok (???, 1268 gas) + test test_nested_panic_inlined ... ok (???, 1267 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 (???, 1268 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 1267 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 (???, 1286 gas) + test test_nested_panic_non_inlined ... ok (???, 1285 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 (???, 1286 gas) + test test_nested_panic_non_inlined_same_revert_code ... ok (???, 1285 gas) revert code: 8080000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) @@ -247,7 +247,7 @@ AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 └─ 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 (???, 749 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 (???, 749 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 (???, 854 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 f3ac2946888..2fdb2f37313 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 @@ -8,7 +8,7 @@ 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 script panicking_script (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script) - Finished debug [unoptimized + fuel] target(s) [3.696 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [3.688 KB] in ??? Running 11 tests, filtered 0 tests tested -- panicking_script @@ -69,7 +69,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_script, src/main.sw:31:5 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 (???, 562 gas) + test test_generic_panic_with_unit ... ok (???, 558 gas) revert code: 8180000000000007 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic @@ -78,7 +78,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_script, src/main.sw:36:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 562 gas) + test test_generic_panic_with_unit_same_revert_code ... ok (???, 558 gas) revert code: 8180000000000008 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic @@ -87,7 +87,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_script, src/main.sw:41:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 789 gas) + test test_generic_panic_with_str ... ok (???, 788 gas) revert code: 8200000000000009 ├─ panic message: generic panic with string ├─ panicked: in panicking_lib::generic_panic @@ -96,7 +96,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_script, src/main.sw:46:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 792 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 791 gas) revert code: 820000000000000a ├─ 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/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 62a139ed4ee..b83f6a2759f 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 = 0x657862b4cc891cc26d7afe8b131b717cd125c826491d2839b22510b90fafa9c1; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release +const CONTRACT_ID = 0x26cef815a265eab39ef5f708c29d3996706be536a9a264b95f41a55977cd5a35; // 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_increment_contract/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_increment_contract/src/main.sw index 71fe92ab770..b83f21b18c4 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_increment_contract/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_increment_contract/src/main.sw @@ -6,7 +6,7 @@ use dynamic_contract_call::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xd1b4047af7ef111c023ab71069e01dc2abfde487c0a0ce1268e4f447e6c6e4c2; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x4f0834953dc8cb8eea5eb2f8f0f99198b075f55dee90e8af6e3e6d07325bdea8; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release +const CONTRACT_ID = 0x8001320480c4632d4c90ac92cbf3bb1a57d5d1945892f0be25cc22a86d57c6ff; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release fn main() -> bool { let the_abi = abi(Incrementor, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw index 7e7f6661cb0..204f8a4d5e2 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw @@ -5,7 +5,8 @@ use storage_enum_abi::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xc601d11767195485a6654d566c67774134668863d8c797a8c69e8778fb1f89e9; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0xc85ce02d93990b1e4aa8e02fa7c25d97808a293fcc203acdf07b91d9b882b8c8; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release +const CONTRACT_ID = 0x1d211925048029529a142fae94fa25c6595b3d9abce9dc997cbcd9ccc6eb4e29; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release + fn main() -> u64 { let caller = abi(StorageEnum, CONTRACT_ID); let res = caller.read_write_enums(); 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 9aa36050fdd..9e8a56ea87f 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 = 0xb32b82785cb635ee7df31fb6fee8084f051c3c15c48001a0f5d61c504a01dd45; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release +const CONTRACT_ID = 0x4da85d30850eca127e6b906299b5f199e1655b6be85725bceecdd7c20a0ad887; // 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/test_contracts/basic_storage/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/stdout.snap index 168c709b410..4365e7921d0 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): - v7307v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 - mem_copy_val v7307v1, self - v7309v1 = const u64 0 - v7310v1 = get_elem_ptr self, __ptr u64, v7309v1 + v7303v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 + mem_copy_val v7303v1, self + v7305v1 = const u64 0 + v7306v1 = get_elem_ptr self, __ptr u64, v7305v1 + v7307v1 = get_local __ptr u64, other_ + v7308v1 = const u64 1 + store v7308v1 to v7307v1 + v7310v1 = load v7306v1 v7311v1 = get_local __ptr u64, other_ - v7312v1 = const u64 1 - store v7312v1 to v7311v1 - v7314v1 = load v7310v1 - v7315v1 = get_local __ptr u64, other_ - v7316v1 = load v7315v1 - v7317v1 = cmp eq v7314v1 v7316v1 - cbr v7317v1, block0(), block1() + v7312v1 = load v7311v1 + v7313v1 = cmp eq v7310v1 v7312v1 + cbr v7313v1, block0(), block1() block0(): - v7319v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 - v7320v1 = const u64 1 - v7321v1 = const u64 1 - v7322v1 = get_elem_ptr v7319v1, __ptr b256, v7320v1, v7321v1 - mem_copy_val __ret_value, v7322v1 - v7324v1 = const unit () - ret () v7324v1 + v7315v1 = get_local __ptr { u64, ( () | b256 ) }, __matched_value_4 + v7316v1 = const u64 1 + v7317v1 = const u64 1 + v7318v1 = get_elem_ptr v7315v1, __ptr b256, v7316v1, v7317v1 + mem_copy_val __ret_value, v7318v1 + v7320v1 = const unit () + ret () v7320v1 block1(): - v7326v1 = get_local __ptr u64, code_ - v7327v1 = const u64 0 - store v7327v1 to v7326v1 - v7329v1 = get_local __ptr u64, code_ - v7330v1 = load v7329v1 - revert v7330v1 + v7322v1 = get_local __ptr u64, code_ + v7323v1 = const u64 0 + store v7323v1 to v7322v1 + v7325v1 = get_local __ptr u64, code_ + v7326v1 = load v7325v1 + revert v7326v1 } 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 855ea2cc2bb..fdc34f15946 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.144 KB] in ??? + Finished release [optimized + fuel] target(s) [18.672 KB] in ??? Running 33 tests, filtered 0 tests tested -- const_of_contract_call - test cost_of_in_bool ... ok (???, 1733 gas) - test cost_of_in_u8 ... ok (???, 1701 gas) - test cost_of_in_u16 ... ok (???, 1776 gas) - test cost_of_in_u32 ... ok (???, 1885 gas) - test cost_of_in_u64 ... ok (???, 1519 gas) - test cost_of_in_u256 ... ok (???, 1600 gas) - test cost_of_in_b256 ... ok (???, 1590 gas) - test cost_of_in_str_0 ... ok (???, 1887 gas) - test cost_of_in_str_1 ... ok (???, 2004 gas) - test cost_of_in_str_8 ... ok (???, 2011 gas) - test cost_of_in_str_16 ... ok (???, 2008 gas) - test cost_of_in_str_32 ... ok (???, 2018 gas) - test cost_of_in_array_0 ... ok (???, 1547 gas) - test cost_of_in_array_1 ... ok (???, 1599 gas) - test cost_of_in_array_8 ... ok (???, 2107 gas) - test cost_of_in_array_16 ... ok (???, 1639 gas) - test cost_of_in_array_32 ... ok (???, 1688 gas) - test cost_of_in_array_64 ... ok (???, 1781 gas) - test cost_of_in_tuple_0 ... ok (???, 1517 gas) - test cost_of_in_tuple_1 ... ok (???, 1634 gas) - test cost_of_in_tuple_2 ... ok (???, 1652 gas) - test cost_of_in_tuple_3 ... ok (???, 1660 gas) - test cost_of_in_tuple_4 ... ok (???, 1647 gas) - test in_struct_u64 ... ok (???, 1622 gas) - test in_struct_u64_u64 ... ok (???, 1647 gas) - test in_struct_u64_u64_u64 ... ok (???, 1663 gas) - test in_enum_u64 ... ok (???, 1618 gas) - test in_enum_u64_u64 ... ok (???, 1620 gas) - test in_enum_u64_u64_u64 ... ok (???, 1633 gas) - test in_vec_trivial ... ok (???, 2666 gas) - test in_vec_not_trivial ... ok (???, 5865 gas) - test order_args_without_trivial_enum ... ok (???, 3046 gas) - test order_args_with_trivial_enum ... ok (???, 3210 gas) + test cost_of_in_bool ... ok (???, 1718 gas) + test cost_of_in_u8 ... ok (???, 1686 gas) + test cost_of_in_u16 ... ok (???, 1772 gas) + test cost_of_in_u32 ... ok (???, 1881 gas) + test cost_of_in_u64 ... ok (???, 1515 gas) + test cost_of_in_u256 ... ok (???, 1586 gas) + test cost_of_in_b256 ... ok (???, 1576 gas) + test cost_of_in_str_0 ... ok (???, 1863 gas) + test cost_of_in_str_1 ... ok (???, 1979 gas) + test cost_of_in_str_8 ... ok (???, 1986 gas) + test cost_of_in_str_16 ... ok (???, 1984 gas) + test cost_of_in_str_32 ... ok (???, 1994 gas) + test cost_of_in_array_0 ... ok (???, 1533 gas) + test cost_of_in_array_1 ... ok (???, 1585 gas) + test cost_of_in_array_8 ... ok (???, 2093 gas) + test cost_of_in_array_16 ... ok (???, 1625 gas) + test cost_of_in_array_32 ... ok (???, 1674 gas) + test cost_of_in_array_64 ... ok (???, 1767 gas) + test cost_of_in_tuple_0 ... ok (???, 1513 gas) + test cost_of_in_tuple_1 ... ok (???, 1620 gas) + test cost_of_in_tuple_2 ... ok (???, 1638 gas) + test cost_of_in_tuple_3 ... ok (???, 1646 gas) + test cost_of_in_tuple_4 ... ok (???, 1633 gas) + test in_struct_u64 ... ok (???, 1608 gas) + test in_struct_u64_u64 ... ok (???, 1633 gas) + test in_struct_u64_u64_u64 ... ok (???, 1648 gas) + test in_enum_u64 ... ok (???, 1614 gas) + test in_enum_u64_u64 ... ok (???, 1616 gas) + test in_enum_u64_u64_u64 ... ok (???, 1628 gas) + test in_vec_trivial ... ok (???, 2652 gas) + test in_vec_not_trivial ... ok (???, 5861 gas) + test order_args_without_trivial_enum ... ok (???, 3042 gas) + test order_args_with_trivial_enum ... ok (???, 3199 gas) test result: OK. 33 passed; 0 failed; finished in ??? @@ -59,12 +59,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) [536 B] in ??? + Finished release [optimized + fuel] target(s) [520 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_0 ... ok (???, 1375 gas) + test isolated_cost_of_in_array_0 ... ok (???, 1365 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -79,12 +79,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) [616 B] in ??? + Finished release [optimized + fuel] target(s) [600 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_1 ... ok (???, 1422 gas) + test isolated_cost_of_in_array_1 ... ok (???, 1412 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -99,12 +99,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) [616 B] in ??? + Finished release [optimized + fuel] target(s) [600 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_16 ... ok (???, 1463 gas) + test isolated_cost_of_in_array_16 ... ok (???, 1453 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -119,12 +119,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) [616 B] in ??? + Finished release [optimized + fuel] target(s) [600 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_32 ... ok (???, 1508 gas) + test isolated_cost_of_in_array_32 ... ok (???, 1498 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -139,12 +139,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) [616 B] in ??? + Finished release [optimized + fuel] target(s) [600 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_64 ... ok (???, 1598 gas) + test isolated_cost_of_in_array_64 ... ok (???, 1588 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -159,12 +159,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) [672 B] in ??? + Finished release [optimized + fuel] target(s) [656 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_8 ... ok (???, 1924 gas) + test isolated_cost_of_in_array_8 ... ok (???, 1914 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -179,12 +179,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) [600 B] in ??? + Finished release [optimized + fuel] target(s) [584 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_b256 ... ok (???, 1429 gas) + test isolated_cost_of_in_b256 ... ok (???, 1419 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -199,12 +199,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) [896 B] in ??? + Finished release [optimized + fuel] target(s) [880 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_bool ... ok (???, 1537 gas) + test isolated_cost_of_in_bool ... ok (???, 1527 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.272 KB] in ??? + Finished release [optimized + fuel] target(s) [2.264 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test order_args_with_trivial_enum ... ok (???, 2979 gas) + test order_args_with_trivial_enum ... ok (???, 2974 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) [992 B] in ??? + Finished release [optimized + fuel] target(s) [968 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_0 ... ok (???, 1691 gas) + test isolated_cost_of_in_str_0 ... ok (???, 1676 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -339,12 +339,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.16 KB] in ??? + Finished release [optimized + fuel] target(s) [1.136 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_1 ... ok (???, 1810 gas) + test isolated_cost_of_in_str_1 ... ok (???, 1794 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -359,12 +359,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.2 KB] in ??? + Finished release [optimized + fuel] target(s) [1.176 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_16 ... ok (???, 1817 gas) + test isolated_cost_of_in_str_16 ... ok (???, 1802 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -379,12 +379,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.216 KB] in ??? + Finished release [optimized + fuel] target(s) [1.192 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_32 ... ok (???, 1823 gas) + test isolated_cost_of_in_str_32 ... ok (???, 1808 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -399,12 +399,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.168 KB] in ??? + Finished release [optimized + fuel] target(s) [1.144 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_8 ... ok (???, 1814 gas) + test isolated_cost_of_in_str_8 ... ok (???, 1798 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -419,12 +419,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) [616 B] in ??? + Finished release [optimized + fuel] target(s) [600 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_struct_u64 ... ok (???, 1422 gas) + test in_struct_u64 ... ok (???, 1412 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -439,12 +439,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) [648 B] in ??? + Finished release [optimized + fuel] target(s) [632 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_struct_u64_u64 ... ok (???, 1435 gas) + test in_struct_u64_u64 ... ok (???, 1425 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -459,12 +459,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) [648 B] in ??? + Finished release [optimized + fuel] target(s) [632 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_struct_u64_u64_u64 ... ok (???, 1438 gas) + test in_struct_u64_u64_u64 ... ok (???, 1428 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -499,12 +499,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) [616 B] in ??? + Finished release [optimized + fuel] target(s) [600 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_1 ... ok (???, 1422 gas) + test isolated_cost_of_in_tuple_1 ... ok (???, 1412 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -519,12 +519,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) [632 B] in ??? + Finished release [optimized + fuel] target(s) [616 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_2 ... ok (???, 1435 gas) + test isolated_cost_of_in_tuple_2 ... ok (???, 1425 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -539,12 +539,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) [632 B] in ??? + Finished release [optimized + fuel] target(s) [616 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_3 ... ok (???, 1438 gas) + test isolated_cost_of_in_tuple_3 ... ok (???, 1428 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -559,12 +559,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) [736 B] in ??? + Finished release [optimized + fuel] target(s) [720 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_4 ... ok (???, 1440 gas) + test isolated_cost_of_in_tuple_4 ... ok (???, 1430 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -579,12 +579,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.048 KB] in ??? + Finished release [optimized + fuel] target(s) [1.032 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u16 ... ok (???, 1679 gas) + test isolated_cost_of_in_u16 ... ok (???, 1669 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -599,12 +599,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) [600 B] in ??? + Finished release [optimized + fuel] target(s) [584 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u256 ... ok (???, 1429 gas) + test isolated_cost_of_in_u256 ... ok (???, 1419 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -619,12 +619,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.136 KB] in ??? + Finished release [optimized + fuel] target(s) [1.12 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u32 ... ok (???, 1746 gas) + test isolated_cost_of_in_u32 ... ok (???, 1736 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -659,12 +659,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) [816 B] in ??? + Finished release [optimized + fuel] target(s) [800 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u8 ... ok (???, 1518 gas) + test isolated_cost_of_in_u8 ... ok (???, 1508 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -679,12 +679,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.848 KB] in ??? + Finished release [optimized + fuel] target(s) [1.832 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_vec_not_trivial ... ok (???, 4890 gas) + test in_vec_not_trivial ... ok (???, 4880 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -699,12 +699,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.72 KB] in ??? + Finished release [optimized + fuel] target(s) [1.696 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_vec_trivial ... ok (???, 2470 gas) + test in_vec_trivial ... ok (???, 2455 gas) test result: OK. 1 passed; 0 failed; finished in ???