Commit b55c6c55 authored by Masamitsu MURASE's avatar Masamitsu MURASE

Make OP_ASGN faster.

I think that `*=` and `/=` can be compiled to `OP_MUL` and `OP_DIV`.
parent bbd50cca
......@@ -1488,6 +1488,12 @@ codegen(codegen_scope *s, node *tree, int val)
else if (len == 1 && name[0] == '-') {
genop_peep(s, MKOP_ABC(OP_SUB, cursp(), idx, 1), val);
}
else if (len == 1 && name[0] == '*') {
genop(s, MKOP_ABC(OP_MUL, cursp(), idx, 1));
}
else if (len == 1 && name[0] == '/') {
genop(s, MKOP_ABC(OP_DIV, cursp(), idx, 1));
}
else if (len == 1 && name[0] == '<') {
genop(s, MKOP_ABC(OP_LT, cursp(), idx, 1));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment