Skip to content

Add relevant features/snapshot properties bitset to snapshot header #1981

Closed
@martijnthe

Description

@martijnthe

I noticed that certain features affect the snapshot output format (logically so):

  • whether uncompressed / 32-bit pointers is enabled
  • machine endianness
  • js-parser-limits.h values – PARSER_MAXIMUM_CODE_SIZE affects the byte code generation. I'm not sure if any of the other parser limit values are relevant when loading a snapshot.
  • whether RegExp literal templates are used in the snapshot (a JerryScript VM that is compiled w/o RegExp support will hit JERRY_UNREACHABLE () when loading a snapshot with a regular expression template literal)
  • probably more...?

Right now, there's no nice way to check whether a snapshot is really compatible before running it.
Would it make sense to add this information to the jerry_snapshot_header_t?

@LaszloLango also hinted on IRC at that the magic strings list may also cause snapshots to become different, but I did not observe this when comparing outputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions