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

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

Issue 10660026: Don't allow statement-nodes in expression contexts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test for checked mode. Created 8 years, 5 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 #library('tracer'); 5 #library('tracer');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('ssa.dart'); 8 #import('ssa.dart');
9 #import('../leg.dart'); 9 #import('../leg.dart');
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return "Continue: (B${target.id})"; 236 return "Continue: (B${target.id})";
237 } 237 }
238 238
239 String visitDivide(HDivide node) => visitInvokeStatic(node); 239 String visitDivide(HDivide node) => visitInvokeStatic(node);
240 240
241 String visitEquals(HEquals node) => visitInvokeStatic(node); 241 String visitEquals(HEquals node) => visitInvokeStatic(node);
242 242
243 String visitExit(HExit node) => "exit"; 243 String visitExit(HExit node) => "exit";
244 244
245 String visitFieldGet(HFieldGet node) { 245 String visitFieldGet(HFieldGet node) {
246 return 'get ${temporaryId(node.receiver)}'; 246 String fieldName = node.element.name.slowToString();
247 return 'get ${temporaryId(node.receiver)}.$fieldName';
247 } 248 }
248 249
249 String visitFieldSet(HFieldSet node) { 250 String visitFieldSet(HFieldSet node) {
250 String valueId = temporaryId(node.value); 251 String valueId = temporaryId(node.value);
251 return 'set ${temporaryId(node.receiver)} to $valueId'; 252 String fieldName = node.element.name.slowToString();
253 return 'set ${temporaryId(node.receiver)}.$fieldName to $valueId';
252 } 254 }
253 255
254 String visitLocalGet(HLocalGet node) => visitFieldGet(node); 256 String visitLocalGet(HLocalGet node) => visitFieldGet(node);
255 String visitLocalSet(HLocalSet node) => visitFieldSet(node); 257 String visitLocalSet(HLocalSet node) => visitFieldSet(node);
256 258
257 String visitGoto(HGoto node) { 259 String visitGoto(HGoto node) {
258 HBasicBlock target = currentBlock.successors[0]; 260 HBasicBlock target = currentBlock.successors[0];
259 return "Goto: (B${target.id})"; 261 return "Goto: (B${target.id})";
260 } 262 }
261 263
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 } else { 473 } else {
472 throw new CompilerCancelledException('Unexpected type guard: $type'); 474 throw new CompilerCancelledException('Unexpected type guard: $type');
473 } 475 }
474 StringBuffer envBuffer = new StringBuffer(); 476 StringBuffer envBuffer = new StringBuffer();
475 List<HInstruction> inputs = node.inputs; 477 List<HInstruction> inputs = node.inputs;
476 for (int i = 0; i < inputs.length; i++) { 478 for (int i = 0; i < inputs.length; i++) {
477 if (inputs[i] !== node.guarded) { 479 if (inputs[i] !== node.guarded) {
478 envBuffer.add(" ${temporaryId(inputs[i])}"); 480 envBuffer.add(" ${temporaryId(inputs[i])}");
479 } 481 }
480 } 482 }
481 String on = node.isOn ? "on" : "off"; 483 String on = node.isEnabled ? "enabled" : "disabled";
482 String id = temporaryId(node.guarded); 484 String id = temporaryId(node.guarded);
483 return "TypeGuard($on): $id is $type env: $envBuffer"; 485 return "TypeGuard($on): $id is $type env: $envBuffer";
484 } 486 }
485 487
486 String visitIs(HIs node) { 488 String visitIs(HIs node) {
487 String type = node.typeExpression.toString(); 489 String type = node.typeExpression.toString();
488 return "TypeTest: ${temporaryId(node.expression)} is $type"; 490 return "TypeTest: ${temporaryId(node.expression)} is $type";
489 } 491 }
490 492
491 String visitTypeConversion(HTypeConversion node) { 493 String visitTypeConversion(HTypeConversion node) {
492 String type = node.propagatedType.toString(); 494 String type = node.propagatedType.toString();
493 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type"; 495 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type";
494 } 496 }
495 } 497 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698