-
vogelheim authored
Expression::bounds_ is used only by a subset of compile passes, but the data structure occupies space for every Expression node ever parsed. This unneccessarily increases memory consumption. Particularly, peak memory consumption during startup, which may cause out-of-memory errors. This CL - removes Expression::bounds_; - introduces an AstTypeBounds container, which mappes Expression* to Bounds; - modifies the code that actually requires bounds information, namely Crankshaft compile and AsmWasmBuilder, to instantiate such an AstTypeBounds container before typing and to pass it to the code that consumes this information; and - modifies all accesses to Expression::bounds_ to instead access the bounds via the container instead. Additionally, this rewrites test-ast-expression-visitor. The reason is that this code attempted to test AstExpressionVisitor but did so exclusively through its subclass ExpressionTypeCollector, meaning that the test dealt almost exclusively with type bounds despite the class-under-test having no knowledge or functionality related to it. Worse, the test was written in a way to assume that type bounds were available outside & after compilation, which is something this change changes. BUG=v8:4947 Review-Url: https://codereview.chromium.org/1968383002 Cr-Commit-Position: refs/heads/master@{#36222}
bb04e124