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

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

Issue 10353014: Start implementing checked mode and tools support for using it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 /** 5 /**
6 * Instead of emitting each SSA instruction with a temporary variable 6 * Instead of emitting each SSA instruction with a temporary variable
7 * mark instructions that can be emitted at their use-site. 7 * mark instructions that can be emitted at their use-site.
8 * For example, in: 8 * For example, in:
9 * t0 = 4; 9 * t0 = 4;
10 * t1 = 3; 10 * t1 = 3;
(...skipping 24 matching lines...) Expand all
35 for (HInstruction input in instruction.inputs) { 35 for (HInstruction input in instruction.inputs) {
36 if (!generateAtUseSite.contains(input) 36 if (!generateAtUseSite.contains(input)
37 && !input.isCodeMotionInvariant() 37 && !input.isCodeMotionInvariant()
38 && input.usedBy.length == 1 38 && input.usedBy.length == 1
39 && input is! HPhi) { 39 && input is! HPhi) {
40 expectedInputs.add(input); 40 expectedInputs.add(input);
41 } 41 }
42 } 42 }
43 } 43 }
44 44
45 void visitTypeConversion(HTypeConversion instruction) {
46 generateAtUseSite.add(instruction);
47 }
48
49 // The codegen might use the input multiple times, so it must not be 45 // The codegen might use the input multiple times, so it must not be
50 // set generate at use site. 46 // set generate at use site.
51 void visitIs(HIs instruction) {} 47 void visitIs(HIs instruction) {}
52 48
53 // A check method must not have its input generate at use site, 49 // A check method must not have its input generate at use site,
54 // because it's using it multiple times. 50 // because it's using it multiple times.
55 void visitCheck(HCheck instruction) {} 51 void visitCheck(HCheck instruction) {}
56 52
57 // A type guard should not generate its input at use site, otherwise 53 // A type guard should not generate its input at use site, otherwise
58 // they would not be alive. 54 // they would not be alive.
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 // improving the performance of future lookups. 488 // improving the performance of future lookups.
493 T root = getRepresentative(parent); 489 T root = getRepresentative(parent);
494 if (root !== parent) representative[element] = root; 490 if (root !== parent) representative[element] = root;
495 return root; 491 return root;
496 } 492 }
497 493
498 bool areEquivalent(T a, T b) { 494 bool areEquivalent(T a, T b) {
499 return getRepresentative(a) === getRepresentative(b); 495 return getRepresentative(a) === getRepresentative(b);
500 } 496 }
501 } 497 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698