Parser improvements.

The number of delete opcodes is reduced to two from six. The
range of numbers which can be included in the byte code is
doubled from (-127,127) to (-256,256).

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2016-06-09 05:52:17 -07:00
parent 3c83af9f23
commit eed84a7dd9
8 changed files with 79 additions and 64 deletions
+8 -7
View File
@@ -1135,16 +1135,17 @@ parse_print_final_cbc (ecma_compiled_code_t *compiled_code_p, /**< compiled code
continue;
}
if (opcode == CBC_PUSH_NUMBER_1)
if (opcode == CBC_PUSH_NUMBER_POS_BYTE)
{
int value = *byte_code_p++;
printf (" number:%d\n", value + 1);
continue;
}
if (value >= CBC_PUSH_NUMBER_1_RANGE_END)
{
value = -(value - CBC_PUSH_NUMBER_1_RANGE_END);
}
printf (" number:%d\n", value);
if (opcode == CBC_PUSH_NUMBER_NEG_BYTE)
{
int value = *byte_code_p++;
printf (" number:%d\n", -(value + 1));
continue;
}
}