on master help sign in
javascript: display unsupported instruction as comments
a88c208raichoo
jsrts/Runtime-common.js−1
@@ -5,7 +5,6 @@ var i$VM = function() {
5 this.valstack_base = 0;
5 this.valstack_base = 0;
6
6
7 this.ret = null;
7 this.ret = null;
8− this.reg1 = null;
9
8
10 this.callstack = [];
9 this.callstack = [];
11}
10}
src/IRTS/CodegenJavaScript.hs+2−3
@@ -606,7 +606,7 @@ translateDecl info (name, bc) =
606translateReg :: Reg -> JS
606translateReg :: Reg -> JS
607translateReg reg
607translateReg reg
608 | RVal <- reg = jsRET
608 | RVal <- reg = jsRET
609− | Tmp <- reg = JSProj (JSIdent "vm") "reg1"
609+ | Tmp <- reg = JSRaw "//TMPREG"
610 | L n <- reg = jsLOC n
610 | L n <- reg = jsLOC n
611 | T n <- reg = jsTOP n
611 | T n <- reg = jsTOP n
612
612
@@ -1534,6 +1534,5 @@ translateBC info bc
1534 | PROJECT r l a <- bc = jsPROJECT info r l a
1534 | PROJECT r l a <- bc = jsPROJECT info r l a
1535 | OP r o a <- bc = jsOP info r o a
1535 | OP r o a <- bc = jsOP info r o a
1536 | ERROR e <- bc = jsERROR info e
1536 | ERROR e <- bc = jsERROR info e
1537− | otherwise = JSRaw $ show bc
1537+ | otherwise = JSRaw $ "//" ++ show bc
1538− {- PROJECTINTO _ _ _ <- bc = undefined -}
1539
1538