Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2932883002: Add FrontendStrategy.commonElements and remove Backend.commonElements (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 57aabba6381bd44df6869b672aa2e354317cf68a..a99368812bc41719946c6e8c2a6bfccc07a656cf 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -68,7 +68,8 @@ abstract class SsaAstBuilderBase extends CompilerTask
///
/// If the field is constant, no code is needed for the field and the method
/// return `true`.
- bool handleConstantField(ElementCodegenWorkItem work) {
+ bool handleConstantField(
+ ElementCodegenWorkItem work, ClosedWorld closedWorld) {
MemberElement element = work.element;
if (element.isField) {
FieldElement field = element;
@@ -102,7 +103,8 @@ abstract class SsaAstBuilderBase extends CompilerTask
// the static variable.
// We also need to register the use of the cyclic-error helper.
work.registry.worldImpact.registerStaticUse(new StaticUse.staticInvoke(
- backend.commonElements.cyclicThrowHelper, CallStructure.ONE_ARG));
+ closedWorld.commonElements.cyclicThrowHelper,
+ CallStructure.ONE_ARG));
}
}
return false;
@@ -123,7 +125,7 @@ class SsaAstBuilderTask extends SsaAstBuilderBase {
HGraph build(ElementCodegenWorkItem work, ClosedWorld closedWorld) {
return measure(() {
- if (handleConstantField(work)) {
+ if (handleConstantField(work, closedWorld)) {
// No code is generated for `work.element`.
return null;
}
@@ -2517,7 +2519,7 @@ class SsaBuilder extends ast.Visitor
HInstruction call = pop();
return new HIs.compound(type, expression, call, commonMasks.boolType);
} else {
- if (backend.hasDirectCheckFor(type)) {
+ if (backend.hasDirectCheckFor(closedWorld.commonElements, type)) {
return new HIs.direct(type, expression, commonMasks.boolType);
}
// The interceptor is not always needed. It is removed by optimization
@@ -3700,7 +3702,7 @@ class SsaBuilder extends ast.Visitor
@override
void visitTopLevelFunctionInvoke(ast.Send node, MethodElement function,
ast.NodeList arguments, CallStructure callStructure, _) {
- if (backend.isForeign(function)) {
+ if (backend.isForeign(closedWorld.commonElements, function)) {
handleForeignSend(node, function);
} else {
generateStaticFunctionInvoke(node, function, callStructure);
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_strategy.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698