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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 23504003: Do not do global optimizations on fields and parameters when invokeOn is enabled. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 js_backend; 5 part of js_backend;
6 6
7 class JavaScriptItemCompilationContext extends ItemCompilationContext { 7 class JavaScriptItemCompilationContext extends ItemCompilationContext {
8 final Set<HInstruction> boundsChecked; 8 final Set<HInstruction> boundsChecked;
9 9
10 JavaScriptItemCompilationContext() 10 JavaScriptItemCompilationContext()
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 static Namer determineNamer(Compiler compiler) { 359 static Namer determineNamer(Compiler compiler) {
360 return compiler.enableMinification ? 360 return compiler.enableMinification ?
361 new MinifyNamer(compiler) : 361 new MinifyNamer(compiler) :
362 new Namer(compiler); 362 new Namer(compiler);
363 } 363 }
364 364
365 bool canBeUsedForGlobalOptimizations(Element element) { 365 bool canBeUsedForGlobalOptimizations(Element element) {
366 if (element.isParameter() 366 if (element.isParameter()
367 || element.isFieldParameter() 367 || element.isFieldParameter()
368 || element.isField()) { 368 || element.isField()) {
369 if (hasInsufficientMirrorsUsed && compiler.enabledInvokeOn) return false;
369 if (!canBeUsedForGlobalOptimizations(element.enclosingElement)) { 370 if (!canBeUsedForGlobalOptimizations(element.enclosingElement)) {
370 return false; 371 return false;
371 } 372 }
372 } 373 }
373 element = element.declaration; 374 element = element.declaration;
374 return !isNeededForReflection(element) && !helpersUsed.contains(element); 375 return !isNeededForReflection(element) && !helpersUsed.contains(element);
375 } 376 }
376 377
377 bool isInterceptorClass(ClassElement element) { 378 bool isInterceptorClass(ClassElement element) {
378 if (element == null) return false; 379 if (element == null) return false;
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 copy(constant.values); 1684 copy(constant.values);
1684 copy(constant.protoValue); 1685 copy(constant.protoValue);
1685 copy(constant); 1686 copy(constant);
1686 } 1687 }
1687 1688
1688 void visitConstructed(ConstructedConstant constant) { 1689 void visitConstructed(ConstructedConstant constant) {
1689 copy(constant.fields); 1690 copy(constant.fields);
1690 copy(constant); 1691 copy(constant);
1691 } 1692 }
1692 } 1693 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698