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

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

Issue 10391067: Remove wrong assert: the guarded instruction could be generate at use site if it is a HCheck instru… (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA code generator'; 7 String get name() => 'SSA code generator';
8 8
9 9
10 String buildJavaScriptFunction(FunctionElement element, 10 String buildJavaScriptFunction(FunctionElement element,
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 } else { 2251 } else {
2252 assert(guard.guarded is HParameterValue); 2252 assert(guard.guarded is HParameterValue);
2253 buffer.add(' 0'); 2253 buffer.add(' 0');
2254 } 2254 }
2255 buffer.add(')'); 2255 buffer.add(')');
2256 } 2256 }
2257 2257
2258 void visitTypeGuard(HTypeGuard node) { 2258 void visitTypeGuard(HTypeGuard node) {
2259 addIndentation(); 2259 addIndentation();
2260 HInstruction input = node.guarded; 2260 HInstruction input = node.guarded;
2261 assert(!isGenerateAtUseSite(input) || input.isCodeMotionInvariant());
2262 if (node.isInteger()) { 2261 if (node.isInteger()) {
2263 buffer.add('if ('); 2262 buffer.add('if (');
2264 checkInt(input, '!=='); 2263 checkInt(input, '!==');
2265 buffer.add(') '); 2264 buffer.add(') ');
2266 bailout(node, 'Not an integer'); 2265 bailout(node, 'Not an integer');
2267 } else if (node.isNumber()) { 2266 } else if (node.isNumber()) {
2268 buffer.add('if ('); 2267 buffer.add('if (');
2269 checkNum(input, '!=='); 2268 checkNum(input, '!==');
2270 buffer.add(') '); 2269 buffer.add(') ');
2271 bailout(node, 'Not a number'); 2270 bailout(node, 'Not a number');
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 startBailoutSwitch(); 2610 startBailoutSwitch();
2612 } 2611 }
2613 } 2612 }
2614 2613
2615 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { 2614 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) {
2616 if (labeledBlockInfo.body.start.hasGuards()) { 2615 if (labeledBlockInfo.body.start.hasGuards()) {
2617 endBailoutSwitch(); 2616 endBailoutSwitch();
2618 } 2617 }
2619 } 2618 }
2620 } 2619 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698