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

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

Issue 10539156: Track fields which are known to be always set to integer constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comment and addressed initializers Created 8 years, 6 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 779ff35e47f1be5794f37fb16b754a5035c5127c..540818d4e4959ae50855f3fb45b8bef852fb4cab 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1738,7 +1738,9 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
buffer.add(name);
Type type = node.receiver.propagatedType.computeType(compiler);
if (type != null) {
- world.registerFieldSetter(node.element.name, type);
+ world.registerFieldSetter(node.element.name,
+ type,
+ node.value.isInteger());
}
} else {
declareInstruction(node.receiver);
@@ -1768,6 +1770,17 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
visitForeignNew(HForeignNew node) {
+ var i = 0;
+ node.element.forEachInstanceField(
+ includeBackendMembers: true,
+ includeSuperMembers: true,
+ f: (ClassElement enclosingClass, Element member) {
+ world.registerFieldInitializer(member.name,
+ enclosingClass.computeType(compiler),
+ node.inputs[i].isInteger());
+
+ i++;
+ });
String jsClassReference = compiler.namer.isolateAccess(node.element);
beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
buffer.add('new $jsClassReference(');

Powered by Google App Engine
This is Rietveld 408576698