Files
sdk/pkg/vm/lib/bytecode
Alexander Markov dd65f97118 [vm/bytecode] Save/restore globalDebuggingNames around bytecode generation
Global variable globalDebuggingNames in the front-end can accumulate a
lot of garbage (all ASTs) if toString() is called from an AST node.

Bytecode generator uses Expression.getStaticType a lot, which calls
Expression.getStaticTypeAsInstanceOf, which sometimes calls toString()
when it throws an error (these crashes are tracked in
https://github.com/dart-lang/sdk/issues/34496 and bytecode generator
has a workaround to catch them).

As a result, after bytecode generation all ASTs were hanging out of
globalDebuggingNames, which leaks a lot of memory.

Fixes https://github.com/dart-lang/sdk/issues/38553

Change-Id: Ic1516d5ec9bf60861ae678e150c66d2e9394e2cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118914
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-26 03:24:42 +00:00
..
2019-09-19 10:42:10 +00:00