| Index: pkg/compiler/lib/src/cps_ir/inline.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/inline.dart b/pkg/compiler/lib/src/cps_ir/inline.dart
|
| index 2771aefc89cef8aa6176d703f5beb7e88d28c4b2..b112aeeb5c8e7fefe2ebd632dce29de84a599ac6 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/inline.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/inline.dart
|
| @@ -86,6 +86,9 @@ class InliningCache {
|
| static const int ABSENT = -1;
|
| static const int NO_INLINE = 0;
|
|
|
| + final Map<ExecutableElement, FunctionDefinition> unoptimized =
|
| + <ExecutableElement, FunctionDefinition>{};
|
| +
|
| final Map<ExecutableElement, List<CacheEntry>> map =
|
| <ExecutableElement, List<CacheEntry>>{};
|
|
|
| @@ -144,6 +147,29 @@ class InliningCache {
|
| }
|
| return ABSENT;
|
| }
|
| +
|
| + /// Cache the unoptimized CPS term for a function.
|
| + ///
|
| + /// The unoptimized term should not have any inlining-context-specific
|
| + /// optimizations applied to it. It will be used to compile the
|
| + /// non-specialized version of the function.
|
| + void putUnoptimized(ExecutableElement element, FunctionDefinition function) {
|
| + unoptimized.putIfAbsent(element, () => copier.copy(function));
|
| + }
|
| +
|
| + /// Look up the unoptimized CPS term for a function.
|
| + ///
|
| + /// The unoptimized term will not have any inlining-context-specific
|
| + /// optimizations applied to it. It can be used to compile the
|
| + /// non-specialized version of the function.
|
| + FunctionDefinition getUnoptimized(ExecutableElement element) {
|
| + FunctionDefinition function = unoptimized[element];
|
| + if (function != null) {
|
| + function = copier.copy(function);
|
| + ParentVisitor.setParents(function);
|
| + }
|
| + return function;
|
| + }
|
| }
|
|
|
| class Inliner implements Pass {
|
| @@ -443,7 +469,7 @@ class InliningVisitor extends TrampolineRecursiveVisitor {
|
| // body.
|
| function = buildAdapter(invoke, target);
|
| } else {
|
| - function = _inliner.functionCompiler.compileToCpsIr(target);
|
| + function = compileToCpsIr(target);
|
| void setValue(Variable variable, Reference<Primitive> value) {
|
| variable.type = value.definition.type;
|
| }
|
|
|