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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2620593002: dart2js-kernel: handle 'dynamic' as an expression (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 void visitMapEntry(ir.MapEntry mapEntry) { 1226 void visitMapEntry(ir.MapEntry mapEntry) {
1227 // Visit value before the key because each will push an expression to the 1227 // Visit value before the key because each will push an expression to the
1228 // stack, so when we pop them off, the key is popped first, then the value. 1228 // stack, so when we pop them off, the key is popped first, then the value.
1229 mapEntry.value.accept(this); 1229 mapEntry.value.accept(this);
1230 mapEntry.key.accept(this); 1230 mapEntry.key.accept(this);
1231 } 1231 }
1232 1232
1233 @override 1233 @override
1234 void visitTypeLiteral(ir.TypeLiteral typeLiteral) { 1234 void visitTypeLiteral(ir.TypeLiteral typeLiteral) {
1235 ir.DartType type = typeLiteral.type; 1235 ir.DartType type = typeLiteral.type;
1236 if (type is ir.InterfaceType) { 1236 if (type is ir.InterfaceType || type is ir.DynamicType) {
1237 ConstantValue constant = astAdapter.getConstantForType(type); 1237 ConstantValue constant = astAdapter.getConstantForType(type);
1238 stack.add(graph.addConstant(constant, closedWorld)); 1238 stack.add(graph.addConstant(constant, closedWorld));
1239 return; 1239 return;
1240 } 1240 }
1241 if (type is ir.TypeParameterType) { 1241 if (type is ir.TypeParameterType) {
1242 // TODO(sra): Convert the type logic here to use ir.DartType. 1242 // TODO(sra): Convert the type logic here to use ir.DartType.
1243 ResolutionDartType dartType = astAdapter.getDartType(type); 1243 ResolutionDartType dartType = astAdapter.getDartType(type);
1244 dartType = localsHandler.substInContext(dartType); 1244 dartType = localsHandler.substInContext(dartType);
1245 HInstruction value = typeBuilder.analyzeTypeArgument( 1245 HInstruction value = typeBuilder.analyzeTypeArgument(
1246 dartType, sourceElement, 1246 dartType, sourceElement,
1247 sourceInformation: null); 1247 sourceInformation: null);
1248 _pushStaticInvocation(astAdapter.runtimeTypeToString, 1248 _pushStaticInvocation(astAdapter.runtimeTypeToString,
1249 <HInstruction>[value], commonMasks.stringType); 1249 <HInstruction>[value], commonMasks.stringType);
1250 _pushStaticInvocation(astAdapter.createRuntimeType, <HInstruction>[pop()], 1250 _pushStaticInvocation(astAdapter.createRuntimeType, <HInstruction>[pop()],
1251 astAdapter.createRuntimeTypeReturnType); 1251 astAdapter.createRuntimeTypeReturnType);
1252 return; 1252 return;
1253 } 1253 }
1254 // TODO(27394): 'dynamic' and function types observed. Where are they from? 1254 // TODO(27394): Function types observed. Where are they from?
1255 defaultExpression(typeLiteral); 1255 defaultExpression(typeLiteral);
1256 return; 1256 return;
1257 } 1257 }
1258 1258
1259 @override 1259 @override
1260 void visitStaticGet(ir.StaticGet staticGet) { 1260 void visitStaticGet(ir.StaticGet staticGet) {
1261 ir.Member staticTarget = staticGet.target; 1261 ir.Member staticTarget = staticGet.target;
1262 if (staticTarget is ir.Procedure && 1262 if (staticTarget is ir.Procedure &&
1263 staticTarget.kind == ir.ProcedureKind.Getter) { 1263 staticTarget.kind == ir.ProcedureKind.Getter) {
1264 // Invoke the getter 1264 // Invoke the getter
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 kernelBuilder.open(exitBlock); 2484 kernelBuilder.open(exitBlock);
2485 enterBlock.setBlockFlow( 2485 enterBlock.setBlockFlow(
2486 new HTryBlockInformation( 2486 new HTryBlockInformation(
2487 kernelBuilder.wrapStatementGraph(bodyGraph), 2487 kernelBuilder.wrapStatementGraph(bodyGraph),
2488 exception, 2488 exception,
2489 kernelBuilder.wrapStatementGraph(catchGraph), 2489 kernelBuilder.wrapStatementGraph(catchGraph),
2490 kernelBuilder.wrapStatementGraph(finallyGraph)), 2490 kernelBuilder.wrapStatementGraph(finallyGraph)),
2491 exitBlock); 2491 exitBlock);
2492 } 2492 }
2493 } 2493 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698