es-meta / esmeta

ECMAScript Specification (ECMA-262) Metalanguage
BSD 3-Clause "New" or "Revised" License
175 stars 12 forks source link

Implement unreachables #181

Closed hyp3rflow closed 11 months ago

hyp3rflow commented 11 months ago

This PR implements log dump for unreachable node points and functions.

Summary with es2022 + no tysens:

duration: 10,478 ms
error: 241
iter: 61,737
analyzed:
  functions: 2,688
  nodes: 15,731
unreachable:
  functions: 423
  nodes: 4,289

Here is an example of unreachable-nodes dump:

AdvanceStringIndex: Block[14445]
AllocateArrayBuffer: Block[17522]
AllocateSharedArrayBuffer: Block[17722]
AllocateTypedArray: Block[16928]
AllocateTypedArray: Block[16929]
AllocateTypedArray: Block[16931]
AllocateTypedArray: Block[16933]
AllocateTypedArray: Block[16934]
AllocateTypedArray: Branch[16927]
...

Here is an example of unreachable-funcs dump:

AgentCanSuspend
AgentSignifier
AllocateTypedArrayBuffer
Alternative[0,0].CompileSubpattern
Alternative[1,0].CompileSubpattern
Arguments[0,0].ArgumentListEvaluation
ArrayBindingPattern[0,0].BoundNames
ArrayBindingPattern[0,2].BoundNames
ArrowFunction[0,0].Evaluation
ArrowFunction[0,0].InstantiateArrowFunctionExpression
ArrowFunction[0,0].NamedEvaluation
Assertion[0,0].CompileAssertion
Assertion[1,0].CompileAssertion
Assertion[2,0].CompileAssertion
Assertion[3,0].CompileAssertion
Assertion[4,0].CompileAssertion
Assertion[5,0].CompileAssertion
Assertion[6,0].CompileAssertion
...