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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart

Issue 85783002: Bailout on array optimizations if the array might escape to reflection land. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/compiler/dart2js/array_tracing_mirror_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of type_graph_inferrer; 5 part of type_graph_inferrer;
6 6
7 /** 7 /**
8 * A set of selector names that [List] implements, that we know do not 8 * A set of selector names that [List] implements, that we know do not
9 * change the element type of the list, or let the list escape to code 9 * change the element type of the list, or let the list escape to code
10 * that might change the element type. 10 * that might change the element type.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 bool isClosure(Element element) { 264 bool isClosure(Element element) {
265 if (!element.isFunction()) return false; 265 if (!element.isFunction()) return false;
266 Element outermost = element.getOutermostEnclosingMemberOrTopLevel(); 266 Element outermost = element.getOutermostEnclosingMemberOrTopLevel();
267 return outermost.declaration != element.declaration; 267 return outermost.declaration != element.declaration;
268 } 268 }
269 269
270 visitElementTypeInformation(ElementTypeInformation info) { 270 visitElementTypeInformation(ElementTypeInformation info) {
271 if (isClosure(info.element)) { 271 if (isClosure(info.element)) {
272 bailout('Returned from a closure'); 272 bailout('Returned from a closure');
273 } 273 }
274 if (compiler.backend.isNeededForReflection(info.element)) {
275 bailout('Escape in reflection');
276 }
274 } 277 }
275 } 278 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/array_tracing_mirror_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698