Freaking FINALLY: postparser

This commit is contained in:
Ilmir Usmanov
2014-10-12 20:33:37 +04:00
parent 63662dfb35
commit 18618c6501
13 changed files with 132 additions and 105 deletions
@@ -32,8 +32,8 @@ opfunc_try (opcode_t opdata, /**< operation data */
{
const idx_t block_end_oc_idx_1 = opdata.data.try.oc_idx_1;
const idx_t block_end_oc_idx_2 = opdata.data.try.oc_idx_2;
const opcode_counter_t try_end_oc = calc_opcode_counter_from_idx_idx (block_end_oc_idx_1,
block_end_oc_idx_2);
const opcode_counter_t try_end_oc = (opcode_counter_t) (
calc_opcode_counter_from_idx_idx (block_end_oc_idx_1, block_end_oc_idx_2) + int_data->pos);
int_data->pos++;
@@ -52,8 +52,8 @@ opfunc_try (opcode_t opdata, /**< operation data */
if (next_opcode.data.meta.type == OPCODE_META_TYPE_CATCH)
{
const opcode_counter_t catch_end_oc = read_meta_opcode_counter (OPCODE_META_TYPE_CATCH,
int_data);
const opcode_counter_t catch_end_oc = (opcode_counter_t) (
read_meta_opcode_counter (OPCODE_META_TYPE_CATCH, int_data) + int_data->pos);
int_data->pos++;
if (ecma_is_completion_value_throw (try_completion))
@@ -105,8 +105,8 @@ opfunc_try (opcode_t opdata, /**< operation data */
if (next_opcode.data.meta.type == OPCODE_META_TYPE_FINALLY)
{
const opcode_counter_t finally_end_oc = read_meta_opcode_counter (OPCODE_META_TYPE_FINALLY,
int_data);
const opcode_counter_t finally_end_oc = (opcode_counter_t) (
read_meta_opcode_counter (OPCODE_META_TYPE_FINALLY, int_data) + int_data->pos);
int_data->pos++;
ecma_completion_value_t finally_completion = run_int_loop (int_data);
+4 -2
View File
@@ -414,7 +414,8 @@ function_declaration (int_data_t *int_data, /**< interpreter context */
bool is_strict = int_data->is_strict;
const bool is_configurable_bindings = int_data->is_eval_code;
const opcode_counter_t function_code_end_oc = read_meta_opcode_counter (OPCODE_META_TYPE_FUNCTION_END, int_data);
const opcode_counter_t function_code_end_oc = (opcode_counter_t) (
read_meta_opcode_counter (OPCODE_META_TYPE_FUNCTION_END, int_data) + int_data->pos);
int_data->pos++;
opcode_t next_opcode = read_opcode (int_data->pos);
@@ -497,7 +498,8 @@ opfunc_func_expr_n (opcode_t opdata, /**< operation data */
bool is_strict = int_data->is_strict;
const opcode_counter_t function_code_end_oc = read_meta_opcode_counter (OPCODE_META_TYPE_FUNCTION_END, int_data);
const opcode_counter_t function_code_end_oc = (opcode_counter_t) (
read_meta_opcode_counter (OPCODE_META_TYPE_FUNCTION_END, int_data) + int_data->pos);
int_data->pos++;
opcode_t next_opcode = read_opcode (int_data->pos);
+1 -1
View File
@@ -62,7 +62,7 @@ typedef enum
OPCODE_META_TYPE_VARG_PROP_GETTER, /**< name (lit_idx) and getter (var_idx) for an accessor property descriptor */
OPCODE_META_TYPE_VARG_PROP_SETTER, /**< name (lit_idx) and setter (var_idx) for an accessor property descriptor */
OPCODE_META_TYPE_END_WITH, /**< end of with statement */
OPCODE_META_TYPE_FUNCTION_END, /**< opcode counter */
OPCODE_META_TYPE_FUNCTION_END, /**< offset to function end */
OPCODE_META_TYPE_CATCH, /**< mark of beginning of catch block containing pointer to end of catch block */
OPCODE_META_TYPE_CATCH_EXCEPTION_IDENTIFIER, /**< literal index containing name of variable with exception object */
OPCODE_META_TYPE_FINALLY, /**< mark of beginning of finally block containing pointer to end of finally block */