From af7f85c4eb724f2888ecce9c8b52d6d3bb1cd807 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 27 Apr 2019 23:41:47 -0400 Subject: Moved JVM type machinery to stdlib. --- new-luxc/source/luxc/lang/translation/jvm/case.lux | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm/case.lux') diff --git a/new-luxc/source/luxc/lang/translation/jvm/case.lux b/new-luxc/source/luxc/lang/translation/jvm/case.lux index 43d11c71e..3c50f6124 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/case.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/case.lux @@ -8,15 +8,17 @@ [data [text format]] + [target + [jvm + ["$t" type]]] [tool [compiler ["." synthesis (#+ Path Synthesis)] - ["." phase ("operation/." monad)]]]] + ["." phase ("operation@." monad)]]]] [luxc [lang [host ["$" jvm (#+ Label Inst Operation Phase) - ["$t" type] ["_" inst]]]]] ["." // (#+ $Object) ["." runtime]]) @@ -63,34 +65,34 @@ (-> Phase Nat Label Label Path (Operation Inst)) (.case path #synthesis.Pop - (operation/wrap popI) + (operation@wrap popI) (#synthesis.Bind register) - (operation/wrap (|>> peekI + (operation@wrap (|>> peekI (_.ASTORE register))) (^ (synthesis.path/bit value)) - (operation/wrap (.let [jumpI (.if value _.IFEQ _.IFNE)] + (operation@wrap (.let [jumpI (.if value _.IFEQ _.IFNE)] (|>> peekI - (_.unwrap #$.Boolean) + (_.unwrap #$t.Boolean) (jumpI @else)))) (^ (synthesis.path/i64 value)) - (operation/wrap (|>> peekI - (_.unwrap #$.Long) + (operation@wrap (|>> peekI + (_.unwrap #$t.Long) (_.long (.int value)) _.LCMP (_.IFNE @else))) (^ (synthesis.path/f64 value)) - (operation/wrap (|>> peekI - (_.unwrap #$.Double) + (operation@wrap (|>> peekI + (_.unwrap #$t.Double) (_.double value) _.DCMPL (_.IFNE @else))) (^ (synthesis.path/text value)) - (operation/wrap (|>> peekI + (operation@wrap (|>> peekI (_.string value) (_.INVOKEVIRTUAL "java.lang.Object" "equals" @@ -110,7 +112,7 @@ (^template [ ] (^ ( idx)) - (operation/wrap (<| _.with-label (function (_ @success)) + (operation@wrap (<| _.with-label (function (_ @success)) _.with-label (function (_ @fail)) (|>> peekI (_.CHECKCAST ($t.descriptor runtime.$Variant)) @@ -133,7 +135,7 @@ [synthesis.side/right (_.string "") .inc]) (^ (synthesis.member/left lefts)) - (operation/wrap (.let [accessI (.case lefts + (operation@wrap (.let [accessI (.case lefts 0 _.AALOAD @@ -151,7 +153,7 @@ pushI))) (^ (synthesis.member/right lefts)) - (operation/wrap (|>> peekI + (operation@wrap (|>> peekI (_.CHECKCAST ($t.descriptor runtime.$Tuple)) (_.int (.int lefts)) (_.INVOKESTATIC //.runtime-class @@ -205,7 +207,7 @@ (wrap (<| _.with-label (function (_ @else)) _.with-label (function (_ @end)) (|>> testI - (_.unwrap #$.Boolean) + (_.unwrap #$t.Boolean) (_.IFEQ @else) thenI (_.GOTO @end) -- cgit v1.2.3