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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/glue.dart

Issue 968843003: Implement type argument access and reification of runtime types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Unbreak long line. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_backend/codegen/glue.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/glue.dart b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
index ebe89235e47e972b9ba14148d6c782c38d365f1d..712e90a69c22bdf99d18b449b5aab110efc109d5 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/glue.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
@@ -11,6 +11,7 @@ import '../../js/js.dart' as js;
import '../../constants/values.dart';
import '../../elements/elements.dart';
import '../../constants/expressions.dart';
+import '../../dart_types.dart' show TypeVariableType;
/// Encapsulates the dependencies of the function-compiler to the compiler,
/// backend and emitter.
@@ -115,4 +116,38 @@ class Glue {
return new js.VariableUse(
_backend.namer.globalObjectFor(_backend.interceptorsLibrary));
}
+
+ FunctionElement getCreateRuntimeType() {
+ return _backend.getCreateRuntimeType();
+ }
+
+ FunctionElement getRuntimeTypeToString() {
+ return _backend.getRuntimeTypeToString();
+ }
+
+ FunctionElement getTypeArgumentWithSubstitution() {
+ return _backend.getGetRuntimeTypeArgument();
+ }
+
+ FunctionElement getTypeArgumentByIndex() {
+ return _backend.getGetTypeArgumentByIndex();
+ }
+
+ js.Expression getSubstitutionName(ClassElement cls) {
+ return js.string(_namer.substitutionName(cls));
+ }
+
+ int getTypeVariableIndex(TypeVariableType variable) {
+ return RuntimeTypes.getTypeVariableIndex(variable.element);
+ }
+
+ bool needsSubstitutionForTypeVariableAccess(ClassElement cls) {
+ ClassWorld classWorld = _compiler.world;
+ if (classWorld.isUsedAsMixin(cls)) return true;
+
+ Iterable<ClassElement> subclasses = _compiler.world.strictSubclassesOf(cls);
+ return subclasses.any((ClassElement subclass) {
+ return !_backend.rti.isTrivialSubstitution(subclass, cls);
+ });
+ }
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/codegen.dart ('k') | pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698