--- a/progs/fun/fun.sc Tue Dec 01 05:41:12 2020 +0000
+++ b/progs/fun/fun.sc Wed Dec 02 16:03:57 2020 +0000
@@ -50,13 +50,12 @@
.super java/lang/Object
.method public static write(I)V
- .limit locals 5
- .limit stack 5
- iload 0
- getstatic java/lang/System/out Ljava/io/PrintStream;
- swap
- invokevirtual java/io/PrintStream/println(I)V
- return
+ .limit locals 1
+ .limit stack 2
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload 0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
.end method
"""
@@ -142,7 +141,7 @@
val env = args.zipWithIndex.toMap
val is = "I" * args.length
m".method public static $name($is)I" ++
- m".limit locals ${args.length.toString}" ++
+ m".limit locals ${args.length}" ++
m".limit stack ${1 + max_stack_exp(a)}" ++
l"${name}_Start" ++
compile_exp(a, env) ++