Skip to content

Commit 2d35a5d

Browse files
committed
profile [minimal es5.1-full es2015-part]
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
1 parent 4ae83c9 commit 2d35a5d

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

jerry-core/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set(JERRY_CORE_NAME jerry-core)
1818
project (${JERRY_CORE_NAME} C)
1919

2020
# Optional features
21-
set(FEATURE_PROFILE "full" CACHE STRING "Profile types: full, minimal")
21+
set(FEATURE_PROFILE "es5.1-full" CACHE STRING "Profile types: es5.1-full, minimal, es2015-part")
2222
set(FEATURE_ERROR_MESSAGES OFF CACHE BOOL "Enable error messages?")
2323
set(FEATURE_VALGRIND OFF CACHE BOOL "Enable Valgrind support?")
2424
set(FEATURE_VALGRIND_FREYA OFF CACHE BOOL "Enable Valgrind-Freya support?")
@@ -118,9 +118,12 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
118118
endif()
119119

120120
# Profile modes
121+
set(CONFIG_DISABLE_ES2015
122+
CONFIG_DISABLE_ARRAYBUFFER_BUILTIN)
121123
# Minimal profile
122124
if(FEATURE_PROFILE STREQUAL "minimal")
123125
set(DEFINES_JERRY ${DEFINES_JERRY}
126+
${CONFIG_DISABLE_ES2015}
124127
CONFIG_DISABLE_NUMBER_BUILTIN
125128
CONFIG_DISABLE_STRING_BUILTIN
126129
CONFIG_DISABLE_BOOLEAN_BUILTIN
@@ -131,7 +134,10 @@ if(FEATURE_PROFILE STREQUAL "minimal")
131134
CONFIG_DISABLE_DATE_BUILTIN
132135
CONFIG_DISABLE_REGEXP_BUILTIN
133136
CONFIG_DISABLE_ANNEXB_BUILTIN)
134-
elseif(NOT FEATURE_PROFILE STREQUAL "full")
137+
elseif(FEATURE_PROFILE STREQUAL "es5.1-full")
138+
set(DEFINES_JERRY ${DEFINES_JERRY}
139+
${CONFIG_DISABLE_ES2015})
140+
elseif(NOT FEATURE_PROFILE STREQUAL "es2015-part")
135141
message(FATAL_ERROR "FEATURE_PROFILE='${FEATURE_PROFILE}' isn't supported")
136142
endif()
137143

jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ ecma_builtin_arraybuffer_prototype_bytelength_getter (ecma_value_t this_arg) /**
5858
if (ecma_is_value_object (this_arg))
5959
{
6060
ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
61+
6162
if (ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL))
6263
{
6364
ecma_length_t len = ecma_arraybuffer_get_length (object_p);

jerry-core/ecma/builtin-objects/ecma-builtins.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
622622
{
623623
ecma_deref_object (getter_p);
624624
}
625-
626625
}
627626
else
628627
{

jerry-core/ecma/operations/ecma-arraybuffer-object.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*/
4242
ecma_value_t
4343
ecma_op_create_arraybuffer_object (const ecma_value_t *arguments_list_p, /**< list of arguments that
44-
are passed to String constructor */
44+
* are passed to String constructor */
4545
ecma_length_t arguments_list_len) /**< length of the arguments' list */
4646
{
4747
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -97,6 +97,7 @@ inline ecma_length_t __attr_pure___ __attr_always_inline___
9797
ecma_arraybuffer_get_length (ecma_object_t *object_p) /**< pointer to the ArrayBuffer object */
9898
{
9999
JERRY_ASSERT (ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL));
100+
100101
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
101102
return ext_object_p->u.class_prop.u.length;
102103
} /* ecma_arraybuffer_get_length */
@@ -110,6 +111,7 @@ inline lit_utf8_byte_t * __attr_pure___ __attr_always_inline___
110111
ecma_arraybuffer_get_buffer (ecma_object_t *object_p) /**< pointer to the ArrayBuffer object */
111112
{
112113
JERRY_ASSERT (ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL));
114+
113115
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
114116
return (lit_utf8_byte_t *) (ext_object_p + 1);
115117
} /* ecma_arraybuffer_get_buffer */

tests/unit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
cmake_minimum_required (VERSION 2.8.12)
1717
project (Unittest C)
1818

19-
if(NOT FEATURE_PROFILE STREQUAL "full")
19+
if(NOT FEATURE_PROFILE STREQUAL "es5.1-full")
2020
message(FATAL_ERROR "FEATURE_PROFILE='${FEATURE_PROFILE}' isn't supported with UNITTESTS=ON")
2121
endif()
2222

tools/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def devhelp(help):
4949
parser.add_argument('--builddir', metavar='DIR', action='store', default=BUILD_DIR, help='specify output directory (default: %(default)s)')
5050
parser.add_argument('--lto', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper, help='enable link-time optimizations (%(choices)s; default: %(default)s)')
5151
parser.add_argument('--all-in-one', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='all-in-one build (%(choices)s; default: %(default)s)')
52-
parser.add_argument('--profile', metavar='PROFILE', choices=['full', 'minimal'], default='full', type=str.lower, help='specify the profile (%(choices)s; default: %(default)s)')
52+
parser.add_argument('--profile', metavar='PROFILE', choices=['es5.1-full', 'minimal', 'es2015-part'], default='es5.1-full', type=str.lower, help='specify the profile (%(choices)s; default: %(default)s)')
5353
parser.add_argument('--error-messages', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='enable error messages (%(choices)s; default: %(default)s)')
5454
parser.add_argument('--snapshot-save', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='enable saving snapshot files (%(choices)s; default: %(default)s)')
5555
parser.add_argument('--snapshot-exec', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='enable executing snapshot files (%(choices)s; default: %(default)s)')

0 commit comments

Comments
 (0)