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

Side by Side Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 1435053002: Register super field set explicitly in the universe. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Checked mode fix Created 5 years, 1 month 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 library dart2js.resolution.members; 5 library dart2js.resolution.members;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show 8 import '../common/names.dart' show
9 Selectors; 9 Selectors;
10 import '../common/resolution.dart' show 10 import '../common/resolution.dart' show
(...skipping 3343 matching lines...) Expand 10 before | Expand all | Expand 10 after
3354 void registerStaticUses(AccessSemantics semantics) { 3354 void registerStaticUses(AccessSemantics semantics) {
3355 switch (semantics.kind) { 3355 switch (semantics.kind) {
3356 case AccessKind.SUPER_METHOD: 3356 case AccessKind.SUPER_METHOD:
3357 registry.registerStaticUse( 3357 registry.registerStaticUse(
3358 new StaticUse.superTearOff(semantics.element)); 3358 new StaticUse.superTearOff(semantics.element));
3359 break; 3359 break;
3360 case AccessKind.SUPER_GETTER: 3360 case AccessKind.SUPER_GETTER:
3361 registry.registerStaticUse(new StaticUse.superGet(semantics.getter)); 3361 registry.registerStaticUse(new StaticUse.superGet(semantics.getter));
3362 break; 3362 break;
3363 case AccessKind.SUPER_SETTER: 3363 case AccessKind.SUPER_SETTER:
3364 registry.registerStaticUse(new StaticUse.superSet(semantics.setter)); 3364 registry.registerStaticUse(
3365 new StaticUse.superSetterSet(semantics.setter));
3365 break; 3366 break;
3366 case AccessKind.SUPER_FIELD: 3367 case AccessKind.SUPER_FIELD:
3367 registry.registerStaticUse( 3368 registry.registerStaticUse(
3368 new StaticUse.superGet(semantics.element)); 3369 new StaticUse.superGet(semantics.element));
3369 registry.registerStaticUse( 3370 registry.registerStaticUse(
3370 new StaticUse.superSet(semantics.element)); 3371 new StaticUse.superFieldSet(semantics.element));
3371 break; 3372 break;
3372 case AccessKind.SUPER_FINAL_FIELD: 3373 case AccessKind.SUPER_FINAL_FIELD:
3373 registry.registerStaticUse( 3374 registry.registerStaticUse(
3374 new StaticUse.superGet(semantics.element)); 3375 new StaticUse.superGet(semantics.element));
3375 break; 3376 break;
3376 case AccessKind.COMPOUND: 3377 case AccessKind.COMPOUND:
3377 CompoundAccessSemantics compoundSemantics = semantics; 3378 CompoundAccessSemantics compoundSemantics = semantics;
3378 switch (compoundSemantics.compoundAccessKind) { 3379 switch (compoundSemantics.compoundAccessKind) {
3379 case CompoundAccessKind.SUPER_GETTER_SETTER:
3380 case CompoundAccessKind.SUPER_GETTER_FIELD: 3380 case CompoundAccessKind.SUPER_GETTER_FIELD:
3381 case CompoundAccessKind.SUPER_FIELD_SETTER:
3382 case CompoundAccessKind.SUPER_FIELD_FIELD: 3381 case CompoundAccessKind.SUPER_FIELD_FIELD:
3383 registry.registerStaticUse( 3382 registry.registerStaticUse(
3384 new StaticUse.superGet(semantics.getter)); 3383 new StaticUse.superGet(semantics.getter));
3385 registry.registerStaticUse( 3384 registry.registerStaticUse(
3386 new StaticUse.superSet(semantics.setter)); 3385 new StaticUse.superFieldSet(semantics.setter));
3386 break;
3387 case CompoundAccessKind.SUPER_FIELD_SETTER:
3388 case CompoundAccessKind.SUPER_GETTER_SETTER:
3389 registry.registerStaticUse(
3390 new StaticUse.superGet(semantics.getter));
3391 registry.registerStaticUse(
3392 new StaticUse.superSetterSet(semantics.setter));
3387 break; 3393 break;
3388 case CompoundAccessKind.SUPER_METHOD_SETTER: 3394 case CompoundAccessKind.SUPER_METHOD_SETTER:
3389 registry.registerStaticUse( 3395 registry.registerStaticUse(
3390 new StaticUse.superSet(semantics.setter)); 3396 new StaticUse.superSetterSet(semantics.setter));
3391 break; 3397 break;
3392 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER: 3398 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
3393 registry.registerStaticUse( 3399 registry.registerStaticUse(
3394 new StaticUse.superSet(semantics.setter)); 3400 new StaticUse.superSetterSet(semantics.setter));
3395 break; 3401 break;
3396 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER: 3402 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
3397 registry.registerStaticUse( 3403 registry.registerStaticUse(
3398 new StaticUse.superGet(semantics.getter)); 3404 new StaticUse.superGet(semantics.getter));
3399 break; 3405 break;
3400 default: 3406 default:
3401 break; 3407 break;
3402 } 3408 }
3403 break; 3409 break;
3404 default: 3410 default:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
3439 reporter.reportWarningMessage( 3445 reporter.reportWarningMessage(
3440 node, MessageKind.ASSIGNING_METHOD_IN_SUPER, 3446 node, MessageKind.ASSIGNING_METHOD_IN_SUPER,
3441 {'name': name, 3447 {'name': name,
3442 'superclassName': semantics.setter.enclosingClass.name}); 3448 'superclassName': semantics.setter.enclosingClass.name});
3443 // TODO(johnniwinther): This shouldn't be needed. 3449 // TODO(johnniwinther): This shouldn't be needed.
3444 registry.registerDynamicUse( 3450 registry.registerDynamicUse(
3445 new DynamicUse(setterSelector, null)); 3451 new DynamicUse(setterSelector, null));
3446 registry.registerFeature(Feature.SUPER_NO_SUCH_METHOD); 3452 registry.registerFeature(Feature.SUPER_NO_SUCH_METHOD);
3447 break; 3453 break;
3448 case AccessKind.SUPER_FIELD: 3454 case AccessKind.SUPER_FIELD:
3455 registry.registerStaticUse(
3456 new StaticUse.superFieldSet(semantics.setter));
3457 break;
3449 case AccessKind.SUPER_SETTER: 3458 case AccessKind.SUPER_SETTER:
3450 registry.registerStaticUse( 3459 registry.registerStaticUse(
3451 new StaticUse.superSet(semantics.setter)); 3460 new StaticUse.superSetterSet(semantics.setter));
3452 break; 3461 break;
3453 default: 3462 default:
3454 break; 3463 break;
3455 } 3464 }
3456 } 3465 }
3457 return handleUpdate(node, name, semantics); 3466 return handleUpdate(node, name, semantics);
3458 } else { 3467 } else {
3459 // `super.a += b`. 3468 // `super.a += b`.
3460 if (semantics == null) { 3469 if (semantics == null) {
3461 semantics = computeSuperAccessSemanticsForSelectors( 3470 semantics = computeSuperAccessSemanticsForSelectors(
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
4842 } 4851 }
4843 return const NoneResult(); 4852 return const NoneResult();
4844 } 4853 }
4845 } 4854 }
4846 4855
4847 /// Looks up [name] in [scope] and unwraps the result. 4856 /// Looks up [name] in [scope] and unwraps the result.
4848 Element lookupInScope(DiagnosticReporter reporter, Node node, 4857 Element lookupInScope(DiagnosticReporter reporter, Node node,
4849 Scope scope, String name) { 4858 Scope scope, String name) {
4850 return Elements.unwrap(scope.lookup(name), reporter, node); 4859 return Elements.unwrap(scope.lookup(name), reporter, node);
4851 } 4860 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698