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

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

Issue 49813002: Infer types for parameters even in the presence of InvocationMirror.delegate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (element.isParameter() 417 if (element.isParameter()
418 || element.isFieldParameter() 418 || element.isFieldParameter()
419 || element.isField()) { 419 || element.isField()) {
420 if (usedByBackend(element.enclosingElement)) return true; 420 if (usedByBackend(element.enclosingElement)) return true;
421 } 421 }
422 return helpersUsed.contains(element.declaration); 422 return helpersUsed.contains(element.declaration);
423 } 423 }
424 424
425 bool invokedReflectively(Element element) { 425 bool invokedReflectively(Element element) {
426 if (element.isParameter() || element.isFieldParameter()) { 426 if (element.isParameter() || element.isFieldParameter()) {
427 if (hasInsufficientMirrorsUsed && compiler.enabledInvokeOn) return true;
428 if (invokedReflectively(element.enclosingElement)) return true; 427 if (invokedReflectively(element.enclosingElement)) return true;
429 } 428 }
430 429
431 if (element.isField()) { 430 if (element.isField()) {
432 if (Elements.isStaticOrTopLevel(element) 431 if (Elements.isStaticOrTopLevel(element)
433 && (element.modifiers.isFinal() || element.modifiers.isConst())) { 432 && (element.modifiers.isFinal() || element.modifiers.isConst())) {
434 return false; 433 return false;
435 } 434 }
436 if (hasInsufficientMirrorsUsed && compiler.enabledInvokeOn) return true;
437 } 435 }
438 436
439 return isNeededForReflection(element.declaration); 437 return isNeededForReflection(element.declaration);
440 } 438 }
441 439
442 bool canBeUsedForGlobalOptimizations(Element element) { 440 bool canBeUsedForGlobalOptimizations(Element element) {
443 return !usedByBackend(element) && !invokedReflectively(element); 441 return !usedByBackend(element) && !invokedReflectively(element);
444 } 442 }
445 443
446 bool isInterceptorClass(ClassElement element) { 444 bool isInterceptorClass(ClassElement element) {
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 copy(constant.values); 1868 copy(constant.values);
1871 copy(constant.protoValue); 1869 copy(constant.protoValue);
1872 copy(constant); 1870 copy(constant);
1873 } 1871 }
1874 1872
1875 void visitConstructed(ConstructedConstant constant) { 1873 void visitConstructed(ConstructedConstant constant) {
1876 copy(constant.fields); 1874 copy(constant.fields);
1877 copy(constant); 1875 copy(constant);
1878 } 1876 }
1879 } 1877 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698