Rename int_data_t -> vm_frame_ctx_t, vm_frame_ctx_t* variables from int_data / int_data_p -> frame_ctx_p.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
committed by
Evgeny Gavrin
parent
a2c6663d43
commit
7dcaf06793
@@ -28,44 +28,44 @@
|
||||
*/
|
||||
ecma_completion_value_t
|
||||
opfunc_try_block (opcode_t opdata, /**< operation data */
|
||||
int_data_t *int_data) /**< interpreter context */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t block_end_oc_idx_1 = opdata.data.try_block.oc_idx_1;
|
||||
const idx_t block_end_oc_idx_2 = opdata.data.try_block.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);
|
||||
calc_opcode_counter_from_idx_idx (block_end_oc_idx_1, block_end_oc_idx_2) + frame_ctx_p->pos);
|
||||
|
||||
int_data->pos++;
|
||||
frame_ctx_p->pos++;
|
||||
|
||||
vm_run_scope_t run_scope_try = { int_data->pos, try_end_oc };
|
||||
ecma_completion_value_t try_completion = vm_loop (int_data, &run_scope_try);
|
||||
JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && int_data->pos <= try_end_oc)
|
||||
|| (ecma_is_completion_value_empty (try_completion) && int_data->pos == try_end_oc));
|
||||
int_data->pos = try_end_oc;
|
||||
vm_run_scope_t run_scope_try = { frame_ctx_p->pos, try_end_oc };
|
||||
ecma_completion_value_t try_completion = vm_loop (frame_ctx_p, &run_scope_try);
|
||||
JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos <= try_end_oc)
|
||||
|| (ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos == try_end_oc));
|
||||
frame_ctx_p->pos = try_end_oc;
|
||||
|
||||
opcode_t next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos);
|
||||
opcode_t next_opcode = vm_get_opcode (frame_ctx_p->opcodes_p, frame_ctx_p->pos);
|
||||
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
|
||||
|
||||
if (next_opcode.data.meta.type == OPCODE_META_TYPE_CATCH)
|
||||
{
|
||||
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++;
|
||||
read_meta_opcode_counter (OPCODE_META_TYPE_CATCH, frame_ctx_p) + frame_ctx_p->pos);
|
||||
frame_ctx_p->pos++;
|
||||
|
||||
if (ecma_is_completion_value_throw (try_completion))
|
||||
{
|
||||
next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos);
|
||||
next_opcode = vm_get_opcode (frame_ctx_p->opcodes_p, frame_ctx_p->pos);
|
||||
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
|
||||
JERRY_ASSERT (next_opcode.data.meta.type == OPCODE_META_TYPE_CATCH_EXCEPTION_IDENTIFIER);
|
||||
|
||||
lit_cpointer_t catch_exc_val_var_name_lit_cp = serializer_get_literal_cp_by_uid (next_opcode.data.meta.data_1,
|
||||
int_data->opcodes_p,
|
||||
int_data->pos);
|
||||
int_data->pos++;
|
||||
frame_ctx_p->opcodes_p,
|
||||
frame_ctx_p->pos);
|
||||
frame_ctx_p->pos++;
|
||||
|
||||
ecma_string_t *catch_exc_var_name_str_p = ecma_new_ecma_string_from_lit_cp (catch_exc_val_var_name_lit_cp);
|
||||
|
||||
ecma_object_t *old_env_p = int_data->lex_env_p;
|
||||
ecma_object_t *old_env_p = frame_ctx_p->lex_env_p;
|
||||
ecma_object_t *catch_env_p = ecma_create_decl_lex_env (old_env_p);
|
||||
ecma_completion_value_t completion = ecma_op_create_mutable_binding (catch_env_p,
|
||||
catch_exc_var_name_str_p,
|
||||
@@ -80,39 +80,39 @@ opfunc_try_block (opcode_t opdata, /**< operation data */
|
||||
|
||||
ecma_deref_ecma_string (catch_exc_var_name_str_p);
|
||||
|
||||
int_data->lex_env_p = catch_env_p;
|
||||
frame_ctx_p->lex_env_p = catch_env_p;
|
||||
|
||||
ecma_free_completion_value (try_completion);
|
||||
|
||||
vm_run_scope_t run_scope_catch = { int_data->pos, catch_end_oc };
|
||||
try_completion = vm_loop (int_data, &run_scope_catch);
|
||||
vm_run_scope_t run_scope_catch = { frame_ctx_p->pos, catch_end_oc };
|
||||
try_completion = vm_loop (frame_ctx_p, &run_scope_catch);
|
||||
|
||||
int_data->lex_env_p = old_env_p;
|
||||
frame_ctx_p->lex_env_p = old_env_p;
|
||||
|
||||
ecma_deref_object (catch_env_p);
|
||||
|
||||
JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && int_data->pos <= catch_end_oc)
|
||||
|| (ecma_is_completion_value_empty (try_completion) && int_data->pos == catch_end_oc));
|
||||
JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos <= catch_end_oc)
|
||||
|| (ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos == catch_end_oc));
|
||||
}
|
||||
|
||||
int_data->pos = catch_end_oc;
|
||||
frame_ctx_p->pos = catch_end_oc;
|
||||
}
|
||||
|
||||
next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos);
|
||||
next_opcode = vm_get_opcode (frame_ctx_p->opcodes_p, frame_ctx_p->pos);
|
||||
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
|
||||
|
||||
if (next_opcode.data.meta.type == OPCODE_META_TYPE_FINALLY)
|
||||
{
|
||||
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++;
|
||||
read_meta_opcode_counter (OPCODE_META_TYPE_FINALLY, frame_ctx_p) + frame_ctx_p->pos);
|
||||
frame_ctx_p->pos++;
|
||||
|
||||
vm_run_scope_t run_scope_finally = { int_data->pos, finally_end_oc };
|
||||
ecma_completion_value_t finally_completion = vm_loop (int_data, &run_scope_finally);
|
||||
vm_run_scope_t run_scope_finally = { frame_ctx_p->pos, finally_end_oc };
|
||||
ecma_completion_value_t finally_completion = vm_loop (frame_ctx_p, &run_scope_finally);
|
||||
|
||||
JERRY_ASSERT ((!ecma_is_completion_value_empty (finally_completion) && int_data->pos <= finally_end_oc)
|
||||
|| (ecma_is_completion_value_empty (finally_completion) && int_data->pos == finally_end_oc));
|
||||
int_data->pos = finally_end_oc;
|
||||
JERRY_ASSERT ((!ecma_is_completion_value_empty (finally_completion) && frame_ctx_p->pos <= finally_end_oc)
|
||||
|| (ecma_is_completion_value_empty (finally_completion) && frame_ctx_p->pos == finally_end_oc));
|
||||
frame_ctx_p->pos = finally_end_oc;
|
||||
|
||||
if (!ecma_is_completion_value_empty (finally_completion))
|
||||
{
|
||||
@@ -121,7 +121,7 @@ opfunc_try_block (opcode_t opdata, /**< operation data */
|
||||
}
|
||||
}
|
||||
|
||||
next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos++);
|
||||
next_opcode = vm_get_opcode (frame_ctx_p->opcodes_p, frame_ctx_p->pos++);
|
||||
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
|
||||
JERRY_ASSERT (next_opcode.data.meta.type == OPCODE_META_TYPE_END_TRY_CATCH_FINALLY);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user