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

Unified Diff: dart/frog/leg/ssa/codegen.dart

Issue 9395070: Triage Expect. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: dart/frog/leg/ssa/codegen.dart
diff --git a/dart/frog/leg/ssa/codegen.dart b/dart/frog/leg/ssa/codegen.dart
index 9898eedbea91b91dc9da966a5020f7f769987656..76e76b2f465a7aedf8c757509c196814c15413e3 100644
--- a/dart/frog/leg/ssa/codegen.dart
+++ b/dart/frog/leg/ssa/codegen.dart
@@ -805,8 +805,11 @@ class SsaCodeGenerator implements HVisitor {
checkObject(input, '===');
buffer.add(' && (');
if (element == coreLibrary.find(const SourceString('List'))) {
+ buffer.add('(');
+ checkObject(input, '===');
ngeoffray 2012/02/21 12:23:51 checkObject is already done line 805.
+ buffer.add(' && ');
checkArray(input, '===');
- buffer.add(' || ');
+ buffer.add(') || ');
}
buffer.add('!!(');
use(input);
@@ -890,15 +893,19 @@ class SsaOptimizedCodeGenerator extends SsaCodeGenerator {
bailout(node, 'Not a string');
} else if (node.isArray()) {
buffer.add('if (');
+ checkObject(input, '!==');
ngeoffray 2012/02/21 12:23:51 Please add a comment that this is actually a null
+ buffer.add('||');
checkArray(input, '!==');
buffer.add(') ');
bailout(node, 'Not an array');
} else if (node.isStringOrArray()) {
buffer.add('if (');
checkString(input, '!==');
- buffer.add(' && ');
+ buffer.add(' && (');
+ checkObject(input, '!==');
+ buffer.add('||');
checkArray(input, '!==');
- buffer.add(') ');
+ buffer.add(')) ');
bailout(node, 'Not a string or array');
} else {
unreachable();

Powered by Google App Engine
This is Rietveld 408576698