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

Unified Diff: pkg/compiler/lib/src/kernel/element_map_impl.dart

Issue 2938203003: Compute KernelClosureRepresentationInfo.variableIsUsedInTryOrSync (Closed)
Patch Set: Merge KernelClosureConversionTask and KernelClosureDataLookup Created 3 years, 6 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/kernel/element_map_impl.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index e7d3cd0d506cd82b588be8635cb46f08e514bb25..54b2504bb76966200deb4a527258387220efc5fc 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -47,9 +47,24 @@ part 'native_basic_data.dart';
part 'no_such_method_resolver.dart';
part 'types.dart';
+/// Interface for kernel queries needed to implement the [CodegenWorldBuilder].
+abstract class KernelToWorldBuilder implements KernelToElementMap {
+ /// Returns `true` if [field] has a constant initializer.
+ bool hasConstantFieldInitializer(FieldEntity field);
+
+ /// Returns the constant initializer for [field].
+ ConstantValue getConstantFieldInitializer(FieldEntity field);
+
+ /// Calls [f] for each parameter of [function] providing the type and name of
+ /// the parameter and the [defaultValue] if the parameter is optional.
+ void forEachParameter(FunctionEntity function,
+ void f(DartType type, String name, ConstantValue defaultValue));
+}
+
/// Element builder used for creating elements and types corresponding to Kernel
/// IR nodes.
-class KernelToElementMapImpl extends KernelToElementMapMixin {
+class KernelToElementMapImpl extends KernelToElementMapMixin
+ implements KernelToWorldBuilder {
final Environment _environment;
CommonElements _commonElements;
native.BehaviorBuilder _nativeBehaviorBuilder;
@@ -1752,7 +1767,8 @@ class KernelNativeMemberResolver extends NativeMemberResolverBase {
}
}
-class JsKernelToElementMap extends KernelToElementMapMixin {
+class JsKernelToElementMap extends KernelToElementMapMixin
+ implements KernelToWorldBuilder {
final JsToFrontendMap _map;
final ElementEnvironment _elementEnvironment;
final CommonElements _commonElements;
@@ -1877,4 +1893,22 @@ class JsKernelToElementMap extends KernelToElementMapMixin {
ConstantValue getFieldConstantValue(ir.Field field) {
throw new UnsupportedError("JsKernelToElementMap.getFieldConstantValue");
}
+
+ @override
+ void forEachParameter(FunctionEntity function,
+ void f(DartType type, String name, ConstantValue defaultValue)) {
+ throw new UnsupportedError("JsKernelToElementMap.forEachParameter");
+ }
+
+ @override
+ ConstantValue getConstantFieldInitializer(FieldEntity field) {
+ throw new UnsupportedError(
+ "JsKernelToElementMap.getConstantFieldInitializer");
+ }
+
+ @override
+ bool hasConstantFieldInitializer(FieldEntity field) {
+ throw new UnsupportedError(
+ "JsKernelToElementMap.hasConstantFieldInitializer");
+ }
}

Powered by Google App Engine
This is Rietveld 408576698