Remove exit completion value type.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-06-28 15:03:36 +03:00
committed by Evgeny Gavrin
parent 447358cd4a
commit 06dffdec8f
20 changed files with 34 additions and 141 deletions
@@ -46,11 +46,6 @@ opfunc_try_block (opcode_t opdata, /**< operation data */
opcode_t next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos);
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
if (ecma_is_completion_value_exit (try_completion))
{
return try_completion;
}
if (next_opcode.data.meta.type == OPCODE_META_TYPE_CATCH)
{
const opcode_counter_t catch_end_oc = (opcode_counter_t) (
@@ -106,11 +101,6 @@ opfunc_try_block (opcode_t opdata, /**< operation data */
next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos);
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
if (ecma_is_completion_value_exit (try_completion))
{
return try_completion;
}
if (next_opcode.data.meta.type == OPCODE_META_TYPE_FINALLY)
{
const opcode_counter_t finally_end_oc = (opcode_counter_t) (
+3 -1
View File
@@ -253,7 +253,9 @@ opfunc_for_in (opcode_t opdata, /**< operation data */
}
else
{
JERRY_ASSERT (!ecma_is_completion_value_normal (for_in_body_completion));
JERRY_ASSERT (ecma_is_completion_value_throw (for_in_body_completion)
|| ecma_is_completion_value_return (for_in_body_completion)
|| ecma_is_completion_value_jump (for_in_body_completion));
JERRY_ASSERT (int_data_p->pos <= for_in_body_end_oc);
ret_value = for_in_body_completion;
+6 -5
View File
@@ -42,7 +42,7 @@ fill_varg_list (int_data_t *int_data, /**< interpreter context */
{
ecma_completion_value_t evaluate_arg_completion = vm_loop (int_data, NULL);
if (ecma_is_completion_value_normal (evaluate_arg_completion))
if (ecma_is_completion_value_empty (evaluate_arg_completion))
{
opcode_t next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos);
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
@@ -58,16 +58,17 @@ fill_varg_list (int_data_t *int_data, /**< interpreter context */
}
else
{
JERRY_ASSERT (ecma_is_completion_value_throw (get_arg_completion));
ret_value = get_arg_completion;
}
}
else
{
ret_value = evaluate_arg_completion;
}
JERRY_ASSERT (ecma_is_completion_value_throw (evaluate_arg_completion));
ret_value = evaluate_arg_completion;
if (!ecma_is_completion_value_empty (ret_value))
{
break;
}
+7 -28
View File
@@ -991,10 +991,8 @@ opfunc_obj_decl (opcode_t opdata, /**< operation data */
{
ecma_completion_value_t evaluate_prop_completion = vm_loop (int_data, NULL);
if (ecma_is_completion_value_normal (evaluate_prop_completion))
if (ecma_is_completion_value_empty (evaluate_prop_completion))
{
JERRY_ASSERT (ecma_is_completion_value_empty (evaluate_prop_completion));
opcode_t next_opcode = vm_get_opcode (int_data->opcodes_p, int_data->pos);
JERRY_ASSERT (next_opcode.op_idx == __op__idx_meta);
@@ -1109,7 +1107,7 @@ opfunc_obj_decl (opcode_t opdata, /**< operation data */
}
else
{
JERRY_ASSERT (!ecma_is_completion_value_normal (evaluate_prop_completion));
JERRY_ASSERT (ecma_is_completion_value_throw (evaluate_prop_completion));
completion = evaluate_prop_completion;
@@ -1123,6 +1121,8 @@ opfunc_obj_decl (opcode_t opdata, /**< operation data */
}
else
{
JERRY_ASSERT (ecma_is_completion_value_throw (completion));
ret_value = completion;
}
@@ -1276,29 +1276,6 @@ opfunc_prop_setter (opcode_t opdata __attr_unused___, /**< operation data */
return ret_value;
} /* opfunc_prop_setter */
/**
* Exit from script with specified status code:
* 0 - for successful completion
* 1 - to indicate failure.
*
* Note: this is not ECMA specification-defined, but internal
* implementation-defined opcode for end of script
* and assertions inside of unit tests.
*
* @return completion value
* Returned value is simple and so need not be freed.
* However, ecma_free_completion_value may be called for it, but it is a no-op.
*/
ecma_completion_value_t
opfunc_exitval (opcode_t opdata, /**< operation data */
int_data_t *int_data __attr_unused___) /**< interpreter context */
{
JERRY_ASSERT (opdata.data.exitval.status_code == 0
|| opdata.data.exitval.status_code == 1);
return ecma_make_exit_completion_value (opdata.data.exitval.status_code == 0);
} /* opfunc_exitval */
/**
* 'Logical NOT Operator' opcode handler.
*
@@ -1419,7 +1396,9 @@ opfunc_with (opcode_t opdata, /**< operation data */
}
else
{
JERRY_ASSERT (!ecma_is_completion_value_normal (with_completion));
JERRY_ASSERT (ecma_is_completion_value_throw (with_completion)
|| ecma_is_completion_value_return (with_completion)
|| ecma_is_completion_value_jump (with_completion));
JERRY_ASSERT (int_data->pos <= with_end_oc);
}
-1
View File
@@ -176,7 +176,6 @@ opcode_counter_t read_meta_opcode_counter (opcode_meta_type expected_type, int_d
p##_3 (a, construct_n, lhs, name_lit_idx, arg_list) \
p##_2 (a, func_decl_n, name_lit_idx, arg_list) \
p##_3 (a, func_expr_n, lhs, name_lit_idx, arg_list) \
p##_1 (a, exitval, status_code) \
p##_1 (a, retval, ret_value) \
p##_0 (a, ret)
-1
View File
@@ -222,7 +222,6 @@ pp_op_meta (const opcode_t *opcodes_p,
PP_OP (reg_var_decl, "var %s .. %s;");
PP_OP (var_decl, "var %s;");
PP_OP (nop, ";");
PP_OP (exitval, "exit %d;");
PP_OP (retval, "return %s;");
PP_OP (ret, "ret;");
PP_OP (prop_getter, "%s = %s[%s];");
+6 -13
View File
@@ -396,16 +396,11 @@ vm_run_global (void)
jerry_completion_code_t ret_code;
if (ecma_is_completion_value_exit (completion))
if (ecma_is_completion_value_return (completion))
{
if (ecma_is_value_true (ecma_get_completion_value_value (completion)))
{
ret_code = JERRY_COMPLETION_CODE_OK;
}
else
{
ret_code = JERRY_COMPLETION_CODE_FAILED_ASSERTION_IN_SCRIPT;
}
JERRY_ASSERT (ecma_is_value_undefined (ecma_get_completion_value_value (completion)));
ret_code = JERRY_COMPLETION_CODE_OK;
}
else
{
@@ -560,10 +555,8 @@ vm_run_from_pos (const opcode_t *opcodes_p, /**< byte-code array */
completion = vm_loop (&int_data, NULL);
JERRY_ASSERT (ecma_is_completion_value_normal (completion)
|| ecma_is_completion_value_throw (completion)
|| ecma_is_completion_value_return (completion)
|| ecma_is_completion_value_exit (completion));
JERRY_ASSERT (ecma_is_completion_value_throw (completion)
|| ecma_is_completion_value_return (completion));
vm_top_context_p = prev_context_p;