Various opcode's refinements: obj[0,1, 2, n]->obj_decl, array[0, 1, 2, n]->array_decl, func_expr[0, 1, n]->removed, varg[1_end, 2_end, 3_end, 3]->varg_list.
This commit is contained in:
@@ -307,22 +307,11 @@ OP_CODE_DECL (call_n, T_IDX_IDX_IDX,
|
||||
name_lit_idx,
|
||||
arg1_lit_idx)
|
||||
|
||||
/** a = new name (); */
|
||||
OP_CODE_DECL (construct_0, T_IDX_IDX,
|
||||
lhs,
|
||||
name_lit_idx)
|
||||
|
||||
/** a = new name (arg1); */
|
||||
OP_CODE_DECL (construct_1, T_IDX_IDX_IDX,
|
||||
/** a = new name (arg_list */
|
||||
OP_CODE_DECL (construct_decl, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
name_lit_idx,
|
||||
arg1_lit_idx)
|
||||
|
||||
/** a = new name (arg1, ... */
|
||||
OP_CODE_DECL (construct_n, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
name_lit_idx,
|
||||
arg1_lit_idx)
|
||||
arg_list)
|
||||
|
||||
/** name (); */
|
||||
OP_CODE_DECL (func_decl_0, T_IDX,
|
||||
@@ -345,40 +334,8 @@ OP_CODE_DECL (func_decl_n, T_IDX_IDX_IDX,
|
||||
arg1_lit_idx,
|
||||
arg2_lit_idx)
|
||||
|
||||
/** a = name (); */
|
||||
OP_CODE_DECL (func_expr_0, T_IDX_IDX,
|
||||
lhs,
|
||||
name_lit_idx)
|
||||
|
||||
/** a = name (arg1); */
|
||||
OP_CODE_DECL (func_expr_1, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
name_lit_idx,
|
||||
arg1_lit_idx)
|
||||
|
||||
/** a = name (arg1, ... */
|
||||
OP_CODE_DECL (func_expr_n, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
name_lit_idx,
|
||||
arg1_lit_idx)
|
||||
|
||||
/** ..., arg1); */
|
||||
OP_CODE_DECL (varg_1_end, T_IDX,
|
||||
arg1_lit_idx)
|
||||
|
||||
/** ..., arg1, arg2); */
|
||||
OP_CODE_DECL (varg_2_end, T_IDX_IDX,
|
||||
arg1_lit_idx,
|
||||
arg2_lit_idx)
|
||||
|
||||
/** arg1, arg2, arg3, ... */
|
||||
OP_CODE_DECL (varg_3, T_IDX_IDX_IDX,
|
||||
arg1_lit_idx,
|
||||
arg2_lit_idx,
|
||||
arg3_lit_idx)
|
||||
|
||||
/** arg1, arg2, arg3); */
|
||||
OP_CODE_DECL (varg_3_end, T_IDX_IDX_IDX,
|
||||
/** arg1, arg2, arg3 */
|
||||
OP_CODE_DECL (varg_list, T_IDX_IDX_IDX,
|
||||
arg1_lit_idx,
|
||||
arg2_lit_idx,
|
||||
arg3_lit_idx)
|
||||
@@ -394,26 +351,10 @@ OP_CODE_DECL_VOID (ret)
|
||||
|
||||
OP_CODE_DECL_VOID (nop)
|
||||
|
||||
/** a = [] */
|
||||
OP_CODE_DECL (array_0, T_IDX,
|
||||
lhs)
|
||||
|
||||
/** a = [b] */
|
||||
OP_CODE_DECL (array_1, T_IDX_IDX,
|
||||
/** a = [list] */
|
||||
OP_CODE_DECL (array_decl, T_IDX_IDX,
|
||||
lhs,
|
||||
elem1)
|
||||
|
||||
/** a = [b, c] */
|
||||
OP_CODE_DECL (array_2, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
elem1,
|
||||
elem2)
|
||||
|
||||
/** a = [b, c ... */
|
||||
OP_CODE_DECL (array_n, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
elem1,
|
||||
elem2)
|
||||
list)
|
||||
|
||||
/** a = b : c */
|
||||
OP_CODE_DECL (prop, T_IDX_IDX_IDX,
|
||||
@@ -445,25 +386,9 @@ OP_CODE_DECL (prop_set_decl, T_IDX_IDX_IDX,
|
||||
arg)
|
||||
|
||||
/** a = { } */
|
||||
OP_CODE_DECL (obj_0, T_IDX,
|
||||
lhs)
|
||||
|
||||
/** a = { b } */
|
||||
OP_CODE_DECL (obj_1, T_IDX_IDX,
|
||||
OP_CODE_DECL (obj_decl, T_IDX_IDX,
|
||||
lhs,
|
||||
arg1)
|
||||
|
||||
/** a = { b, c } */
|
||||
OP_CODE_DECL (obj_2, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
arg1,
|
||||
arg2)
|
||||
|
||||
/** a = { b, c ... */
|
||||
OP_CODE_DECL (obj_n, T_IDX_IDX_IDX,
|
||||
lhs,
|
||||
arg1,
|
||||
arg2)
|
||||
list)
|
||||
|
||||
/** a = this */
|
||||
OP_CODE_DECL (this, T_IDX,
|
||||
|
||||
+15
-43
@@ -429,40 +429,26 @@ do_number_bitwise_logic (struct __int_data *int_data, /**< interpreter context *
|
||||
#define OP_UNIMPLEMENTED_LIST(op) \
|
||||
op (call_n) \
|
||||
op (func_decl_n) \
|
||||
op (varg_1_end) \
|
||||
op (varg_2_end) \
|
||||
op (varg_3) \
|
||||
op (varg_3_end) \
|
||||
op (varg_list) \
|
||||
op (retval) \
|
||||
op (b_shift_left) \
|
||||
op (b_shift_right) \
|
||||
op (b_shift_uright) \
|
||||
op (logical_and) \
|
||||
op (logical_or) \
|
||||
op (construct_0) \
|
||||
op (construct_1) \
|
||||
op (construct_n) \
|
||||
op (func_expr_0) \
|
||||
op (func_expr_1) \
|
||||
op (func_expr_n) \
|
||||
op (array_0) \
|
||||
op (array_1) \
|
||||
op (array_2) \
|
||||
op (array_n) \
|
||||
op (construct_decl) \
|
||||
op (array_decl) \
|
||||
op (prop) \
|
||||
op (prop_get_decl) \
|
||||
op (prop_set_decl) \
|
||||
op (obj_0) \
|
||||
op (obj_1) \
|
||||
op (obj_2) \
|
||||
op (obj_n) \
|
||||
op (obj_decl) \
|
||||
op (this) \
|
||||
op (delete) \
|
||||
op (typeof) \
|
||||
op (with) \
|
||||
op (end_with) \
|
||||
op (logical_not) \
|
||||
op (logical_and) \
|
||||
op (logical_or) \
|
||||
op (b_not) \
|
||||
op (b_shift_left) \
|
||||
op (b_shift_right) \
|
||||
op (b_shift_uright) \
|
||||
op (instanceof) \
|
||||
op (in) \
|
||||
static char __unused unimplemented_list_end
|
||||
@@ -1798,7 +1784,7 @@ opfunc_func_decl_1 (OPCODE opdata, /**< operation data */
|
||||
int_data->pos++;
|
||||
|
||||
ecma_string_t *arg_name_string_p = ecma_new_ecma_string_from_lit_index (opdata.data.func_decl_1.arg1_lit_idx);
|
||||
|
||||
|
||||
ecma_completion_value_t ret_value = function_declaration (int_data,
|
||||
opdata.data.func_decl_1.name_lit_idx,
|
||||
&arg_name_string_p,
|
||||
@@ -1826,7 +1812,7 @@ opfunc_func_decl_2 (OPCODE opdata, /**< operation data */
|
||||
ecma_new_ecma_string_from_lit_index (opdata.data.func_decl_2.arg1_lit_idx),
|
||||
ecma_new_ecma_string_from_lit_index (opdata.data.func_decl_2.arg2_lit_idx)
|
||||
};
|
||||
|
||||
|
||||
ecma_completion_value_t ret_value = function_declaration (int_data,
|
||||
opdata.data.func_decl_1.name_lit_idx,
|
||||
arg_names_strings,
|
||||
@@ -2048,10 +2034,7 @@ GETOP_IMPL_3 (call_n, lhs, name_lit_idx, arg1_lit_idx)
|
||||
GETOP_IMPL_2 (func_decl_1, name_lit_idx, arg1_lit_idx)
|
||||
GETOP_IMPL_3 (func_decl_2, name_lit_idx, arg1_lit_idx, arg2_lit_idx)
|
||||
GETOP_IMPL_3 (func_decl_n, name_lit_idx, arg1_lit_idx, arg2_lit_idx)
|
||||
GETOP_IMPL_1 (varg_1_end, arg1_lit_idx)
|
||||
GETOP_IMPL_2 (varg_2_end, arg1_lit_idx, arg2_lit_idx)
|
||||
GETOP_IMPL_3 (varg_3, arg1_lit_idx, arg2_lit_idx, arg3_lit_idx)
|
||||
GETOP_IMPL_3 (varg_3_end, arg1_lit_idx, arg2_lit_idx, arg3_lit_idx)
|
||||
GETOP_IMPL_3 (varg_list, arg1_lit_idx, arg2_lit_idx, arg3_lit_idx)
|
||||
GETOP_IMPL_1 (exitval, status_code)
|
||||
GETOP_IMPL_1 (retval, ret_value)
|
||||
GETOP_IMPL_0 (ret)
|
||||
@@ -2061,26 +2044,15 @@ GETOP_IMPL_2 (b_not, dst, var_right)
|
||||
GETOP_IMPL_2 (logical_not, dst, var_right)
|
||||
GETOP_IMPL_3 (instanceof, dst, var_left, var_right)
|
||||
GETOP_IMPL_3 (in, dst, var_left, var_right)
|
||||
GETOP_IMPL_2 (construct_0, lhs, name_lit_idx)
|
||||
GETOP_IMPL_3 (construct_1, lhs, name_lit_idx, arg1_lit_idx)
|
||||
GETOP_IMPL_3 (construct_n, lhs, name_lit_idx, arg1_lit_idx)
|
||||
GETOP_IMPL_3 (construct_decl, lhs, name_lit_idx, arg_list)
|
||||
GETOP_IMPL_1 (func_decl_0, name_lit_idx)
|
||||
GETOP_IMPL_2 (func_expr_0, lhs, name_lit_idx)
|
||||
GETOP_IMPL_3 (func_expr_1, lhs, name_lit_idx, arg1_lit_idx)
|
||||
GETOP_IMPL_3 (func_expr_n, lhs, name_lit_idx, arg1_lit_idx)
|
||||
GETOP_IMPL_1 (array_0, lhs)
|
||||
GETOP_IMPL_2 (array_1, lhs, elem1)
|
||||
GETOP_IMPL_3 (array_2, lhs, elem1, elem2)
|
||||
GETOP_IMPL_3 (array_n, lhs, elem1, elem2)
|
||||
GETOP_IMPL_2 (array_decl, lhs, list)
|
||||
GETOP_IMPL_3 (prop, lhs, name, value)
|
||||
GETOP_IMPL_3 (prop_getter, lhs, obj, prop)
|
||||
GETOP_IMPL_3 (prop_setter, obj, prop, rhs)
|
||||
GETOP_IMPL_2 (prop_get_decl, lhs, prop)
|
||||
GETOP_IMPL_3 (prop_set_decl, lhs, prop, arg)
|
||||
GETOP_IMPL_1 (obj_0, lhs)
|
||||
GETOP_IMPL_2 (obj_1, lhs, arg1)
|
||||
GETOP_IMPL_3 (obj_2, lhs, arg1, arg2)
|
||||
GETOP_IMPL_3 (obj_n, lhs, arg1, arg2)
|
||||
GETOP_IMPL_2 (obj_decl, lhs, list)
|
||||
GETOP_IMPL_1 (this, lhs)
|
||||
GETOP_IMPL_2 (delete, lhs, obj)
|
||||
GETOP_IMPL_2 (typeof, lhs, obj)
|
||||
|
||||
@@ -40,38 +40,24 @@ ecma_completion_value_t (*opfunc) (OPCODE, struct __int_data *);
|
||||
op (call_0) \
|
||||
op (call_1) \
|
||||
op (call_n) \
|
||||
op (construct_0) \
|
||||
op (construct_1) \
|
||||
op (construct_n) \
|
||||
op (construct_decl) \
|
||||
op (func_decl_0) \
|
||||
op (func_decl_1) \
|
||||
op (func_decl_2) \
|
||||
op (func_decl_n) \
|
||||
op (func_expr_0) \
|
||||
op (func_expr_1) \
|
||||
op (func_expr_n) \
|
||||
op (varg_1_end) \
|
||||
op (varg_2_end) \
|
||||
op (varg_3) \
|
||||
op (varg_3_end) \
|
||||
op (varg_list) \
|
||||
op (exitval) \
|
||||
op (retval) \
|
||||
op (ret)
|
||||
|
||||
#define OP_INITS(op) \
|
||||
op (array_0) \
|
||||
op (array_1) \
|
||||
op (array_2) \
|
||||
op (array_n) \
|
||||
op (array_decl) \
|
||||
op (prop) \
|
||||
op (prop_getter) \
|
||||
op (prop_setter) \
|
||||
op (prop_get_decl) \
|
||||
op (prop_set_decl) \
|
||||
op (obj_0) \
|
||||
op (obj_1) \
|
||||
op (obj_2) \
|
||||
op (obj_n) \
|
||||
op (obj_decl) \
|
||||
op (this) \
|
||||
op (delete) \
|
||||
op (typeof) \
|
||||
|
||||
Reference in New Issue
Block a user