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

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

Issue 609563002: Address MSVS 2013 warning C4146: unary minus operator applied to unsigned type, result still unsign… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | 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) 2012, 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_OBJECT_SET_H_ 5 #ifndef VM_OBJECT_SET_H_
6 #define VM_OBJECT_SET_H_ 6 #define VM_OBJECT_SET_H_
7 7
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/raw_object.h" 10 #include "vm/raw_object.h"
(...skipping 13 matching lines...) Expand all
24 ~ObjectSet() { 24 ~ObjectSet() {
25 delete[] allocation_; 25 delete[] allocation_;
26 } 26 }
27 27
28 void Init(uword start, uword end) { 28 void Init(uword start, uword end) {
29 start_ = start; 29 start_ = start;
30 end_ = end; 30 end_ = end;
31 ASSERT(start_ <= end_); 31 ASSERT(start_ <= end_);
32 size_ = SizeFor((end_ - start_) >> kWordSizeLog2); 32 size_ = SizeFor((end_ - start_) >> kWordSizeLog2);
33 allocation_ = new uword[size_]; 33 allocation_ = new uword[size_];
34 data_ = &allocation_[-((start >> kWordSizeLog2) / kBitsPerWord)]; 34 data_ = &allocation_[0 - ((start >> kWordSizeLog2) / kBitsPerWord)];
koda 2014/09/25 21:31:28 Consider creating a local intptr_t for the express
35 ASSERT(allocation_ == &data_[(start >> kWordSizeLog2) / kBitsPerWord]); 35 ASSERT(allocation_ == &data_[(start >> kWordSizeLog2) / kBitsPerWord]);
36 Clear(); 36 Clear();
37 } 37 }
38 38
39 bool Contains(RawObject* raw_obj) const { 39 bool Contains(RawObject* raw_obj) const {
40 uword raw_addr = RawObject::ToAddr(raw_obj); 40 uword raw_addr = RawObject::ToAddr(raw_obj);
41 ASSERT(raw_addr >= start_); 41 ASSERT(raw_addr >= start_);
42 ASSERT(raw_addr < end_); 42 ASSERT(raw_addr < end_);
43 uword i = raw_addr >> kWordSizeLog2; 43 uword i = raw_addr >> kWordSizeLog2;
44 uword mask = (static_cast<uword>(1) << (i % kBitsPerWord)); 44 uword mask = (static_cast<uword>(1) << (i % kBitsPerWord));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // The inclusive maximum address in this ObjectMap. 105 // The inclusive maximum address in this ObjectMap.
106 // Used by FastClear 106 // Used by FastClear
107 uword max_; 107 uword max_;
108 108
109 DISALLOW_COPY_AND_ASSIGN(ObjectSet); 109 DISALLOW_COPY_AND_ASSIGN(ObjectSet);
110 }; 110 };
111 111
112 } // namespace dart 112 } // namespace dart
113 113
114 #endif // VM_OBJECT_SET_H_ 114 #endif // VM_OBJECT_SET_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698