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

Side by Side Diff: pkg/compiler/lib/src/universe/side_effects.dart

Issue 1896843002: Store and serialize NativeBehavior in TreeElements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 months 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/compiler/dart2js/serialization_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 library universe.side_effects; 5 library universe.side_effects;
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 15 matching lines...) Expand all
26 SideEffects() { 26 SideEffects() {
27 setAllSideEffects(); 27 setAllSideEffects();
28 setDependsOnSomething(); 28 setDependsOnSomething();
29 } 29 }
30 30
31 SideEffects.empty() { 31 SideEffects.empty() {
32 clearAllDependencies(); 32 clearAllDependencies();
33 clearAllSideEffects(); 33 clearAllSideEffects();
34 } 34 }
35 35
36 SideEffects.fromFlags(this._flags);
37
36 bool operator ==(other) => _flags == other._flags; 38 bool operator ==(other) => _flags == other._flags;
37 39
38 int get hashCode => throw new UnsupportedError('SideEffects.hashCode'); 40 int get hashCode => throw new UnsupportedError('SideEffects.hashCode');
39 41
40 bool _getFlag(int position) => (_flags & (1 << position)) != 0; 42 bool _getFlag(int position) => (_flags & (1 << position)) != 0;
41 void _setFlag(int position) { 43 void _setFlag(int position) {
42 _flags |= (1 << position); 44 _flags |= (1 << position);
43 } 45 }
44 46
45 void _clearFlag(int position) { 47 void _clearFlag(int position) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 bool dependsOn(int dependsFlags) => (_flags & dependsFlags) != 0; 142 bool dependsOn(int dependsFlags) => (_flags & dependsFlags) != 0;
141 143
142 void add(SideEffects other) { 144 void add(SideEffects other) {
143 _flags |= other._flags; 145 _flags |= other._flags;
144 } 146 }
145 147
146 void setTo(SideEffects other) { 148 void setTo(SideEffects other) {
147 _flags = other._flags; 149 _flags = other._flags;
148 } 150 }
149 151
152 int get flags => _flags;
153
150 String toString() { 154 String toString() {
151 StringBuffer buffer = new StringBuffer(); 155 StringBuffer buffer = new StringBuffer();
152 buffer.write('Depends on'); 156 buffer.write('Depends on');
153 if (dependsOnIndexStore()) buffer.write(' []'); 157 if (dependsOnIndexStore()) buffer.write(' []');
154 if (dependsOnInstancePropertyStore()) buffer.write(' field store'); 158 if (dependsOnInstancePropertyStore()) buffer.write(' field store');
155 if (dependsOnStaticPropertyStore()) buffer.write(' static store'); 159 if (dependsOnStaticPropertyStore()) buffer.write(' static store');
156 if (!dependsOnSomething()) buffer.write(' nothing'); 160 if (!dependsOnSomething()) buffer.write(' nothing');
157 buffer.write(', Changes'); 161 buffer.write(', Changes');
158 if (changesIndex()) buffer.write(' []'); 162 if (changesIndex()) buffer.write(' []');
159 if (changesInstanceProperty()) buffer.write(' field'); 163 if (changesInstanceProperty()) buffer.write(' field');
160 if (changesStaticProperty()) buffer.write(' static'); 164 if (changesStaticProperty()) buffer.write(' static');
161 if (!hasSideEffects()) buffer.write(' nothing'); 165 if (!hasSideEffects()) buffer.write(' nothing');
162 buffer.write('.'); 166 buffer.write('.');
163 return buffer.toString(); 167 return buffer.toString();
164 } 168 }
165 } 169 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/compiler/dart2js/serialization_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698