Split opcode and instruction entities and perform related renamings: opcode_t is now vm_instr_t, opcode position is instruction position, etc.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-07-21 19:14:06 +03:00
committed by Evgeny Gavrin
parent 1990762cf0
commit 502f4c4623
43 changed files with 1096 additions and 1085 deletions
@@ -27,13 +27,13 @@
* Returned value must be freed with ecma_free_completion_value
*/
ecma_completion_value_t
opfunc_try_block (opcode_t opdata, /**< operation data */
opfunc_try_block (vm_instr_t instr, /**< instruction */
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) + frame_ctx_p->pos);
const idx_t block_end_oc_idx_1 = instr.data.try_block.oc_idx_1;
const idx_t block_end_oc_idx_2 = instr.data.try_block.oc_idx_2;
const vm_instr_counter_t try_end_oc = (vm_instr_counter_t) (
vm_calc_instr_counter_from_idx_idx (block_end_oc_idx_1, block_end_oc_idx_2) + frame_ctx_p->pos);
frame_ctx_p->pos++;
@@ -43,23 +43,23 @@ opfunc_try_block (opcode_t opdata, /**< operation data */
|| (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 (frame_ctx_p->opcodes_p, frame_ctx_p->pos);
JERRY_ASSERT (next_opcode.op_idx == VM_OP_META);
vm_instr_t next_instr = vm_get_instr (frame_ctx_p->instrs_p, frame_ctx_p->pos);
JERRY_ASSERT (next_instr.op_idx == VM_OP_META);
if (next_opcode.data.meta.type == OPCODE_META_TYPE_CATCH)
if (next_instr.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, frame_ctx_p) + frame_ctx_p->pos);
const vm_instr_counter_t catch_end_oc = (vm_instr_counter_t) (
vm_read_instr_counter_from_meta (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 (frame_ctx_p->opcodes_p, frame_ctx_p->pos);
JERRY_ASSERT (next_opcode.op_idx == VM_OP_META);
JERRY_ASSERT (next_opcode.data.meta.type == OPCODE_META_TYPE_CATCH_EXCEPTION_IDENTIFIER);
next_instr = vm_get_instr (frame_ctx_p->instrs_p, frame_ctx_p->pos);
JERRY_ASSERT (next_instr.op_idx == VM_OP_META);
JERRY_ASSERT (next_instr.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,
frame_ctx_p->opcodes_p,
lit_cpointer_t catch_exc_val_var_name_lit_cp = serializer_get_literal_cp_by_uid (next_instr.data.meta.data_1,
frame_ctx_p->instrs_p,
frame_ctx_p->pos);
frame_ctx_p->pos++;
@@ -98,13 +98,13 @@ opfunc_try_block (opcode_t opdata, /**< operation data */
frame_ctx_p->pos = catch_end_oc;
}
next_opcode = vm_get_opcode (frame_ctx_p->opcodes_p, frame_ctx_p->pos);
JERRY_ASSERT (next_opcode.op_idx == VM_OP_META);
next_instr = vm_get_instr (frame_ctx_p->instrs_p, frame_ctx_p->pos);
JERRY_ASSERT (next_instr.op_idx == VM_OP_META);
if (next_opcode.data.meta.type == OPCODE_META_TYPE_FINALLY)
if (next_instr.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, frame_ctx_p) + frame_ctx_p->pos);
const vm_instr_counter_t finally_end_oc = (vm_instr_counter_t) (
vm_read_instr_counter_from_meta (OPCODE_META_TYPE_FINALLY, frame_ctx_p) + frame_ctx_p->pos);
frame_ctx_p->pos++;
vm_run_scope_t run_scope_finally = { frame_ctx_p->pos, finally_end_oc };
@@ -121,9 +121,9 @@ opfunc_try_block (opcode_t opdata, /**< operation data */
}
}
next_opcode = vm_get_opcode (frame_ctx_p->opcodes_p, frame_ctx_p->pos++);
JERRY_ASSERT (next_opcode.op_idx == VM_OP_META);
JERRY_ASSERT (next_opcode.data.meta.type == OPCODE_META_TYPE_END_TRY_CATCH_FINALLY);
next_instr = vm_get_instr (frame_ctx_p->instrs_p, frame_ctx_p->pos++);
JERRY_ASSERT (next_instr.op_idx == VM_OP_META);
JERRY_ASSERT (next_instr.data.meta.type == OPCODE_META_TYPE_END_TRY_CATCH_FINALLY);
return try_completion;
} /* opfunc_try_block */