optimize frames; remove trampoline
This commit is contained in:
9
mcode.cm
9
mcode.cm
@@ -4,7 +4,7 @@ var mcode = function(ast) {
|
||||
// Translation tables
|
||||
var binop_map = {
|
||||
"+": "add", "-": "subtract", "*": "multiply", "/": "divide",
|
||||
"%": "modulo", "&": "bitand", "|": "bitor", "^": "bitxor",
|
||||
"%": "remainder", "&": "bitand", "|": "bitor", "^": "bitxor",
|
||||
"<<": "shl", ">>": "shr", ">>>": "ushr",
|
||||
"==": "eq", "===": "eq", "!=": "ne", "!==": "ne",
|
||||
"<": "lt", "<=": "le", ">": "gt", ">=": "ge",
|
||||
@@ -24,13 +24,13 @@ var mcode = function(ast) {
|
||||
|
||||
var binop_sym = {
|
||||
add: "+", subtract: "-", multiply: "*", divide: "/",
|
||||
modulo: "%", pow: "**",
|
||||
remainder: "%", pow: "**",
|
||||
lt: "<", le: "<=", gt: ">", ge: ">="
|
||||
}
|
||||
|
||||
var compound_map = {
|
||||
"+=": "add", "-=": "subtract", "*=": "multiply", "/=": "divide",
|
||||
"%=": "modulo", "&=": "bitand", "|=": "bitor", "^=": "bitxor",
|
||||
"%=": "remainder", "&=": "bitand", "|=": "bitor", "^=": "bitxor",
|
||||
"<<=": "shl", ">>=": "shr", ">>>=": "ushr"
|
||||
}
|
||||
|
||||
@@ -673,7 +673,8 @@ var mcode = function(ast) {
|
||||
if (rel != null) {
|
||||
emit_relational(rel[0], rel[1], rel[2])
|
||||
} else if (op_str == "subtract" || op_str == "multiply" ||
|
||||
op_str == "divide" || op_str == "modulo" || op_str == "pow") {
|
||||
op_str == "divide" || op_str == "modulo" || op_str == "remainder" ||
|
||||
op_str == "pow") {
|
||||
emit_numeric_binop(op_str)
|
||||
} else {
|
||||
// Passthrough for bitwise, in, etc.
|
||||
|
||||
Reference in New Issue
Block a user