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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10139012: Refactor types in ssa nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More fixes. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index 4c76a2cf502db68b3bd021ea2f6fcd6bf339db65..9e68b48bc386adab62815142440415b3909bc2e8 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1488,6 +1488,10 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
endExpression(JSPrecedence.PREFIX_PRECEDENCE);
}
+ void checkExtendableArray(HInstruction input) {
+ compiler.unimplemented("check extendable array");
+ }
+
void checkNull(HInstruction input) {
beginExpression(JSPrecedence.EQUALITY_PRECEDENCE);
use(input, JSPrecedence.EQUALITY_PRECEDENCE);
@@ -1676,6 +1680,15 @@ class SsaOptimizedCodeGenerator extends SsaCodeGenerator {
checkString(input, '!==');
buffer.add(') ');
bailout(node, 'Not a string');
+ } else if (node.isExtendableArray()) {
+ buffer.add('if (');
+ checkObject(input, '!==');
+ buffer.add('||');
+ checkArray(input, '!==');
+ buffer.add('||');
+ checkExtendableArray(input);
+ buffer.add(') ');
+ bailout(node, 'Not an extendable array');
} else if (node.isMutableArray()) {
buffer.add('if (');
checkObject(input, '!==');
@@ -1685,14 +1698,14 @@ class SsaOptimizedCodeGenerator extends SsaCodeGenerator {
checkImmutableArray(input);
buffer.add(') ');
bailout(node, 'Not a mutable array');
- } else if (node.isArray()) {
+ } else if (node.isReadableArray()) {
buffer.add('if (');
checkObject(input, '!==');
buffer.add('||');
checkArray(input, '!==');
buffer.add(') ');
bailout(node, 'Not an array');
- } else if (node.isStringOrArray()) {
+ } else if (node.isIndexablePrimitive()) {
buffer.add('if (');
checkString(input, '!==');
buffer.add(' && (');

Powered by Google App Engine
This is Rietveld 408576698