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

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

Issue 10964016: Change the type inference for fields in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fixes and rebased Created 8 years, 3 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 087d657c4b2aaf64440db5358589fa36574014c3..38681f914948b5fe7da8b54006f8b205f5d224df 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1634,33 +1634,13 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
visitFieldSet(HFieldSet node) {
- if (work.element.isGenerativeConstructorBody() &&
- node.element.isMember() &&
- node.value.hasGuaranteedType() &&
- node.block.dominates(currentGraph.exit)) {
- backend.updateFieldConstructorSetters(node.element,
- node.value.guaranteedType);
- }
String name = backend.namer.getName(node.element);
DartType type = types[node.receiver].computeType(compiler);
if (type != null) {
if (!work.element.isGenerativeConstructorBody()) {
world.registerFieldSetter(
node.element.name, node.element.getLibrary(), type);
- }
- // Determine the types seen so far for the field. If only number
- // types have been seen and the value of the field set is a
- // simple number computation only depending on that field, we
- // can safely keep the number type for the field.
- HType fieldSettersType = backend.fieldSettersTypeSoFar(node.element);
- HType initializersType =
- backend.typeFromInitializersSoFar(node.element);
- HType fieldType = fieldSettersType.union(initializersType);
- if (HType.NUMBER.union(fieldType) == HType.NUMBER &&
- isSimpleFieldNumberComputation(node.value, node)) {
- backend.updateFieldSetters(node.element, HType.NUMBER);
- } else {
- backend.updateFieldSetters(node.element, types[node.value]);
+ backend.registerFieldSetter(node, types);
}
}
use(node.receiver);
@@ -1699,14 +1679,6 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
visitForeignNew(HForeignNew node) {
- int j = 0;
- node.element.forEachInstanceField(
- includeBackendMembers: true,
- includeSuperMembers: true,
- f: (ClassElement enclosingClass, Element member) {
- backend.updateFieldInitializers(member, types[node.inputs[j]]);
- j++;
- });
String jsClassReference = backend.namer.isolateAccess(node.element);
List<HInstruction> inputs = node.inputs;
// We can't use 'visitArguments', since our arguments start at input[0].

Powered by Google App Engine
This is Rietveld 408576698