This commit is contained in:
Ilmir Usmanov
2014-07-24 19:50:37 +04:00
parent c2f82eefc0
commit 1f3b5a4c29
14 changed files with 182 additions and 34 deletions
+8 -1
View File
@@ -22,11 +22,18 @@ uint8_t num_size = 0;
const ecma_char_t *
deserialize_string_by_id (uint8_t id)
{
uint8_t size = *bytecode_data, *data = bytecode_data, offset;
uint8_t size, *data, offset;
if (bytecode_data == NULL)
return NULL;
size = *bytecode_data;
if (id >= size)
return NULL;
data = bytecode_data;
data += id + 1;
offset = *data;
+24
View File
@@ -146,3 +146,27 @@ serializer_rewrite_opcode (const uint8_t loc, const void *opcode)
__printf ("// REWRITE\n");
}
void
serializer_print_opcodes (void)
{
int loc = -1, i;
OPCODE* opcode;
int opcode_num;
__printf ("AFTER OPTIMIZER:\n");
do
{
loc++;
opcode = bytecode_opcodes + loc;
opcode_num = (int)((char*)opcode)[0];
__printf ("%03d: %20s ", loc, opcode_names[opcode_num]);
for (i = 1; i < opcode_sizes[opcode_num]; i++)
__printf ("%4d ", ((char*)opcode)[i]);
__printf ("\n");
}
while (opcode->op_idx != __op__idx_exitval);
}