Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (revision 26173) |
| +++ sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (working copy) |
| @@ -859,6 +859,15 @@ |
| bool recordType(Element analyzedElement, TypeMask type) { |
| if (isNativeElement(analyzedElement)) return false; |
| + if (!compiler.backend.canBeUsedForGlobalOptimizations(analyzedElement)) { |
| + return false; |
| + } |
| + if (analyzedElement.isParameter() || analyzedElement.isFieldParameter()) { |
|
ahe
2013/08/15 09:41:07
I wonder if this check should be moved to canBeUse
ngeoffray
2013/08/15 09:46:04
Good point. Done.
|
| + Element enclosing = analyzedElement.enclosingElement; |
| + if (!compiler.backend.canBeUsedForGlobalOptimizations(enclosing)) { |
| + return false; |
| + } |
| + } |
| assert(type != null); |
| assert(analyzedElement.isField() |
| || analyzedElement.isParameter() |
| @@ -879,6 +888,9 @@ |
| */ |
| bool recordReturnType(Element analyzedElement, TypeMask returnType) { |
| if (isNativeElement(analyzedElement)) return false; |
| + if (!compiler.backend.canBeUsedForGlobalOptimizations(analyzedElement)) { |
| + return false; |
| + } |
| assert(analyzedElement.implementation == analyzedElement); |
| TypeMask existing = typeInformationOf(analyzedElement).returnType; |
| if (optimismState == OPTIMISTIC |
| @@ -1111,8 +1123,8 @@ |
| } |
| bool updateParameterType(Element parameter) { |
| - FunctionTypeInformation functionInfo = |
| - typeInformationOf(parameter.enclosingElement); |
| + Element function = parameter.enclosingElement; |
| + FunctionTypeInformation functionInfo = typeInformationOf(function); |
| if (functionInfo.canBeClosurized) return false; |
| if (!isNotClosure(parameter.enclosingElement)) return false; |