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

Side by Side Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 2791993002: Fix dart2js warnings and add test to ensure it stays clean. (Closed)
Patch Set: Remove unused method. Created 3 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 unified diff | Download patch
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 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 5 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
6 import '../common/names.dart' show Selectors; 6 import '../common/names.dart' show Selectors;
7 import '../common/tasks.dart' show CompilerTask; 7 import '../common/tasks.dart' show CompilerTask;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // makes the field load available to further optimization, e.g. LICM. 511 // makes the field load available to further optimization, e.g. LICM.
512 512
513 if (element != null && 513 if (element != null &&
514 element.isField && 514 element.isField &&
515 element.name == node.selector.name) { 515 element.name == node.selector.name) {
516 FieldEntity field = element; 516 FieldEntity field = element;
517 if (!_nativeData.isNativeMember(field) && 517 if (!_nativeData.isNativeMember(field) &&
518 !node.isCallOnInterceptor(_closedWorld)) { 518 !node.isCallOnInterceptor(_closedWorld)) {
519 HInstruction receiver = node.getDartReceiver(_closedWorld); 519 HInstruction receiver = node.getDartReceiver(_closedWorld);
520 TypeMask type = TypeMaskFactory.inferredTypeForMember( 520 TypeMask type = TypeMaskFactory.inferredTypeForMember(
521 field as Entity, _globalInferenceResults); 521 // ignore: ARGUMENT_TYPE_NOT_ASSIGNABLE
522 field,
Johnni Winther 2017/04/03 12:07:33 Reinsert the cast and ignore the hint.
ahe 2017/04/03 12:25:07 Done.
523 _globalInferenceResults);
522 HInstruction load = new HFieldGet(field, receiver, type); 524 HInstruction load = new HFieldGet(field, receiver, type);
523 node.block.addBefore(node, load); 525 node.block.addBefore(node, load);
524 Selector callSelector = new Selector.callClosureFrom(node.selector); 526 Selector callSelector = new Selector.callClosureFrom(node.selector);
525 List<HInstruction> inputs = <HInstruction>[load] 527 List<HInstruction> inputs = <HInstruction>[load]
526 ..addAll(node.inputs.skip(node.isInterceptedCall ? 2 : 1)); 528 ..addAll(node.inputs.skip(node.isInterceptedCall ? 2 : 1));
527 HInstruction closureCall = 529 HInstruction closureCall =
528 new HInvokeClosure(callSelector, inputs, node.instructionType) 530 new HInvokeClosure(callSelector, inputs, node.instructionType)
529 ..sourceInformation = node.sourceInformation; 531 ..sourceInformation = node.sourceInformation;
530 node.block.addAfter(load, closureCall); 532 node.block.addAfter(load, closureCall);
531 return closureCall; 533 return closureCall;
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 990
989 HInstruction directFieldGet(HInstruction receiver, FieldEntity field) { 991 HInstruction directFieldGet(HInstruction receiver, FieldEntity field) {
990 bool isAssignable = !_closedWorld.fieldNeverChanges(field); 992 bool isAssignable = !_closedWorld.fieldNeverChanges(field);
991 993
992 TypeMask type; 994 TypeMask type;
993 if (_nativeData.isNativeClass(field.enclosingClass)) { 995 if (_nativeData.isNativeClass(field.enclosingClass)) {
994 type = TypeMaskFactory.fromNativeBehavior( 996 type = TypeMaskFactory.fromNativeBehavior(
995 _nativeData.getNativeFieldLoadBehavior(field), _closedWorld); 997 _nativeData.getNativeFieldLoadBehavior(field), _closedWorld);
996 } else { 998 } else {
997 type = TypeMaskFactory.inferredTypeForMember( 999 type = TypeMaskFactory.inferredTypeForMember(
998 field as Entity, _globalInferenceResults); 1000 // ignore: ARGUMENT_TYPE_NOT_ASSIGNABLE
1001 field,
Johnni Winther 2017/04/03 12:07:33 Reinsert the cast and ignore the hint.
ahe 2017/04/03 12:25:07 Done.
1002 _globalInferenceResults);
999 } 1003 }
1000 1004
1001 return new HFieldGet(field, receiver, type, isAssignable: isAssignable); 1005 return new HFieldGet(field, receiver, type, isAssignable: isAssignable);
1002 } 1006 }
1003 1007
1004 HInstruction visitInvokeDynamicSetter(HInvokeDynamicSetter node) { 1008 HInstruction visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
1005 if (node.isInterceptedCall) { 1009 if (node.isInterceptedCall) {
1006 HInstruction folded = handleInterceptedCall(node); 1010 HInstruction folded = handleInterceptedCall(node);
1007 if (folded != node) return folded; 1011 if (folded != node) return folded;
1008 } 1012 }
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 memorySet.registerFieldValueUpdate( 2376 memorySet.registerFieldValueUpdate(
2373 instruction.element, receiver, instruction.inputs.last); 2377 instruction.element, receiver, instruction.inputs.last);
2374 } 2378 }
2375 2379
2376 void visitCreate(HCreate instruction) { 2380 void visitCreate(HCreate instruction) {
2377 memorySet.registerAllocation(instruction); 2381 memorySet.registerAllocation(instruction);
2378 if (shouldTrackInitialValues(instruction)) { 2382 if (shouldTrackInitialValues(instruction)) {
2379 int argumentIndex = 0; 2383 int argumentIndex = 0;
2380 compiler.codegenWorldBuilder.forEachInstanceField(instruction.element, 2384 compiler.codegenWorldBuilder.forEachInstanceField(instruction.element,
2381 (_, FieldEntity member) { 2385 (_, FieldEntity member) {
2382 if (compiler.elementHasCompileTimeError(member as Entity)) return; 2386 if (compiler.elementHasCompileTimeError(
2387 // ignore: ARGUMENT_TYPE_NOT_ASSIGNABLE
2388 member)) {
Johnni Winther 2017/04/03 12:07:33 Reinsert the cast and ignore the hint.
ahe 2017/04/03 12:25:07 Done.
2389 return;
2390 }
2383 memorySet.registerFieldValue( 2391 memorySet.registerFieldValue(
2384 member, instruction, instruction.inputs[argumentIndex++]); 2392 member, instruction, instruction.inputs[argumentIndex++]);
2385 }); 2393 });
2386 } 2394 }
2387 // In case this instruction has as input non-escaping objects, we 2395 // In case this instruction has as input non-escaping objects, we
2388 // need to mark these objects as escaping. 2396 // need to mark these objects as escaping.
2389 memorySet.killAffectedBy(instruction); 2397 memorySet.killAffectedBy(instruction);
2390 } 2398 }
2391 2399
2392 bool shouldTrackInitialValues(HCreate instruction) { 2400 bool shouldTrackInitialValues(HCreate instruction) {
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 2828
2821 keyedValues.forEach((receiver, values) { 2829 keyedValues.forEach((receiver, values) {
2822 result.keyedValues[receiver] = 2830 result.keyedValues[receiver] =
2823 new Map<HInstruction, HInstruction>.from(values); 2831 new Map<HInstruction, HInstruction>.from(values);
2824 }); 2832 });
2825 2833
2826 result.nonEscapingReceivers.addAll(nonEscapingReceivers); 2834 result.nonEscapingReceivers.addAll(nonEscapingReceivers);
2827 return result; 2835 return result;
2828 } 2836 }
2829 } 2837 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698