diff options
author | Eduardo Julian | 2019-05-01 22:50:25 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-05-01 22:50:25 -0400 |
commit | 6e14d46da33a9aa5f5627475ac52b84101b234d6 (patch) | |
tree | d9c2cdf9d2a421302ab3412724519295898cc35e /luxc | |
parent | b52409599fc5e93ad20e1aa61e44b75f5d6d2789 (diff) |
Changed how the pattern-matching stack is built, in the hopes of optimizing peeks.
Diffstat (limited to '')
-rw-r--r-- | luxc/src/lux/compiler/jvm/rt.clj | 14 |
1 files changed, 7 insertions, 7 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) |