From 97ab1f076ac08992d6b64cd77bc0bef97b3fc50a Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 31 Jul 2018 22:23:07 -0400 Subject: Now implementing array functionality in stdlib instead of the compiler. --- .../lang/translation/jvm/procedure/common.jvm.lux | 56 ---------------------- 1 file changed, 56 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux index 49b1971f1..2c470c44c 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux @@ -113,15 +113,6 @@ (def: lux-intI $.Inst (|>> _.I2L (_.wrap #$.Long))) (def: jvm-intI $.Inst (|>> (_.unwrap #$.Long) _.L2I)) -(def: (array-writeI arrayI idxI elemI) - (-> $.Inst $.Inst $.Inst - $.Inst) - (|>> arrayI (_.CHECKCAST ($t.descriptor $Object-Array)) - _.DUP - idxI jvm-intI - elemI - _.AASTORE)) - (def: (predicateI tester) (-> (-> $.Label $.Inst) $.Inst) @@ -209,41 +200,6 @@ [bit//logical-right-shift _.LUSHR] ) -## [[Arrays]] -(def: (array//new lengthI) - Unary - (|>> lengthI jvm-intI (_.ANEWARRAY ($t.binary-name "java.lang.Object")))) - -(def: (array//get [arrayI idxI]) - Binary - (<| _.with-label (function (_ @is-null)) - _.with-label (function (_ @end)) - (|>> arrayI (_.CHECKCAST ($t.descriptor $Object-Array)) - idxI jvm-intI - _.AALOAD - _.DUP - (_.IFNULL @is-null) - runtimeT.someI - (_.GOTO @end) - (_.label @is-null) - _.POP - runtimeT.noneI - (_.label @end)))) - -(def: (array//put [arrayI idxI elemI]) - Trinary - (array-writeI arrayI idxI elemI)) - -(def: (array//remove [arrayI idxI]) - Binary - (array-writeI arrayI idxI _.NULL)) - -(def: (array//size arrayI) - Unary - (|>> arrayI (_.CHECKCAST ($t.descriptor $Object-Array)) - _.ARRAYLENGTH - lux-intI)) - ## [[Numbers]] (def: nat-method $.Method @@ -501,17 +457,6 @@ (install "clip" (trinary text//clip)) ))) -(def: array-procs - Bundle - (<| (prefix "array") - (|> (dict.new text.Hash) - (install "new" (unary array//new)) - (install "get" (binary array//get)) - (install "put" (trinary array//put)) - (install "remove" (binary array//remove)) - (install "size" (unary array//size)) - ))) - (def: io-procs Bundle (<| (prefix "io") @@ -537,7 +482,6 @@ (dict.merge int-procs) (dict.merge frac-procs) (dict.merge text-procs) - (dict.merge array-procs) (dict.merge io-procs) (dict.merge box-procs) ))) -- cgit v1.2.3