Skip to content

Conversation

@zherczeg
Copy link
Member

Unlike normal snapshots, no part of a static snapshot is loaded into the RAM when executed from ROM. Static snapshots rely heavily on external magic strings.

@zherczeg zherczeg force-pushed the static_snapshot branch 2 times, most recently from 50d3193 to f6d938a Compare March 12, 2018 07:23
@zherczeg zherczeg changed the title [WIP] Support static snapshots. Support static snapshots. Mar 12, 2018
@zherczeg zherczeg force-pushed the static_snapshot branch 2 times, most recently from 18e5646 to 493f60b Compare March 13, 2018 11:12
Unlike normal snapshots, no part of a static snapshot is loaded into
the RAM when executed from ROM. Static snapshots rely heavily on
external magic strings.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
- `is_for_global` - snapshot would be executed as global (true) or eval (false).
- `is_strict` - strict mode
- `buffer_p` - buffer to save snapshot to.
- `buffer_size` - the buffer's size.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the size mean here? Byte size? or element size?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Byte size just like the other cases (this is mostly a copy-paste). And the plan is rewriting the saving API anyway.


Unlike normal snaphots static snaphots are fully executed from ROM. Not
even their header is loaded into the RAM. However they can only depend
on magic strings and 28 bit integer numbers. Regular expression literals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should emphasise that the magic strings during the snapshot generation must be the same as the magic strings during execution.

#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */

ecma_value_t
ecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to move this function prototype?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to keep the .c side order. Not a critical change though.

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yichoi
Copy link
Contributor

yichoi commented Mar 19, 2018

LGTM

@yichoi yichoi merged commit bb84466 into jerryscript-project:master Mar 19, 2018
@zherczeg zherczeg deleted the static_snapshot branch March 20, 2018 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants