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

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

Issue 2814453005: Merge CommonElements and BackendHelpers! (Closed)
Patch Set: comments and re-merge, take two Created 3 years, 8 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/codegen_listener.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen_listener.dart b/pkg/compiler/lib/src/js_backend/codegen_listener.dart
index dd5919aab2a6146fd83d253711834836298153bd..b4c8523d749ec8de0908a86740caca79fea748a7 100644
--- a/pkg/compiler/lib/src/js_backend/codegen_listener.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen_listener.dart
@@ -18,7 +18,6 @@ import '../universe/use.dart' show StaticUse, TypeUse;
import '../universe/world_impact.dart'
show WorldImpact, WorldImpactBuilder, WorldImpactBuilderImpl;
import 'backend.dart';
-import 'backend_helpers.dart';
import 'backend_impact.dart';
import 'backend_usage.dart';
import 'custom_elements_analysis.dart';
@@ -29,7 +28,6 @@ import 'type_variable_handler.dart';
class CodegenEnqueuerListener extends EnqueuerListener {
final ElementEnvironment _elementEnvironment;
final CommonElements _commonElements;
- final BackendHelpers _helpers;
final BackendImpacts _impacts;
final BackendClasses _backendClasses;
@@ -48,7 +46,6 @@ class CodegenEnqueuerListener extends EnqueuerListener {
CodegenEnqueuerListener(
this._elementEnvironment,
this._commonElements,
- this._helpers,
this._impacts,
this._backendClasses,
this._backendUsage,
@@ -220,7 +217,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
if (_rtiNeed.classNeedsRtiField(type.element)) {
impactBuilder.registerStaticUse(new StaticUse.staticInvoke(
// TODO(johnniwinther): Find the right [CallStructure].
- _helpers.setRuntimeTypeInfo,
+ _commonElements.setRuntimeTypeInfo,
null));
}
if (type.element == _backendClasses.typeClass) {
@@ -229,7 +226,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
// helper so we register a use of that.
impactBuilder.registerStaticUse(new StaticUse.staticInvoke(
// TODO(johnniwinther): Find the right [CallStructure].
- _helpers.createRuntimeType,
+ _commonElements.createRuntimeType,
null));
}
}
@@ -265,7 +262,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
if (!cls.typeVariables.isEmpty) {
_typeVariableCodegenAnalysis.registerClassWithTypeVariables(cls);
}
- if (cls == _helpers.closureClass) {
+ if (cls == _commonElements.closureClass) {
_impacts.closureClass.registerImpact(impactBuilder, _elementEnvironment);
}
@@ -274,51 +271,53 @@ class CodegenEnqueuerListener extends EnqueuerListener {
new TypeUse.instantiation(_elementEnvironment.getRawType(cls)));
}
- if (cls == _commonElements.stringClass || cls == _helpers.jsStringClass) {
- registerInstantiation(_helpers.jsStringClass);
+ if (cls == _commonElements.stringClass ||
+ cls == _commonElements.jsStringClass) {
+ registerInstantiation(_commonElements.jsStringClass);
} else if (cls == _commonElements.listClass ||
- cls == _helpers.jsArrayClass ||
- cls == _helpers.jsFixedArrayClass ||
- cls == _helpers.jsExtendableArrayClass ||
- cls == _helpers.jsUnmodifiableArrayClass) {
- registerInstantiation(_helpers.jsArrayClass);
- registerInstantiation(_helpers.jsMutableArrayClass);
- registerInstantiation(_helpers.jsFixedArrayClass);
- registerInstantiation(_helpers.jsExtendableArrayClass);
- registerInstantiation(_helpers.jsUnmodifiableArrayClass);
- } else if (cls == _commonElements.intClass || cls == _helpers.jsIntClass) {
- registerInstantiation(_helpers.jsIntClass);
- registerInstantiation(_helpers.jsPositiveIntClass);
- registerInstantiation(_helpers.jsUInt32Class);
- registerInstantiation(_helpers.jsUInt31Class);
- registerInstantiation(_helpers.jsNumberClass);
+ cls == _commonElements.jsArrayClass ||
+ cls == _commonElements.jsFixedArrayClass ||
+ cls == _commonElements.jsExtendableArrayClass ||
+ cls == _commonElements.jsUnmodifiableArrayClass) {
+ registerInstantiation(_commonElements.jsArrayClass);
+ registerInstantiation(_commonElements.jsMutableArrayClass);
+ registerInstantiation(_commonElements.jsFixedArrayClass);
+ registerInstantiation(_commonElements.jsExtendableArrayClass);
+ registerInstantiation(_commonElements.jsUnmodifiableArrayClass);
+ } else if (cls == _commonElements.intClass ||
+ cls == _commonElements.jsIntClass) {
+ registerInstantiation(_commonElements.jsIntClass);
+ registerInstantiation(_commonElements.jsPositiveIntClass);
+ registerInstantiation(_commonElements.jsUInt32Class);
+ registerInstantiation(_commonElements.jsUInt31Class);
+ registerInstantiation(_commonElements.jsNumberClass);
} else if (cls == _commonElements.doubleClass ||
- cls == _helpers.jsDoubleClass) {
- registerInstantiation(_helpers.jsDoubleClass);
- registerInstantiation(_helpers.jsNumberClass);
+ cls == _commonElements.jsDoubleClass) {
+ registerInstantiation(_commonElements.jsDoubleClass);
+ registerInstantiation(_commonElements.jsNumberClass);
} else if (cls == _commonElements.boolClass ||
- cls == _helpers.jsBoolClass) {
- registerInstantiation(_helpers.jsBoolClass);
+ cls == _commonElements.jsBoolClass) {
+ registerInstantiation(_commonElements.jsBoolClass);
} else if (cls == _commonElements.nullClass ||
- cls == _helpers.jsNullClass) {
- registerInstantiation(_helpers.jsNullClass);
+ cls == _commonElements.jsNullClass) {
+ registerInstantiation(_commonElements.jsNullClass);
} else if (cls == _commonElements.numClass ||
- cls == _helpers.jsNumberClass) {
- registerInstantiation(_helpers.jsIntClass);
- registerInstantiation(_helpers.jsPositiveIntClass);
- registerInstantiation(_helpers.jsUInt32Class);
- registerInstantiation(_helpers.jsUInt31Class);
- registerInstantiation(_helpers.jsDoubleClass);
- registerInstantiation(_helpers.jsNumberClass);
- } else if (cls == _helpers.jsJavaScriptObjectClass) {
- registerInstantiation(_helpers.jsJavaScriptObjectClass);
- } else if (cls == _helpers.jsPlainJavaScriptObjectClass) {
- registerInstantiation(_helpers.jsPlainJavaScriptObjectClass);
- } else if (cls == _helpers.jsUnknownJavaScriptObjectClass) {
- registerInstantiation(_helpers.jsUnknownJavaScriptObjectClass);
- } else if (cls == _helpers.jsJavaScriptFunctionClass) {
- registerInstantiation(_helpers.jsJavaScriptFunctionClass);
- } else if (cls == _helpers.jsIndexingBehaviorInterface) {
+ cls == _commonElements.jsNumberClass) {
+ registerInstantiation(_commonElements.jsIntClass);
+ registerInstantiation(_commonElements.jsPositiveIntClass);
+ registerInstantiation(_commonElements.jsUInt32Class);
+ registerInstantiation(_commonElements.jsUInt31Class);
+ registerInstantiation(_commonElements.jsDoubleClass);
+ registerInstantiation(_commonElements.jsNumberClass);
+ } else if (cls == _commonElements.jsJavaScriptObjectClass) {
+ registerInstantiation(_commonElements.jsJavaScriptObjectClass);
+ } else if (cls == _commonElements.jsPlainJavaScriptObjectClass) {
+ registerInstantiation(_commonElements.jsPlainJavaScriptObjectClass);
+ } else if (cls == _commonElements.jsUnknownJavaScriptObjectClass) {
+ registerInstantiation(_commonElements.jsUnknownJavaScriptObjectClass);
+ } else if (cls == _commonElements.jsJavaScriptFunctionClass) {
+ registerInstantiation(_commonElements.jsJavaScriptFunctionClass);
+ } else if (cls == _commonElements.jsIndexingBehaviorInterface) {
_impacts.jsIndexingBehavior
.registerImpact(impactBuilder, _elementEnvironment);
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart ('k') | pkg/compiler/lib/src/js_backend/constant_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698