Split parser into parser itself, opcodes dumper and syntax errors checker.
Add internal hash map of literal indexes: In this hash map key is pair of block number and literal's unique identifier in the block, and the value is a literal index that unique in the whole program. Block is a continues array of opcodes. So, bytecode is splitted into blocks. Each block has its own uid counter. To get literal index the interpreter looks up it in the hash map. Thus, now JS program is able to have more than 255 identifiers/string literals. The first 128 (0-127) uids are reserved for block's uid counter, the other 128 (128-255) are reserved for tmp variables.
This commit is contained in:
@@ -96,7 +96,7 @@ fill_params_list (int_data_t *int_data, /**< interpreter context */
|
||||
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
|
||||
JERRY_ASSERT (next_opcode.data.meta.type == OPCODE_META_TYPE_VARG);
|
||||
|
||||
const idx_t param_name_lit_idx = next_opcode.data.meta.data_1;
|
||||
const literal_index_t param_name_lit_idx = deserialize_lit_id_by_uid (next_opcode.data.meta.data_1, int_data->pos);
|
||||
|
||||
params_names [param_index] = ecma_new_ecma_string_from_lit_index (param_name_lit_idx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user