From bae39f32cddb816a6123697269c20dbf4a65ac19 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 9 Oct 2020 01:16:47 -0400 Subject: Also using BIPUSH and SIPUSH during JVM generation. --- lux-jvm/source/luxc/lang/translation/jvm/case.lux | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lux-jvm/source/luxc/lang/translation/jvm/case.lux') diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux index d77e747fd..eea77aaf0 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux @@ -30,7 +30,8 @@ ["$" jvm (#+ Label Inst Operation Phase Generator) ["_" inst]]]]] ["." // - ["." runtime]]) + ["." runtime] + ["." structure]]) (def: (pop-altI stack-depth) (-> Nat Inst) @@ -151,14 +152,14 @@ bodyI (_.GOTO @end)))) - (^template [ ] - (^ ( idx)) + (^template [ ] + (^ ( lefts)) (operation@wrap (<| _.with-label (function (_ @success)) _.with-label (function (_ @fail)) (|>> peekI (_.CHECKCAST //.$Variant) - (_.int (.int ( idx))) - + (structure.tagI lefts ) + (structure.flagI ) (_.INVOKESTATIC //.$Runtime "pm_variant" (type.method [(list //.$Variant runtime.$Tag runtime.$Flag) runtime.$Value (list)])) _.DUP (_.IFNULL @fail) @@ -168,8 +169,8 @@ (_.GOTO @else) (_.label @success) pushI)))) - ([synthesis.side/left _.NULL function.identity] - [synthesis.side/right (_.string "") .inc]) + ([synthesis.side/left false] + [synthesis.side/right true]) ## Extra optimization (^template [ ] -- cgit v1.2.3