aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-08-15 19:06:17 -0400
committerEduardo Julian2018-08-15 19:06:17 -0400
commit196c1843d1a4a32ab92b9ba5c549933a5ce30c17 (patch)
treebd5e6d432601bec6409cb5edbc4e19865bf4fc24 /new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
parent453ab9f67873bb022acadf4c0f5c1e635c7d5794 (diff)
Fixes for pattern-matching/case synthesis & translation.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux59
1 files changed, 2 insertions, 57 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
index c92ab1026..20c31bd5d 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
@@ -106,59 +106,8 @@
Def
(let [store-tagI (|>> _.DUP (_.int +0) (_.ILOAD 0) (_.wrap #$.Int) _.AASTORE)
store-flagI (|>> _.DUP (_.int +1) (_.ALOAD 1) _.AASTORE)
- store-valueI (|>> _.DUP (_.int +2) (_.ALOAD 2) _.AASTORE)
- force-textMT ($t.method (list $Object) (#.Some $String) (list))]
- (|>> ($d.method #$.Public $.staticM "force_text" force-textMT
- (<| _.with-label (function (_ @is-null))
- _.with-label (function (_ @normal-object))
- _.with-label (function (_ @array-loop))
- _.with-label (function (_ @within-bounds))
- _.with-label (function (_ @is-first))
- _.with-label (function (_ @elem-end))
- _.with-label (function (_ @fold-end))
- (let [on-normal-objectI (|>> (_.ALOAD 0)
- (_.INVOKEVIRTUAL "java.lang.Object" "toString" ($t.method (list) (#.Some $String) (list)) #0))
- on-null-objectI (_.string "NULL")
- arrayI (|>> (_.ALOAD 0)
- (_.CHECKCAST ($t.descriptor $Object-Array)))
- recurseI (_.INVOKESTATIC //.runtime-class "force_text" force-textMT #0)
- force-elemI (|>> _.DUP arrayI _.SWAP _.AALOAD recurseI)
- swap2 (|>> _.DUP2_X2 ## X,Y => Y,X,Y
- _.POP2 ## Y,X,Y => Y,X
- )
- add-spacingI (|>> (_.string ", ") _.SWAP string-concatI)
- merge-with-totalI (|>> _.DUP_X2 _.POP ## TSIP => TPSI
- swap2 ## TPSI => SITP
- string-concatI ## SITP => SIT
- _.DUP_X2 _.POP ## SIT => TSI
- )
- foldI (|>> _.DUP ## TSI => TSII
- (_.IFEQ @is-first) ## TSI
- force-elemI add-spacingI merge-with-totalI (_.GOTO @elem-end)
- (_.label @is-first) ## TSI
- force-elemI merge-with-totalI
- (_.label @elem-end) ## TSI
- )
- inc-idxI (|>> (_.int +1) _.IADD)
- on-array-objectI (|>> (_.string "[") ## T
- arrayI _.ARRAYLENGTH ## TS
- (_.int +0) ## TSI
- (_.label @array-loop) ## TSI
- _.DUP2
- (_.IF_ICMPGT @within-bounds) ## TSI
- _.POP2 (_.string "]") string-concatI (_.GOTO @fold-end)
- (_.label @within-bounds)
- foldI inc-idxI (_.GOTO @array-loop)
- (_.label @fold-end))])
- (|>> (_.ALOAD 0)
- (_.IFNULL @is-null)
- (_.ALOAD 0)
- (_.INSTANCEOF ($t.descriptor $Object-Array))
- (_.IFEQ @normal-object)
- on-array-objectI _.ARETURN
- (_.label @normal-object) on-normal-objectI _.ARETURN
- (_.label @is-null) on-null-objectI _.ARETURN)))
- ($d.method #$.Public $.staticM "variant_make"
+ store-valueI (|>> _.DUP (_.int +2) (_.ALOAD 2) _.AASTORE)]
+ (|>> ($d.method #$.Public $.staticM "variant_make"
($t.method (list $t.int $Object $Object)
(#.Some $Variant)
(list))
@@ -169,10 +118,6 @@
store-valueI
_.ARETURN)))))
-(def: #export force-textI
- Inst
- (_.INVOKESTATIC //.runtime-class "force_text" ($t.method (list $Object) (#.Some $String) (list)) #0))
-
(def: frac-shiftI Inst (_.double (math.pow +32.0 +2.0)))
(def: frac-methods