Verified Commit 78d1376e authored by Camil Staps's avatar Camil Staps 🙂

Use new instructions for optimized instance calls in Data._Array hacks

parent cdf00ee3
Pipeline #26140 passed with stage
in 3 minutes and 4 seconds
......@@ -2,5 +2,5 @@ definition module Data._Array
from StdArray import class Array
unsafeCreateArray :: .Int -> u:(a v:b) | Array a b, [u<=v]
unsafeUselect :: u:(a v:b) Int -> *(v:b,u:(a v:b)) | Array a b, [u<=v]
unsafeCreateArray :: !.Int -> u:(a v:b) | Array a b, [u<=v]
unsafeUselect :: !u:(a v:b) !Int -> *(v:b,!u:(a v:b)) | Array a b, [u<=v]
......@@ -2,16 +2,16 @@ implementation module Data._Array
import StdEnv
unsafeCreateArray :: .Int -> u:(a v:b) | Array a b, [u<=v]
unsafeCreateArray :: !.Int -> u:(a v:b) | Array a b, [u<=v]
unsafeCreateArray size = code {
updatepop_a 0 7
jmp_ap 1
}
updatepop_a 0 7
.d 1 1 i
jmp_i 1
}
unsafeUselect :: u:(a v:b) Int -> *(v:b,u:(a v:b)) | Array a b, [u<=v]
unsafeUselect :: !u:(a v:b) !Int -> *(v:b,!u:(a v:b)) | Array a b, [u<=v]
unsafeUselect arr index = code {
update_a 3 7
pop_a 7
jsr_ap 2
repl_args 2 2
}
updatepop_a 6 7
.d 2 1 i
jmp_i 2
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment