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:
Ilmir Usmanov
2014-12-10 18:31:59 +03:00
parent fc9e83d290
commit dc8ab27900
37 changed files with 5015 additions and 3086 deletions
+2 -1
View File
@@ -31,10 +31,11 @@
#include "ecma-operations.h"
#include "ecma-reference.h"
#include "ecma-try-catch-macro.h"
#include "deserializer.h"
bool is_reg_variable (int_data_t *int_data, idx_t var_idx);
ecma_completion_value_t get_variable_value (int_data_t *, idx_t, bool);
ecma_completion_value_t set_variable_value (int_data_t *, idx_t, ecma_value_t);
ecma_completion_value_t set_variable_value (int_data_t *, opcode_counter_t, idx_t, ecma_value_t);
ecma_completion_value_t fill_varg_list (int_data_t *int_data,
ecma_length_t args_number,
ecma_value_t args_values[],