Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/01.GETTING-STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ python tools/build.py --debug --lto=off
python tools/build.py --cmake-param=CMAKE_PARAM
```

##### Set an ECMAScript profile mode (full|compact|minimal):
##### Set a profile mode (full|minimal):

```bash
python tools/build.py --feature=full|compact|minimal
python tools/build.py --feature=full|minimal
```

##### Use (jerry|compiler-default|external libc) libc:
Expand Down
5 changes: 2 additions & 3 deletions docs/04.INTERNALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,8 @@ Chunk size of the pool is 8 bytes (reduces fragmentation).
### Number

There are two possible representation of numbers according to standard IEEE 754:

* 4-byte (float, compact profile)
* 8-byte (double, full profile)
The default is 8-byte (double),
but the engine supports the 4-byte (single precision) representation by setting CONFIG_ECMA_NUMBER_TYPE as well.

![Number](img/number.png)

Expand Down
40 changes: 15 additions & 25 deletions jerry-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(JERRY_CORE_NAME jerry-core)
project (${JERRY_CORE_NAME} C)

# Optional features
set(FEATURE_PROFILE "full" CACHE STRING "ES5.1 profile: full, compact, minimal")
set(FEATURE_PROFILE "full" CACHE STRING "Profile types: full, minimal")
set(FEATURE_ERROR_MESSAGES OFF CACHE BOOL "Enable error messages?")
set(FEATURE_LOG OFF CACHE BOOL "Enable logging?")
set(FEATURE_VALGRIND OFF CACHE BOOL "Enable Valgrind support?")
Expand Down Expand Up @@ -142,30 +142,20 @@ else()
set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_NDEBUG)
endif()

# ES5.1 profiles
# Compact profile
if(FEATURE_PROFILE STREQUAL "compact")
set(DEFINES_JERRY ${DEFINES_JERRY} CONFIG_ECMA_COMPACT_PROFILE)

# Minimal compact profile
elseif(FEATURE_PROFILE STREQUAL "minimal")
set(DEFINES_JERRY
${DEFINES_JERRY}
CONFIG_ECMA_COMPACT_PROFILE
#
# Date and RegExp built-in objects are also disabled in non-minimal compact profile build
#
# CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN
# CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
#
CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS
CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN
CONFIG_ECMA_COMPACT_PROFILE_DISABLE_JSON_BUILTIN)

# Profile modes
# Minimal profile
if(FEATURE_PROFILE STREQUAL "minimal")
set(DEFINES_JERRY ${DEFINES_JERRY}
CONFIG_DISABLE_NUMBER_BUILTIN
CONFIG_DISABLE_STRING_BUILTIN
CONFIG_DISABLE_BOOLEAN_BUILTIN
CONFIG_DISABLE_ERROR_BUILTINS
CONFIG_DISABLE_ARRAY_BUILTIN
CONFIG_DISABLE_MATH_BUILTIN
CONFIG_DISABLE_JSON_BUILTIN
CONFIG_DISABLE_DATE_BUILTIN
CONFIG_DISABLE_REGEXP_BUILTIN
CONFIG_DISABLE_ANNEXB_BUILTIN)
elseif(NOT FEATURE_PROFILE STREQUAL "full")
message(FATAL_ERROR "FEATURE_PROFILE='${FEATURE_PROFILE}' doesn't supported")
endif()
Expand Down
18 changes: 0 additions & 18 deletions jerry-core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,6 @@
*/
// #define CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE

/**
* Implementation should correspond to 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_JSON_BUILTIN
#define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN
#define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
#define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN
#endif /* CONFIG_ECMA_COMPACT_PROFILE */

/**
* Number of ecma values inlined into VM stack frame
*/
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/base/ecma-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ ecma_gc_run (jmem_free_unused_memory_severity_t severity) /**< gc severity */

JERRY_CONTEXT (ecma_gc_visited_flip_flag) = !JERRY_CONTEXT (ecma_gc_visited_flip_flag);

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
/* Free RegExp bytecodes stored in cache */
re_cache_gc_run ();
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
} /* ecma_gc_run */

/**
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/base/ecma-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,11 +1479,11 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
}
else
{
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
re_compiled_code_t *re_bytecode_p = (re_compiled_code_t *) bytecode_p;

ecma_deref_ecma_string (ECMA_GET_NON_NULL_POINTER (ecma_string_t, re_bytecode_p->pattern_cp));
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
}

jmem_heap_free_block (bytecode_p,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "ecma-try-catch-macro.h"
#include "jrt.h"

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -2768,4 +2768,4 @@ ecma_builtin_array_prototype_object_reduce_right (ecma_value_t this_arg, /**< th
* @}
*/

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
4 changes: 2 additions & 2 deletions jerry-core/ecma/builtin-objects/ecma-builtin-array.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "ecma-try-catch-macro.h"
#include "jrt.h"

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -107,4 +107,4 @@ ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**
* @}
*/

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "ecma-try-catch-macro.h"
#include "jrt.h"

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -122,4 +122,4 @@ ecma_builtin_boolean_prototype_object_value_of (ecma_value_t this_arg) /**< this
* @}
*/

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
4 changes: 2 additions & 2 deletions jerry-core/ecma/builtin-objects/ecma-builtin-boolean.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "ecma-try-catch-macro.h"
#include "jrt.h"

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -97,4 +97,4 @@ ecma_builtin_boolean_dispatch_construct (const ecma_value_t *arguments_list_p, /
* @}
*/

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "ecma-objects.h"
#include "ecma-try-catch-macro.h"

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN
#ifndef CONFIG_DISABLE_DATE_BUILTIN

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -1225,7 +1225,7 @@ ecma_builtin_date_prototype_to_json (ecma_value_t this_arg, /**< this argument *
return ret_value;
} /* ecma_builtin_date_prototype_to_json */

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN

/**
* The Date.prototype object's 'getYear' routine
Expand Down Expand Up @@ -1321,13 +1321,13 @@ ecma_builtin_date_prototype_set_year (ecma_value_t this_arg, /**< this argument
return ret_value;
} /* ecma_builtin_date_prototype_set_year */

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */

/**
* @}
* @}
* @}
*/

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */

Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ecma_builtin_date_prototype_to_utc_s
ROUTINE (LIT_MAGIC_STRING_TO_ISO_STRING_UL, ecma_builtin_date_prototype_to_iso_string, 0, 0)
ROUTINE (LIT_MAGIC_STRING_TO_JSON_UL, ecma_builtin_date_prototype_to_json, 1, 1)

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN

ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ecma_builtin_date_prototype_get_year, 0, 0)
ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ecma_builtin_date_prototype_set_year, 1, 1)
ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ecma_builtin_date_prototype_to_utc_string, 0, 0)

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */

#undef OBJECT_ID
#undef SIMPLE_VALUE
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/builtin-objects/ecma-builtin-date.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "ecma-try-catch-macro.h"
#include "lit-char-helpers.h"

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN
#ifndef CONFIG_DISABLE_DATE_BUILTIN

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -574,4 +574,4 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
* @}
*/

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include "jrt.h"
#include "lit-magic-strings.h"

#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

Expand Down Expand Up @@ -195,5 +193,3 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
* @}
* @}
*/

#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
Loading