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

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
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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 static Namer determineNamer(Compiler compiler) { 362 static Namer determineNamer(Compiler compiler) {
363 return compiler.enableMinification ? 363 return compiler.enableMinification ?
364 new MinifyNamer(compiler) : 364 new MinifyNamer(compiler) :
365 new Namer(compiler); 365 new Namer(compiler);
366 } 366 }
367 367
368 bool canBeUsedForGlobalOptimizations(Element element) { 368 bool canBeUsedForGlobalOptimizations(Element element) {
369 if (element.isParameter() 369 if (element.isParameter()
370 || element.isFieldParameter() 370 || element.isFieldParameter()
371 || element.isField()) { 371 || element.isField()) {
372 if (hasInsufficientMirrorsUsed && compiler.enabledInvokeOn) return false;
372 if (!canBeUsedForGlobalOptimizations(element.enclosingElement)) { 373 if (!canBeUsedForGlobalOptimizations(element.enclosingElement)) {
373 return false; 374 return false;
374 } 375 }
375 } 376 }
376 element = element.declaration; 377 element = element.declaration;
377 return !isNeededForReflection(element) && !helpersUsed.contains(element); 378 return !isNeededForReflection(element) && !helpersUsed.contains(element);
378 } 379 }
379 380
380 bool isInterceptorClass(ClassElement element) { 381 bool isInterceptorClass(ClassElement element) {
381 if (element == null) return false; 382 if (element == null) return false;
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1697 copy(constant.values); 1698 copy(constant.values);
1698 copy(constant.protoValue); 1699 copy(constant.protoValue);
1699 copy(constant); 1700 copy(constant);
1700 } 1701 }
1701 1702
1702 void visitConstructed(ConstructedConstant constant) { 1703 void visitConstructed(ConstructedConstant constant) {
1703 copy(constant.fields); 1704 copy(constant.fields);
1704 copy(constant); 1705 copy(constant);
1705 } 1706 }
1706 } 1707 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/js_helper.dart » ('j') | sdk/lib/_internal/lib/js_helper.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698