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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart

Issue 23118007: Ensure the type inferrer does not infer types for runtime helpers used by the backend. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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: 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;

Powered by Google App Engine
This is Rietveld 408576698