| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |