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

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

Issue 14404004: Throw NoSuchMethod or ArgumentError instead of generating a bailout, when we know the next instruct… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 HInstruction right = instruction.right; 101 HInstruction right = instruction.right;
102 if (singleIdentityComparison(left, right) != null) { 102 if (singleIdentityComparison(left, right) != null) {
103 super.visitIdentity(instruction); 103 super.visitIdentity(instruction);
104 } 104 }
105 // Do nothing. 105 // Do nothing.
106 } 106 }
107 107
108 void visitTypeConversion(HTypeConversion instruction) { 108 void visitTypeConversion(HTypeConversion instruction) {
109 if (!instruction.isChecked) { 109 if (!instruction.isChecked) {
110 markAsGenerateAtUseSite(instruction); 110 markAsGenerateAtUseSite(instruction);
111 } else if (!instruction.isArgumentTypeCheck) { 111 } else if (!instruction.isArgumentTypeCheck
112 && !instruction.isReceiverTypeCheck) {
112 assert(instruction.isCheckedModeCheck || instruction.isCastTypeCheck); 113 assert(instruction.isCheckedModeCheck || instruction.isCastTypeCheck);
113 // Checked mode checks and cast checks compile to code that 114 // Checked mode checks and cast checks compile to code that
114 // only use their input once, so we can safely visit them 115 // only use their input once, so we can safely visit them
115 // and try to merge the input. 116 // and try to merge the input.
116 visitInstruction(instruction); 117 visitInstruction(instruction);
117 } 118 }
118 } 119 }
119 120
120 void tryGenerateAtUseSite(HInstruction instruction) { 121 void tryGenerateAtUseSite(HInstruction instruction) {
121 if (instruction.isControlFlow()) return; 122 if (instruction.isControlFlow()) return;
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 } 368 }
368 369
369 // If [thenInput] is defined in the first predecessor, then it is only used 370 // If [thenInput] is defined in the first predecessor, then it is only used
370 // by [phi] and can be generated at use site. 371 // by [phi] and can be generated at use site.
371 if (identical(thenInput.block, end.predecessors[0])) { 372 if (identical(thenInput.block, end.predecessors[0])) {
372 assert(thenInput.usedBy.length == 1); 373 assert(thenInput.usedBy.length == 1);
373 markAsGenerateAtUseSite(thenInput); 374 markAsGenerateAtUseSite(thenInput);
374 } 375 }
375 } 376 }
376 } 377 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698