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

Side by Side Diff: pkg/compiler/lib/src/kernel/env.dart

Issue 3001823002: Revert "Various redemptions" (Closed)
Patch Set: Created 3 years, 4 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 library dart2js.kernel.env; 5 library dart2js.kernel.env;
6 6
7 import 'package:kernel/ast.dart' as ir; 7 import 'package:kernel/ast.dart' as ir;
8 import 'package:kernel/clone.dart'; 8 import 'package:kernel/clone.dart';
9 import 'package:kernel/type_algebra.dart'; 9 import 'package:kernel/type_algebra.dart';
10 10
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 return _constantConstructor; 556 return _constantConstructor;
557 } 557 }
558 558
559 @override 559 @override
560 ConstructorData copy() { 560 ConstructorData copy() {
561 return new ConstructorDataImpl(node, functionNode, definition); 561 return new ConstructorDataImpl(node, functionNode, definition);
562 } 562 }
563 } 563 }
564 564
565 abstract class FieldData extends MemberData { 565 abstract class FieldData extends MemberData {
566 DartType getFieldType(KernelToElementMap elementMap);
567
568 ConstantExpression getFieldConstant( 566 ConstantExpression getFieldConstant(
569 KernelToElementMapBase elementMap, FieldEntity field); 567 KernelToElementMapBase elementMap, FieldEntity field);
570 } 568 }
571 569
572 class FieldDataImpl extends MemberDataImpl implements FieldData { 570 class FieldDataImpl extends MemberDataImpl implements FieldData {
573 DartType _type;
574 ConstantExpression _constant; 571 ConstantExpression _constant;
575 572
576 FieldDataImpl(ir.Field node, MemberDefinition definition) 573 FieldDataImpl(ir.Field node, MemberDefinition definition)
577 : super(node, definition); 574 : super(node, definition);
578 575
579 ir.Field get node => super.node; 576 ir.Field get node => super.node;
580 577
581 DartType getFieldType(covariant KernelToElementMapBase elementMap) {
582 return _type ??= elementMap.getDartType(node.type);
583 }
584
585 ConstantExpression getFieldConstant( 578 ConstantExpression getFieldConstant(
586 KernelToElementMapBase elementMap, FieldEntity field) { 579 KernelToElementMapBase elementMap, FieldEntity field) {
587 if (_constant == null) { 580 if (_constant == null) {
588 if (node.isConst) { 581 if (node.isConst) {
589 _constant = new Constantifier(elementMap).visit(node.initializer); 582 _constant = new Constantifier(elementMap).visit(node.initializer);
590 } else { 583 } else {
591 failedAt( 584 failedAt(
592 field, 585 field,
593 "Unexpected field $field in " 586 "Unexpected field $field in "
594 "FieldDataImpl.getFieldConstant"); 587 "FieldDataImpl.getFieldConstant");
595 } 588 }
596 } 589 }
597 return _constant; 590 return _constant;
598 } 591 }
599 592
600 @override 593 @override
601 FieldData copy() { 594 FieldData copy() {
602 return new FieldDataImpl(node, definition); 595 return new FieldDataImpl(node, definition);
603 } 596 }
604 } 597 }
605 598
606 class TypedefData { 599 class TypedefData {
607 final ir.Typedef node; 600 final ir.Typedef node;
608 final TypedefEntity element; 601 final TypedefEntity element;
609 final TypedefType rawType; 602 final TypedefType rawType;
610 603
611 TypedefData(this.node, this.element, this.rawType); 604 TypedefData(this.node, this.element, this.rawType);
612 } 605 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698