@@ -437,13 +437,16 @@ trait StagedWasmEvaluator extends SAIOps {
437
437
}
438
438
439
439
trait StagedWasmScalaGen extends ScalaGenBase with SAICodeGenBase {
440
+ override def mayInline (n : Node ): Boolean = n match {
441
+ case Node (s, " stack-pop" , _, _) => false
442
+ case _ => super .mayInline(n)
443
+ }
444
+
440
445
override def traverse (n : Node ): Unit = n match {
441
446
case Node (_, " stack-push" , List (value), _) =>
442
447
emit(" Stack.push(" ); shallow(value); emit(" )\n " )
443
448
case Node (_, " stack-drop" , List (n), _) =>
444
449
emit(" Stack.drop(" ); shallow(n); emit(" )\n " )
445
- case Node (_, " stack-pop" , _, _) =>
446
- emit(" Stack.pop()\n " )
447
450
case Node (_, " stack-reset" , List (n), _) =>
448
451
emit(" Stack.reset(" ); shallow(n); emit(" )\n " )
449
452
case Node (_, " stack-init" , _, _) =>
@@ -469,6 +472,8 @@ trait StagedWasmScalaGen extends ScalaGenBase with SAICodeGenBase {
469
472
emit(" Frames.get(" ); shallow(i); emit(" )" )
470
473
case Node (_, " frame-pop" , _, _) =>
471
474
emit(" Frames.popFrame()" )
475
+ case Node (_, " stack-pop" , _, _) =>
476
+ emit(" Stack.pop()" )
472
477
case Node (_, " stack-peek" , _, _) =>
473
478
emit(" Stack.peek" )
474
479
case Node (_, " stack-take" , List (n), _) =>
@@ -666,7 +671,6 @@ object Main {
666
671
}
667
672
668
673
669
-
670
674
object WasmToScalaCompiler {
671
675
def apply (moduleInst : ModuleInstance , main : Option [String ], printRes : Boolean = false ): String = {
672
676
println(s " Now compiling wasm module with entry function $main" )
0 commit comments