Skip to content

Commit

Permalink
feat: Allow slicing Bytes with UInt64. Code generation has also been …
Browse files Browse the repository at this point in the history
…improved for slicing, and a potential double-evaluation has been fixed.
  • Loading branch information
achidlow committed Mar 6, 2024
1 parent f83a397 commit 0f9dd79
Show file tree
Hide file tree
Showing 123 changed files with 10,277 additions and 9,652 deletions.
12 changes: 6 additions & 6 deletions examples/sizes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ arc4_types/Arc4BoolEval 569 20 20
arc4_types/Arc4BoolType 329 57 57
arc4_types/Arc4DynamicStringArray 230 112 112
arc4_types/Arc4Mutation 2803 1452 1451
arc4_types/Arc4NumericTypes 364 8 8
arc4_types/Arc4NumericTypes 345 8 8
arc4_types/Arc4RefTypes 47 43 43
arc4_types/Arc4StringTypes 336 8 8
arc4_types/Arc4StringTypes 328 8 8
arc4_types/Arc4StructsFromAnotherModule 67 12 12
arc4_types/Arc4StructsType 283 225 225
arc4_types/Arc4TuplesType 799 146 146
Expand All @@ -36,7 +36,7 @@ everything 467 448 448
global_state/AppState 305 301 301
hello_world/HelloWorld 23 22 22
hello_world_arc4/HelloWorld 110 89 89
inner_transactions 1862 1222 1222
inner_transactions 1849 1198 1198
inner_transactions/Greeter 325 302 302
inner_transactions/itxn_loop 203 260 260
intrinsics/ImmediateVariants 164 162 162
Expand All @@ -47,7 +47,7 @@ local_state/LocalStateWithOffsets 318 309 297
log 172 168 168
match 490 455 455
nested_loops/Nested 243 201 201
reversed_iteration 768 562 562
reversed_iteration 765 549 549
scratch_slots 70 67 67
scratch_slots/2 70 67 67
scratch_slots/MyOther 8 8 8
Expand All @@ -58,13 +58,13 @@ ssa2 95 87 87
state_proxies/StateProxy 87 83 83
string_ops 157 152 152
stubs/BigUInt 172 112 112
stubs/Bytes 660 8 8
stubs/Bytes 928 164 164
stubs/Uint64 371 8 8
too_many_permutations 108 107 107
transaction/Transaction 914 864 864
tuple_support/TupleSupport 442 294 294
unary/Unary 134 96 96
undefined_phi_args/Baddie 350 350 315
unssa/UnSSA 446 375 375
voting/VotingRoundApp 1609 1509 1509
voting/VotingRoundApp 1606 1505 1505
with_reentrancy/WithReentrancy 264 242 242
108 changes: 48 additions & 60 deletions examples/voting/out/VotingRoundApp.approval.mir

Large diffs are not rendered by default.

22 changes: 8 additions & 14 deletions examples/voting/out/VotingRoundApp.approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -942,22 +942,17 @@ get_preconditions:
// is_allowed_to_vote=arc4.UInt64(self.allowed_to_vote(signature.bytes[2:])),
frame_dig -1
len
dup
int 2
>
bz get_preconditions_ternary_false@2
dig 1
<
swap
dup
int 2
b get_preconditions_ternary_merge@3

get_preconditions_ternary_false@2:
frame_dig 1

get_preconditions_ternary_merge@3:
// voting/voting.py:161
// is_allowed_to_vote=arc4.UInt64(self.allowed_to_vote(signature.bytes[2:])),
uncover 3
select
frame_dig -1
swap
frame_dig 1
uncover 2
substring3
callsub allowed_to_vote
itob
Expand All @@ -976,14 +971,13 @@ get_preconditions_ternary_merge@3:
// has_already_voted=arc4.UInt64(self.already_voted()),
// current_time=arc4.UInt64(Global.latest_timestamp),
// )
frame_dig 0
uncover 3
uncover 3
concat
uncover 2
concat
swap
concat
frame_bury 0
retsub


Expand Down
2 changes: 1 addition & 1 deletion examples/voting/out/VotingRoundApp.arc32.json

Large diffs are not rendered by default.

31 changes: 12 additions & 19 deletions examples/voting/out/VotingRoundApp.destructured.ir

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 18 additions & 24 deletions examples/voting/out/VotingRoundApp.ssa.ir

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 12 additions & 19 deletions examples/voting/out/VotingRoundApp.ssa.opt_pass_1.ir

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 12 additions & 19 deletions examples/voting/out/VotingRoundApp.ssa.opt_pass_2.ir

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/voting/out/voting.awst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions examples/voting/out_O2/VotingRoundApp.approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -539,35 +539,31 @@ get_preconditions:
itob
frame_dig -1
len
dup
int 2
>
bz get_preconditions_ternary_false@2
dig 1
<
swap
dup
int 2
b get_preconditions_ternary_merge@3

get_preconditions_ternary_false@2:
frame_dig 1

get_preconditions_ternary_merge@3:
uncover 3
select
frame_dig -1
swap
frame_dig 1
uncover 2
substring3
callsub allowed_to_vote
itob
callsub already_voted
itob
global LatestTimestamp
itob
frame_dig 0
uncover 3
uncover 3
concat
uncover 2
concat
swap
concat
frame_bury 0
retsub


Expand Down
Loading

0 comments on commit 0f9dd79

Please sign in to comment.