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

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

Issue 13019003: Enable full type-checks in checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use HTypeConversion instead of HIs. Created 7 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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * Instead of emitting each SSA instruction with a temporary variable 8 * Instead of emitting each SSA instruction with a temporary variable
9 * mark instructions that can be emitted at their use-site. 9 * mark instructions that can be emitted at their use-site.
10 * For example, in: 10 * For example, in:
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 return false; 262 return false;
263 } 263 }
264 264
265 bool isSafeToGenerateAtUseSite(HInstruction user, HInstruction input) { 265 bool isSafeToGenerateAtUseSite(HInstruction user, HInstruction input) {
266 // A [HForeign] instruction uses operators and if we generate 266 // A [HForeign] instruction uses operators and if we generate
267 // [input] at use site, the precedence might be wrong. 267 // [input] at use site, the precedence might be wrong.
268 if (user is HForeign) return false; 268 if (user is HForeign) return false;
269 // A [HCheck] instruction with control flow uses its input 269 // A [HCheck] instruction with control flow uses its input
270 // multiple times, so we avoid generating it at use site. 270 // multiple times, so we avoid generating it at use site.
271 if (user is HCheck && user.isControlFlow()) return false; 271 if (user is HCheck && user.isControlFlow()) return false;
272 // A [HIs] instruction uses its input multiple times, so we
273 // avoid generating it at use site.
274 if (user is HIs) return false;
ngeoffray 2013/05/13 09:10:59 I think you still need this.
karlklose 2013/05/14 13:49:41 Done.
275 return true; 272 return true;
276 } 273 }
277 274
278 void visitBasicBlock(HBasicBlock block) { 275 void visitBasicBlock(HBasicBlock block) {
279 if (block.last is !HIf) return; 276 if (block.last is !HIf) return;
280 HIf startIf = block.last; 277 HIf startIf = block.last;
281 HBasicBlock end = startIf.joinBlock; 278 HBasicBlock end = startIf.joinBlock;
282 279
283 // We check that the structure is the following: 280 // We check that the structure is the following:
284 // If 281 // If
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 369 }
373 370
374 // If [thenInput] is defined in the first predecessor, then it is only used 371 // If [thenInput] is defined in the first predecessor, then it is only used
375 // by [phi] and can be generated at use site. 372 // by [phi] and can be generated at use site.
376 if (identical(thenInput.block, end.predecessors[0])) { 373 if (identical(thenInput.block, end.predecessors[0])) {
377 assert(thenInput.usedBy.length == 1); 374 assert(thenInput.usedBy.length == 1);
378 markAsGenerateAtUseSite(thenInput); 375 markAsGenerateAtUseSite(thenInput);
379 } 376 }
380 } 377 }
381 } 378 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698