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:
@@ -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
|
||||
/**
|
||||
|
||||
@@ -714,7 +714,7 @@ ecma_snapshot_get_literal (const uint8_t *literal_base_p, /**< literal start */
|
||||
* @return pointer to the beginning of the serializable ecma-values
|
||||
*/
|
||||
ecma_value_t *
|
||||
ecma_snapshot_resolve_serializable_values (ecma_compiled_code_t *compiled_code_p, /**< compiled code */
|
||||
ecma_snapshot_resolve_serializable_values (const ecma_compiled_code_t *compiled_code_p, /**< compiled code */
|
||||
uint8_t *bytecode_end_p) /**< end of the bytecode */
|
||||
{
|
||||
ecma_value_t *base_p = (ecma_value_t *) bytecode_end_p;
|
||||
|
||||
@@ -59,7 +59,7 @@ bool ecma_save_literals_for_snapshot (ecma_collection_t *lit_pool_p, uint32_t *b
|
||||
ecma_value_t
|
||||
ecma_snapshot_get_literal (const uint8_t *literal_base_p, ecma_value_t literal_value);
|
||||
ecma_value_t *
|
||||
ecma_snapshot_resolve_serializable_values (ecma_compiled_code_t *compiled_code_p, uint8_t *byte_code_end_p);
|
||||
ecma_snapshot_resolve_serializable_values (const ecma_compiled_code_t *compiled_code_p, uint8_t *byte_code_end_p);
|
||||
#endif /* JERRY_SNAPSHOT_EXEC || JERRY_SNAPSHOT_SAVE */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user