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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 17413013: Revert "Support runtime check of function types." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } else if (expressionMask.intersection(typeMask, compiler).isEmpty) { 589 } else if (expressionMask.intersection(typeMask, compiler).isEmpty) {
590 return graph.addConstantBool(false, compiler); 590 return graph.addConstantBool(false, compiler);
591 } 591 }
592 } 592 }
593 return node; 593 return node;
594 } 594 }
595 595
596 HInstruction visitTypeConversion(HTypeConversion node) { 596 HInstruction visitTypeConversion(HTypeConversion node) {
597 HInstruction value = node.inputs[0]; 597 HInstruction value = node.inputs[0];
598 DartType type = node.typeExpression; 598 DartType type = node.typeExpression;
599 if (type != null) { 599 if (type != null && (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE)) {
600 if (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE) { 600 return node;
601 return node;
602 }
603 if (type.kind == TypeKind.FUNCTION) {
604 // TODO(johnniwinther): Optimize function type conversions.
605 return node;
606 }
607 } 601 }
608 HType convertedType = node.instructionType; 602 HType convertedType = node.instructionType;
609 if (convertedType.isUnknown()) return node; 603 if (convertedType.isUnknown()) return node;
610 HType combinedType = value.instructionType.intersection( 604 HType combinedType = value.instructionType.intersection(
611 convertedType, compiler); 605 convertedType, compiler);
612 return (combinedType == value.instructionType) ? value : node; 606 return (combinedType == value.instructionType) ? value : node;
613 } 607 }
614 608
615 Element findConcreteFieldForDynamicAccess(HInstruction receiver, 609 Element findConcreteFieldForDynamicAccess(HInstruction receiver,
616 Selector selector) { 610 Selector selector) {
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 // that knows it is not of a specific Type. 1330 // that knows it is not of a specific Type.
1337 } 1331 }
1338 1332
1339 for (HIf ifUser in notIfUsers) { 1333 for (HIf ifUser in notIfUsers) {
1340 changeUsesDominatedBy(ifUser.elseBlock, input, convertedType); 1334 changeUsesDominatedBy(ifUser.elseBlock, input, convertedType);
1341 // TODO(ngeoffray): Also change uses for the then block on a HType 1335 // TODO(ngeoffray): Also change uses for the then block on a HType
1342 // that knows it is not of a specific Type. 1336 // that knows it is not of a specific Type.
1343 } 1337 }
1344 } 1338 }
1345 } 1339 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698