| Index: lib/compiler/implementation/ssa/builder.dart
|
| diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
|
| index 01149a64e0d5b9d5001d68794c98d6cc4d49d3dd..473def66ff819d5558c07989a9dd8da32df9523b 100644
|
| --- a/lib/compiler/implementation/ssa/builder.dart
|
| +++ b/lib/compiler/implementation/ssa/builder.dart
|
| @@ -153,7 +153,9 @@ class SsaBuilderTask extends CompilerTask {
|
| return measure(() {
|
| FunctionElement element = work.element;
|
| HInstruction.idCounter = 0;
|
| - SsaBuilder builder = new SsaBuilder(this, work);
|
| + FoldingOperations foldingOperations =
|
| + compiler.constantHandler.foldingOperations;
|
| + SsaBuilder builder = new SsaBuilder(foldingOperations, this, work);
|
| HGraph graph;
|
| ElementKind kind = element.kind;
|
| if (kind === ElementKind.GENERATIVE_CONSTRUCTOR) {
|
| @@ -797,6 +799,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| final SsaBuilderTask builder;
|
| final Interceptors interceptors;
|
| final WorkItem work;
|
| + final FoldingOperations foldingOperations;
|
| bool methodInterceptionEnabled;
|
| HGraph graph;
|
| LocalsHandler localsHandler;
|
| @@ -827,7 +830,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| Compiler get compiler() => builder.compiler;
|
| CodeEmitterTask get emitter() => builder.emitter;
|
|
|
| - SsaBuilder(SsaBuilderTask builder, WorkItem work)
|
| + SsaBuilder(this.foldingOperations, SsaBuilderTask builder, WorkItem work)
|
| : this.builder = builder,
|
| this.work = work,
|
| interceptors = builder.interceptors,
|
| @@ -1639,7 +1642,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| // See if we can constant-fold right away. This avoids rewrites later on.
|
| if (operand is HConstant) {
|
| HConstant constant = operand;
|
| - Constant folded = result.operation.fold(constant.constant);
|
| + Constant folded =
|
| + result.operation(foldingOperations).fold(constant.constant);
|
| if (folded !== null) {
|
| stack.add(graph.addConstant(folded));
|
| return;
|
|
|