From 60daee098f92a44c3b404a9f5801f2e8126ad650 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 5 Apr 2022 18:32:42 -0400 Subject: No longer depending on the ASM library for JVM bytecode generation. --- .../source/luxc/lang/translation/jvm/program.lux | 94 ---------------------- 1 file changed, 94 deletions(-) delete mode 100644 lux-jvm/source/luxc/lang/translation/jvm/program.lux (limited to 'lux-jvm/source/luxc/lang/translation/jvm/program.lux') diff --git a/lux-jvm/source/luxc/lang/translation/jvm/program.lux b/lux-jvm/source/luxc/lang/translation/jvm/program.lux deleted file mode 100644 index 4efe0fd3d..000000000 --- a/lux-jvm/source/luxc/lang/translation/jvm/program.lux +++ /dev/null @@ -1,94 +0,0 @@ -(.using - [library - [lux "*" - [data - [text - ["%" format {"+" format}]]] - [target - [jvm - ["$t" type]]] - [tool - [compiler - [language - [lux - [program {"+" Program}]]] - [meta - [archive - ["[0]" unit]]]]]]] - [luxc - [lang - [host - ["_" jvm - ["$d" def] - ["$i" inst]]] - [translation - ["[0]" jvm - ["[0]" runtime]]]]]) - -(def: ^Object ($t.class "java.lang.Object" (list))) - -(def: .public (program artifact_name context programI) - (-> (-> unit.ID Text) (Program _.Inst _.Definition)) - (let [nilI runtime.noneI - num_inputsI (|>> ($i.ALOAD 0) $i.ARRAYLENGTH) - --I (|>> ($i.int +1) $i.ISUB) - headI (|>> $i.DUP - ($i.ALOAD 0) - $i.SWAP - $i.AALOAD - $i.SWAP - $i.DUP_X2 - $i.POP) - pairI (|>> ($i.int +2) - ($i.ANEWARRAY ..^Object) - $i.DUP_X1 - $i.SWAP - ($i.int +0) - $i.SWAP - $i.AASTORE - $i.DUP_X1 - $i.SWAP - ($i.int +1) - $i.SWAP - $i.AASTORE) - consI (|>> ($i.int +0) - ($i.string "") - $i.DUP2_X1 - $i.POP2 - runtime.variantI) - prepare_input_listI (<| $i.with_label (function (_ @loop)) - $i.with_label (function (_ @end)) - (|>> nilI - num_inputsI - ($i.label @loop) - --I - $i.DUP - ($i.IFLT @end) - headI - pairI - consI - $i.SWAP - ($i.GOTO @loop) - ($i.label @end) - $i.POP)) - feed_inputsI ($i.INVOKEVIRTUAL jvm.$Function runtime.apply_method (runtime.apply_signature 1)) - run_ioI (|>> ($i.CHECKCAST jvm.$Function) - $i.NULL - ($i.INVOKEVIRTUAL jvm.$Function runtime.apply_method (runtime.apply_signature 1))) - main_type ($t.method [(list) - (list ($t.array ($t.class "java.lang.String" (list)))) - $t.void - (list)]) - class (artifact_name context)] - [class - ($d.class {_.#V1_6} - {_.#Public} _.finalC - class - (list) ..^Object - (list) - (|>> ($d.method {_.#Public} _.staticM "main" main_type - (|>> programI - prepare_input_listI - feed_inputsI - run_ioI - $i.RETURN))))])) -- cgit v1.2.3