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

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

Issue 10855170: Track types for arguments passed to calls to static functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 interface OptimizationPhase { 5 interface OptimizationPhase {
6 String get name(); 6 String get name();
7 void visitGraph(HGraph graph); 7 void visitGraph(HGraph graph);
8 } 8 }
9 9
10 class SsaOptimizerTask extends CompilerTask { 10 class SsaOptimizerTask extends CompilerTask {
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 556 }
557 557
558 HInstruction visitInvokeDynamicGetter(HInvokeDynamicGetter node) { 558 HInstruction visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
559 HInstruction receiver = node.inputs[0]; 559 HInstruction receiver = node.inputs[0];
560 if (!receiver.propagatedType.isUseful()) return node; 560 if (!receiver.propagatedType.isUseful()) return node;
561 if (receiver.propagatedType.canBeNull()) return node; 561 if (receiver.propagatedType.canBeNull()) return node;
562 Type type = receiver.propagatedType.computeType(compiler); 562 Type type = receiver.propagatedType.computeType(compiler);
563 if (type === null) return node; 563 if (type === null) return node;
564 Element field = compiler.world.locateSingleField(type, node.name); 564 Element field = compiler.world.locateSingleField(type, node.name);
565 if (field === null) return node; 565 if (field === null) return node;
566 if (field.getLibrary() !== work.element.getLibrary()) return node;
floitsch 2012/08/15 09:11:59 if (field.getLibrary() !== work.element.getLibrary
Søren Gjesse 2012/08/15 12:17:10 Moved to http://codereview.chromium.org/10830331/
566 Modifiers modifiers = field.modifiers; 567 Modifiers modifiers = field.modifiers;
567 bool isFinalOrConst = false; 568 bool isFinalOrConst = false;
568 if (modifiers != null) { 569 if (modifiers != null) {
569 isFinalOrConst = modifiers.isFinal() || modifiers.isConst(); 570 isFinalOrConst = modifiers.isFinal() || modifiers.isConst();
570 } 571 }
571 if (!compiler.resolverWorld.hasInvokedSetter(field, compiler)) { 572 if (!compiler.resolverWorld.hasInvokedSetter(field, compiler)) {
572 // If no setter is ever used for this field it is only initialized in the 573 // If no setter is ever used for this field it is only initialized in the
573 // initializer list. 574 // initializer list.
574 isFinalOrConst = true; 575 isFinalOrConst = true;
575 } 576 }
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 // this type for the field is still a strong signal 1307 // this type for the field is still a strong signal
1307 // indicating the expected type of the field. 1308 // indicating the expected type of the field.
1308 field.propagatedType = type; 1309 field.propagatedType = type;
1309 } else { 1310 } else {
1310 // If there are no invoked setters we know the type of 1311 // If there are no invoked setters we know the type of
1311 // this field for sure. 1312 // this field for sure.
1312 field.guaranteedType = type; 1313 field.guaranteedType = type;
1313 } 1314 }
1314 } 1315 }
1315 } 1316 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698