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

Unified Diff: pkg/compiler/lib/src/js_backend/runtime_types.dart

Issue 2260353002: Remove use of JS templates in reified type information (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/runtime_types.dart
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index a28f2322012b3f443f520800eddf88cb2808a41d..1d7470ffdf17a0cbad922d116f70a44a7ccef62c 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -88,20 +88,11 @@ abstract class RuntimeTypesEncoder {
jsAst.Template get templateForCreateFunctionType;
jsAst.Name get getFunctionThatReturnsNullName;
+ /// Returns a [jsAst.Expression] representing the given [type]. Type variables
+ /// are replaced by the [jsAst.Expression] returned by [onVariable].
jsAst.Expression getTypeRepresentation(
DartType type, OnVariableCallback onVariable,
[ShouldEncodeTypedefCallback shouldEncodeTypedef]);
- /**
- * Returns a [jsAst.Expression] representing the given [type]. Type
- * variables are replaced by placeholders in the ast.
- *
- * [firstPlaceholderIndex] is the index to use for the first placeholder.
- * This is useful if the returned [jsAst.Expression] is only part of a
- * larger template. By default, indexing starts with 0.
- */
- jsAst.Expression getTypeRepresentationWithPlaceholders(
- DartType type, OnVariableCallback onVariable,
- {int firstPlaceholderIndex: 0});
String getTypeRepresentationForTypeConstant(DartType type);
}
@@ -619,20 +610,6 @@ class _RuntimeTypesEncoder implements RuntimeTypesEncoder {
}
@override
- jsAst.Expression getTypeRepresentationWithPlaceholders(
- DartType type, OnVariableCallback onVariable,
- {int firstPlaceholderIndex: 0}) {
- // Create a type representation. For type variables call the original
- // callback for side effects and return a template placeholder.
- int positions = firstPlaceholderIndex;
- jsAst.Expression representation = getTypeRepresentation(type, (variable) {
- onVariable(variable);
- return new jsAst.InterpolatedExpression(positions++);
- });
- return representation;
- }
-
- @override
jsAst.Expression getSubstitutionRepresentation(
List<DartType> types, OnVariableCallback onVariable) {
List<jsAst.Expression> elements = types
@@ -648,7 +625,6 @@ class _RuntimeTypesEncoder implements RuntimeTypesEncoder {
return new jsAst.VariableUse(v.name);
}
- ;
sra1 2016/08/19 22:21:32 I guess this is what happens if you 'terminate' a
jsAst.Expression encoding = getTypeRepresentation(type, onVariable);
if (contextClass == null && !alwaysGenerateFunction) {
return encoding;

Powered by Google App Engine
This is Rietveld 408576698