From 57f645c18c5b06b15440fa7a27e9b3e3029d0dee Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Thu, 22 Jan 2015 18:43:17 +0300 Subject: [PATCH] Passing ecma_value_t arguments by const reference instead of by value. --- src/globals.h | 5 +- src/libcoreint/interpreter.c | 2 +- src/libcoreint/interpreter.h | 4 +- src/libcoreint/opcodes-ecma-arithmetics.c | 4 +- src/libcoreint/opcodes-ecma-bitwise.c | 4 +- src/libcoreint/opcodes-ecma-support.h | 2 +- src/libcoreint/opcodes-helpers-variables.c | 2 +- .../ecma-builtin-array-prototype.c | 2 +- src/libecmabuiltins/ecma-builtin-array.c | 12 +-- .../ecma-builtin-boolean-prototype.c | 4 +- src/libecmabuiltins/ecma-builtin-boolean.c | 6 +- .../ecma-builtin-compact-profile-error.c | 6 +- .../ecma-builtin-error-prototype.c | 2 +- src/libecmabuiltins/ecma-builtin-error.c | 6 +- src/libecmabuiltins/ecma-builtin-evalerror.c | 6 +- .../ecma-builtin-function-prototype.c | 20 ++-- src/libecmabuiltins/ecma-builtin-function.c | 6 +- src/libecmabuiltins/ecma-builtin-global.c | 41 +++++---- ...a-builtin-internal-routines-template.inc.h | 15 +-- src/libecmabuiltins/ecma-builtin-math.c | 76 +++++++-------- .../ecma-builtin-number-prototype.c | 20 ++-- src/libecmabuiltins/ecma-builtin-number.c | 6 +- .../ecma-builtin-object-prototype.c | 18 ++-- src/libecmabuiltins/ecma-builtin-object.c | 68 +++++++------- src/libecmabuiltins/ecma-builtin-rangeerror.c | 6 +- .../ecma-builtin-referenceerror.c | 6 +- .../ecma-builtin-string-prototype.c | 74 +++++++-------- src/libecmabuiltins/ecma-builtin-string.c | 8 +- .../ecma-builtin-syntaxerror.c | 6 +- .../ecma-builtin-type-error-thrower.c | 6 +- src/libecmabuiltins/ecma-builtin-typeerror.c | 6 +- src/libecmabuiltins/ecma-builtin-urierror.c | 6 +- src/libecmabuiltins/ecma-builtins-internal.h | 10 +- src/libecmabuiltins/ecma-builtins.c | 14 +-- src/libecmabuiltins/ecma-builtins.h | 8 +- src/libecmaobjects/ecma-gc.c | 2 +- src/libecmaobjects/ecma-gc.h | 4 +- src/libecmaobjects/ecma-helpers-value.c | 92 ++++++++++--------- src/libecmaobjects/ecma-helpers.c | 12 ++- src/libecmaobjects/ecma-helpers.h | 48 +++++----- src/libecmaoperations/ecma-array-object.c | 13 +-- src/libecmaoperations/ecma-array-object.h | 4 +- src/libecmaoperations/ecma-boolean-object.c | 4 +- src/libecmaoperations/ecma-boolean-object.h | 4 +- src/libecmaoperations/ecma-comparison.c | 18 ++-- src/libecmaoperations/ecma-comparison.h | 12 ++- src/libecmaoperations/ecma-conversion.c | 20 ++-- src/libecmaoperations/ecma-conversion.h | 20 ++-- src/libecmaoperations/ecma-function-object.c | 14 +-- src/libecmaoperations/ecma-function-object.h | 14 +-- src/libecmaoperations/ecma-get-put-value.c | 4 +- src/libecmaoperations/ecma-lex-env.c | 6 +- src/libecmaoperations/ecma-lex-env.h | 10 +- src/libecmaoperations/ecma-number-object.c | 4 +- src/libecmaoperations/ecma-number-object.h | 4 +- .../ecma-objects-arguments.c | 2 +- .../ecma-objects-arguments.h | 4 +- src/libecmaoperations/ecma-objects-general.c | 4 +- src/libecmaoperations/ecma-objects-general.h | 6 +- src/libecmaoperations/ecma-objects.c | 4 +- src/libecmaoperations/ecma-objects.h | 6 +- src/libecmaoperations/ecma-reference.c | 2 +- src/libecmaoperations/ecma-reference.h | 4 +- src/libecmaoperations/ecma-string-object.c | 4 +- src/libecmaoperations/ecma-string-object.h | 4 +- 65 files changed, 426 insertions(+), 410 deletions(-) diff --git a/src/globals.h b/src/globals.h index 157b6a883..6cd9c72a0 100644 --- a/src/globals.h +++ b/src/globals.h @@ -16,11 +16,11 @@ #ifndef JERRY_GLOBALS_H #define JERRY_GLOBALS_H +#include #include #include #include #include -#include /** * Types @@ -126,7 +126,8 @@ extern void __noreturn jerry_unimplemented (const char *comment, const char *fil /** * Mark for unreachable points and unimplemented cases */ -extern void jerry_ref_unused_variables (int unused_variables_follow, ...); +template extern void jerry_ref_unused_variables (values... unused); + #if !defined (JERRY_NDEBUG) && defined (__TARGET_HOST) #define JERRY_UNREACHABLE() \ do \ diff --git a/src/libcoreint/interpreter.c b/src/libcoreint/interpreter.c index 1f6960637..065a29330 100644 --- a/src/libcoreint/interpreter.c +++ b/src/libcoreint/interpreter.c @@ -454,7 +454,7 @@ run_int_loop (int_data_t *int_data) ecma_completion_value_t run_int_from_pos (opcode_counter_t start_pos, - ecma_value_t this_binding_value, + const ecma_value_t& this_binding_value, ecma_object_t *lex_env_p, bool is_strict, bool is_eval_code) diff --git a/src/libcoreint/interpreter.h b/src/libcoreint/interpreter.h index 228d2f05c..7363b7f0d 100644 --- a/src/libcoreint/interpreter.h +++ b/src/libcoreint/interpreter.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ void init_int (const opcode_t* program_p, bool dump_mem_stats); bool run_int (void); ecma_completion_value_t run_int_loop (int_data_t *int_data); ecma_completion_value_t run_int_from_pos (opcode_counter_t start_pos, - ecma_value_t this_binding_value, + const ecma_value_t& this_binding_value, ecma_object_t *lex_env_p, bool is_strict, bool is_eval_code); diff --git a/src/libcoreint/opcodes-ecma-arithmetics.c b/src/libcoreint/opcodes-ecma-arithmetics.c index 5aa546f66..7b6e61810 100644 --- a/src/libcoreint/opcodes-ecma-arithmetics.c +++ b/src/libcoreint/opcodes-ecma-arithmetics.c @@ -45,8 +45,8 @@ static ecma_completion_value_t do_number_arithmetic (int_data_t *int_data, /**< interpreter context */ idx_t dst_var_idx, /**< destination variable identifier */ number_arithmetic_op op, /**< number arithmetic operation */ - ecma_value_t left_value, /**< left value */ - ecma_value_t right_value) /** right value */ + const ecma_value_t& left_value, /**< left value */ + const ecma_value_t& right_value) /** right value */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); diff --git a/src/libcoreint/opcodes-ecma-bitwise.c b/src/libcoreint/opcodes-ecma-bitwise.c index 7d2c51c15..3509bca2a 100644 --- a/src/libcoreint/opcodes-ecma-bitwise.c +++ b/src/libcoreint/opcodes-ecma-bitwise.c @@ -45,8 +45,8 @@ static ecma_completion_value_t do_number_bitwise_logic (int_data_t *int_data, /**< interpreter context */ idx_t dst_var_idx, /**< destination variable identifier */ number_bitwise_logic_op op, /**< number bitwise logic operation */ - ecma_value_t left_value, /**< left value */ - ecma_value_t right_value) /** right value */ + const ecma_value_t& left_value, /**< left value */ + const ecma_value_t& right_value) /** right value */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); diff --git a/src/libcoreint/opcodes-ecma-support.h b/src/libcoreint/opcodes-ecma-support.h index 30c920425..672914a37 100644 --- a/src/libcoreint/opcodes-ecma-support.h +++ b/src/libcoreint/opcodes-ecma-support.h @@ -35,7 +35,7 @@ bool is_reg_variable (int_data_t *int_data, idx_t var_idx); ecma_completion_value_t get_variable_value (int_data_t *, idx_t, bool); -ecma_completion_value_t set_variable_value (int_data_t *, opcode_counter_t, idx_t, ecma_value_t); +ecma_completion_value_t set_variable_value (int_data_t *, opcode_counter_t, idx_t, const ecma_value_t&); ecma_completion_value_t fill_varg_list (int_data_t *int_data, ecma_length_t args_number, ecma_value_t args_values[], diff --git a/src/libcoreint/opcodes-helpers-variables.c b/src/libcoreint/opcodes-helpers-variables.c index e020cc5d1..b82889e77 100644 --- a/src/libcoreint/opcodes-helpers-variables.c +++ b/src/libcoreint/opcodes-helpers-variables.c @@ -127,7 +127,7 @@ ecma_completion_value_t set_variable_value (int_data_t *int_data, /**< interpreter context */ opcode_counter_t lit_oc, /**< opcode counter for literal */ idx_t var_idx, /**< variable identifier */ - ecma_value_t value) /**< value to set */ + const ecma_value_t& value) /**< value to set */ { ecma_completion_value_t ret_value; diff --git a/src/libecmabuiltins/ecma-builtin-array-prototype.c b/src/libecmabuiltins/ecma-builtin-array-prototype.c index be9ad3501..85231375c 100644 --- a/src/libecmabuiltins/ecma-builtin-array-prototype.c +++ b/src/libecmabuiltins/ecma-builtin-array-prototype.c @@ -54,7 +54,7 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_array_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_array_prototype_object_to_string (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_array_prototype_object_to_string */ diff --git a/src/libecmabuiltins/ecma-builtin-array.c b/src/libecmabuiltins/ecma-builtin-array.c index d315fd6b8..29525d4c1 100644 --- a/src/libecmabuiltins/ecma-builtin-array.c +++ b/src/libecmabuiltins/ecma-builtin-array.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,8 +54,8 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_array_object_is_array (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< first argument */ +ecma_builtin_array_object_is_array (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< first argument */ { ecma_simple_value_t is_array = ECMA_SIMPLE_VALUE_FALSE; @@ -81,8 +81,8 @@ ecma_builtin_array_object_is_array (ecma_value_t this_arg __unused, /**< 'this' * @return completion-value */ ecma_completion_value_t -ecma_builtin_array_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ - ecma_length_t arguments_list_len) /**< number of arguments */ +ecma_builtin_array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ + ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -95,7 +95,7 @@ ecma_builtin_array_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments * @return completion-value */ ecma_completion_value_t -ecma_builtin_array_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-boolean-prototype.c b/src/libecmabuiltins/ecma-builtin-boolean-prototype.c index 0e6b5e814..744525cc7 100644 --- a/src/libecmabuiltins/ecma-builtin-boolean-prototype.c +++ b/src/libecmabuiltins/ecma-builtin-boolean-prototype.c @@ -54,7 +54,7 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_boolean_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_boolean_prototype_object_to_string (const ecma_value_t& this_arg) /**< this argument */ { ecma_completion_value_t ret_value; @@ -92,7 +92,7 @@ ecma_builtin_boolean_prototype_object_to_string (ecma_value_t this_arg) /**< thi * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_boolean_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_boolean_prototype_object_value_of (const ecma_value_t& this_arg) /**< this argument */ { if (ecma_is_value_boolean (this_arg)) { diff --git a/src/libecmabuiltins/ecma-builtin-boolean.c b/src/libecmabuiltins/ecma-builtin-boolean.c index 9280bef89..c3c65c6a9 100644 --- a/src/libecmabuiltins/ecma-builtin-boolean.c +++ b/src/libecmabuiltins/ecma-builtin-boolean.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_boolean_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_boolean_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -75,7 +75,7 @@ ecma_builtin_boolean_dispatch_call (ecma_value_t *arguments_list_p, /**< argumen * @return completion-value */ ecma_completion_value_t -ecma_builtin_boolean_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_boolean_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-compact-profile-error.c b/src/libecmabuiltins/ecma-builtin-compact-profile-error.c index 6fa8ddb18..bb1375840 100644 --- a/src/libecmabuiltins/ecma-builtin-compact-profile-error.c +++ b/src/libecmabuiltins/ecma-builtin-compact-profile-error.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_compact_profile_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_compact_profile_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -63,7 +63,7 @@ ecma_builtin_compact_profile_error_dispatch_call (ecma_value_t *arguments_list_p * @return completion-value */ ecma_completion_value_t -ecma_builtin_compact_profile_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_compact_profile_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-error-prototype.c b/src/libecmabuiltins/ecma-builtin-error-prototype.c index 6f57d4f1d..346d8d011 100644 --- a/src/libecmabuiltins/ecma-builtin-error-prototype.c +++ b/src/libecmabuiltins/ecma-builtin-error-prototype.c @@ -54,7 +54,7 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_error_prototype_object_to_string (const ecma_value_t& this_arg) /**< this argument */ { ecma_completion_value_t ret_value; diff --git a/src/libecmabuiltins/ecma-builtin-error.c b/src/libecmabuiltins/ecma-builtin-error.c index 7567adb18..031c206dc 100644 --- a/src/libecmabuiltins/ecma-builtin-error.c +++ b/src/libecmabuiltins/ecma-builtin-error.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -86,7 +86,7 @@ ecma_builtin_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments * @return completion-value */ ecma_completion_value_t -ecma_builtin_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { return ecma_builtin_error_dispatch_call (arguments_list_p, arguments_list_len); diff --git a/src/libecmabuiltins/ecma-builtin-evalerror.c b/src/libecmabuiltins/ecma-builtin-evalerror.c index 2663ad549..278a9c91f 100644 --- a/src/libecmabuiltins/ecma-builtin-evalerror.c +++ b/src/libecmabuiltins/ecma-builtin-evalerror.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_eval_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_eval_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -86,7 +86,7 @@ ecma_builtin_eval_error_dispatch_call (ecma_value_t *arguments_list_p, /**< argu * @return completion-value */ ecma_completion_value_t -ecma_builtin_eval_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { return ecma_builtin_eval_error_dispatch_call (arguments_list_p, arguments_list_len); diff --git a/src/libecmabuiltins/ecma-builtin-function-prototype.c b/src/libecmabuiltins/ecma-builtin-function-prototype.c index 85ab21692..1f6ede75e 100644 --- a/src/libecmabuiltins/ecma-builtin-function-prototype.c +++ b/src/libecmabuiltins/ecma-builtin-function-prototype.c @@ -52,7 +52,7 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_function_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_function_prototype_object_to_string (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_function_prototype_object_to_string */ @@ -67,9 +67,9 @@ ecma_builtin_function_prototype_object_to_string (ecma_value_t this_arg) /**< th * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_function_prototype_object_apply (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg1, /**< first argument */ - ecma_value_t arg2) /**< second argument */ +ecma_builtin_function_prototype_object_apply (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg1, /**< first argument */ + const ecma_value_t& arg2) /**< second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_function_prototype_object_apply */ @@ -84,8 +84,8 @@ ecma_builtin_function_prototype_object_apply (ecma_value_t this_arg, /**< this a * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_function_prototype_object_call (ecma_value_t this_arg, /**< this argument */ - ecma_value_t *arguments_list_p, /**< list of arguments */ +ecma_builtin_function_prototype_object_call (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t* arguments_list_p, /**< list of arguments */ ecma_length_t arguments_number) /**< number of arguments */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arguments_list_p, arguments_number); @@ -101,8 +101,8 @@ ecma_builtin_function_prototype_object_call (ecma_value_t this_arg, /**< this ar * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_function_prototype_object_bind (ecma_value_t this_arg, /**< this argument */ - ecma_value_t *arguments_list_p, /**< list of arguments */ +ecma_builtin_function_prototype_object_bind (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t* arguments_list_p, /**< list of arguments */ ecma_length_t arguments_number) /**< number of arguments */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arguments_list_p, arguments_number); @@ -114,7 +114,7 @@ ecma_builtin_function_prototype_object_bind (ecma_value_t this_arg, /**< this ar * @return completion-value */ ecma_completion_value_t -ecma_builtin_function_prototype_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_function_prototype_dispatch_call (const ecma_value_t* arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -128,7 +128,7 @@ ecma_builtin_function_prototype_dispatch_call (ecma_value_t *arguments_list_p, / * @return completion-value */ ecma_completion_value_t -ecma_builtin_function_prototype_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_function_prototype_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-function.c b/src/libecmabuiltins/ecma-builtin-function.c index b2e64c54d..8e57e67d4 100644 --- a/src/libecmabuiltins/ecma-builtin-function.c +++ b/src/libecmabuiltins/ecma-builtin-function.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_function_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_function_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -62,7 +62,7 @@ ecma_builtin_function_dispatch_call (ecma_value_t *arguments_list_p, /**< argume * @return completion-value */ ecma_completion_value_t -ecma_builtin_function_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_function_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-global.c b/src/libecmabuiltins/ecma-builtin-global.c index 2b7968406..594d54175 100644 --- a/src/libecmabuiltins/ecma-builtin-global.c +++ b/src/libecmabuiltins/ecma-builtin-global.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,8 +49,8 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */ - ecma_value_t x) /**< routine's first argument */ +ecma_builtin_global_object_eval (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& x) /**< routine's first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, x); } /* ecma_builtin_global_object_eval */ @@ -65,9 +65,9 @@ ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_parse_int (ecma_value_t this_arg, /**< this argument */ - ecma_value_t string, /**< routine's first argument */ - ecma_value_t radix) /**< routine's second argument */ +ecma_builtin_global_object_parse_int (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& string, /**< routine's first argument */ + const ecma_value_t& radix) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, string, radix); } /* ecma_builtin_global_object_parse_int */ @@ -82,8 +82,8 @@ ecma_builtin_global_object_parse_int (ecma_value_t this_arg, /**< this argument * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_parse_float (ecma_value_t this_arg, /**< this argument */ - ecma_value_t string) /**< routine's first argument */ +ecma_builtin_global_object_parse_float (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& string) /**< routine's first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, string); } /* ecma_builtin_global_object_parse_float */ @@ -98,8 +98,8 @@ ecma_builtin_global_object_parse_float (ecma_value_t this_arg, /**< this argumen * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_is_nan (ecma_value_t this_arg __unused, /**< this argument */ - ecma_value_t arg) /**< routine's first argument */ +ecma_builtin_global_object_is_nan (const ecma_value_t& this_arg __unused, /**< this argument */ + const ecma_value_t& arg) /**< routine's first argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -125,8 +125,8 @@ ecma_builtin_global_object_is_nan (ecma_value_t this_arg __unused, /**< this arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_is_finite (ecma_value_t this_arg __unused, /**< this argument */ - ecma_value_t arg) /**< routine's first argument */ +ecma_builtin_global_object_is_finite (const ecma_value_t& this_arg __unused, /**< this argument */ + const ecma_value_t& arg) /**< routine's first argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -153,8 +153,8 @@ ecma_builtin_global_object_is_finite (ecma_value_t this_arg __unused, /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_decode_uri (ecma_value_t this_arg, /**< this argument */ - ecma_value_t encoded_uri) /**< routine's first argument */ +ecma_builtin_global_object_decode_uri (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& encoded_uri) /**< routine's first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, encoded_uri); } /* ecma_builtin_global_object_decode_uri */ @@ -169,8 +169,9 @@ ecma_builtin_global_object_decode_uri (ecma_value_t this_arg, /**< this argument * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_decode_uri_component (ecma_value_t this_arg, /**< this argument */ - ecma_value_t encoded_uri_component) /**< routine's first argument */ +ecma_builtin_global_object_decode_uri_component (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& encoded_uri_component) /**< routine's + * first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, encoded_uri_component); } /* ecma_builtin_global_object_decode_uri_component */ @@ -185,8 +186,8 @@ ecma_builtin_global_object_decode_uri_component (ecma_value_t this_arg, /**< thi * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_encode_uri (ecma_value_t this_arg, /**< this argument */ - ecma_value_t uri) /**< routine's first argument */ +ecma_builtin_global_object_encode_uri (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& uri) /**< routine's first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, uri); } /* ecma_builtin_global_object_encode_uri */ @@ -201,8 +202,8 @@ ecma_builtin_global_object_encode_uri (ecma_value_t this_arg, /**< this argument * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_global_object_encode_uri_component (ecma_value_t this_arg, /**< this argument */ - ecma_value_t uri_component) /**< routine's first argument */ +ecma_builtin_global_object_encode_uri_component (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& uri_component) /**< routine's first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, uri_component); } /* ecma_builtin_global_object_encode_uri_component */ diff --git a/src/libecmabuiltins/ecma-builtin-internal-routines-template.inc.h b/src/libecmabuiltins/ecma-builtin-internal-routines-template.inc.h index 1b0361623..286d702cf 100644 --- a/src/libecmabuiltins/ecma-builtin-internal-routines-template.inc.h +++ b/src/libecmabuiltins/ecma-builtin-internal-routines-template.inc.h @@ -32,12 +32,13 @@ #define DISPATCH_ROUTINE_ROUTINE_NAME(builtin_underscored_id) \ PASTE (PASTE (ecma_builtin_, builtin_underscored_id), _dispatch_routine) -#define ROUTINE_ARG(n) , ecma_value_t arg ## n -#define ROUTINE_ARG_LIST_0 ecma_value_t this_arg +#define ROUTINE_ARG(n) , const ecma_value_t& arg ## n +#define ROUTINE_ARG_LIST_0 const ecma_value_t& this_arg #define ROUTINE_ARG_LIST_1 ROUTINE_ARG_LIST_0 ROUTINE_ARG(1) #define ROUTINE_ARG_LIST_2 ROUTINE_ARG_LIST_1 ROUTINE_ARG(2) #define ROUTINE_ARG_LIST_3 ROUTINE_ARG_LIST_2 ROUTINE_ARG(3) -#define ROUTINE_ARG_LIST_NON_FIXED ROUTINE_ARG_LIST_0, ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len +#define ROUTINE_ARG_LIST_NON_FIXED ROUTINE_ARG_LIST_0, \ + const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len #define ROUTINE(name, c_function_name, args_number, length_prop_value) \ static ecma_completion_value_t c_function_name (ROUTINE_ARG_LIST_ ## args_number); #include BUILTIN_INC_HEADER_NAME @@ -275,10 +276,10 @@ ecma_completion_value_t DISPATCH_ROUTINE_ROUTINE_NAME (BUILTIN_UNDERSCORED_ID) (ecma_magic_string_id_t builtin_routine_id, /**< built-in's routine's name */ - ecma_value_t this_arg_value, /**< 'this' argument - value */ - ecma_value_t arguments_list [], /**< list of arguments - passed to routine */ + const ecma_value_t& this_arg_value, /**< 'this' argument + value */ + const ecma_value_t arguments_list [], /**< list of arguments + passed to routine */ ecma_length_t arguments_number) /**< length of arguments' list */ { diff --git a/src/libecmabuiltins/ecma-builtin-math.c b/src/libecmabuiltins/ecma-builtin-math.c index b86a8e368..701508822 100644 --- a/src/libecmabuiltins/ecma-builtin-math.c +++ b/src/libecmabuiltins/ecma-builtin-math.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,8 +55,8 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_abs (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_abs (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -90,8 +90,8 @@ ecma_builtin_math_object_abs (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_acos (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_acos (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_math_object_acos */ @@ -106,8 +106,8 @@ ecma_builtin_math_object_acos (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_asin (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_asin (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_math_object_asin */ @@ -122,8 +122,8 @@ ecma_builtin_math_object_asin (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_atan (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_atan (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_math_object_atan */ @@ -138,9 +138,9 @@ ecma_builtin_math_object_atan (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_atan2 (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg1, /**< first routine's argument */ - ecma_value_t arg2) /**< second routine's argument */ +ecma_builtin_math_object_atan2 (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg1, /**< first routine's argument */ + const ecma_value_t& arg2) /**< second routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_math_object_atan2 */ @@ -155,8 +155,8 @@ ecma_builtin_math_object_atan2 (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_ceil (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_ceil (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_math_object_ceil */ @@ -171,8 +171,8 @@ ecma_builtin_math_object_ceil (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_cos (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_cos (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -239,8 +239,8 @@ ecma_builtin_math_object_cos (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_exp (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_exp (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -289,8 +289,8 @@ ecma_builtin_math_object_exp (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_floor (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_floor (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_math_object_floor */ @@ -305,8 +305,8 @@ ecma_builtin_math_object_floor (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_log (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_log (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -352,8 +352,8 @@ ecma_builtin_math_object_log (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_max (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t args[], /**< arguments list */ +ecma_builtin_math_object_max (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -439,8 +439,8 @@ ecma_builtin_math_object_max (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_min (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t args[], /**< arguments list */ +ecma_builtin_math_object_min (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -526,9 +526,9 @@ ecma_builtin_math_object_min (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_pow (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg1, /**< first routine's argument */ - ecma_value_t arg2) /**< second routine's argument */ +ecma_builtin_math_object_pow (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg1, /**< first routine's argument */ + const ecma_value_t& arg2) /**< second routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -760,7 +760,7 @@ ecma_builtin_math_object_pow (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_random (ecma_value_t this_arg __unused) /**< 'this' argument */ +ecma_builtin_math_object_random (const ecma_value_t& this_arg __unused) /**< 'this' argument */ { /* Implementation of George Marsaglia's XorShift random number generator */ TODO (/* Check for license issues */); @@ -801,8 +801,8 @@ ecma_builtin_math_object_random (ecma_value_t this_arg __unused) /**< 'this' arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_round (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_round (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -855,8 +855,8 @@ ecma_builtin_math_object_round (ecma_value_t this_arg __unused, /**< 'this' argu * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_sin (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_sin (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -923,8 +923,8 @@ ecma_builtin_math_object_sin (ecma_value_t this_arg __unused, /**< 'this' argume * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_sqrt (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_sqrt (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -973,8 +973,8 @@ ecma_builtin_math_object_sqrt (ecma_value_t this_arg __unused, /**< 'this' argum * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_math_object_tan (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_math_object_tan (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_math_object_tan */ diff --git a/src/libecmabuiltins/ecma-builtin-number-prototype.c b/src/libecmabuiltins/ecma-builtin-number-prototype.c index 59d8cf6f3..e5d15a178 100644 --- a/src/libecmabuiltins/ecma-builtin-number-prototype.c +++ b/src/libecmabuiltins/ecma-builtin-number-prototype.c @@ -54,8 +54,8 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this argument */ - ecma_value_t* arguments_list_p, /**< arguments list */ +ecma_builtin_number_prototype_object_to_string (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t* arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { ecma_number_t this_arg_number; @@ -112,7 +112,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_number_prototype_object_to_locale_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_number_prototype_object_to_locale_string (const ecma_value_t& this_arg) /**< this argument */ { return ecma_builtin_number_prototype_object_to_string (this_arg, NULL, 0); } /* ecma_builtin_number_prototype_object_to_locale_string */ @@ -127,7 +127,7 @@ ecma_builtin_number_prototype_object_to_locale_string (ecma_value_t this_arg) /* * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_number_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_number_prototype_object_value_of (const ecma_value_t& this_arg) /**< this argument */ { if (ecma_is_value_number (this_arg)) { @@ -167,8 +167,8 @@ ecma_builtin_number_prototype_object_value_of (ecma_value_t this_arg) /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_number_prototype_object_to_fixed (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_number_prototype_object_to_fixed (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_number_prototype_object_to_fixed */ @@ -183,8 +183,8 @@ ecma_builtin_number_prototype_object_to_fixed (ecma_value_t this_arg, /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_number_prototype_object_to_exponential (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_number_prototype_object_to_exponential (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_number_prototype_object_to_exponential */ @@ -199,8 +199,8 @@ ecma_builtin_number_prototype_object_to_exponential (ecma_value_t this_arg, /**< * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_number_prototype_object_to_precision (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_number_prototype_object_to_precision (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_number_prototype_object_to_precision */ diff --git a/src/libecmabuiltins/ecma-builtin-number.c b/src/libecmabuiltins/ecma-builtin-number.c index 6746291ef..edb63e393 100644 --- a/src/libecmabuiltins/ecma-builtin-number.c +++ b/src/libecmabuiltins/ecma-builtin-number.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_number_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_number_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -78,7 +78,7 @@ ecma_builtin_number_dispatch_call (ecma_value_t *arguments_list_p, /**< argument * @return completion-value */ ecma_completion_value_t -ecma_builtin_number_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-object-prototype.c b/src/libecmabuiltins/ecma-builtin-object-prototype.c index 913b9439c..0cede0049 100644 --- a/src/libecmabuiltins/ecma-builtin-object-prototype.c +++ b/src/libecmabuiltins/ecma-builtin-object-prototype.c @@ -52,7 +52,7 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_object_prototype_object_to_string (const ecma_value_t& this_arg) /**< this argument */ { ecma_magic_string_id_t type_string; @@ -140,7 +140,7 @@ ecma_builtin_object_prototype_object_to_string (ecma_value_t this_arg) /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_object_prototype_object_value_of (const ecma_value_t& this_arg) /**< this argument */ { return ecma_op_to_object (this_arg); } /* ecma_builtin_object_prototype_object_value_of */ @@ -155,7 +155,7 @@ ecma_builtin_object_prototype_object_value_of (ecma_value_t this_arg) /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_prototype_object_to_locale_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_object_prototype_object_to_locale_string (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_object_prototype_object_to_locale_string */ @@ -170,8 +170,8 @@ ecma_builtin_object_prototype_object_to_locale_string (ecma_value_t this_arg) /* * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_prototype_object_has_own_property (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< first argument */ +ecma_builtin_object_prototype_object_has_own_property (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_prototype_object_has_own_property */ @@ -186,8 +186,8 @@ ecma_builtin_object_prototype_object_has_own_property (ecma_value_t this_arg, /* * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_prototype_object_is_prototype_of (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's first argument */ +ecma_builtin_object_prototype_object_is_prototype_of (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_prototype_object_is_prototype_of */ @@ -202,8 +202,8 @@ ecma_builtin_object_prototype_object_is_prototype_of (ecma_value_t this_arg, /** * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_prototype_object_property_is_enumerable (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's first argument */ +ecma_builtin_object_prototype_object_property_is_enumerable (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's first argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_prototype_object_property_is_enumerable */ diff --git a/src/libecmabuiltins/ecma-builtin-object.c b/src/libecmabuiltins/ecma-builtin-object.c index 15a07ceb7..6e8e271c0 100644 --- a/src/libecmabuiltins/ecma-builtin-object.c +++ b/src/libecmabuiltins/ecma-builtin-object.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_object_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_object_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -75,7 +75,7 @@ ecma_builtin_object_dispatch_call (ecma_value_t *arguments_list_p, /**< argument * @return completion-value */ ecma_completion_value_t -ecma_builtin_object_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -111,8 +111,8 @@ ecma_builtin_object_dispatch_construct (ecma_value_t *arguments_list_p, /**< arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_get_prototype_of (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_get_prototype_of */ @@ -127,8 +127,8 @@ ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg, /**< 'this' * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_get_own_property_names (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_get_own_property_names */ @@ -143,8 +143,8 @@ ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg, /**< ' * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_seal (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_seal (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_seal */ @@ -159,8 +159,8 @@ ecma_builtin_object_object_seal (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_freeze (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_freeze (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_freeze */ @@ -175,8 +175,8 @@ ecma_builtin_object_object_freeze (ecma_value_t this_arg, /**< 'this' argument * * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_prevent_extensions (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_prevent_extensions (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_prevent_extensions */ @@ -191,8 +191,8 @@ ecma_builtin_object_object_prevent_extensions (ecma_value_t this_arg, /**< 'this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_is_sealed (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_is_sealed (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_is_sealed */ @@ -207,8 +207,8 @@ ecma_builtin_object_object_is_sealed (ecma_value_t this_arg, /**< 'this' argumen * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_is_frozen (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_is_frozen (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_is_frozen */ @@ -223,8 +223,8 @@ ecma_builtin_object_object_is_frozen (ecma_value_t this_arg, /**< 'this' argumen * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_is_extensible (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_is_extensible (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_is_extensible */ @@ -239,8 +239,8 @@ ecma_builtin_object_object_is_extensible (ecma_value_t this_arg, /**< 'this' arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_keys (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_object_object_keys (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_object_object_keys */ @@ -255,9 +255,9 @@ ecma_builtin_object_object_keys (ecma_value_t this_arg, /**< 'this' argument */ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_get_own_property_descriptor (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_object_object_get_own_property_descriptor (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_object_object_get_own_property_descriptor */ @@ -272,9 +272,9 @@ ecma_builtin_object_object_get_own_property_descriptor (ecma_value_t this_arg, / * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_create (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_object_object_create (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_object_object_create */ @@ -289,9 +289,9 @@ ecma_builtin_object_object_create (ecma_value_t this_arg, /**< 'this' argument * * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_define_properties (ecma_value_t this_arg, /**< 'this' argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_object_object_define_properties (const ecma_value_t& this_arg, /**< 'this' argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_object_object_define_properties */ @@ -306,10 +306,10 @@ ecma_builtin_object_object_define_properties (ecma_value_t this_arg, /**< 'this' * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_object_object_define_property (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2, /**< routine's second argument */ - ecma_value_t arg3) /**< routine's third argument */ +ecma_builtin_object_object_define_property (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2, /**< routine's second argument */ + const ecma_value_t& arg3) /**< routine's third argument */ { ecma_completion_value_t ret_value; diff --git a/src/libecmabuiltins/ecma-builtin-rangeerror.c b/src/libecmabuiltins/ecma-builtin-rangeerror.c index 9842bc3e2..36a452c97 100644 --- a/src/libecmabuiltins/ecma-builtin-rangeerror.c +++ b/src/libecmabuiltins/ecma-builtin-rangeerror.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_range_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_range_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -86,7 +86,7 @@ ecma_builtin_range_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arg * @return completion-value */ ecma_completion_value_t -ecma_builtin_range_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { return ecma_builtin_range_error_dispatch_call (arguments_list_p, arguments_list_len); diff --git a/src/libecmabuiltins/ecma-builtin-referenceerror.c b/src/libecmabuiltins/ecma-builtin-referenceerror.c index 64a424504..dfc017d2d 100644 --- a/src/libecmabuiltins/ecma-builtin-referenceerror.c +++ b/src/libecmabuiltins/ecma-builtin-referenceerror.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_reference_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_reference_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -86,7 +86,7 @@ ecma_builtin_reference_error_dispatch_call (ecma_value_t *arguments_list_p, /**< * @return completion-value */ ecma_completion_value_t -ecma_builtin_reference_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { return ecma_builtin_reference_error_dispatch_call (arguments_list_p, arguments_list_len); diff --git a/src/libecmabuiltins/ecma-builtin-string-prototype.c b/src/libecmabuiltins/ecma-builtin-string-prototype.c index 578b5d263..385114f22 100644 --- a/src/libecmabuiltins/ecma-builtin-string-prototype.c +++ b/src/libecmabuiltins/ecma-builtin-string-prototype.c @@ -54,7 +54,7 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_string_prototype_object_to_string (const ecma_value_t& this_arg) /**< this argument */ { if (ecma_is_value_string (this_arg)) { @@ -93,7 +93,7 @@ ecma_builtin_string_prototype_object_to_string (ecma_value_t this_arg) /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_string_prototype_object_value_of (const ecma_value_t& this_arg) /**< this argument */ { return ecma_builtin_string_prototype_object_to_string (this_arg); } /* ecma_builtin_string_prototype_object_value_of */ @@ -108,8 +108,8 @@ ecma_builtin_string_prototype_object_value_of (ecma_value_t this_arg) /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_char_at (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_string_prototype_object_char_at (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_string_prototype_object_char_at */ @@ -124,8 +124,8 @@ ecma_builtin_string_prototype_object_char_at (ecma_value_t this_arg, /**< this a * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_char_code_at (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_string_prototype_object_char_code_at (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_string_prototype_object_char_code_at */ @@ -140,8 +140,8 @@ ecma_builtin_string_prototype_object_char_code_at (ecma_value_t this_arg, /**< t * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_concat (ecma_value_t this_arg, /**< this argument */ - ecma_value_t* argument_list_p, /**< arguments list */ +ecma_builtin_string_prototype_object_concat (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t* argument_list_p, /**< arguments list */ ecma_length_t arguments_number) /**< number of arguments */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, argument_list_p, arguments_number); @@ -157,9 +157,9 @@ ecma_builtin_string_prototype_object_concat (ecma_value_t this_arg, /**< this ar * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_index_of (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_string_prototype_object_index_of (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_string_prototype_object_index_of */ @@ -174,9 +174,9 @@ ecma_builtin_string_prototype_object_index_of (ecma_value_t this_arg, /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_last_index_of (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_string_prototype_object_last_index_of (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_string_prototype_object_last_index_of */ @@ -191,8 +191,8 @@ ecma_builtin_string_prototype_object_last_index_of (ecma_value_t this_arg, /**< * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_locale_compare (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_string_prototype_object_locale_compare (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_string_prototype_object_locale_compare */ @@ -207,8 +207,8 @@ ecma_builtin_string_prototype_object_locale_compare (ecma_value_t this_arg, /**< * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_match (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_string_prototype_object_match (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_string_prototype_object_match */ @@ -223,9 +223,9 @@ ecma_builtin_string_prototype_object_match (ecma_value_t this_arg, /**< this arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_replace (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_string_prototype_object_replace (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_string_prototype_object_replace */ @@ -240,8 +240,8 @@ ecma_builtin_string_prototype_object_replace (ecma_value_t this_arg, /**< this a * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_search (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg) /**< routine's argument */ +ecma_builtin_string_prototype_object_search (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg) /**< routine's argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg); } /* ecma_builtin_string_prototype_object_search */ @@ -256,9 +256,9 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_arg, /**< this ar * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_slice (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_string_prototype_object_slice (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_string_prototype_object_slice */ @@ -273,9 +273,9 @@ ecma_builtin_string_prototype_object_slice (ecma_value_t this_arg, /**< this arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_string_prototype_object_split (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_string_prototype_object_split */ @@ -290,9 +290,9 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_substring (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg1, /**< routine's first argument */ - ecma_value_t arg2) /**< routine's second argument */ +ecma_builtin_string_prototype_object_substring (const ecma_value_t& this_arg, /**< this argument */ + const ecma_value_t& arg1, /**< routine's first argument */ + const ecma_value_t& arg2) /**< routine's second argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg1, arg2); } /* ecma_builtin_string_prototype_object_substring */ @@ -307,7 +307,7 @@ ecma_builtin_string_prototype_object_substring (ecma_value_t this_arg, /**< this * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_to_lower_case (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_string_prototype_object_to_lower_case (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_string_prototype_object_to_lower_case */ @@ -322,7 +322,7 @@ ecma_builtin_string_prototype_object_to_lower_case (ecma_value_t this_arg) /**< * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_to_locale_lower_case (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_string_prototype_object_to_locale_lower_case (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_string_prototype_object_to_locale_lower_case */ @@ -337,7 +337,7 @@ ecma_builtin_string_prototype_object_to_locale_lower_case (ecma_value_t this_arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_to_upper_case (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_string_prototype_object_to_upper_case (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_string_prototype_object_to_upper_case */ @@ -352,7 +352,7 @@ ecma_builtin_string_prototype_object_to_upper_case (ecma_value_t this_arg) /**< * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_to_locale_upper_case (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_string_prototype_object_to_locale_upper_case (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_string_prototype_object_to_locale_upper_case */ @@ -367,7 +367,7 @@ ecma_builtin_string_prototype_object_to_locale_upper_case (ecma_value_t this_arg * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_prototype_object_trim (ecma_value_t this_arg) /**< this argument */ +ecma_builtin_string_prototype_object_trim (const ecma_value_t& this_arg) /**< this argument */ { ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg); } /* ecma_builtin_string_prototype_object_trim */ diff --git a/src/libecmabuiltins/ecma-builtin-string.c b/src/libecmabuiltins/ecma-builtin-string.c index e17878f81..f8bb6d387 100644 --- a/src/libecmabuiltins/ecma-builtin-string.c +++ b/src/libecmabuiltins/ecma-builtin-string.c @@ -54,8 +54,8 @@ * Returned value must be freed with ecma_free_completion_value. */ static ecma_completion_value_t -ecma_builtin_string_object_from_char_code (ecma_value_t this_arg __unused, /**< 'this' argument */ - ecma_value_t args[], /**< arguments list */ +ecma_builtin_string_object_from_char_code (const ecma_value_t& this_arg __unused, /**< 'this' argument */ + const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); @@ -113,7 +113,7 @@ ecma_builtin_string_object_from_char_code (ecma_value_t this_arg __unused, /**< * @return completion-value */ ecma_completion_value_t -ecma_builtin_string_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -141,7 +141,7 @@ ecma_builtin_string_dispatch_call (ecma_value_t *arguments_list_p, /**< argument * @return completion-value */ ecma_completion_value_t -ecma_builtin_string_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_string_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-syntaxerror.c b/src/libecmabuiltins/ecma-builtin-syntaxerror.c index da58b52e5..c3b8cd32d 100644 --- a/src/libecmabuiltins/ecma-builtin-syntaxerror.c +++ b/src/libecmabuiltins/ecma-builtin-syntaxerror.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_syntax_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_syntax_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -86,7 +86,7 @@ ecma_builtin_syntax_error_dispatch_call (ecma_value_t *arguments_list_p, /**< ar * @return completion-value */ ecma_completion_value_t -ecma_builtin_syntax_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { return ecma_builtin_syntax_error_dispatch_call (arguments_list_p, arguments_list_len); diff --git a/src/libecmabuiltins/ecma-builtin-type-error-thrower.c b/src/libecmabuiltins/ecma-builtin-type-error-thrower.c index cbbc571d2..c9b05213f 100644 --- a/src/libecmabuiltins/ecma-builtin-type-error-thrower.c +++ b/src/libecmabuiltins/ecma-builtin-type-error-thrower.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_type_error_thrower_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_type_error_thrower_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -68,7 +68,7 @@ ecma_builtin_type_error_thrower_dispatch_call (ecma_value_t *arguments_list_p, / * @return completion-value */ ecma_completion_value_t -ecma_builtin_type_error_thrower_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_type_error_thrower_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); diff --git a/src/libecmabuiltins/ecma-builtin-typeerror.c b/src/libecmabuiltins/ecma-builtin-typeerror.c index 35ce91993..26d29f463 100644 --- a/src/libecmabuiltins/ecma-builtin-typeerror.c +++ b/src/libecmabuiltins/ecma-builtin-typeerror.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_type_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_type_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -86,7 +86,7 @@ ecma_builtin_type_error_dispatch_call (ecma_value_t *arguments_list_p, /**< argu * @return completion-value */ ecma_completion_value_t -ecma_builtin_type_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { return ecma_builtin_type_error_dispatch_call (arguments_list_p, arguments_list_len); diff --git a/src/libecmabuiltins/ecma-builtin-urierror.c b/src/libecmabuiltins/ecma-builtin-urierror.c index 18b96386e..6f83bd592 100644 --- a/src/libecmabuiltins/ecma-builtin-urierror.c +++ b/src/libecmabuiltins/ecma-builtin-urierror.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * @return completion-value */ ecma_completion_value_t -ecma_builtin_uri_error_dispatch_call (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_uri_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); @@ -86,7 +86,7 @@ ecma_builtin_uri_error_dispatch_call (ecma_value_t *arguments_list_p, /**< argum * @return completion-value */ ecma_completion_value_t -ecma_builtin_uri_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< arguments list */ +ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< number of arguments */ { return ecma_builtin_uri_error_dispatch_call (arguments_list_p, arguments_list_len); diff --git a/src/libecmabuiltins/ecma-builtins-internal.h b/src/libecmabuiltins/ecma-builtins-internal.h index e95e8d8b9..bb5e18000 100644 --- a/src/libecmabuiltins/ecma-builtins-internal.h +++ b/src/libecmabuiltins/ecma-builtins-internal.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,15 +62,15 @@ ecma_builtin_bin_search_for_magic_string_id_in_array (const ecma_magic_string_id is_extensible, \ lowercase_name) \ extern ecma_completion_value_t \ -ecma_builtin_ ## lowercase_name ## _dispatch_call (ecma_value_t *arguments_list_p, \ +ecma_builtin_ ## lowercase_name ## _dispatch_call (const ecma_value_t *arguments_list_p, \ ecma_length_t arguments_list_len); \ extern ecma_completion_value_t \ -ecma_builtin_ ## lowercase_name ## _dispatch_construct (ecma_value_t *arguments_list_p, \ +ecma_builtin_ ## lowercase_name ## _dispatch_construct (const ecma_value_t *arguments_list_p, \ ecma_length_t arguments_list_len); \ extern ecma_completion_value_t \ ecma_builtin_ ## lowercase_name ## _dispatch_routine (ecma_magic_string_id_t builtin_routine_id, \ - ecma_value_t this_arg_value, \ - ecma_value_t arguments_list [], \ + const ecma_value_t& this_arg_value, \ + const ecma_value_t arguments_list [], \ ecma_length_t arguments_number); \ extern ecma_property_t* \ ecma_builtin_ ## lowercase_name ## _try_to_instantiate_property (ecma_object_t *obj_p, \ diff --git a/src/libecmabuiltins/ecma-builtins.c b/src/libecmabuiltins/ecma-builtins.c index 37c1f6850..17800e30a 100644 --- a/src/libecmabuiltins/ecma-builtins.c +++ b/src/libecmabuiltins/ecma-builtins.c @@ -34,8 +34,8 @@ static ecma_completion_value_t ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id, ecma_magic_string_id_t builtin_routine_id, - ecma_value_t this_arg_value, - ecma_value_t arguments_list [], + const ecma_value_t& this_arg_value, + const ecma_value_t arguments_list [], ecma_length_t arguments_number); static void ecma_instantiate_builtin (ecma_builtin_id_t id); @@ -360,8 +360,8 @@ ecma_builtin_make_function_object_for_routine (ecma_builtin_id_t builtin_id, /** */ ecma_completion_value_t ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */ - ecma_value_t this_arg_value, /**< 'this' argument value */ - ecma_value_t *arguments_list_p, /**< arguments list */ + const ecma_value_t& this_arg_value, /**< 'this' argument value */ + const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< length of the arguments list */ { JERRY_ASSERT (ecma_get_object_is_builtin (obj_p)); @@ -450,7 +450,7 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */ */ ecma_completion_value_t ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */ - ecma_value_t *arguments_list_p, /**< arguments list */ + const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< length of the arguments list */ { JERRY_ASSERT (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION); @@ -514,8 +514,8 @@ static ecma_completion_value_t ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id, /**< built-in object' identifier */ ecma_magic_string_id_t builtin_routine_id, /**< name of the built-in object's routine property */ - ecma_value_t this_arg_value, /**< 'this' argument value */ - ecma_value_t arguments_list [], /**< list of arguments passed to routine */ + const ecma_value_t& this_arg_value, /**< 'this' argument value */ + const ecma_value_t arguments_list [], /**< list of arguments passed to routine */ ecma_length_t arguments_number) /**< length of arguments' list */ { switch (builtin_object_id) diff --git a/src/libecmabuiltins/ecma-builtins.h b/src/libecmabuiltins/ecma-builtins.h index af92fac10..554f6afbc 100644 --- a/src/libecmabuiltins/ecma-builtins.h +++ b/src/libecmabuiltins/ecma-builtins.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,12 +40,12 @@ extern void ecma_finalize_builtins (void); extern ecma_completion_value_t ecma_builtin_dispatch_call (ecma_object_t *obj_p, - ecma_value_t this_arg, - ecma_value_t *arguments_list_p, + const ecma_value_t& this_arg, + const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); extern ecma_completion_value_t ecma_builtin_dispatch_construct (ecma_object_t *obj_p, - ecma_value_t *arguments_list_p, + const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); extern ecma_property_t* ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, diff --git a/src/libecmaobjects/ecma-gc.c b/src/libecmaobjects/ecma-gc.c index e0ce4bdab..2689e5b36 100644 --- a/src/libecmaobjects/ecma-gc.c +++ b/src/libecmaobjects/ecma-gc.c @@ -239,7 +239,7 @@ ecma_deref_object (ecma_object_t *object_p) /**< object */ */ void ecma_gc_update_may_ref_younger_object_flag_by_value (ecma_object_t *obj_p, /**< object */ - ecma_value_t value) /**< value */ + const ecma_value_t& value) /**< value */ { if (!ecma_is_value_object (value)) { diff --git a/src/libecmaobjects/ecma-gc.h b/src/libecmaobjects/ecma-gc.h index c1a054c95..42f547dc3 100644 --- a/src/libecmaobjects/ecma-gc.h +++ b/src/libecmaobjects/ecma-gc.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ extern void ecma_gc_init (void); extern void ecma_init_gc_info (ecma_object_t *object_p); extern void ecma_ref_object (ecma_object_t *object_p); extern void ecma_deref_object (ecma_object_t *object_p); -extern void ecma_gc_update_may_ref_younger_object_flag_by_value (ecma_object_t *obj_p, ecma_value_t value); +extern void ecma_gc_update_may_ref_younger_object_flag_by_value (ecma_object_t *obj_p, const ecma_value_t& value); extern void ecma_gc_update_may_ref_younger_object_flag_by_object (ecma_object_t *obj_p, ecma_object_t *ref_obj_p); extern void ecma_gc_run (ecma_gc_gen_t max_gen_to_collect); extern void ecma_try_to_give_back_some_memory (mem_try_give_memory_back_severity_t severity); diff --git a/src/libecmaobjects/ecma-helpers-value.c b/src/libecmaobjects/ecma-helpers-value.c index 4683455c2..ac136a8ad 100644 --- a/src/libecmaobjects/ecma-helpers-value.c +++ b/src/libecmaobjects/ecma-helpers-value.c @@ -34,8 +34,8 @@ JERRY_STATIC_ASSERT (sizeof (ecma_value_t) * JERRY_BITSINBYTE == ECMA_VALUE_SIZE * * @return type field */ -static ecma_type_t __attribute_const__ -ecma_get_value_type_field (ecma_value_t value) /**< ecma-value */ +static ecma_type_t __attribute_pure__ +ecma_get_value_type_field (const ecma_value_t& value) /**< ecma-value */ { return (ecma_type_t) jrt_extract_bit_field (value, ECMA_VALUE_TYPE_POS, @@ -47,8 +47,8 @@ ecma_get_value_type_field (ecma_value_t value) /**< ecma-value */ * * @return value field */ -static uintptr_t __attribute_const__ -ecma_get_value_value_field (ecma_value_t value) /**< ecma-value */ +static uintptr_t __attribute_pure__ +ecma_get_value_value_field (const ecma_value_t& value) /**< ecma-value */ { return (uintptr_t) jrt_extract_bit_field (value, ECMA_VALUE_VALUE_POS, @@ -60,8 +60,8 @@ ecma_get_value_value_field (ecma_value_t value) /**< ecma-value */ * * @return ecma-value with updated field */ -static ecma_value_t __attribute_const__ -ecma_set_value_type_field (ecma_value_t value, /**< ecma-value to set field in */ +static ecma_value_t __attribute_pure__ +ecma_set_value_type_field (const ecma_value_t& value, /**< ecma-value to set field in */ ecma_type_t type_field) /**< new field value */ { return (ecma_value_t) jrt_set_bit_field_value (value, @@ -75,8 +75,8 @@ ecma_set_value_type_field (ecma_value_t value, /**< ecma-value to set field in * * * @return ecma-value with updated field */ -static ecma_value_t __attribute_const__ -ecma_set_value_value_field (ecma_value_t value, /**< ecma-value to set field in */ +static ecma_value_t __attribute_pure__ +ecma_set_value_value_field (const ecma_value_t& value, /**< ecma-value to set field in */ uintptr_t value_field) /**< new field value */ { return (ecma_value_t) jrt_set_bit_field_value (value, @@ -91,8 +91,8 @@ ecma_set_value_value_field (ecma_value_t value, /**< ecma-value to set field in * @return true - if the value contains implementation-defined empty simple value, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_empty (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_empty (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_SIMPLE && ecma_get_value_value_field (value) == ECMA_SIMPLE_VALUE_EMPTY); @@ -104,8 +104,8 @@ ecma_is_value_empty (ecma_value_t value) /**< ecma-value */ * @return true - if the value contains ecma-undefined simple value, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_undefined (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_undefined (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_SIMPLE && ecma_get_value_value_field (value) == ECMA_SIMPLE_VALUE_UNDEFINED); @@ -117,8 +117,8 @@ ecma_is_value_undefined (ecma_value_t value) /**< ecma-value */ * @return true - if the value contains ecma-null simple value, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_null (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_null (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_SIMPLE && ecma_get_value_value_field (value) == ECMA_SIMPLE_VALUE_NULL); @@ -130,8 +130,8 @@ ecma_is_value_null (ecma_value_t value) /**< ecma-value */ * @return true - if the value contains ecma-true or ecma-false simple values, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_boolean (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_boolean (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_SIMPLE && (ecma_get_value_value_field (value) == ECMA_SIMPLE_VALUE_TRUE @@ -147,8 +147,8 @@ ecma_is_value_boolean (ecma_value_t value) /**< ecma-value */ * @return true - if the value contains ecma-true simple value, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_true (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_true (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_SIMPLE && ecma_get_value_value_field (value) == ECMA_SIMPLE_VALUE_TRUE); @@ -160,8 +160,8 @@ ecma_is_value_true (ecma_value_t value) /**< ecma-value */ * @return true - if the value contains ecma-number value, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_number (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_number (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_NUMBER); } /* ecma_is_value_number */ @@ -172,8 +172,8 @@ ecma_is_value_number (ecma_value_t value) /**< ecma-value */ * @return true - if the value contains ecma-string value, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_string (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_string (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_STRING); } /* ecma_is_value_string */ @@ -184,8 +184,8 @@ ecma_is_value_string (ecma_value_t value) /**< ecma-value */ * @return true - if the value contains object value, * false - otherwise. */ -inline bool __attribute_const__ __attribute_always_inline__ -ecma_is_value_object (ecma_value_t value) /**< ecma-value */ +inline bool __attribute_pure__ __attribute_always_inline__ +ecma_is_value_object (const ecma_value_t& value) /**< ecma-value */ { return (ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT); } /* ecma_is_value_object */ @@ -195,7 +195,7 @@ ecma_is_value_object (ecma_value_t value) /**< ecma-value */ * script-visible types, i.e.: undefined, null, boolean, number, string, object. */ void -ecma_check_value_type_is_spec_defined (ecma_value_t value) /**< ecma-value */ +ecma_check_value_type_is_spec_defined (const ecma_value_t& value) /**< ecma-value */ { JERRY_ASSERT (ecma_is_value_undefined (value) || ecma_is_value_null (value) @@ -281,8 +281,8 @@ ecma_make_object_value (ecma_object_t* object_p) /**< object to reference in val * * @return the pointer */ -ecma_number_t* __attribute_const__ -ecma_get_number_from_value (ecma_value_t value) /**< ecma-value */ +ecma_number_t* __attribute_pure__ +ecma_get_number_from_value (const ecma_value_t& value) /**< ecma-value */ { JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_NUMBER); @@ -295,8 +295,8 @@ ecma_get_number_from_value (ecma_value_t value) /**< ecma-value */ * * @return the pointer */ -ecma_string_t* __attribute_const__ -ecma_get_string_from_value (ecma_value_t value) /**< ecma-value */ +ecma_string_t* __attribute_pure__ +ecma_get_string_from_value (const ecma_value_t& value) /**< ecma-value */ { JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_STRING); @@ -309,8 +309,8 @@ ecma_get_string_from_value (ecma_value_t value) /**< ecma-value */ * * @return the pointer */ -ecma_object_t* __attribute_const__ -ecma_get_object_from_value (ecma_value_t value) /**< ecma-value */ +ecma_object_t* __attribute_pure__ +ecma_get_object_from_value (const ecma_value_t& value) /**< ecma-value */ { JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT); @@ -340,7 +340,7 @@ ecma_get_object_from_value (ecma_value_t value) /**< ecma-value */ * @return See note. */ ecma_value_t -ecma_copy_value (const ecma_value_t value, /**< ecma-value */ +ecma_copy_value (const ecma_value_t& value, /**< ecma-value */ bool do_ref_if_object) /**< if the value is object value, increment reference counter of the object */ { @@ -397,7 +397,7 @@ ecma_copy_value (const ecma_value_t value, /**< ecma-value */ * Free the ecma-value */ void -ecma_free_value (ecma_value_t value, /**< value description */ +ecma_free_value (ecma_value_t& value, /**< value description */ bool do_deref_if_object) /**< if the value is object value, decrement reference counter of the object */ { @@ -495,10 +495,10 @@ ecma_set_completion_value_type_field (ecma_completion_value_t completion_value, * * @return completion value with updated field */ -static ecma_completion_value_t __attribute_const__ +static ecma_completion_value_t __attribute_pure__ ecma_set_completion_value_value_field (ecma_completion_value_t completion_value, /**< completion value * to set field in */ - ecma_value_t value_field) /**< new field value */ + const ecma_value_t& value_field) /**< new field value */ { return (ecma_completion_value_t) jrt_set_bit_field_value (completion_value, value_field, @@ -531,9 +531,9 @@ ecma_set_completion_value_label_descriptor (ecma_completion_value_t completion_v * * @return completion value */ -inline ecma_completion_value_t __attribute_const__ __attribute_always_inline__ +inline ecma_completion_value_t __attribute_pure__ __attribute_always_inline__ ecma_make_completion_value (ecma_completion_type_t type, /**< type */ - ecma_value_t value) /**< value */ + const ecma_value_t& value) /**< value */ { const bool is_type_ok = (type == ECMA_COMPLETION_TYPE_NORMAL #ifdef CONFIG_ECMA_EXCEPTION_SUPPORT @@ -606,8 +606,8 @@ ecma_make_simple_completion_value (ecma_simple_value_t simple_value) /**< simple * * @return completion value */ -inline ecma_completion_value_t __attribute_const__ __attribute_always_inline__ -ecma_make_normal_completion_value (ecma_value_t value) /**< value */ +inline ecma_completion_value_t __attribute_pure__ __attribute_always_inline__ +ecma_make_normal_completion_value (const ecma_value_t& value) /**< value */ { return ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL, value); } /* ecma_make_normal_completion_value */ @@ -617,8 +617,8 @@ ecma_make_normal_completion_value (ecma_value_t value) /**< value */ * * @return completion value */ -inline ecma_completion_value_t __attribute_const__ __attribute_always_inline__ -ecma_make_throw_completion_value (ecma_value_t value) /**< value */ +inline ecma_completion_value_t __attribute_pure__ __attribute_always_inline__ +ecma_make_throw_completion_value (const ecma_value_t& value) /**< value */ { #ifdef CONFIG_ECMA_EXCEPTION_SUPPORT return ecma_make_completion_value (ECMA_COMPLETION_TYPE_THROW, value); @@ -662,8 +662,8 @@ ecma_make_empty_completion_value (void) * * @return completion value */ -inline ecma_completion_value_t __attribute_const__ __attribute_always_inline__ -ecma_make_return_completion_value (ecma_value_t value) /**< value */ +inline ecma_completion_value_t __attribute_pure__ __attribute_always_inline__ +ecma_make_return_completion_value (const ecma_value_t& value) /**< value */ { return ecma_make_completion_value (ECMA_COMPLETION_TYPE_RETURN, value); } /* ecma_make_return_completion_value */ @@ -787,12 +787,14 @@ ecma_free_completion_value (ecma_completion_value_t completion_value) /**< compl #endif /* CONFIG_ECMA_EXCEPTION_SUPPORT */ case ECMA_COMPLETION_TYPE_RETURN: { - ecma_free_value (ecma_get_completion_value_value_field (completion_value), true); + ecma_value_t v = ecma_get_completion_value_value_field (completion_value); + ecma_free_value (v, true); break; } case ECMA_COMPLETION_TYPE_EXIT: { - JERRY_ASSERT(ecma_get_value_type_field (ecma_get_completion_value_value (completion_value)) == ECMA_TYPE_SIMPLE); + ecma_value_t v = ecma_get_completion_value_value_field (completion_value); + JERRY_ASSERT(ecma_get_value_type_field (v) == ECMA_TYPE_SIMPLE); break; } case ECMA_COMPLETION_TYPE_CONTINUE: diff --git a/src/libecmaobjects/ecma-helpers.c b/src/libecmaobjects/ecma-helpers.c index 73cc80e06..f5b39df87 100644 --- a/src/libecmaobjects/ecma-helpers.c +++ b/src/libecmaobjects/ecma-helpers.c @@ -689,7 +689,9 @@ ecma_free_named_data_property (ecma_object_t *object_p, /**< object the property ecma_deref_ecma_string (ECMA_GET_NON_NULL_POINTER (ecma_string_t, property_p->u.named_data_property.name_p)); - ecma_free_value (property_p->u.named_data_property.value, false); + + ecma_value_t v = property_p->u.named_data_property.value; + ecma_free_value (v, false); ecma_dealloc_property (property_p); } /* ecma_free_named_data_property */ @@ -875,7 +877,7 @@ ecma_get_named_data_property_value (const ecma_property_t *prop_p) /**< property */ void ecma_set_named_data_property_value (ecma_property_t *prop_p, /**< property */ - ecma_value_t value) /**< value to set */ + const ecma_value_t& value) /**< value to set */ { JERRY_ASSERT (prop_p->type == ECMA_PROPERTY_NAMEDDATA); @@ -894,7 +896,7 @@ ecma_set_named_data_property_value (ecma_property_t *prop_p, /**< property */ void ecma_named_data_property_assign_value (ecma_object_t *obj_p, /**< object */ ecma_property_t *prop_p, /**< property */ - ecma_value_t value) /**< value to assign */ + const ecma_value_t& value) /**< value to assign */ { JERRY_ASSERT (prop_p->type == ECMA_PROPERTY_NAMEDDATA); #ifndef JERRY_NDEBUG @@ -922,7 +924,9 @@ ecma_named_data_property_assign_value (ecma_object_t *obj_p, /**< object */ } else { - ecma_free_value (ecma_get_named_data_property_value (prop_p), false); + ecma_value_t v = ecma_get_named_data_property_value (prop_p); + ecma_free_value (v, false); + prop_p->u.named_data_property.value = ecma_copy_value (value, false); ecma_gc_update_may_ref_younger_object_flag_by_value (obj_p, prop_p->u.named_data_property.value); diff --git a/src/libecmaobjects/ecma-helpers.h b/src/libecmaobjects/ecma-helpers.h index f7cf435eb..d80ff291a 100644 --- a/src/libecmaobjects/ecma-helpers.h +++ b/src/libecmaobjects/ecma-helpers.h @@ -61,39 +61,39 @@ & ((1u << ECMA_POINTER_FIELD_WIDTH) - 1))) /* ecma-helpers-value.c */ -extern bool ecma_is_value_empty (ecma_value_t value); -extern bool ecma_is_value_undefined (ecma_value_t value); -extern bool ecma_is_value_null (ecma_value_t value); -extern bool ecma_is_value_boolean (ecma_value_t value); -extern bool ecma_is_value_true (ecma_value_t value); +extern bool ecma_is_value_empty (const ecma_value_t& value); +extern bool ecma_is_value_undefined (const ecma_value_t& value); +extern bool ecma_is_value_null (const ecma_value_t& value); +extern bool ecma_is_value_boolean (const ecma_value_t& value); +extern bool ecma_is_value_true (const ecma_value_t& value); -extern bool ecma_is_value_number (ecma_value_t value); -extern bool ecma_is_value_string (ecma_value_t value); -extern bool ecma_is_value_object (ecma_value_t value); +extern bool ecma_is_value_number (const ecma_value_t& value); +extern bool ecma_is_value_string (const ecma_value_t& value); +extern bool ecma_is_value_object (const ecma_value_t& value); -extern void ecma_check_value_type_is_spec_defined (ecma_value_t value); +extern void ecma_check_value_type_is_spec_defined (const ecma_value_t& value); extern ecma_value_t ecma_make_simple_value (ecma_simple_value_t value); extern ecma_value_t ecma_make_number_value (ecma_number_t* num_p); extern ecma_value_t ecma_make_string_value (ecma_string_t* ecma_string_p); extern ecma_value_t ecma_make_object_value (ecma_object_t* object_p); -extern ecma_number_t* __attribute_const__ ecma_get_number_from_value (ecma_value_t value); -extern ecma_string_t* __attribute_const__ ecma_get_string_from_value (ecma_value_t value); -extern ecma_object_t* __attribute_const__ ecma_get_object_from_value (ecma_value_t value); -extern ecma_value_t ecma_copy_value (const ecma_value_t value, bool do_ref_if_object); -extern void ecma_free_value (const ecma_value_t value, bool do_deref_if_object); +extern ecma_number_t* __attribute_pure__ ecma_get_number_from_value (const ecma_value_t& value); +extern ecma_string_t* __attribute_pure__ ecma_get_string_from_value (const ecma_value_t& value); +extern ecma_object_t* __attribute_pure__ ecma_get_object_from_value (const ecma_value_t& value); +extern ecma_value_t ecma_copy_value (const ecma_value_t& value, bool do_ref_if_object); +extern void ecma_free_value (ecma_value_t& value, bool do_deref_if_object); extern ecma_completion_value_t ecma_make_completion_value (ecma_completion_type_t type, - ecma_value_t value); + const ecma_value_t& value); extern ecma_completion_value_t ecma_make_label_completion_value (ecma_completion_type_t type, uint8_t depth_level, uint16_t offset); extern ecma_completion_value_t ecma_make_simple_completion_value (ecma_simple_value_t simple_value); -extern ecma_completion_value_t ecma_make_normal_completion_value (ecma_value_t value); -extern ecma_completion_value_t ecma_make_throw_completion_value (ecma_value_t value); +extern ecma_completion_value_t ecma_make_normal_completion_value (const ecma_value_t& value); +extern ecma_completion_value_t ecma_make_throw_completion_value (const ecma_value_t& value); extern ecma_completion_value_t ecma_make_throw_obj_completion_value (ecma_object_t *exception_p); extern ecma_completion_value_t ecma_make_empty_completion_value (void); -extern ecma_completion_value_t ecma_make_return_completion_value (ecma_value_t value); +extern ecma_completion_value_t ecma_make_return_completion_value (const ecma_value_t& value); extern ecma_completion_value_t ecma_make_exit_completion_value (bool is_successful); extern ecma_completion_value_t ecma_make_meta_completion_value (void); extern ecma_value_t ecma_get_completion_value_value (ecma_completion_value_t completion_value); @@ -196,7 +196,7 @@ extern ecma_number_t ecma_number_exp (ecma_number_t num); /* ecma-helpers-values-collection.c */ -extern ecma_collection_header_t *ecma_new_values_collection (ecma_value_t values_buffer[], +extern ecma_collection_header_t *ecma_new_values_collection (const ecma_value_t values_buffer[], ecma_length_t values_number, bool do_ref_if_object); extern void ecma_free_values_collection (ecma_collection_header_t* header_p, bool do_deref_if_object); @@ -211,9 +211,9 @@ typedef struct ecma_collection_header_t *header_p; /**< collection header */ uint16_t next_chunk_cp; /**< compressed pointer to next chunk */ ecma_length_t current_index; /**< index of current element */ - ecma_value_t *current_value_p; /**< pointer to current element */ - ecma_value_t *current_chunk_beg_p; /**< pointer to beginning of current chunk's data */ - ecma_value_t *current_chunk_end_p; /**< pointer to place right after the end of current chunk's data */ + const ecma_value_t *current_value_p; /**< pointer to current element */ + const ecma_value_t *current_chunk_beg_p; /**< pointer to beginning of current chunk's data */ + const ecma_value_t *current_chunk_end_p; /**< pointer to place right after the end of current chunk's data */ } ecma_collection_iterator_t; extern void @@ -275,10 +275,10 @@ extern void ecma_free_property (ecma_object_t *obj_p, ecma_property_t *prop_p); extern void ecma_delete_property (ecma_object_t *obj_p, ecma_property_t *prop_p); extern ecma_value_t ecma_get_named_data_property_value (const ecma_property_t *prop_p); -extern void ecma_set_named_data_property_value (ecma_property_t *prop_p, ecma_value_t value); +extern void ecma_set_named_data_property_value (ecma_property_t *prop_p, const ecma_value_t& value); extern void ecma_named_data_property_assign_value (ecma_object_t *obj_p, ecma_property_t *prop_p, - ecma_value_t value); + const ecma_value_t& value); extern bool ecma_is_property_writable (ecma_property_t* prop_p); extern void ecma_set_property_writable_attr (ecma_property_t* prop_p, bool is_writable); diff --git a/src/libecmaoperations/ecma-array-object.c b/src/libecmaoperations/ecma-array-object.c index 2fac194db..a53c14f56 100644 --- a/src/libecmaoperations/ecma-array-object.c +++ b/src/libecmaoperations/ecma-array-object.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,8 +60,8 @@ ecma_reject (bool is_throw) /**< Throw flag */ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_create_array_object (ecma_value_t *arguments_list_p, /**< list of arguments that - are passed to Array constructor */ +ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of arguments that + are passed to Array constructor */ ecma_length_t arguments_list_len, /**< length of the arguments' list */ bool is_treat_single_arg_as_length) /**< if the value is true, arguments_list_len is 1 @@ -74,7 +74,7 @@ ecma_op_create_array_object (ecma_value_t *arguments_list_p, /**< list of argume || arguments_list_p != NULL); uint32_t length; - ecma_value_t *array_items_p; + const ecma_value_t *array_items_p; ecma_length_t array_items_count; if (is_treat_single_arg_as_length @@ -444,8 +444,9 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o ecma_number_t *num_p = ecma_alloc_number (); *num_p = ecma_number_add (ecma_uint32_to_number (index), ECMA_NUMBER_ONE); - ecma_free_value (ecma_get_named_data_property_value (len_prop_p), false); - ecma_set_named_data_property_value (len_prop_p, ecma_make_number_value (num_p)); + ecma_named_data_property_assign_value (obj_p, len_prop_p, ecma_make_number_value (num_p)); + + ecma_dealloc_number (num_p); } // f. diff --git a/src/libecmaoperations/ecma-array-object.h b/src/libecmaoperations/ecma-array-object.h index 67646f413..2566edf13 100644 --- a/src/libecmaoperations/ecma-array-object.h +++ b/src/libecmaoperations/ecma-array-object.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ */ extern ecma_completion_value_t -ecma_op_create_array_object (ecma_value_t *arguments_list_p, +ecma_op_create_array_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len, bool is_treat_single_arg_as_length); diff --git a/src/libecmaoperations/ecma-boolean-object.c b/src/libecmaoperations/ecma-boolean-object.c index c0a4a5cf6..bde3f9b1b 100644 --- a/src/libecmaoperations/ecma-boolean-object.c +++ b/src/libecmaoperations/ecma-boolean-object.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boolean constructor */ +ecma_op_create_boolean_object (const ecma_value_t& arg) /**< argument passed to the Boolean constructor */ { ecma_completion_value_t conv_to_boolean_completion = ecma_op_to_boolean (arg); diff --git a/src/libecmaoperations/ecma-boolean-object.h b/src/libecmaoperations/ecma-boolean-object.h index f2721f1b7..f3a58eb37 100644 --- a/src/libecmaoperations/ecma-boolean-object.h +++ b/src/libecmaoperations/ecma-boolean-object.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ * @{ */ -extern ecma_completion_value_t ecma_op_create_boolean_object (ecma_value_t arg); +extern ecma_completion_value_t ecma_op_create_boolean_object (const ecma_value_t& arg); /** * @} diff --git a/src/libecmaoperations/ecma-comparison.c b/src/libecmaoperations/ecma-comparison.c index 45bb9095a..18e37ce00 100644 --- a/src/libecmaoperations/ecma-comparison.c +++ b/src/libecmaoperations/ecma-comparison.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,8 +35,8 @@ * false - otherwise. */ ecma_completion_value_t -ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */ - ecma_value_t y) /**< second operand */ +ecma_op_abstract_equality_compare (const ecma_value_t& x, /**< first operand */ + const ecma_value_t& y) /**< second operand */ { const bool is_x_undefined = ecma_is_value_undefined (x); const bool is_x_null = ecma_is_value_null (x); @@ -223,8 +223,8 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */ * false - otherwise. */ bool -ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */ - ecma_value_t y) /**< second operand */ +ecma_op_strict_equality_compare (const ecma_value_t& x, /**< first operand */ + const ecma_value_t& y) /**< second operand */ { const bool is_x_undefined = ecma_is_value_undefined (x); const bool is_x_null = ecma_is_value_null (x); @@ -335,14 +335,14 @@ ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */ - ecma_value_t y, /**< second operand */ +ecma_op_abstract_relational_compare (const ecma_value_t& x, /**< first operand */ + const ecma_value_t& y, /**< second operand */ bool left_first) /**< 'LeftFirst' flag */ { ecma_completion_value_t ret_value = ecma_make_empty_completion_value (); - ecma_value_t first_converted_value = left_first ? x : y; - ecma_value_t second_converted_value = left_first ? y : x; + const ecma_value_t& first_converted_value = left_first ? x : y; + const ecma_value_t& second_converted_value = left_first ? y : x; // 1., 2. ECMA_TRY_CATCH(prim_first_converted_value, diff --git a/src/libecmaoperations/ecma-comparison.h b/src/libecmaoperations/ecma-comparison.h index 9331b61bf..eba9e1733 100644 --- a/src/libecmaoperations/ecma-comparison.h +++ b/src/libecmaoperations/ecma-comparison.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,9 +26,13 @@ * @{ */ -extern ecma_completion_value_t ecma_op_abstract_equality_compare (ecma_value_t x, ecma_value_t y); -extern bool ecma_op_strict_equality_compare (ecma_value_t x, ecma_value_t y); -extern ecma_completion_value_t ecma_op_abstract_relational_compare (ecma_value_t x, ecma_value_t y, bool left_first); +extern ecma_completion_value_t ecma_op_abstract_equality_compare (const ecma_value_t& x, + const ecma_value_t& y); +extern bool ecma_op_strict_equality_compare (const ecma_value_t& x, + const ecma_value_t& y); +extern ecma_completion_value_t ecma_op_abstract_relational_compare (const ecma_value_t& x, + const ecma_value_t& y, + bool left_first); /** * @} diff --git a/src/libecmaoperations/ecma-conversion.c b/src/libecmaoperations/ecma-conversion.c index c7362fd5e..d51318608 100644 --- a/src/libecmaoperations/ecma-conversion.c +++ b/src/libecmaoperations/ecma-conversion.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_check_object_coercible (ecma_value_t value) /**< ecma-value */ +ecma_op_check_object_coercible (const ecma_value_t& value) /**< ecma-value */ { ecma_check_value_type_is_spec_defined (value); @@ -74,8 +74,8 @@ ecma_op_check_object_coercible (ecma_value_t value) /**< ecma-value */ * false - otherwise. */ bool -ecma_op_same_value (ecma_value_t x, /**< ecma-value */ - ecma_value_t y) /**< ecma-value */ +ecma_op_same_value (const ecma_value_t& x, /**< ecma-value */ + const ecma_value_t& y) /**< ecma-value */ { const bool is_x_undefined = ecma_is_value_undefined (x); const bool is_x_null = ecma_is_value_null (x); @@ -157,7 +157,7 @@ ecma_op_same_value (ecma_value_t x, /**< ecma-value */ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_to_primitive (ecma_value_t value, /**< ecma-value */ +ecma_op_to_primitive (const ecma_value_t& value, /**< ecma-value */ ecma_preferred_type_hint_t preferred_type) /**< preferred type hint */ { ecma_check_value_type_is_spec_defined (value); @@ -185,7 +185,7 @@ ecma_op_to_primitive (ecma_value_t value, /**< ecma-value */ * However, ecma_free_completion_value may be called for it, but it is a no-op. */ ecma_completion_value_t -ecma_op_to_boolean (ecma_value_t value) /**< ecma-value */ +ecma_op_to_boolean (const ecma_value_t& value) /**< ecma-value */ { ecma_check_value_type_is_spec_defined (value); @@ -248,7 +248,7 @@ ecma_op_to_boolean (ecma_value_t value) /**< ecma-value */ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_to_number (ecma_value_t value) /**< ecma-value */ +ecma_op_to_number (const ecma_value_t& value) /**< ecma-value */ { ecma_check_value_type_is_spec_defined (value); @@ -319,7 +319,7 @@ ecma_op_to_number (ecma_value_t value) /**< ecma-value */ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_to_string (ecma_value_t value) /**< ecma-value */ +ecma_op_to_string (const ecma_value_t& value) /**< ecma-value */ { ecma_check_value_type_is_spec_defined (value); @@ -387,7 +387,7 @@ ecma_op_to_string (ecma_value_t value) /**< ecma-value */ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_to_object (ecma_value_t value) /**< ecma-value */ +ecma_op_to_object (const ecma_value_t& value) /**< ecma-value */ { ecma_check_value_type_is_spec_defined (value); @@ -557,7 +557,7 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t* src_prop_des * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */ +ecma_op_to_property_descriptor (const ecma_value_t& obj_value, /**< object value */ ecma_property_descriptor_t *out_prop_desc_p) /**< out: filled property descriptor if return value is normal empty completion value */ diff --git a/src/libecmaoperations/ecma-conversion.h b/src/libecmaoperations/ecma-conversion.h index 7cf255fd2..9ce911c51 100644 --- a/src/libecmaoperations/ecma-conversion.h +++ b/src/libecmaoperations/ecma-conversion.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,16 +37,18 @@ typedef enum ECMA_PREFERRED_TYPE_STRING /**< String */ } ecma_preferred_type_hint_t; -extern ecma_completion_value_t ecma_op_check_object_coercible (ecma_value_t value); -extern bool ecma_op_same_value (ecma_value_t x, ecma_value_t y); -extern ecma_completion_value_t ecma_op_to_primitive (ecma_value_t value, ecma_preferred_type_hint_t preferred_type); -extern ecma_completion_value_t ecma_op_to_boolean (ecma_value_t value); -extern ecma_completion_value_t ecma_op_to_number (ecma_value_t value); -extern ecma_completion_value_t ecma_op_to_string (ecma_value_t value); -extern ecma_completion_value_t ecma_op_to_object (ecma_value_t value); +extern ecma_completion_value_t ecma_op_check_object_coercible (const ecma_value_t& value); +extern bool ecma_op_same_value (const ecma_value_t& x, + const ecma_value_t& y); +extern ecma_completion_value_t ecma_op_to_primitive (const ecma_value_t& value, + ecma_preferred_type_hint_t preferred_type); +extern ecma_completion_value_t ecma_op_to_boolean (const ecma_value_t& value); +extern ecma_completion_value_t ecma_op_to_number (const ecma_value_t& value); +extern ecma_completion_value_t ecma_op_to_string (const ecma_value_t& value); +extern ecma_completion_value_t ecma_op_to_object (const ecma_value_t& value); extern ecma_object_t* ecma_op_from_property_descriptor (const ecma_property_descriptor_t* src_prop_desc_p); -extern ecma_completion_value_t ecma_op_to_property_descriptor (ecma_value_t obj_value, +extern ecma_completion_value_t ecma_op_to_property_descriptor (const ecma_value_t& obj_value, ecma_property_descriptor_t *out_prop_desc_p); /** diff --git a/src/libecmaoperations/ecma-function-object.c b/src/libecmaoperations/ecma-function-object.c index 61f4add6a..0ec2ca2ca 100644 --- a/src/libecmaoperations/ecma-function-object.c +++ b/src/libecmaoperations/ecma-function-object.c @@ -87,7 +87,7 @@ ecma_unpack_code_internal_property_value (uint32_t value, /**< packed value */ * false - otherwise. */ bool -ecma_op_is_callable (ecma_value_t value) /**< ecma-value */ +ecma_op_is_callable (const ecma_value_t& value) /**< ecma-value */ { if (!ecma_is_value_object (value)) { @@ -111,7 +111,7 @@ ecma_op_is_callable (ecma_value_t value) /**< ecma-value */ * false - otherwise. */ bool -ecma_is_constructor (ecma_value_t value) /**< ecma-value */ +ecma_is_constructor (const ecma_value_t& value) /**< ecma-value */ { if (!ecma_is_value_object (value)) { @@ -295,7 +295,7 @@ ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[], /**< f static ecma_completion_value_t ecma_function_call_setup_args_variables (ecma_object_t *func_obj_p, /**< Function object */ ecma_object_t *env_p, /**< lexical environment */ - ecma_value_t *arguments_list_p, /**< arguments list */ + const ecma_value_t *arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len, /**< length of argument list */ bool is_strict) /**< flag indicating strict mode */ { @@ -377,7 +377,7 @@ ecma_function_call_setup_args_variables (ecma_object_t *func_obj_p, /**< Functio */ ecma_completion_value_t ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object */ - ecma_value_t value) /**< argument 'V' */ + const ecma_value_t& value) /**< argument 'V' */ { JERRY_ASSERT(func_obj_p != NULL && !ecma_is_lexical_environment (func_obj_p)); @@ -457,8 +457,8 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object * */ ecma_completion_value_t ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */ - ecma_value_t this_arg_value, /**< 'this' argument's value */ - ecma_value_t* arguments_list_p, /**< arguments list */ + const ecma_value_t& this_arg_value, /**< 'this' argument's value */ + const ecma_value_t* arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< length of arguments list */ { JERRY_ASSERT(func_obj_p != NULL @@ -564,7 +564,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */ */ ecma_completion_value_t ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */ - ecma_value_t* arguments_list_p, /**< arguments list */ + const ecma_value_t* arguments_list_p, /**< arguments list */ ecma_length_t arguments_list_len) /**< length of arguments list */ { JERRY_ASSERT(func_obj_p != NULL diff --git a/src/libecmaoperations/ecma-function-object.h b/src/libecmaoperations/ecma-function-object.h index 81aa510ec..6885a48b2 100644 --- a/src/libecmaoperations/ecma-function-object.h +++ b/src/libecmaoperations/ecma-function-object.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ * @{ */ -extern bool ecma_op_is_callable (ecma_value_t value); -extern bool ecma_is_constructor (ecma_value_t value); +extern bool ecma_op_is_callable (const ecma_value_t& value); +extern bool ecma_is_constructor (const ecma_value_t& value); extern ecma_object_t* ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[], @@ -38,18 +38,18 @@ ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[], extern ecma_completion_value_t ecma_op_function_call (ecma_object_t *func_obj_p, - ecma_value_t this_arg_value, - ecma_value_t* arguments_list_p, + const ecma_value_t& this_arg_value, + const ecma_value_t* arguments_list_p, ecma_length_t arguments_list_len); extern ecma_completion_value_t ecma_op_function_construct (ecma_object_t *func_obj_p, - ecma_value_t* arguments_list_p, + const ecma_value_t* arguments_list_p, ecma_length_t arguments_list_len); extern ecma_completion_value_t ecma_op_function_has_instance (ecma_object_t *func_obj_p, - ecma_value_t value); + const ecma_value_t& value); extern ecma_completion_value_t ecma_op_function_declaration (ecma_object_t *lex_env_p, diff --git a/src/libecmaoperations/ecma-get-put-value.c b/src/libecmaoperations/ecma-get-put-value.c index 56bfafdc1..f5ae05ea7 100644 --- a/src/libecmaoperations/ecma-get-put-value.c +++ b/src/libecmaoperations/ecma-get-put-value.c @@ -133,7 +133,7 @@ ecma_completion_value_t ecma_op_put_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< reference's base (lexical environment) */ ecma_string_t *var_name_string_p, /**< variable name */ bool is_strict, /**< flag indicating strict mode */ - ecma_value_t value) /**< ECMA-value */ + const ecma_value_t& value) /**< ECMA-value */ { const bool is_unresolvable_reference = (ref_base_lex_env_p == NULL); @@ -204,7 +204,7 @@ ecma_reject_put (bool is_throw) /**< Throw flag */ */ ecma_completion_value_t ecma_op_put_value_object_base (ecma_reference_t ref, /**< ECMA-reference */ - ecma_value_t value) /**< ECMA-value */ + const ecma_value_t& value) /**< ECMA-value */ { const ecma_value_t base = ref.base; const bool is_unresolvable_reference = ecma_is_value_undefined (base); diff --git a/src/libecmaoperations/ecma-lex-env.c b/src/libecmaoperations/ecma-lex-env.c index 5b3fa5895..c51bba6b5 100644 --- a/src/libecmaoperations/ecma-lex-env.c +++ b/src/libecmaoperations/ecma-lex-env.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -135,7 +135,7 @@ ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environme ecma_completion_value_t ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment */ ecma_string_t *name_p, /**< argument N */ - ecma_value_t value, /**< argument V */ + const ecma_value_t& value, /**< argument V */ bool is_strict) /**< argument S */ { JERRY_ASSERT(lex_env_p != NULL @@ -408,7 +408,7 @@ ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environ void ecma_op_initialize_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environment */ ecma_string_t *name_p, /**< argument N */ - ecma_value_t value) /**< argument V */ + const ecma_value_t& value) /**< argument V */ { JERRY_ASSERT(lex_env_p != NULL && ecma_is_lexical_environment (lex_env_p)); diff --git a/src/libecmaoperations/ecma-lex-env.h b/src/libecmaoperations/ecma-lex-env.h index 9aa06f944..7ff7178eb 100644 --- a/src/libecmaoperations/ecma-lex-env.h +++ b/src/libecmaoperations/ecma-lex-env.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,9 +36,9 @@ extern ecma_completion_value_t ecma_op_get_value_object_base (ecma_reference_t r extern ecma_completion_value_t ecma_op_put_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, ecma_string_t *var_name_string_p, bool is_strict, - ecma_value_t value); + const ecma_value_t& value); extern ecma_completion_value_t ecma_op_put_value_object_base (ecma_reference_t ref, - ecma_value_t value); + const ecma_value_t& value); /* ECMA-262 v5, Table 17. Abstract methods of Environment Records */ extern bool ecma_op_has_binding (ecma_object_t *lex_env_p, @@ -48,7 +48,7 @@ extern ecma_completion_value_t ecma_op_create_mutable_binding (ecma_object_t *le bool is_deletable); extern ecma_completion_value_t ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, - ecma_value_t value, + const ecma_value_t& value, bool is_strict); extern ecma_completion_value_t ecma_op_get_binding_value (ecma_object_t *lex_env_p, ecma_string_t *name_p, @@ -62,7 +62,7 @@ extern void ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p); extern void ecma_op_initialize_immutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, - ecma_value_t value); + const ecma_value_t& value); extern ecma_object_t* ecma_op_create_global_environment (ecma_object_t *glob_obj_p); extern bool ecma_is_lexical_environment_global (ecma_object_t *lex_env_p); diff --git a/src/libecmaoperations/ecma-number-object.c b/src/libecmaoperations/ecma-number-object.c index a11edf531..3c9c4baec 100644 --- a/src/libecmaoperations/ecma-number-object.c +++ b/src/libecmaoperations/ecma-number-object.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Number constructor */ +ecma_op_create_number_object (const ecma_value_t& arg) /**< argument passed to the Number constructor */ { ecma_completion_value_t conv_to_num_completion = ecma_op_to_number (arg); diff --git a/src/libecmaoperations/ecma-number-object.h b/src/libecmaoperations/ecma-number-object.h index 95b715305..c1960e498 100644 --- a/src/libecmaoperations/ecma-number-object.h +++ b/src/libecmaoperations/ecma-number-object.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ * @{ */ -extern ecma_completion_value_t ecma_op_create_number_object (ecma_value_t arg); +extern ecma_completion_value_t ecma_op_create_number_object (const ecma_value_t& arg); /** * @} diff --git a/src/libecmaoperations/ecma-objects-arguments.c b/src/libecmaoperations/ecma-objects-arguments.c index a33fde8ed..191c1f73a 100644 --- a/src/libecmaoperations/ecma-objects-arguments.c +++ b/src/libecmaoperations/ecma-objects-arguments.c @@ -46,7 +46,7 @@ ecma_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function */ object is created for */ ecma_collection_iterator_t *formal_params_iter_p, /**< formal parameters collection iterator */ - ecma_value_t *arguments_list_p, /**< list of arguments */ + const ecma_value_t *arguments_list_p, /**< list of arguments */ ecma_length_t arguments_list_length, /**< length of arguments' list */ bool is_strict) /**< flag indicating whether strict mode is enabled */ { diff --git a/src/libecmaoperations/ecma-objects-arguments.h b/src/libecmaoperations/ecma-objects-arguments.h index 64990db95..ebe558aa4 100644 --- a/src/libecmaoperations/ecma-objects-arguments.h +++ b/src/libecmaoperations/ecma-objects-arguments.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ extern ecma_object_t* ecma_create_arguments_object (ecma_object_t *func_obj_p, ecma_object_t *lex_env_p, ecma_collection_iterator_t *formal_params_iter_p, - ecma_value_t *arguments_list_p, + const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_length, bool is_strict); diff --git a/src/libecmaoperations/ecma-objects-general.c b/src/libecmaoperations/ecma-objects-general.c index 304df8e27..20eb8a13c 100644 --- a/src/libecmaoperations/ecma-objects-general.c +++ b/src/libecmaoperations/ecma-objects-general.c @@ -80,7 +80,7 @@ ecma_op_create_object_object_noarg (void) * @return pointer to newly created 'Object' object */ ecma_completion_value_t -ecma_op_create_object_object_arg (ecma_value_t value) /**< argument of constructor */ +ecma_op_create_object_object_arg (const ecma_value_t& value) /**< argument of constructor */ { ecma_check_value_type_is_spec_defined (value); @@ -235,7 +235,7 @@ ecma_op_general_object_get_property (ecma_object_t *obj_p, /**< the object */ ecma_completion_value_t ecma_op_general_object_put (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p, /**< property name */ - ecma_value_t value, /**< ecma-value */ + const ecma_value_t& value, /**< ecma-value */ bool is_throw) /**< flag that controls failure handling */ { JERRY_ASSERT(obj_p != NULL diff --git a/src/libecmaoperations/ecma-objects-general.h b/src/libecmaoperations/ecma-objects-general.h index fb8fe590f..a3cf38b3a 100644 --- a/src/libecmaoperations/ecma-objects-general.h +++ b/src/libecmaoperations/ecma-objects-general.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ */ extern ecma_object_t* ecma_op_create_object_object_noarg (void); -extern ecma_completion_value_t ecma_op_create_object_object_arg (ecma_value_t value); +extern ecma_completion_value_t ecma_op_create_object_object_arg (const ecma_value_t& value); extern ecma_completion_value_t ecma_op_general_object_get (ecma_object_t *obj_p, ecma_string_t *property_name_p); @@ -37,7 +37,7 @@ extern ecma_property_t *ecma_op_general_object_get_property (ecma_object_t *obj_ ecma_string_t *property_name_p); extern ecma_completion_value_t ecma_op_general_object_put (ecma_object_t *obj_p, ecma_string_t *property_name_p, - ecma_value_t value, + const ecma_value_t& value, bool is_throw); extern bool ecma_op_general_object_can_put (ecma_object_t *obj_p, ecma_string_t *property_name_p); diff --git a/src/libecmaoperations/ecma-objects.c b/src/libecmaoperations/ecma-objects.c index 33e8e7a93..9299b2e7c 100644 --- a/src/libecmaoperations/ecma-objects.c +++ b/src/libecmaoperations/ecma-objects.c @@ -221,7 +221,7 @@ ecma_op_object_get_property (ecma_object_t *obj_p, /**< the object */ ecma_completion_value_t ecma_op_object_put (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p, /**< property name */ - ecma_value_t value, /**< ecma-value */ + const ecma_value_t& value, /**< ecma-value */ bool is_throw) /**< flag that controls failure handling */ { JERRY_ASSERT(obj_p != NULL @@ -448,7 +448,7 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */ */ ecma_completion_value_t ecma_op_object_has_instance (ecma_object_t *obj_p, /**< the object */ - ecma_value_t value) /**< argument 'V' */ + const ecma_value_t& value) /**< argument 'V' */ { JERRY_ASSERT(obj_p != NULL && !ecma_is_lexical_environment (obj_p)); diff --git a/src/libecmaoperations/ecma-objects.h b/src/libecmaoperations/ecma-objects.h index c2d1bece9..776b4fdc5 100644 --- a/src/libecmaoperations/ecma-objects.h +++ b/src/libecmaoperations/ecma-objects.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ extern ecma_property_t *ecma_op_object_get_own_property (ecma_object_t *obj_p, e extern ecma_property_t *ecma_op_object_get_property (ecma_object_t *obj_p, ecma_string_t *property_name_p); extern ecma_completion_value_t ecma_op_object_put (ecma_object_t *obj_p, ecma_string_t *property_name_p, - ecma_value_t value, + const ecma_value_t& value, bool is_throw); extern bool ecma_op_object_can_put (ecma_object_t *obj_p, ecma_string_t *property_name_p); extern ecma_completion_value_t ecma_op_object_delete (ecma_object_t *obj_p, @@ -44,7 +44,7 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, const ecma_property_descriptor_t* property_desc_p, bool is_throw); extern ecma_completion_value_t ecma_op_object_has_instance (ecma_object_t *obj_p, - ecma_value_t value); + const ecma_value_t& value); /** * @} * @} diff --git a/src/libecmaoperations/ecma-reference.c b/src/libecmaoperations/ecma-reference.c index b9289988a..3bf249354 100644 --- a/src/libecmaoperations/ecma-reference.c +++ b/src/libecmaoperations/ecma-reference.c @@ -93,7 +93,7 @@ ecma_op_get_identifier_reference (ecma_object_t *lex_env_p, /**< lexical environ * Returned value must be freed through ecma_free_reference. */ ecma_reference_t -ecma_make_reference (ecma_value_t base, /**< base value */ +ecma_make_reference (const ecma_value_t& base, /**< base value */ ecma_string_t *name_p, /**< referenced name */ bool is_strict) /**< strict reference flag */ { diff --git a/src/libecmaoperations/ecma-reference.h b/src/libecmaoperations/ecma-reference.h index 8654fc85d..d7f035506 100644 --- a/src/libecmaoperations/ecma-reference.h +++ b/src/libecmaoperations/ecma-reference.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ extern ecma_object_t* ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, extern ecma_reference_t ecma_op_get_identifier_reference (ecma_object_t *lex_env_p, ecma_string_t *name_p, bool is_strict); -extern ecma_reference_t ecma_make_reference (ecma_value_t base, +extern ecma_reference_t ecma_make_reference (const ecma_value_t& base, ecma_string_t *name_p, bool is_strict); extern void ecma_free_reference (ecma_reference_t ref); diff --git a/src/libecmaoperations/ecma-string-object.c b/src/libecmaoperations/ecma-string-object.c index 7fb5ae85c..3706fefe1 100644 --- a/src/libecmaoperations/ecma-string-object.c +++ b/src/libecmaoperations/ecma-string-object.c @@ -39,8 +39,8 @@ * Returned value must be freed with ecma_free_completion_value */ ecma_completion_value_t -ecma_op_create_string_object (ecma_value_t *arguments_list_p, /**< list of arguments that - are passed to String constructor */ +ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of arguments that + are passed to String constructor */ ecma_length_t arguments_list_len) /**< length of the arguments' list */ { JERRY_ASSERT (arguments_list_len == 0 diff --git a/src/libecmaoperations/ecma-string-object.h b/src/libecmaoperations/ecma-string-object.h index 49322cb3f..377464e5e 100644 --- a/src/libecmaoperations/ecma-string-object.h +++ b/src/libecmaoperations/ecma-string-object.h @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ */ extern ecma_completion_value_t -ecma_op_create_string_object (ecma_value_t *arguments_list_p, +ecma_op_create_string_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); extern ecma_property_t*