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

Side by Side Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 11365030: Fix issue 6452: do not change a dynamic setter call to a field set in case the field is not assigna… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of ssa; 5 part of ssa;
6 6
7 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 result.guaranteedType = type; 609 result.guaranteedType = type;
610 backend.registerFieldTypesOptimization( 610 backend.registerFieldTypesOptimization(
611 work.element, field, result.guaranteedType); 611 work.element, field, result.guaranteedType);
612 } 612 }
613 return result; 613 return result;
614 } 614 }
615 615
616 HInstruction visitInvokeDynamicSetter(HInvokeDynamicSetter node) { 616 HInstruction visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
617 Element field = 617 Element field =
618 findConcreteFieldForDynamicAccess(node.receiver, node.selector); 618 findConcreteFieldForDynamicAccess(node.receiver, node.selector);
619 if (field == null) return node; 619 if (field == null || !field.isAssignable()) return node;
620 HInstruction value = node.inputs[1]; 620 HInstruction value = node.inputs[1];
621 if (compiler.enableTypeAssertions) { 621 if (compiler.enableTypeAssertions) {
622 HInstruction other = value.convertType( 622 HInstruction other = value.convertType(
623 compiler, field, HTypeConversion.CHECKED_MODE_CHECK); 623 compiler, field, HTypeConversion.CHECKED_MODE_CHECK);
624 if (other != value) { 624 if (other != value) {
625 node.block.addBefore(node, other); 625 node.block.addBefore(node, other);
626 value = other; 626 value = other;
627 } 627 }
628 } 628 }
629 return new HFieldSet(field, node.inputs[0], value); 629 return new HFieldSet(field, node.inputs[0], value);
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 } 1340 }
1341 1341
1342 // For other fields having setters in the generative constructor body, set 1342 // For other fields having setters in the generative constructor body, set
1343 // the type to UNKNOWN to avoid relying on the type set in the initializer 1343 // the type to UNKNOWN to avoid relying on the type set in the initializer
1344 // list. 1344 // list.
1345 allSetters.forEach((Element element) { 1345 allSetters.forEach((Element element) {
1346 backend.registerFieldConstructor(element, HType.UNKNOWN); 1346 backend.registerFieldConstructor(element, HType.UNKNOWN);
1347 }); 1347 });
1348 } 1348 }
1349 } 1349 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698