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

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

Issue 1155633002: Fix 56 hints in pkg/compiler (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase Created 5 years, 7 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/typechecker.dart ('k') | pkg/compiler/lib/src/use_unused_api.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 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 21 matching lines...) Expand all
32 clearAllDependencies(); 32 clearAllDependencies();
33 clearAllSideEffects(); 33 clearAllSideEffects();
34 } 34 }
35 35
36 bool operator==(other) => _flags == other._flags; 36 bool operator==(other) => _flags == other._flags;
37 37
38 int get hashCode => throw new UnsupportedError('SideEffects.hashCode'); 38 int get hashCode => throw new UnsupportedError('SideEffects.hashCode');
39 39
40 bool _getFlag(int position) => (_flags & (1 << position)) != 0; 40 bool _getFlag(int position) => (_flags & (1 << position)) != 0;
41 void _setFlag(int position) { _flags |= (1 << position); } 41 void _setFlag(int position) { _flags |= (1 << position); }
42 bool _clearFlag(int position) { _flags &= ~(1 << position); } 42 void _clearFlag(int position) { _flags &= ~(1 << position); }
43 43
44 int getChangesFlags() => _flags & ((1 << FLAG_CHANGES_COUNT) - 1); 44 int getChangesFlags() => _flags & ((1 << FLAG_CHANGES_COUNT) - 1);
45 int getDependsOnFlags() { 45 int getDependsOnFlags() {
46 return (_flags & ((1 << FLAG_DEPENDS_ON_COUNT) - 1)) >> FLAG_CHANGES_COUNT; 46 return (_flags & ((1 << FLAG_DEPENDS_ON_COUNT) - 1)) >> FLAG_CHANGES_COUNT;
47 } 47 }
48 48
49 bool hasSideEffects() => getChangesFlags() != 0; 49 bool hasSideEffects() => getChangesFlags() != 0;
50 bool dependsOnSomething() => getDependsOnFlags() != 0; 50 bool dependsOnSomething() => getDependsOnFlags() != 0;
51 51
52 void setAllSideEffects() { _flags |= ((1 << FLAG_CHANGES_COUNT) - 1); } 52 void setAllSideEffects() { _flags |= ((1 << FLAG_CHANGES_COUNT) - 1); }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 if (!dependsOnSomething()) buffer.write(' nothing'); 122 if (!dependsOnSomething()) buffer.write(' nothing');
123 buffer.write(', Changes'); 123 buffer.write(', Changes');
124 if (changesIndex()) buffer.write(' []'); 124 if (changesIndex()) buffer.write(' []');
125 if (changesInstanceProperty()) buffer.write(' field'); 125 if (changesInstanceProperty()) buffer.write(' field');
126 if (changesStaticProperty()) buffer.write(' static'); 126 if (changesStaticProperty()) buffer.write(' static');
127 if (!hasSideEffects()) buffer.write(' nothing'); 127 if (!hasSideEffects()) buffer.write(' nothing');
128 buffer.write('.'); 128 buffer.write('.');
129 return buffer.toString(); 129 return buffer.toString();
130 } 130 }
131 } 131 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | pkg/compiler/lib/src/use_unused_api.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698