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

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

Issue 2954123002: Remove special casing of == null (Closed)
Patch Set: Created 3 years, 5 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../compiler.dart'; 9 import '../compiler.dart';
10 import '../constants/expressions.dart'; 10 import '../constants/expressions.dart';
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 } 573 }
574 574
575 TypeMask typeOfInvocation(ir.MethodInvocation send, ClosedWorld closedWorld) { 575 TypeMask typeOfInvocation(ir.MethodInvocation send, ClosedWorld closedWorld) {
576 ast.Node operatorNode = _astAdapter.kernel.nodeToAstOperator[send]; 576 ast.Node operatorNode = _astAdapter.kernel.nodeToAstOperator[send];
577 if (operatorNode != null) { 577 if (operatorNode != null) {
578 return _resultOf(_target).typeOfOperator(operatorNode); 578 return _resultOf(_target).typeOfOperator(operatorNode);
579 } 579 }
580 if (send.name.name == '[]=') { 580 if (send.name.name == '[]=') {
581 return closedWorld.commonMasks.dynamicType; 581 return closedWorld.commonMasks.dynamicType;
582 } 582 }
583 return _resultOf(_target).typeOfSend(_astAdapter.getNode(send)); 583 ast.Node node = _astAdapter.getNodeOrNull(send);
584 if (node == null) {
585 return closedWorld.commonMasks.dynamicType;
Siggi Cherem (dart-lang) 2017/06/23 20:43:37 should we list here what kind of `send` we expect
Johnni Winther 2017/06/26 10:47:40 Asserted that `send.name.name == 'null'`.
586 }
587 return _resultOf(_target).typeOfSend(node);
584 } 588 }
585 589
586 TypeMask typeOfGet(ir.PropertyGet getter) { 590 TypeMask typeOfGet(ir.PropertyGet getter) {
587 return _resultOf(_target).typeOfSend(_astAdapter.getNode(getter)); 591 return _resultOf(_target).typeOfSend(_astAdapter.getNode(getter));
588 } 592 }
589 593
590 TypeMask typeOfSet(ir.PropertySet setter, ClosedWorld closedWorld) { 594 TypeMask typeOfSet(ir.PropertySet setter, ClosedWorld closedWorld) {
591 return closedWorld.commonMasks.dynamicType; 595 return closedWorld.commonMasks.dynamicType;
592 } 596 }
593 597
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { 666 TypeMask selectorTypeOf(Selector selector, TypeMask mask) {
663 return TypeMaskFactory.inferredTypeForSelector( 667 return TypeMaskFactory.inferredTypeForSelector(
664 selector, mask, _globalInferenceResults); 668 selector, mask, _globalInferenceResults);
665 } 669 }
666 670
667 TypeMask typeFromNativeBehavior( 671 TypeMask typeFromNativeBehavior(
668 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { 672 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) {
669 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); 673 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld);
670 } 674 }
671 } 675 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698