facebookarchive/prepack

Enhance serializer tests with automated heap traversals

Open

#1852 aperta il 3 mag 2018

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (520 fork)batch import
enhancementhelp wantedserializertest needed

Metriche repository

Star
 (14.268 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Currently, the serializer tests only checks a heap projection: whatever the inspect function computes.

This is great for debugging issues, as each serializer test tends to be minimal and test a separate feature.

However, we are ignoring additional potential. What could be done is effectively synthesizing an alternative inspect function implementation that returns the result of a systematic, deterministic heap traversal.

Challenges:

  1. Ideally, we'd like to detect any changes to built-ins as well as changes rooted in the global object.
  2. Prepack does not preserve everything, e.g. function names and function source code change. So this should be abstracted by the traversal.
  3. Functions are interesting in general: How can we detect that their behavior didn't change? To start with, we can just ignore that and focus on the immediately accessible heap. Maybe some annotations are needed on how to invoke functions to get interesting outputs, which in turn can be traversed.

Guida contributor