Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8dea9aa

Browse files
johnniwinthercommit-bot@chromium.org
authored andcommitted
Share inlining cache between members
Change-Id: I7dde30abcd585016efad664d65911101a213288f Reviewed-on: https://dart-review.googlesource.com/75060 Reviewed-by: Stephen Adams <[email protected]> Commit-Queue: Johnni Winther <[email protected]>
1 parent 272473b commit 8dea9aa

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

pkg/compiler/lib/src/js_model/js_strategy.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,13 +1040,15 @@ class KernelSsaBuilder implements SsaBuilder {
10401040
final Compiler _compiler;
10411041
final JsToElementMap _elementMap;
10421042
final GlobalLocalsMap _globalLocalsMap;
1043+
FunctionInlineCache _inlineCache;
10431044

10441045
KernelSsaBuilder(
10451046
this.task, this._compiler, this._elementMap, this._globalLocalsMap);
10461047

10471048
@override
10481049
HGraph build(CodegenWorkItem work, JClosedWorld closedWorld,
10491050
GlobalTypeInferenceResults results) {
1051+
_inlineCache ??= new FunctionInlineCache(closedWorld.annotationsData);
10501052
return task.measure(() {
10511053
KernelSsaGraphBuilder builder = new KernelSsaGraphBuilder(
10521054
work.element,
@@ -1060,7 +1062,8 @@ class KernelSsaBuilder implements SsaBuilder {
10601062
work.registry,
10611063
_compiler.backendStrategy.closureDataLookup,
10621064
_compiler.backend.emitter.nativeEmitter,
1063-
_compiler.backend.sourceInformationStrategy);
1065+
_compiler.backend.sourceInformationStrategy,
1066+
_inlineCache);
10641067
return builder.build();
10651068
});
10661069
}

pkg/compiler/lib/src/ssa/builder_kernel.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,22 @@ class KernelSsaGraphBuilder extends ir.Visitor
126126
final FunctionInlineCache inlineCache;
127127

128128
KernelSsaGraphBuilder(
129-
this.initialTargetElement,
130-
InterfaceType instanceType,
131-
this.compiler,
132-
this._elementMap,
133-
this.globalInferenceResults,
134-
this._globalLocalsMap,
135-
this.closedWorld,
136-
this._worldBuilder,
137-
this.registry,
138-
this.closureDataLookup,
139-
this.nativeEmitter,
140-
this._sourceInformationStrategy,
141-
) : this.targetElement = _effectiveTargetElementFor(initialTargetElement),
129+
this.initialTargetElement,
130+
InterfaceType instanceType,
131+
this.compiler,
132+
this._elementMap,
133+
this.globalInferenceResults,
134+
this._globalLocalsMap,
135+
this.closedWorld,
136+
this._worldBuilder,
137+
this.registry,
138+
this.closureDataLookup,
139+
this.nativeEmitter,
140+
this._sourceInformationStrategy,
141+
this.inlineCache)
142+
: this.targetElement = _effectiveTargetElementFor(initialTargetElement),
142143
_infoReporter = compiler.dumpInfoTask,
143-
_allocatorAnalysis = closedWorld.allocatorAnalysis,
144-
inlineCache = new FunctionInlineCache(closedWorld.annotationsData) {
144+
_allocatorAnalysis = closedWorld.allocatorAnalysis {
145145
_enterFrame(targetElement, null);
146146
this.loopHandler = new KernelLoopHandler(this);
147147
typeBuilder = new KernelTypeBuilder(this, _elementMap, _globalLocalsMap);

0 commit comments

Comments
 (0)