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

Side by Side Diff: pkg/compiler/lib/src/js_model/elements.dart

Issue 2968383002: Add ConstructorBodyEntity (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) 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.js_model.elements; 5 library dart2js.js_model.elements;
6 6
7 import '../common_elements.dart'; 7 import '../common_elements.dart';
8 import '../constants/constant_system.dart'; 8 import '../constants/constant_system.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../elements/entities.dart'; 10 import '../elements/entities.dart';
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 {bool isExternal, 129 {bool isExternal,
130 bool isConst, 130 bool isConst,
131 bool isFromEnvironmentConstructor}) { 131 bool isFromEnvironmentConstructor}) {
132 return new JFactoryConstructor( 132 return new JFactoryConstructor(
133 memberIndex, enclosingClass, name, parameterStructure, 133 memberIndex, enclosingClass, name, parameterStructure,
134 isExternal: isExternal, 134 isExternal: isExternal,
135 isConst: isConst, 135 isConst: isConst,
136 isFromEnvironmentConstructor: isFromEnvironmentConstructor); 136 isFromEnvironmentConstructor: isFromEnvironmentConstructor);
137 } 137 }
138 138
139 ConstructorBodyEntity createConstructorBody(
140 int memberIndex, ConstructorEntity constructor) {
141 return new JConstructorBody(memberIndex, constructor);
142 }
143
139 IndexedFunction createGetter(int memberIndex, LibraryEntity library, 144 IndexedFunction createGetter(int memberIndex, LibraryEntity library,
140 ClassEntity enclosingClass, Name name, AsyncMarker asyncMarker, 145 ClassEntity enclosingClass, Name name, AsyncMarker asyncMarker,
141 {bool isStatic, bool isExternal, bool isAbstract}) { 146 {bool isStatic, bool isExternal, bool isAbstract}) {
142 return new JGetter(memberIndex, library, enclosingClass, name, asyncMarker, 147 return new JGetter(memberIndex, library, enclosingClass, name, asyncMarker,
143 isStatic: isStatic, isExternal: isExternal, isAbstract: isAbstract); 148 isStatic: isStatic, isExternal: isExternal, isAbstract: isAbstract);
144 } 149 }
145 150
146 IndexedFunction createMethod( 151 IndexedFunction createMethod(
147 int memberIndex, 152 int memberIndex,
148 LibraryEntity library, 153 LibraryEntity library,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 : super(memberIndex, enclosingClass, name, parameterStructure, 440 : super(memberIndex, enclosingClass, name, parameterStructure,
436 isExternal: isExternal, isConst: isConst); 441 isExternal: isExternal, isConst: isConst);
437 442
438 @override 443 @override
439 bool get isFactoryConstructor => true; 444 bool get isFactoryConstructor => true;
440 445
441 @override 446 @override
442 bool get isGenerativeConstructor => false; 447 bool get isGenerativeConstructor => false;
443 } 448 }
444 449
450 class JConstructorBody extends JFunction implements ConstructorBodyEntity {
451 final ConstructorEntity constructor;
452
453 JConstructorBody(int memberIndex, this.constructor)
454 : super(
455 memberIndex,
456 constructor.library,
457 constructor.enclosingClass,
458 constructor.memberName,
459 constructor.parameterStructure,
460 AsyncMarker.SYNC,
461 isStatic: false,
462 isExternal: false);
463
464 @override
465 bool get isFunction => true;
466
467 String get _kind => 'constructor_body';
468 }
469
445 class JMethod extends JFunction { 470 class JMethod extends JFunction {
446 final bool isAbstract; 471 final bool isAbstract;
447 472
448 JMethod(int memberIndex, JLibrary library, JClass enclosingClass, Name name, 473 JMethod(int memberIndex, JLibrary library, JClass enclosingClass, Name name,
449 ParameterStructure parameterStructure, AsyncMarker asyncMarker, 474 ParameterStructure parameterStructure, AsyncMarker asyncMarker,
450 {bool isStatic, bool isExternal, this.isAbstract}) 475 {bool isStatic, bool isExternal, this.isAbstract})
451 : super(memberIndex, library, enclosingClass, name, parameterStructure, 476 : super(memberIndex, library, enclosingClass, name, parameterStructure,
452 asyncMarker, 477 asyncMarker,
453 isStatic: isStatic, isExternal: isExternal); 478 isStatic: isStatic, isExternal: isExternal);
454 479
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 745
721 @override 746 @override
722 bool get isFunctionApplyUsed => _backendUsage.isFunctionApplyUsed; 747 bool get isFunctionApplyUsed => _backendUsage.isFunctionApplyUsed;
723 748
724 @override 749 @override
725 bool get isMirrorsUsed => _backendUsage.isMirrorsUsed; 750 bool get isMirrorsUsed => _backendUsage.isMirrorsUsed;
726 751
727 @override 752 @override
728 bool get isNoSuchMethodUsed => _backendUsage.isNoSuchMethodUsed; 753 bool get isNoSuchMethodUsed => _backendUsage.isNoSuchMethodUsed;
729 } 754 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698