Introducing type argument in 'assignment' opcode handler.

This commit is contained in:
Ruben Ayrapetyan
2014-07-21 15:57:15 +04:00
parent 123df0f185
commit 98a0c0f933
4 changed files with 48 additions and 5 deletions
+3 -2
View File
@@ -238,8 +238,9 @@ OP_CODE_DECL (greater_or_equal_than, T_IDX_IDX_IDX,
// Assign value to LEFT operand based on value of RIGHT operand.
/** L = R */
OP_CODE_DECL (assignment, T_IDX_IDX,
value_left,
OP_CODE_DECL (assignment, T_IDX_IDX_IDX,
var_left,
type_value_right,
value_right)
// Functions calls, declarations and argument handling
+1 -1
View File
@@ -278,7 +278,7 @@ GETOP_IMPL_3 (less_than, dst, var_left, var_right)
GETOP_IMPL_3 (greater_than, dst, var_left, var_right)
GETOP_IMPL_3 (less_or_equal_than, dst, var_left, var_right)
GETOP_IMPL_3 (greater_or_equal_than, dst, var_left, var_right)
GETOP_IMPL_2 (assignment, value_left, value_right)
GETOP_IMPL_3 (assignment, var_left, type_value_right, value_right)
GETOP_IMPL_2 (call_1, name_lit_idx, arg1_lit_idx)
GETOP_IMPL_3 (call_2, name_lit_idx, arg1_lit_idx, arg2_lit_idx)
GETOP_IMPL_3 (call_n, name_lit_idx, arg1_lit_idx, arg2_lit_idx)
+13
View File
@@ -141,5 +141,18 @@ OPCODE
}
__packed;
/**
* Descriptor of assignment's second argument
* that specifies type of third argument.
*/
typedef enum
{
OPCODE_ARG_TYPE_SIMPLE, /**< ecma_SimpleValue_t */
OPCODE_ARG_TYPE_SMALLINT, /**< small integer: from -128 to 127 */
OPCODE_ARG_TYPE_NUMBER, /**< index of number literal */
OPCODE_ARG_TYPE_STRING, /**< index of string literal */
OPCODE_ARG_TYPE_VARIABLE /**< index of variable name */
} opcode_arg_type_operand;
#endif /* OPCODES_H */