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 universe; | 5 part of universe; |
6 | 6 |
7 class SideEffects { | 7 class SideEffects { |
8 // Changes flags. | 8 // Changes flags. |
9 static const int FLAG_CHANGES_INDEX = 0; | 9 static const int FLAG_CHANGES_INDEX = 0; |
10 static const int FLAG_CHANGES_INSTANCE_PROPERTY = FLAG_CHANGES_INDEX + 1; | 10 static const int FLAG_CHANGES_INSTANCE_PROPERTY = FLAG_CHANGES_INDEX + 1; |
(...skipping 10 matching lines...) Expand all Loading... |
21 static const int FLAG_DEPENDS_ON_COUNT = | 21 static const int FLAG_DEPENDS_ON_COUNT = |
22 FLAG_DEPENDS_ON_STATIC_PROPERTY_STORE + 1; | 22 FLAG_DEPENDS_ON_STATIC_PROPERTY_STORE + 1; |
23 | 23 |
24 int _flags = 0; | 24 int _flags = 0; |
25 | 25 |
26 SideEffects() { | 26 SideEffects() { |
27 setAllSideEffects(); | 27 setAllSideEffects(); |
28 setDependsOnSomething(); | 28 setDependsOnSomething(); |
29 } | 29 } |
30 | 30 |
31 SideEffects.empty(); | 31 SideEffects.empty() { |
| 32 clearAllDependencies(); |
| 33 clearAllSideEffects(); |
| 34 } |
32 | 35 |
33 bool operator==(other) => _flags == other._flags; | 36 bool operator==(other) => _flags == other._flags; |
34 | 37 |
35 int get hashCode => throw new UnsupportedError('SideEffects.hashCode'); | 38 int get hashCode => throw new UnsupportedError('SideEffects.hashCode'); |
36 | 39 |
37 bool _getFlag(int position) => (_flags & (1 << position)) != 0; | 40 bool _getFlag(int position) => (_flags & (1 << position)) != 0; |
38 void _setFlag(int position) { _flags |= (1 << position); } | 41 void _setFlag(int position) { _flags |= (1 << position); } |
39 bool _clearFlag(int position) { _flags &= ~(1 << position); } | 42 bool _clearFlag(int position) { _flags &= ~(1 << position); } |
40 | 43 |
41 int getChangesFlags() => _flags & ((1 << FLAG_CHANGES_COUNT) - 1); | 44 int getChangesFlags() => _flags & ((1 << FLAG_CHANGES_COUNT) - 1); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 if (!dependsOnSomething()) buffer.write(' nothing'); | 122 if (!dependsOnSomething()) buffer.write(' nothing'); |
120 buffer.write(', Changes'); | 123 buffer.write(', Changes'); |
121 if (changesIndex()) buffer.write(' []'); | 124 if (changesIndex()) buffer.write(' []'); |
122 if (changesInstanceProperty()) buffer.write(' field'); | 125 if (changesInstanceProperty()) buffer.write(' field'); |
123 if (changesStaticProperty()) buffer.write(' static'); | 126 if (changesStaticProperty()) buffer.write(' static'); |
124 if (!hasSideEffects()) buffer.write(' nothing'); | 127 if (!hasSideEffects()) buffer.write(' nothing'); |
125 buffer.write('.'); | 128 buffer.write('.'); |
126 return buffer.toString(); | 129 return buffer.toString(); |
127 } | 130 } |
128 } | 131 } |
OLD | NEW |