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

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

Issue 1146003004: dart2js: Properly construct rti ast templates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | pkg/compiler/lib/src/ssa/builder.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 937703692faf049174143f2f3316d143294a8521..cee17622ac079808fec3a2dcf3cb79acf992b6c2 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -550,11 +550,19 @@ class RuntimeTypes {
}
}
+ /**
+ * 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) {
+ 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 = 0;
+ int positions = firstPlaceholderIndex;
jsAst.Expression representation = getTypeRepresentation(type, (variable) {
onVariable(variable);
return new jsAst.InterpolatedExpression(positions++);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | pkg/compiler/lib/src/ssa/builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698