aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/compiler/jvm/rt.clj14
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/runtime.lux8
2 files changed, 11 insertions, 11 deletions
diff --git a/luxc/src/lux/compiler/jvm/rt.clj b/luxc/src/lux/compiler/jvm/rt.clj
index 4a8b470ac..689da2eb9 100644
--- a/luxc/src/lux/compiler/jvm/rt.clj
+++ b/luxc/src/lux/compiler/jvm/rt.clj
@@ -289,16 +289,16 @@
^:private compile-LuxRT-frac-methods "decode_frac" "java/lang/Double" "parseDouble" "(Ljava/lang/String;)D" &&/wrap-double
)
-(defn popI [writer]
+(defn peekI [writer]
(doto writer
(.visitLdcInsn (int 0))
- (.visitInsn Opcodes/AALOAD)
- (.visitTypeInsn Opcodes/CHECKCAST "[Ljava/lang/Object;")))
+ (.visitInsn Opcodes/AALOAD)))
-(defn peekI [writer]
+(defn popI [writer]
(doto writer
(.visitLdcInsn (int 1))
- (.visitInsn Opcodes/AALOAD)))
+ (.visitInsn Opcodes/AALOAD)
+ (.visitTypeInsn Opcodes/CHECKCAST "[Ljava/lang/Object;")))
(defn ^:private compile-LuxRT-pm-methods [^ClassWriter =class]
(|let [_ (doto (.visitMethod =class (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STATIC) "pm_fail" "()V" nil nil)
@@ -315,11 +315,11 @@
(.visitLdcInsn (int 2))
(.visitTypeInsn Opcodes/ANEWARRAY "java/lang/Object")
(.visitInsn Opcodes/DUP)
- (.visitLdcInsn (int 0))
+ (.visitLdcInsn (int 1))
(.visitVarInsn Opcodes/ALOAD 0)
(.visitInsn Opcodes/AASTORE)
(.visitInsn Opcodes/DUP)
- (.visitLdcInsn (int 1))
+ (.visitLdcInsn (int 0))
(.visitVarInsn Opcodes/ALOAD 1)
(.visitInsn Opcodes/AASTORE)
(.visitInsn Opcodes/ARETURN)
diff --git a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
index 175a60e80..26d98771b 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
@@ -133,12 +133,12 @@
))
(def: #export popI
- (|>> (_.int +0)
+ (|>> (_.int +1)
_.AALOAD
(_.CHECKCAST ($t.descriptor $Stack))))
(def: #export peekI
- (|>> (_.int +1)
+ (|>> (_.int +0)
_.AALOAD))
(def: pm-methods
@@ -172,11 +172,11 @@
(|>> (_.int +2)
(_.ANEWARRAY "java.lang.Object")
_.DUP
- (_.int +0)
+ (_.int +1)
(_.ALOAD 0)
_.AASTORE
_.DUP
- (_.int +1)
+ (_.int +0)
(_.ALOAD 1)
_.AASTORE
_.ARETURN))