Providing cp_minimal build mode.

In the mode built-in objects except Global, Object, Object.prototype, Function,
Function.prototype, [[ThrowTypeError]] and CompactProfileError are disabled.

Making default builds (without cp cp_minimal modes set) to not define CONFIG_ECMA_COMPACT_PROFILE.
Removing some tests that depend on 'eval'-like functionality or CompactProfileError built-in from pre-commit testing.
This commit is contained in:
Ruben Ayrapetyan 2014-10-31 18:27:46 +03:00
parent 73084cb976
commit 05cf2dbe04
36 changed files with 241 additions and 50 deletions

View File

@ -46,8 +46,9 @@ export TARGET_RELEASE_MODES = release
export TARGET_PC_SYSTEMS = linux
export TARGET_MCU_SYSTEMS = $(addprefix stm32f,3 4)
export TARGET_PC_MODS = musl sanitize valgrind \
musl-valgrind float64
export TARGET_PC_MODS = musl sanitize valgrind float64 cp cp_minimal \
musl-valgrind \
musl-cp_minimal
export TARGET_MCU_MODS =

View File

@ -171,6 +171,21 @@ else
OPTION_FLOAT64 := disable
endif
# CompactProfile mode
ifeq ($(filter cp,$(TARGET_MODS)), cp)
OPTION_COMPACT_PROFILE := enable
else
OPTION_COMPACT_PROFILE := disable
endif
# minimal CompactProfile mode
ifeq ($(filter cp_minimal,$(TARGET_MODS)), cp_minimal)
OPTION_COMPACT_PROFILE := enable
OPTION_CP_MINIMAL := enable
else
OPTION_CP_MINIMAL := disable
endif
# Enabling float64 mode for unittests
ifeq ($(filter-out $(TESTS_TARGET),$(TARGET_MODE)),)
OPTION_FLOAT64 := enable
@ -355,6 +370,22 @@ ifeq ($(OPTION_FLOAT64),enable)
DEFINES_JERRY += -DCONFIG_ECMA_NUMBER_TYPE=CONFIG_ECMA_NUMBER_FLOAT64
endif
ifeq ($(OPTION_COMPACT_PROFILE),enable)
DEFINES_JERRY += -DCONFIG_ECMA_COMPACT_PROFILE
endif
ifeq ($(OPTION_CP_MINIMAL),enable)
DEFINES_JERRY += -DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_JSON_BUILTIN \
-DCONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
endif
ifeq ($(OPTION_MCU),disable)
MACHINE_TYPE=$(shell uname -m)
ifeq ($(MACHINE_TYPE),x86_64)

View File

@ -139,6 +139,18 @@
/**
* Implementation should correspond to ECMA Compact Profile
*/
#define CONFIG_ECMA_COMPACT_PROFILE
// #define CONFIG_ECMA_COMPACT_PROFILE
#ifdef CONFIG_ECMA_COMPACT_PROFILE
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_JSON_BUILTIN
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
#endif /* !CONFIG_H */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -62,3 +64,5 @@ ecma_builtin_array_prototype_object_to_string (ecma_value_t this) /**< this argu
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -106,3 +108,5 @@ ecma_builtin_array_dispatch_construct (ecma_value_t *arguments_list_p, /**< argu
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -127,3 +129,5 @@ ecma_builtin_boolean_prototype_object_value_of (ecma_value_t this) /**< this arg
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -93,3 +95,5 @@ ecma_builtin_boolean_dispatch_construct (ecma_value_t *arguments_list_p, /**< ar
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -201,3 +203,5 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this) /**< this argu
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -24,6 +24,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -95,3 +97,5 @@ ecma_builtin_error_dispatch_construct (ecma_value_t *arguments_list_p, /**< argu
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -25,9 +25,13 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-evalerror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID eval_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -24,6 +24,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -95,3 +97,5 @@ ecma_builtin_eval_error_dispatch_construct (ecma_value_t *arguments_list_p, /**<
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -89,32 +89,40 @@ OBJECT_VALUE (ECMA_MAGIC_STRING_FUNCTION_UL,
ECMA_PROPERTY_CONFIGURABLE)
// ECMA-262 v5, 15.1.4.3
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
OBJECT_VALUE (ECMA_MAGIC_STRING_ARRAY_UL,
ecma_builtin_get (ECMA_BUILTIN_ID_ARRAY),
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN*/
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
// ECMA-262 v5, 15.1.4.4
OBJECT_VALUE (ECMA_MAGIC_STRING_STRING_UL,
ecma_builtin_get (ECMA_BUILTIN_ID_STRING),
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
// ECMA-262 v5, 15.1.4.5
OBJECT_VALUE (ECMA_MAGIC_STRING_BOOLEAN_UL,
ecma_builtin_get (ECMA_BUILTIN_ID_BOOLEAN),
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
// ECMA-262 v5, 15.1.4.6
OBJECT_VALUE (ECMA_MAGIC_STRING_NUMBER_UL,
ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER),
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
// ECMA-262 v5, 15.1.4.7
CP_UNIMPLEMENTED_VALUE (ECMA_MAGIC_STRING_DATE_UL,
@ -130,6 +138,7 @@ CP_UNIMPLEMENTED_VALUE (ECMA_MAGIC_STRING_REG_EXP_UL,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
// ECMA-262 v5, 15.1.4.9
OBJECT_VALUE (ECMA_MAGIC_STRING_ERROR_UL,
ecma_builtin_get (ECMA_BUILTIN_ID_ERROR),
@ -178,13 +187,16 @@ OBJECT_VALUE (ECMA_MAGIC_STRING_URI_ERROR_UL,
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN
// ECMA-262 v5, 15.1.5.1
OBJECT_VALUE (ECMA_MAGIC_STRING_MATH_UL,
ecma_builtin_get (ECMA_BUILTIN_ID_MATH),
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN */
// ECMA-262 v5, 15.1.5.2
CP_UNIMPLEMENTED_VALUE (ECMA_MAGIC_STRING_JSON_U,

View File

@ -26,6 +26,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -912,3 +914,5 @@ ecma_builtin_math_object_tan (ecma_value_t this_arg, /**< 'this' argument */
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -206,3 +208,5 @@ ecma_builtin_number_prototype_object_to_precision (ecma_value_t this, /**< this
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -103,3 +105,5 @@ ecma_builtin_number_dispatch_construct (ecma_value_t *arguments_list_p, /**< arg
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */

View File

@ -25,9 +25,13 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-rangeerror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID range_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -24,6 +24,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -95,3 +97,5 @@ ecma_builtin_range_error_dispatch_construct (ecma_value_t *arguments_list_p, /**
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -25,9 +25,13 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-referenceerror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID reference_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -24,6 +24,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -95,3 +97,5 @@ ecma_builtin_reference_error_dispatch_construct (ecma_value_t *arguments_list_p,
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -374,3 +376,5 @@ ecma_builtin_string_prototype_object_trim (ecma_value_t this) /**< this argument
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */

View File

@ -25,6 +25,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -157,3 +159,5 @@ ecma_builtin_string_dispatch_construct (ecma_value_t *arguments_list_p, /**< arg
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */

View File

@ -25,9 +25,13 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-syntaxerror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID syntax_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -24,6 +24,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -95,3 +97,5 @@ ecma_builtin_syntax_error_dispatch_construct (ecma_value_t *arguments_list_p, /*
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -25,9 +25,13 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-typeerror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID type_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -24,6 +24,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -95,3 +97,5 @@ ecma_builtin_type_error_dispatch_construct (ecma_value_t *arguments_list_p, /**<
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -25,9 +25,13 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-urierror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID uri_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -24,6 +24,8 @@
#include "ecma-try-catch-macro.h"
#include "globals.h"
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@ -95,3 +97,5 @@ ecma_builtin_uri_error_dispatch_construct (ecma_value_t *arguments_list_p, /**<
* @}
* @}
*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */

View File

@ -112,6 +112,7 @@ ecma_builtin_init_object (ecma_builtin_id_t obj_builtin_id, /**< built-in ID */
/** Initializing [[PrimitiveValue]] properties of built-in prototype objects */
switch (obj_builtin_id)
{
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
case ECMA_BUILTIN_ID_STRING_PROTOTYPE:
{
ecma_string_t *prim_prop_str_value_p = ecma_get_magic_string (ECMA_MAGIC_STRING__EMPTY);
@ -122,6 +123,9 @@ ecma_builtin_init_object (ecma_builtin_id_t obj_builtin_id, /**< built-in ID */
ECMA_SET_POINTER (prim_value_prop_p->u.internal_property.value, prim_prop_str_value_p);
break;
}
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
case ECMA_BUILTIN_ID_NUMBER_PROTOTYPE:
{
ecma_number_t *prim_prop_num_value_p = ecma_alloc_number ();
@ -133,6 +137,9 @@ ecma_builtin_init_object (ecma_builtin_id_t obj_builtin_id, /**< built-in ID */
ECMA_SET_POINTER (prim_value_prop_p->u.internal_property.value, prim_prop_num_value_p);
break;
}
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
case ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE:
{
ecma_property_t *prim_value_prop_p;
@ -141,6 +148,7 @@ ecma_builtin_init_object (ecma_builtin_id_t obj_builtin_id, /**< built-in ID */
prim_value_prop_p->u.internal_property.value = ECMA_SIMPLE_VALUE_FALSE;
break;
}
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
default:
{

View File

@ -24,14 +24,15 @@ BUILTIN (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
object_prototype)
/* The Function.prototype object (15.3.4) */
BUILTIN (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
/* The Object object (15.2.1) */
BUILTIN (ECMA_BUILTIN_ID_OBJECT,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_MAGIC_STRING_FUNCTION_UL,
ECMA_MAGIC_STRING_OBJECT_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
function_prototype)
object)
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
/* The Array.prototype object (15.4.4) */
BUILTIN (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE,
ECMA_OBJECT_TYPE_ARRAY,
@ -40,46 +41,6 @@ BUILTIN (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE,
true,
array_prototype)
/* The Array object (15.4.1) */
BUILTIN (ECMA_BUILTIN_ID_STRING_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_STRING_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
string_prototype)
/* The Boolean.prototype object (15.6.4) */
BUILTIN (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_BOOLEAN_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
boolean_prototype)
/* The Number.prototype object (15.7.4) */
BUILTIN (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_NUMBER_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
number_prototype)
/* The Object object (15.2.1) */
BUILTIN (ECMA_BUILTIN_ID_OBJECT,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_MAGIC_STRING_OBJECT_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
object)
/* The Math object (15.8) */
BUILTIN (ECMA_BUILTIN_ID_MATH,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_MATH_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
math)
/* The Array object (15.4.1) */
BUILTIN (ECMA_BUILTIN_ID_ARRAY,
ECMA_OBJECT_TYPE_FUNCTION,
@ -87,6 +48,16 @@ BUILTIN (ECMA_BUILTIN_ID_ARRAY,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
array)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN*/
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
/* The String.prototype object (15.5.4) */
BUILTIN (ECMA_BUILTIN_ID_STRING_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_STRING_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
string_prototype)
/* The String object (15.5.1) */
BUILTIN (ECMA_BUILTIN_ID_STRING,
@ -95,6 +66,16 @@ BUILTIN (ECMA_BUILTIN_ID_STRING,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
string)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
/* The Boolean.prototype object (15.6.4) */
BUILTIN (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_BOOLEAN_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
boolean_prototype)
/* The Boolean object (15.6.1) */
BUILTIN (ECMA_BUILTIN_ID_BOOLEAN,
@ -103,6 +84,16 @@ BUILTIN (ECMA_BUILTIN_ID_BOOLEAN,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
boolean)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
/* The Number.prototype object (15.7.4) */
BUILTIN (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_NUMBER_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
number_prototype)
/* The Number object (15.7.1) */
BUILTIN (ECMA_BUILTIN_ID_NUMBER,
@ -111,6 +102,15 @@ BUILTIN (ECMA_BUILTIN_ID_NUMBER,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
number)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
/* The Function.prototype object (15.3.4) */
BUILTIN (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_MAGIC_STRING_FUNCTION_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
function_prototype)
/* The Function object (15.3.1) */
BUILTIN (ECMA_BUILTIN_ID_FUNCTION,
@ -120,6 +120,17 @@ BUILTIN (ECMA_BUILTIN_ID_FUNCTION,
true,
function)
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN
/* The Math object (15.8) */
BUILTIN (ECMA_BUILTIN_ID_MATH,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_MAGIC_STRING_MATH_UL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
true,
math)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
/* The Error.prototype object (15.11.4) */
BUILTIN (ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
@ -231,6 +242,7 @@ BUILTIN (ECMA_BUILTIN_ID_URI_ERROR,
ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
true,
uri_error)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
/**< The [[ThrowTypeError]] object (13.2.3) */
BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,

View File

@ -101,7 +101,12 @@ ecma_op_create_array_object (ecma_value_t *arguments_list_p, /**< list of argume
array_items_count = arguments_list_len;
}
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
ecma_object_t *array_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
ecma_object_t *array_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (array_prototype_obj_p, true, ECMA_OBJECT_TYPE_ARRAY);
ecma_deref_object (array_prototype_obj_p);

View File

@ -52,7 +52,12 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo
JERRY_ASSERT (bool_value == ECMA_SIMPLE_VALUE_TRUE || bool_value == ECMA_SIMPLE_VALUE_FALSE);
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
true,
ECMA_OBJECT_TYPE_GENERAL);

View File

@ -38,6 +38,7 @@
ecma_object_t*
ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error type */
{
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
ecma_builtin_id_t prototype_id = ECMA_BUILTIN_ID__COUNT;
switch (error_type)
@ -98,6 +99,11 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ
class_prop_p->u.internal_property.value = ECMA_MAGIC_STRING_ERROR_UL;
return new_error_obj_p;
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
(void) error_type;
return ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
} /* ecma_new_standard_error */
/**

View File

@ -50,7 +50,12 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
ecma_number_t *prim_value_p = ECMA_GET_POINTER (conv_to_num_completion.u.value.value);
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
true,
ECMA_OBJECT_TYPE_GENERAL);

View File

@ -77,7 +77,12 @@ ecma_op_create_string_object (ecma_value_t *arguments_list_p, /**< list of argum
}
}
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_STRING_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
true,
ECMA_OBJECT_TYPE_STRING);

View File

@ -961,9 +961,6 @@
./tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-008.js
./tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-009.js
./tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-010.js
./tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-002.js
./tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-004.js
./tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-007.js
./tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-003.js
./tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-001.js
./tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-001.js