OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_HANDLES_H_ | 5 #ifndef VM_HANDLES_H_ |
6 #define VM_HANDLES_H_ | 6 #define VM_HANDLES_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 // Accessors. | 170 // Accessors. |
171 intptr_t next_handle_slot() const { return next_handle_slot_; } | 171 intptr_t next_handle_slot() const { return next_handle_slot_; } |
172 void set_next_handle_slot(intptr_t next_handle_slot) { | 172 void set_next_handle_slot(intptr_t next_handle_slot) { |
173 next_handle_slot_ = next_handle_slot; | 173 next_handle_slot_ = next_handle_slot; |
174 } | 174 } |
175 HandlesBlock* next_block() const { return next_block_; } | 175 HandlesBlock* next_block() const { return next_block_; } |
176 void set_next_block(HandlesBlock* next) { next_block_ = next; } | 176 void set_next_block(HandlesBlock* next) { next_block_ = next; } |
177 | 177 |
178 private: | 178 private: |
179 // Zap value used to indicate uninitialized handle area (debug purposes). | |
180 static const uword kZapUninitializedWord = 0xabababab; | |
181 | |
182 uword data_[kHandleSizeInWords * kHandlesPerChunk]; // Handles area. | 179 uword data_[kHandleSizeInWords * kHandlesPerChunk]; // Handles area. |
183 intptr_t next_handle_slot_; // Next slot for allocation in current block. | 180 intptr_t next_handle_slot_; // Next slot for allocation in current block. |
184 HandlesBlock* next_block_; // Link to next block of handles. | 181 HandlesBlock* next_block_; // Link to next block of handles. |
185 | 182 |
186 DISALLOW_COPY_AND_ASSIGN(HandlesBlock); | 183 DISALLOW_COPY_AND_ASSIGN(HandlesBlock); |
187 }; | 184 }; |
188 | 185 |
189 // Deletes all the allocated handle blocks. | 186 // Deletes all the allocated handle blocks. |
190 void DeleteAll(); | 187 void DeleteAll(); |
191 void DeleteHandleBlocks(HandlesBlock* blocks); | 188 void DeleteHandleBlocks(HandlesBlock* blocks); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 }; | 316 }; |
320 #endif // defined(DEBUG) | 317 #endif // defined(DEBUG) |
321 | 318 |
322 // Macro to start a no handles scope in the code. | 319 // Macro to start a no handles scope in the code. |
323 #define NOHANDLESCOPE(isolate) \ | 320 #define NOHANDLESCOPE(isolate) \ |
324 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); | 321 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); |
325 | 322 |
326 } // namespace dart | 323 } // namespace dart |
327 | 324 |
328 #endif // VM_HANDLES_H_ | 325 #endif // VM_HANDLES_H_ |
OLD | NEW |