Enhancement of argument list parsing loop: removing break / continue operators, so that every iteration passes start and end of loop body.

The change makes possible simple notification of byte-code generator about start / end of byte-code generation for an argument.
As register values are not passed between byte-code sequences that prepare different arguments, the change would make possible for byte-code generator to reuse registers allocated for the code sequences.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan 2015-06-28 17:42:19 +03:00 committed by Evgeny Gavrin
parent 1dc7ed64d6
commit dc095bb902

View File

@ -522,61 +522,56 @@ parse_argument_list (varg_list_type vlt, operand obj, uint8_t *args_count, opera
while (!token_is (close_tt))
{
operand op;
switch (vlt)
{
case VARG_FUNC_DECL:
case VARG_FUNC_EXPR:
if (vlt == VARG_FUNC_DECL
|| vlt == VARG_FUNC_EXPR)
{
current_token_must_be (TOK_NAME);
op = literal_operand (token_data_as_lit_cp ());
syntax_add_varg (op);
syntax_check_for_eval_and_arguments_in_strict_mode (op, is_strict_mode (), tok.loc);
break;
dump_varg (op);
skip_newlines ();
}
case VARG_ARRAY_DECL:
else if (vlt == VARG_CONSTRUCT_EXPR
|| vlt == VARG_CALL_EXPR)
{
op = parse_assignment_expression (true);
dump_varg (op);
skip_newlines ();
}
else if (vlt == VARG_ARRAY_DECL)
{
if (token_is (TOK_COMMA))
{
op = dump_undefined_assignment_res ();
dump_varg (op);
args_num++;
skip_newlines ();
continue;
}
/* FALLTHRU */
}
case VARG_CONSTRUCT_EXPR:
else
{
op = parse_assignment_expression (true);
break;
}
case VARG_CALL_EXPR:
{
op = parse_assignment_expression (true);
break;
}
case VARG_OBJ_DECL:
{
parse_property_assignment ();
break;
}
}
/* In case of obj_decl prop is already dumped. */
if (vlt != VARG_OBJ_DECL)
{
dump_varg (op);
}
args_num++;
skip_newlines ();
if (!token_is (TOK_COMMA))
}
}
else
{
JERRY_ASSERT (vlt == VARG_OBJ_DECL);
parse_property_assignment ();
skip_newlines ();
}
if (token_is (TOK_COMMA))
{
skip_newlines ();
}
else
{
current_token_must_be (close_tt);
break;
}
skip_newlines ();
args_num++;
}
if (args_count != NULL)