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

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

Issue 1011403003: cps-ir: Set runtime type information for new objects that require it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 5dfd8de7541ce7bf45fe4a3ce41d5cb83353bfdc..642e136927f90b42d2932f243a181a265b2e1bed 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/glue.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
@@ -11,7 +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;
+import '../../dart_types.dart' show DartType, TypeVariableType;
/// Encapsulates the dependencies of the function-compiler to the compiler,
/// backend and emitter.
@@ -154,4 +154,18 @@ class Glue {
return !_backend.rti.isTrivialSubstitution(subclass, cls);
});
}
+
+ FunctionElement getAddRuntimeTypeInformation() {
+ return _backend.getSetRuntimeTypeInfo();
+ }
+
+ js.Expression generateTypeRepresentation(DartType dartType,
+ List<js.Expression> arguments) {
+ int variableIndex = 0;
+ js.Expression representation = _backend.rti.getTypeRepresentation(
+ dartType,
+ (_) => arguments[variableIndex++]);
+ assert(variableIndex == arguments.length);
+ return representation;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698