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

Side by Side Diff: runtime/vm/bitmap.cc

Issue 1220193009: Migrate most uses of Isolate::current_zone to Thread::zone. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « runtime/vm/bitmap.h ('k') | runtime/vm/coverage.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) 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // Bits not covered by the backing store are implicitly false. 47 // Bits not covered by the backing store are implicitly false.
48 if (!value) return; 48 if (!value) return;
49 // Grow the backing store if necessary. 49 // Grow the backing store if necessary.
50 intptr_t byte_offset = bit_offset >> kBitsPerByteLog2; 50 intptr_t byte_offset = bit_offset >> kBitsPerByteLog2;
51 if (byte_offset >= data_size_in_bytes_) { 51 if (byte_offset >= data_size_in_bytes_) {
52 uint8_t* old_data = data_; 52 uint8_t* old_data = data_;
53 intptr_t old_size = data_size_in_bytes_; 53 intptr_t old_size = data_size_in_bytes_;
54 data_size_in_bytes_ = 54 data_size_in_bytes_ =
55 Utils::RoundUp(byte_offset + 1, kIncrementSizeInBytes); 55 Utils::RoundUp(byte_offset + 1, kIncrementSizeInBytes);
56 ASSERT(data_size_in_bytes_ > 0); 56 ASSERT(data_size_in_bytes_ > 0);
57 data_ = Isolate::Current()->current_zone()->Alloc<uint8_t>( 57 data_ = Thread::Current()->zone()->Alloc<uint8_t>(
58 data_size_in_bytes_); 58 data_size_in_bytes_);
59 ASSERT(data_ != NULL); 59 ASSERT(data_ != NULL);
60 memmove(data_, old_data, old_size); 60 memmove(data_, old_data, old_size);
61 memset(&data_[old_size], 0, (data_size_in_bytes_ - old_size)); 61 memset(&data_[old_size], 0, (data_size_in_bytes_ - old_size));
62 } 62 }
63 } 63 }
64 SetBit(bit_offset, value); 64 SetBit(bit_offset, value);
65 } 65 }
66 66
67 67
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 uint8_t mask = 1U << bit_remainder; 107 uint8_t mask = 1U << bit_remainder;
108 ASSERT(data_ != NULL); 108 ASSERT(data_ != NULL);
109 if (value) { 109 if (value) {
110 data_[byte_offset] |= mask; 110 data_[byte_offset] |= mask;
111 } else { 111 } else {
112 data_[byte_offset] &= ~mask; 112 data_[byte_offset] &= ~mask;
113 } 113 }
114 } 114 }
115 115
116 } // namespace dart 116 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bitmap.h ('k') | runtime/vm/coverage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698