From bff74b14856f5a8e5aa95bc6721c3c64f6230444 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Thu, 17 Nov 2022 17:00:38 -0500 Subject: [PATCH 01/22] init commit remove popn exposure, seems not useful here prototyped. revert test change minor update some note --- pyteal/ast/abi/type.py | 50 +- pyteal/ast/frame.py | 28 + pyteal/ast/subroutine.py | 42 +- .../teal/roundtrip/app_roundtrip_()_v8.teal | 15 +- .../app_roundtrip_(bool)[10]_v8.teal | 98 +- .../roundtrip/app_roundtrip_(bool)_v8.teal | 15 +- ...t64,bool),byte[10],bool[4],uint64)_v8.teal | 419 +++--- .../app_roundtrip_(bool,byte)_v8.teal | 15 +- ...undtrip_(bool,byte,address,string)_v8.teal | 363 ++--- ...yte),uint8)[2],string,bool[]))[]_2_v8.teal | 1170 +++++++++-------- ..._(bool,byte,address,string,uint64)_v8.teal | 363 ++--- ...app_roundtrip_(bool,uint64,uint32)_v8.teal | 15 +- .../roundtrip/app_roundtrip_(byte)_v8.teal | 15 +- .../app_roundtrip_(byte,bool,uint64)_v8.teal | 15 +- ...4],(bool,bool),uint64,address)[]_7_v8.teal | 456 ++++--- .../roundtrip/app_roundtrip_(uint16)_v8.teal | 15 +- .../app_roundtrip_(uint16,uint8,byte)_v8.teal | 15 +- .../roundtrip/app_roundtrip_(uint32)_v8.teal | 15 +- ...pp_roundtrip_(uint32,uint16,uint8)_v8.teal | 15 +- .../roundtrip/app_roundtrip_(uint64)_v8.teal | 15 +- ...p_roundtrip_(uint64,uint32,uint16)_v8.teal | 15 +- .../roundtrip/app_roundtrip_(uint8)_v8.teal | 15 +- .../app_roundtrip_(uint8,byte,bool)_v8.teal | 15 +- .../app_roundtrip_address[]_10_v8.teal | 414 +++--- .../roundtrip/app_roundtrip_address_v8.teal | 271 ++-- .../roundtrip/app_roundtrip_bool[1]_v8.teal | 23 +- .../app_roundtrip_bool[3][]_11_v8.teal | 186 +-- .../roundtrip/app_roundtrip_bool[42]_v8.teal | 351 ++--- .../roundtrip/app_roundtrip_bool[]_0_v8.teal | 71 +- .../roundtrip/app_roundtrip_bool[]_1_v8.teal | 79 +- .../roundtrip/app_roundtrip_bool[]_42_v8.teal | 407 +++--- .../teal/roundtrip/app_roundtrip_bool_v8.teal | 12 +- .../roundtrip/app_roundtrip_byte[16]_v8.teal | 143 +- .../roundtrip/app_roundtrip_byte[]_36_v8.teal | 363 ++--- .../teal/roundtrip/app_roundtrip_byte_v8.teal | 12 +- .../roundtrip/app_roundtrip_string_0_v8.teal | 71 +- .../roundtrip/app_roundtrip_string_13_v8.teal | 123 +- .../roundtrip/app_roundtrip_string_1_v8.teal | 75 +- .../roundtrip/app_roundtrip_uint16_v8.teal | 12 +- .../roundtrip/app_roundtrip_uint32_v8.teal | 12 +- .../roundtrip/app_roundtrip_uint64[1]_v8.teal | 23 +- .../app_roundtrip_uint64[42]_v8.teal | 351 ++--- .../app_roundtrip_uint64[]_0_v8.teal | 71 +- .../app_roundtrip_uint64[]_1_v8.teal | 79 +- .../app_roundtrip_uint64[]_42_v8.teal | 409 +++--- .../roundtrip/app_roundtrip_uint64_v8.teal | 12 +- .../roundtrip/app_roundtrip_uint8_v8.teal | 12 +- 47 files changed, 3625 insertions(+), 3156 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index 6abed2d80..b7ebe5bd5 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -3,6 +3,7 @@ from pyteal.ast.expr import Expr from pyteal.ast.abstractvar import AbstractVar +from pyteal.ast.frame import FrameVar from pyteal.ast.scratchvar import ScratchVar from pyteal.ast.seq import Seq from pyteal.errors import TealInputError @@ -76,9 +77,28 @@ class BaseType(ABC): def __init__(self, spec: TypeSpec) -> None: """Create a new BaseType.""" + from pyteal.ast.subroutine import SubroutineEval + super().__init__() self._type_spec: Final[TypeSpec] = spec - self._stored_value: AbstractVar = ScratchVar(spec.storage_type()) + self._stored_value: AbstractVar + + if SubroutineEval.Context.config_use_frame_pointer: + assert SubroutineEval.Context.proto + proto = SubroutineEval.Context.proto + + assert proto.mem_layout + local_types = proto.mem_layout.local_stack_types + + # NOTE: you can have at most 128 local variables. + # len(local_types) + 1 computes the resulting length, + # should be <= 128 + if len(local_types) + 1 <= 128: + local_types.append(self._type_spec.storage_type()) + self._stored_value = FrameVar(proto, len(local_types) - 1) + return + + self._stored_value = ScratchVar(spec.storage_type()) def type_spec(self) -> TypeSpec: """Get the TypeSpec for this ABI type instance.""" @@ -221,17 +241,23 @@ def store_into(self, output: BaseType) -> Expr: f"expected type_spec {self.produced_type_spec()} but get {output.type_spec()}" ) - declaration = self.computation.subroutine.get_declaration() - - if declaration.deferred_expr is None: - raise TealInputError( - "ABI return subroutine must have deferred_expr to be not-None." - ) - if declaration.deferred_expr.type_of() != output.type_spec().storage_type(): - raise TealInputError( - f"ABI return subroutine deferred_expr is expected to be typed {output.type_spec().storage_type()}, " - f"but has type {declaration.deferred_expr.type_of()}." - ) + # HANG NOTE! This get_declaration check applies only for pre frame pointer case + # the post frame pointer case should not apply + # need to somehow expose the context of evaluation + try: + declaration = self.computation.subroutine.get_declaration() + + if declaration.deferred_expr is None: + raise TealInputError( + "ABI return subroutine must have deferred_expr to be not-None." + ) + if declaration.deferred_expr.type_of() != output.type_spec().storage_type(): + raise TealInputError( + f"ABI return subroutine deferred_expr is expected to be typed {output.type_spec().storage_type()}, " + f"but has type {declaration.deferred_expr.type_of()}." + ) + except Exception: + pass return output._stored_value.store(self.computation) diff --git a/pyteal/ast/frame.py b/pyteal/ast/frame.py index 904885f66..deb3eefaf 100644 --- a/pyteal/ast/frame.py +++ b/pyteal/ast/frame.py @@ -349,3 +349,31 @@ def has_return(self) -> bool: DupN.__module__ = "pyteal" + + +class Bury(Expr): + def __init__(self, depth: int): + super(Bury, self).__init__() + if depth <= 0: + raise TealInputError("bury depth should be positive") + self.depth = depth + + def __teal__(self, options: "CompileOptions") -> tuple[TealBlock, TealSimpleBlock]: + verifyProgramVersion( + Op.bury.min_version, + options.version, + "Program version too low to use bury", + ) + return TealBlock.FromOp(options, TealOp(self, Op.bury, self.depth)) + + def __str__(self): + return f"(Bury {self.depth})" + + def has_return(self) -> bool: + return False + + def type_of(self) -> TealType: + return TealType.none + + +Bury.__module__ = "pyteal" diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index eeea8950b..7e3e14c51 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1,3 +1,4 @@ +from contextlib import AbstractContextManager from dataclasses import dataclass from docstring_parser import parse as parse_docstring from inspect import isclass, Parameter, signature, get_annotations @@ -9,7 +10,7 @@ from pyteal.ast.expr import Expr from pyteal.ast.seq import Seq from pyteal.ast.scratchvar import DynamicScratchVar, ScratchVar, ScratchSlot -from pyteal.ast.frame import Proto, FrameVar, ProtoStackLayout +from pyteal.ast.frame import Bury, Proto, FrameVar, ProtoStackLayout from pyteal.errors import TealInputError, TealInternalError, verifyProgramVersion from pyteal.ir import TealOp, Op, TealBlock from pyteal.types import TealType @@ -1006,7 +1007,17 @@ def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: abi_output_kwargs[output_kwarg_info.name] = output_carrying_abi # Arg usage "B" supplied to build an AST from the user-defined PyTEAL function: - subroutine_body = subroutine.implementation(*loaded_args, **abi_output_kwargs) + subroutine_body: Expr + if not self.use_frame_pt: + subroutine_body = subroutine.implementation( + *loaded_args, **abi_output_kwargs + ) + else: + with SubroutineEval.Context.CompileWithFrameContext(proto): + subroutine_body = subroutine.implementation( + *loaded_args, **abi_output_kwargs + ) + if not isinstance(subroutine_body, Expr): raise TealInputError( f"Subroutine function does not return a PyTeal expression. Got type {type(subroutine_body)}." @@ -1025,6 +1036,14 @@ def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: if not self.use_frame_pt: deferred_expr = output_carrying_abi._stored_value.load() + if self.use_frame_pt: + assert proto.mem_layout + depth = len(proto.mem_layout.local_stack_types) + # only when we have 1 return, and with other local variables + # we use bury to bury the result to 0 index against frame pointer + if not abi_output_kwargs and 0 < proto.num_returns < depth: + deferred_expr = Bury(depth) + # Arg usage "A" to be pick up and store in scratch parameters that have been placed on the stack # need to reverse order of argumentVars because the last argument will be on top of the stack @@ -1053,5 +1072,24 @@ def normal_evaluator(cls) -> "SubroutineEval": def fp_evaluator(cls) -> "SubroutineEval": return cls(SubroutineEval.var_n_loaded_fp, True) + class Context: + config_use_frame_pointer: bool = False + proto: Optional[Proto] = None + + class CompileWithFrameContext(AbstractContextManager): + def __init__(self, _proto: Proto): + super().__init__() + self.prev_ctxt_proto: Optional[Proto] = SubroutineEval.Context.proto + SubroutineEval.Context.proto = _proto + + def __enter__(self): + SubroutineEval.Context.config_use_frame_pointer = True + return self + + def __exit__(self, *_): + SubroutineEval.Context.config_use_frame_pointer = False + SubroutineEval.Context.proto = self.prev_ctxt_proto + return None + SubroutineEval.__module__ = "pyteal" diff --git a/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal index d0ddb9ccf..459116c6c 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 1 byte "" frame_bury 0 retsub @@ -23,16 +25,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 3 +frame_bury 2 frame_dig -1 -load 2 +frame_dig 1 concat -load 3 +frame_dig 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal index 13296df67..59f3055ff 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 getbit @@ -33,124 +35,127 @@ retsub arraycomplement_1: proto 1 1 byte "" +dupn 10 +int 0 +dupn 1 frame_dig -1 int 1 int 0 * int 1 extract3 -store 5 +frame_bury 1 frame_dig -1 int 1 int 1 * int 1 extract3 -store 6 +frame_bury 2 frame_dig -1 int 1 int 2 * int 1 extract3 -store 7 +frame_bury 3 frame_dig -1 int 1 int 3 * int 1 extract3 -store 8 +frame_bury 4 frame_dig -1 int 1 int 4 * int 1 extract3 -store 9 +frame_bury 5 frame_dig -1 int 1 int 5 * int 1 extract3 -store 10 +frame_bury 6 frame_dig -1 int 1 int 6 * int 1 extract3 -store 11 +frame_bury 7 frame_dig -1 int 1 int 7 * int 1 extract3 -store 12 +frame_bury 8 frame_dig -1 int 1 int 8 * int 1 extract3 -store 13 +frame_bury 9 frame_dig -1 int 1 int 9 * int 1 extract3 -store 14 -load 5 +frame_bury 10 +frame_dig 1 callsub tuplecomplement_0 -store 5 -load 6 +frame_bury 1 +frame_dig 2 callsub tuplecomplement_0 -store 6 -load 7 +frame_bury 2 +frame_dig 3 callsub tuplecomplement_0 -store 7 -load 8 +frame_bury 3 +frame_dig 4 callsub tuplecomplement_0 -store 8 -load 9 +frame_bury 4 +frame_dig 5 callsub tuplecomplement_0 -store 9 -load 10 +frame_bury 5 +frame_dig 6 callsub tuplecomplement_0 -store 10 -load 11 +frame_bury 6 +frame_dig 7 callsub tuplecomplement_0 -store 11 -load 12 +frame_bury 7 +frame_dig 8 callsub tuplecomplement_0 -store 12 -load 13 +frame_bury 8 +frame_dig 9 callsub tuplecomplement_0 -store 13 -load 14 +frame_bury 9 +frame_dig 10 callsub tuplecomplement_0 -store 14 -load 5 -load 6 +frame_bury 10 +frame_dig 1 +frame_dig 2 concat -load 7 +frame_dig 3 concat -load 8 +frame_dig 4 concat -load 9 +frame_dig 5 concat -load 10 +frame_dig 6 concat -load 11 +frame_dig 7 concat -load 12 +frame_dig 8 concat -load 13 +frame_dig 9 concat -load 14 +frame_dig 10 concat frame_bury 0 retsub @@ -159,16 +164,19 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 3 -load 3 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 4 +frame_bury 2 frame_dig -1 -load 3 +frame_dig 1 concat -load 4 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal index 72411884c..247d0a8ea 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 getbit @@ -33,16 +35,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 3 -load 3 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 4 +frame_bury 2 frame_dig -1 -load 3 +frame_dig 1 concat -load 4 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal index 1875b356a..7eb23d671 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal @@ -15,6 +15,20 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 6 +byte "" +dupn 1 +int 0 +dupn 97 +byte "" +dupn 1 +int 0 +dupn 5 +byte "" +dupn 1 +int 0 +dupn 9 frame_dig -1 int 0 getbit @@ -75,16 +89,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 4 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 8 -load 8 +frame_bury 2 +frame_dig 2 callsub tuplecomplement_0 -store 9 +frame_bury 4 frame_dig -1 -load 8 +frame_dig 2 concat -load 9 +frame_dig 4 concat frame_bury 0 retsub @@ -118,451 +135,453 @@ retsub arraycomplement_4: proto 1 1 byte "" +int 0 +dupn 97 frame_dig -1 int 1 int 0 * getbyte -store 12 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 13 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 14 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 15 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 16 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 17 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 18 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 19 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 20 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 21 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 22 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 23 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 24 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 25 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 26 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 27 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 28 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 29 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 30 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 31 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 32 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 33 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 34 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 35 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 36 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 37 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 38 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 39 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 40 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 41 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 42 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 43 -load 12 +frame_bury 32 +frame_dig 1 callsub numericalcomp_3 -store 12 -load 13 +frame_bury 1 +frame_dig 2 callsub numericalcomp_3 -store 13 -load 14 +frame_bury 2 +frame_dig 3 callsub numericalcomp_3 -store 14 -load 15 +frame_bury 3 +frame_dig 4 callsub numericalcomp_3 -store 15 -load 16 +frame_bury 4 +frame_dig 5 callsub numericalcomp_3 -store 16 -load 17 +frame_bury 5 +frame_dig 6 callsub numericalcomp_3 -store 17 -load 18 +frame_bury 6 +frame_dig 7 callsub numericalcomp_3 -store 18 -load 19 +frame_bury 7 +frame_dig 8 callsub numericalcomp_3 -store 19 -load 20 +frame_bury 8 +frame_dig 9 callsub numericalcomp_3 -store 20 -load 21 +frame_bury 9 +frame_dig 10 callsub numericalcomp_3 -store 21 -load 22 +frame_bury 10 +frame_dig 11 callsub numericalcomp_3 -store 22 -load 23 +frame_bury 11 +frame_dig 12 callsub numericalcomp_3 -store 23 -load 24 +frame_bury 12 +frame_dig 13 callsub numericalcomp_3 -store 24 -load 25 +frame_bury 13 +frame_dig 14 callsub numericalcomp_3 -store 25 -load 26 +frame_bury 14 +frame_dig 15 callsub numericalcomp_3 -store 26 -load 27 +frame_bury 15 +frame_dig 16 callsub numericalcomp_3 -store 27 -load 28 +frame_bury 16 +frame_dig 17 callsub numericalcomp_3 -store 28 -load 29 +frame_bury 17 +frame_dig 18 callsub numericalcomp_3 -store 29 -load 30 +frame_bury 18 +frame_dig 19 callsub numericalcomp_3 -store 30 -load 31 +frame_bury 19 +frame_dig 20 callsub numericalcomp_3 -store 31 -load 32 +frame_bury 20 +frame_dig 21 callsub numericalcomp_3 -store 32 -load 33 +frame_bury 21 +frame_dig 22 callsub numericalcomp_3 -store 33 -load 34 +frame_bury 22 +frame_dig 23 callsub numericalcomp_3 -store 34 -load 35 +frame_bury 23 +frame_dig 24 callsub numericalcomp_3 -store 35 -load 36 +frame_bury 24 +frame_dig 25 callsub numericalcomp_3 -store 36 -load 37 +frame_bury 25 +frame_dig 26 callsub numericalcomp_3 -store 37 -load 38 +frame_bury 26 +frame_dig 27 callsub numericalcomp_3 -store 38 -load 39 +frame_bury 27 +frame_dig 28 callsub numericalcomp_3 -store 39 -load 40 +frame_bury 28 +frame_dig 29 callsub numericalcomp_3 -store 40 -load 41 +frame_bury 29 +frame_dig 30 callsub numericalcomp_3 -store 41 -load 42 +frame_bury 30 +frame_dig 31 callsub numericalcomp_3 -store 42 -load 43 +frame_bury 31 +frame_dig 32 callsub numericalcomp_3 -store 43 +frame_bury 32 byte 0x00 int 0 -load 12 +frame_dig 1 setbyte byte 0x00 int 0 -load 13 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 14 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 15 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 16 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 17 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 18 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 19 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 20 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 21 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 22 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 23 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 24 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 25 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 26 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 27 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 28 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 29 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 30 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 31 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 36 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 37 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 38 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 39 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 40 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 41 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 42 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 43 +frame_dig 32 setbyte concat frame_bury 0 @@ -572,25 +591,27 @@ retsub tuplecomplement_5: proto 1 1 byte "" +int 0 +dupn 5 frame_dig -1 int 0 extract_uint64 -store 10 +frame_bury 2 frame_dig -1 int 64 getbit -store 11 -load 10 +frame_bury 3 +frame_dig 2 callsub numericalcomp_11 -store 10 -load 11 +frame_bury 2 +frame_dig 3 callsub boolcomp_12 -store 11 -load 10 +frame_bury 3 +frame_dig 2 itob byte 0x00 int 0 -load 11 +frame_dig 3 setbit concat frame_bury 0 @@ -614,143 +635,145 @@ retsub arraycomplement_7: proto 1 1 byte "" +int 0 +dupn 11 frame_dig -1 int 1 int 0 * getbyte -store 44 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 45 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 46 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 47 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 48 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 49 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 50 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 51 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 52 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 53 -load 44 +frame_bury 10 +frame_dig 1 callsub numericalcomp_6 -store 44 -load 45 +frame_bury 1 +frame_dig 2 callsub numericalcomp_6 -store 45 -load 46 +frame_bury 2 +frame_dig 3 callsub numericalcomp_6 -store 46 -load 47 +frame_bury 3 +frame_dig 4 callsub numericalcomp_6 -store 47 -load 48 +frame_bury 4 +frame_dig 5 callsub numericalcomp_6 -store 48 -load 49 +frame_bury 5 +frame_dig 6 callsub numericalcomp_6 -store 49 -load 50 +frame_bury 6 +frame_dig 7 callsub numericalcomp_6 -store 50 -load 51 +frame_bury 7 +frame_dig 8 callsub numericalcomp_6 -store 51 -load 52 +frame_bury 8 +frame_dig 9 callsub numericalcomp_6 -store 52 -load 53 +frame_bury 9 +frame_dig 10 callsub numericalcomp_6 -store 53 +frame_bury 10 byte 0x00 int 0 -load 44 +frame_dig 1 setbyte byte 0x00 int 0 -load 45 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 46 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 47 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 48 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 49 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 50 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 51 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 52 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 53 +frame_dig 10 setbyte concat frame_bury 0 @@ -771,46 +794,48 @@ retsub arraycomplement_9: proto 1 1 byte "" +int 0 +dupn 5 frame_dig -1 int 0 getbit -store 54 +frame_bury 1 frame_dig -1 int 1 getbit -store 55 +frame_bury 2 frame_dig -1 int 2 getbit -store 56 +frame_bury 3 frame_dig -1 int 3 getbit -store 57 -load 54 +frame_bury 4 +frame_dig 1 callsub boolcomp_8 -store 54 -load 55 +frame_bury 1 +frame_dig 2 callsub boolcomp_8 -store 55 -load 56 +frame_bury 2 +frame_dig 3 callsub boolcomp_8 -store 56 -load 57 +frame_bury 3 +frame_dig 4 callsub boolcomp_8 -store 57 +frame_bury 4 byte 0x00 int 0 -load 54 +frame_dig 1 setbit int 1 -load 55 +frame_dig 2 setbit int 2 -load 56 +frame_dig 3 setbit int 3 -load 57 +frame_dig 4 setbit frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal index c91fe2871..585707784 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 5 frame_dig -1 int 0 getbit @@ -45,16 +47,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 4 -load 4 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 5 +frame_bury 2 frame_dig -1 -load 4 +frame_dig 1 concat -load 5 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal index dbb2b1b5e..765aa30d1 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal @@ -15,6 +15,16 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 4 +byte "" +dupn 1 +int 0 +dupn 97 +byte "" +dupn 1 +int 0 +dupn 10 frame_dig -1 int 0 getbit @@ -58,16 +68,16 @@ concat load 2 concat load 3 -store 14 -load 14 -store 13 +store 9 +load 9 +store 8 int 36 -store 12 -load 12 +frame_bury 117 +frame_dig 117 itob extract 6 0 concat -load 13 +load 8 concat frame_bury 0 retsub @@ -76,64 +86,67 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 6 -load 6 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 7 +frame_bury 2 frame_dig -1 -store 11 -load 11 -store 10 +store 7 +load 7 +store 6 int 6 -store 8 -load 8 -load 11 +frame_bury 3 +frame_dig 3 +load 7 len + -store 9 -load 9 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 8 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 7 load 6 -store 11 -load 10 -load 11 +load 7 concat -store 10 -load 9 -store 8 -load 8 -load 11 +store 6 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 7 len + -store 9 -load 9 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 8 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 7 +load 6 load 7 -store 11 -load 10 -load 11 concat -store 10 -load 9 -store 8 -load 8 +store 6 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 10 +load 6 concat frame_bury 0 retsub @@ -181,451 +194,453 @@ retsub arraycomplement_5: proto 1 1 byte "" +int 0 +dupn 97 frame_dig -1 int 1 int 0 * getbyte -store 15 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 16 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 17 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 18 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 19 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 20 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 21 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 22 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 23 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 24 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 25 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 26 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 27 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 28 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 29 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 30 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 31 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 32 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 33 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 34 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 35 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 36 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 37 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 38 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 39 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 40 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 41 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 42 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 43 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 44 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 45 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 46 -load 15 +frame_bury 32 +frame_dig 1 callsub numericalcomp_4 -store 15 -load 16 +frame_bury 1 +frame_dig 2 callsub numericalcomp_4 -store 16 -load 17 +frame_bury 2 +frame_dig 3 callsub numericalcomp_4 -store 17 -load 18 +frame_bury 3 +frame_dig 4 callsub numericalcomp_4 -store 18 -load 19 +frame_bury 4 +frame_dig 5 callsub numericalcomp_4 -store 19 -load 20 +frame_bury 5 +frame_dig 6 callsub numericalcomp_4 -store 20 -load 21 +frame_bury 6 +frame_dig 7 callsub numericalcomp_4 -store 21 -load 22 +frame_bury 7 +frame_dig 8 callsub numericalcomp_4 -store 22 -load 23 +frame_bury 8 +frame_dig 9 callsub numericalcomp_4 -store 23 -load 24 +frame_bury 9 +frame_dig 10 callsub numericalcomp_4 -store 24 -load 25 +frame_bury 10 +frame_dig 11 callsub numericalcomp_4 -store 25 -load 26 +frame_bury 11 +frame_dig 12 callsub numericalcomp_4 -store 26 -load 27 +frame_bury 12 +frame_dig 13 callsub numericalcomp_4 -store 27 -load 28 +frame_bury 13 +frame_dig 14 callsub numericalcomp_4 -store 28 -load 29 +frame_bury 14 +frame_dig 15 callsub numericalcomp_4 -store 29 -load 30 +frame_bury 15 +frame_dig 16 callsub numericalcomp_4 -store 30 -load 31 +frame_bury 16 +frame_dig 17 callsub numericalcomp_4 -store 31 -load 32 +frame_bury 17 +frame_dig 18 callsub numericalcomp_4 -store 32 -load 33 +frame_bury 18 +frame_dig 19 callsub numericalcomp_4 -store 33 -load 34 +frame_bury 19 +frame_dig 20 callsub numericalcomp_4 -store 34 -load 35 +frame_bury 20 +frame_dig 21 callsub numericalcomp_4 -store 35 -load 36 +frame_bury 21 +frame_dig 22 callsub numericalcomp_4 -store 36 -load 37 +frame_bury 22 +frame_dig 23 callsub numericalcomp_4 -store 37 -load 38 +frame_bury 23 +frame_dig 24 callsub numericalcomp_4 -store 38 -load 39 +frame_bury 24 +frame_dig 25 callsub numericalcomp_4 -store 39 -load 40 +frame_bury 25 +frame_dig 26 callsub numericalcomp_4 -store 40 -load 41 +frame_bury 26 +frame_dig 27 callsub numericalcomp_4 -store 41 -load 42 +frame_bury 27 +frame_dig 28 callsub numericalcomp_4 -store 42 -load 43 +frame_bury 28 +frame_dig 29 callsub numericalcomp_4 -store 43 -load 44 +frame_bury 29 +frame_dig 30 callsub numericalcomp_4 -store 44 -load 45 +frame_bury 30 +frame_dig 31 callsub numericalcomp_4 -store 45 -load 46 +frame_bury 31 +frame_dig 32 callsub numericalcomp_4 -store 46 +frame_bury 32 byte 0x00 int 0 -load 15 +frame_dig 1 setbyte byte 0x00 int 0 -load 16 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 17 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 18 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 19 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 20 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 21 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 22 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 23 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 24 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 25 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 26 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 27 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 28 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 29 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 30 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 31 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 36 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 37 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 38 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 39 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 40 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 41 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 42 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 43 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 44 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 45 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 46 +frame_dig 32 setbyte concat frame_bury 0 @@ -635,6 +650,8 @@ retsub stringreverse_6: proto 1 1 byte "" +int 0 +dupn 8 frame_dig -1 int 1 int 0 @@ -642,7 +659,7 @@ int 0 int 2 + getbyte -store 49 +frame_bury 3 frame_dig -1 int 1 int 1 @@ -650,7 +667,7 @@ int 1 int 2 + getbyte -store 48 +frame_bury 2 frame_dig -1 int 1 int 2 @@ -658,24 +675,24 @@ int 2 int 2 + getbyte -store 47 +frame_bury 1 int 3 -store 50 -load 50 +frame_bury 9 +frame_dig 9 itob extract 6 0 byte 0x00 int 0 -load 47 +frame_dig 1 setbyte byte 0x00 int 0 -load 48 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 49 +frame_dig 3 setbyte concat concat diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal index ac2ca105f..664c612c0 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal @@ -15,6 +15,26 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +byte "" +dupn 3 +int 0 +dupn 3 +byte "" +dupn 1 +int 0 +dupn 97 +byte "" +dupn 1 +int 0 +dupn 8 +byte "" +dupn 1 +int 0 +byte "" +int 0 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -70,37 +90,37 @@ concat load 2 concat load 3 -store 29 -load 29 -store 28 +store 14 +load 14 +store 13 int 38 -store 26 -load 26 -load 29 +store 11 +load 11 +load 14 len + -store 27 -load 27 +store 12 +load 12 int 65536 < assert -load 26 +load 11 itob extract 6 0 concat load 4 -store 29 -load 28 -load 29 -concat -store 28 -load 27 -store 26 -load 26 +store 14 +load 13 +load 14 +concat +store 13 +load 12 +store 11 +load 11 itob extract 6 0 concat -load 28 +load 13 concat frame_bury 0 retsub @@ -109,6 +129,9 @@ retsub arraycomplement_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 4 frame_dig -1 frame_dig -1 int 2 @@ -125,8 +148,8 @@ int 1 frame_dig -1 int 0 extract_uint16 -store 15 -load 15 +frame_bury 3 +frame_dig 3 == bnz arraycomplement_1_l5 frame_dig -1 @@ -142,7 +165,7 @@ int 2 + arraycomplement_1_l2: substring3 -store 13 +frame_bury 1 frame_dig -1 frame_dig -1 int 2 @@ -159,8 +182,8 @@ int 1 frame_dig -1 int 0 extract_uint16 -store 16 -load 16 +frame_bury 4 +frame_dig 4 == bnz arraycomplement_1_l4 frame_dig -1 @@ -185,49 +208,49 @@ len b arraycomplement_1_l2 arraycomplement_1_l6: substring3 -store 14 -load 13 +frame_bury 2 +frame_dig 1 callsub tuplecomplement_0 -store 13 -load 14 +frame_bury 1 +frame_dig 2 callsub tuplecomplement_0 -store 14 +frame_bury 2 int 2 -store 21 -load 21 +frame_bury 7 +frame_dig 7 itob extract 6 0 -load 13 -store 20 -load 20 -store 19 +frame_dig 1 +store 10 +load 10 +store 9 int 4 -store 17 -load 17 -load 20 +frame_bury 5 +frame_dig 5 +load 10 len + -store 18 -load 18 +frame_bury 6 +frame_dig 6 int 65536 < assert -load 17 +frame_dig 5 itob extract 6 0 -load 14 -store 20 -load 19 -load 20 +frame_dig 2 +store 10 +load 9 +load 10 concat -store 19 -load 18 -store 17 -load 17 +store 9 +frame_dig 6 +frame_bury 5 +frame_dig 5 itob extract 6 0 concat -load 19 +load 9 concat concat frame_bury 0 @@ -237,64 +260,67 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 7 -load 7 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 8 +frame_bury 2 frame_dig -1 -store 12 -load 12 -store 11 +store 8 +load 8 +store 7 int 6 -store 9 -load 9 -load 12 +frame_bury 3 +frame_dig 3 +load 8 len + -store 10 -load 10 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 9 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 8 load 7 -store 12 -load 11 -load 12 +load 8 concat -store 11 -load 10 -store 9 -load 9 -load 12 +store 7 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 8 len + -store 10 -load 10 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 9 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 8 +load 7 load 8 -store 12 -load 11 -load 12 concat -store 11 -load 10 -store 9 -load 9 +store 7 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 11 +load 7 concat frame_bury 0 retsub @@ -342,451 +368,453 @@ retsub arraycomplement_6: proto 1 1 byte "" +int 0 +dupn 97 frame_dig -1 int 1 int 0 * getbyte -store 30 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 31 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 32 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 33 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 34 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 35 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 36 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 37 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 38 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 39 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 40 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 41 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 42 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 43 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 44 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 45 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 46 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 47 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 48 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 49 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 50 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 51 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 52 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 53 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 54 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 55 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 56 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 57 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 58 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 59 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 60 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 61 -load 30 +frame_bury 32 +frame_dig 1 callsub numericalcomp_5 -store 30 -load 31 +frame_bury 1 +frame_dig 2 callsub numericalcomp_5 -store 31 -load 32 +frame_bury 2 +frame_dig 3 callsub numericalcomp_5 -store 32 -load 33 +frame_bury 3 +frame_dig 4 callsub numericalcomp_5 -store 33 -load 34 +frame_bury 4 +frame_dig 5 callsub numericalcomp_5 -store 34 -load 35 +frame_bury 5 +frame_dig 6 callsub numericalcomp_5 -store 35 -load 36 +frame_bury 6 +frame_dig 7 callsub numericalcomp_5 -store 36 -load 37 +frame_bury 7 +frame_dig 8 callsub numericalcomp_5 -store 37 -load 38 +frame_bury 8 +frame_dig 9 callsub numericalcomp_5 -store 38 -load 39 +frame_bury 9 +frame_dig 10 callsub numericalcomp_5 -store 39 -load 40 +frame_bury 10 +frame_dig 11 callsub numericalcomp_5 -store 40 -load 41 +frame_bury 11 +frame_dig 12 callsub numericalcomp_5 -store 41 -load 42 +frame_bury 12 +frame_dig 13 callsub numericalcomp_5 -store 42 -load 43 +frame_bury 13 +frame_dig 14 callsub numericalcomp_5 -store 43 -load 44 +frame_bury 14 +frame_dig 15 callsub numericalcomp_5 -store 44 -load 45 +frame_bury 15 +frame_dig 16 callsub numericalcomp_5 -store 45 -load 46 +frame_bury 16 +frame_dig 17 callsub numericalcomp_5 -store 46 -load 47 +frame_bury 17 +frame_dig 18 callsub numericalcomp_5 -store 47 -load 48 +frame_bury 18 +frame_dig 19 callsub numericalcomp_5 -store 48 -load 49 +frame_bury 19 +frame_dig 20 callsub numericalcomp_5 -store 49 -load 50 +frame_bury 20 +frame_dig 21 callsub numericalcomp_5 -store 50 -load 51 +frame_bury 21 +frame_dig 22 callsub numericalcomp_5 -store 51 -load 52 +frame_bury 22 +frame_dig 23 callsub numericalcomp_5 -store 52 -load 53 +frame_bury 23 +frame_dig 24 callsub numericalcomp_5 -store 53 -load 54 +frame_bury 24 +frame_dig 25 callsub numericalcomp_5 -store 54 -load 55 +frame_bury 25 +frame_dig 26 callsub numericalcomp_5 -store 55 -load 56 +frame_bury 26 +frame_dig 27 callsub numericalcomp_5 -store 56 -load 57 +frame_bury 27 +frame_dig 28 callsub numericalcomp_5 -store 57 -load 58 +frame_bury 28 +frame_dig 29 callsub numericalcomp_5 -store 58 -load 59 +frame_bury 29 +frame_dig 30 callsub numericalcomp_5 -store 59 -load 60 +frame_bury 30 +frame_dig 31 callsub numericalcomp_5 -store 60 -load 61 +frame_bury 31 +frame_dig 32 callsub numericalcomp_5 -store 61 +frame_bury 32 byte 0x00 int 0 -load 30 +frame_dig 1 setbyte byte 0x00 int 0 -load 31 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 36 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 37 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 38 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 39 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 40 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 41 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 42 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 43 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 44 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 45 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 46 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 47 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 48 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 49 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 50 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 51 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 52 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 53 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 54 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 55 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 56 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 57 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 58 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 59 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 60 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 61 +frame_dig 32 setbyte concat frame_bury 0 @@ -796,6 +824,8 @@ retsub stringreverse_7: proto 1 1 byte "" +int 0 +dupn 8 frame_dig -1 int 1 int 0 @@ -803,7 +833,7 @@ int 0 int 2 + getbyte -store 64 +frame_bury 3 frame_dig -1 int 1 int 1 @@ -811,7 +841,7 @@ int 1 int 2 + getbyte -store 63 +frame_bury 2 frame_dig -1 int 1 int 2 @@ -819,24 +849,24 @@ int 2 int 2 + getbyte -store 62 +frame_bury 1 int 3 -store 65 -load 65 +frame_bury 9 +frame_dig 9 itob extract 6 0 byte 0x00 int 0 -load 62 +frame_dig 1 setbyte byte 0x00 int 0 -load 63 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 64 +frame_dig 3 setbyte concat concat @@ -847,9 +877,28 @@ retsub tuplecomplement_8: proto 1 1 byte "" +int 0 +byte "" +int 0 +byte "" +dupn 2 +int 0 +dupn 1 +byte "" +dupn 1 +int 0 +dupn 97 +byte "" +dupn 6 +int 0 +dupn 3 +byte "" +dupn 4 +int 0 +dupn 2 frame_dig -1 extract 0 32 -store 22 +frame_bury 2 frame_dig -1 frame_dig -1 int 32 @@ -858,7 +907,7 @@ frame_dig -1 int 34 extract_uint16 substring3 -store 23 +frame_bury 3 frame_dig -1 frame_dig -1 int 34 @@ -867,7 +916,7 @@ frame_dig -1 int 36 extract_uint16 substring3 -store 24 +frame_bury 4 frame_dig -1 frame_dig -1 int 36 @@ -875,73 +924,73 @@ extract_uint16 dig 1 len substring3 -store 25 -load 22 +frame_bury 5 +frame_dig 2 callsub arraycomplement_10 -store 22 -load 23 +frame_bury 2 +frame_dig 3 callsub arraycomplement_12 -store 23 -load 24 +frame_bury 3 +frame_dig 4 callsub stringreverse_13 -store 24 -load 25 +frame_bury 4 +frame_dig 5 callsub arraycomplement_15 -store 25 -load 22 -load 23 -store 74 -load 74 -store 73 +frame_bury 5 +frame_dig 2 +frame_dig 3 +store 18 +load 18 +store 17 int 38 -store 71 -load 71 -load 74 +store 15 +load 15 +load 18 len + -store 72 -load 72 +store 16 +load 16 int 65536 < assert -load 71 +load 15 itob extract 6 0 concat -load 24 -store 74 -load 73 -load 74 -concat -store 73 -load 72 -store 71 -load 71 -load 74 +frame_dig 4 +store 18 +load 17 +load 18 +concat +store 17 +load 16 +store 15 +load 15 +load 18 len + -store 72 -load 72 +store 16 +load 16 int 65536 < assert -load 71 +load 15 itob extract 6 0 concat -load 25 -store 74 -load 73 -load 74 +frame_dig 5 +store 18 +load 17 +load 18 concat -store 73 -load 72 -store 71 -load 71 +store 17 +load 16 +store 15 +load 15 itob extract 6 0 concat -load 73 +load 17 concat frame_bury 0 retsub @@ -964,451 +1013,453 @@ retsub arraycomplement_10: proto 1 1 byte "" +int 0 +dupn 97 frame_dig -1 int 1 int 0 * getbyte -store 75 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 76 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 77 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 78 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 79 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 80 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 81 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 82 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 83 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 84 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 85 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 86 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 87 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 88 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 89 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 90 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 91 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 92 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 93 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 94 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 95 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 96 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 97 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 98 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 99 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 100 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 101 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 102 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 103 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 104 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 105 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 106 -load 75 +frame_bury 32 +frame_dig 1 callsub numericalcomp_9 -store 75 -load 76 +frame_bury 1 +frame_dig 2 callsub numericalcomp_9 -store 76 -load 77 +frame_bury 2 +frame_dig 3 callsub numericalcomp_9 -store 77 -load 78 +frame_bury 3 +frame_dig 4 callsub numericalcomp_9 -store 78 -load 79 +frame_bury 4 +frame_dig 5 callsub numericalcomp_9 -store 79 -load 80 +frame_bury 5 +frame_dig 6 callsub numericalcomp_9 -store 80 -load 81 +frame_bury 6 +frame_dig 7 callsub numericalcomp_9 -store 81 -load 82 +frame_bury 7 +frame_dig 8 callsub numericalcomp_9 -store 82 -load 83 +frame_bury 8 +frame_dig 9 callsub numericalcomp_9 -store 83 -load 84 +frame_bury 9 +frame_dig 10 callsub numericalcomp_9 -store 84 -load 85 +frame_bury 10 +frame_dig 11 callsub numericalcomp_9 -store 85 -load 86 +frame_bury 11 +frame_dig 12 callsub numericalcomp_9 -store 86 -load 87 +frame_bury 12 +frame_dig 13 callsub numericalcomp_9 -store 87 -load 88 +frame_bury 13 +frame_dig 14 callsub numericalcomp_9 -store 88 -load 89 +frame_bury 14 +frame_dig 15 callsub numericalcomp_9 -store 89 -load 90 +frame_bury 15 +frame_dig 16 callsub numericalcomp_9 -store 90 -load 91 +frame_bury 16 +frame_dig 17 callsub numericalcomp_9 -store 91 -load 92 +frame_bury 17 +frame_dig 18 callsub numericalcomp_9 -store 92 -load 93 +frame_bury 18 +frame_dig 19 callsub numericalcomp_9 -store 93 -load 94 +frame_bury 19 +frame_dig 20 callsub numericalcomp_9 -store 94 -load 95 +frame_bury 20 +frame_dig 21 callsub numericalcomp_9 -store 95 -load 96 +frame_bury 21 +frame_dig 22 callsub numericalcomp_9 -store 96 -load 97 +frame_bury 22 +frame_dig 23 callsub numericalcomp_9 -store 97 -load 98 +frame_bury 23 +frame_dig 24 callsub numericalcomp_9 -store 98 -load 99 +frame_bury 24 +frame_dig 25 callsub numericalcomp_9 -store 99 -load 100 +frame_bury 25 +frame_dig 26 callsub numericalcomp_9 -store 100 -load 101 +frame_bury 26 +frame_dig 27 callsub numericalcomp_9 -store 101 -load 102 +frame_bury 27 +frame_dig 28 callsub numericalcomp_9 -store 102 -load 103 +frame_bury 28 +frame_dig 29 callsub numericalcomp_9 -store 103 -load 104 +frame_bury 29 +frame_dig 30 callsub numericalcomp_9 -store 104 -load 105 +frame_bury 30 +frame_dig 31 callsub numericalcomp_9 -store 105 -load 106 +frame_bury 31 +frame_dig 32 callsub numericalcomp_9 -store 106 +frame_bury 32 byte 0x00 int 0 -load 75 +frame_dig 1 setbyte byte 0x00 int 0 -load 76 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 77 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 78 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 79 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 80 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 81 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 82 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 83 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 84 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 85 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 86 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 87 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 88 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 89 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 90 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 91 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 92 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 93 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 94 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 95 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 96 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 97 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 98 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 99 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 100 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 101 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 102 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 103 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 104 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 105 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 106 +frame_dig 32 setbyte concat frame_bury 0 @@ -1418,10 +1469,37 @@ retsub tuplecomplement_11: proto 1 1 byte "" +dupn 1 +int 0 +dupn 3 +byte "" +dupn 4 +int 0 +dupn 2 +byte "" +dupn 1 +int 0 +dupn 8 +byte "" +dupn 1 +int 0 +dupn 8 +byte "" +dupn 1 +int 0 +dupn 11 +byte "" +dupn 1 +int 0 +dupn 7 +byte "" +dupn 1 +int 0 +dupn 7 frame_dig -1 int 0 extract_uint32 -store 66 +frame_bury 3 frame_dig -1 frame_dig -1 int 4 @@ -1429,55 +1507,55 @@ extract_uint16 dig 1 len substring3 -store 67 +frame_bury 4 frame_dig -1 extract 6 1 -store 68 +frame_bury 5 frame_dig -1 extract 7 1 -store 69 +frame_bury 6 frame_dig -1 int 8 getbyte -store 70 -load 66 +frame_bury 7 +frame_dig 3 callsub numericalcomp_16 -store 66 -load 67 +frame_bury 3 +frame_dig 4 callsub arraycomplement_18 -store 67 -load 68 +frame_bury 4 +frame_dig 5 callsub arraycomplement_20 -store 68 -load 69 +frame_bury 5 +frame_dig 6 callsub tuplecomplement_21 -store 69 -load 70 +frame_bury 6 +frame_dig 7 callsub numericalcomp_22 -store 70 -load 66 +frame_bury 7 +frame_dig 3 itob extract 4 0 -load 67 -store 116 -load 116 -store 115 +frame_dig 4 +store 22 +load 22 +store 21 int 9 -store 114 -load 114 +frame_bury 68 +frame_dig 68 itob extract 6 0 concat -load 68 +frame_dig 5 concat -load 69 +frame_dig 6 concat byte 0x00 int 0 -load 70 +frame_dig 7 setbyte concat -load 115 +load 21 concat frame_bury 0 retsub @@ -1486,6 +1564,9 @@ retsub arraycomplement_12: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 frame_dig -1 int 2 @@ -1507,7 +1588,7 @@ int 2 extract_uint16 arraycomplement_12_l2: substring3 -store 107 +frame_bury 1 frame_dig -1 frame_dig -1 int 2 @@ -1538,44 +1619,44 @@ len b arraycomplement_12_l2 arraycomplement_12_l6: substring3 -store 108 -load 107 +frame_bury 2 +frame_dig 1 callsub tuplecomplement_11 -store 107 -load 108 +frame_bury 1 +frame_dig 2 callsub tuplecomplement_11 -store 108 -load 107 -store 112 -load 112 -store 111 +frame_bury 2 +frame_dig 1 +store 20 +load 20 +store 19 int 4 -store 109 -load 109 -load 112 +frame_bury 3 +frame_dig 3 +load 20 len + -store 110 -load 110 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 109 +frame_dig 3 itob extract 6 0 -load 108 -store 112 -load 111 -load 112 -concat -store 111 -load 110 -store 109 -load 109 +frame_dig 2 +store 20 +load 19 +load 20 +concat +store 19 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 111 +load 19 concat frame_bury 0 retsub @@ -1584,6 +1665,8 @@ retsub stringreverse_13: proto 1 1 byte "" +int 0 +dupn 8 frame_dig -1 int 1 int 0 @@ -1591,7 +1674,7 @@ int 0 int 2 + getbyte -store 136 +frame_bury 3 frame_dig -1 int 1 int 1 @@ -1599,7 +1682,7 @@ int 1 int 2 + getbyte -store 135 +frame_bury 2 frame_dig -1 int 1 int 2 @@ -1607,24 +1690,24 @@ int 2 int 2 + getbyte -store 134 +frame_bury 1 int 3 -store 137 -load 137 +frame_bury 9 +frame_dig 9 itob extract 6 0 byte 0x00 int 0 -load 134 +frame_dig 1 setbyte byte 0x00 int 0 -load 135 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 136 +frame_dig 3 setbyte concat concat @@ -1646,47 +1729,49 @@ retsub arraycomplement_15: proto 1 1 byte "" +int 0 +dupn 5 frame_dig -1 int 0 int 16 + getbit -store 138 +frame_bury 1 frame_dig -1 int 1 int 16 + getbit -store 139 +frame_bury 2 frame_dig -1 int 2 int 16 + getbit -store 140 -load 138 +frame_bury 3 +frame_dig 1 callsub boolcomp_14 -store 138 -load 139 +frame_bury 1 +frame_dig 2 callsub boolcomp_14 -store 139 -load 140 +frame_bury 2 +frame_dig 3 callsub boolcomp_14 -store 140 +frame_bury 3 int 3 -store 141 -load 141 +frame_bury 6 +frame_dig 6 itob extract 6 0 byte 0x00 int 0 -load 138 +frame_dig 1 setbit int 1 -load 139 +frame_dig 2 setbit int 2 -load 140 +frame_dig 3 setbit concat frame_bury 0 @@ -1710,6 +1795,8 @@ retsub stringreverse_17: proto 1 1 byte "" +int 0 +dupn 8 frame_dig -1 int 1 int 0 @@ -1717,7 +1804,7 @@ int 0 int 2 + getbyte -store 130 +frame_bury 3 frame_dig -1 int 1 int 1 @@ -1725,7 +1812,7 @@ int 1 int 2 + getbyte -store 129 +frame_bury 2 frame_dig -1 int 1 int 2 @@ -1733,24 +1820,24 @@ int 2 int 2 + getbyte -store 128 +frame_bury 1 int 3 -store 131 -load 131 +frame_bury 9 +frame_dig 9 itob extract 6 0 byte 0x00 int 0 -load 128 +frame_dig 1 setbyte byte 0x00 int 0 -load 129 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 130 +frame_dig 3 setbyte concat concat @@ -1761,6 +1848,21 @@ retsub arraycomplement_18: proto 1 1 byte "" +dupn 3 +int 0 +dupn 2 +byte "" +dupn 1 +int 0 +dupn 8 +byte "" +dupn 1 +int 0 +dupn 8 +byte "" +dupn 1 +int 0 +dupn 11 frame_dig -1 frame_dig -1 int 2 @@ -1777,8 +1879,8 @@ int 1 frame_dig -1 int 0 extract_uint16 -store 120 -load 120 +frame_bury 4 +frame_dig 4 == bnz arraycomplement_18_l8 frame_dig -1 @@ -1794,7 +1896,7 @@ int 2 + arraycomplement_18_l2: substring3 -store 117 +frame_bury 1 frame_dig -1 frame_dig -1 int 2 @@ -1811,8 +1913,8 @@ int 1 frame_dig -1 int 0 extract_uint16 -store 121 -load 121 +frame_bury 5 +frame_dig 5 == bnz arraycomplement_18_l7 frame_dig -1 @@ -1828,7 +1930,7 @@ int 2 + arraycomplement_18_l4: substring3 -store 118 +frame_bury 2 frame_dig -1 frame_dig -1 int 2 @@ -1845,8 +1947,8 @@ int 1 frame_dig -1 int 0 extract_uint16 -store 122 -load 122 +frame_bury 6 +frame_dig 6 == bnz arraycomplement_18_l6 frame_dig -1 @@ -1875,73 +1977,73 @@ len b arraycomplement_18_l2 arraycomplement_18_l9: substring3 -store 119 -load 117 +frame_bury 3 +frame_dig 1 callsub stringreverse_17 -store 117 -load 118 +frame_bury 1 +frame_dig 2 callsub stringreverse_17 -store 118 -load 119 +frame_bury 2 +frame_dig 3 callsub stringreverse_17 -store 119 +frame_bury 3 int 3 -store 127 -load 127 +frame_bury 42 +frame_dig 42 itob extract 6 0 -load 117 -store 126 -load 126 -store 125 +frame_dig 1 +store 24 +load 24 +store 23 int 6 -store 123 -load 123 -load 126 +frame_bury 40 +frame_dig 40 +load 24 len + -store 124 -load 124 +frame_bury 41 +frame_dig 41 int 65536 < assert -load 123 +frame_dig 40 itob extract 6 0 -load 118 -store 126 -load 125 -load 126 -concat -store 125 -load 124 -store 123 -load 123 -load 126 +frame_dig 2 +store 24 +load 23 +load 24 +concat +store 23 +frame_dig 41 +frame_bury 40 +frame_dig 40 +load 24 len + -store 124 -load 124 +frame_bury 41 +frame_dig 41 int 65536 < assert -load 123 +frame_dig 40 itob extract 6 0 concat -load 119 -store 126 -load 125 -load 126 +frame_dig 3 +store 24 +load 23 +load 24 concat -store 125 -load 124 -store 123 -load 123 +store 23 +frame_dig 41 +frame_bury 40 +frame_dig 40 itob extract 6 0 concat -load 125 +load 23 concat concat frame_bury 0 @@ -1962,26 +2064,28 @@ retsub arraycomplement_20: proto 1 1 byte "" +int 0 +dupn 7 frame_dig -1 int 0 getbit -store 132 +frame_bury 1 frame_dig -1 int 1 getbit -store 133 -load 132 +frame_bury 2 +frame_dig 1 callsub boolcomp_19 -store 132 -load 133 +frame_bury 1 +frame_dig 2 callsub boolcomp_19 -store 133 +frame_bury 2 byte 0x00 int 0 -load 132 +frame_dig 1 setbit int 1 -load 133 +frame_dig 2 setbit frame_bury 0 retsub @@ -1990,16 +2094,18 @@ retsub tuplecomplement_21: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 getbyte -store 113 -load 113 +frame_bury 3 +frame_dig 3 callsub numericalcomp_23 -store 113 +frame_bury 3 byte 0x00 int 0 -load 113 +frame_dig 3 setbyte frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal index ac3980f9e..87a31aea2 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal @@ -15,6 +15,16 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 4 +byte "" +dupn 1 +int 0 +dupn 97 +byte "" +dupn 1 +int 0 +dupn 12 frame_dig -1 int 0 getbit @@ -65,19 +75,19 @@ concat load 2 concat load 3 -store 15 -load 15 -store 14 +store 10 +load 10 +store 9 int 44 -store 13 -load 13 +frame_bury 119 +frame_dig 119 itob extract 6 0 concat load 4 itob concat -load 14 +load 9 concat frame_bury 0 retsub @@ -86,64 +96,67 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 7 -load 7 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 8 +frame_bury 2 frame_dig -1 -store 12 -load 12 -store 11 +store 8 +load 8 +store 7 int 6 -store 9 -load 9 -load 12 +frame_bury 3 +frame_dig 3 +load 8 len + -store 10 -load 10 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 9 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 8 load 7 -store 12 -load 11 -load 12 +load 8 concat -store 11 -load 10 -store 9 -load 9 -load 12 +store 7 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 8 len + -store 10 -load 10 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 9 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 8 +load 7 load 8 -store 12 -load 11 -load 12 concat -store 11 -load 10 -store 9 -load 9 +store 7 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 11 +load 7 concat frame_bury 0 retsub @@ -191,451 +204,453 @@ retsub arraycomplement_5: proto 1 1 byte "" +int 0 +dupn 97 frame_dig -1 int 1 int 0 * getbyte -store 16 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 17 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 18 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 19 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 20 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 21 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 22 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 23 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 24 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 25 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 26 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 27 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 28 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 29 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 30 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 31 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 32 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 33 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 34 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 35 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 36 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 37 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 38 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 39 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 40 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 41 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 42 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 43 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 44 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 45 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 46 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 47 -load 16 +frame_bury 32 +frame_dig 1 callsub numericalcomp_4 -store 16 -load 17 +frame_bury 1 +frame_dig 2 callsub numericalcomp_4 -store 17 -load 18 +frame_bury 2 +frame_dig 3 callsub numericalcomp_4 -store 18 -load 19 +frame_bury 3 +frame_dig 4 callsub numericalcomp_4 -store 19 -load 20 +frame_bury 4 +frame_dig 5 callsub numericalcomp_4 -store 20 -load 21 +frame_bury 5 +frame_dig 6 callsub numericalcomp_4 -store 21 -load 22 +frame_bury 6 +frame_dig 7 callsub numericalcomp_4 -store 22 -load 23 +frame_bury 7 +frame_dig 8 callsub numericalcomp_4 -store 23 -load 24 +frame_bury 8 +frame_dig 9 callsub numericalcomp_4 -store 24 -load 25 +frame_bury 9 +frame_dig 10 callsub numericalcomp_4 -store 25 -load 26 +frame_bury 10 +frame_dig 11 callsub numericalcomp_4 -store 26 -load 27 +frame_bury 11 +frame_dig 12 callsub numericalcomp_4 -store 27 -load 28 +frame_bury 12 +frame_dig 13 callsub numericalcomp_4 -store 28 -load 29 +frame_bury 13 +frame_dig 14 callsub numericalcomp_4 -store 29 -load 30 +frame_bury 14 +frame_dig 15 callsub numericalcomp_4 -store 30 -load 31 +frame_bury 15 +frame_dig 16 callsub numericalcomp_4 -store 31 -load 32 +frame_bury 16 +frame_dig 17 callsub numericalcomp_4 -store 32 -load 33 +frame_bury 17 +frame_dig 18 callsub numericalcomp_4 -store 33 -load 34 +frame_bury 18 +frame_dig 19 callsub numericalcomp_4 -store 34 -load 35 +frame_bury 19 +frame_dig 20 callsub numericalcomp_4 -store 35 -load 36 +frame_bury 20 +frame_dig 21 callsub numericalcomp_4 -store 36 -load 37 +frame_bury 21 +frame_dig 22 callsub numericalcomp_4 -store 37 -load 38 +frame_bury 22 +frame_dig 23 callsub numericalcomp_4 -store 38 -load 39 +frame_bury 23 +frame_dig 24 callsub numericalcomp_4 -store 39 -load 40 +frame_bury 24 +frame_dig 25 callsub numericalcomp_4 -store 40 -load 41 +frame_bury 25 +frame_dig 26 callsub numericalcomp_4 -store 41 -load 42 +frame_bury 26 +frame_dig 27 callsub numericalcomp_4 -store 42 -load 43 +frame_bury 27 +frame_dig 28 callsub numericalcomp_4 -store 43 -load 44 +frame_bury 28 +frame_dig 29 callsub numericalcomp_4 -store 44 -load 45 +frame_bury 29 +frame_dig 30 callsub numericalcomp_4 -store 45 -load 46 +frame_bury 30 +frame_dig 31 callsub numericalcomp_4 -store 46 -load 47 +frame_bury 31 +frame_dig 32 callsub numericalcomp_4 -store 47 +frame_bury 32 byte 0x00 int 0 -load 16 +frame_dig 1 setbyte byte 0x00 int 0 -load 17 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 18 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 19 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 20 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 21 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 22 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 23 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 24 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 25 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 26 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 27 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 28 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 29 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 30 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 31 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 36 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 37 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 38 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 39 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 40 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 41 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 42 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 43 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 44 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 45 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 46 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 47 +frame_dig 32 setbyte concat frame_bury 0 @@ -645,6 +660,8 @@ retsub stringreverse_6: proto 1 1 byte "" +int 0 +dupn 8 frame_dig -1 int 1 int 0 @@ -652,7 +669,7 @@ int 0 int 2 + getbyte -store 50 +frame_bury 3 frame_dig -1 int 1 int 1 @@ -660,7 +677,7 @@ int 1 int 2 + getbyte -store 49 +frame_bury 2 frame_dig -1 int 1 int 2 @@ -668,24 +685,24 @@ int 2 int 2 + getbyte -store 48 +frame_bury 1 int 3 -store 51 -load 51 +frame_bury 9 +frame_dig 9 itob extract 6 0 byte 0x00 int 0 -load 48 +frame_dig 1 setbyte byte 0x00 int 0 -load 49 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 50 +frame_dig 3 setbyte concat concat diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal index 8f04b8ad0..3b5d822da 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 7 frame_dig -1 int 0 getbit @@ -54,16 +56,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 5 -load 5 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 6 +frame_bury 2 frame_dig -1 -load 5 +frame_dig 1 concat -load 6 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal index 4a8d567ff..a6f374016 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 getbyte @@ -33,16 +35,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 3 -load 3 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 4 +frame_bury 2 frame_dig -1 -load 3 +frame_dig 1 concat -load 4 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal index a5fb0355f..8c66003b1 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 7 frame_dig -1 int 0 getbyte @@ -55,16 +57,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 5 -load 5 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 6 +frame_bury 2 frame_dig -1 -load 5 +frame_dig 1 concat -load 6 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal index 064b29fc8..93f1d6568 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal @@ -15,6 +15,20 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 +byte "" +dupn 1 +int 0 +dupn 13 +byte "" +dupn 1 +int 0 +dupn 7 +byte "" +dupn 1 +int 0 +dupn 94 frame_dig -1 extract 0 4 store 0 @@ -55,6 +69,9 @@ retsub arraycomplement_1: proto 1 1 byte "" +dupn 7 +int 0 +dupn 9 frame_dig -1 int 45 int 0 @@ -63,7 +80,7 @@ int 2 + int 45 extract3 -store 12 +frame_bury 1 frame_dig -1 int 45 int 1 @@ -72,7 +89,7 @@ int 2 + int 45 extract3 -store 13 +frame_bury 2 frame_dig -1 int 45 int 2 @@ -81,7 +98,7 @@ int 2 + int 45 extract3 -store 14 +frame_bury 3 frame_dig -1 int 45 int 3 @@ -90,7 +107,7 @@ int 2 + int 45 extract3 -store 15 +frame_bury 4 frame_dig -1 int 45 int 4 @@ -99,7 +116,7 @@ int 2 + int 45 extract3 -store 16 +frame_bury 5 frame_dig -1 int 45 int 5 @@ -108,7 +125,7 @@ int 2 + int 45 extract3 -store 17 +frame_bury 6 frame_dig -1 int 45 int 6 @@ -117,45 +134,45 @@ int 2 + int 45 extract3 -store 18 -load 12 +frame_bury 7 +frame_dig 1 callsub tuplecomplement_0 -store 12 -load 13 +frame_bury 1 +frame_dig 2 callsub tuplecomplement_0 -store 13 -load 14 +frame_bury 2 +frame_dig 3 callsub tuplecomplement_0 -store 14 -load 15 +frame_bury 3 +frame_dig 4 callsub tuplecomplement_0 -store 15 -load 16 +frame_bury 4 +frame_dig 5 callsub tuplecomplement_0 -store 16 -load 17 +frame_bury 5 +frame_dig 6 callsub tuplecomplement_0 -store 17 -load 18 +frame_bury 6 +frame_dig 7 callsub tuplecomplement_0 -store 18 +frame_bury 7 int 7 -store 19 -load 19 +frame_bury 17 +frame_dig 17 itob extract 6 0 -load 12 -load 13 +frame_dig 1 +frame_dig 2 concat -load 14 +frame_dig 3 concat -load 15 +frame_dig 4 concat -load 16 +frame_dig 5 concat -load 17 +frame_dig 6 concat -load 18 +frame_dig 7 concat concat frame_bury 0 @@ -165,64 +182,67 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 6 -load 6 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 7 +frame_bury 2 frame_dig -1 -store 11 -load 11 -store 10 +store 7 +load 7 +store 6 int 6 -store 8 -load 8 -load 11 +frame_bury 3 +frame_dig 3 +load 7 len + -store 9 -load 9 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 8 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 7 load 6 -store 11 -load 10 -load 11 -concat -store 10 -load 9 -store 8 -load 8 -load 11 +load 7 +concat +store 6 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 7 len + -store 9 -load 9 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 8 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 7 +load 6 load 7 -store 11 -load 10 -load 11 -concat -store 10 -load 9 -store 8 -load 8 +concat +store 6 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 10 +load 6 concat frame_bury 0 retsub @@ -245,59 +265,61 @@ retsub arraycomplement_4: proto 1 1 byte "" +int 0 +dupn 13 frame_dig -1 int 1 int 0 * getbyte -store 22 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 23 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 24 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 25 -load 22 +frame_bury 4 +frame_dig 1 callsub numericalcomp_3 -store 22 -load 23 +frame_bury 1 +frame_dig 2 callsub numericalcomp_3 -store 23 -load 24 +frame_bury 2 +frame_dig 3 callsub numericalcomp_3 -store 24 -load 25 +frame_bury 3 +frame_dig 4 callsub numericalcomp_3 -store 25 +frame_bury 4 byte 0x00 int 0 -load 22 +frame_dig 1 setbyte byte 0x00 int 0 -load 23 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 24 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 25 +frame_dig 4 setbyte concat frame_bury 0 @@ -307,26 +329,28 @@ retsub tuplecomplement_5: proto 1 1 byte "" +int 0 +dupn 5 frame_dig -1 int 0 getbit -store 20 +frame_bury 2 frame_dig -1 int 1 getbit -store 21 -load 20 +frame_bury 3 +frame_dig 2 callsub boolcomp_9 -store 20 -load 21 +frame_bury 2 +frame_dig 3 callsub boolcomp_10 -store 21 +frame_bury 3 byte 0x00 int 0 -load 20 +frame_dig 2 setbit int 1 -load 21 +frame_dig 3 setbit frame_bury 0 retsub @@ -359,451 +383,453 @@ retsub arraycomplement_8: proto 1 1 byte "" +int 0 +dupn 97 frame_dig -1 int 1 int 0 * getbyte -store 26 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 27 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 28 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 29 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 30 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 31 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 32 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 33 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 34 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 35 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 36 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 37 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 38 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 39 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 40 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 41 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 42 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 43 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 44 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 45 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 46 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 47 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 48 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 49 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 50 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 51 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 52 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 53 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 54 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 55 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 56 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 57 -load 26 +frame_bury 32 +frame_dig 1 callsub numericalcomp_7 -store 26 -load 27 +frame_bury 1 +frame_dig 2 callsub numericalcomp_7 -store 27 -load 28 +frame_bury 2 +frame_dig 3 callsub numericalcomp_7 -store 28 -load 29 +frame_bury 3 +frame_dig 4 callsub numericalcomp_7 -store 29 -load 30 +frame_bury 4 +frame_dig 5 callsub numericalcomp_7 -store 30 -load 31 +frame_bury 5 +frame_dig 6 callsub numericalcomp_7 -store 31 -load 32 +frame_bury 6 +frame_dig 7 callsub numericalcomp_7 -store 32 -load 33 +frame_bury 7 +frame_dig 8 callsub numericalcomp_7 -store 33 -load 34 +frame_bury 8 +frame_dig 9 callsub numericalcomp_7 -store 34 -load 35 +frame_bury 9 +frame_dig 10 callsub numericalcomp_7 -store 35 -load 36 +frame_bury 10 +frame_dig 11 callsub numericalcomp_7 -store 36 -load 37 +frame_bury 11 +frame_dig 12 callsub numericalcomp_7 -store 37 -load 38 +frame_bury 12 +frame_dig 13 callsub numericalcomp_7 -store 38 -load 39 +frame_bury 13 +frame_dig 14 callsub numericalcomp_7 -store 39 -load 40 +frame_bury 14 +frame_dig 15 callsub numericalcomp_7 -store 40 -load 41 +frame_bury 15 +frame_dig 16 callsub numericalcomp_7 -store 41 -load 42 +frame_bury 16 +frame_dig 17 callsub numericalcomp_7 -store 42 -load 43 +frame_bury 17 +frame_dig 18 callsub numericalcomp_7 -store 43 -load 44 +frame_bury 18 +frame_dig 19 callsub numericalcomp_7 -store 44 -load 45 +frame_bury 19 +frame_dig 20 callsub numericalcomp_7 -store 45 -load 46 +frame_bury 20 +frame_dig 21 callsub numericalcomp_7 -store 46 -load 47 +frame_bury 21 +frame_dig 22 callsub numericalcomp_7 -store 47 -load 48 +frame_bury 22 +frame_dig 23 callsub numericalcomp_7 -store 48 -load 49 +frame_bury 23 +frame_dig 24 callsub numericalcomp_7 -store 49 -load 50 +frame_bury 24 +frame_dig 25 callsub numericalcomp_7 -store 50 -load 51 +frame_bury 25 +frame_dig 26 callsub numericalcomp_7 -store 51 -load 52 +frame_bury 26 +frame_dig 27 callsub numericalcomp_7 -store 52 -load 53 +frame_bury 27 +frame_dig 28 callsub numericalcomp_7 -store 53 -load 54 +frame_bury 28 +frame_dig 29 callsub numericalcomp_7 -store 54 -load 55 +frame_bury 29 +frame_dig 30 callsub numericalcomp_7 -store 55 -load 56 +frame_bury 30 +frame_dig 31 callsub numericalcomp_7 -store 56 -load 57 +frame_bury 31 +frame_dig 32 callsub numericalcomp_7 -store 57 +frame_bury 32 byte 0x00 int 0 -load 26 +frame_dig 1 setbyte byte 0x00 int 0 -load 27 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 28 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 29 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 30 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 31 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 36 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 37 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 38 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 39 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 40 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 41 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 42 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 43 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 44 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 45 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 46 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 47 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 48 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 49 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 50 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 51 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 52 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 53 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 54 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 55 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 56 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 57 +frame_dig 32 setbyte concat frame_bury 0 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal index 3a683e4cf..e22555fe3 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 extract_uint16 @@ -32,16 +34,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 3 -load 3 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 4 +frame_bury 2 frame_dig -1 -load 3 +frame_dig 1 concat -load 4 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal index 47ddf0b4c..e8b2a9f45 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 7 frame_dig -1 int 0 extract_uint16 @@ -56,16 +58,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 5 -load 5 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 6 +frame_bury 2 frame_dig -1 -load 5 +frame_dig 1 concat -load 6 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal index a4b6b04a2..dd6a75d9f 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 extract_uint32 @@ -32,16 +34,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 3 -load 3 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 4 +frame_bury 2 frame_dig -1 -load 3 +frame_dig 1 concat -load 4 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal index 8a165cddc..002d38421 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 7 frame_dig -1 int 0 extract_uint32 @@ -55,16 +57,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 5 -load 5 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 6 +frame_bury 2 frame_dig -1 -load 5 +frame_dig 1 concat -load 6 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal index 5ba9c63c6..da53cd891 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 btoi store 0 @@ -30,16 +32,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 3 -load 3 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 4 +frame_bury 2 frame_dig -1 -load 3 +frame_dig 1 concat -load 4 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal index 33a5fb36c..ae607acd0 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 7 frame_dig -1 int 0 extract_uint64 @@ -53,16 +55,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 5 -load 5 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 6 +frame_bury 2 frame_dig -1 -load 5 +frame_dig 1 concat -load 6 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal index 4a8d567ff..a6f374016 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 getbyte @@ -33,16 +35,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 3 -load 3 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 4 +frame_bury 2 frame_dig -1 -load 3 +frame_dig 1 concat -load 4 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal index 853a8b269..f14028d0a 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal @@ -15,6 +15,8 @@ return tuplecomplement_0: proto 1 1 byte "" +int 0 +dupn 7 frame_dig -1 int 0 getbyte @@ -57,16 +59,19 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub tuplecomplement_0 -store 5 -load 5 +frame_bury 1 +frame_dig 1 callsub tuplecomplement_0 -store 6 +frame_bury 2 frame_dig -1 -load 5 +frame_dig 1 concat -load 6 +frame_dig 2 concat frame_bury 0 retsub diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal index d58d71f84..de35e5e09 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal @@ -29,451 +29,453 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 33 frame_dig -1 int 1 int 0 * getbyte -store 19 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 20 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 21 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 22 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 23 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 24 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 25 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 26 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 27 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 28 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 29 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 30 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 31 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 32 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 33 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 34 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 35 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 36 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 37 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 38 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 39 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 40 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 41 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 42 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 43 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 44 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 45 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 46 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 47 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 48 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 49 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 50 -load 19 +frame_bury 32 +frame_dig 1 callsub numericalcomp_0 -store 19 -load 20 +frame_bury 1 +frame_dig 2 callsub numericalcomp_0 -store 20 -load 21 +frame_bury 2 +frame_dig 3 callsub numericalcomp_0 -store 21 -load 22 +frame_bury 3 +frame_dig 4 callsub numericalcomp_0 -store 22 -load 23 +frame_bury 4 +frame_dig 5 callsub numericalcomp_0 -store 23 -load 24 +frame_bury 5 +frame_dig 6 callsub numericalcomp_0 -store 24 -load 25 +frame_bury 6 +frame_dig 7 callsub numericalcomp_0 -store 25 -load 26 +frame_bury 7 +frame_dig 8 callsub numericalcomp_0 -store 26 -load 27 +frame_bury 8 +frame_dig 9 callsub numericalcomp_0 -store 27 -load 28 +frame_bury 9 +frame_dig 10 callsub numericalcomp_0 -store 28 -load 29 +frame_bury 10 +frame_dig 11 callsub numericalcomp_0 -store 29 -load 30 +frame_bury 11 +frame_dig 12 callsub numericalcomp_0 -store 30 -load 31 +frame_bury 12 +frame_dig 13 callsub numericalcomp_0 -store 31 -load 32 +frame_bury 13 +frame_dig 14 callsub numericalcomp_0 -store 32 -load 33 +frame_bury 14 +frame_dig 15 callsub numericalcomp_0 -store 33 -load 34 +frame_bury 15 +frame_dig 16 callsub numericalcomp_0 -store 34 -load 35 +frame_bury 16 +frame_dig 17 callsub numericalcomp_0 -store 35 -load 36 +frame_bury 17 +frame_dig 18 callsub numericalcomp_0 -store 36 -load 37 +frame_bury 18 +frame_dig 19 callsub numericalcomp_0 -store 37 -load 38 +frame_bury 19 +frame_dig 20 callsub numericalcomp_0 -store 38 -load 39 +frame_bury 20 +frame_dig 21 callsub numericalcomp_0 -store 39 -load 40 +frame_bury 21 +frame_dig 22 callsub numericalcomp_0 -store 40 -load 41 +frame_bury 22 +frame_dig 23 callsub numericalcomp_0 -store 41 -load 42 +frame_bury 23 +frame_dig 24 callsub numericalcomp_0 -store 42 -load 43 +frame_bury 24 +frame_dig 25 callsub numericalcomp_0 -store 43 -load 44 +frame_bury 25 +frame_dig 26 callsub numericalcomp_0 -store 44 -load 45 +frame_bury 26 +frame_dig 27 callsub numericalcomp_0 -store 45 -load 46 +frame_bury 27 +frame_dig 28 callsub numericalcomp_0 -store 46 -load 47 +frame_bury 28 +frame_dig 29 callsub numericalcomp_0 -store 47 -load 48 +frame_bury 29 +frame_dig 30 callsub numericalcomp_0 -store 48 -load 49 +frame_bury 30 +frame_dig 31 callsub numericalcomp_0 -store 49 -load 50 +frame_bury 31 +frame_dig 32 callsub numericalcomp_0 -store 50 +frame_bury 32 byte 0x00 int 0 -load 19 +frame_dig 1 setbyte byte 0x00 int 0 -load 20 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 21 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 22 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 23 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 24 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 25 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 26 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 27 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 28 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 29 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 30 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 31 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 36 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 37 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 38 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 39 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 40 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 41 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 42 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 43 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 44 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 45 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 46 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 47 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 48 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 49 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 50 +frame_dig 32 setbyte concat frame_bury 0 @@ -483,6 +485,9 @@ retsub arraycomplement_2: proto 1 1 byte "" +dupn 10 +int 0 +dupn 12 frame_dig -1 int 32 int 0 @@ -491,7 +496,7 @@ int 2 + int 32 extract3 -store 8 +frame_bury 1 frame_dig -1 int 32 int 1 @@ -500,7 +505,7 @@ int 2 + int 32 extract3 -store 9 +frame_bury 2 frame_dig -1 int 32 int 2 @@ -509,7 +514,7 @@ int 2 + int 32 extract3 -store 10 +frame_bury 3 frame_dig -1 int 32 int 3 @@ -518,7 +523,7 @@ int 2 + int 32 extract3 -store 11 +frame_bury 4 frame_dig -1 int 32 int 4 @@ -527,7 +532,7 @@ int 2 + int 32 extract3 -store 12 +frame_bury 5 frame_dig -1 int 32 int 5 @@ -536,7 +541,7 @@ int 2 + int 32 extract3 -store 13 +frame_bury 6 frame_dig -1 int 32 int 6 @@ -545,7 +550,7 @@ int 2 + int 32 extract3 -store 14 +frame_bury 7 frame_dig -1 int 32 int 7 @@ -554,7 +559,7 @@ int 2 + int 32 extract3 -store 15 +frame_bury 8 frame_dig -1 int 32 int 8 @@ -563,7 +568,7 @@ int 2 + int 32 extract3 -store 16 +frame_bury 9 frame_dig -1 int 32 int 9 @@ -572,60 +577,60 @@ int 2 + int 32 extract3 -store 17 -load 8 +frame_bury 10 +frame_dig 1 callsub arraycomplement_1 -store 8 -load 9 +frame_bury 1 +frame_dig 2 callsub arraycomplement_1 -store 9 -load 10 +frame_bury 2 +frame_dig 3 callsub arraycomplement_1 -store 10 -load 11 +frame_bury 3 +frame_dig 4 callsub arraycomplement_1 -store 11 -load 12 +frame_bury 4 +frame_dig 5 callsub arraycomplement_1 -store 12 -load 13 +frame_bury 5 +frame_dig 6 callsub arraycomplement_1 -store 13 -load 14 +frame_bury 6 +frame_dig 7 callsub arraycomplement_1 -store 14 -load 15 +frame_bury 7 +frame_dig 8 callsub arraycomplement_1 -store 15 -load 16 +frame_bury 8 +frame_dig 9 callsub arraycomplement_1 -store 16 -load 17 +frame_bury 9 +frame_dig 10 callsub arraycomplement_1 -store 17 +frame_bury 10 int 10 -store 18 -load 18 +frame_bury 23 +frame_dig 23 itob extract 6 0 -load 8 -load 9 +frame_dig 1 +frame_dig 2 concat -load 10 +frame_dig 3 concat -load 11 +frame_dig 4 concat -load 12 +frame_dig 5 concat -load 13 +frame_dig 6 concat -load 14 +frame_dig 7 concat -load 15 +frame_dig 8 concat -load 16 +frame_dig 9 concat -load 17 +frame_dig 10 concat concat frame_bury 0 @@ -635,64 +640,67 @@ retsub roundtripper_3: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_2 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_2 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 -concat -store 6 -load 5 -store 4 -load 4 -load 7 +load 3 +concat +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 -concat -store 6 -load 5 -store 4 -load 4 +concat +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal index 0ebe72b72..272928083 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal @@ -29,451 +29,453 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 33 frame_dig -1 int 1 int 0 * getbyte -store 4 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 5 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 6 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 7 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 8 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 9 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 10 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 11 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 12 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 13 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 14 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 15 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 16 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 17 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 18 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 19 +frame_bury 16 frame_dig -1 int 1 int 16 * getbyte -store 20 +frame_bury 17 frame_dig -1 int 1 int 17 * getbyte -store 21 +frame_bury 18 frame_dig -1 int 1 int 18 * getbyte -store 22 +frame_bury 19 frame_dig -1 int 1 int 19 * getbyte -store 23 +frame_bury 20 frame_dig -1 int 1 int 20 * getbyte -store 24 +frame_bury 21 frame_dig -1 int 1 int 21 * getbyte -store 25 +frame_bury 22 frame_dig -1 int 1 int 22 * getbyte -store 26 +frame_bury 23 frame_dig -1 int 1 int 23 * getbyte -store 27 +frame_bury 24 frame_dig -1 int 1 int 24 * getbyte -store 28 +frame_bury 25 frame_dig -1 int 1 int 25 * getbyte -store 29 +frame_bury 26 frame_dig -1 int 1 int 26 * getbyte -store 30 +frame_bury 27 frame_dig -1 int 1 int 27 * getbyte -store 31 +frame_bury 28 frame_dig -1 int 1 int 28 * getbyte -store 32 +frame_bury 29 frame_dig -1 int 1 int 29 * getbyte -store 33 +frame_bury 30 frame_dig -1 int 1 int 30 * getbyte -store 34 +frame_bury 31 frame_dig -1 int 1 int 31 * getbyte -store 35 -load 4 +frame_bury 32 +frame_dig 1 callsub numericalcomp_0 -store 4 -load 5 +frame_bury 1 +frame_dig 2 callsub numericalcomp_0 -store 5 -load 6 +frame_bury 2 +frame_dig 3 callsub numericalcomp_0 -store 6 -load 7 +frame_bury 3 +frame_dig 4 callsub numericalcomp_0 -store 7 -load 8 +frame_bury 4 +frame_dig 5 callsub numericalcomp_0 -store 8 -load 9 +frame_bury 5 +frame_dig 6 callsub numericalcomp_0 -store 9 -load 10 +frame_bury 6 +frame_dig 7 callsub numericalcomp_0 -store 10 -load 11 +frame_bury 7 +frame_dig 8 callsub numericalcomp_0 -store 11 -load 12 +frame_bury 8 +frame_dig 9 callsub numericalcomp_0 -store 12 -load 13 +frame_bury 9 +frame_dig 10 callsub numericalcomp_0 -store 13 -load 14 +frame_bury 10 +frame_dig 11 callsub numericalcomp_0 -store 14 -load 15 +frame_bury 11 +frame_dig 12 callsub numericalcomp_0 -store 15 -load 16 +frame_bury 12 +frame_dig 13 callsub numericalcomp_0 -store 16 -load 17 +frame_bury 13 +frame_dig 14 callsub numericalcomp_0 -store 17 -load 18 +frame_bury 14 +frame_dig 15 callsub numericalcomp_0 -store 18 -load 19 +frame_bury 15 +frame_dig 16 callsub numericalcomp_0 -store 19 -load 20 +frame_bury 16 +frame_dig 17 callsub numericalcomp_0 -store 20 -load 21 +frame_bury 17 +frame_dig 18 callsub numericalcomp_0 -store 21 -load 22 +frame_bury 18 +frame_dig 19 callsub numericalcomp_0 -store 22 -load 23 +frame_bury 19 +frame_dig 20 callsub numericalcomp_0 -store 23 -load 24 +frame_bury 20 +frame_dig 21 callsub numericalcomp_0 -store 24 -load 25 +frame_bury 21 +frame_dig 22 callsub numericalcomp_0 -store 25 -load 26 +frame_bury 22 +frame_dig 23 callsub numericalcomp_0 -store 26 -load 27 +frame_bury 23 +frame_dig 24 callsub numericalcomp_0 -store 27 -load 28 +frame_bury 24 +frame_dig 25 callsub numericalcomp_0 -store 28 -load 29 +frame_bury 25 +frame_dig 26 callsub numericalcomp_0 -store 29 -load 30 +frame_bury 26 +frame_dig 27 callsub numericalcomp_0 -store 30 -load 31 +frame_bury 27 +frame_dig 28 callsub numericalcomp_0 -store 31 -load 32 +frame_bury 28 +frame_dig 29 callsub numericalcomp_0 -store 32 -load 33 +frame_bury 29 +frame_dig 30 callsub numericalcomp_0 -store 33 -load 34 +frame_bury 30 +frame_dig 31 callsub numericalcomp_0 -store 34 -load 35 +frame_bury 31 +frame_dig 32 callsub numericalcomp_0 -store 35 +frame_bury 32 byte 0x00 int 0 -load 4 +frame_dig 1 setbyte byte 0x00 int 0 -load 5 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 6 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 7 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 8 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 9 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 10 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 11 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 12 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 13 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 14 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 15 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 16 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 17 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 18 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 19 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 20 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 21 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 22 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 23 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 24 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 25 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 26 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 27 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 28 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 29 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 30 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 31 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 32 setbyte concat frame_bury 0 @@ -483,16 +485,19 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -load 2 +frame_dig 1 concat -load 3 +frame_dig 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal index 3458bde41..c8dd10f81 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal @@ -26,16 +26,18 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 2 frame_dig -1 int 0 getbit -store 4 -load 4 +frame_bury 1 +frame_dig 1 callsub boolcomp_0 -store 4 +frame_bury 1 byte 0x00 int 0 -load 4 +frame_dig 1 setbit frame_bury 0 retsub @@ -44,16 +46,19 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -load 2 +frame_dig 1 concat -load 3 +frame_dig 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal index 64bd1f049..cfc8dd12f 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal @@ -26,36 +26,38 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 4 frame_dig -1 int 0 getbit -store 20 +frame_bury 1 frame_dig -1 int 1 getbit -store 21 +frame_bury 2 frame_dig -1 int 2 getbit -store 22 -load 20 +frame_bury 3 +frame_dig 1 callsub boolcomp_0 -store 20 -load 21 +frame_bury 1 +frame_dig 2 callsub boolcomp_0 -store 21 -load 22 +frame_bury 2 +frame_dig 3 callsub boolcomp_0 -store 22 +frame_bury 3 byte 0x00 int 0 -load 20 +frame_dig 1 setbit int 1 -load 21 +frame_dig 2 setbit int 2 -load 22 +frame_dig 3 setbit frame_bury 0 retsub @@ -64,6 +66,9 @@ retsub arraycomplement_2: proto 1 1 byte "" +dupn 11 +int 0 +dupn 13 frame_dig -1 int 1 int 0 @@ -72,7 +77,7 @@ int 2 + int 1 extract3 -store 8 +frame_bury 1 frame_dig -1 int 1 int 1 @@ -81,7 +86,7 @@ int 2 + int 1 extract3 -store 9 +frame_bury 2 frame_dig -1 int 1 int 2 @@ -90,7 +95,7 @@ int 2 + int 1 extract3 -store 10 +frame_bury 3 frame_dig -1 int 1 int 3 @@ -99,7 +104,7 @@ int 2 + int 1 extract3 -store 11 +frame_bury 4 frame_dig -1 int 1 int 4 @@ -108,7 +113,7 @@ int 2 + int 1 extract3 -store 12 +frame_bury 5 frame_dig -1 int 1 int 5 @@ -117,7 +122,7 @@ int 2 + int 1 extract3 -store 13 +frame_bury 6 frame_dig -1 int 1 int 6 @@ -126,7 +131,7 @@ int 2 + int 1 extract3 -store 14 +frame_bury 7 frame_dig -1 int 1 int 7 @@ -135,7 +140,7 @@ int 2 + int 1 extract3 -store 15 +frame_bury 8 frame_dig -1 int 1 int 8 @@ -144,7 +149,7 @@ int 2 + int 1 extract3 -store 16 +frame_bury 9 frame_dig -1 int 1 int 9 @@ -153,7 +158,7 @@ int 2 + int 1 extract3 -store 17 +frame_bury 10 frame_dig -1 int 1 int 10 @@ -162,65 +167,65 @@ int 2 + int 1 extract3 -store 18 -load 8 +frame_bury 11 +frame_dig 1 callsub arraycomplement_1 -store 8 -load 9 +frame_bury 1 +frame_dig 2 callsub arraycomplement_1 -store 9 -load 10 +frame_bury 2 +frame_dig 3 callsub arraycomplement_1 -store 10 -load 11 +frame_bury 3 +frame_dig 4 callsub arraycomplement_1 -store 11 -load 12 +frame_bury 4 +frame_dig 5 callsub arraycomplement_1 -store 12 -load 13 +frame_bury 5 +frame_dig 6 callsub arraycomplement_1 -store 13 -load 14 +frame_bury 6 +frame_dig 7 callsub arraycomplement_1 -store 14 -load 15 +frame_bury 7 +frame_dig 8 callsub arraycomplement_1 -store 15 -load 16 +frame_bury 8 +frame_dig 9 callsub arraycomplement_1 -store 16 -load 17 +frame_bury 9 +frame_dig 10 callsub arraycomplement_1 -store 17 -load 18 +frame_bury 10 +frame_dig 11 callsub arraycomplement_1 -store 18 +frame_bury 11 int 11 -store 19 -load 19 +frame_bury 25 +frame_dig 25 itob extract 6 0 -load 8 -load 9 +frame_dig 1 +frame_dig 2 concat -load 10 +frame_dig 3 concat -load 11 +frame_dig 4 concat -load 12 +frame_dig 5 concat -load 13 +frame_dig 6 concat -load 14 +frame_dig 7 concat -load 15 +frame_dig 8 concat -load 16 +frame_dig 9 concat -load 17 +frame_dig 10 concat -load 18 +frame_dig 11 concat concat frame_bury 0 @@ -230,64 +235,67 @@ retsub roundtripper_3: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_2 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_2 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal index a215df488..b23cad207 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal @@ -26,426 +26,428 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 43 frame_dig -1 int 0 getbit -store 4 +frame_bury 1 frame_dig -1 int 1 getbit -store 5 +frame_bury 2 frame_dig -1 int 2 getbit -store 6 +frame_bury 3 frame_dig -1 int 3 getbit -store 7 +frame_bury 4 frame_dig -1 int 4 getbit -store 8 +frame_bury 5 frame_dig -1 int 5 getbit -store 9 +frame_bury 6 frame_dig -1 int 6 getbit -store 10 +frame_bury 7 frame_dig -1 int 7 getbit -store 11 +frame_bury 8 frame_dig -1 int 8 getbit -store 12 +frame_bury 9 frame_dig -1 int 9 getbit -store 13 +frame_bury 10 frame_dig -1 int 10 getbit -store 14 +frame_bury 11 frame_dig -1 int 11 getbit -store 15 +frame_bury 12 frame_dig -1 int 12 getbit -store 16 +frame_bury 13 frame_dig -1 int 13 getbit -store 17 +frame_bury 14 frame_dig -1 int 14 getbit -store 18 +frame_bury 15 frame_dig -1 int 15 getbit -store 19 +frame_bury 16 frame_dig -1 int 16 getbit -store 20 +frame_bury 17 frame_dig -1 int 17 getbit -store 21 +frame_bury 18 frame_dig -1 int 18 getbit -store 22 +frame_bury 19 frame_dig -1 int 19 getbit -store 23 +frame_bury 20 frame_dig -1 int 20 getbit -store 24 +frame_bury 21 frame_dig -1 int 21 getbit -store 25 +frame_bury 22 frame_dig -1 int 22 getbit -store 26 +frame_bury 23 frame_dig -1 int 23 getbit -store 27 +frame_bury 24 frame_dig -1 int 24 getbit -store 28 +frame_bury 25 frame_dig -1 int 25 getbit -store 29 +frame_bury 26 frame_dig -1 int 26 getbit -store 30 +frame_bury 27 frame_dig -1 int 27 getbit -store 31 +frame_bury 28 frame_dig -1 int 28 getbit -store 32 +frame_bury 29 frame_dig -1 int 29 getbit -store 33 +frame_bury 30 frame_dig -1 int 30 getbit -store 34 +frame_bury 31 frame_dig -1 int 31 getbit -store 35 +frame_bury 32 frame_dig -1 int 32 getbit -store 36 +frame_bury 33 frame_dig -1 int 33 getbit -store 37 +frame_bury 34 frame_dig -1 int 34 getbit -store 38 +frame_bury 35 frame_dig -1 int 35 getbit -store 39 +frame_bury 36 frame_dig -1 int 36 getbit -store 40 +frame_bury 37 frame_dig -1 int 37 getbit -store 41 +frame_bury 38 frame_dig -1 int 38 getbit -store 42 +frame_bury 39 frame_dig -1 int 39 getbit -store 43 +frame_bury 40 frame_dig -1 int 40 getbit -store 44 +frame_bury 41 frame_dig -1 int 41 getbit -store 45 -load 4 +frame_bury 42 +frame_dig 1 callsub boolcomp_0 -store 4 -load 5 +frame_bury 1 +frame_dig 2 callsub boolcomp_0 -store 5 -load 6 +frame_bury 2 +frame_dig 3 callsub boolcomp_0 -store 6 -load 7 +frame_bury 3 +frame_dig 4 callsub boolcomp_0 -store 7 -load 8 +frame_bury 4 +frame_dig 5 callsub boolcomp_0 -store 8 -load 9 +frame_bury 5 +frame_dig 6 callsub boolcomp_0 -store 9 -load 10 +frame_bury 6 +frame_dig 7 callsub boolcomp_0 -store 10 -load 11 +frame_bury 7 +frame_dig 8 callsub boolcomp_0 -store 11 -load 12 +frame_bury 8 +frame_dig 9 callsub boolcomp_0 -store 12 -load 13 +frame_bury 9 +frame_dig 10 callsub boolcomp_0 -store 13 -load 14 +frame_bury 10 +frame_dig 11 callsub boolcomp_0 -store 14 -load 15 +frame_bury 11 +frame_dig 12 callsub boolcomp_0 -store 15 -load 16 +frame_bury 12 +frame_dig 13 callsub boolcomp_0 -store 16 -load 17 +frame_bury 13 +frame_dig 14 callsub boolcomp_0 -store 17 -load 18 +frame_bury 14 +frame_dig 15 callsub boolcomp_0 -store 18 -load 19 +frame_bury 15 +frame_dig 16 callsub boolcomp_0 -store 19 -load 20 +frame_bury 16 +frame_dig 17 callsub boolcomp_0 -store 20 -load 21 +frame_bury 17 +frame_dig 18 callsub boolcomp_0 -store 21 -load 22 +frame_bury 18 +frame_dig 19 callsub boolcomp_0 -store 22 -load 23 +frame_bury 19 +frame_dig 20 callsub boolcomp_0 -store 23 -load 24 +frame_bury 20 +frame_dig 21 callsub boolcomp_0 -store 24 -load 25 +frame_bury 21 +frame_dig 22 callsub boolcomp_0 -store 25 -load 26 +frame_bury 22 +frame_dig 23 callsub boolcomp_0 -store 26 -load 27 +frame_bury 23 +frame_dig 24 callsub boolcomp_0 -store 27 -load 28 +frame_bury 24 +frame_dig 25 callsub boolcomp_0 -store 28 -load 29 +frame_bury 25 +frame_dig 26 callsub boolcomp_0 -store 29 -load 30 +frame_bury 26 +frame_dig 27 callsub boolcomp_0 -store 30 -load 31 +frame_bury 27 +frame_dig 28 callsub boolcomp_0 -store 31 -load 32 +frame_bury 28 +frame_dig 29 callsub boolcomp_0 -store 32 -load 33 +frame_bury 29 +frame_dig 30 callsub boolcomp_0 -store 33 -load 34 +frame_bury 30 +frame_dig 31 callsub boolcomp_0 -store 34 -load 35 +frame_bury 31 +frame_dig 32 callsub boolcomp_0 -store 35 -load 36 +frame_bury 32 +frame_dig 33 callsub boolcomp_0 -store 36 -load 37 +frame_bury 33 +frame_dig 34 callsub boolcomp_0 -store 37 -load 38 +frame_bury 34 +frame_dig 35 callsub boolcomp_0 -store 38 -load 39 +frame_bury 35 +frame_dig 36 callsub boolcomp_0 -store 39 -load 40 +frame_bury 36 +frame_dig 37 callsub boolcomp_0 -store 40 -load 41 +frame_bury 37 +frame_dig 38 callsub boolcomp_0 -store 41 -load 42 +frame_bury 38 +frame_dig 39 callsub boolcomp_0 -store 42 -load 43 +frame_bury 39 +frame_dig 40 callsub boolcomp_0 -store 43 -load 44 +frame_bury 40 +frame_dig 41 callsub boolcomp_0 -store 44 -load 45 +frame_bury 41 +frame_dig 42 callsub boolcomp_0 -store 45 +frame_bury 42 byte 0x000000000000 int 0 -load 4 +frame_dig 1 setbit int 1 -load 5 +frame_dig 2 setbit int 2 -load 6 +frame_dig 3 setbit int 3 -load 7 +frame_dig 4 setbit int 4 -load 8 +frame_dig 5 setbit int 5 -load 9 +frame_dig 6 setbit int 6 -load 10 +frame_dig 7 setbit int 7 -load 11 +frame_dig 8 setbit int 8 -load 12 +frame_dig 9 setbit int 9 -load 13 +frame_dig 10 setbit int 10 -load 14 +frame_dig 11 setbit int 11 -load 15 +frame_dig 12 setbit int 12 -load 16 +frame_dig 13 setbit int 13 -load 17 +frame_dig 14 setbit int 14 -load 18 +frame_dig 15 setbit int 15 -load 19 +frame_dig 16 setbit int 16 -load 20 +frame_dig 17 setbit int 17 -load 21 +frame_dig 18 setbit int 18 -load 22 +frame_dig 19 setbit int 19 -load 23 +frame_dig 20 setbit int 20 -load 24 +frame_dig 21 setbit int 21 -load 25 +frame_dig 22 setbit int 22 -load 26 +frame_dig 23 setbit int 23 -load 27 +frame_dig 24 setbit int 24 -load 28 +frame_dig 25 setbit int 25 -load 29 +frame_dig 26 setbit int 26 -load 30 +frame_dig 27 setbit int 27 -load 31 +frame_dig 28 setbit int 28 -load 32 +frame_dig 29 setbit int 29 -load 33 +frame_dig 30 setbit int 30 -load 34 +frame_dig 31 setbit int 31 -load 35 +frame_dig 32 setbit int 32 -load 36 +frame_dig 33 setbit int 33 -load 37 +frame_dig 34 setbit int 34 -load 38 +frame_dig 35 setbit int 35 -load 39 +frame_dig 36 setbit int 36 -load 40 +frame_dig 37 setbit int 37 -load 41 +frame_dig 38 setbit int 38 -load 42 +frame_dig 39 setbit int 39 -load 43 +frame_dig 40 setbit int 40 -load 44 +frame_dig 41 setbit int 41 -load 45 +frame_dig 42 setbit frame_bury 0 retsub @@ -454,16 +456,19 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -load 2 +frame_dig 1 concat -load 3 +frame_dig 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal index 87f935c92..173e4c5c5 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal @@ -16,8 +16,10 @@ arraycomplement_0: proto 1 1 byte "" int 0 -store 8 -load 8 +dupn 2 +int 0 +frame_bury 3 +frame_dig 3 itob extract 6 0 byte "" @@ -29,64 +31,67 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_0 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal index 9b403483f..11c2891c5 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal @@ -26,23 +26,25 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 int 0 int 16 + getbit -store 8 -load 8 +frame_bury 1 +frame_dig 1 callsub boolcomp_0 -store 8 +frame_bury 1 int 1 -store 9 -load 9 +frame_bury 4 +frame_dig 4 itob extract 6 0 byte 0x00 int 0 -load 8 +frame_dig 1 setbit concat frame_bury 0 @@ -52,64 +54,67 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal index a2a6821c4..2e8a85c04 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal @@ -26,515 +26,517 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 44 frame_dig -1 int 0 int 16 + getbit -store 8 +frame_bury 1 frame_dig -1 int 1 int 16 + getbit -store 9 +frame_bury 2 frame_dig -1 int 2 int 16 + getbit -store 10 +frame_bury 3 frame_dig -1 int 3 int 16 + getbit -store 11 +frame_bury 4 frame_dig -1 int 4 int 16 + getbit -store 12 +frame_bury 5 frame_dig -1 int 5 int 16 + getbit -store 13 +frame_bury 6 frame_dig -1 int 6 int 16 + getbit -store 14 +frame_bury 7 frame_dig -1 int 7 int 16 + getbit -store 15 +frame_bury 8 frame_dig -1 int 8 int 16 + getbit -store 16 +frame_bury 9 frame_dig -1 int 9 int 16 + getbit -store 17 +frame_bury 10 frame_dig -1 int 10 int 16 + getbit -store 18 +frame_bury 11 frame_dig -1 int 11 int 16 + getbit -store 19 +frame_bury 12 frame_dig -1 int 12 int 16 + getbit -store 20 +frame_bury 13 frame_dig -1 int 13 int 16 + getbit -store 21 +frame_bury 14 frame_dig -1 int 14 int 16 + getbit -store 22 +frame_bury 15 frame_dig -1 int 15 int 16 + getbit -store 23 +frame_bury 16 frame_dig -1 int 16 int 16 + getbit -store 24 +frame_bury 17 frame_dig -1 int 17 int 16 + getbit -store 25 +frame_bury 18 frame_dig -1 int 18 int 16 + getbit -store 26 +frame_bury 19 frame_dig -1 int 19 int 16 + getbit -store 27 +frame_bury 20 frame_dig -1 int 20 int 16 + getbit -store 28 +frame_bury 21 frame_dig -1 int 21 int 16 + getbit -store 29 +frame_bury 22 frame_dig -1 int 22 int 16 + getbit -store 30 +frame_bury 23 frame_dig -1 int 23 int 16 + getbit -store 31 +frame_bury 24 frame_dig -1 int 24 int 16 + getbit -store 32 +frame_bury 25 frame_dig -1 int 25 int 16 + getbit -store 33 +frame_bury 26 frame_dig -1 int 26 int 16 + getbit -store 34 +frame_bury 27 frame_dig -1 int 27 int 16 + getbit -store 35 +frame_bury 28 frame_dig -1 int 28 int 16 + getbit -store 36 +frame_bury 29 frame_dig -1 int 29 int 16 + getbit -store 37 +frame_bury 30 frame_dig -1 int 30 int 16 + getbit -store 38 +frame_bury 31 frame_dig -1 int 31 int 16 + getbit -store 39 +frame_bury 32 frame_dig -1 int 32 int 16 + getbit -store 40 +frame_bury 33 frame_dig -1 int 33 int 16 + getbit -store 41 +frame_bury 34 frame_dig -1 int 34 int 16 + getbit -store 42 +frame_bury 35 frame_dig -1 int 35 int 16 + getbit -store 43 +frame_bury 36 frame_dig -1 int 36 int 16 + getbit -store 44 +frame_bury 37 frame_dig -1 int 37 int 16 + getbit -store 45 +frame_bury 38 frame_dig -1 int 38 int 16 + getbit -store 46 +frame_bury 39 frame_dig -1 int 39 int 16 + getbit -store 47 +frame_bury 40 frame_dig -1 int 40 int 16 + getbit -store 48 +frame_bury 41 frame_dig -1 int 41 int 16 + getbit -store 49 -load 8 +frame_bury 42 +frame_dig 1 callsub boolcomp_0 -store 8 -load 9 +frame_bury 1 +frame_dig 2 callsub boolcomp_0 -store 9 -load 10 +frame_bury 2 +frame_dig 3 callsub boolcomp_0 -store 10 -load 11 +frame_bury 3 +frame_dig 4 callsub boolcomp_0 -store 11 -load 12 +frame_bury 4 +frame_dig 5 callsub boolcomp_0 -store 12 -load 13 +frame_bury 5 +frame_dig 6 callsub boolcomp_0 -store 13 -load 14 +frame_bury 6 +frame_dig 7 callsub boolcomp_0 -store 14 -load 15 +frame_bury 7 +frame_dig 8 callsub boolcomp_0 -store 15 -load 16 +frame_bury 8 +frame_dig 9 callsub boolcomp_0 -store 16 -load 17 +frame_bury 9 +frame_dig 10 callsub boolcomp_0 -store 17 -load 18 +frame_bury 10 +frame_dig 11 callsub boolcomp_0 -store 18 -load 19 +frame_bury 11 +frame_dig 12 callsub boolcomp_0 -store 19 -load 20 +frame_bury 12 +frame_dig 13 callsub boolcomp_0 -store 20 -load 21 +frame_bury 13 +frame_dig 14 callsub boolcomp_0 -store 21 -load 22 +frame_bury 14 +frame_dig 15 callsub boolcomp_0 -store 22 -load 23 +frame_bury 15 +frame_dig 16 callsub boolcomp_0 -store 23 -load 24 +frame_bury 16 +frame_dig 17 callsub boolcomp_0 -store 24 -load 25 +frame_bury 17 +frame_dig 18 callsub boolcomp_0 -store 25 -load 26 +frame_bury 18 +frame_dig 19 callsub boolcomp_0 -store 26 -load 27 +frame_bury 19 +frame_dig 20 callsub boolcomp_0 -store 27 -load 28 +frame_bury 20 +frame_dig 21 callsub boolcomp_0 -store 28 -load 29 +frame_bury 21 +frame_dig 22 callsub boolcomp_0 -store 29 -load 30 +frame_bury 22 +frame_dig 23 callsub boolcomp_0 -store 30 -load 31 +frame_bury 23 +frame_dig 24 callsub boolcomp_0 -store 31 -load 32 +frame_bury 24 +frame_dig 25 callsub boolcomp_0 -store 32 -load 33 +frame_bury 25 +frame_dig 26 callsub boolcomp_0 -store 33 -load 34 +frame_bury 26 +frame_dig 27 callsub boolcomp_0 -store 34 -load 35 +frame_bury 27 +frame_dig 28 callsub boolcomp_0 -store 35 -load 36 +frame_bury 28 +frame_dig 29 callsub boolcomp_0 -store 36 -load 37 +frame_bury 29 +frame_dig 30 callsub boolcomp_0 -store 37 -load 38 +frame_bury 30 +frame_dig 31 callsub boolcomp_0 -store 38 -load 39 +frame_bury 31 +frame_dig 32 callsub boolcomp_0 -store 39 -load 40 +frame_bury 32 +frame_dig 33 callsub boolcomp_0 -store 40 -load 41 +frame_bury 33 +frame_dig 34 callsub boolcomp_0 -store 41 -load 42 +frame_bury 34 +frame_dig 35 callsub boolcomp_0 -store 42 -load 43 +frame_bury 35 +frame_dig 36 callsub boolcomp_0 -store 43 -load 44 +frame_bury 36 +frame_dig 37 callsub boolcomp_0 -store 44 -load 45 +frame_bury 37 +frame_dig 38 callsub boolcomp_0 -store 45 -load 46 +frame_bury 38 +frame_dig 39 callsub boolcomp_0 -store 46 -load 47 +frame_bury 39 +frame_dig 40 callsub boolcomp_0 -store 47 -load 48 +frame_bury 40 +frame_dig 41 callsub boolcomp_0 -store 48 -load 49 +frame_bury 41 +frame_dig 42 callsub boolcomp_0 -store 49 +frame_bury 42 int 42 -store 50 -load 50 +frame_bury 45 +frame_dig 45 itob extract 6 0 byte 0x000000000000 int 0 -load 8 +frame_dig 1 setbit int 1 -load 9 +frame_dig 2 setbit int 2 -load 10 +frame_dig 3 setbit int 3 -load 11 +frame_dig 4 setbit int 4 -load 12 +frame_dig 5 setbit int 5 -load 13 +frame_dig 6 setbit int 6 -load 14 +frame_dig 7 setbit int 7 -load 15 +frame_dig 8 setbit int 8 -load 16 +frame_dig 9 setbit int 9 -load 17 +frame_dig 10 setbit int 10 -load 18 +frame_dig 11 setbit int 11 -load 19 +frame_dig 12 setbit int 12 -load 20 +frame_dig 13 setbit int 13 -load 21 +frame_dig 14 setbit int 14 -load 22 +frame_dig 15 setbit int 15 -load 23 +frame_dig 16 setbit int 16 -load 24 +frame_dig 17 setbit int 17 -load 25 +frame_dig 18 setbit int 18 -load 26 +frame_dig 19 setbit int 19 -load 27 +frame_dig 20 setbit int 20 -load 28 +frame_dig 21 setbit int 21 -load 29 +frame_dig 22 setbit int 22 -load 30 +frame_dig 23 setbit int 23 -load 31 +frame_dig 24 setbit int 24 -load 32 +frame_dig 25 setbit int 25 -load 33 +frame_dig 26 setbit int 26 -load 34 +frame_dig 27 setbit int 27 -load 35 +frame_dig 28 setbit int 28 -load 36 +frame_dig 29 setbit int 29 -load 37 +frame_dig 30 setbit int 30 -load 38 +frame_dig 31 setbit int 31 -load 39 +frame_dig 32 setbit int 32 -load 40 +frame_dig 33 setbit int 33 -load 41 +frame_dig 34 setbit int 34 -load 42 +frame_dig 35 setbit int 35 -load 43 +frame_dig 36 setbit int 36 -load 44 +frame_dig 37 setbit int 37 -load 45 +frame_dig 38 setbit int 38 -load 46 +frame_dig 39 setbit int 39 -load 47 +frame_dig 40 setbit int 40 -load 48 +frame_dig 41 setbit int 41 -load 49 +frame_dig 42 setbit concat frame_bury 0 @@ -544,64 +546,67 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal index 5e08ac3d2..2a8a7572c 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal @@ -30,21 +30,23 @@ retsub roundtripper_1: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 callsub boolcomp_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub boolcomp_0 -store 3 +frame_bury 2 byte 0x00 int 0 frame_dig -1 setbit int 1 -load 2 +frame_dig 1 setbit int 2 -load 3 +frame_dig 2 setbit frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal index 86fa73f5a..345b09fcc 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal @@ -29,227 +29,229 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 17 frame_dig -1 int 1 int 0 * getbyte -store 4 +frame_bury 1 frame_dig -1 int 1 int 1 * getbyte -store 5 +frame_bury 2 frame_dig -1 int 1 int 2 * getbyte -store 6 +frame_bury 3 frame_dig -1 int 1 int 3 * getbyte -store 7 +frame_bury 4 frame_dig -1 int 1 int 4 * getbyte -store 8 +frame_bury 5 frame_dig -1 int 1 int 5 * getbyte -store 9 +frame_bury 6 frame_dig -1 int 1 int 6 * getbyte -store 10 +frame_bury 7 frame_dig -1 int 1 int 7 * getbyte -store 11 +frame_bury 8 frame_dig -1 int 1 int 8 * getbyte -store 12 +frame_bury 9 frame_dig -1 int 1 int 9 * getbyte -store 13 +frame_bury 10 frame_dig -1 int 1 int 10 * getbyte -store 14 +frame_bury 11 frame_dig -1 int 1 int 11 * getbyte -store 15 +frame_bury 12 frame_dig -1 int 1 int 12 * getbyte -store 16 +frame_bury 13 frame_dig -1 int 1 int 13 * getbyte -store 17 +frame_bury 14 frame_dig -1 int 1 int 14 * getbyte -store 18 +frame_bury 15 frame_dig -1 int 1 int 15 * getbyte -store 19 -load 4 +frame_bury 16 +frame_dig 1 callsub numericalcomp_0 -store 4 -load 5 +frame_bury 1 +frame_dig 2 callsub numericalcomp_0 -store 5 -load 6 +frame_bury 2 +frame_dig 3 callsub numericalcomp_0 -store 6 -load 7 +frame_bury 3 +frame_dig 4 callsub numericalcomp_0 -store 7 -load 8 +frame_bury 4 +frame_dig 5 callsub numericalcomp_0 -store 8 -load 9 +frame_bury 5 +frame_dig 6 callsub numericalcomp_0 -store 9 -load 10 +frame_bury 6 +frame_dig 7 callsub numericalcomp_0 -store 10 -load 11 +frame_bury 7 +frame_dig 8 callsub numericalcomp_0 -store 11 -load 12 +frame_bury 8 +frame_dig 9 callsub numericalcomp_0 -store 12 -load 13 +frame_bury 9 +frame_dig 10 callsub numericalcomp_0 -store 13 -load 14 +frame_bury 10 +frame_dig 11 callsub numericalcomp_0 -store 14 -load 15 +frame_bury 11 +frame_dig 12 callsub numericalcomp_0 -store 15 -load 16 +frame_bury 12 +frame_dig 13 callsub numericalcomp_0 -store 16 -load 17 +frame_bury 13 +frame_dig 14 callsub numericalcomp_0 -store 17 -load 18 +frame_bury 14 +frame_dig 15 callsub numericalcomp_0 -store 18 -load 19 +frame_bury 15 +frame_dig 16 callsub numericalcomp_0 -store 19 +frame_bury 16 byte 0x00 int 0 -load 4 +frame_dig 1 setbyte byte 0x00 int 0 -load 5 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 6 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 7 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 8 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 9 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 10 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 11 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 12 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 13 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 14 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 15 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 16 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 17 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 18 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 19 +frame_dig 16 setbyte concat frame_bury 0 @@ -259,16 +261,19 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -load 2 +frame_dig 1 concat -load 3 +frame_dig 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal index 3b92e3e84..1b999bd87 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal @@ -29,6 +29,8 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 74 frame_dig -1 int 1 int 0 @@ -36,7 +38,7 @@ int 0 int 2 + getbyte -store 8 +frame_bury 1 frame_dig -1 int 1 int 1 @@ -44,7 +46,7 @@ int 1 int 2 + getbyte -store 9 +frame_bury 2 frame_dig -1 int 1 int 2 @@ -52,7 +54,7 @@ int 2 int 2 + getbyte -store 10 +frame_bury 3 frame_dig -1 int 1 int 3 @@ -60,7 +62,7 @@ int 3 int 2 + getbyte -store 11 +frame_bury 4 frame_dig -1 int 1 int 4 @@ -68,7 +70,7 @@ int 4 int 2 + getbyte -store 12 +frame_bury 5 frame_dig -1 int 1 int 5 @@ -76,7 +78,7 @@ int 5 int 2 + getbyte -store 13 +frame_bury 6 frame_dig -1 int 1 int 6 @@ -84,7 +86,7 @@ int 6 int 2 + getbyte -store 14 +frame_bury 7 frame_dig -1 int 1 int 7 @@ -92,7 +94,7 @@ int 7 int 2 + getbyte -store 15 +frame_bury 8 frame_dig -1 int 1 int 8 @@ -100,7 +102,7 @@ int 8 int 2 + getbyte -store 16 +frame_bury 9 frame_dig -1 int 1 int 9 @@ -108,7 +110,7 @@ int 9 int 2 + getbyte -store 17 +frame_bury 10 frame_dig -1 int 1 int 10 @@ -116,7 +118,7 @@ int 10 int 2 + getbyte -store 18 +frame_bury 11 frame_dig -1 int 1 int 11 @@ -124,7 +126,7 @@ int 11 int 2 + getbyte -store 19 +frame_bury 12 frame_dig -1 int 1 int 12 @@ -132,7 +134,7 @@ int 12 int 2 + getbyte -store 20 +frame_bury 13 frame_dig -1 int 1 int 13 @@ -140,7 +142,7 @@ int 13 int 2 + getbyte -store 21 +frame_bury 14 frame_dig -1 int 1 int 14 @@ -148,7 +150,7 @@ int 14 int 2 + getbyte -store 22 +frame_bury 15 frame_dig -1 int 1 int 15 @@ -156,7 +158,7 @@ int 15 int 2 + getbyte -store 23 +frame_bury 16 frame_dig -1 int 1 int 16 @@ -164,7 +166,7 @@ int 16 int 2 + getbyte -store 24 +frame_bury 17 frame_dig -1 int 1 int 17 @@ -172,7 +174,7 @@ int 17 int 2 + getbyte -store 25 +frame_bury 18 frame_dig -1 int 1 int 18 @@ -180,7 +182,7 @@ int 18 int 2 + getbyte -store 26 +frame_bury 19 frame_dig -1 int 1 int 19 @@ -188,7 +190,7 @@ int 19 int 2 + getbyte -store 27 +frame_bury 20 frame_dig -1 int 1 int 20 @@ -196,7 +198,7 @@ int 20 int 2 + getbyte -store 28 +frame_bury 21 frame_dig -1 int 1 int 21 @@ -204,7 +206,7 @@ int 21 int 2 + getbyte -store 29 +frame_bury 22 frame_dig -1 int 1 int 22 @@ -212,7 +214,7 @@ int 22 int 2 + getbyte -store 30 +frame_bury 23 frame_dig -1 int 1 int 23 @@ -220,7 +222,7 @@ int 23 int 2 + getbyte -store 31 +frame_bury 24 frame_dig -1 int 1 int 24 @@ -228,7 +230,7 @@ int 24 int 2 + getbyte -store 32 +frame_bury 25 frame_dig -1 int 1 int 25 @@ -236,7 +238,7 @@ int 25 int 2 + getbyte -store 33 +frame_bury 26 frame_dig -1 int 1 int 26 @@ -244,7 +246,7 @@ int 26 int 2 + getbyte -store 34 +frame_bury 27 frame_dig -1 int 1 int 27 @@ -252,7 +254,7 @@ int 27 int 2 + getbyte -store 35 +frame_bury 28 frame_dig -1 int 1 int 28 @@ -260,7 +262,7 @@ int 28 int 2 + getbyte -store 36 +frame_bury 29 frame_dig -1 int 1 int 29 @@ -268,7 +270,7 @@ int 29 int 2 + getbyte -store 37 +frame_bury 30 frame_dig -1 int 1 int 30 @@ -276,7 +278,7 @@ int 30 int 2 + getbyte -store 38 +frame_bury 31 frame_dig -1 int 1 int 31 @@ -284,7 +286,7 @@ int 31 int 2 + getbyte -store 39 +frame_bury 32 frame_dig -1 int 1 int 32 @@ -292,7 +294,7 @@ int 32 int 2 + getbyte -store 40 +frame_bury 33 frame_dig -1 int 1 int 33 @@ -300,7 +302,7 @@ int 33 int 2 + getbyte -store 41 +frame_bury 34 frame_dig -1 int 1 int 34 @@ -308,7 +310,7 @@ int 34 int 2 + getbyte -store 42 +frame_bury 35 frame_dig -1 int 1 int 35 @@ -316,297 +318,297 @@ int 35 int 2 + getbyte -store 43 -load 8 +frame_bury 36 +frame_dig 1 callsub numericalcomp_0 -store 8 -load 9 +frame_bury 1 +frame_dig 2 callsub numericalcomp_0 -store 9 -load 10 +frame_bury 2 +frame_dig 3 callsub numericalcomp_0 -store 10 -load 11 +frame_bury 3 +frame_dig 4 callsub numericalcomp_0 -store 11 -load 12 +frame_bury 4 +frame_dig 5 callsub numericalcomp_0 -store 12 -load 13 +frame_bury 5 +frame_dig 6 callsub numericalcomp_0 -store 13 -load 14 +frame_bury 6 +frame_dig 7 callsub numericalcomp_0 -store 14 -load 15 +frame_bury 7 +frame_dig 8 callsub numericalcomp_0 -store 15 -load 16 +frame_bury 8 +frame_dig 9 callsub numericalcomp_0 -store 16 -load 17 +frame_bury 9 +frame_dig 10 callsub numericalcomp_0 -store 17 -load 18 +frame_bury 10 +frame_dig 11 callsub numericalcomp_0 -store 18 -load 19 +frame_bury 11 +frame_dig 12 callsub numericalcomp_0 -store 19 -load 20 +frame_bury 12 +frame_dig 13 callsub numericalcomp_0 -store 20 -load 21 +frame_bury 13 +frame_dig 14 callsub numericalcomp_0 -store 21 -load 22 +frame_bury 14 +frame_dig 15 callsub numericalcomp_0 -store 22 -load 23 +frame_bury 15 +frame_dig 16 callsub numericalcomp_0 -store 23 -load 24 +frame_bury 16 +frame_dig 17 callsub numericalcomp_0 -store 24 -load 25 +frame_bury 17 +frame_dig 18 callsub numericalcomp_0 -store 25 -load 26 +frame_bury 18 +frame_dig 19 callsub numericalcomp_0 -store 26 -load 27 +frame_bury 19 +frame_dig 20 callsub numericalcomp_0 -store 27 -load 28 +frame_bury 20 +frame_dig 21 callsub numericalcomp_0 -store 28 -load 29 +frame_bury 21 +frame_dig 22 callsub numericalcomp_0 -store 29 -load 30 +frame_bury 22 +frame_dig 23 callsub numericalcomp_0 -store 30 -load 31 +frame_bury 23 +frame_dig 24 callsub numericalcomp_0 -store 31 -load 32 +frame_bury 24 +frame_dig 25 callsub numericalcomp_0 -store 32 -load 33 +frame_bury 25 +frame_dig 26 callsub numericalcomp_0 -store 33 -load 34 +frame_bury 26 +frame_dig 27 callsub numericalcomp_0 -store 34 -load 35 +frame_bury 27 +frame_dig 28 callsub numericalcomp_0 -store 35 -load 36 +frame_bury 28 +frame_dig 29 callsub numericalcomp_0 -store 36 -load 37 +frame_bury 29 +frame_dig 30 callsub numericalcomp_0 -store 37 -load 38 +frame_bury 30 +frame_dig 31 callsub numericalcomp_0 -store 38 -load 39 +frame_bury 31 +frame_dig 32 callsub numericalcomp_0 -store 39 -load 40 +frame_bury 32 +frame_dig 33 callsub numericalcomp_0 -store 40 -load 41 +frame_bury 33 +frame_dig 34 callsub numericalcomp_0 -store 41 -load 42 +frame_bury 34 +frame_dig 35 callsub numericalcomp_0 -store 42 -load 43 +frame_bury 35 +frame_dig 36 callsub numericalcomp_0 -store 43 +frame_bury 36 int 36 -store 44 -load 44 +frame_bury 75 +frame_dig 75 itob extract 6 0 byte 0x00 int 0 -load 8 +frame_dig 1 setbyte byte 0x00 int 0 -load 9 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 10 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 11 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 12 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 13 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 14 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 15 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 16 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 17 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 18 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 19 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 20 +frame_dig 13 setbyte concat byte 0x00 int 0 -load 21 +frame_dig 14 setbyte concat byte 0x00 int 0 -load 22 +frame_dig 15 setbyte concat byte 0x00 int 0 -load 23 +frame_dig 16 setbyte concat byte 0x00 int 0 -load 24 +frame_dig 17 setbyte concat byte 0x00 int 0 -load 25 +frame_dig 18 setbyte concat byte 0x00 int 0 -load 26 +frame_dig 19 setbyte concat byte 0x00 int 0 -load 27 +frame_dig 20 setbyte concat byte 0x00 int 0 -load 28 +frame_dig 21 setbyte concat byte 0x00 int 0 -load 29 +frame_dig 22 setbyte concat byte 0x00 int 0 -load 30 +frame_dig 23 setbyte concat byte 0x00 int 0 -load 31 +frame_dig 24 setbyte concat byte 0x00 int 0 -load 32 +frame_dig 25 setbyte concat byte 0x00 int 0 -load 33 +frame_dig 26 setbyte concat byte 0x00 int 0 -load 34 +frame_dig 27 setbyte concat byte 0x00 int 0 -load 35 +frame_dig 28 setbyte concat byte 0x00 int 0 -load 36 +frame_dig 29 setbyte concat byte 0x00 int 0 -load 37 +frame_dig 30 setbyte concat byte 0x00 int 0 -load 38 +frame_dig 31 setbyte concat byte 0x00 int 0 -load 39 +frame_dig 32 setbyte concat byte 0x00 int 0 -load 40 +frame_dig 33 setbyte concat byte 0x00 int 0 -load 41 +frame_dig 34 setbyte concat byte 0x00 int 0 -load 42 +frame_dig 35 setbyte concat byte 0x00 int 0 -load 43 +frame_dig 36 setbyte concat concat @@ -617,64 +619,67 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 -concat -store 6 -load 5 -store 4 -load 4 -load 7 +load 3 +concat +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 -concat -store 6 -load 5 -store 4 -load 4 +concat +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal index c7dfcc09f..58daf6eb2 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal @@ -31,24 +31,26 @@ retsub roundtripper_1: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 callsub numericalcomp_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub numericalcomp_0 -store 3 +frame_bury 2 byte 0x00 int 0 frame_dig -1 setbyte byte 0x00 int 0 -load 2 +frame_dig 1 setbyte concat byte 0x00 int 0 -load 3 +frame_dig 2 setbyte concat frame_bury 0 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal index f6742b7c1..235d01ed3 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal @@ -16,8 +16,10 @@ stringreverse_0: proto 1 1 byte "" int 0 -store 8 -load 8 +dupn 2 +int 0 +frame_bury 3 +frame_dig 3 itob extract 6 0 byte "" @@ -29,64 +31,67 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub stringreverse_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub stringreverse_0 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal index 4e608a404..63c41ab5a 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal @@ -15,6 +15,8 @@ return stringreverse_0: proto 1 1 byte "" +int 0 +dupn 28 frame_dig -1 int 1 int 0 @@ -22,7 +24,7 @@ int 0 int 2 + getbyte -store 20 +frame_bury 13 frame_dig -1 int 1 int 1 @@ -30,7 +32,7 @@ int 1 int 2 + getbyte -store 19 +frame_bury 12 frame_dig -1 int 1 int 2 @@ -38,7 +40,7 @@ int 2 int 2 + getbyte -store 18 +frame_bury 11 frame_dig -1 int 1 int 3 @@ -46,7 +48,7 @@ int 3 int 2 + getbyte -store 17 +frame_bury 10 frame_dig -1 int 1 int 4 @@ -54,7 +56,7 @@ int 4 int 2 + getbyte -store 16 +frame_bury 9 frame_dig -1 int 1 int 5 @@ -62,7 +64,7 @@ int 5 int 2 + getbyte -store 15 +frame_bury 8 frame_dig -1 int 1 int 6 @@ -70,7 +72,7 @@ int 6 int 2 + getbyte -store 14 +frame_bury 7 frame_dig -1 int 1 int 7 @@ -78,7 +80,7 @@ int 7 int 2 + getbyte -store 13 +frame_bury 6 frame_dig -1 int 1 int 8 @@ -86,7 +88,7 @@ int 8 int 2 + getbyte -store 12 +frame_bury 5 frame_dig -1 int 1 int 9 @@ -94,7 +96,7 @@ int 9 int 2 + getbyte -store 11 +frame_bury 4 frame_dig -1 int 1 int 10 @@ -102,7 +104,7 @@ int 10 int 2 + getbyte -store 10 +frame_bury 3 frame_dig -1 int 1 int 11 @@ -110,7 +112,7 @@ int 11 int 2 + getbyte -store 9 +frame_bury 2 frame_dig -1 int 1 int 12 @@ -118,74 +120,74 @@ int 12 int 2 + getbyte -store 8 +frame_bury 1 int 13 -store 21 -load 21 +frame_bury 29 +frame_dig 29 itob extract 6 0 byte 0x00 int 0 -load 8 +frame_dig 1 setbyte byte 0x00 int 0 -load 9 +frame_dig 2 setbyte concat byte 0x00 int 0 -load 10 +frame_dig 3 setbyte concat byte 0x00 int 0 -load 11 +frame_dig 4 setbyte concat byte 0x00 int 0 -load 12 +frame_dig 5 setbyte concat byte 0x00 int 0 -load 13 +frame_dig 6 setbyte concat byte 0x00 int 0 -load 14 +frame_dig 7 setbyte concat byte 0x00 int 0 -load 15 +frame_dig 8 setbyte concat byte 0x00 int 0 -load 16 +frame_dig 9 setbyte concat byte 0x00 int 0 -load 17 +frame_dig 10 setbyte concat byte 0x00 int 0 -load 18 +frame_dig 11 setbyte concat byte 0x00 int 0 -load 19 +frame_dig 12 setbyte concat byte 0x00 int 0 -load 20 +frame_dig 13 setbyte concat concat @@ -196,64 +198,67 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub stringreverse_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub stringreverse_0 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal index 8a72badb8..290537714 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal @@ -15,6 +15,8 @@ return stringreverse_0: proto 1 1 byte "" +int 0 +dupn 4 frame_dig -1 int 1 int 0 @@ -22,15 +24,15 @@ int 0 int 2 + getbyte -store 8 +frame_bury 1 int 1 -store 9 -load 9 +frame_bury 5 +frame_dig 5 itob extract 6 0 byte 0x00 int 0 -load 8 +frame_dig 1 setbyte concat frame_bury 0 @@ -40,64 +42,67 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub stringreverse_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub stringreverse_0 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal index 2baecd50a..4a27045bf 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal @@ -31,20 +31,22 @@ retsub roundtripper_1: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 callsub numericalcomp_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub numericalcomp_0 -store 3 +frame_bury 2 frame_dig -1 itob extract 6 0 -load 2 +frame_dig 1 itob extract 6 0 concat -load 3 +frame_dig 2 itob extract 6 0 concat diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal index d495dae9d..ce183aab6 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal @@ -31,20 +31,22 @@ retsub roundtripper_1: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 callsub numericalcomp_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub numericalcomp_0 -store 3 +frame_bury 2 frame_dig -1 itob extract 4 0 -load 2 +frame_dig 1 itob extract 4 0 concat -load 3 +frame_dig 2 itob extract 4 0 concat diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal index 48d881ec6..603cd4a6a 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal @@ -25,16 +25,18 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 2 frame_dig -1 int 8 int 0 * extract_uint64 -store 4 -load 4 +frame_bury 1 +frame_dig 1 callsub numericalcomp_0 -store 4 -load 4 +frame_bury 1 +frame_dig 1 itob frame_bury 0 retsub @@ -43,16 +45,19 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -load 2 +frame_dig 1 concat -load 3 +frame_dig 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal index 9126983f1..ac132adf3 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal @@ -25,507 +25,509 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 43 frame_dig -1 int 8 int 0 * extract_uint64 -store 4 +frame_bury 1 frame_dig -1 int 8 int 1 * extract_uint64 -store 5 +frame_bury 2 frame_dig -1 int 8 int 2 * extract_uint64 -store 6 +frame_bury 3 frame_dig -1 int 8 int 3 * extract_uint64 -store 7 +frame_bury 4 frame_dig -1 int 8 int 4 * extract_uint64 -store 8 +frame_bury 5 frame_dig -1 int 8 int 5 * extract_uint64 -store 9 +frame_bury 6 frame_dig -1 int 8 int 6 * extract_uint64 -store 10 +frame_bury 7 frame_dig -1 int 8 int 7 * extract_uint64 -store 11 +frame_bury 8 frame_dig -1 int 8 int 8 * extract_uint64 -store 12 +frame_bury 9 frame_dig -1 int 8 int 9 * extract_uint64 -store 13 +frame_bury 10 frame_dig -1 int 8 int 10 * extract_uint64 -store 14 +frame_bury 11 frame_dig -1 int 8 int 11 * extract_uint64 -store 15 +frame_bury 12 frame_dig -1 int 8 int 12 * extract_uint64 -store 16 +frame_bury 13 frame_dig -1 int 8 int 13 * extract_uint64 -store 17 +frame_bury 14 frame_dig -1 int 8 int 14 * extract_uint64 -store 18 +frame_bury 15 frame_dig -1 int 8 int 15 * extract_uint64 -store 19 +frame_bury 16 frame_dig -1 int 8 int 16 * extract_uint64 -store 20 +frame_bury 17 frame_dig -1 int 8 int 17 * extract_uint64 -store 21 +frame_bury 18 frame_dig -1 int 8 int 18 * extract_uint64 -store 22 +frame_bury 19 frame_dig -1 int 8 int 19 * extract_uint64 -store 23 +frame_bury 20 frame_dig -1 int 8 int 20 * extract_uint64 -store 24 +frame_bury 21 frame_dig -1 int 8 int 21 * extract_uint64 -store 25 +frame_bury 22 frame_dig -1 int 8 int 22 * extract_uint64 -store 26 +frame_bury 23 frame_dig -1 int 8 int 23 * extract_uint64 -store 27 +frame_bury 24 frame_dig -1 int 8 int 24 * extract_uint64 -store 28 +frame_bury 25 frame_dig -1 int 8 int 25 * extract_uint64 -store 29 +frame_bury 26 frame_dig -1 int 8 int 26 * extract_uint64 -store 30 +frame_bury 27 frame_dig -1 int 8 int 27 * extract_uint64 -store 31 +frame_bury 28 frame_dig -1 int 8 int 28 * extract_uint64 -store 32 +frame_bury 29 frame_dig -1 int 8 int 29 * extract_uint64 -store 33 +frame_bury 30 frame_dig -1 int 8 int 30 * extract_uint64 -store 34 +frame_bury 31 frame_dig -1 int 8 int 31 * extract_uint64 -store 35 +frame_bury 32 frame_dig -1 int 8 int 32 * extract_uint64 -store 36 +frame_bury 33 frame_dig -1 int 8 int 33 * extract_uint64 -store 37 +frame_bury 34 frame_dig -1 int 8 int 34 * extract_uint64 -store 38 +frame_bury 35 frame_dig -1 int 8 int 35 * extract_uint64 -store 39 +frame_bury 36 frame_dig -1 int 8 int 36 * extract_uint64 -store 40 +frame_bury 37 frame_dig -1 int 8 int 37 * extract_uint64 -store 41 +frame_bury 38 frame_dig -1 int 8 int 38 * extract_uint64 -store 42 +frame_bury 39 frame_dig -1 int 8 int 39 * extract_uint64 -store 43 +frame_bury 40 frame_dig -1 int 8 int 40 * extract_uint64 -store 44 +frame_bury 41 frame_dig -1 int 8 int 41 * extract_uint64 -store 45 -load 4 +frame_bury 42 +frame_dig 1 callsub numericalcomp_0 -store 4 -load 5 +frame_bury 1 +frame_dig 2 callsub numericalcomp_0 -store 5 -load 6 +frame_bury 2 +frame_dig 3 callsub numericalcomp_0 -store 6 -load 7 +frame_bury 3 +frame_dig 4 callsub numericalcomp_0 -store 7 -load 8 +frame_bury 4 +frame_dig 5 callsub numericalcomp_0 -store 8 -load 9 +frame_bury 5 +frame_dig 6 callsub numericalcomp_0 -store 9 -load 10 +frame_bury 6 +frame_dig 7 callsub numericalcomp_0 -store 10 -load 11 +frame_bury 7 +frame_dig 8 callsub numericalcomp_0 -store 11 -load 12 +frame_bury 8 +frame_dig 9 callsub numericalcomp_0 -store 12 -load 13 +frame_bury 9 +frame_dig 10 callsub numericalcomp_0 -store 13 -load 14 +frame_bury 10 +frame_dig 11 callsub numericalcomp_0 -store 14 -load 15 +frame_bury 11 +frame_dig 12 callsub numericalcomp_0 -store 15 -load 16 +frame_bury 12 +frame_dig 13 callsub numericalcomp_0 -store 16 -load 17 +frame_bury 13 +frame_dig 14 callsub numericalcomp_0 -store 17 -load 18 +frame_bury 14 +frame_dig 15 callsub numericalcomp_0 -store 18 -load 19 +frame_bury 15 +frame_dig 16 callsub numericalcomp_0 -store 19 -load 20 +frame_bury 16 +frame_dig 17 callsub numericalcomp_0 -store 20 -load 21 +frame_bury 17 +frame_dig 18 callsub numericalcomp_0 -store 21 -load 22 +frame_bury 18 +frame_dig 19 callsub numericalcomp_0 -store 22 -load 23 +frame_bury 19 +frame_dig 20 callsub numericalcomp_0 -store 23 -load 24 +frame_bury 20 +frame_dig 21 callsub numericalcomp_0 -store 24 -load 25 +frame_bury 21 +frame_dig 22 callsub numericalcomp_0 -store 25 -load 26 +frame_bury 22 +frame_dig 23 callsub numericalcomp_0 -store 26 -load 27 +frame_bury 23 +frame_dig 24 callsub numericalcomp_0 -store 27 -load 28 +frame_bury 24 +frame_dig 25 callsub numericalcomp_0 -store 28 -load 29 +frame_bury 25 +frame_dig 26 callsub numericalcomp_0 -store 29 -load 30 +frame_bury 26 +frame_dig 27 callsub numericalcomp_0 -store 30 -load 31 +frame_bury 27 +frame_dig 28 callsub numericalcomp_0 -store 31 -load 32 +frame_bury 28 +frame_dig 29 callsub numericalcomp_0 -store 32 -load 33 +frame_bury 29 +frame_dig 30 callsub numericalcomp_0 -store 33 -load 34 +frame_bury 30 +frame_dig 31 callsub numericalcomp_0 -store 34 -load 35 +frame_bury 31 +frame_dig 32 callsub numericalcomp_0 -store 35 -load 36 +frame_bury 32 +frame_dig 33 callsub numericalcomp_0 -store 36 -load 37 +frame_bury 33 +frame_dig 34 callsub numericalcomp_0 -store 37 -load 38 +frame_bury 34 +frame_dig 35 callsub numericalcomp_0 -store 38 -load 39 +frame_bury 35 +frame_dig 36 callsub numericalcomp_0 -store 39 -load 40 +frame_bury 36 +frame_dig 37 callsub numericalcomp_0 -store 40 -load 41 +frame_bury 37 +frame_dig 38 callsub numericalcomp_0 -store 41 -load 42 +frame_bury 38 +frame_dig 39 callsub numericalcomp_0 -store 42 -load 43 +frame_bury 39 +frame_dig 40 callsub numericalcomp_0 -store 43 -load 44 +frame_bury 40 +frame_dig 41 callsub numericalcomp_0 -store 44 -load 45 +frame_bury 41 +frame_dig 42 callsub numericalcomp_0 -store 45 -load 4 +frame_bury 42 +frame_dig 1 itob -load 5 +frame_dig 2 itob concat -load 6 +frame_dig 3 itob concat -load 7 +frame_dig 4 itob concat -load 8 +frame_dig 5 itob concat -load 9 +frame_dig 6 itob concat -load 10 +frame_dig 7 itob concat -load 11 +frame_dig 8 itob concat -load 12 +frame_dig 9 itob concat -load 13 +frame_dig 10 itob concat -load 14 +frame_dig 11 itob concat -load 15 +frame_dig 12 itob concat -load 16 +frame_dig 13 itob concat -load 17 +frame_dig 14 itob concat -load 18 +frame_dig 15 itob concat -load 19 +frame_dig 16 itob concat -load 20 +frame_dig 17 itob concat -load 21 +frame_dig 18 itob concat -load 22 +frame_dig 19 itob concat -load 23 +frame_dig 20 itob concat -load 24 +frame_dig 21 itob concat -load 25 +frame_dig 22 itob concat -load 26 +frame_dig 23 itob concat -load 27 +frame_dig 24 itob concat -load 28 +frame_dig 25 itob concat -load 29 +frame_dig 26 itob concat -load 30 +frame_dig 27 itob concat -load 31 +frame_dig 28 itob concat -load 32 +frame_dig 29 itob concat -load 33 +frame_dig 30 itob concat -load 34 +frame_dig 31 itob concat -load 35 +frame_dig 32 itob concat -load 36 +frame_dig 33 itob concat -load 37 +frame_dig 34 itob concat -load 38 +frame_dig 35 itob concat -load 39 +frame_dig 36 itob concat -load 40 +frame_dig 37 itob concat -load 41 +frame_dig 38 itob concat -load 42 +frame_dig 39 itob concat -load 43 +frame_dig 40 itob concat -load 44 +frame_dig 41 itob concat -load 45 +frame_dig 42 itob concat frame_bury 0 @@ -535,16 +537,19 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -load 2 +frame_dig 1 concat -load 3 +frame_dig 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal index 87f935c92..173e4c5c5 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal @@ -16,8 +16,10 @@ arraycomplement_0: proto 1 1 byte "" int 0 -store 8 -load 8 +dupn 2 +int 0 +frame_bury 3 +frame_dig 3 itob extract 6 0 byte "" @@ -29,64 +31,67 @@ retsub roundtripper_1: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_0 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal index fb4caf8bd..2c095611e 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal @@ -25,6 +25,8 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 4 frame_dig -1 int 8 int 0 @@ -32,16 +34,16 @@ int 0 int 2 + extract_uint64 -store 8 -load 8 +frame_bury 1 +frame_dig 1 callsub numericalcomp_0 -store 8 +frame_bury 1 int 1 -store 9 -load 9 +frame_bury 5 +frame_dig 5 itob extract 6 0 -load 8 +frame_dig 1 itob concat frame_bury 0 @@ -51,64 +53,67 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 +load 3 concat -store 6 -load 5 -store 4 -load 4 -load 7 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal index cf61ff80f..c05b53930 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal @@ -25,6 +25,8 @@ retsub arraycomplement_1: proto 1 1 byte "" +int 0 +dupn 86 frame_dig -1 int 8 int 0 @@ -32,7 +34,7 @@ int 0 int 2 + extract_uint64 -store 8 +frame_bury 1 frame_dig -1 int 8 int 1 @@ -40,7 +42,7 @@ int 1 int 2 + extract_uint64 -store 9 +frame_bury 2 frame_dig -1 int 8 int 2 @@ -48,7 +50,7 @@ int 2 int 2 + extract_uint64 -store 10 +frame_bury 3 frame_dig -1 int 8 int 3 @@ -56,7 +58,7 @@ int 3 int 2 + extract_uint64 -store 11 +frame_bury 4 frame_dig -1 int 8 int 4 @@ -64,7 +66,7 @@ int 4 int 2 + extract_uint64 -store 12 +frame_bury 5 frame_dig -1 int 8 int 5 @@ -72,7 +74,7 @@ int 5 int 2 + extract_uint64 -store 13 +frame_bury 6 frame_dig -1 int 8 int 6 @@ -80,7 +82,7 @@ int 6 int 2 + extract_uint64 -store 14 +frame_bury 7 frame_dig -1 int 8 int 7 @@ -88,7 +90,7 @@ int 7 int 2 + extract_uint64 -store 15 +frame_bury 8 frame_dig -1 int 8 int 8 @@ -96,7 +98,7 @@ int 8 int 2 + extract_uint64 -store 16 +frame_bury 9 frame_dig -1 int 8 int 9 @@ -104,7 +106,7 @@ int 9 int 2 + extract_uint64 -store 17 +frame_bury 10 frame_dig -1 int 8 int 10 @@ -112,7 +114,7 @@ int 10 int 2 + extract_uint64 -store 18 +frame_bury 11 frame_dig -1 int 8 int 11 @@ -120,7 +122,7 @@ int 11 int 2 + extract_uint64 -store 19 +frame_bury 12 frame_dig -1 int 8 int 12 @@ -128,7 +130,7 @@ int 12 int 2 + extract_uint64 -store 20 +frame_bury 13 frame_dig -1 int 8 int 13 @@ -136,7 +138,7 @@ int 13 int 2 + extract_uint64 -store 21 +frame_bury 14 frame_dig -1 int 8 int 14 @@ -144,7 +146,7 @@ int 14 int 2 + extract_uint64 -store 22 +frame_bury 15 frame_dig -1 int 8 int 15 @@ -152,7 +154,7 @@ int 15 int 2 + extract_uint64 -store 23 +frame_bury 16 frame_dig -1 int 8 int 16 @@ -160,7 +162,7 @@ int 16 int 2 + extract_uint64 -store 24 +frame_bury 17 frame_dig -1 int 8 int 17 @@ -168,7 +170,7 @@ int 17 int 2 + extract_uint64 -store 25 +frame_bury 18 frame_dig -1 int 8 int 18 @@ -176,7 +178,7 @@ int 18 int 2 + extract_uint64 -store 26 +frame_bury 19 frame_dig -1 int 8 int 19 @@ -184,7 +186,7 @@ int 19 int 2 + extract_uint64 -store 27 +frame_bury 20 frame_dig -1 int 8 int 20 @@ -192,7 +194,7 @@ int 20 int 2 + extract_uint64 -store 28 +frame_bury 21 frame_dig -1 int 8 int 21 @@ -200,7 +202,7 @@ int 21 int 2 + extract_uint64 -store 29 +frame_bury 22 frame_dig -1 int 8 int 22 @@ -208,7 +210,7 @@ int 22 int 2 + extract_uint64 -store 30 +frame_bury 23 frame_dig -1 int 8 int 23 @@ -216,7 +218,7 @@ int 23 int 2 + extract_uint64 -store 31 +frame_bury 24 frame_dig -1 int 8 int 24 @@ -224,7 +226,7 @@ int 24 int 2 + extract_uint64 -store 32 +frame_bury 25 frame_dig -1 int 8 int 25 @@ -232,7 +234,7 @@ int 25 int 2 + extract_uint64 -store 33 +frame_bury 26 frame_dig -1 int 8 int 26 @@ -240,7 +242,7 @@ int 26 int 2 + extract_uint64 -store 34 +frame_bury 27 frame_dig -1 int 8 int 27 @@ -248,7 +250,7 @@ int 27 int 2 + extract_uint64 -store 35 +frame_bury 28 frame_dig -1 int 8 int 28 @@ -256,7 +258,7 @@ int 28 int 2 + extract_uint64 -store 36 +frame_bury 29 frame_dig -1 int 8 int 29 @@ -264,7 +266,7 @@ int 29 int 2 + extract_uint64 -store 37 +frame_bury 30 frame_dig -1 int 8 int 30 @@ -272,7 +274,7 @@ int 30 int 2 + extract_uint64 -store 38 +frame_bury 31 frame_dig -1 int 8 int 31 @@ -280,7 +282,7 @@ int 31 int 2 + extract_uint64 -store 39 +frame_bury 32 frame_dig -1 int 8 int 32 @@ -288,7 +290,7 @@ int 32 int 2 + extract_uint64 -store 40 +frame_bury 33 frame_dig -1 int 8 int 33 @@ -296,7 +298,7 @@ int 33 int 2 + extract_uint64 -store 41 +frame_bury 34 frame_dig -1 int 8 int 34 @@ -304,7 +306,7 @@ int 34 int 2 + extract_uint64 -store 42 +frame_bury 35 frame_dig -1 int 8 int 35 @@ -312,7 +314,7 @@ int 35 int 2 + extract_uint64 -store 43 +frame_bury 36 frame_dig -1 int 8 int 36 @@ -320,7 +322,7 @@ int 36 int 2 + extract_uint64 -store 44 +frame_bury 37 frame_dig -1 int 8 int 37 @@ -328,7 +330,7 @@ int 37 int 2 + extract_uint64 -store 45 +frame_bury 38 frame_dig -1 int 8 int 38 @@ -336,7 +338,7 @@ int 38 int 2 + extract_uint64 -store 46 +frame_bury 39 frame_dig -1 int 8 int 39 @@ -344,7 +346,7 @@ int 39 int 2 + extract_uint64 -store 47 +frame_bury 40 frame_dig -1 int 8 int 40 @@ -352,7 +354,7 @@ int 40 int 2 + extract_uint64 -store 48 +frame_bury 41 frame_dig -1 int 8 int 41 @@ -360,261 +362,261 @@ int 41 int 2 + extract_uint64 -store 49 -load 8 +frame_bury 42 +frame_dig 1 callsub numericalcomp_0 -store 8 -load 9 +frame_bury 1 +frame_dig 2 callsub numericalcomp_0 -store 9 -load 10 +frame_bury 2 +frame_dig 3 callsub numericalcomp_0 -store 10 -load 11 +frame_bury 3 +frame_dig 4 callsub numericalcomp_0 -store 11 -load 12 +frame_bury 4 +frame_dig 5 callsub numericalcomp_0 -store 12 -load 13 +frame_bury 5 +frame_dig 6 callsub numericalcomp_0 -store 13 -load 14 +frame_bury 6 +frame_dig 7 callsub numericalcomp_0 -store 14 -load 15 +frame_bury 7 +frame_dig 8 callsub numericalcomp_0 -store 15 -load 16 +frame_bury 8 +frame_dig 9 callsub numericalcomp_0 -store 16 -load 17 +frame_bury 9 +frame_dig 10 callsub numericalcomp_0 -store 17 -load 18 +frame_bury 10 +frame_dig 11 callsub numericalcomp_0 -store 18 -load 19 +frame_bury 11 +frame_dig 12 callsub numericalcomp_0 -store 19 -load 20 +frame_bury 12 +frame_dig 13 callsub numericalcomp_0 -store 20 -load 21 +frame_bury 13 +frame_dig 14 callsub numericalcomp_0 -store 21 -load 22 +frame_bury 14 +frame_dig 15 callsub numericalcomp_0 -store 22 -load 23 +frame_bury 15 +frame_dig 16 callsub numericalcomp_0 -store 23 -load 24 +frame_bury 16 +frame_dig 17 callsub numericalcomp_0 -store 24 -load 25 +frame_bury 17 +frame_dig 18 callsub numericalcomp_0 -store 25 -load 26 +frame_bury 18 +frame_dig 19 callsub numericalcomp_0 -store 26 -load 27 +frame_bury 19 +frame_dig 20 callsub numericalcomp_0 -store 27 -load 28 +frame_bury 20 +frame_dig 21 callsub numericalcomp_0 -store 28 -load 29 +frame_bury 21 +frame_dig 22 callsub numericalcomp_0 -store 29 -load 30 +frame_bury 22 +frame_dig 23 callsub numericalcomp_0 -store 30 -load 31 +frame_bury 23 +frame_dig 24 callsub numericalcomp_0 -store 31 -load 32 +frame_bury 24 +frame_dig 25 callsub numericalcomp_0 -store 32 -load 33 +frame_bury 25 +frame_dig 26 callsub numericalcomp_0 -store 33 -load 34 +frame_bury 26 +frame_dig 27 callsub numericalcomp_0 -store 34 -load 35 +frame_bury 27 +frame_dig 28 callsub numericalcomp_0 -store 35 -load 36 +frame_bury 28 +frame_dig 29 callsub numericalcomp_0 -store 36 -load 37 +frame_bury 29 +frame_dig 30 callsub numericalcomp_0 -store 37 -load 38 +frame_bury 30 +frame_dig 31 callsub numericalcomp_0 -store 38 -load 39 +frame_bury 31 +frame_dig 32 callsub numericalcomp_0 -store 39 -load 40 +frame_bury 32 +frame_dig 33 callsub numericalcomp_0 -store 40 -load 41 +frame_bury 33 +frame_dig 34 callsub numericalcomp_0 -store 41 -load 42 +frame_bury 34 +frame_dig 35 callsub numericalcomp_0 -store 42 -load 43 +frame_bury 35 +frame_dig 36 callsub numericalcomp_0 -store 43 -load 44 +frame_bury 36 +frame_dig 37 callsub numericalcomp_0 -store 44 -load 45 +frame_bury 37 +frame_dig 38 callsub numericalcomp_0 -store 45 -load 46 +frame_bury 38 +frame_dig 39 callsub numericalcomp_0 -store 46 -load 47 +frame_bury 39 +frame_dig 40 callsub numericalcomp_0 -store 47 -load 48 +frame_bury 40 +frame_dig 41 callsub numericalcomp_0 -store 48 -load 49 +frame_bury 41 +frame_dig 42 callsub numericalcomp_0 -store 49 +frame_bury 42 int 42 -store 50 -load 50 +frame_bury 87 +frame_dig 87 itob extract 6 0 -load 8 +frame_dig 1 itob -load 9 +frame_dig 2 itob concat -load 10 +frame_dig 3 itob concat -load 11 +frame_dig 4 itob concat -load 12 +frame_dig 5 itob concat -load 13 +frame_dig 6 itob concat -load 14 +frame_dig 7 itob concat -load 15 +frame_dig 8 itob concat -load 16 +frame_dig 9 itob concat -load 17 +frame_dig 10 itob concat -load 18 +frame_dig 11 itob concat -load 19 +frame_dig 12 itob concat -load 20 +frame_dig 13 itob concat -load 21 +frame_dig 14 itob concat -load 22 +frame_dig 15 itob concat -load 23 +frame_dig 16 itob concat -load 24 +frame_dig 17 itob concat -load 25 +frame_dig 18 itob concat -load 26 +frame_dig 19 itob concat -load 27 +frame_dig 20 itob concat -load 28 +frame_dig 21 itob concat -load 29 +frame_dig 22 itob concat -load 30 +frame_dig 23 itob concat -load 31 +frame_dig 24 itob concat -load 32 +frame_dig 25 itob concat -load 33 +frame_dig 26 itob concat -load 34 +frame_dig 27 itob concat -load 35 +frame_dig 28 itob concat -load 36 +frame_dig 29 itob concat -load 37 +frame_dig 30 itob concat -load 38 +frame_dig 31 itob concat -load 39 +frame_dig 32 itob concat -load 40 +frame_dig 33 itob concat -load 41 +frame_dig 34 itob concat -load 42 +frame_dig 35 itob concat -load 43 +frame_dig 36 itob concat -load 44 +frame_dig 37 itob concat -load 45 +frame_dig 38 itob concat -load 46 +frame_dig 39 itob concat -load 47 +frame_dig 40 itob concat -load 48 +frame_dig 41 itob concat -load 49 +frame_dig 42 itob concat concat @@ -625,64 +627,67 @@ retsub roundtripper_2: proto 1 1 byte "" +dupn 2 +int 0 +dupn 1 frame_dig -1 callsub arraycomplement_1 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub arraycomplement_1 -store 3 +frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +store 3 +load 3 +store 2 int 6 -store 4 -load 4 -load 7 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 +frame_dig 1 +store 3 load 2 -store 7 -load 6 -load 7 -concat -store 6 -load 5 -store 4 -load 4 -load 7 +load 3 +concat +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 +load 3 len + -store 5 -load 5 +frame_bury 4 +frame_dig 4 int 65536 < assert -load 4 +frame_dig 3 itob extract 6 0 concat +frame_dig 2 +store 3 +load 2 load 3 -store 7 -load 6 -load 7 concat -store 6 -load 5 -store 4 -load 4 +store 2 +frame_dig 4 +frame_bury 3 +frame_dig 3 itob extract 6 0 concat -load 6 +load 2 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal index ce11171f2..6a94f89c3 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal @@ -26,18 +26,20 @@ retsub roundtripper_1: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 callsub numericalcomp_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub numericalcomp_0 -store 3 +frame_bury 2 frame_dig -1 itob -load 2 +frame_dig 1 itob concat -load 3 +frame_dig 2 itob concat frame_bury 0 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal index c7dfcc09f..58daf6eb2 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal @@ -31,24 +31,26 @@ retsub roundtripper_1: proto 1 1 byte "" +int 0 +dupn 3 frame_dig -1 callsub numericalcomp_0 -store 2 -load 2 +frame_bury 1 +frame_dig 1 callsub numericalcomp_0 -store 3 +frame_bury 2 byte 0x00 int 0 frame_dig -1 setbyte byte 0x00 int 0 -load 2 +frame_dig 1 setbyte concat byte 0x00 int 0 -load 3 +frame_dig 2 setbyte concat frame_bury 0 From 38a9c86d1103f5f1d65a242743e948bb20126b2e Mon Sep 17 00:00:00 2001 From: Hang Su Date: Fri, 2 Dec 2022 21:46:51 -0500 Subject: [PATCH 02/22] notes --- pyteal/ast/subroutine.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index 7e3e14c51..864b96328 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1087,6 +1087,7 @@ def __enter__(self): return self def __exit__(self, *_): + # HANG NOTE: TODO revisit this part, sounds right? SubroutineEval.Context.config_use_frame_pointer = False SubroutineEval.Context.proto = self.prev_ctxt_proto return None From ba5e2ed0a6fc384d05cc023b8062950b01a63309 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Fri, 2 Dec 2022 21:55:37 -0500 Subject: [PATCH 03/22] remove unnecessary cond --- pyteal/ast/abi/type.py | 3 +-- pyteal/ast/subroutine.py | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index b7ebe5bd5..0608b4be3 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -83,8 +83,7 @@ def __init__(self, spec: TypeSpec) -> None: self._type_spec: Final[TypeSpec] = spec self._stored_value: AbstractVar - if SubroutineEval.Context.config_use_frame_pointer: - assert SubroutineEval.Context.proto + if SubroutineEval.Context.proto: proto = SubroutineEval.Context.proto assert proto.mem_layout diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index 864b96328..b2705ba5d 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1073,22 +1073,18 @@ def fp_evaluator(cls) -> "SubroutineEval": return cls(SubroutineEval.var_n_loaded_fp, True) class Context: - config_use_frame_pointer: bool = False proto: Optional[Proto] = None class CompileWithFrameContext(AbstractContextManager): def __init__(self, _proto: Proto): super().__init__() - self.prev_ctxt_proto: Optional[Proto] = SubroutineEval.Context.proto + self.prev_ctxt_proto = SubroutineEval.Context.proto SubroutineEval.Context.proto = _proto def __enter__(self): - SubroutineEval.Context.config_use_frame_pointer = True return self def __exit__(self, *_): - # HANG NOTE: TODO revisit this part, sounds right? - SubroutineEval.Context.config_use_frame_pointer = False SubroutineEval.Context.proto = self.prev_ctxt_proto return None From 5dd282ce93ff287ee424e8289e5763eb41c0fb04 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Sat, 3 Dec 2022 19:51:44 -0500 Subject: [PATCH 04/22] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c9265ab2..ad70bdfb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # Added * Added frame pointer support for subroutine arguments, replacing the previous usage of scratch. ([#562](https://github.com/algorand/pyteal/pull/562)) +* Added frame pointer support for local ABI variables in subroutine. ([#606](https://github.com/algorand/pyteal/pull/606)) # Fixed * Allowing the `MethodCall` and `ExecuteMethodCall` to be passed `None` as app_id argument in the case of an app create transaction ([#592](https://github.com/algorand/pyteal/pull/592)) From c936f431dfb2664384e3538efb8d131fe39cd507 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Mon, 5 Dec 2022 11:39:57 -0500 Subject: [PATCH 05/22] CONST for frmae local total number --- pyteal/ast/abi/type.py | 4 ++-- pyteal/ast/frame.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index 0608b4be3..b3113e74d 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -3,7 +3,7 @@ from pyteal.ast.expr import Expr from pyteal.ast.abstractvar import AbstractVar -from pyteal.ast.frame import FrameVar +from pyteal.ast.frame import FrameVar, FRAME_LOCAL_NUM from pyteal.ast.scratchvar import ScratchVar from pyteal.ast.seq import Seq from pyteal.errors import TealInputError @@ -92,7 +92,7 @@ def __init__(self, spec: TypeSpec) -> None: # NOTE: you can have at most 128 local variables. # len(local_types) + 1 computes the resulting length, # should be <= 128 - if len(local_types) + 1 <= 128: + if len(local_types) + 1 <= FRAME_LOCAL_NUM: local_types.append(self._type_spec.storage_type()) self._stored_value = FrameVar(proto, len(local_types) - 1) return diff --git a/pyteal/ast/frame.py b/pyteal/ast/frame.py index deb3eefaf..4e5f1e04a 100644 --- a/pyteal/ast/frame.py +++ b/pyteal/ast/frame.py @@ -1,5 +1,5 @@ from itertools import groupby -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, Optional, Final from pyteal.ast.expr import Expr from pyteal.ast.int import Int @@ -13,6 +13,9 @@ from pyteal.compiler import CompileOptions +FRAME_LOCAL_NUM: Final[int] = 128 + + class LocalTypeSegment(Expr): """An expression that allocates stack spaces for local variable. From a5b32c0cac0b8e9127877ff0c42dbd3e267e1a57 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Wed, 7 Dec 2022 13:22:32 -0500 Subject: [PATCH 06/22] per MAX number suggestion --- pyteal/ast/abi/type.py | 4 ++-- pyteal/ast/frame.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index b3113e74d..80cf16a4f 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -3,7 +3,7 @@ from pyteal.ast.expr import Expr from pyteal.ast.abstractvar import AbstractVar -from pyteal.ast.frame import FrameVar, FRAME_LOCAL_NUM +from pyteal.ast.frame import FrameVar, MAX_FRAME_LOCAL_VARS from pyteal.ast.scratchvar import ScratchVar from pyteal.ast.seq import Seq from pyteal.errors import TealInputError @@ -92,7 +92,7 @@ def __init__(self, spec: TypeSpec) -> None: # NOTE: you can have at most 128 local variables. # len(local_types) + 1 computes the resulting length, # should be <= 128 - if len(local_types) + 1 <= FRAME_LOCAL_NUM: + if len(local_types) + 1 <= MAX_FRAME_LOCAL_VARS: local_types.append(self._type_spec.storage_type()) self._stored_value = FrameVar(proto, len(local_types) - 1) return diff --git a/pyteal/ast/frame.py b/pyteal/ast/frame.py index 4e5f1e04a..9e943363d 100644 --- a/pyteal/ast/frame.py +++ b/pyteal/ast/frame.py @@ -13,7 +13,7 @@ from pyteal.compiler import CompileOptions -FRAME_LOCAL_NUM: Final[int] = 128 +MAX_FRAME_LOCAL_VARS: Final[int] = 128 class LocalTypeSegment(Expr): From 06774f675f208f5085760014ed20929a9bd7129d Mon Sep 17 00:00:00 2001 From: Hang Su Date: Wed, 7 Dec 2022 14:06:04 -0500 Subject: [PATCH 07/22] make default mem_layout --- pyteal/ast/abi/type.py | 9 ++++----- pyteal/ast/frame.py | 25 +++++++++++++++---------- pyteal/ast/frame_test.py | 11 +++++++++-- pyteal/ast/subroutine.py | 1 - 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index 80cf16a4f..1463b0659 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -84,17 +84,16 @@ def __init__(self, spec: TypeSpec) -> None: self._stored_value: AbstractVar if SubroutineEval.Context.proto: - proto = SubroutineEval.Context.proto - - assert proto.mem_layout - local_types = proto.mem_layout.local_stack_types + local_types = SubroutineEval.Context.proto.mem_layout.local_stack_types # NOTE: you can have at most 128 local variables. # len(local_types) + 1 computes the resulting length, # should be <= 128 if len(local_types) + 1 <= MAX_FRAME_LOCAL_VARS: local_types.append(self._type_spec.storage_type()) - self._stored_value = FrameVar(proto, len(local_types) - 1) + self._stored_value = FrameVar( + SubroutineEval.Context.proto, len(local_types) - 1 + ) return self._stored_value = ScratchVar(spec.storage_type()) diff --git a/pyteal/ast/frame.py b/pyteal/ast/frame.py index 9e943363d..0b5fcca3f 100644 --- a/pyteal/ast/frame.py +++ b/pyteal/ast/frame.py @@ -107,6 +107,14 @@ def __getitem__(self, index: int) -> TealType: def __str__(self) -> str: return f"(ProtoStackLayout: (args: {self.arg_stack_types}) (locals: {self.local_stack_types}))" + @classmethod + def from_proto(cls, proto: "Proto") -> "ProtoStackLayout": + return cls( + [TealType.anytype] * proto.num_args, + [TealType.anytype] * proto.num_returns, + proto.num_returns, + ) + def has_return(self) -> bool: return False @@ -160,6 +168,9 @@ def __init__( raise TealInputError( f"The number of returns provided to Proto must be >= 0 but {num_returns=}." ) + self.num_args = num_args + self.num_returns = num_returns + if mem_layout: if mem_layout.num_return_allocs > num_returns: raise TealInternalError( @@ -171,10 +182,10 @@ def __init__( f"The number of arguments {num_args} should match with " f"memory layout's number of arguments {len(mem_layout.arg_stack_types)}" ) + else: + mem_layout = ProtoStackLayout.from_proto(self) - self.num_args = num_args - self.num_returns = num_returns - self.mem_layout: Optional[ProtoStackLayout] = mem_layout + self.mem_layout: ProtoStackLayout = mem_layout def __teal__(self, options: "CompileOptions") -> tuple[TealBlock, TealSimpleBlock]: verifyProgramVersion( @@ -184,8 +195,6 @@ def __teal__(self, options: "CompileOptions") -> tuple[TealBlock, TealSimpleBloc ) op = TealOp(self, Op.proto, self.num_args, self.num_returns) proto_srt, proto_end = TealBlock.FromOp(options, op) - if not self.mem_layout: - return proto_srt, proto_end local_srt, local_end = self.mem_layout.__teal__(options) proto_end.setNextBlock(local_srt) return proto_srt, local_end @@ -294,11 +303,7 @@ def __init__(self, under_proto: Proto, frame_index: int) -> None: super().__init__() self.proto = under_proto self.frame_index = frame_index - self.stack_type = ( - self.proto.mem_layout[frame_index] - if self.proto.mem_layout - else TealType.anytype - ) + self.stack_type = self.proto.mem_layout[frame_index] def storage_type(self) -> TealType: return self.stack_type diff --git a/pyteal/ast/frame_test.py b/pyteal/ast/frame_test.py index e58e11af7..89e3f2763 100644 --- a/pyteal/ast/frame_test.py +++ b/pyteal/ast/frame_test.py @@ -20,12 +20,19 @@ def test_proto(input_num: int, output_num: int): assert not expr.has_return() assert expr.type_of() == pt.TealType.none - expected = pt.TealSimpleBlock([pt.TealOp(expr, pt.Op.proto, input_num, output_num)]) + block = [pt.TealOp(expr, pt.Op.proto, input_num, output_num)] + if output_num > 0: + block.append(pt.TealOp(None, pt.Op.int, 0)) + if output_num > 1: + block.append(pt.TealOp(None, pt.Op.dupn, output_num - 1)) + + expected = pt.TealSimpleBlock(block) actual, _ = expr.__teal__(avm8Options) actual.addIncoming() actual = pt.TealBlock.NormalizeBlocks(actual) - assert actual == expected + with pt.TealComponent.Context.ignoreExprEquality(): + assert actual == expected def test_proto_invalid(): diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index b2705ba5d..ee2d9f67d 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1037,7 +1037,6 @@ def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: deferred_expr = output_carrying_abi._stored_value.load() if self.use_frame_pt: - assert proto.mem_layout depth = len(proto.mem_layout.local_stack_types) # only when we have 1 return, and with other local variables # we use bury to bury the result to 0 index against frame pointer From ec3e0e781422d052e24837d33b95a03b3a6e897b Mon Sep 17 00:00:00 2001 From: Hang Su Date: Wed, 7 Dec 2022 14:39:32 -0500 Subject: [PATCH 08/22] remove bury op use --- pyteal/ast/frame.py | 30 +----------------------------- pyteal/ast/subroutine.py | 4 ++-- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/pyteal/ast/frame.py b/pyteal/ast/frame.py index 0b5fcca3f..d477d2d86 100644 --- a/pyteal/ast/frame.py +++ b/pyteal/ast/frame.py @@ -262,7 +262,7 @@ def __init__( ): super().__init__() - target_type = inferred_type if inferred_type else TealType.anytype + target_type = inferred_type if inferred_type is not None else TealType.anytype require_type(value, target_type) self.value = value @@ -357,31 +357,3 @@ def has_return(self) -> bool: DupN.__module__ = "pyteal" - - -class Bury(Expr): - def __init__(self, depth: int): - super(Bury, self).__init__() - if depth <= 0: - raise TealInputError("bury depth should be positive") - self.depth = depth - - def __teal__(self, options: "CompileOptions") -> tuple[TealBlock, TealSimpleBlock]: - verifyProgramVersion( - Op.bury.min_version, - options.version, - "Program version too low to use bury", - ) - return TealBlock.FromOp(options, TealOp(self, Op.bury, self.depth)) - - def __str__(self): - return f"(Bury {self.depth})" - - def has_return(self) -> bool: - return False - - def type_of(self) -> TealType: - return TealType.none - - -Bury.__module__ = "pyteal" diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index ee2d9f67d..b1a9026a9 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -10,7 +10,7 @@ from pyteal.ast.expr import Expr from pyteal.ast.seq import Seq from pyteal.ast.scratchvar import DynamicScratchVar, ScratchVar, ScratchSlot -from pyteal.ast.frame import Bury, Proto, FrameVar, ProtoStackLayout +from pyteal.ast.frame import FrameBury, Proto, FrameVar, ProtoStackLayout from pyteal.errors import TealInputError, TealInternalError, verifyProgramVersion from pyteal.ir import TealOp, Op, TealBlock from pyteal.types import TealType @@ -1041,7 +1041,7 @@ def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: # only when we have 1 return, and with other local variables # we use bury to bury the result to 0 index against frame pointer if not abi_output_kwargs and 0 < proto.num_returns < depth: - deferred_expr = Bury(depth) + deferred_expr = FrameBury(Seq(), 0, inferred_type=TealType.none) # Arg usage "A" to be pick up and store in scratch parameters that have been placed on the stack # need to reverse order of argumentVars because the last argument will be on top of the stack From 7514b14397978e881e2354e014e4f9d5ca51cee6 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Wed, 7 Dec 2022 15:57:55 -0500 Subject: [PATCH 09/22] remove context syntax --- pyteal/ast/abi/type.py | 6 +++--- pyteal/ast/subroutine.py | 30 ++++++++---------------------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index 1463b0659..b85c3f0b9 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -83,8 +83,8 @@ def __init__(self, spec: TypeSpec) -> None: self._type_spec: Final[TypeSpec] = spec self._stored_value: AbstractVar - if SubroutineEval.Context.proto: - local_types = SubroutineEval.Context.proto.mem_layout.local_stack_types + if SubroutineEval.current_proto: + local_types = SubroutineEval.current_proto.mem_layout.local_stack_types # NOTE: you can have at most 128 local variables. # len(local_types) + 1 computes the resulting length, @@ -92,7 +92,7 @@ def __init__(self, spec: TypeSpec) -> None: if len(local_types) + 1 <= MAX_FRAME_LOCAL_VARS: local_types.append(self._type_spec.storage_type()) self._stored_value = FrameVar( - SubroutineEval.Context.proto, len(local_types) - 1 + SubroutineEval.current_proto, len(local_types) - 1 ) return diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index b1a9026a9..381b4ffa9 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1,9 +1,8 @@ -from contextlib import AbstractContextManager from dataclasses import dataclass from docstring_parser import parse as parse_docstring from inspect import isclass, Parameter, signature, get_annotations from types import MappingProxyType, NoneType -from typing import Any, Callable, Final, Optional, TYPE_CHECKING, cast +from typing import Any, Callable, Final, Optional, TYPE_CHECKING, cast, ClassVar import algosdk.abi as sdk_abi from pyteal.ast import abi @@ -890,6 +889,7 @@ class SubroutineEval: tuple[Optional[ScratchVar], ScratchVar | abi.BaseType | Expr], ] use_frame_pt: bool = False + current_proto: ClassVar[Optional[Proto]] = None @staticmethod def var_n_loaded_scratch( @@ -1013,10 +1013,12 @@ def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: *loaded_args, **abi_output_kwargs ) else: - with SubroutineEval.Context.CompileWithFrameContext(proto): - subroutine_body = subroutine.implementation( - *loaded_args, **abi_output_kwargs - ) + prev_proto: Optional[Proto] = SubroutineEval.current_proto + SubroutineEval.current_proto = proto + subroutine_body = subroutine.implementation( + *loaded_args, **abi_output_kwargs + ) + SubroutineEval.current_proto = prev_proto if not isinstance(subroutine_body, Expr): raise TealInputError( @@ -1071,21 +1073,5 @@ def normal_evaluator(cls) -> "SubroutineEval": def fp_evaluator(cls) -> "SubroutineEval": return cls(SubroutineEval.var_n_loaded_fp, True) - class Context: - proto: Optional[Proto] = None - - class CompileWithFrameContext(AbstractContextManager): - def __init__(self, _proto: Proto): - super().__init__() - self.prev_ctxt_proto = SubroutineEval.Context.proto - SubroutineEval.Context.proto = _proto - - def __enter__(self): - return self - - def __exit__(self, *_): - SubroutineEval.Context.proto = self.prev_ctxt_proto - return None - SubroutineEval.__module__ = "pyteal" From 13309f6ac66aefb9e7df2450ae6ae5c0e3dccfb5 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Thu, 8 Dec 2022 10:55:28 -0500 Subject: [PATCH 10/22] revert back to context manager --- pyteal/ast/abi/type.py | 8 ++++---- pyteal/ast/subroutine.py | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index b85c3f0b9..e82853cf9 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -83,16 +83,16 @@ def __init__(self, spec: TypeSpec) -> None: self._type_spec: Final[TypeSpec] = spec self._stored_value: AbstractVar - if SubroutineEval.current_proto: - local_types = SubroutineEval.current_proto.mem_layout.local_stack_types + if SubroutineEval._current_proto: + local_types = SubroutineEval._current_proto.mem_layout.local_stack_types # NOTE: you can have at most 128 local variables. # len(local_types) + 1 computes the resulting length, # should be <= 128 if len(local_types) + 1 <= MAX_FRAME_LOCAL_VARS: - local_types.append(self._type_spec.storage_type()) + local_types.append(spec.storage_type()) self._stored_value = FrameVar( - SubroutineEval.current_proto, len(local_types) - 1 + SubroutineEval._current_proto, len(local_types) - 1 ) return diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index 381b4ffa9..c6811e558 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1,3 +1,4 @@ +from contextlib import contextmanager from dataclasses import dataclass from docstring_parser import parse as parse_docstring from inspect import isclass, Parameter, signature, get_annotations @@ -815,6 +816,13 @@ def __call__(self, fn_implementation: Callable[..., Expr]) -> SubroutineFnWrappe Subroutine.__module__ = "pyteal" +@contextmanager +def _frame_pointer_context(proto: Proto): + tmp, SubroutineEval._current_proto = SubroutineEval._current_proto, proto + yield proto + SubroutineEval._current_proto = tmp + + @dataclass class SubroutineEval: """ @@ -889,7 +897,7 @@ class SubroutineEval: tuple[Optional[ScratchVar], ScratchVar | abi.BaseType | Expr], ] use_frame_pt: bool = False - current_proto: ClassVar[Optional[Proto]] = None + _current_proto: ClassVar[Optional[Proto]] = None @staticmethod def var_n_loaded_scratch( @@ -1013,12 +1021,10 @@ def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: *loaded_args, **abi_output_kwargs ) else: - prev_proto: Optional[Proto] = SubroutineEval.current_proto - SubroutineEval.current_proto = proto - subroutine_body = subroutine.implementation( - *loaded_args, **abi_output_kwargs - ) - SubroutineEval.current_proto = prev_proto + with _frame_pointer_context(proto): + subroutine_body = subroutine.implementation( + *loaded_args, **abi_output_kwargs + ) if not isinstance(subroutine_body, Expr): raise TealInputError( From ff1fc63cdc3e936079a2cc9e8f6873954a0e5133 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Mon, 12 Dec 2022 11:32:03 -0500 Subject: [PATCH 11/22] separate logic of alloc abstract var --- pyteal/ast/abi/type.py | 23 ++--------------------- pyteal/ast/abstractvar.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index e82853cf9..0c7951b14 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -2,9 +2,7 @@ from abc import ABC, abstractmethod from pyteal.ast.expr import Expr -from pyteal.ast.abstractvar import AbstractVar -from pyteal.ast.frame import FrameVar, MAX_FRAME_LOCAL_VARS -from pyteal.ast.scratchvar import ScratchVar +from pyteal.ast.abstractvar import AbstractVar, alloc_abstract_var from pyteal.ast.seq import Seq from pyteal.errors import TealInputError from pyteal.types import TealType @@ -77,26 +75,9 @@ class BaseType(ABC): def __init__(self, spec: TypeSpec) -> None: """Create a new BaseType.""" - from pyteal.ast.subroutine import SubroutineEval - super().__init__() self._type_spec: Final[TypeSpec] = spec - self._stored_value: AbstractVar - - if SubroutineEval._current_proto: - local_types = SubroutineEval._current_proto.mem_layout.local_stack_types - - # NOTE: you can have at most 128 local variables. - # len(local_types) + 1 computes the resulting length, - # should be <= 128 - if len(local_types) + 1 <= MAX_FRAME_LOCAL_VARS: - local_types.append(spec.storage_type()) - self._stored_value = FrameVar( - SubroutineEval._current_proto, len(local_types) - 1 - ) - return - - self._stored_value = ScratchVar(spec.storage_type()) + self._stored_value: AbstractVar = alloc_abstract_var(spec.storage_type()) def type_spec(self) -> TypeSpec: """Get the TypeSpec for this ABI type instance.""" diff --git a/pyteal/ast/abstractvar.py b/pyteal/ast/abstractvar.py index 0ed9bf9b2..1057774a9 100644 --- a/pyteal/ast/abstractvar.py +++ b/pyteal/ast/abstractvar.py @@ -38,3 +38,32 @@ def storage_type(self) -> TealType: AbstractVar.__module__ = "pyteal" + + +def alloc_abstract_var(stack_type: TealType) -> AbstractVar: + """Allocate abstract var over stack, or over scratch. + + This unexported function takes a TealType as value type representation over stack (or scratch), + and generates an AbstractVar instance. + It infers the proto currently being used in context of subroutine evaluation, + and swap to FrameVar to save the use of scratch slots. + + Arg: + stack_type: An TealType that represents stack type. + """ + + from pyteal.ast import ScratchVar + from pyteal.ast.subroutine import SubroutineEval + from pyteal.ast.frame import FrameVar, MAX_FRAME_LOCAL_VARS + + if SubroutineEval._current_proto: + local_types = SubroutineEval._current_proto.mem_layout.local_stack_types + + # NOTE: you can have at most 128 local variables. + # len(local_types) + 1 computes the resulting length, + # should be <= 128 + if len(local_types) + 1 <= MAX_FRAME_LOCAL_VARS: + local_types.append(stack_type) + return FrameVar(SubroutineEval._current_proto, len(local_types) - 1) + + return ScratchVar(stack_type) From 33fe9661adbc53c39d6fc61688392b1565b66a76 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Mon, 12 Dec 2022 13:19:18 -0500 Subject: [PATCH 12/22] declaration get by option --- pyteal/ast/abi/type.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index 0c7951b14..76ff79be5 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -224,7 +224,7 @@ def store_into(self, output: BaseType) -> Expr: # the post frame pointer case should not apply # need to somehow expose the context of evaluation try: - declaration = self.computation.subroutine.get_declaration() + declaration = self.computation.subroutine.get_declaration_by_option(False) if declaration.deferred_expr is None: raise TealInputError( From 3c2927c2597dcc37e25a453bfb5639669311676b Mon Sep 17 00:00:00 2001 From: Hang Su Date: Mon, 12 Dec 2022 13:22:22 -0500 Subject: [PATCH 13/22] mark methods as deprecated --- pyteal/ast/subroutine.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index c6811e558..e1d8d472c 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -34,6 +34,7 @@ def __init__(self, subroutine_def: "SubroutineDefinition") -> None: self.type_of: Optional[TealType] = None def get_declaration(self) -> "SubroutineDeclaration": + """MARK AS DEPRECATED, FOR WE ARE NOW GET DECLARATION BY COMPILE OPTIONS""" return self.get_declaration_by_option(False) def get_declaration_by_option( @@ -305,6 +306,7 @@ def _validate_annotation( ) def get_declaration(self) -> "SubroutineDeclaration": + """MARK AS DEPRECATED, FOR WE ARE NOW GET DECLARATION BY COMPILE OPTIONS""" return self.declarations.get_declaration() def get_declaration_by_option( From 9ffe66815f6c8afc03b3af0642ffcb8d94ec37fa Mon Sep 17 00:00:00 2001 From: Hang Su Date: Mon, 12 Dec 2022 13:35:10 -0500 Subject: [PATCH 14/22] deprecated method change to get by option --- pyteal/compiler/compiler_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyteal/compiler/compiler_test.py b/pyteal/compiler/compiler_test.py index d4852bd73..64e9dd3c8 100644 --- a/pyteal/compiler/compiler_test.py +++ b/pyteal/compiler/compiler_test.py @@ -1714,7 +1714,7 @@ def deferredExample(value: pt.Expr) -> pt.Expr: assert actual_no_deferred == expected_no_deferred # manually add deferred expression to SubroutineDefinition - declaration = deferredExample.subroutine.get_declaration() + declaration = deferredExample.subroutine.get_declaration_by_option(False) declaration.deferred_expr = pt.Pop(pt.Bytes("deferred")) expected_deferred = """#pragma version 6 @@ -1786,7 +1786,7 @@ def empty() -> pt.Expr: assert actual_no_deferred == expected_no_deferred # manually add deferred expression to SubroutineDefinition - declaration = empty.subroutine.get_declaration() + declaration = empty.subroutine.get_declaration_by_option(False) declaration.deferred_expr = pt.Pop(pt.Bytes("deferred")) expected_deferred = """#pragma version 6 @@ -1837,7 +1837,7 @@ def bad() -> pt.Expr: program = pt.Seq(bad(), pt.Approve()) # manually add deferred expression to SubroutineDefinition - declaration = bad.subroutine.get_declaration() + declaration = bad.subroutine.get_declaration_by_option(False) declaration.deferred_expr = pt.Pop(pt.Bytes("deferred")) with pytest.raises( From d64d3f45a89f2ba943543b7f8bd1ecf26c9321dc Mon Sep 17 00:00:00 2001 From: Hang Su Date: Mon, 19 Dec 2022 15:30:40 -0500 Subject: [PATCH 15/22] try to use local variables --- pyteal/ast/abi/tuple.py | 6 +- .../teal/roundtrip/app_roundtrip_()_v8.teal | 4 + .../app_roundtrip_(bool)[10]_v8.teal | 6 + .../roundtrip/app_roundtrip_(bool)_v8.teal | 4 + ...t64,bool),byte[10],bool[4],uint64)_v8.teal | 16 +- .../app_roundtrip_(bool,byte)_v8.teal | 4 + ...undtrip_(bool,byte,address,string)_v8.teal | 61 ++-- ...yte),uint8)[2],string,bool[]))[]_2_v8.teal | 345 ++++++++++-------- ..._(bool,byte,address,string,uint64)_v8.teal | 61 ++-- ...app_roundtrip_(bool,uint64,uint32)_v8.teal | 4 + .../roundtrip/app_roundtrip_(byte)_v8.teal | 4 + .../app_roundtrip_(byte,bool,uint64)_v8.teal | 4 + ...4],(bool,bool),uint64,address)[]_7_v8.teal | 55 ++- .../roundtrip/app_roundtrip_(uint16)_v8.teal | 4 + .../app_roundtrip_(uint16,uint8,byte)_v8.teal | 4 + .../roundtrip/app_roundtrip_(uint32)_v8.teal | 4 + ...pp_roundtrip_(uint32,uint16,uint8)_v8.teal | 4 + .../roundtrip/app_roundtrip_(uint64)_v8.teal | 4 + ...p_roundtrip_(uint64,uint32,uint16)_v8.teal | 4 + .../roundtrip/app_roundtrip_(uint8)_v8.teal | 4 + .../app_roundtrip_(uint8,byte,bool)_v8.teal | 4 + .../app_roundtrip_address[]_10_v8.teal | 41 ++- .../roundtrip/app_roundtrip_address_v8.teal | 4 + .../roundtrip/app_roundtrip_bool[1]_v8.teal | 4 + .../app_roundtrip_bool[3][]_11_v8.teal | 41 ++- .../roundtrip/app_roundtrip_bool[42]_v8.teal | 4 + .../roundtrip/app_roundtrip_bool[]_0_v8.teal | 39 +- .../roundtrip/app_roundtrip_bool[]_1_v8.teal | 39 +- .../roundtrip/app_roundtrip_bool[]_42_v8.teal | 39 +- .../teal/roundtrip/app_roundtrip_bool_v8.teal | 2 + .../roundtrip/app_roundtrip_byte[16]_v8.teal | 4 + .../roundtrip/app_roundtrip_byte[]_36_v8.teal | 39 +- .../teal/roundtrip/app_roundtrip_byte_v8.teal | 2 + .../roundtrip/app_roundtrip_string_0_v8.teal | 39 +- .../roundtrip/app_roundtrip_string_13_v8.teal | 39 +- .../roundtrip/app_roundtrip_string_1_v8.teal | 39 +- .../roundtrip/app_roundtrip_uint16_v8.teal | 2 + .../roundtrip/app_roundtrip_uint32_v8.teal | 2 + .../roundtrip/app_roundtrip_uint64[1]_v8.teal | 4 + .../app_roundtrip_uint64[42]_v8.teal | 4 + .../app_roundtrip_uint64[]_0_v8.teal | 39 +- .../app_roundtrip_uint64[]_1_v8.teal | 39 +- .../app_roundtrip_uint64[]_42_v8.teal | 39 +- .../roundtrip/app_roundtrip_uint64_v8.teal | 2 + .../roundtrip/app_roundtrip_uint8_v8.teal | 2 + 45 files changed, 692 insertions(+), 422 deletions(-) diff --git a/pyteal/ast/abi/tuple.py b/pyteal/ast/abi/tuple.py index 2d744eeeb..94851e729 100644 --- a/pyteal/ast/abi/tuple.py +++ b/pyteal/ast/abi/tuple.py @@ -23,7 +23,7 @@ from pyteal.ast.unaryexpr import Len from pyteal.ast.binaryexpr import ExtractUint16 from pyteal.ast.naryexpr import Concat -from pyteal.ast.scratchvar import ScratchVar +from pyteal.ast.abstractvar import alloc_abstract_var from pyteal.ast.abi.type import TypeSpec, BaseType, ComputedValue from pyteal.ast.abi.bool import ( @@ -72,8 +72,8 @@ def _encode_tuple(values: Sequence[BaseType]) -> Expr: tail_offset = Uint16() tail_offset_accumulator = Uint16() - tail_holder = ScratchVar(TealType.bytes) - encoded_tail = ScratchVar(TealType.bytes) + tail_holder = alloc_abstract_var(TealType.bytes) + encoded_tail = alloc_abstract_var(TealType.bytes) firstDynamicTail = True for i, elem in enumerate(values): diff --git a/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal index 459116c6c..961b19574 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal @@ -18,6 +18,8 @@ byte "" int 0 dupn 1 byte "" +dupn 1 +byte "" frame_bury 0 retsub @@ -28,6 +30,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal index 59f3055ff..cb265f8f7 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -38,6 +40,8 @@ byte "" dupn 10 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -167,6 +171,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal index 247d0a8ea..c8313ba4b 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -38,6 +40,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal index 7eb23d671..a2d33a59e 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal @@ -22,13 +22,13 @@ dupn 1 int 0 dupn 97 byte "" -dupn 1 +dupn 3 int 0 dupn 5 byte "" -dupn 1 +dupn 3 int 0 -dupn 9 +dupn 5 frame_dig -1 int 0 getbit @@ -92,6 +92,8 @@ byte "" dupn 4 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 2 @@ -137,6 +139,8 @@ proto 1 1 byte "" int 0 dupn 97 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -593,6 +597,8 @@ proto 1 1 byte "" int 0 dupn 5 +byte "" +dupn 1 frame_dig -1 int 0 extract_uint64 @@ -637,6 +643,8 @@ proto 1 1 byte "" int 0 dupn 11 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -796,6 +804,8 @@ proto 1 1 byte "" int 0 dupn 5 +byte "" +dupn 1 frame_dig -1 int 0 getbit diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal index 585707784..1bd77bc8b 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 5 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -50,6 +52,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal index 765aa30d1..e2a26e2d4 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal @@ -22,9 +22,15 @@ dupn 1 int 0 dupn 97 byte "" +dupn 3 +int 0 +dupn 7 +byte "" dupn 1 int 0 -dupn 10 +dupn 2 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -68,16 +74,16 @@ concat load 2 concat load 3 -store 9 -load 9 -store 8 +frame_bury 124 +frame_dig 124 +frame_bury 123 int 36 -frame_bury 117 -frame_dig 117 +frame_bury 121 +frame_dig 121 itob extract 6 0 concat -load 8 +frame_dig 123 concat frame_bury 0 retsub @@ -89,6 +95,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 @@ -96,13 +104,13 @@ frame_dig 1 callsub tuplecomplement_0 frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 7 +frame_dig 6 len + frame_bury 4 @@ -114,15 +122,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 7 -load 6 -load 7 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 6 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 7 +frame_dig 6 len + frame_bury 4 @@ -135,18 +143,18 @@ itob extract 6 0 concat frame_dig 2 -store 7 -load 6 -load 7 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 6 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 6 +frame_dig 5 concat frame_bury 0 retsub @@ -196,6 +204,8 @@ proto 1 1 byte "" int 0 dupn 97 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -651,7 +661,10 @@ stringreverse_6: proto 1 1 byte "" int 0 -dupn 8 +dupn 7 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -677,8 +690,8 @@ int 2 getbyte frame_bury 1 int 3 -frame_bury 9 -frame_dig 9 +frame_bury 11 +frame_dig 11 itob extract 6 0 byte 0x00 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal index 664c612c0..d22c5bea1 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal @@ -25,16 +25,15 @@ dupn 1 int 0 dupn 97 byte "" -dupn 1 +dupn 3 int 0 -dupn 8 +dupn 7 byte "" dupn 1 int 0 byte "" -int 0 -byte "" dupn 1 +int 0 frame_dig -1 int 0 getbit @@ -90,37 +89,37 @@ concat load 2 concat load 3 -store 14 -load 14 -store 13 +store 10 +load 10 +store 9 int 38 -store 11 -load 11 -load 14 +store 7 +load 7 +load 10 len + -store 12 -load 12 +store 8 +load 8 int 65536 < assert -load 11 +load 7 itob extract 6 0 concat load 4 -store 14 -load 13 -load 14 +store 10 +load 9 +load 10 concat -store 13 -load 12 -store 11 -load 11 +store 9 +load 8 +store 7 +load 7 itob extract 6 0 concat -load 13 +load 9 concat frame_bury 0 retsub @@ -131,7 +130,10 @@ proto 1 1 byte "" dupn 2 int 0 -dupn 4 +dupn 3 +byte "" +dupn 1 +int 0 frame_dig -1 frame_dig -1 int 2 @@ -216,18 +218,18 @@ frame_dig 2 callsub tuplecomplement_0 frame_bury 2 int 2 -frame_bury 7 -frame_dig 7 +frame_bury 9 +frame_dig 9 itob extract 6 0 frame_dig 1 -store 10 -load 10 -store 9 +frame_bury 8 +frame_dig 8 +frame_bury 7 int 4 frame_bury 5 frame_dig 5 -load 10 +frame_dig 8 len + frame_bury 6 @@ -239,18 +241,18 @@ frame_dig 5 itob extract 6 0 frame_dig 2 -store 10 -load 9 -load 10 +frame_bury 8 +frame_dig 7 +frame_dig 8 concat -store 9 +frame_bury 7 frame_dig 6 frame_bury 5 frame_dig 5 itob extract 6 0 concat -load 9 +frame_dig 7 concat concat frame_bury 0 @@ -263,6 +265,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 @@ -270,13 +274,13 @@ frame_dig 1 callsub arraycomplement_1 frame_bury 2 frame_dig -1 -store 8 -load 8 -store 7 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 8 +frame_dig 6 len + frame_bury 4 @@ -288,15 +292,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 8 -load 7 -load 8 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 7 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 8 +frame_dig 6 len + frame_bury 4 @@ -309,18 +313,18 @@ itob extract 6 0 concat frame_dig 2 -store 8 -load 7 -load 8 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 7 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 7 +frame_dig 5 concat frame_bury 0 retsub @@ -370,6 +374,8 @@ proto 1 1 byte "" int 0 dupn 97 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -825,7 +831,10 @@ stringreverse_7: proto 1 1 byte "" int 0 -dupn 8 +dupn 7 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -851,8 +860,8 @@ int 2 getbyte frame_bury 1 int 3 -frame_bury 9 -frame_dig 9 +frame_bury 11 +frame_dig 11 itob extract 6 0 byte 0x00 @@ -889,13 +898,12 @@ dupn 1 int 0 dupn 97 byte "" -dupn 6 +dupn 8 int 0 dupn 3 byte "" dupn 4 int 0 -dupn 2 frame_dig -1 extract 0 32 frame_bury 2 @@ -939,58 +947,58 @@ callsub arraycomplement_15 frame_bury 5 frame_dig 2 frame_dig 3 -store 18 -load 18 -store 17 +store 14 +load 14 +store 13 int 38 -store 15 -load 15 -load 18 +store 11 +load 11 +load 14 len + -store 16 -load 16 +store 12 +load 12 int 65536 < assert -load 15 +load 11 itob extract 6 0 concat frame_dig 4 -store 18 -load 17 -load 18 -concat -store 17 -load 16 -store 15 -load 15 -load 18 +store 14 +load 13 +load 14 +concat +store 13 +load 12 +store 11 +load 11 +load 14 len + -store 16 -load 16 +store 12 +load 12 int 65536 < assert -load 15 +load 11 itob extract 6 0 concat frame_dig 5 -store 18 -load 17 -load 18 -concat -store 17 -load 16 -store 15 -load 15 +store 14 +load 13 +load 14 +concat +store 13 +load 12 +store 11 +load 11 itob extract 6 0 concat -load 17 +load 13 concat frame_bury 0 retsub @@ -1015,6 +1023,8 @@ proto 1 1 byte "" int 0 dupn 97 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -1479,15 +1489,17 @@ dupn 2 byte "" dupn 1 int 0 -dupn 8 +dupn 7 byte "" dupn 1 int 0 -dupn 8 byte "" dupn 1 int 0 -dupn 11 +dupn 7 +byte "" +dupn 1 +int 0 byte "" dupn 1 int 0 @@ -1495,7 +1507,24 @@ dupn 7 byte "" dupn 1 int 0 +dupn 2 +byte "" +dupn 1 +int 0 +byte "" +dupn 1 +int 0 dupn 7 +byte "" +dupn 3 +int 0 +dupn 3 +byte "" +dupn 1 +int 0 +dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 extract_uint32 @@ -1537,12 +1566,12 @@ frame_dig 3 itob extract 4 0 frame_dig 4 -store 22 -load 22 -store 21 +frame_bury 83 +frame_dig 83 +frame_bury 82 int 9 -frame_bury 68 -frame_dig 68 +frame_bury 80 +frame_dig 80 itob extract 6 0 concat @@ -1555,7 +1584,7 @@ int 0 frame_dig 7 setbyte concat -load 21 +frame_dig 82 concat frame_bury 0 retsub @@ -1567,6 +1596,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 frame_dig -1 int 2 @@ -1627,13 +1658,13 @@ frame_dig 2 callsub tuplecomplement_11 frame_bury 2 frame_dig 1 -store 20 -load 20 -store 19 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 4 frame_bury 3 frame_dig 3 -load 20 +frame_dig 6 len + frame_bury 4 @@ -1645,18 +1676,18 @@ frame_dig 3 itob extract 6 0 frame_dig 2 -store 20 -load 19 -load 20 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 19 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 19 +frame_dig 5 concat frame_bury 0 retsub @@ -1666,7 +1697,10 @@ stringreverse_13: proto 1 1 byte "" int 0 -dupn 8 +dupn 7 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -1692,8 +1726,8 @@ int 2 getbyte frame_bury 1 int 3 -frame_bury 9 -frame_dig 9 +frame_bury 11 +frame_dig 11 itob extract 6 0 byte 0x00 @@ -1730,7 +1764,10 @@ arraycomplement_15: proto 1 1 byte "" int 0 -dupn 5 +dupn 4 +byte "" +dupn 1 +int 0 frame_dig -1 int 0 int 16 @@ -1759,8 +1796,8 @@ frame_dig 3 callsub boolcomp_14 frame_bury 3 int 3 -frame_bury 6 -frame_dig 6 +frame_bury 8 +frame_dig 8 itob extract 6 0 byte 0x00 @@ -1796,7 +1833,10 @@ stringreverse_17: proto 1 1 byte "" int 0 -dupn 8 +dupn 7 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -1822,8 +1862,8 @@ int 2 getbyte frame_bury 1 int 3 -frame_bury 9 -frame_dig 9 +frame_bury 11 +frame_dig 11 itob extract 6 0 byte 0x00 @@ -1854,15 +1894,28 @@ dupn 2 byte "" dupn 1 int 0 -dupn 8 +dupn 7 byte "" dupn 1 int 0 -dupn 8 byte "" dupn 1 int 0 -dupn 11 +dupn 7 +byte "" +dupn 1 +int 0 +byte "" +dupn 1 +int 0 +dupn 7 +byte "" +dupn 1 +int 0 +dupn 2 +byte "" +dupn 1 +int 0 frame_dig -1 frame_dig -1 int 2 @@ -1988,62 +2041,62 @@ frame_dig 3 callsub stringreverse_17 frame_bury 3 int 3 -frame_bury 42 -frame_dig 42 +frame_bury 50 +frame_dig 50 itob extract 6 0 frame_dig 1 -store 24 -load 24 -store 23 +frame_bury 49 +frame_dig 49 +frame_bury 48 int 6 -frame_bury 40 -frame_dig 40 -load 24 +frame_bury 46 +frame_dig 46 +frame_dig 49 len + -frame_bury 41 -frame_dig 41 +frame_bury 47 +frame_dig 47 int 65536 < assert -frame_dig 40 +frame_dig 46 itob extract 6 0 frame_dig 2 -store 24 -load 23 -load 24 -concat -store 23 -frame_dig 41 -frame_bury 40 -frame_dig 40 -load 24 +frame_bury 49 +frame_dig 48 +frame_dig 49 +concat +frame_bury 48 +frame_dig 47 +frame_bury 46 +frame_dig 46 +frame_dig 49 len + -frame_bury 41 -frame_dig 41 +frame_bury 47 +frame_dig 47 int 65536 < assert -frame_dig 40 +frame_dig 46 itob extract 6 0 concat frame_dig 3 -store 24 -load 23 -load 24 -concat -store 23 -frame_dig 41 -frame_bury 40 -frame_dig 40 +frame_bury 49 +frame_dig 48 +frame_dig 49 +concat +frame_bury 48 +frame_dig 47 +frame_bury 46 +frame_dig 46 itob extract 6 0 concat -load 23 +frame_dig 48 concat concat frame_bury 0 @@ -2066,6 +2119,8 @@ proto 1 1 byte "" int 0 dupn 7 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -2096,6 +2151,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 getbyte diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal index 87a31aea2..83280db32 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal @@ -22,9 +22,15 @@ dupn 1 int 0 dupn 97 byte "" +dupn 3 +int 0 +dupn 7 +byte "" dupn 1 int 0 -dupn 12 +dupn 4 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -75,19 +81,19 @@ concat load 2 concat load 3 -store 10 -load 10 -store 9 +frame_bury 126 +frame_dig 126 +frame_bury 125 int 44 -frame_bury 119 -frame_dig 119 +frame_bury 123 +frame_dig 123 itob extract 6 0 concat load 4 itob concat -load 9 +frame_dig 125 concat frame_bury 0 retsub @@ -99,6 +105,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 @@ -106,13 +114,13 @@ frame_dig 1 callsub tuplecomplement_0 frame_bury 2 frame_dig -1 -store 8 -load 8 -store 7 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 8 +frame_dig 6 len + frame_bury 4 @@ -124,15 +132,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 8 -load 7 -load 8 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 7 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 8 +frame_dig 6 len + frame_bury 4 @@ -145,18 +153,18 @@ itob extract 6 0 concat frame_dig 2 -store 8 -load 7 -load 8 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 7 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 7 +frame_dig 5 concat frame_bury 0 retsub @@ -206,6 +214,8 @@ proto 1 1 byte "" int 0 dupn 97 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -661,7 +671,10 @@ stringreverse_6: proto 1 1 byte "" int 0 -dupn 8 +dupn 7 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -687,8 +700,8 @@ int 2 getbyte frame_bury 1 int 3 -frame_bury 9 -frame_dig 9 +frame_bury 11 +frame_dig 11 itob extract 6 0 byte 0x00 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal index 3b5d822da..a7d3a0874 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 7 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -59,6 +61,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal index a6f374016..10bed04e6 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 getbyte @@ -38,6 +40,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal index 8c66003b1..35d4ad2b6 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 7 +byte "" +dupn 1 frame_dig -1 int 0 getbyte @@ -60,6 +62,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal index 93f1d6568..71231c6e4 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal @@ -22,13 +22,17 @@ dupn 1 int 0 dupn 13 byte "" +dupn 3 +int 0 +dupn 5 +byte "" dupn 1 int 0 -dupn 7 +dupn 1 byte "" dupn 1 int 0 -dupn 94 +dupn 90 frame_dig -1 extract 0 4 store 0 @@ -71,7 +75,10 @@ proto 1 1 byte "" dupn 7 int 0 -dupn 9 +dupn 8 +byte "" +dupn 1 +int 0 frame_dig -1 int 45 int 0 @@ -157,8 +164,8 @@ frame_dig 7 callsub tuplecomplement_0 frame_bury 7 int 7 -frame_bury 17 -frame_dig 17 +frame_bury 19 +frame_dig 19 itob extract 6 0 frame_dig 1 @@ -185,6 +192,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 @@ -192,13 +201,13 @@ frame_dig 1 callsub arraycomplement_1 frame_bury 2 frame_dig -1 -store 7 -load 7 -store 6 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 7 +frame_dig 6 len + frame_bury 4 @@ -210,15 +219,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 7 -load 6 -load 7 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 6 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 7 +frame_dig 6 len + frame_bury 4 @@ -231,18 +240,18 @@ itob extract 6 0 concat frame_dig 2 -store 7 -load 6 -load 7 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 6 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 6 +frame_dig 5 concat frame_bury 0 retsub @@ -267,6 +276,8 @@ proto 1 1 byte "" int 0 dupn 13 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -331,6 +342,8 @@ proto 1 1 byte "" int 0 dupn 5 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -384,7 +397,9 @@ arraycomplement_8: proto 1 1 byte "" int 0 -dupn 97 +dupn 33 +byte "" +dupn 1 frame_dig -1 int 1 int 0 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal index e22555fe3..c349cd533 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 extract_uint16 @@ -37,6 +39,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal index e8b2a9f45..90f8f675e 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 7 +byte "" +dupn 1 frame_dig -1 int 0 extract_uint16 @@ -61,6 +63,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal index dd6a75d9f..f7a6e1064 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 extract_uint32 @@ -37,6 +39,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal index 002d38421..993e3f595 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 7 +byte "" +dupn 1 frame_dig -1 int 0 extract_uint32 @@ -60,6 +62,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal index da53cd891..de7a29801 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 btoi store 0 @@ -35,6 +37,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal index ae607acd0..057133312 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 7 +byte "" +dupn 1 frame_dig -1 int 0 extract_uint64 @@ -58,6 +60,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal index a6f374016..10bed04e6 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 int 0 getbyte @@ -38,6 +40,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal index f14028d0a..78eab7698 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal @@ -17,6 +17,8 @@ proto 1 1 byte "" int 0 dupn 7 +byte "" +dupn 1 frame_dig -1 int 0 getbyte @@ -62,6 +64,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub tuplecomplement_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal index de35e5e09..38f372107 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal @@ -31,6 +31,8 @@ proto 1 1 byte "" int 0 dupn 33 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -487,7 +489,10 @@ proto 1 1 byte "" dupn 10 int 0 -dupn 12 +dupn 11 +byte "" +dupn 1 +int 0 frame_dig -1 int 32 int 0 @@ -609,8 +614,8 @@ frame_dig 10 callsub arraycomplement_1 frame_bury 10 int 10 -frame_bury 23 -frame_dig 23 +frame_bury 25 +frame_dig 25 itob extract 6 0 frame_dig 1 @@ -643,6 +648,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_2 frame_bury 1 @@ -650,13 +657,13 @@ frame_dig 1 callsub arraycomplement_2 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -668,15 +675,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -689,18 +696,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal index 272928083..820a4e327 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal @@ -31,6 +31,8 @@ proto 1 1 byte "" int 0 dupn 33 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -488,6 +490,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal index c8dd10f81..ad8b78779 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal @@ -28,6 +28,8 @@ proto 1 1 byte "" int 0 dupn 2 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -49,6 +51,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal index cfc8dd12f..33aee47c4 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal @@ -28,6 +28,8 @@ proto 1 1 byte "" int 0 dupn 4 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -68,7 +70,10 @@ proto 1 1 byte "" dupn 11 int 0 -dupn 13 +dupn 12 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -202,8 +207,8 @@ frame_dig 11 callsub arraycomplement_1 frame_bury 11 int 11 -frame_bury 25 -frame_dig 25 +frame_bury 27 +frame_dig 27 itob extract 6 0 frame_dig 1 @@ -238,6 +243,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_2 frame_bury 1 @@ -245,13 +252,13 @@ frame_dig 1 callsub arraycomplement_2 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -263,15 +270,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -284,18 +291,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal index b23cad207..ef566eefb 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal @@ -28,6 +28,8 @@ proto 1 1 byte "" int 0 dupn 43 +byte "" +dupn 1 frame_dig -1 int 0 getbit @@ -459,6 +461,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal index 173e4c5c5..8a24971dd 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal @@ -16,10 +16,13 @@ arraycomplement_0: proto 1 1 byte "" int 0 -dupn 2 +dupn 1 +byte "" +dupn 1 int 0 -frame_bury 3 -frame_dig 3 +int 0 +frame_bury 5 +frame_dig 5 itob extract 6 0 byte "" @@ -34,6 +37,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_0 frame_bury 1 @@ -41,13 +46,13 @@ frame_dig 1 callsub arraycomplement_0 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -59,15 +64,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -80,18 +85,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal index 11c2891c5..f5dd24669 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal @@ -27,7 +27,10 @@ arraycomplement_1: proto 1 1 byte "" int 0 -dupn 3 +dupn 2 +byte "" +dupn 1 +int 0 frame_dig -1 int 0 int 16 @@ -38,8 +41,8 @@ frame_dig 1 callsub boolcomp_0 frame_bury 1 int 1 -frame_bury 4 -frame_dig 4 +frame_bury 6 +frame_dig 6 itob extract 6 0 byte 0x00 @@ -57,6 +60,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 @@ -64,13 +69,13 @@ frame_dig 1 callsub arraycomplement_1 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -82,15 +87,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -103,18 +108,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal index 2e8a85c04..bafacd668 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal @@ -27,7 +27,10 @@ arraycomplement_1: proto 1 1 byte "" int 0 -dupn 44 +dupn 43 +byte "" +dupn 1 +int 0 frame_dig -1 int 0 int 16 @@ -407,8 +410,8 @@ frame_dig 42 callsub boolcomp_0 frame_bury 42 int 42 -frame_bury 45 -frame_dig 45 +frame_bury 47 +frame_dig 47 itob extract 6 0 byte 0x000000000000 @@ -549,6 +552,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 @@ -556,13 +561,13 @@ frame_dig 1 callsub arraycomplement_1 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -574,15 +579,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -595,18 +600,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal index 2a8a7572c..b3b85fd76 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal @@ -32,6 +32,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 callsub boolcomp_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal index 345b09fcc..e61f765e3 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal @@ -31,6 +31,8 @@ proto 1 1 byte "" int 0 dupn 17 +byte "" +dupn 1 frame_dig -1 int 1 int 0 @@ -264,6 +266,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal index 1b999bd87..bc35cdbb4 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal @@ -30,7 +30,10 @@ arraycomplement_1: proto 1 1 byte "" int 0 -dupn 74 +dupn 73 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -428,8 +431,8 @@ frame_dig 36 callsub numericalcomp_0 frame_bury 36 int 36 -frame_bury 75 -frame_dig 75 +frame_bury 77 +frame_dig 77 itob extract 6 0 byte 0x00 @@ -622,6 +625,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 @@ -629,13 +634,13 @@ frame_dig 1 callsub arraycomplement_1 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -647,15 +652,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -668,18 +673,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal index 58daf6eb2..09f91f0a7 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal @@ -33,6 +33,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 callsub numericalcomp_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal index 235d01ed3..3a1effcc4 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal @@ -16,10 +16,13 @@ stringreverse_0: proto 1 1 byte "" int 0 -dupn 2 +dupn 1 +byte "" +dupn 1 int 0 -frame_bury 3 -frame_dig 3 +int 0 +frame_bury 5 +frame_dig 5 itob extract 6 0 byte "" @@ -34,6 +37,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub stringreverse_0 frame_bury 1 @@ -41,13 +46,13 @@ frame_dig 1 callsub stringreverse_0 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -59,15 +64,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -80,18 +85,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal index 63c41ab5a..fdb2b37fb 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal @@ -16,7 +16,10 @@ stringreverse_0: proto 1 1 byte "" int 0 -dupn 28 +dupn 27 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -122,8 +125,8 @@ int 2 getbyte frame_bury 1 int 13 -frame_bury 29 -frame_dig 29 +frame_bury 31 +frame_dig 31 itob extract 6 0 byte 0x00 @@ -201,6 +204,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub stringreverse_0 frame_bury 1 @@ -208,13 +213,13 @@ frame_dig 1 callsub stringreverse_0 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -226,15 +231,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -247,18 +252,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal index 290537714..be88fc157 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal @@ -16,7 +16,10 @@ stringreverse_0: proto 1 1 byte "" int 0 -dupn 4 +dupn 3 +byte "" +dupn 1 +int 0 frame_dig -1 int 1 int 0 @@ -26,8 +29,8 @@ int 2 getbyte frame_bury 1 int 1 -frame_bury 5 -frame_dig 5 +frame_bury 7 +frame_dig 7 itob extract 6 0 byte 0x00 @@ -45,6 +48,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub stringreverse_0 frame_bury 1 @@ -52,13 +57,13 @@ frame_dig 1 callsub stringreverse_0 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -70,15 +75,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -91,18 +96,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal index 4a27045bf..e1ac5d747 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal @@ -33,6 +33,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 callsub numericalcomp_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal index ce183aab6..2ad4ceba3 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal @@ -33,6 +33,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 callsub numericalcomp_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal index 603cd4a6a..7a92839b7 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal @@ -27,6 +27,8 @@ proto 1 1 byte "" int 0 dupn 2 +byte "" +dupn 1 frame_dig -1 int 8 int 0 @@ -48,6 +50,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal index ac132adf3..bee568ac1 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal @@ -27,6 +27,8 @@ proto 1 1 byte "" int 0 dupn 43 +byte "" +dupn 1 frame_dig -1 int 8 int 0 @@ -540,6 +542,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal index 173e4c5c5..8a24971dd 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal @@ -16,10 +16,13 @@ arraycomplement_0: proto 1 1 byte "" int 0 -dupn 2 +dupn 1 +byte "" +dupn 1 int 0 -frame_bury 3 -frame_dig 3 +int 0 +frame_bury 5 +frame_dig 5 itob extract 6 0 byte "" @@ -34,6 +37,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_0 frame_bury 1 @@ -41,13 +46,13 @@ frame_dig 1 callsub arraycomplement_0 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -59,15 +64,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -80,18 +85,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal index 2c095611e..6c45bb4b8 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal @@ -26,7 +26,10 @@ arraycomplement_1: proto 1 1 byte "" int 0 -dupn 4 +dupn 3 +byte "" +dupn 1 +int 0 frame_dig -1 int 8 int 0 @@ -39,8 +42,8 @@ frame_dig 1 callsub numericalcomp_0 frame_bury 1 int 1 -frame_bury 5 -frame_dig 5 +frame_bury 7 +frame_dig 7 itob extract 6 0 frame_dig 1 @@ -56,6 +59,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 @@ -63,13 +68,13 @@ frame_dig 1 callsub arraycomplement_1 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -81,15 +86,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -102,18 +107,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal index c05b53930..3ede8656c 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal @@ -26,7 +26,10 @@ arraycomplement_1: proto 1 1 byte "" int 0 -dupn 86 +dupn 85 +byte "" +dupn 1 +int 0 frame_dig -1 int 8 int 0 @@ -490,8 +493,8 @@ frame_dig 42 callsub numericalcomp_0 frame_bury 42 int 42 -frame_bury 87 -frame_dig 87 +frame_bury 89 +frame_dig 89 itob extract 6 0 frame_dig 1 @@ -630,6 +633,8 @@ byte "" dupn 2 int 0 dupn 1 +byte "" +dupn 1 frame_dig -1 callsub arraycomplement_1 frame_bury 1 @@ -637,13 +642,13 @@ frame_dig 1 callsub arraycomplement_1 frame_bury 2 frame_dig -1 -store 3 -load 3 -store 2 +frame_bury 6 +frame_dig 6 +frame_bury 5 int 6 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -655,15 +660,15 @@ frame_dig 3 itob extract 6 0 frame_dig 1 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 -load 3 +frame_dig 6 len + frame_bury 4 @@ -676,18 +681,18 @@ itob extract 6 0 concat frame_dig 2 -store 3 -load 2 -load 3 +frame_bury 6 +frame_dig 5 +frame_dig 6 concat -store 2 +frame_bury 5 frame_dig 4 frame_bury 3 frame_dig 3 itob extract 6 0 concat -load 2 +frame_dig 5 concat frame_bury 0 retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal index 6a94f89c3..b3d7da786 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal @@ -28,6 +28,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 callsub numericalcomp_0 frame_bury 1 diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal index 58daf6eb2..09f91f0a7 100644 --- a/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal @@ -33,6 +33,8 @@ proto 1 1 byte "" int 0 dupn 3 +byte "" +dupn 1 frame_dig -1 callsub numericalcomp_0 frame_bury 1 From 39344728fb0b2dd499df7325381d662ea62812d5 Mon Sep 17 00:00:00 2001 From: Hang Su <87964331+ahangsu@users.noreply.github.com> Date: Tue, 20 Dec 2022 11:09:46 -0500 Subject: [PATCH 16/22] Update pyteal/ast/abstractvar.py comments Co-authored-by: Michael Diamant --- pyteal/ast/abstractvar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyteal/ast/abstractvar.py b/pyteal/ast/abstractvar.py index 1057774a9..1106e0974 100644 --- a/pyteal/ast/abstractvar.py +++ b/pyteal/ast/abstractvar.py @@ -49,7 +49,7 @@ def alloc_abstract_var(stack_type: TealType) -> AbstractVar: and swap to FrameVar to save the use of scratch slots. Arg: - stack_type: An TealType that represents stack type. + stack_type: TealType that represents stack type. """ from pyteal.ast import ScratchVar From d2a796f02fe6ced1e8c10f1c4fdc297f6f2ff332 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Tue, 20 Dec 2022 11:25:54 -0500 Subject: [PATCH 17/22] warning sign on get_declaration --- pyteal/ast/subroutine.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index e1d8d472c..4b83bd102 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1,10 +1,12 @@ from contextlib import contextmanager +import algosdk.abi as sdk_abi +import warnings + from dataclasses import dataclass from docstring_parser import parse as parse_docstring from inspect import isclass, Parameter, signature, get_annotations from types import MappingProxyType, NoneType from typing import Any, Callable, Final, Optional, TYPE_CHECKING, cast, ClassVar -import algosdk.abi as sdk_abi from pyteal.ast import abi from pyteal.ast.expr import Expr @@ -34,7 +36,10 @@ def __init__(self, subroutine_def: "SubroutineDefinition") -> None: self.type_of: Optional[TealType] = None def get_declaration(self) -> "SubroutineDeclaration": - """MARK AS DEPRECATED, FOR WE ARE NOW GET DECLARATION BY COMPILE OPTIONS""" + warnings.warn( + "`get_declaration` is being deprecated: Please use `get_declaration_by_option` instead.", + DeprecationWarning, + ) return self.get_declaration_by_option(False) def get_declaration_by_option( @@ -306,7 +311,10 @@ def _validate_annotation( ) def get_declaration(self) -> "SubroutineDeclaration": - """MARK AS DEPRECATED, FOR WE ARE NOW GET DECLARATION BY COMPILE OPTIONS""" + warnings.warn( + "`get_declaration` is being deprecated: Please use `get_declaration_by_option` instead.", + DeprecationWarning, + ) return self.declarations.get_declaration() def get_declaration_by_option( From 0f1fe4f384c0a829c3aa9188bd548f54b16e4821 Mon Sep 17 00:00:00 2001 From: Hang Su Date: Wed, 21 Dec 2022 11:31:30 -0500 Subject: [PATCH 18/22] per PR reviews --- pyteal/ast/abi/type.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pyteal/ast/abi/type.py b/pyteal/ast/abi/type.py index 76ff79be5..718b5a010 100644 --- a/pyteal/ast/abi/type.py +++ b/pyteal/ast/abi/type.py @@ -4,7 +4,7 @@ from pyteal.ast.expr import Expr from pyteal.ast.abstractvar import AbstractVar, alloc_abstract_var from pyteal.ast.seq import Seq -from pyteal.errors import TealInputError +from pyteal.errors import TealInputError, TealTypeError from pyteal.types import TealType @@ -215,6 +215,8 @@ def produced_type_spec(self) -> TypeSpec: return self.type_spec def store_into(self, output: BaseType) -> Expr: + from pyteal.ast.subroutine import SubroutineDeclaration + if output.type_spec() != self.produced_type_spec(): raise TealInputError( f"expected type_spec {self.produced_type_spec()} but get {output.type_spec()}" @@ -223,20 +225,23 @@ def store_into(self, output: BaseType) -> Expr: # HANG NOTE! This get_declaration check applies only for pre frame pointer case # the post frame pointer case should not apply # need to somehow expose the context of evaluation + + declaration: SubroutineDeclaration | None = None try: declaration = self.computation.subroutine.get_declaration_by_option(False) + except Exception: + pass + if declaration is not None: if declaration.deferred_expr is None: raise TealInputError( "ABI return subroutine must have deferred_expr to be not-None." ) if declaration.deferred_expr.type_of() != output.type_spec().storage_type(): - raise TealInputError( - f"ABI return subroutine deferred_expr is expected to be typed {output.type_spec().storage_type()}, " - f"but has type {declaration.deferred_expr.type_of()}." + raise TealTypeError( + declaration.deferred_expr.type_of(), + output.type_spec().storage_type(), ) - except Exception: - pass return output._stored_value.store(self.computation) From 6ce319a128a71c6d81a9f6636e70717c7c2dbe43 Mon Sep 17 00:00:00 2001 From: Hang Su <87964331+ahangsu@users.noreply.github.com> Date: Wed, 21 Dec 2022 17:16:22 -0500 Subject: [PATCH 19/22] Update pyteal/ast/subroutine.py Co-authored-by: Michael Diamant --- pyteal/ast/subroutine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index 4b83bd102..68650b76b 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -315,7 +315,7 @@ def get_declaration(self) -> "SubroutineDeclaration": "`get_declaration` is being deprecated: Please use `get_declaration_by_option` instead.", DeprecationWarning, ) - return self.declarations.get_declaration() + return self.declarations.get_declaration_by_option(False) def get_declaration_by_option( self, From 217055f11df0a919c554b3314e88cc4c0bf493fd Mon Sep 17 00:00:00 2001 From: Hang Su Date: Thu, 22 Dec 2022 12:25:51 -0500 Subject: [PATCH 20/22] auughhh rippled cond --- pyteal/ast/subroutine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index 68650b76b..8235d4e49 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -1055,10 +1055,10 @@ def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: deferred_expr = output_carrying_abi._stored_value.load() if self.use_frame_pt: - depth = len(proto.mem_layout.local_stack_types) + local_size = len(proto.mem_layout.local_stack_types) # only when we have 1 return, and with other local variables # we use bury to bury the result to 0 index against frame pointer - if not abi_output_kwargs and 0 < proto.num_returns < depth: + if not abi_output_kwargs and proto.num_returns > 0 and local_size > 0: deferred_expr = FrameBury(Seq(), 0, inferred_type=TealType.none) # Arg usage "A" to be pick up and store in scratch parameters that have been placed on the stack From b3452f938b92d881e4907205e7b9629cabb0c352 Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Fri, 23 Dec 2022 06:17:33 -0800 Subject: [PATCH 21/22] Add codegen tests for subroutine local variables (#622) --- pyteal/ast/subroutine_test.py | 468 +++++++++++++++++++++++++++++++++- 1 file changed, 467 insertions(+), 1 deletion(-) diff --git a/pyteal/ast/subroutine_test.py b/pyteal/ast/subroutine_test.py index b8d3d04f5..f17ba3402 100644 --- a/pyteal/ast/subroutine_test.py +++ b/pyteal/ast/subroutine_test.py @@ -6,7 +6,7 @@ from dataclasses import dataclass import pyteal as pt -from pyteal.ast.frame import Proto +from pyteal.ast.frame import Proto, ProtoStackLayout, FrameBury, FrameDig from pyteal.ast.subroutine import ABIReturnSubroutine, SubroutineEval from pyteal.compiler.compiler import FRAME_POINTERS_VERSION @@ -1344,6 +1344,472 @@ def mySubroutine_arg_10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): assert actual == expected +@dataclass +class LocalVariableTestCase: + input_subroutine: Callable[..., pt.Expr] + input_subroutine_return_type: pt.TealType + input_subroutine_abi_return: bool + expected_body_normal_evaluator: pt.Expr + expected_body_fp_evaluator: pt.Expr + + +def example_subroutine_no_args_no_return(): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + ) + + +def example_subroutine_no_args_uint64_return(): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + local_scratch_var.store(pt.Int(1)), local_abi_type.set(pt.Int(2)), pt.Int(3) + ) + + +def example_subroutine_no_args_bytes_return(): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + pt.Bytes(b"abc"), + ) + + +def example_subroutine_no_args_abi_return(*, output: pt.abi.Uint64): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + output.set(pt.Int(3)), + ) + + +def example_subroutine_expr_args_uint64_return(a: pt.Expr, b: pt.Expr): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + pt.Pop(a == pt.Len(b)), + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + pt.Int(3), + ) + + +def example_subroutine_expr_args_bytes_return(a: pt.Expr, b: pt.Expr): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + pt.Pop(a == pt.Len(b)), + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + pt.Bytes(b"abc"), + ) + + +def example_subroutine_expr_args_abi_return( + a: pt.Expr, b: pt.Expr, *, output: pt.abi.StaticBytes[Literal[5]] +): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + pt.Pop(a == pt.Len(b)), + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + output.set(b"hello"), + ) + + +def example_subroutine_abi_args_uint64_return(a: pt.abi.Uint8, b: pt.abi.String): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + pt.Pop(a.get() == pt.Len(b.get())), + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + pt.Int(3), + ) + + +def example_subroutine_abi_args_bytes_return(a: pt.abi.Uint8, b: pt.abi.String): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + pt.Pop(a.get() == pt.Len(b.get())), + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + pt.Bytes(b"abc"), + ) + + +def example_subroutine_abi_args_abi_return( + a: pt.abi.Uint8, b: pt.abi.String, *, output: pt.abi.StaticBytes[Literal[5]] +): + local_scratch_var = pt.ScratchVar(pt.TealType.uint64) + local_abi_type = pt.abi.Uint64() + return pt.Seq( + pt.Pop(a.get() == pt.Len(b.get())), + local_scratch_var.store(pt.Int(1)), + local_abi_type.set(pt.Int(2)), + output.set(b"hello"), + ) + + +@pytest.mark.parametrize( + "test_case", + [ + LocalVariableTestCase( + input_subroutine=example_subroutine_no_args_no_return, + input_subroutine_return_type=pt.TealType.none, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 0, + 0, + mem_layout=ProtoStackLayout( + arg_stack_types=[], + local_stack_types=[pt.TealType.uint64], + num_return_allocs=0, + ), + ), + pt.ScratchVar().store(pt.Int(1)), + FrameBury(pt.Int(2), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_no_args_uint64_return, + input_subroutine_return_type=pt.TealType.uint64, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + pt.Int(3), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 0, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[], + local_stack_types=[pt.TealType.uint64], + num_return_allocs=0, + ), + ), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 0), + # overwrite 1st local variable with the return value + FrameBury(pt.Int(3), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_no_args_bytes_return, + input_subroutine_return_type=pt.TealType.bytes, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + pt.Bytes(b"abc"), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 0, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[], + local_stack_types=[pt.TealType.uint64], + num_return_allocs=0, + ), + ), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 0), + # overwrite 1st local variable with the return value + FrameBury(pt.Bytes(b"abc"), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_no_args_abi_return, + input_subroutine_return_type=pt.TealType.none, + input_subroutine_abi_return=True, + expected_body_normal_evaluator=pt.Seq( + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + (output_uint64 := pt.abi.Uint64()).set(pt.Int(3)), + output_uint64.get(), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 0, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[], + local_stack_types=[pt.TealType.uint64, pt.TealType.uint64], + num_return_allocs=1, + ), + ), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 1), + FrameBury(pt.Int(3), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_expr_args_uint64_return, + input_subroutine_return_type=pt.TealType.uint64, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + (arg2_expr := pt.ScratchVar()).slot.store(), + (arg1_expr := pt.ScratchVar()).slot.store(), + pt.Pop(arg1_expr.load() == pt.Len(arg2_expr.load())), + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + pt.Int(3), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 2, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[pt.TealType.anytype, pt.TealType.anytype], + local_stack_types=[pt.TealType.uint64], + num_return_allocs=0, + ), + ), + pt.Pop(FrameDig(-2) == pt.Len(FrameDig(-1))), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 0), + # overwrite 1st local variable with the return value + FrameBury(pt.Int(3), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_expr_args_bytes_return, + input_subroutine_return_type=pt.TealType.bytes, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + (arg2_expr := pt.ScratchVar()).slot.store(), + (arg1_expr := pt.ScratchVar()).slot.store(), + pt.Pop(arg1_expr.load() == pt.Len(arg2_expr.load())), + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + pt.Bytes(b"abc"), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 2, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[pt.TealType.anytype, pt.TealType.anytype], + local_stack_types=[pt.TealType.uint64], + num_return_allocs=0, + ), + ), + pt.Pop(FrameDig(-2) == pt.Len(FrameDig(-1))), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 0), + # overwrite 1st local variable with the return value + FrameBury(pt.Bytes(b"abc"), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_expr_args_abi_return, + input_subroutine_return_type=pt.TealType.none, + input_subroutine_abi_return=True, + expected_body_normal_evaluator=pt.Seq( + (arg2_expr := pt.ScratchVar()).slot.store(), + (arg1_expr := pt.ScratchVar()).slot.store(), + pt.Pop(arg1_expr.load() == pt.Len(arg2_expr.load())), + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + ( + output_static_bytes := pt.abi.make(pt.abi.StaticBytes[Literal[5]]) + ).set(b"hello"), + output_static_bytes.get(), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 2, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[pt.TealType.anytype, pt.TealType.anytype], + local_stack_types=[pt.TealType.bytes, pt.TealType.uint64], + num_return_allocs=1, + ), + ), + pt.Pop(FrameDig(-2) == pt.Len(FrameDig(-1))), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 1), + FrameBury(pt.Bytes(b"hello"), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_abi_args_uint64_return, + input_subroutine_return_type=pt.TealType.uint64, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + cast( + pt.ScratchVar, (arg_string := pt.abi.String())._stored_value + ).slot.store(), + cast( + pt.ScratchVar, (arg_uint8 := pt.abi.Uint8())._stored_value + ).slot.store(), + pt.Pop(arg_uint8.get() == pt.Len(arg_string.get())), + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + pt.Int(3), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 2, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[pt.TealType.uint64, pt.TealType.bytes], + local_stack_types=[pt.TealType.uint64], + num_return_allocs=0, + ), + ), + pt.Pop(FrameDig(-2) == pt.Len(pt.Suffix(FrameDig(-1), pt.Int(2)))), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 0), + # overwrite 1st local variable with the return value + FrameBury(pt.Int(3), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_abi_args_bytes_return, + input_subroutine_return_type=pt.TealType.bytes, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + cast( + pt.ScratchVar, (arg_string := pt.abi.String())._stored_value + ).slot.store(), + cast( + pt.ScratchVar, (arg_uint8 := pt.abi.Uint8())._stored_value + ).slot.store(), + pt.Pop(arg_uint8.get() == pt.Len(arg_string.get())), + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + pt.Bytes(b"abc"), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 2, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[pt.TealType.uint64, pt.TealType.bytes], + local_stack_types=[pt.TealType.uint64], + num_return_allocs=0, + ), + ), + pt.Pop(FrameDig(-2) == pt.Len(pt.Suffix(FrameDig(-1), pt.Int(2)))), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 0), + # overwrite 1st local variable with the return value + FrameBury(pt.Bytes(b"abc"), 0), + ), + ), + LocalVariableTestCase( + input_subroutine=example_subroutine_abi_args_abi_return, + input_subroutine_return_type=pt.TealType.none, + input_subroutine_abi_return=True, + expected_body_normal_evaluator=pt.Seq( + cast( + pt.ScratchVar, (arg_string := pt.abi.String())._stored_value + ).slot.store(), + cast( + pt.ScratchVar, (arg_uint8 := pt.abi.Uint8())._stored_value + ).slot.store(), + pt.Pop(arg_uint8.get() == pt.Len(arg_string.get())), + pt.ScratchVar().store(pt.Int(1)), + pt.abi.Uint64().set(pt.Int(2)), + ( + output_static_bytes := pt.abi.make(pt.abi.StaticBytes[Literal[5]]) + ).set(b"hello"), + output_static_bytes.get(), + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 2, + 1, + mem_layout=ProtoStackLayout( + arg_stack_types=[pt.TealType.uint64, pt.TealType.bytes], + local_stack_types=[pt.TealType.bytes, pt.TealType.uint64], + num_return_allocs=1, + ), + ), + pt.Pop(FrameDig(-2) == pt.Len(pt.Suffix(FrameDig(-1), pt.Int(2)))), + pt.ScratchVar(pt.TealType.uint64).store(pt.Int(1)), + FrameBury(pt.Int(2), 1), + FrameBury(pt.Bytes(b"hello"), 0), + ), + ), + ], +) +def test_evaluate_subroutine_local_variables(test_case: LocalVariableTestCase): + definition = pt.SubroutineDefinition( + test_case.input_subroutine, + test_case.input_subroutine_return_type, + has_abi_output=test_case.input_subroutine_abi_return, + ) + + for evaluator, expected_body in ( + (SubroutineEval.normal_evaluator(), test_case.expected_body_normal_evaluator), + (SubroutineEval.fp_evaluator(), test_case.expected_body_fp_evaluator), + ): + declaration = evaluator(definition) + + evaluator_type = "fp" if evaluator.use_frame_pt else "normal" + failure_msg = f"assertion failed for {evaluator_type} evaluator" + + assert isinstance(declaration, pt.SubroutineDeclaration), failure_msg + assert declaration.subroutine is definition, failure_msg + + assert ( + declaration.type_of() is test_case.input_subroutine_return_type + ), failure_msg + assert declaration.has_return() is False, failure_msg + + options_v8.setSubroutine(definition) + + expected, _ = expected_body.__teal__(options_v8) + + actual, actual_end = declaration.__teal__(options_v8) + if declaration.deferred_expr is not None: + # This is a hacky way to include the deferred expression in the resulting IR. It's only + # valid if there are no retsub opcodes anywhere in the subroutine. + + for block in pt.TealBlock.Iterate(actual): + assert all( + op.op != pt.Op.retsub for op in block.ops + ), "retsub present in subroutine, test code to apply deferred expression is no longer valid" + + deferred, _ = declaration.deferred_expr.__teal__(options_v8) + actual_end.setNextBlock(deferred) + + options_v8.setSubroutine(None) + + expected.addIncoming() + expected = pt.TealBlock.NormalizeBlocks(expected) + + actual.addIncoming() + actual = pt.TealBlock.NormalizeBlocks(actual) + + with pt.TealComponent.Context.ignoreExprEquality(), pt.TealComponent.Context.ignoreScratchSlotEquality(): + assert actual == expected, failure_msg + + assert pt.TealBlock.MatchScratchSlotReferences( + pt.TealBlock.GetReferencedScratchSlots(actual), + pt.TealBlock.GetReferencedScratchSlots(expected), + ), failure_msg + + def test_docstring_parsing_with_different_format(): short_desc = "Example of a ABIReturnSubroutine with short description docstring." a_doc = "an abi Uint64 value" From 3c5912e23069a087673e129f95045b9f6099c72d Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Fri, 23 Dec 2022 10:10:08 -0500 Subject: [PATCH 22/22] Add additional testcase for 128+ local vars --- pyteal/ast/subroutine_test.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pyteal/ast/subroutine_test.py b/pyteal/ast/subroutine_test.py index f17ba3402..294dcf73f 100644 --- a/pyteal/ast/subroutine_test.py +++ b/pyteal/ast/subroutine_test.py @@ -1460,6 +1460,11 @@ def example_subroutine_abi_args_abi_return( ) +def example_subroutine_many_local_vars(): + local_abi_vars = [pt.abi.Uint64() for _ in range(200)] + return pt.Seq([v.set(pt.Int(i)) for i, v in enumerate(local_abi_vars)]) + + @pytest.mark.parametrize( "test_case", [ @@ -1750,6 +1755,28 @@ def example_subroutine_abi_args_abi_return( FrameBury(pt.Bytes(b"hello"), 0), ), ), + LocalVariableTestCase( + input_subroutine=example_subroutine_many_local_vars, + input_subroutine_return_type=pt.TealType.none, + input_subroutine_abi_return=False, + expected_body_normal_evaluator=pt.Seq( + [pt.ScratchVar().store(pt.Int(i)) for i in range(200)] + ), + expected_body_fp_evaluator=pt.Seq( + Proto( + 0, + 0, + mem_layout=ProtoStackLayout( + arg_stack_types=[], + local_stack_types=[pt.TealType.uint64] * 128, + num_return_allocs=0, + ), + ), + # 128 is the max number of frame pointer local+return vars + *[FrameBury(pt.Int(i), i) for i in range(128)], + *[pt.ScratchVar().store(pt.Int(i)) for i in range(128, 200)], + ), + ), ], ) def test_evaluate_subroutine_local_variables(test_case: LocalVariableTestCase):