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

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

Issue 10532158: Some cleanup of recompilation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 isFinalOrConst = modifiers.isFinal() || modifiers.isConst(); 582 isFinalOrConst = modifiers.isFinal() || modifiers.isConst();
583 } 583 }
584 if (!compiler.resolverWorld.hasInvokedSetter(field, compiler)) { 584 if (!compiler.resolverWorld.hasInvokedSetter(field, compiler)) {
585 // If no setter is ever used for this field it is only initialized in the 585 // If no setter is ever used for this field it is only initialized in the
586 // initializer list. 586 // initializer list.
587 isFinalOrConst = true; 587 isFinalOrConst = true;
588 } 588 }
589 if (!isFinalOrConst && 589 if (!isFinalOrConst &&
590 !compiler.codegenWorld.hasInvokedSetter(field, compiler) && 590 !compiler.codegenWorld.hasInvokedSetter(field, compiler) &&
591 !compiler.codegenWorld.hasFieldSetter(field, compiler)) { 591 !compiler.codegenWorld.hasFieldSetter(field, compiler)) {
592 switch (compiler.pass) { 592 switch (compiler.phase) {
593 case 1: 593 case Compiler.PHASE_COMPILING:
594 compiler.enqueuer.codegen.registerRecompilationCandidate( 594 compiler.enqueuer.codegen.registerRecompilationCandidate(
595 work.element); 595 work.element);
ngeoffray 2012/06/15 20:12:59 I think putting such considerations into the new S
Søren Gjesse 2012/06/18 06:40:36 I will move it to the new SSA phase when it is in
596 break; 596 break;
597 case 2: 597 case Compiler.PHASE_RECOMPILING:
598 // If field is not final or const but no setters are used then the 598 // If field is not final or const but no setters are used then the
599 // field might be considered final anyway as it will be either 599 // field might be considered final anyway as it will be either
600 // un-initialized or initialized in the constructor initializer list. 600 // un-initialized or initialized in the constructor initializer list.
601 isFinalOrConst = true; 601 isFinalOrConst = true;
602 break; 602 break;
603 } 603 }
604 } 604 }
605 return new HFieldGet(field, node.inputs[0], isFinalOrConst: isFinalOrConst); 605 return new HFieldGet(field, node.inputs[0], isFinalOrConst: isFinalOrConst);
606 } 606 }
607 607
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 // the if block terminates. So any use of the instruction 1162 // the if block terminates. So any use of the instruction
1163 // after the join block should be changed to the new 1163 // after the join block should be changed to the new
1164 // instruction. 1164 // instruction.
1165 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType); 1165 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType);
1166 } 1166 }
1167 // TODO(ngeoffray): Also change uses for the then block on a HType 1167 // TODO(ngeoffray): Also change uses for the then block on a HType
1168 // that knows it is not of a specific Type. 1168 // that knows it is not of a specific Type.
1169 } 1169 }
1170 } 1170 }
1171 } 1171 }
OLDNEW
« lib/compiler/implementation/compiler.dart ('K') | « lib/compiler/implementation/enqueue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698