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

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

Issue 10119010: Start propagating non-primitive types in the backend, and fold instructions that know about the typ… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/builder.dart
===================================================================
--- lib/compiler/implementation/ssa/builder.dart (revision 6686)
+++ lib/compiler/implementation/ssa/builder.dart (working copy)
@@ -106,6 +106,10 @@
return compiler.findHelper(const SourceString('eq'));
}
+ Element getTripleEqualsInterceptor() {
+ return compiler.findHelper(const SourceString('eqq'));
+ }
+
Element getMapMaker() {
return compiler.findHelper(const SourceString('makeLiteralMap'));
}
@@ -2143,7 +2147,15 @@
// exception at runtime.
compiler.cancel('Unimplemented non-matching static call', node: node);
}
- push(new HInvokeStatic(selector, inputs));
+ HType type = HType.UNKNOWN;
+ if (element.isGenerativeConstructor()) {
+ ClassElement cls = element.enclosingElement;
+ type = new HNonPrimitiveType(cls.type);
+ } else if (element.isFactoryConstructor()
+ && element === compiler.listClass) {
+ type = HType.MUTABLE_ARRAY;
+ }
+ push(new HInvokeStatic(selector, inputs, type));
} else {
if (element.kind == ElementKind.GETTER) {
target = new HInvokeStatic(Selector.GETTER, inputs);
@@ -2652,7 +2664,8 @@
add(keyValuePairs);
add(mapMaker);
inputs = <HInstruction>[mapMaker, keyValuePairs];
- push(new HInvokeStatic(Selector.INVOCATION_1, inputs));
+ // TODO(ngeoffray): give the concrete type of our map literal.
+ push(new HInvokeStatic(Selector.INVOCATION_1, inputs, HType.UNKNOWN));
}
visitLiteralMapEntry(LiteralMapEntry node) {

Powered by Google App Engine
This is Rietveld 408576698