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

Side by Side Diff: pkg/compiler/lib/src/universe/codegen_world_builder.dart

Issue 2992863002: Support forEachClassMember on closure classes (Closed)
Patch Set: Updated cf. comments 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/compiler/lib/src/universe/member_usage.dart » ('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) 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 part of world_builder; 5 part of world_builder;
6 6
7 /// World builder specific to codegen. 7 /// World builder specific to codegen.
8 /// 8 ///
9 /// This adds additional access to liveness of selectors and elements. 9 /// This adds additional access to liveness of selectors and elements.
10 abstract class CodegenWorldBuilder implements WorldBuilder { 10 abstract class CodegenWorldBuilder implements WorldBuilder {
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 staticFunctionsNeedingGetter.add(staticUse.element); 342 staticFunctionsNeedingGetter.add(staticUse.element);
343 break; 343 break;
344 case StaticUseKind.SUPER_TEAR_OFF: 344 case StaticUseKind.SUPER_TEAR_OFF:
345 methodsNeedingSuperGetter.add(staticUse.element); 345 methodsNeedingSuperGetter.add(staticUse.element);
346 break; 346 break;
347 case StaticUseKind.SUPER_FIELD_SET: 347 case StaticUseKind.SUPER_FIELD_SET:
348 case StaticUseKind.FIELD_SET: 348 case StaticUseKind.FIELD_SET:
349 case StaticUseKind.GENERAL: 349 case StaticUseKind.GENERAL:
350 case StaticUseKind.DIRECT_USE: 350 case StaticUseKind.DIRECT_USE:
351 case StaticUseKind.CLOSURE: 351 case StaticUseKind.CLOSURE:
352 case StaticUseKind.CALL_METHOD:
352 case StaticUseKind.FIELD_GET: 353 case StaticUseKind.FIELD_GET:
353 case StaticUseKind.CONSTRUCTOR_INVOKE: 354 case StaticUseKind.CONSTRUCTOR_INVOKE:
354 case StaticUseKind.CONST_CONSTRUCTOR_INVOKE: 355 case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
355 case StaticUseKind.REDIRECTION: 356 case StaticUseKind.REDIRECTION:
356 case StaticUseKind.DIRECT_INVOKE: 357 case StaticUseKind.DIRECT_INVOKE:
357 case StaticUseKind.INLINING: 358 case StaticUseKind.INLINING:
358 break; 359 break;
359 } 360 }
360 } 361 }
361 362
(...skipping 10 matching lines...) Expand all
372 } 373 }
373 }); 374 });
374 EnumSet<MemberUse> useSet = new EnumSet<MemberUse>(); 375 EnumSet<MemberUse> useSet = new EnumSet<MemberUse>();
375 switch (staticUse.kind) { 376 switch (staticUse.kind) {
376 case StaticUseKind.STATIC_TEAR_OFF: 377 case StaticUseKind.STATIC_TEAR_OFF:
377 useSet.addAll(usage.tearOff()); 378 useSet.addAll(usage.tearOff());
378 break; 379 break;
379 case StaticUseKind.FIELD_GET: 380 case StaticUseKind.FIELD_GET:
380 case StaticUseKind.FIELD_SET: 381 case StaticUseKind.FIELD_SET:
381 case StaticUseKind.CLOSURE: 382 case StaticUseKind.CLOSURE:
383 case StaticUseKind.CALL_METHOD:
382 // TODO(johnniwinther): Avoid this. Currently [FIELD_GET] and 384 // TODO(johnniwinther): Avoid this. Currently [FIELD_GET] and
383 // [FIELD_SET] contains [BoxFieldElement]s which we cannot enqueue. 385 // [FIELD_SET] contains [BoxFieldElement]s which we cannot enqueue.
384 // Also [CLOSURE] contains [LocalFunctionElement] which we cannot 386 // Also [CLOSURE] contains [LocalFunctionElement] which we cannot
385 // enqueue. 387 // enqueue.
386 break; 388 break;
387 case StaticUseKind.SUPER_FIELD_SET: 389 case StaticUseKind.SUPER_FIELD_SET:
388 case StaticUseKind.SUPER_TEAR_OFF: 390 case StaticUseKind.SUPER_TEAR_OFF:
389 case StaticUseKind.GENERAL: 391 case StaticUseKind.GENERAL:
390 case StaticUseKind.DIRECT_USE: 392 case StaticUseKind.DIRECT_USE:
391 useSet.addAll(usage.normalUse()); 393 useSet.addAll(usage.normalUse());
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 658
657 @override 659 @override
658 void forEachInstanceField( 660 void forEachInstanceField(
659 ClassEntity cls, void f(ClassEntity declarer, FieldEntity field)) { 661 ClassEntity cls, void f(ClassEntity declarer, FieldEntity field)) {
660 _elementEnvironment.forEachClassMember(cls, 662 _elementEnvironment.forEachClassMember(cls,
661 (ClassEntity declarer, MemberEntity member) { 663 (ClassEntity declarer, MemberEntity member) {
662 if (member.isField && member.isInstanceMember) f(declarer, member); 664 if (member.isField && member.isInstanceMember) f(declarer, member);
663 }); 665 });
664 } 666 }
665 } 667 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/compiler/lib/src/universe/member_usage.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698