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

Unified Diff: pkg/compiler/lib/src/js_emitter/type_test_registry.dart

Issue 2791263005: Split MirrorsData methods and MirrorsDataImpl data by element kind. (Closed)
Patch Set: Updated cf. comments. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/type_test_registry.dart
diff --git a/pkg/compiler/lib/src/js_emitter/type_test_registry.dart b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
index 744b05e261876d6d3b5347ec38cc45ee014f28f8..a752a4cddd1c6cf710e6dba865250abd95e713fc 100644
--- a/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
+++ b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
@@ -13,7 +13,7 @@ import '../elements/resolution_types.dart'
Types,
ResolutionTypeVariableType;
import '../elements/elements.dart'
- show ClassElement, Element, ElementKind, FunctionElement;
+ show ClassElement, Element, ElementKind, MemberElement, MethodElement;
import '../js_backend/js_backend.dart'
show JavaScriptBackend, RuntimeTypesSubstitutions, TypeChecks;
import '../world.dart' show ClosedWorld;
@@ -130,23 +130,23 @@ class TypeTestRegistry {
return false;
}
- bool canBeReflectedAsFunction(Element element) {
+ bool canBeReflectedAsFunction(MemberElement element) {
return element.kind == ElementKind.FUNCTION ||
element.kind == ElementKind.GETTER ||
element.kind == ElementKind.SETTER ||
element.kind == ElementKind.GENERATIVE_CONSTRUCTOR;
}
- bool canBeReified(Element element) {
+ bool canBeReified(MemberElement element) {
return (canTearOff(element) ||
- backend.mirrorsData.isAccessibleByReflection(element));
+ backend.mirrorsData.isMemberAccessibleByReflection(element));
}
// Find all types referenced from the types of elements that can be
// reflected on 'as functions'.
backend.generatedCode.keys.where((element) {
return canBeReflectedAsFunction(element) && canBeReified(element);
- }).forEach((FunctionElement function) {
+ }).forEach((MethodElement function) {
ResolutionDartType type = function.type;
for (ClassElement cls in backend.rtiChecks.getReferencedClasses(type)) {
while (cls != null) {
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart ('k') | pkg/compiler/lib/src/kernel/world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698