• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright JS Foundation and other contributors, http://js.foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef JERRYSCRIPT_CONFIG_H
17 #define JERRYSCRIPT_CONFIG_H
18 
19 /*
20  * Here define the special config for IAR and gn build.
21  */
22 #if (!defined(_WIN32) && !defined(_WIN64))
23 
24 # define JERRY_BUILTIN_REGEXP 0
25 # define JERRY_ES2015 0
26 #ifndef JERRY_NDEBUG
27 # define JERRY_NDEBUG
28 #endif
29 # define JERRY_DISABLE_HEAVY_DEBUG
30 # define JERRY_SNAPSHOT_EXEC 1
31 # define JERRY_PARSER 1
32 # define JERRY_ES2015_BUILTIN_TYPEDARRAY 1
33 #ifndef JERRY_FOR_IAR_CONFIG
34 # define JERRY_MEM_STATS 1
35 # define JERRY_LOGGING 1
36 #endif /* JERRY_FOR_IAR_CONFIG */
37 
38 #ifndef JERRY_GLOBAL_HEAP_SIZE
39 //Maximum size of heap in kilobytes
40 # define JERRY_GLOBAL_HEAP_SIZE (48)
41 #endif
42 
43 #ifndef JERRY_BUILTIN_EVAL_DISABLED
44 // disable builtin eval() function
45 # define JERRY_BUILTIN_EVAL_DISABLED 1
46 #endif
47 
48 #if defined (__linux__)
49 #ifndef JERRY_SNAPSHOT_SAVE
50 # define JERRY_SNAPSHOT_SAVE 1
51 #endif
52 #endif /* binary tool compiling in linux platform */
53 
54 #endif /* !defined(_WIN32) && !defined(_WIN64) */
55 
56 /*
57  * Here define the special config for Win simulator build.
58  */
59 #if defined (_WIN32) || defined (_WIN64)
60 #ifdef JERRY_FOR_IAR_CONFIG
61 # error "Should not define this macro on WIN simulator!"
62 #endif
63 # define JERRY_BUILTIN_REGEXP 0
64 # define JERRY_ES2015 0
65 # define JERRY_ES2015_BUILTIN_TYPEDARRAY 1
66 //Maximum size of heap in kilobytes
67 # define JERRY_GLOBAL_HEAP_SIZE (64)
68 # define JERRY_DISABLE_HEAVY_DEBUG
69 # define JERRY_ERROR_MESSAGES 1
70 # define JERRY_LINE_INFO 1
71 # define JERRY_MEM_STATS 1
72 # define JERRY_SNAPSHOT_EXEC 1
73 # define JERRY_SNAPSHOT_SAVE 1
74 #ifndef JERRY_LOGGING
75 # define JERRY_LOGGING 1
76 #endif
77 
78 // following config controls temp changes in jerry for debugger function with IDE
79 # define ACE_DEBUGGER_CUSTOM
80 
81 #ifndef JERRY_BUILTIN_EVAL_DISABLED
82 // disable builtin eval() function
83 # define JERRY_BUILTIN_EVAL_DISABLED 1
84 #endif
85 #endif /* defined (_WIN32) || defined (_WIN64) */
86 
87 /*
88  * Note: should not modify below by default!
89  */
90 
91 // @JERRY_BUILD_CFG@
92 
93 /**
94  * Built-in configurations
95  *
96  * Allowed values for built-in defines:
97  *  0: Disable the given built-in.
98  *  1: Enable the given built-in.
99  */
100 /*
101  * By default all built-ins are enabled if they are not defined.
102  */
103 #ifndef JERRY_BUILTINS
104 # define JERRY_BUILTINS 1
105 #endif /* !defined (JERRY_BUILTINS) */
106 
107 #ifndef JERRY_BUILTIN_ANNEXB
108 # define JERRY_BUILTIN_ANNEXB JERRY_BUILTINS
109 #endif /* !defined (JERRY_BUILTIN_ANNEXB) */
110 
111 #ifndef JERRY_BUILTIN_ARRAY
112 # define JERRY_BUILTIN_ARRAY JERRY_BUILTINS
113 #endif /* !defined (JERRY_BUILTIN_ARRAY) */
114 
115 #ifndef JERRY_BUILTIN_DATE
116 # define JERRY_BUILTIN_DATE JERRY_BUILTINS
117 #endif /* !defined (JERRY_BUILTIN_DATE) */
118 
119 #ifndef JERRY_BUILTIN_ERRORS
120 # define JERRY_BUILTIN_ERRORS JERRY_BUILTINS
121 #endif /* !defined (JERRY_BUILTIN_ERRORS) */
122 
123 #ifndef JERRY_BUILTIN_BOOLEAN
124 # define JERRY_BUILTIN_BOOLEAN JERRY_BUILTINS
125 #endif /* !defined (JERRY_BUILTIN_BOOLEAN) */
126 
127 #ifndef JERRY_BUILTIN_JSON
128 # define JERRY_BUILTIN_JSON JERRY_BUILTINS
129 #endif /* !defined (JERRY_BUILTIN_JSON) */
130 
131 #ifndef JERRY_BUILTIN_MATH
132 # define JERRY_BUILTIN_MATH JERRY_BUILTINS
133 #endif /* !defined (JERRY_BUILTIN_MATH) */
134 
135 #ifndef JERRY_BUILTIN_NUMBER
136 # define JERRY_BUILTIN_NUMBER JERRY_BUILTINS
137 #endif /* !defined (JERRY_BUILTIN_NUMBER) */
138 
139 #ifndef JERRY_BUILTIN_REGEXP
140 # define JERRY_BUILTIN_REGEXP JERRY_BUILTINS
141 #endif /* !defined (JERRY_BUILTIN_REGEXP) */
142 
143 #ifndef JERRY_BUILTIN_STRING
144 # define JERRY_BUILTIN_STRING JERRY_BUILTINS
145 #endif /* !defined (JERRY_BUILTIN_STRING) */
146 
147 /**
148  * ES2015 (a.k.a es6) related features, by default all of them are enabled.
149  */
150 #ifndef JERRY_ES2015
151 # define JERRY_ES2015 1
152 #endif /* !defined (JERRY_ES2015) */
153 
154 #ifndef JERRY_ES2015_BUILTIN_DATAVIEW
155 # define JERRY_ES2015_BUILTIN_DATAVIEW JERRY_ES2015
156 #endif /* !defined (JERRY_ES2015_BUILTIN_DATAVIEW) */
157 
158 #ifndef JERRY_ES2015_BUILTIN_MAP
159 # define JERRY_ES2015_BUILTIN_MAP JERRY_ES2015
160 #endif /* !defined (JERRY_ES2015_BUILTIN_MAP) */
161 
162 #ifndef JERRY_ES2015_BUILTIN_SET
163 # define JERRY_ES2015_BUILTIN_SET JERRY_ES2015
164 #endif /* !defined (JERRY_ES2015_BUILTIN_SET) */
165 
166 #ifndef JERRY_ES2015_BUILTIN_WEAKMAP
167 # define JERRY_ES2015_BUILTIN_WEAKMAP JERRY_ES2015
168 #endif /* !defined (JERRY_ES2015_BUILTIN_WEAKMAP) */
169 
170 #ifndef JERRY_ES2015_BUILTIN_WEAKSET
171 # define JERRY_ES2015_BUILTIN_WEAKSET JERRY_ES2015
172 #endif /* !defined (JERRY_ES2015_BUILTIN_WEAKSET) */
173 
174 #ifndef JERRY_ES2015_BUILTIN_PROMISE
175 # define JERRY_ES2015_BUILTIN_PROMISE JERRY_ES2015
176 #endif /* !defined (JERRY_ES2015_BUILTIN_PROMISE) */
177 
178 #ifndef JERRY_ES2015_BUILTIN_PROXY
179 # define JERRY_ES2015_BUILTIN_PROXY JERRY_ES2015
180 #endif /* !defined (JERRY_ES2015_BUILTIN_PROXY) */
181 
182 #ifndef JERRY_ES2015_BUILTIN_REFLECT
183 # define JERRY_ES2015_BUILTIN_REFLECT JERRY_ES2015
184 #endif /* !defined (JERRY_ES2015_BUILTIN_REFLECT) */
185 
186 #ifndef JERRY_ES2015_BUILTIN_TYPEDARRAY
187 # define JERRY_ES2015_BUILTIN_TYPEDARRAY JERRY_ES2015
188 #endif /* !defined (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
189 
190 #ifndef JERRY_ES2015_MODULE_SYSTEM
191 # define JERRY_ES2015_MODULE_SYSTEM JERRY_ES2015
192 #endif /* !defined (JERRY_ES2015_MODULE_SYSTEM) */
193 
194 /**
195  * Engine internal and misc configurations.
196  */
197 
198 /**
199  * Specifies the compressed pointer representation
200  *
201  * Allowed values:
202  *  0: use 16 bit representation
203  *  1: use 32 bit representation
204  *
205  * Default value: 0
206  * For more details see: jmem/jmem.h
207  */
208 #ifndef JERRY_CPOINTER_32_BIT
209 # define JERRY_CPOINTER_32_BIT 0
210 #endif /* !defined (JERRY_CPOINTER_32_BIT) */
211 
212 /**
213  * Enable/Disable the engine's JavaScript debugger interface
214  *
215  * Allowed values:
216  *  0: Disable the debugger parts.
217  *  1: Enable the debugger.
218  */
219 #ifndef JERRY_DEBUGGER
220 # define JERRY_DEBUGGER 0
221 #endif /* !defined (JERRY_DEBUGGER) */
222 
223 /**
224  * Enable/Disable built-in error messages for error objects.
225  *
226  * Allowed values:
227  *  0: Disable error messages.
228  *  1: Enable error message.
229  *
230  * Default value: 0
231  */
232 #ifndef JERRY_ERROR_MESSAGES
233 # define JERRY_ERROR_MESSAGES 0
234 #endif /* !defined (JERRY_ERROR_MESSAGES) */
235 
236 /**
237  * Enable/Disable external context.
238  *
239  * Allowed values:
240  *  0: Disable external context.
241  *  1: Enable external context support.
242  *
243  * Default value: 0
244  */
245 #ifndef JERRY_EXTERNAL_CONTEXT
246 # define JERRY_EXTERNAL_CONTEXT 0
247 #endif /* !defined (JERRY_EXTERNAL_CONTEXT) */
248 
249 /**
250  * Maximum size of heap in kilobytes
251  *
252  * Default value: 512 KiB
253  */
254 #ifndef JERRY_GLOBAL_HEAP_SIZE
255 # define JERRY_GLOBAL_HEAP_SIZE (512)
256 #endif /* !defined (JERRY_GLOBAL_HEAP_SIZE) */
257 
258 /**
259  * The allowed heap usage limit until next garbage collection, in bytes.
260  *
261  * If value is 0, the default is 1/32 of JERRY_HEAP_SIZE
262  */
263 #ifndef JERRY_GC_LIMIT
264 # define JERRY_GC_LIMIT 0
265 #endif /* !defined (JERRY_GC_LIMIT) */
266 
267 /**
268  * Maximum stack usage size in kilobytes
269  *
270  * Note: This feature cannot be used when 'detect_stack_use_after_return=1' ASAN option is enabled.
271  * For more detailed description:
272  *   - https://github.com/google/sanitizers/wiki/AddressSanitizerUseAfterReturn#compatibility
273  *
274  * Default value: 0, unlimited
275  */
276 #ifndef JERRY_STACK_LIMIT
277 # define JERRY_STACK_LIMIT (0)
278 #endif /* !defined (JERRY_STACK_LIMIT) */
279 
280 /**
281  * Maximum depth of recursion during GC mark phase
282  *
283  * Default value: 8
284  */
285 #ifndef JERRY_GC_MARK_LIMIT
286 # define JERRY_GC_MARK_LIMIT (8)
287 #endif /* !defined (JERRY_GC_MARK_LIMIT) */
288 
289 /**
290  * Enable/Disable property lookup cache.
291  *
292  * Allowed values:
293  *  0: Disable lookup cache.
294  *  1: Enable lookup cache.
295  *
296  * Default value: 1
297  */
298 #ifndef JERRY_LCACHE
299 # define JERRY_LCACHE 1
300 #endif /* !defined (JERRY_LCACHE) */
301 
302 /**
303  * Enable/Disable line-info management inside the engine.
304  *
305  * Allowed values:
306  *  0: Disable line-info in the engine.
307  *  1: Enable line-info management.
308  *
309  * Default value: 0
310  */
311 #ifndef JERRY_LINE_INFO
312 # define JERRY_LINE_INFO 0
313 #endif /* !defined (JERRY_LINE_INFO) */
314 
315 /**
316  * Enable/Disable logging inside the engine.
317  *
318  * Allowed values:
319  *  0: Disable internal logging.
320  *  1: Enable internal logging.
321  *
322  * Default value: 0
323  */
324 #ifndef JERRY_LOGGING
325 # define JERRY_LOGGING 0
326 #endif /* !defined (JERRY_LOGGING) */
327 
328 /**
329  * Enable/Disable gc call before every allocation.
330  *
331  * Allowed values:
332  *  0: Disable gc call before each allocation.
333  *  1: Enable and force gc call before each allocation.
334  *
335  * Default value: 0
336  * Warning!: This is an advanced option and will slow down the engine!
337  *           Only enable it for debugging purposes.
338  */
339 #ifndef JERRY_MEM_GC_BEFORE_EACH_ALLOC
340 # define JERRY_MEM_GC_BEFORE_EACH_ALLOC 0
341 #endif /* !defined (JERRY_MEM_GC_BEFORE_EACH_ALLOC) */
342 
343 /**
344  * Enable/Disable the collection if run-time memory statistics.
345  *
346  * Allowed values:
347  *  0: Disable run-time memory information collection.
348  *  1: Enable run-time memory statistics collection.
349  *
350  * Default value: 0
351  */
352 #ifndef JERRY_MEM_STATS
353 # define JERRY_MEM_STATS 0
354 #endif /* !defined (JERRY_MEM_STATS) */
355 
356 /**
357  * Use 32-bit/64-bit float for ecma-numbers
358  * This option is for expert use only!
359  *
360  * Allowed values:
361  *  1: use 64-bit floating point number mode
362  *  0: use 32-bit floating point number mode
363  *
364  * Default value: 1
365  */
366 #ifndef JERRY_NUMBER_TYPE_FLOAT64
367 # define JERRY_NUMBER_TYPE_FLOAT64 1
368 #endif /* !defined (JERRY_NUMBER_TYPE_FLOAT64 */
369 
370 /**
371  * Enable/Disable the JavaScript parser.
372  *
373  * Allowed values:
374  *  0: Disable the JavaScript parser and all related functionallity.
375  *  1: Enable the JavaScript parser.
376  *
377  * Default value: 1
378  */
379 #ifndef JERRY_PARSER
380 # define JERRY_PARSER 1
381 #endif /* !defined (JERRY_PARSER) */
382 
383 /**
384  * Enable/Disable JerryScript byte code dump functions during parsing.
385  * To dump the JerryScript byte code the engine must be initialized with opcodes
386  * display flag. This option does not influence RegExp byte code dumps.
387  *
388  * Allowed values:
389  *  0: Disable all bytecode dump functions.
390  *  1: Enable bytecode dump functions.
391  *
392  * Default value: 0
393  */
394 #ifndef JERRY_PARSER_DUMP_BYTE_CODE
395 # define JERRY_PARSER_DUMP_BYTE_CODE 0
396 #endif /* defined (JERRY_PARSER_DUMP_BYTE_CODE) */
397 
398 /**
399  * Enable/Disable ECMA property hashmap.
400  *
401  * Allowed values:
402  *  0: Disable property hasmap.
403  *  1: Enable property hashmap.
404  *
405  * Default value: 1
406  */
407 #ifndef JERRY_PROPRETY_HASHMAP
408 # define JERRY_PROPRETY_HASHMAP 1
409 #endif /* !defined (JERRY_PROPRETY_HASHMAP) */
410 
411 /**
412  * Enable/Disable byte code dump functions for RegExp objects.
413  * To dump the RegExp byte code the engine must be initialized with
414  * regexp opcodes display flag. This option does not influence the
415  * JerryScript byte code dumps.
416  *
417  * Allowed values:
418  *  0: Disable all bytecode dump functions.
419  *  1: Enable bytecode dump functions.
420  *
421  * Default value: 0
422  */
423 #ifndef JERRY_REGEXP_DUMP_BYTE_CODE
424 # define JERRY_REGEXP_DUMP_BYTE_CODE 0
425 #endif /* !defined (JERRY_REGEXP_DUMP_BYTE_CODE) */
426 
427 /**
428  * Enables/disables the RegExp strict mode
429  *
430  * Default value: 0
431  */
432 #ifndef JERRY_REGEXP_STRICT_MODE
433 # define JERRY_REGEXP_STRICT_MODE 0
434 #endif /* !defined (JERRY_REGEXP_STRICT_MODE) */
435 
436 /**
437  * Enable/Disable the snapshot execution functions.
438  *
439  * Allowed values:
440  *  0: Disable snapshot execution.
441  *  1: Enable snapshot execution.
442  *
443  * Default value: 0
444  */
445 #ifndef JERRY_SNAPSHOT_EXEC
446 # define JERRY_SNAPSHOT_EXEC 0
447 #endif /* !defined (JERRY_SNAPSHOT_EXEC) */
448 
449 /**
450  * Enable/Disable the snapshot save functions.
451  *
452  * Allowed values:
453  *  0: Disable snapshot save functions.
454  *  1: Enable snapshot save functions.
455  */
456 #ifndef JERRY_SNAPSHOT_SAVE
457 # define JERRY_SNAPSHOT_SAVE 0
458 #endif /* !defined (JERRY_SNAPSHOT_SAVE) */
459 
460 /**
461  * Enable/Disable usage of system allocator.
462  *
463  * Allowed values:
464  *  0: Disable usage of system allocator.
465  *  1: Enable usage of system allocator.
466  *
467  * Default value: 0
468  */
469 #ifndef JERRY_SYSTEM_ALLOCATOR
470 # define JERRY_SYSTEM_ALLOCATOR 0
471 #endif /* !defined (JERRY_SYSTEM_ALLOCATOR) */
472 
473 /**
474  * Enables/disables the unicode case conversion in the engine.
475  * By default Unicode case conversion is enabled.
476  */
477 #ifndef JERRY_UNICODE_CASE_CONVERSION
478 # define JERRY_UNICODE_CASE_CONVERSION 1
479 #endif /* !defined (JERRY_UNICODE_CASE_CONVERSION) */
480 
481 /**
482  * Configures if the internal memory allocations are exposed to Valgrind or not.
483  *
484  * Allowed values:
485  *  0: Disable the Valgrind specific memory allocation notifications.
486  *  1: Enable the Valgrind specific allocation notifications.
487  */
488 #ifndef JERRY_VALGRIND
489 # define JERRY_VALGRIND 0
490 #endif /* !defined (JERRY_VALGRIND) */
491 
492 /**
493  * Enable/Disable the vm execution stop callback function.
494  *
495  * Allowed values:
496  *  0: Disable vm exec stop callbacks.
497  *  1: Enable vm exec stop callback functionality.
498  */
499 #ifndef JERRY_VM_EXEC_STOP
500 # define JERRY_VM_EXEC_STOP 0
501 #endif /* !defined (JERRY_VM_EXEC_STOP) */
502 
503 /**
504  * Advanced section configurations.
505  */
506 
507 /**
508  * Allow configuring attributes on a few constant data inside the engine.
509  *
510  * One of the main usages:
511  * Normally compilers store const(ant)s in ROM. Thus saving RAM.
512  * But if your compiler does not support it then the directive below can force it.
513  *
514  * For the moment it is mainly meant for the following targets:
515  *      - ESP8266
516  *
517  * Example configuration for moving (some) constatns into a given section:
518  *  # define JERRY_ATTR_CONST_DATA __attribute__((section(".rodata.const")))
519  */
520 #ifndef JERRY_ATTR_CONST_DATA
521 # define JERRY_ATTR_CONST_DATA
522 #endif /* !defined (JERRY_ATTR_CONST_DATA) */
523 
524 /**
525  * The JERRY_ATTR_GLOBAL_HEAP allows adding extra attributes for the Jerry global heap.
526  *
527  * Example on how to move the global heap into it's own section:
528  *   #define JERRY_ATTR_GLOBAL_HEAP __attribute__((section(".text.globalheap")))
529  */
530 #ifndef JERRY_ATTR_GLOBAL_HEAP
531 # define JERRY_ATTR_GLOBAL_HEAP
532 #endif /* !defined (JERRY_ATTR_GLOBAL_HEAP) */
533 
534 /**
535  * Sanity check for macros to see if the values are 0 or 1
536  *
537  * If a new feature is added this should be updated.
538  */
539 /**
540  * Check base builtins.
541  */
542 #if !defined (JERRY_BUILTIN_ANNEXB) \
543 || ((JERRY_BUILTIN_ANNEXB != 0) && (JERRY_BUILTIN_ANNEXB != 1))
544 # error "Invalid value for JERRY_BUILTIN_ANNEXB macro."
545 #endif
546 #if !defined (JERRY_BUILTIN_ARRAY) \
547 || ((JERRY_BUILTIN_ARRAY != 0) && (JERRY_BUILTIN_ARRAY != 1))
548 # error "Invalid value for JERRY_BUILTIN_ARRAY macro."
549 #endif
550 #if !defined (JERRY_BUILTIN_BOOLEAN) \
551 || ((JERRY_BUILTIN_BOOLEAN != 0) && (JERRY_BUILTIN_BOOLEAN != 1))
552 # error "Invalid value for JERRY_BUILTIN_BOOLEAN macro."
553 #endif
554 #if !defined (JERRY_BUILTIN_DATE) \
555 || ((JERRY_BUILTIN_DATE != 0) && (JERRY_BUILTIN_DATE != 1))
556 # error "Invalid value for JERRY_BUILTIN_DATE macro."
557 #endif
558 #if !defined (JERRY_BUILTIN_ERRORS) \
559 || ((JERRY_BUILTIN_ERRORS != 0) && (JERRY_BUILTIN_ERRORS != 1))
560 # error "Invalid value for JERRY_BUILTIN_ERRORS macro."
561 #endif
562 #if !defined (JERRY_BUILTIN_JSON) \
563 || ((JERRY_BUILTIN_JSON != 0) && (JERRY_BUILTIN_JSON != 1))
564 # error "Invalid value for JERRY_BUILTIN_JSON macro."
565 #endif
566 #if !defined (JERRY_BUILTIN_MATH) \
567 || ((JERRY_BUILTIN_MATH != 0) && (JERRY_BUILTIN_MATH != 1))
568 # error "Invalid value for JERRY_BUILTIN_MATH macro."
569 #endif
570 #if !defined (JERRY_BUILTIN_NUMBER) \
571 || ((JERRY_BUILTIN_NUMBER != 0) && (JERRY_BUILTIN_NUMBER != 1))
572 # error "Invalid value for JERRY_BUILTIN_NUMBER macro."
573 #endif
574 #if !defined (JERRY_BUILTIN_REGEXP) \
575 || ((JERRY_BUILTIN_REGEXP != 0) && (JERRY_BUILTIN_REGEXP != 1))
576 # error "Invalid value for JERRY_BUILTIN_REGEXP macro."
577 #endif
578 #if !defined (JERRY_BUILTIN_STRING) \
579 || ((JERRY_BUILTIN_STRING != 0) && (JERRY_BUILTIN_STRING != 1))
580 # error "Invalid value for JERRY_BUILTIN_STRING macro."
581 #endif
582 #if !defined (JERRY_BUILTINS) \
583 || ((JERRY_BUILTINS != 0) && (JERRY_BUILTINS != 1))
584 # error "Invalid value for JERRY_BUILTINS macro."
585 #endif
586 
587 /**
588  * Check ES2015 features
589  */
590 #if !defined (JERRY_ES2015) \
591 || ((JERRY_ES2015 != 0) && (JERRY_ES2015 != 1))
592 # error "Invalid value for JERRY_ES2015 macro."
593 #endif
594 #if !defined (JERRY_ES2015_BUILTIN_DATAVIEW) \
595 || ((JERRY_ES2015_BUILTIN_DATAVIEW != 0) && (JERRY_ES2015_BUILTIN_DATAVIEW != 1))
596 # error "Invalid value for JERRY_ES2015_BUILTIN_DATAVIEW macro."
597 #endif
598 #if !defined (JERRY_ES2015_BUILTIN_MAP) \
599 || ((JERRY_ES2015_BUILTIN_MAP != 0) && (JERRY_ES2015_BUILTIN_MAP != 1))
600 # error "Invalid value for JERRY_ES2015_BUILTIN_MAP macro."
601 #endif
602 #if !defined (JERRY_ES2015_BUILTIN_REFLECT) \
603 || ((JERRY_ES2015_BUILTIN_REFLECT != 0) && (JERRY_ES2015_BUILTIN_REFLECT != 1))
604 # error "Invalid value for JERRY_ES2015_BUILTIN_REFLECT macro."
605 #endif
606 #if !defined (JERRY_ES2015_BUILTIN_SET) \
607 || ((JERRY_ES2015_BUILTIN_SET != 0) && (JERRY_ES2015_BUILTIN_SET != 1))
608 # error "Invalid value for JERRY_ES2015_BUILTIN_SET macro."
609 #endif
610 #if !defined (JERRY_ES2015_BUILTIN_WEAKMAP) \
611 || ((JERRY_ES2015_BUILTIN_WEAKMAP != 0) && (JERRY_ES2015_BUILTIN_WEAKMAP != 1))
612 # error "Invalid value for JERRY_ES2015_BUILTIN_WEAKMAP macro."
613 #endif
614 #if !defined (JERRY_ES2015_BUILTIN_WEAKSET) \
615 || ((JERRY_ES2015_BUILTIN_WEAKSET != 0) && (JERRY_ES2015_BUILTIN_WEAKSET != 1))
616 # error "Invalid value for JERRY_ES2015_BUILTIN_WEAKSET macro."
617 #endif
618 #if !defined (JERRY_ES2015_BUILTIN_PROMISE) \
619 || ((JERRY_ES2015_BUILTIN_PROMISE != 0) && (JERRY_ES2015_BUILTIN_PROMISE != 1))
620 # error "Invalid value for JERRY_ES2015_BUILTIN_PROMISE macro."
621 #endif
622 #if !defined (JERRY_ES2015_BUILTIN_PROXY) \
623 || ((JERRY_ES2015_BUILTIN_PROXY != 0) && (JERRY_ES2015_BUILTIN_PROXY != 1))
624 # error "Invalid value for JERRY_ES2015_BUILTIN_PROXY macro."
625 #endif
626 #if !defined (JERRY_ES2015_BUILTIN_TYPEDARRAY) \
627 || ((JERRY_ES2015_BUILTIN_TYPEDARRAY != 0) && (JERRY_ES2015_BUILTIN_TYPEDARRAY != 1))
628 # error "Invalid value for JERRY_ES2015_BUILTIN_TYPEDARRAY macro."
629 #endif
630 #if !defined (JERRY_ES2015_MODULE_SYSTEM) \
631 || ((JERRY_ES2015_MODULE_SYSTEM != 0) && (JERRY_ES2015_MODULE_SYSTEM != 1))
632 # error "Invalid value for JERRY_ES2015_MODULE_SYSTEM macro."
633 #endif
634 
635 /**
636  * Internal options.
637  */
638 #if !defined (JERRY_CPOINTER_32_BIT) \
639 || ((JERRY_CPOINTER_32_BIT != 0) && (JERRY_CPOINTER_32_BIT != 1))
640 # error "Invalid value for 'JERRY_CPOINTER_32_BIT' macro."
641 #endif
642 #if !defined (JERRY_DEBUGGER) \
643 || ((JERRY_DEBUGGER != 0) && (JERRY_DEBUGGER != 1))
644 # error "Invalid value for 'JERRY_DEBUGGER' macro."
645 #endif
646 #if !defined (JERRY_ERROR_MESSAGES) \
647 || ((JERRY_ERROR_MESSAGES != 0) && (JERRY_ERROR_MESSAGES != 1))
648 # error "Invalid value for 'JERRY_ERROR_MESSAGES' macro."
649 #endif
650 #if !defined (JERRY_EXTERNAL_CONTEXT) \
651 || ((JERRY_EXTERNAL_CONTEXT != 0) && (JERRY_EXTERNAL_CONTEXT != 1))
652 # error "Invalid value for 'JERRY_EXTERNAL_CONTEXT' macro."
653 #endif
654 #if !defined (JERRY_GLOBAL_HEAP_SIZE) || (JERRY_GLOBAL_HEAP_SIZE <= 0)
655 # error "Invalid value for 'JERRY_GLOBAL_HEAP_SIZE' macro."
656 #endif
657 #if !defined (JERRY_GC_LIMIT) || (JERRY_GC_LIMIT < 0)
658 # error "Invalid value for 'JERRY_GC_LIMIT' macro."
659 #endif
660 #if !defined (JERRY_STACK_LIMIT) || (JERRY_STACK_LIMIT < 0)
661 # error "Invalid value for 'JERRY_STACK_LIMIT' macro."
662 #endif
663 #if !defined (JERRY_GC_MARK_LIMIT) || (JERRY_GC_MARK_LIMIT < 0)
664 # error "Invalid value for 'JERRY_GC_MARK_LIMIT' macro."
665 #endif
666 #if !defined (JERRY_LCACHE) \
667 || ((JERRY_LCACHE != 0) && (JERRY_LCACHE != 1))
668 # error "Invalid value for 'JERRY_LCACHE' macro."
669 #endif
670 #if !defined (JERRY_LINE_INFO) \
671 || ((JERRY_LINE_INFO != 0) && (JERRY_LINE_INFO != 1))
672 # error "Invalid value for 'JERRY_LINE_INFO' macro."
673 #endif
674 #if !defined (JERRY_LOGGING) \
675 || ((JERRY_LOGGING != 0) && (JERRY_LOGGING != 1))
676 # error "Invalid value for 'JERRY_LOGGING' macro."
677 #endif
678 #if !defined (JERRY_MEM_GC_BEFORE_EACH_ALLOC) \
679 || ((JERRY_MEM_GC_BEFORE_EACH_ALLOC != 0) && (JERRY_MEM_GC_BEFORE_EACH_ALLOC != 1))
680 # error "Invalid value for 'JERRY_MEM_GC_BEFORE_EACH_ALLOC' macro."
681 #endif
682 #if !defined (JERRY_MEM_STATS) \
683 || ((JERRY_MEM_STATS != 0) && (JERRY_MEM_STATS != 1))
684 # error "Invalid value for 'JERRY_MEM_STATS' macro."
685 #endif
686 #if !defined (JERRY_NUMBER_TYPE_FLOAT64) \
687 || ((JERRY_NUMBER_TYPE_FLOAT64 != 0) && (JERRY_NUMBER_TYPE_FLOAT64 != 1))
688 # error "Invalid value for 'JERRY_NUMBER_TYPE_FLOAT64' macro."
689 #endif
690 #if !defined (JERRY_PARSER) \
691 || ((JERRY_PARSER != 0) && (JERRY_PARSER != 1))
692 # error "Invalid value for 'JERRY_PARSER' macro."
693 #endif
694 #if !defined (JERRY_PARSER_DUMP_BYTE_CODE) \
695 || ((JERRY_PARSER_DUMP_BYTE_CODE != 0) && (JERRY_PARSER_DUMP_BYTE_CODE != 1))
696 # error "Invalid value for 'JERRY_PARSER_DUMP_BYTE_CODE' macro."
697 #endif
698 #if !defined (JERRY_PROPRETY_HASHMAP) \
699 || ((JERRY_PROPRETY_HASHMAP != 0) && (JERRY_PROPRETY_HASHMAP != 1))
700 # error "Invalid value for 'JERRY_PROPRETY_HASHMAP' macro."
701 #endif
702 #if !defined (JERRY_REGEXP_DUMP_BYTE_CODE) \
703 || ((JERRY_REGEXP_DUMP_BYTE_CODE != 0) && (JERRY_REGEXP_DUMP_BYTE_CODE != 1))
704 # error "Invalid value for 'JERRY_REGEXP_DUMP_BYTE_CODE' macro."
705 #endif
706 #if !defined (JERRY_REGEXP_STRICT_MODE) \
707 || ((JERRY_REGEXP_STRICT_MODE != 0) && (JERRY_REGEXP_STRICT_MODE != 1))
708 # error "Invalid value for 'JERRY_REGEXP_STRICT_MODE' macro."
709 #endif
710 #if !defined (JERRY_SNAPSHOT_EXEC) \
711 || ((JERRY_SNAPSHOT_EXEC != 0) && (JERRY_SNAPSHOT_EXEC != 1))
712 # error "Invalid value for 'JERRY_SNAPSHOT_EXEC' macro."
713 #endif
714 #if !defined (JERRY_SNAPSHOT_SAVE) \
715 || ((JERRY_SNAPSHOT_SAVE != 0) && (JERRY_SNAPSHOT_SAVE != 1))
716 # error "Invalid value for 'JERRY_SNAPSHOT_SAVE' macro."
717 #endif
718 #if !defined (JERRY_SYSTEM_ALLOCATOR) \
719 || ((JERRY_SYSTEM_ALLOCATOR != 0) && (JERRY_SYSTEM_ALLOCATOR != 1))
720 # error "Invalid value for 'JERRY_SYSTEM_ALLOCATOR' macro."
721 #endif
722 #if !defined (JERRY_UNICODE_CASE_CONVERSION) \
723 || ((JERRY_UNICODE_CASE_CONVERSION != 0) && (JERRY_UNICODE_CASE_CONVERSION != 1))
724 # error "Invalid value for 'JERRY_UNICODE_CASE_CONVERSION' macro."
725 #endif
726 #if !defined (JERRY_VALGRIND) \
727 || ((JERRY_VALGRIND != 0) && (JERRY_VALGRIND != 1))
728 # error "Invalid value for 'JERRY_VALGRIND' macro."
729 #endif
730 #if !defined (JERRY_VM_EXEC_STOP) \
731 || ((JERRY_VM_EXEC_STOP != 0) && (JERRY_VM_EXEC_STOP != 1))
732 # error "Invalid value for 'JERRY_VM_EXEC_STOP' macro."
733 #endif
734 
735 #define ENABLED(FEATURE) ((FEATURE) == 1)
736 #define DISABLED(FEATURE) ((FEATURE) != 1)
737 
738 /**
739  * Cross component requirements check.
740  */
741 /**
742  * The date module can only use the float 64 number types.
743  * Do a check for this.
744  */
745 #if ENABLED (JERRY_BUILTIN_DATE) && !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
746 #  error "Date does not support float32"
747 #endif
748 
749 /**
750  * Wrap container types into a single guard
751  */
752 #if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) \
753 || ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
754 # define JERRY_ES2015_BUILTIN_CONTAINER 1
755 #else
756 # define JERRY_ES2015_BUILTIN_CONTAINER 0
757 #endif
758 
759 #endif /* !JERRYSCRIPT_CONFIG_H */
760