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

Side by Side Diff: runtime/vm/boolfield.h

Issue 9189003: Move assert.h/assert.cc from runtime/vm to runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Check for correct rebase Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/bitfield_test.cc ('k') | runtime/vm/boolfield_test.cc » ('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) 2011, 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 #ifndef VM_BOOLFIELD_H_ 5 #ifndef VM_BOOLFIELD_H_
6 #define VM_BOOLFIELD_H_ 6 #define VM_BOOLFIELD_H_
7 7
8 #include "vm/globals.h"
9
8 namespace dart { 10 namespace dart {
9 11
10 // BoolField is a template for encoding and decoding a bit inside an 12 // BoolField is a template for encoding and decoding a bit inside an
11 // unsigned machine word. 13 // unsigned machine word.
12 template<int position> 14 template<int position>
13 class BoolField { 15 class BoolField {
14 public: 16 public:
15 // Returns a uword with the bool value encoded. 17 // Returns a uword with the bool value encoded.
16 static uword encode(bool value) { 18 static uword encode(bool value) {
17 ASSERT(position < sizeof(uword)); 19 ASSERT(position < sizeof(uword));
(...skipping 12 matching lines...) Expand all
30 static uword update(bool value, uword original) { 32 static uword update(bool value, uword original) {
31 ASSERT(position < sizeof(uword)); 33 ASSERT(position < sizeof(uword));
32 const uword mask = 1U << position; 34 const uword mask = 1U << position;
33 return value ? original | mask : original & ~mask; 35 return value ? original | mask : original & ~mask;
34 } 36 }
35 }; 37 };
36 38
37 } // namespace dart 39 } // namespace dart
38 40
39 #endif // VM_BOOLFIELD_H_ 41 #endif // VM_BOOLFIELD_H_
OLDNEW
« no previous file with comments | « runtime/vm/bitfield_test.cc ('k') | runtime/vm/boolfield_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698