Support parsing of scripts / functions stored in string values (#4728)

Function arguments must be passed as string values.
Snapshots are generated from compiled code rather than source code.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-08-11 17:37:12 +02:00
committed by GitHub
parent b7dead7b05
commit 3ed93cfb51
24 changed files with 601 additions and 696 deletions
+11 -3
View File
@@ -115,12 +115,20 @@ typedef enum
ECMA_PARSE_ALLOW_NEW_TARGET = (1u << 8), /**< allow new.target access */
ECMA_PARSE_FUNCTION_CONTEXT = (1u << 9), /**< function context is present (ECMA_PARSE_DIRECT_EVAL must be set) */
ECMA_PARSE_GENERATOR_FUNCTION = (1u << 10), /**< generator function is parsed */
ECMA_PARSE_ASYNC_FUNCTION = (1u << 11), /**< async function is parsed */
ECMA_PARSE_HAS_SOURCE_VALUE = (1u << 10), /**< source_p points to a value list
* and the first value is the source code */
ECMA_PARSE_HAS_ARGUMENT_LIST_VALUE = (1u << 11), /**< source_p points to a value list
* and the second value is the argument list */
#if JERRY_ESNEXT
ECMA_PARSE_GENERATOR_FUNCTION = (1u << 12), /**< generator function is parsed */
ECMA_PARSE_ASYNC_FUNCTION = (1u << 13), /**< async function is parsed */
#endif /* JERRY_ESNEXT */
/* These flags are internally used by the parser. */
ECMA_PARSE_INTERNAL_FREE_SOURCE = (1u << 14), /**< free source_p data */
ECMA_PARSE_INTERNAL_FREE_ARG_LIST = (1u << 15), /**< free arg_list_p data */
#if JERRY_ESNEXT
ECMA_PARSE_INTERNAL_PRE_SCANNING = (1u << 12),
ECMA_PARSE_INTERNAL_PRE_SCANNING = (1u << 16), /**< the parser is in pre-scanning mode */
#endif /* JERRY_ESNEXT */
#ifndef JERRY_NDEBUG
/**