OLD | NEW |
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 #include "vm/bitmap.h" | 5 #include "vm/bitmap.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/object.h" | 8 #include "vm/object.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 | 57 |
58 void BitmapBuilder::SetRange(intptr_t min, intptr_t max, bool value) { | 58 void BitmapBuilder::SetRange(intptr_t min, intptr_t max, bool value) { |
59 for (intptr_t i = min; i <= max; i++) { | 59 for (intptr_t i = min; i <= max; i++) { |
60 Set(i, value); | 60 Set(i, value); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 | 64 |
65 void BitmapBuilder::SetBits(const Stackmap& bitmap) { | 65 void BitmapBuilder::SetBits(const Stackmap& bitmap) { |
66 intptr_t min = bitmap.MinimumBitOffset(); | 66 intptr_t min = bitmap.Minimum(); |
67 intptr_t max = bitmap.MaximumBitOffset(); | 67 intptr_t max = bitmap.Maximum(); |
68 if (min == Stackmap::kNoMinimum || max == Stackmap::kNoMaximum) { | 68 if (min == Stackmap::kNoMinimum || max == Stackmap::kNoMaximum) { |
69 return; | 69 return; |
70 } | 70 } |
71 for (intptr_t i = 0; i < min; i++) { | 71 for (intptr_t i = 0; i < min; i++) { |
72 Set(i, false); | 72 Set(i, false); |
73 } | 73 } |
74 for (intptr_t i = min; i <= max; i++) { | 74 for (intptr_t i = min; i <= max; i++) { |
75 Set(i, bitmap.IsObject(i)); | 75 Set(i, bitmap.IsObject(i)); |
76 } | 76 } |
77 intptr_t bound = SizeInBits(); | 77 intptr_t bound = SizeInBits(); |
(...skipping 22 matching lines...) Expand all Loading... |
100 ASSERT(bit_list_ != NULL); | 100 ASSERT(bit_list_ != NULL); |
101 byte_addr = &(bit_list_[byte_offset]); | 101 byte_addr = &(bit_list_[byte_offset]); |
102 if (value) { | 102 if (value) { |
103 *byte_addr |= mask; | 103 *byte_addr |= mask; |
104 } else { | 104 } else { |
105 *byte_addr &= ~mask; | 105 *byte_addr &= ~mask; |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 } // namespace dart | 109 } // namespace dart |
OLD | NEW |