diff options
Diffstat (limited to 'stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux index 3ed3ecb52..89a1b94c1 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux +++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux @@ -97,10 +97,12 @@ (def: (set! index value) (-> (Bytecode Any) (Bytecode Any) (Bytecode Any)) ($_ _.compose - _.dup - index - value - _.aastore)) + ## A + _.dup ## AA + index ## AAI + value ## AAIV + _.aastore ## A + )) (def: #export unit (_.string synthesis.unit)) @@ -125,10 +127,10 @@ ..variant::type (list) (#.Some ($_ _.compose - new-variant - (..set! ..variant-tag $tag) - (..set! ..variant-last? $last?) - (..set! ..variant-value $value) + new-variant ## A[3] + (..set! ..variant-tag $tag) ## A[3] + (..set! ..variant-last? $last?) ## A[3] + (..set! ..variant-value $value) ## A[3] _.areturn))))) (def: #export left-flag _.aconst-null) @@ -184,12 +186,12 @@ (def: decode-frac::method (method.method ..modifier ..decode-frac::name - ..variant::type + ..decode-frac::type (list) (#.Some (..risky ($_ _.compose - ..this + _.aload-0 (_.invokestatic //type.frac "parseDouble" (type.method [(list //type.text) type.double (list)])) (//value.wrap type.double) ))))) @@ -202,7 +204,7 @@ print-type (type.method [(list //type.value) type.void (list)]) print! (function (_ method) (_.invokevirtual ^PrintStream method print-type))] ($_ _.compose - out (_.string "LOG: ") (print! "print") + out (_.string "LUX LOG: ") (print! "print") out _.swap (print! "println")))) (def: exception-constructor (type.method [(list //type.text) type.void (list)])) @@ -290,9 +292,7 @@ not-found _.aconst-null - update-$tag ($_ _.compose - _.isub - _.istore-1) + update-$tag _.isub update-$variant ($_ _.compose $variant ::value (_.checkcast //type.variant) @@ -300,21 +300,24 @@ recur (: (-> Label (Bytecode Any)) (function (_ @loop-start) ($_ _.compose - update-$tag - update-$variant + ## tag, sumT + update-$variant ## tag, sumT + update-$tag ## sub-tag (_.goto @loop-start)))) super-nested-tag ($_ _.compose - $variant ::tag - $tag _.isub) + ## tag, sumT + _.swap ## sumT, tag + _.isub) super-nested ($_ _.compose - super-nested-tag - $variant ::last? - $variant ::value + ## tag, sumT + super-nested-tag ## super-tag + $variant ::last? ## super-tag, super-last + $variant ::value ## super-tag, super-last, super-value ..variant)]] ($_ _.compose - (_.set-label @loop) $tag + (_.set-label @loop) $variant ::tag _.dup2 (_.if-icmpeq @tags-match!) _.dup2 (_.if-icmpgt @maybe-nested) @@ -323,11 +326,11 @@ not-found _.areturn (_.set-label @tags-match!) ## tag, sumT - $last? ## tag, sumT, wants-last? + $last? ## tag, sumT, wants-last? $variant ::last? ## tag, sumT, wants-last?, is-last? (_.if-acmpeq @perfect-match!) ## tag, sumT - (_.set-label @maybe-nested) ## tag, sumT - $variant ::last? ## tag, sumT, last? + (_.set-label @maybe-nested) ## tag, sumT + $variant ::last? ## tag, sumT, last? (_.ifnull @mismatch!) ## tag, sumT (recur @loop) (_.set-label @perfect-match!) ## tag, sumT @@ -335,9 +338,8 @@ $variant ::value _.areturn (_.set-label @maybe-super-nested) ## tag, sumT - $last? (_.ifnull @mismatch!) - ## _.pop2 - super-nested + $last? (_.ifnull @mismatch!) ## tag, sumT + super-nested ## super-variant _.areturn (_.set-label @mismatch!) ## tag, sumT ## _.pop2 |