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

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

Issue 44143002: Fix issue 12336: there was a bug when updating phis at exit of a block with a HTypeKnown instructio… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 /** 7 /**
8 * The [LiveRange] class covers a range where an instruction is live. 8 * The [LiveRange] class covers a range where an instruction is live.
9 */ 9 */
10 class LiveRange { 10 class LiveRange {
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 namer.allocateName(instruction); 675 namer.allocateName(instruction);
676 } 676 }
677 } 677 }
678 678
679 void handlePhi(HPhi phi, VariableNamer namer) { 679 void handlePhi(HPhi phi, VariableNamer namer) {
680 if (!needsName(phi)) return; 680 if (!needsName(phi)) return;
681 681
682 for (int i = 0; i < phi.inputs.length; i++) { 682 for (int i = 0; i < phi.inputs.length; i++) {
683 HInstruction input = phi.inputs[i]; 683 HInstruction input = phi.inputs[i];
684 HBasicBlock predecessor = phi.block.predecessors[i]; 684 HBasicBlock predecessor = phi.block.predecessors[i];
685 // A [HTypeKnown] instruction never has a name, but its checked
686 // input might, therefore we need to do a copy instead of an
687 // assignment.
688 while (input is HTypeKnown) input = input.inputs[0];
685 if (!needsName(input)) { 689 if (!needsName(input)) {
686 names.addAssignment(predecessor, input, phi); 690 names.addAssignment(predecessor, input, phi);
687 } else { 691 } else {
688 names.addCopy(predecessor, input, phi); 692 names.addCopy(predecessor, input, phi);
689 } 693 }
690 } 694 }
691 695
692 namer.allocateName(phi); 696 namer.allocateName(phi);
693 } 697 }
694 } 698 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/tracer.dart ('k') | tests/language/issue12336_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698