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

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

Issue 895813006: dart2js: store typeVariableReader stubs in the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comment. 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_emitter/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index a6d6fe80549fcc46ced09404fc74937ac082a22c..7eeb2bfca3f109dbbf8fe467f3aaacbd487a272d 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -20,7 +20,7 @@ import 'js_emitter.dart' show
CodeEmitterTask,
InterceptorStubGenerator,
ParameterStubGenerator,
- TypeTestGenerator,
+ RuntimeTypeGenerator,
TypeTestProperties;
import '../universe/universe.dart' show Universe;
@@ -290,7 +290,7 @@ class ProgramBuilder {
String name = namer.getNameOfClass(element);
return new Class(
- element, name, null, [], instanceFields, [], [], [], [], null,
+ element, name, null, [], instanceFields, [], [], [], [], [], null,
isDirectlyInstantiated: true,
onlyForRti: false,
isNative: element.isNative);
@@ -304,6 +304,8 @@ class ProgramBuilder {
ClassStubGenerator classStubGenerator =
new ClassStubGenerator(_compiler, namer, backend);
+ RuntimeTypeGenerator runtimeTypeGenerator =
+ new RuntimeTypeGenerator(_compiler, _task, namer);
void visitMember(ClassElement enclosing, Element member) {
assert(invariant(element, member.isDeclaration));
@@ -329,6 +331,9 @@ class ProgramBuilder {
}
}
+ List<StubMethod> typeVariableReaderStubs =
+ runtimeTypeGenerator.generateTypeVariableReaderStubs(element);
+
List<StubMethod> noSuchMethodStubs = <StubMethod>[];
if (element == _compiler.objectClass) {
Map<String, Selector> selectors =
@@ -353,10 +358,8 @@ class ProgramBuilder {
List<Field> staticFieldsForReflection =
onlyForRti ? const <Field>[] : _buildFields(element, true);
- TypeTestGenerator generator =
- new TypeTestGenerator(_compiler, _task, namer);
TypeTestProperties typeTests =
- generator.generateIsTests(
+ runtimeTypeGenerator.generateIsTests(
element,
storeFunctionTypeInMetadata: _storeFunctionTypesInMetadata);
@@ -381,6 +384,7 @@ class ProgramBuilder {
instanceFields,
staticFieldsForReflection,
callStubs,
+ typeVariableReaderStubs,
isChecks,
typeTests.functionTypeIndex,
isDirectlyInstantiated: isInstantiated,
@@ -390,6 +394,7 @@ class ProgramBuilder {
name, holder, methods, instanceFields,
staticFieldsForReflection,
callStubs,
+ typeVariableReaderStubs,
noSuchMethodStubs,
isChecks,
typeTests.functionTypeIndex,

Powered by Google App Engine
This is Rietveld 408576698