From 9d7978074f0ed301fb95a6faf79ee8b1a332ec9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Lang=C3=B3?= Date: Mon, 22 Feb 2016 14:27:16 +0100 Subject: [PATCH] Fix 'jerry-test-suite/13/13-011.js' fail in compact profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Arguments object is not supported in compact profile, so remove the test from 'compact-profile-list'. Do not create arguments object on function calls in compact profile. Remove unnecessary arguments check. Related issue: #879 JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com --- .../ecma/operations/ecma-function-object.c | 3 +- jerry-core/ecma/operations/ecma-lex-env.c | 38 ------------------- tests/jerry-test-suite/compact-profile-list | 1 - 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/jerry-core/ecma/operations/ecma-function-object.c b/jerry-core/ecma/operations/ecma-function-object.c index 7e5779bb41..7a06d5e141 100644 --- a/jerry-core/ecma/operations/ecma-function-object.c +++ b/jerry-core/ecma/operations/ecma-function-object.c @@ -616,7 +616,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */ else { local_env_p = ecma_create_decl_lex_env (scope_p); - +#ifndef CONFIG_ECMA_COMPACT_PROFILE if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_ARGUMENTS_NEEDED) { ecma_op_create_arguments_object (func_obj_p, @@ -625,6 +625,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */ arguments_list_len, bytecode_data_p); } +#endif /* !CONFIG_ECMA_COMPACT_PROFILE */ } ret_value = vm_run (bytecode_data_p, diff --git a/jerry-core/ecma/operations/ecma-lex-env.c b/jerry-core/ecma/operations/ecma-lex-env.c index d43057d2d4..7bb96e36b6 100644 --- a/jerry-core/ecma/operations/ecma-lex-env.c +++ b/jerry-core/ecma/operations/ecma-lex-env.c @@ -204,24 +204,6 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE) { -#ifndef JERRY_NDEBUG -# ifdef CONFIG_ECMA_COMPACT_PROFILE - bool is_equal = false; - - ecma_string_t *arguments_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS); - if (ecma_compare_ecma_strings (name_p, arguments_magic_string_p)) - { - is_equal = true; - } - ecma_deref_ecma_string (arguments_magic_string_p); - - if (is_equal) - { - return ecma_make_error_obj_value (ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR)); - } -# endif /* CONFIG_ECMA_COMPACT_PROFILE */ -#endif /* !JERRY_NDEBUG */ - ecma_property_t *property_p = ecma_get_named_data_property (lex_env_p, name_p); if (ecma_is_property_writable (property_p)) @@ -276,26 +258,6 @@ ecma_op_get_binding_value (ecma_object_t *lex_env_p, /**< lexical environment */ if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE) { -#ifndef JERRY_NDEBUG -# ifdef CONFIG_ECMA_COMPACT_PROFILE - bool is_equal = false; - - ecma_string_t *arguments_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS); - if (ecma_compare_ecma_strings (name_p, arguments_magic_string_p)) - { - is_equal = true; - } - ecma_deref_ecma_string (arguments_magic_string_p); - - JERRY_ASSERT (!is_equal); - - if (is_equal) - { - return ecma_make_error_obj_value (ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR)); - } -# endif /* CONFIG_ECMA_COMPACT_PROFILE */ -#endif /* !JERRY_NDEBUG */ - ecma_property_t *property_p = ecma_get_named_data_property (lex_env_p, name_p); ecma_value_t prop_value = ecma_get_named_data_property_value (property_p); diff --git a/tests/jerry-test-suite/compact-profile-list b/tests/jerry-test-suite/compact-profile-list index b40e54c2ac..126d88bdd5 100644 --- a/tests/jerry-test-suite/compact-profile-list +++ b/tests/jerry-test-suite/compact-profile-list @@ -734,7 +734,6 @@ ./13/13-007.js ./13/13-009.js ./13/13-010.js -./13/13-011.js ./13/13.01/13.01-001.js ./13/13.02/13.02-001.js ./13/13.02/13.02-003.js