facebookarchive/prepack

Enhance serializer tests with automated heap traversals

Open

#1.852 aberto em 3 de mai. de 2018

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (520 forks)batch import
enhancementhelp wantedserializertest needed

Métricas do repositório

Stars
 (14.268 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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.

Guia do colaborador