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

Unified Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2569733002: Even less reliance on Compiler.closedWorld (Closed)
Patch Set: Updated cf. comments. Created 4 years 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/ssa/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 4c2309efe2357e6b97e1e5c8e2c6f78d8745d342..3c85ff073254ae904a1e80ac34864caacfd91184 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -69,8 +69,11 @@ class KernelAstAdapter {
Element get _target => _resolvedAst.element;
ClosedWorld get _closedWorld => _compiler.closedWorld;
+ GlobalTypeInferenceResults get _globalInferenceResults =>
+ _compiler.globalInference.results;
+
GlobalTypeInferenceElementResult _resultOf(Element e) =>
- _compiler.globalInference.results.resultOf(e);
+ _globalInferenceResults.resultOf(e);
ConstantValue getConstantForSymbol(ir.SymbolLiteral node) {
if (kernel.syntheticNodes.contains(node)) {
@@ -133,7 +136,7 @@ class KernelAstAdapter {
TypeMask returnTypeOf(ir.Member node) {
return TypeMaskFactory.inferredReturnTypeForElement(
- getElement(node), _compiler);
+ getElement(node), _globalInferenceResults);
}
SideEffects getSideEffects(ir.Node node) {
@@ -265,27 +268,29 @@ class KernelAstAdapter {
mask.containsOnly(
_closedWorld.backendClasses.constListImplementation) ||
mask.containsOnlyString(_closedWorld) ||
- backend.isTypedArray(mask)) {
+ _closedWorld.commonMasks.isTypedArray(mask)) {
return true;
}
return false;
}
TypeMask inferredIndexType(ir.ForInStatement forInStatement) {
- return TypeMaskFactory.inferredTypeForSelector(
- new Selector.index(), typeOfIterator(forInStatement), _compiler);
+ return TypeMaskFactory.inferredTypeForSelector(new Selector.index(),
+ typeOfIterator(forInStatement), _globalInferenceResults);
}
TypeMask inferredTypeOf(ir.Member node) {
- return TypeMaskFactory.inferredTypeForElement(getElement(node), _compiler);
+ return TypeMaskFactory.inferredTypeForElement(
+ getElement(node), _globalInferenceResults);
}
TypeMask selectorTypeOf(Selector selector, TypeMask mask) {
- return TypeMaskFactory.inferredTypeForSelector(selector, mask, _compiler);
+ return TypeMaskFactory.inferredTypeForSelector(
+ selector, mask, _globalInferenceResults);
}
TypeMask typeFromNativeBehavior(native.NativeBehavior nativeBehavior) {
- return TypeMaskFactory.fromNativeBehavior(nativeBehavior, _compiler);
+ return TypeMaskFactory.fromNativeBehavior(nativeBehavior, _closedWorld);
}
ConstantValue getConstantFor(ir.Node node) {
@@ -359,7 +364,8 @@ class KernelAstAdapter {
TypeMask get checkConcurrentModificationErrorReturnType =>
TypeMaskFactory.inferredReturnTypeForElement(
- _backend.helpers.checkConcurrentModificationError, _compiler);
+ _backend.helpers.checkConcurrentModificationError,
+ _globalInferenceResults);
ir.Procedure get checkSubtype =>
kernel.functions[_backend.helpers.checkSubtype];
@@ -370,16 +376,19 @@ class KernelAstAdapter {
ir.Procedure get assertHelper =>
kernel.functions[_backend.helpers.assertHelper];
- TypeMask get throwTypeErrorType => TypeMaskFactory
- .inferredReturnTypeForElement(_backend.helpers.throwTypeError, _compiler);
+ TypeMask get throwTypeErrorType =>
+ TypeMaskFactory.inferredReturnTypeForElement(
+ _backend.helpers.throwTypeError, _globalInferenceResults);
- TypeMask get assertHelperReturnType => TypeMaskFactory
- .inferredReturnTypeForElement(_backend.helpers.assertHelper, _compiler);
+ TypeMask get assertHelperReturnType =>
+ TypeMaskFactory.inferredReturnTypeForElement(
+ _backend.helpers.assertHelper, _globalInferenceResults);
ir.Procedure get assertTest => kernel.functions[_backend.helpers.assertTest];
- TypeMask get assertTestReturnType => TypeMaskFactory
- .inferredReturnTypeForElement(_backend.helpers.assertTest, _compiler);
+ TypeMask get assertTestReturnType =>
+ TypeMaskFactory.inferredReturnTypeForElement(
+ _backend.helpers.assertTest, _globalInferenceResults);
ir.Procedure get assertThrow =>
kernel.functions[_backend.helpers.assertThrow];
@@ -387,8 +396,9 @@ class KernelAstAdapter {
ir.Procedure get setRuntimeTypeInfo =>
kernel.functions[_backend.helpers.setRuntimeTypeInfo];
- TypeMask get assertThrowReturnType => TypeMaskFactory
- .inferredReturnTypeForElement(_backend.helpers.assertThrow, _compiler);
+ TypeMask get assertThrowReturnType =>
+ TypeMaskFactory.inferredReturnTypeForElement(
+ _backend.helpers.assertThrow, _globalInferenceResults);
ir.Procedure get runtimeTypeToString =>
kernel.functions[_backend.helpers.runtimeTypeToString];
@@ -398,7 +408,7 @@ class KernelAstAdapter {
TypeMask get createRuntimeTypeReturnType =>
TypeMaskFactory.inferredReturnTypeForElement(
- _backend.helpers.createRuntimeType, _compiler);
+ _backend.helpers.createRuntimeType, _globalInferenceResults);
ir.Class get objectClass => kernel.classes[_compiler.coreClasses.objectClass];
« no previous file with comments | « pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698