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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 72643002: Make native implementation classes for classes that are used as targets in @MirrorsUsed available f… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/third_party/angular_todo/main.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 91537ca0f93c9c6a7e6cfc60524f06e2290b9013..673e8b1b722a70743d20383d8adf64d5ac28a0dd 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1294,6 +1294,24 @@ class JavaScriptBackend extends Backend {
}
}
+ Element getDartClass(Element element) {
Johnni Winther 2013/11/14 19:14:19 We have the reverse relation encoded somewhere in
karlklose 2013/11/15 08:44:52 It just below ;-) Done.
+ if (element == jsIntClass) {
+ return compiler.intClass;
+ } else if (element == jsBoolClass) {
+ return compiler.boolClass;
+ } else if (element == jsNumberClass) {
+ return compiler.numClass;
+ } else if (element == jsDoubleClass) {
+ return compiler.doubleClass;
+ } else if (element == jsStringClass) {
+ return compiler.stringClass;
+ } else if (element == jsArrayClass) {
+ return compiler.listClass;
+ } else {
+ return element;
+ }
+ }
+
Element getImplementationClass(Element element) {
if (element == compiler.intClass) {
return jsIntClass;
@@ -1737,6 +1755,7 @@ class JavaScriptBackend extends Backend {
* need to access it.
*/
bool isNeededForReflection(Element element) {
+ element = getDartClass(element);
if (hasInsufficientMirrorsUsed) return isTreeShakingDisabled;
/// Record the name of [element] in [symbolsUsed]. Return true for
/// convenience.
« no previous file with comments | « samples/third_party/angular_todo/main.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698