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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart

Issue 2688413003: Extract BackendUsage, MirrorsData, and CheckedModeHelpers from Backend. (Closed)
Patch Set: Cleanup Created 3 years, 10 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_emitter.program_builder; 5 library dart2js.js_emitter.program_builder;
6 6
7 import '../../closure.dart' show ClosureFieldElement; 7 import '../../closure.dart' show ClosureFieldElement;
8 import '../../common.dart'; 8 import '../../common.dart';
9 import '../../common/names.dart' show Names, Selectors; 9 import '../../common/names.dart' show Names, Selectors;
10 import '../../compiler.dart' show Compiler; 10 import '../../compiler.dart' show Compiler;
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 536
537 List<StubMethod> noSuchMethodStubs = <StubMethod>[]; 537 List<StubMethod> noSuchMethodStubs = <StubMethod>[];
538 538
539 if (backend.enabledNoSuchMethod && element.isObject) { 539 if (backend.enabledNoSuchMethod && element.isObject) {
540 Map<js.Name, Selector> selectors = 540 Map<js.Name, Selector> selectors =
541 classStubGenerator.computeSelectorsForNsmHandlers(); 541 classStubGenerator.computeSelectorsForNsmHandlers();
542 selectors.forEach((js.Name name, Selector selector) { 542 selectors.forEach((js.Name name, Selector selector) {
543 // If the program contains `const Symbol` names we have to retain them. 543 // If the program contains `const Symbol` names we have to retain them.
544 String selectorName = selector.name; 544 String selectorName = selector.name;
545 if (selector.isSetter) selectorName = "$selectorName="; 545 if (selector.isSetter) selectorName = "$selectorName=";
546 if (backend.symbolsUsed.contains(selectorName)) { 546 if (backend.mirrorsData.symbolsUsed.contains(selectorName)) {
547 _symbolsMap[name] = selectorName; 547 _symbolsMap[name] = selectorName;
548 } 548 }
549 noSuchMethodStubs.add( 549 noSuchMethodStubs.add(
550 classStubGenerator.generateStubForNoSuchMethod(name, selector)); 550 classStubGenerator.generateStubForNoSuchMethod(name, selector));
551 }); 551 });
552 } 552 }
553 553
554 if (element == helpers.closureClass) { 554 if (element == helpers.closureClass) {
555 // We add a special getter here to allow for tearing off a closure from 555 // We add a special getter here to allow for tearing off a closure from
556 // itself. 556 // itself.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 _classes[element] = result; 649 _classes[element] = result;
650 return result; 650 return result;
651 } 651 }
652 652
653 bool _methodNeedsStubs(FunctionElement method) { 653 bool _methodNeedsStubs(FunctionElement method) {
654 return !method.functionSignature.optionalParameters.isEmpty; 654 return !method.functionSignature.optionalParameters.isEmpty;
655 } 655 }
656 656
657 bool _methodCanBeReflected(FunctionElement method) { 657 bool _methodCanBeReflected(FunctionElement method) {
658 return backend.isAccessibleByReflection(method); 658 return backend.mirrorsData.isAccessibleByReflection(method);
659 } 659 }
660 660
661 bool _methodCanBeApplied(FunctionElement method) { 661 bool _methodCanBeApplied(FunctionElement method) {
662 return backend.hasFunctionApplySupport && 662 return backend.hasFunctionApplySupport &&
663 closedWorld.getMightBePassedToApply(method); 663 closedWorld.getMightBePassedToApply(method);
664 } 664 }
665 665
666 /* Map | List */ _computeParameterDefaultValues(FunctionSignature signature) { 666 /* Map | List */ _computeParameterDefaultValues(FunctionSignature signature) {
667 var /* Map | List */ optionalParameterDefaultValues; 667 var /* Map | List */ optionalParameterDefaultValues;
668 if (signature.optionalParametersAreNamed) { 668 if (signature.optionalParametersAreNamed) {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 Constant constant = new Constant(name, holder, constantValue); 966 Constant constant = new Constant(name, holder, constantValue);
967 _constants[constantValue] = constant; 967 _constants[constantValue] = constant;
968 } 968 }
969 } 969 }
970 970
971 Holder _registerStaticStateHolder() { 971 Holder _registerStaticStateHolder() {
972 return _registry.registerHolder(namer.staticStateHolder, 972 return _registry.registerHolder(namer.staticStateHolder,
973 isStaticStateHolder: true); 973 isStaticStateHolder: true);
974 } 974 }
975 } 975 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698