| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 if (element.isParameter() | 412 if (element.isParameter() |
| 413 || element.isFieldParameter() | 413 || element.isFieldParameter() |
| 414 || element.isField()) { | 414 || element.isField()) { |
| 415 if (usedByBackend(element.enclosingElement)) return true; | 415 if (usedByBackend(element.enclosingElement)) return true; |
| 416 } | 416 } |
| 417 return helpersUsed.contains(element.declaration); | 417 return helpersUsed.contains(element.declaration); |
| 418 } | 418 } |
| 419 | 419 |
| 420 bool invokedReflectively(Element element) { | 420 bool invokedReflectively(Element element) { |
| 421 if (element.isParameter() || element.isFieldParameter()) { | 421 if (element.isParameter() || element.isFieldParameter()) { |
| 422 if (hasInsufficientMirrorsUsed && compiler.enabledInvokeOn) return true; | |
| 423 if (invokedReflectively(element.enclosingElement)) return true; | 422 if (invokedReflectively(element.enclosingElement)) return true; |
| 424 } | 423 } |
| 425 | 424 |
| 426 if (element.isField()) { | 425 if (element.isField()) { |
| 427 if (Elements.isStaticOrTopLevel(element) | 426 if (Elements.isStaticOrTopLevel(element) |
| 428 && (element.modifiers.isFinal() || element.modifiers.isConst())) { | 427 && (element.modifiers.isFinal() || element.modifiers.isConst())) { |
| 429 return false; | 428 return false; |
| 430 } | 429 } |
| 431 if (hasInsufficientMirrorsUsed && compiler.enabledInvokeOn) return true; | |
| 432 } | 430 } |
| 433 | 431 |
| 434 return isNeededForReflection(element.declaration); | 432 return isNeededForReflection(element.declaration); |
| 435 } | 433 } |
| 436 | 434 |
| 437 bool canBeUsedForGlobalOptimizations(Element element) { | 435 bool canBeUsedForGlobalOptimizations(Element element) { |
| 438 return !usedByBackend(element) && !invokedReflectively(element); | 436 return !usedByBackend(element) && !invokedReflectively(element); |
| 439 } | 437 } |
| 440 | 438 |
| 441 bool isInterceptorClass(ClassElement element) { | 439 bool isInterceptorClass(ClassElement element) { |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 copy(constant.values); | 1854 copy(constant.values); |
| 1857 copy(constant.protoValue); | 1855 copy(constant.protoValue); |
| 1858 copy(constant); | 1856 copy(constant); |
| 1859 } | 1857 } |
| 1860 | 1858 |
| 1861 void visitConstructed(ConstructedConstant constant) { | 1859 void visitConstructed(ConstructedConstant constant) { |
| 1862 copy(constant.fields); | 1860 copy(constant.fields); |
| 1863 copy(constant); | 1861 copy(constant); |
| 1864 } | 1862 } |
| 1865 } | 1863 } |
| OLD | NEW |