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

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

Issue 1227643003: dart2js: Move most of the code_emitter_task code into the program-builder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Upload Created 5 years, 5 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/native_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
index 56bb8de4c14d5b3ecc7d1313fb40797560913be7..4487f8fc3a26dd22dbffabc04ccdfd0e5cb93285 100644
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
@@ -61,8 +61,16 @@ class NativeEmitter {
*
* [classes] contains native classes, mixin applications, and user subclasses
* of native classes.
+ *
+ * [interceptorClassesNeededByConstants] contains the interceptors that are
+ * referenced by constants.
+ *
+ * [classesModifiedByEmitRTISupport] contains the list of classes that must
+ * exist, because runtime-type support adds information to the class.
*/
- Set<Class> prepareNativeClasses(List<Class> classes) {
+ Set<Class> prepareNativeClasses(List<Class> classes,
+ Set<ClassElement> interceptorClassesNeededByConstants,
+ Set<ClassElement> classesModifiedByEmitRTISupport) {
assert(classes.every((Class cls) => cls != null));
hasNativeClasses = classes.isNotEmpty;
@@ -103,11 +111,6 @@ class NativeEmitter {
neededClasses.add(objectClass);
- Set<ClassElement> neededByConstant = emitterTask
- .computeInterceptorsReferencedFromConstants();
- Set<ClassElement> modifiedClasses = emitterTask.typeTestRegistry
- .computeClassesModifiedByEmitRuntimeTypeSupport();
-
for (Class cls in preOrder.reversed) {
ClassElement classElement = cls.element;
// Post-order traversal ensures we visit the subclasses before their
@@ -121,9 +124,9 @@ class NativeEmitter {
needed = true;
} else if (!isTrivialClass(cls)) {
needed = true;
- } else if (neededByConstant.contains(classElement)) {
+ } else if (interceptorClassesNeededByConstants.contains(classElement)) {
needed = true;
- } else if (modifiedClasses.contains(classElement)) {
+ } else if (classesModifiedByEmitRTISupport.contains(classElement)) {
// TODO(9556): Remove this test when [emitRuntimeTypeSupport] no longer
// adds information to a class prototype or constructor.
needed = true;

Powered by Google App Engine
This is Rietveld 408576698