| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_helper; | 5 part of _js_helper; |
| 6 | 6 |
| 7 /// Tells the optimizing compiler that the annotated method has no | 7 /// Tells the optimizing compiler that the annotated method has no |
| 8 /// side-effects. | 8 /// side-effects. |
| 9 /// Requires @NoInline() to function correctly. | 9 /// Requires @NoInline() to function correctly. |
| 10 class NoSideEffects { | 10 class NoSideEffects { |
| 11 const NoSideEffects(); | 11 const NoSideEffects(); |
| 12 } | 12 } |
| 13 | 13 |
| 14 /// Tells the optimizing compiler that the annotated method cannot throw. | 14 /// Tells the optimizing compiler that the annotated method cannot throw. |
| 15 /// Requires @NoInline() to function correctly. | 15 /// Requires @NoInline() to function correctly. |
| 16 class NoThrows { | 16 class NoThrows { |
| 17 const NoThrows(); | 17 const NoThrows(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 /// Tells the optimizing compiler to not inline the annotated method. | 20 /// Tells the optimizing compiler to not inline the annotated method. |
| 21 class NoInline { | 21 class NoInline { |
| 22 const NoInline(); | 22 const NoInline(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 /// Tells the optimizing compiler to always inline the annotated method. |
| 26 class ForceInline { |
| 27 const ForceInline(); |
| 28 } |
| 29 |
| 25 // Ensures that the annotated method is represented internally using | 30 // Ensures that the annotated method is represented internally using |
| 26 // IR nodes ([:value == true:]) or AST nodes ([:value == false:]). | 31 // IR nodes ([:value == true:]) or AST nodes ([:value == false:]). |
| 27 class IrRepresentation { | 32 class IrRepresentation { |
| 28 final bool value; | 33 final bool value; |
| 29 const IrRepresentation(this.value); | 34 const IrRepresentation(this.value); |
| 30 } | 35 } |
| 31 | 36 |
| 32 /// Marks a class as native and defines its JavaScript name(s). | 37 /// Marks a class as native and defines its JavaScript name(s). |
| 33 class Native { | 38 class Native { |
| 34 final String name; | 39 final String name; |
| 35 const Native(this.name); | 40 const Native(this.name); |
| 36 } | 41 } |
| 37 | 42 |
| 38 class _Patch { | 43 class _Patch { |
| 39 final String version; | 44 final String version; |
| 40 | 45 |
| 41 const _Patch(this.version); | 46 const _Patch(this.version); |
| 42 } | 47 } |
| 43 | 48 |
| 44 /// Annotation that marks the declaration as a patch. | 49 /// Annotation that marks the declaration as a patch. |
| 45 const _Patch patch = const _Patch(null); | 50 const _Patch patch = const _Patch(null); |
| 46 | 51 |
| 47 /// Annotation that marks the declaration as a patch for the old emitter. | 52 /// Annotation that marks the declaration as a patch for the old emitter. |
| 48 const _Patch patch_old = const _Patch('old'); | 53 const _Patch patch_old = const _Patch('old'); |
| 49 | 54 |
| 50 /// Annotation that marks the declaration as a patch for the new emitter. | 55 /// Annotation that marks the declaration as a patch for the new emitter. |
| 51 const _Patch patch_new = const _Patch('new'); | 56 const _Patch patch_new = const _Patch('new'); |
| OLD | NEW |