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

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

Issue 2927093002: Support user class in compile_from_dill_test (Closed)
Patch Set: Updated cf. comments 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_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index b5e6dd1b4f2ecc412cffc9eb848c209d670f42ba..a6c50a25d066949727d05893f5a5c76aa100c66f 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -594,15 +594,20 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
..forEach(handleParameter);
// Set the locals handler state as if we were inlining the constructor.
- ConstructorElement astElement = _elementMap.getConstructor(constructor);
- ResolvedAst resolvedAst = astElement.resolvedAst;
+ ConstructorEntity astElement = _elementMap.getConstructor(constructor);
ClosureClassMap oldClosureData = localsHandler.closureData;
ClosureClassMap newClosureData =
closureToClassMapper.getMemberMap(astElement);
- localsHandler.closureData = newClosureData;
- if (resolvedAst.kind == ResolvedAstKind.PARSED) {
- localsHandler.enterScope(newClosureData.capturingScopes[resolvedAst.node],
- forGenerativeConstructorBody: astElement.isGenerativeConstructorBody);
+ if (astElement is ConstructorElement) {
+ // TODO(johnniwinther): Support constructor (body) entities.
+ ResolvedAst resolvedAst = astElement.resolvedAst;
+ localsHandler.closureData = newClosureData;
+ if (resolvedAst.kind == ResolvedAstKind.PARSED) {
+ localsHandler.enterScope(
+ newClosureData.capturingScopes[resolvedAst.node],
+ forGenerativeConstructorBody:
+ astElement.isGenerativeConstructorBody);
+ }
}
inlinedFrom(astElement, () {
_buildInitializers(constructor, constructorChain, fieldValues);
@@ -633,7 +638,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
if (parent is ir.Procedure &&
parent.kind == ir.ProcedureKind.Operator &&
parent.name.name == '==') {
- MethodElement method = _elementMap.getMethod(parent);
+ FunctionEntity method = _elementMap.getMethod(parent);
if (!backend.operatorEqHandlesNullArgument(method)) {
handleIf(
visitCondition: () {
@@ -644,7 +649,9 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
visitThen: () {
closeAndGotoExit(new HReturn(
graph.addConstantBool(false, closedWorld),
- sourceInformationBuilder.buildImplicitReturn(method)));
+ // TODO(johnniwinther): Provider source information like
+ // `sourceInformationBuilder.buildImplicitReturn(method)`.
+ null));
},
visitElse: null,
// TODO(27394): Add sourceInformation via
@@ -3036,7 +3043,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
return;
}
- ResolutionDartType typeValue =
+ DartType typeValue =
localsHandler.substInContext(_elementMap.getDartType(type));
if (type is ir.FunctionType) {
@@ -3064,10 +3071,11 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
}
if (_isInterfaceWithNoDynamicTypes(type)) {
+ InterfaceType interfaceType = typeValue;
HInstruction representations = typeBuilder
.buildTypeArgumentRepresentations(typeValue, sourceElement);
add(representations);
- ClassElement element = typeValue.element;
+ ClassEntity element = interfaceType.element;
js.Name operator = namer.operatorIs(element);
HInstruction isFieldName =
graph.addConstantStringFromName(operator, closedWorld);
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698