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

Unified Diff: pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart

Issue 2722753002: Remove HRuntimeType implementation (Closed)
Patch Set: Created 3 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_emitter/runtime_type_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
index 0791151512263285c91a821f47d08bb802715f8a..09fe5baa251b8af57c12c4daeaf39444202b6af6 100644
--- a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
@@ -329,48 +329,4 @@ class RuntimeTypeGenerator {
superclass, generateIsTest, generateSubstitution, alreadyGenerated);
}
}
-
- List<StubMethod> generateTypeVariableReaderStubs(ClassElement classElement) {
- List<StubMethod> stubs = <StubMethod>[];
- ClassElement superclass = classElement;
- while (superclass != null) {
- for (ResolutionTypeVariableType parameter in superclass.typeVariables) {
- if (backend.emitter.readTypeVariables.contains(parameter.element)) {
- stubs.add(
- _generateTypeVariableReader(classElement, parameter.element));
- }
- }
- superclass = superclass.superclass;
- }
-
- return stubs;
- }
-
- StubMethod _generateTypeVariableReader(
- ClassElement cls, TypeVariableElement element) {
- jsAst.Name name = namer.nameForReadTypeVariable(element);
- int index = element.index;
- jsAst.Expression computeTypeVariable;
-
- Substitution substitution =
- backend.rti.getSubstitution(cls, element.typeDeclaration);
- jsAst.Name rtiFieldName = backend.namer.rtiFieldJsName;
- if (substitution != null) {
- computeTypeVariable = js(r'#.apply(null, this.#)', [
- backend.rtiEncoder.getSubstitutionCodeForVariable(substitution, index),
- rtiFieldName
- ]);
- } else {
- // TODO(ahe): These can be generated dynamically.
- computeTypeVariable = js(r'this.# && this.#[#]',
- [rtiFieldName, rtiFieldName, js.number(index)]);
- }
- jsAst.Expression convertRtiToRuntimeType = backend.emitter
- .staticFunctionAccess(backend.helpers.convertRtiToRuntimeType);
-
- return new StubMethod(
- name,
- js('function () { return #(#) }',
- [convertRtiToRuntimeType, computeTypeVariable]));
- }
}

Powered by Google App Engine
This is Rietveld 408576698