| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 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& stackmap) { |
| 66 intptr_t min = bitmap.MinimumBitOffset(); | 66 intptr_t min = stackmap.MinimumBitIndex(); |
| 67 intptr_t max = bitmap.MaximumBitOffset(); | 67 intptr_t max = stackmap.MaximumBitIndex(); |
| 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, stackmap.IsObject(i)); |
| 76 } | 76 } |
| 77 intptr_t bound = SizeInBits(); | 77 intptr_t bound = SizeInBits(); |
| 78 for (intptr_t i = (max + 1); i < bound; i++) { | 78 for (intptr_t i = (max + 1); i < bound; i++) { |
| 79 Set(i, false); | 79 Set(i, false); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 bool BitmapBuilder::GetBit(intptr_t bit_offset) const { | 84 bool BitmapBuilder::GetBit(intptr_t bit_offset) const { |
| 85 ASSERT(InRange(bit_offset)); | 85 ASSERT(InRange(bit_offset)); |
| (...skipping 14 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 |