aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2019-12-21 06:13:47 -0400
committerEduardo Julian2019-12-21 06:13:47 -0400
commit2690a6ba8ff7998f8dbb778b93fa22976eadb4ac (patch)
tree3e42ebf5b121c85feaacc23f9beac0739086289a /stdlib/source/test
parentb7cff25b71f024a4da86603e5a0b432fae1601e6 (diff)
Properly track how the stack changes in the presence of discontinuities.
Diffstat (limited to 'stdlib/source/test')
-rw-r--r--stdlib/source/test/lux/target/jvm.lux69
1 files changed, 36 insertions, 33 deletions
diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux
index 7b2283cb8..ab6cd5867 100644
--- a/stdlib/source/test/lux/target/jvm.lux
+++ b/stdlib/source/test/lux/target/jvm.lux
@@ -1314,14 +1314,16 @@
(function (_ goto)
(<| (..bytecode (|>> (:coerce java/lang/Long) ("jvm leq" expected)))
(do /.monad
- [^value /.new-label
- ^end /.new-label
- _ (goto ^value)
+ [@skipped /.new-label
+ @value /.new-label
+ @end /.new-label
+ _ (goto @value)
+ _ (/.set-label @skipped)
_ (..$Long::literal dummy)
- _ (goto ^end)
- _ (/.set-label ^value)
+ _ (goto @end)
+ _ (/.set-label @value)
_ (..$Long::literal expected)
- _ (/.set-label ^end)]
+ _ (/.set-label @end)]
..$Long::wrap))))]]
($_ _.and
(_.lift "GOTO" (jump /.goto))
@@ -1339,17 +1341,17 @@
afterwards (:: @ map (n.% 10) random.nat)])
(..bytecode (|>> (:coerce java/lang/Long) ("jvm leq" expected)))
(do /.monad
- [^right /.new-label
- ^wrong /.new-label
- ^return /.new-label
+ [@right /.new-label
+ @wrong /.new-label
+ @return /.new-label
_ (/.bipush (|> minimum /signed.value .nat /unsigned.u1 try.assume))
- _ (/.tableswitch minimum ^wrong [^right (list.repeat afterwards ^wrong)])
- _ (/.set-label ^wrong)
+ _ (/.tableswitch minimum @wrong [@right (list.repeat afterwards @wrong)])
+ _ (/.set-label @wrong)
_ (..$Long::literal dummy)
- _ (/.goto ^return)
- _ (/.set-label ^right)
+ _ (/.goto @return)
+ _ (/.set-label @right)
_ (..$Long::literal expected)
- _ (/.set-label ^return)]
+ _ (/.set-label @return)]
..$Long::wrap))
(<| (_.lift "LOOKUPSWITCH")
(do random.monad
@@ -1365,20 +1367,20 @@
dummy ..$Long::random])
(..bytecode (|>> (:coerce java/lang/Long) ("jvm leq" expected)))
(do /.monad
- [^right /.new-label
- ^wrong /.new-label
- ^return /.new-label
+ [@right /.new-label
+ @wrong /.new-label
+ @return /.new-label
_ (..$Integer::literal (host.long-to-int choice))
- _ (/.lookupswitch ^wrong (list@map (function (_ option)
+ _ (/.lookupswitch @wrong (list@map (function (_ option)
[(|> option /signed.s4 try.assume)
- (if (i.= choice option) ^right ^wrong)])
+ (if (i.= choice option) @right @wrong)])
options))
- _ (/.set-label ^wrong)
+ _ (/.set-label @wrong)
_ (..$Long::literal dummy)
- _ (/.goto ^return)
- _ (/.set-label ^right)
+ _ (/.goto @return)
+ _ (/.set-label @right)
_ (..$Long::literal expected)
- _ (/.set-label ^return)]
+ _ (/.set-label @return)]
..$Long::wrap))
))
@@ -1392,23 +1394,24 @@
(..bytecode (|>> (:coerce java/lang/Long) ("jvm leq" expected)))
(do /.monad
[#let [$Exception (/type.class "java.lang.Exception" (list))]
- ^start /.new-label
- ^end /.new-label
- ^handler /.new-label
- ^return /.new-label
- _ (/.try ^start ^end ^handler $Exception)
- _ (/.set-label ^start)
+ @skipped /.new-label
+ @try /.new-label
+ @handler /.new-label
+ @return /.new-label
+ _ (/.try @try @handler @handler $Exception)
+ _ (/.set-label @try)
_ (/.new $Exception)
_ /.dup
_ (..$String::literal exception)
_ (/.invokespecial $Exception "<init>" (/type.method [(list ..$String) /type.void (list)]))
_ /.athrow
+ _ (/.set-label @skipped)
_ (..$Long::literal dummy)
- _ (/.goto ^return)
- _ (/.set-label ^end)
- _ (/.set-label ^handler)
+ _ (/.goto @return)
+ _ (/.set-label @handler)
+ _ /.pop
_ (..$Long::literal expected)
- _ (/.set-label ^return)]
+ _ (/.set-label @return)]
..$Long::wrap))))
(def: code