Rename idx_t -> vm_idx_t, opcode_special_reg_t -> vm_reg_t, INVALID_VALUE -> VM_IDX_EMPTY / VM_IDX_REWRITE_GENERAL_CASE, LITERAL_TO_REWRITE -> VM_IDX_REWRITE_LITERAL_UID.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
+59
-59
@@ -62,9 +62,9 @@ ecma_completion_value_t
|
||||
opfunc_assignment (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.assignment.var_left;
|
||||
const vm_idx_t dst_var_idx = instr.data.assignment.var_left;
|
||||
const opcode_arg_type_operand type_value_right = (opcode_arg_type_operand) instr.data.assignment.type_value_right;
|
||||
const idx_t src_val_descr = instr.data.assignment.value_right;
|
||||
const vm_idx_t src_val_descr = instr.data.assignment.value_right;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -233,8 +233,8 @@ ecma_completion_value_t
|
||||
opfunc_pre_incr (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.pre_incr.dst;
|
||||
const idx_t incr_var_idx = instr.data.pre_incr.var_right;
|
||||
const vm_idx_t dst_var_idx = instr.data.pre_incr.dst;
|
||||
const vm_idx_t incr_var_idx = instr.data.pre_incr.var_right;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -280,8 +280,8 @@ ecma_completion_value_t
|
||||
opfunc_pre_decr (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.pre_decr.dst;
|
||||
const idx_t decr_var_idx = instr.data.pre_decr.var_right;
|
||||
const vm_idx_t dst_var_idx = instr.data.pre_decr.dst;
|
||||
const vm_idx_t decr_var_idx = instr.data.pre_decr.var_right;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -327,8 +327,8 @@ ecma_completion_value_t
|
||||
opfunc_post_incr (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.post_incr.dst;
|
||||
const idx_t incr_var_idx = instr.data.post_incr.var_right;
|
||||
const vm_idx_t dst_var_idx = instr.data.post_incr.dst;
|
||||
const vm_idx_t incr_var_idx = instr.data.post_incr.var_right;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -375,8 +375,8 @@ ecma_completion_value_t
|
||||
opfunc_post_decr (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.post_decr.dst;
|
||||
const idx_t decr_var_idx = instr.data.post_decr.var_right;
|
||||
const vm_idx_t dst_var_idx = instr.data.post_decr.dst;
|
||||
const vm_idx_t decr_var_idx = instr.data.post_decr.var_right;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -530,7 +530,7 @@ ecma_completion_value_t
|
||||
opfunc_func_decl_n (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t function_name_idx = instr.data.func_decl_n.name_lit_idx;
|
||||
const vm_idx_t function_name_idx = instr.data.func_decl_n.name_lit_idx;
|
||||
const ecma_length_t params_number = instr.data.func_decl_n.arg_list;
|
||||
|
||||
lit_cpointer_t function_name_lit_cp = serializer_get_literal_cp_by_uid (function_name_idx,
|
||||
@@ -566,10 +566,10 @@ opfunc_func_expr_n (vm_instr_t instr, /**< instruction */
|
||||
|
||||
frame_ctx_p->pos++;
|
||||
|
||||
const idx_t dst_var_idx = instr.data.func_expr_n.lhs;
|
||||
const idx_t function_name_lit_idx = instr.data.func_expr_n.name_lit_idx;
|
||||
const vm_idx_t dst_var_idx = instr.data.func_expr_n.lhs;
|
||||
const vm_idx_t function_name_lit_idx = instr.data.func_expr_n.name_lit_idx;
|
||||
const ecma_length_t params_number = instr.data.func_expr_n.arg_list;
|
||||
const bool is_named_func_expr = (function_name_lit_idx != INVALID_VALUE);
|
||||
const bool is_named_func_expr = (function_name_lit_idx != VM_IDX_EMPTY);
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -662,7 +662,7 @@ static ecma_value_t
|
||||
vm_helper_call_get_call_flags_and_this_arg (vm_frame_ctx_t *int_data_p, /**< interpreter context */
|
||||
vm_instr_counter_t var_idx_lit_oc, /**< instruction counter of instruction
|
||||
with var_idx */
|
||||
idx_t var_idx, /**< idx, used to retrieve the called function object */
|
||||
vm_idx_t var_idx, /**< idx, used to retrieve the called function object */
|
||||
opcode_call_flags_t *out_flags_p) /**< out: call flags */
|
||||
{
|
||||
JERRY_ASSERT (out_flags_p != NULL);
|
||||
@@ -670,7 +670,7 @@ vm_helper_call_get_call_flags_and_this_arg (vm_frame_ctx_t *int_data_p, /**< int
|
||||
bool is_increase_instruction_pointer;
|
||||
|
||||
opcode_call_flags_t call_flags = OPCODE_CALL_FLAGS__EMPTY;
|
||||
idx_t this_arg_var_idx = INVALID_VALUE;
|
||||
vm_idx_t this_arg_var_idx = VM_IDX_EMPTY;
|
||||
|
||||
vm_instr_t next_opcode = vm_get_instr (int_data_p->instrs_p, int_data_p->pos);
|
||||
if (next_opcode.op_idx == VM_OP_META
|
||||
@@ -773,9 +773,9 @@ ecma_completion_value_t
|
||||
opfunc_call_n (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t lhs_var_idx = instr.data.call_n.lhs;
|
||||
const idx_t function_var_idx = instr.data.call_n.function_var_idx;
|
||||
const idx_t args_number_idx = instr.data.call_n.arg_list;
|
||||
const vm_idx_t lhs_var_idx = instr.data.call_n.lhs;
|
||||
const vm_idx_t function_var_idx = instr.data.call_n.function_var_idx;
|
||||
const vm_idx_t args_number_idx = instr.data.call_n.arg_list;
|
||||
const vm_instr_counter_t lit_oc = frame_ctx_p->pos;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
@@ -866,9 +866,9 @@ ecma_completion_value_t
|
||||
opfunc_construct_n (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t lhs_var_idx = instr.data.construct_n.lhs;
|
||||
const idx_t constructor_name_lit_idx = instr.data.construct_n.name_lit_idx;
|
||||
const idx_t args_number = instr.data.construct_n.arg_list;
|
||||
const vm_idx_t lhs_var_idx = instr.data.construct_n.lhs;
|
||||
const vm_idx_t constructor_name_lit_idx = instr.data.construct_n.name_lit_idx;
|
||||
const vm_idx_t args_number = instr.data.construct_n.arg_list;
|
||||
const vm_instr_counter_t lit_oc = frame_ctx_p->pos;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
@@ -935,9 +935,9 @@ ecma_completion_value_t
|
||||
opfunc_array_decl (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t lhs_var_idx = instr.data.array_decl.lhs;
|
||||
const idx_t args_number_high_byte = instr.data.array_decl.list_1;
|
||||
const idx_t args_number_low_byte = instr.data.array_decl.list_2;
|
||||
const vm_idx_t lhs_var_idx = instr.data.array_decl.lhs;
|
||||
const vm_idx_t args_number_high_byte = instr.data.array_decl.list_1;
|
||||
const vm_idx_t args_number_low_byte = instr.data.array_decl.list_2;
|
||||
const vm_instr_counter_t lit_oc = frame_ctx_p->pos;
|
||||
|
||||
frame_ctx_p->pos++;
|
||||
@@ -1009,9 +1009,9 @@ ecma_completion_value_t
|
||||
opfunc_obj_decl (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t lhs_var_idx = instr.data.obj_decl.lhs;
|
||||
const idx_t args_number_high_byte = instr.data.obj_decl.list_1;
|
||||
const idx_t args_number_low_byte = instr.data.obj_decl.list_2;
|
||||
const vm_idx_t lhs_var_idx = instr.data.obj_decl.lhs;
|
||||
const vm_idx_t args_number_high_byte = instr.data.obj_decl.list_1;
|
||||
const vm_idx_t args_number_low_byte = instr.data.obj_decl.list_2;
|
||||
const vm_instr_counter_t obj_lit_oc = frame_ctx_p->pos;
|
||||
|
||||
frame_ctx_p->pos++;
|
||||
@@ -1039,10 +1039,10 @@ opfunc_obj_decl (vm_instr_t instr, /**< instruction */
|
||||
|| type == OPCODE_META_TYPE_VARG_PROP_GETTER
|
||||
|| type == OPCODE_META_TYPE_VARG_PROP_SETTER);
|
||||
|
||||
const idx_t prop_name_var_idx = next_opcode.data.meta.data_1;
|
||||
const vm_idx_t prop_name_var_idx = next_opcode.data.meta.data_1;
|
||||
JERRY_ASSERT (is_reg_variable (frame_ctx_p, prop_name_var_idx));
|
||||
|
||||
const idx_t value_for_prop_desc_var_idx = next_opcode.data.meta.data_2;
|
||||
const vm_idx_t value_for_prop_desc_var_idx = next_opcode.data.meta.data_2;
|
||||
|
||||
ECMA_TRY_CATCH (value_for_prop_desc,
|
||||
get_variable_value (frame_ctx_p,
|
||||
@@ -1209,9 +1209,9 @@ ecma_completion_value_t
|
||||
opfunc_prop_getter (vm_instr_t instr __attr_unused___, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p __attr_unused___) /**< interpreter context */
|
||||
{
|
||||
const idx_t lhs_var_idx = instr.data.prop_getter.lhs;
|
||||
const idx_t base_var_idx = instr.data.prop_getter.obj;
|
||||
const idx_t prop_name_var_idx = instr.data.prop_getter.prop;
|
||||
const vm_idx_t lhs_var_idx = instr.data.prop_getter.lhs;
|
||||
const vm_idx_t base_var_idx = instr.data.prop_getter.obj;
|
||||
const vm_idx_t prop_name_var_idx = instr.data.prop_getter.prop;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -1262,9 +1262,9 @@ ecma_completion_value_t
|
||||
opfunc_prop_setter (vm_instr_t instr __attr_unused___, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p __attr_unused___) /**< interpreter context */
|
||||
{
|
||||
const idx_t base_var_idx = instr.data.prop_setter.obj;
|
||||
const idx_t prop_name_var_idx = instr.data.prop_setter.prop;
|
||||
const idx_t rhs_var_idx = instr.data.prop_setter.rhs;
|
||||
const vm_idx_t base_var_idx = instr.data.prop_setter.obj;
|
||||
const vm_idx_t prop_name_var_idx = instr.data.prop_setter.prop;
|
||||
const vm_idx_t rhs_var_idx = instr.data.prop_setter.rhs;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -1314,8 +1314,8 @@ ecma_completion_value_t
|
||||
opfunc_logical_not (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.logical_not.dst;
|
||||
const idx_t right_var_idx = instr.data.logical_not.var_right;
|
||||
const vm_idx_t dst_var_idx = instr.data.logical_not.dst;
|
||||
const vm_idx_t right_var_idx = instr.data.logical_not.var_right;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -1352,7 +1352,7 @@ ecma_completion_value_t
|
||||
opfunc_this_binding (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.this_binding.lhs;
|
||||
const vm_idx_t dst_var_idx = instr.data.this_binding.lhs;
|
||||
const vm_instr_counter_t lit_oc = frame_ctx_p->pos;
|
||||
|
||||
frame_ctx_p->pos++;
|
||||
@@ -1378,9 +1378,9 @@ ecma_completion_value_t
|
||||
opfunc_with (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t expr_var_idx = instr.data.with.expr;
|
||||
const idx_t block_end_oc_idx_1 = instr.data.with.oc_idx_1;
|
||||
const idx_t block_end_oc_idx_2 = instr.data.with.oc_idx_2;
|
||||
const vm_idx_t expr_var_idx = instr.data.with.expr;
|
||||
const vm_idx_t block_end_oc_idx_1 = instr.data.with.oc_idx_1;
|
||||
const vm_idx_t block_end_oc_idx_2 = instr.data.with.oc_idx_2;
|
||||
const vm_instr_counter_t with_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);
|
||||
|
||||
@@ -1452,7 +1452,7 @@ ecma_completion_value_t
|
||||
opfunc_throw_value (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t var_idx = instr.data.throw_value.var;
|
||||
const vm_idx_t var_idx = instr.data.throw_value.var;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -1481,7 +1481,7 @@ opfunc_throw_value (vm_instr_t instr, /**< instruction */
|
||||
*/
|
||||
static ecma_completion_value_t
|
||||
evaluate_arg_for_typeof (vm_frame_ctx_t *frame_ctx_p, /**< interpreter context */
|
||||
idx_t var_idx) /**< arg variable identifier */
|
||||
vm_idx_t var_idx) /**< arg variable identifier */
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -1531,8 +1531,8 @@ ecma_completion_value_t
|
||||
opfunc_typeof (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.typeof.lhs;
|
||||
const idx_t obj_var_idx = instr.data.typeof.obj;
|
||||
const vm_idx_t dst_var_idx = instr.data.typeof.lhs;
|
||||
const vm_idx_t obj_var_idx = instr.data.typeof.obj;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -1603,8 +1603,8 @@ ecma_completion_value_t
|
||||
opfunc_delete_var (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.delete_var.lhs;
|
||||
const idx_t name_lit_idx = instr.data.delete_var.name;
|
||||
const vm_idx_t dst_var_idx = instr.data.delete_var.lhs;
|
||||
const vm_idx_t name_lit_idx = instr.data.delete_var.name;
|
||||
const vm_instr_counter_t lit_oc = frame_ctx_p->pos;
|
||||
|
||||
frame_ctx_p->pos++;
|
||||
@@ -1670,9 +1670,9 @@ ecma_completion_value_t
|
||||
opfunc_delete_prop (vm_instr_t instr, /**< instruction */
|
||||
vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
|
||||
{
|
||||
const idx_t dst_var_idx = instr.data.delete_prop.lhs;
|
||||
const idx_t base_var_idx = instr.data.delete_prop.base;
|
||||
const idx_t name_var_idx = instr.data.delete_prop.name;
|
||||
const vm_idx_t dst_var_idx = instr.data.delete_prop.lhs;
|
||||
const vm_idx_t base_var_idx = instr.data.delete_prop.base;
|
||||
const vm_idx_t name_var_idx = instr.data.delete_prop.name;
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -1777,13 +1777,13 @@ opfunc_meta (vm_instr_t instr, /**< instruction */
|
||||
* @return instruction counter
|
||||
*/
|
||||
vm_instr_counter_t
|
||||
vm_calc_instr_counter_from_idx_idx (const idx_t oc_idx_1, /**< first idx */
|
||||
const idx_t oc_idx_2) /**< second idx */
|
||||
vm_calc_instr_counter_from_idx_idx (const vm_idx_t oc_idx_1, /**< first idx */
|
||||
const vm_idx_t oc_idx_2) /**< second idx */
|
||||
{
|
||||
vm_instr_counter_t counter;
|
||||
|
||||
counter = oc_idx_1;
|
||||
counter = (vm_instr_counter_t) (counter << (sizeof (idx_t) * JERRY_BITSINBYTE));
|
||||
counter = (vm_instr_counter_t) (counter << (sizeof (vm_idx_t) * JERRY_BITSINBYTE));
|
||||
counter = (vm_instr_counter_t) (counter | oc_idx_2);
|
||||
|
||||
return counter;
|
||||
@@ -1800,8 +1800,8 @@ vm_read_instr_counter_from_meta (opcode_meta_type expected_type, /**< expected t
|
||||
vm_instr_t meta_opcode = vm_get_instr (frame_ctx_p->instrs_p, frame_ctx_p->pos);
|
||||
JERRY_ASSERT (meta_opcode.data.meta.type == expected_type);
|
||||
|
||||
const idx_t data_1 = meta_opcode.data.meta.data_1;
|
||||
const idx_t data_2 = meta_opcode.data.meta.data_2;
|
||||
const vm_idx_t data_1 = meta_opcode.data.meta.data_1;
|
||||
const vm_idx_t data_2 = meta_opcode.data.meta.data_2;
|
||||
|
||||
return vm_calc_instr_counter_from_idx_idx (data_1, data_2);
|
||||
} /* vm_read_instr_counter_from_meta */
|
||||
@@ -1815,7 +1815,7 @@ vm_read_instr_counter_from_meta (opcode_meta_type expected_type, /**< expected t
|
||||
return instr; \
|
||||
}
|
||||
#define VM_OP_1(opcode_name, opcode_name_uppercase, arg1, arg1_type) \
|
||||
vm_instr_t getop_##opcode_name (idx_t arg1_v) \
|
||||
vm_instr_t getop_##opcode_name (vm_idx_t arg1_v) \
|
||||
{ \
|
||||
vm_instr_t instr; \
|
||||
memset (&instr, 0, sizeof(instr)); \
|
||||
@@ -1824,7 +1824,7 @@ vm_read_instr_counter_from_meta (opcode_meta_type expected_type, /**< expected t
|
||||
return instr; \
|
||||
}
|
||||
#define VM_OP_2(opcode_name, opcode_name_uppercase, arg1, arg1_type, arg2, arg2_type) \
|
||||
vm_instr_t getop_##opcode_name (idx_t arg1_v, idx_t arg2_v) \
|
||||
vm_instr_t getop_##opcode_name (vm_idx_t arg1_v, vm_idx_t arg2_v) \
|
||||
{ \
|
||||
vm_instr_t instr; \
|
||||
memset (&instr, 0, sizeof(instr)); \
|
||||
@@ -1834,7 +1834,7 @@ vm_read_instr_counter_from_meta (opcode_meta_type expected_type, /**< expected t
|
||||
return instr; \
|
||||
}
|
||||
#define VM_OP_3(opcode_name, opcode_name_uppercase, arg1, arg1_type, arg2, arg2_type, arg3, arg3_type) \
|
||||
vm_instr_t getop_##opcode_name (idx_t arg1_v, idx_t arg2_v, idx_t arg3_v) \
|
||||
vm_instr_t getop_##opcode_name (vm_idx_t arg1_v, vm_idx_t arg2_v, vm_idx_t arg3_v) \
|
||||
{ \
|
||||
vm_instr_t instr; \
|
||||
instr.op_idx = VM_OP_##opcode_name_uppercase; \
|
||||
|
||||
Reference in New Issue
Block a user