ECMAScript Parameters cannot be passed in collections anymore, only as arrays.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
László Langó
parent
cc6fced17a
commit
cadc81d583
@@ -58,10 +58,10 @@ opfunc_call_n (ecma_value_t this_value, /**< this object value */
|
||||
|
||||
ecma_object_t *func_obj_p = ecma_get_object_from_value (func_value);
|
||||
|
||||
ret_value = ecma_op_function_call_array_args (func_obj_p,
|
||||
this_value,
|
||||
arguments_list_p,
|
||||
arguments_list_len);
|
||||
ret_value = ecma_op_function_call (func_obj_p,
|
||||
this_value,
|
||||
arguments_list_p,
|
||||
arguments_list_len);
|
||||
|
||||
return ret_value;
|
||||
} /* opfunc_call_n */
|
||||
@@ -76,16 +76,10 @@ opfunc_call_n (ecma_value_t this_value, /**< this object value */
|
||||
*/
|
||||
ecma_completion_value_t
|
||||
opfunc_construct_n (ecma_value_t constructor_value, /**< constructor object value */
|
||||
uint8_t args_num, /**< number of arguments */
|
||||
ecma_value_t *stack_p) /**< stack pointer */
|
||||
const ecma_value_t *arguments_list_p, /**< stack pointer */
|
||||
ecma_length_t arguments_list_len) /**< number of arguments */
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
ecma_collection_header_t *arg_collection_p = ecma_new_values_collection (NULL, 0, true);
|
||||
|
||||
for (int i = 0; i < args_num; i++)
|
||||
{
|
||||
ecma_append_to_values_collection (arg_collection_p, stack_p[i], true);
|
||||
}
|
||||
|
||||
if (!ecma_is_constructor (constructor_value))
|
||||
{
|
||||
@@ -97,7 +91,8 @@ opfunc_construct_n (ecma_value_t constructor_value, /**< constructor object valu
|
||||
|
||||
ECMA_TRY_CATCH (construction_ret_value,
|
||||
ecma_op_function_construct (constructor_obj_p,
|
||||
arg_collection_p),
|
||||
arguments_list_p,
|
||||
arguments_list_len),
|
||||
ret_value);
|
||||
|
||||
ret_value = ecma_make_normal_completion_value (ecma_copy_value (construction_ret_value, true));
|
||||
@@ -105,8 +100,6 @@ opfunc_construct_n (ecma_value_t constructor_value, /**< constructor object valu
|
||||
ECMA_FINALIZE (construction_ret_value);
|
||||
}
|
||||
|
||||
ecma_free_values_collection (arg_collection_p, true);
|
||||
|
||||
return ret_value;
|
||||
} /* opfunc_construct_n */
|
||||
|
||||
|
||||
@@ -57,13 +57,12 @@ ecma_completion_value_t
|
||||
vm_var_decl (vm_frame_ctx_t *, ecma_string_t *);
|
||||
|
||||
ecma_completion_value_t
|
||||
opfunc_call_n (ecma_value_t,
|
||||
ecma_value_t,
|
||||
const ecma_value_t *,
|
||||
ecma_length_t);
|
||||
opfunc_call_n (ecma_value_t, ecma_value_t,
|
||||
const ecma_value_t *, ecma_length_t);
|
||||
|
||||
ecma_completion_value_t
|
||||
opfunc_construct_n (ecma_value_t, uint8_t, ecma_value_t *);
|
||||
opfunc_construct_n (ecma_value_t,
|
||||
const ecma_value_t *, ecma_length_t);
|
||||
|
||||
ecma_completion_value_t
|
||||
opfunc_equal_value (ecma_value_t, ecma_value_t);
|
||||
|
||||
+9
-74
@@ -191,7 +191,8 @@ vm_run_global (void)
|
||||
ecma_make_object_value (glob_obj_p),
|
||||
lex_env_p,
|
||||
false,
|
||||
NULL);
|
||||
NULL,
|
||||
0);
|
||||
|
||||
if (ecma_is_completion_value_return (completion))
|
||||
{
|
||||
@@ -251,7 +252,8 @@ vm_run_eval (ecma_compiled_code_t *bytecode_data_p, /**< byte-code data */
|
||||
this_binding,
|
||||
lex_env_p,
|
||||
true,
|
||||
NULL);
|
||||
NULL,
|
||||
0);
|
||||
|
||||
if (ecma_is_completion_value_return (completion))
|
||||
{
|
||||
@@ -1302,8 +1304,8 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
stack_top_p -= right_value;
|
||||
|
||||
last_completion_value = opfunc_construct_n (stack_top_p[-1],
|
||||
(uint8_t) right_value,
|
||||
stack_top_p);
|
||||
stack_top_p,
|
||||
right_value);
|
||||
|
||||
/* Free registers. */
|
||||
for (uint32_t i = 0; i < right_value; i++)
|
||||
@@ -2407,75 +2409,8 @@ vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data heade
|
||||
ecma_value_t this_binding_value, /**< value of 'ThisBinding' */
|
||||
ecma_object_t *lex_env_p, /**< lexical environment to use */
|
||||
bool is_eval_code, /**< is the code is eval code (ECMA-262 v5, 10.1) */
|
||||
ecma_collection_header_t *arg_collection_p) /**< arguments list */
|
||||
{
|
||||
lit_cpointer_t *literal_p;
|
||||
vm_frame_ctx_t frame_ctx;
|
||||
uint32_t call_stack_size;
|
||||
|
||||
if (bytecode_header_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
|
||||
{
|
||||
cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_header_p;
|
||||
uint8_t *byte_p = ((uint8_t *) bytecode_header_p + sizeof (cbc_uint16_arguments_t));
|
||||
|
||||
literal_p = (lit_cpointer_t *) byte_p;
|
||||
frame_ctx.literal_start_p = literal_p;
|
||||
literal_p += args_p->literal_end;
|
||||
call_stack_size = (uint32_t) (args_p->register_end + args_p->stack_limit);
|
||||
}
|
||||
else
|
||||
{
|
||||
cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_header_p;
|
||||
uint8_t *byte_p = ((uint8_t *) bytecode_header_p + sizeof (cbc_uint8_arguments_t));
|
||||
|
||||
literal_p = (lit_cpointer_t *) byte_p;
|
||||
frame_ctx.literal_start_p = literal_p;
|
||||
literal_p += args_p->literal_end;
|
||||
call_stack_size = (uint32_t) (args_p->register_end + args_p->stack_limit);
|
||||
}
|
||||
|
||||
frame_ctx.bytecode_header_p = bytecode_header_p;
|
||||
frame_ctx.byte_code_p = (uint8_t *) literal_p;
|
||||
frame_ctx.byte_code_start_p = (uint8_t *) literal_p;
|
||||
frame_ctx.lex_env_p = lex_env_p;
|
||||
frame_ctx.this_binding = this_binding_value;
|
||||
frame_ctx.context_depth = 0;
|
||||
frame_ctx.is_eval_code = is_eval_code;
|
||||
|
||||
ecma_length_t arg_list_len = 0;
|
||||
|
||||
if (arg_collection_p == NULL)
|
||||
{
|
||||
arg_list_len = 1;
|
||||
}
|
||||
|
||||
if (call_stack_size <= INLINE_STACK_SIZE)
|
||||
{
|
||||
return vm_run_with_inline_stack (&frame_ctx,
|
||||
arg_collection_p,
|
||||
arg_list_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
return vm_run_with_alloca (&frame_ctx,
|
||||
arg_collection_p,
|
||||
arg_list_len,
|
||||
call_stack_size);
|
||||
}
|
||||
} /* vm_run */
|
||||
|
||||
/**
|
||||
* Run the code.
|
||||
*
|
||||
* @return completion value
|
||||
*/
|
||||
ecma_completion_value_t
|
||||
vm_run_array_args (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data header */
|
||||
ecma_value_t this_binding_value, /**< value of 'ThisBinding' */
|
||||
ecma_object_t *lex_env_p, /**< lexical environment to use */
|
||||
bool is_eval_code, /**< is the code is eval code (ECMA-262 v5, 10.1) */
|
||||
const ecma_value_t *arg_list_p, /**< arguments list */
|
||||
ecma_length_t arg_list_len) /**< length of arguments list */
|
||||
const ecma_value_t *arg_list_p, /**< arguments list */
|
||||
ecma_length_t arg_list_len) /**< length of arguments list */
|
||||
{
|
||||
lit_cpointer_t *literal_p;
|
||||
vm_frame_ctx_t frame_ctx;
|
||||
@@ -2525,7 +2460,7 @@ vm_run_array_args (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code
|
||||
arg_list_len,
|
||||
call_stack_size);
|
||||
}
|
||||
} /* vm_run_array_args */
|
||||
} /* vm_run */
|
||||
|
||||
/**
|
||||
* Check whether currently executed code is strict mode code
|
||||
|
||||
+3
-8
@@ -190,18 +190,13 @@ extern jerry_completion_code_t vm_run_global (void);
|
||||
extern ecma_completion_value_t vm_run_eval (ecma_compiled_code_t *, bool);
|
||||
|
||||
extern ecma_completion_value_t vm_loop (vm_frame_ctx_t *);
|
||||
|
||||
extern ecma_completion_value_t vm_run (const ecma_compiled_code_t *,
|
||||
ecma_value_t,
|
||||
ecma_object_t *,
|
||||
bool,
|
||||
ecma_collection_header_t *);
|
||||
|
||||
extern ecma_completion_value_t vm_run_array_args (const ecma_compiled_code_t *,
|
||||
ecma_value_t,
|
||||
ecma_object_t *,
|
||||
bool,
|
||||
const ecma_value_t *,
|
||||
ecma_length_t);
|
||||
const ecma_value_t *,
|
||||
ecma_length_t);
|
||||
|
||||
extern bool vm_is_strict_mode (void);
|
||||
extern bool vm_is_direct_eval_form_call (void);
|
||||
|
||||
Reference in New Issue
Block a user