Added literal list loading feature to the snapshot tool. (#2422)
It is needed to load literals and register them as magic strings to be able to generate static snapshots. Also modified the list format saving feature to save all of the literals not only the identifiers. JerryScript-DCO-1.0-Signed-off-by: László Langó [email protected]
This commit is contained in:
1 parent
f86d7459d1
commit
5f4a220a65
4 files changed
+77
-23
No files matched your search
@@ -1633,9 +1633,15 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source
|
||||
{
|
||||
ecma_string_t *literal_p = ecma_get_string_from_value (*iterator_p);
|
||||
|
||||
/* We don't save a literal which isn't a valid identifier or it's a magic string. */
|
||||
/* NOTE:
|
||||
* We don't save a literal (in C format) which isn't a valid
|
||||
* identifier or it's a magic string.
|
||||
* TODO:
|
||||
* Save all of the literals in C format as well.
|
||||
*/
|
||||
if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT
|
||||
&& ecma_string_is_valid_identifier (literal_p))
|
||||
&& (!is_c_format
|
||||
|| (is_c_format && ecma_string_is_valid_identifier (literal_p))))
|
||||
{
|
||||
literal_count++;
|
||||
}
|
||||
@@ -1666,8 +1672,15 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source
|
||||
{
|
||||
ecma_string_t *literal_p = ecma_get_string_from_value (*iterator_p);
|
||||
|
||||
/* NOTE:
|
||||
* We don't save a literal (in C format) which isn't a valid
|
||||
* identifier or it's a magic string.
|
||||
* TODO:
|
||||
* Save all of the literals in C format as well.
|
||||
*/
|
||||
if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT
|
||||
&& ecma_string_is_valid_identifier (literal_p))
|
||||
&& (!is_c_format
|
||||
|| (is_c_format && ecma_string_is_valid_identifier (literal_p))))
|
||||
{
|
||||
literal_array[literal_idx++] = literal_p;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user