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 #ifndef VM_STORE_BUFFER_H_ | 5 #ifndef VM_STORE_BUFFER_H_ |
6 #define VM_STORE_BUFFER_H_ | 6 #define VM_STORE_BUFFER_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 Block* PopAll(); | 114 Block* PopAll(); |
115 private: | 115 private: |
116 Block* head_; | 116 Block* head_; |
117 intptr_t length_; | 117 intptr_t length_; |
118 DISALLOW_COPY_AND_ASSIGN(List); | 118 DISALLOW_COPY_AND_ASSIGN(List); |
119 }; | 119 }; |
120 | 120 |
121 // Adds and transfers ownership of the block to the buffer. | 121 // Adds and transfers ownership of the block to the buffer. |
122 void PushBlockImpl(Block* block); | 122 void PushBlockImpl(Block* block); |
123 | 123 |
124 // If needed, trims the the global cache of empty blocks. | 124 // If needed, trims the global cache of empty blocks. |
125 static void TrimGlobalEmpty(); | 125 static void TrimGlobalEmpty(); |
126 | 126 |
127 List full_; | 127 List full_; |
128 List partial_; | 128 List partial_; |
129 Mutex* mutex_; | 129 Mutex* mutex_; |
130 | 130 |
131 // Note: This is shared on the basis of block size. | 131 // Note: This is shared on the basis of block size. |
132 static const intptr_t kMaxGlobalEmpty = 100; | 132 static const intptr_t kMaxGlobalEmpty = 100; |
133 static List* global_empty_; | 133 static List* global_empty_; |
134 static Mutex* global_mutex_; | 134 static Mutex* global_mutex_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Adds and transfers ownership of the block to the buffer. | 169 // Adds and transfers ownership of the block to the buffer. |
170 void PushBlock(Block* block) { | 170 void PushBlock(Block* block) { |
171 BlockStack<Block::kSize>::PushBlockImpl(block); | 171 BlockStack<Block::kSize>::PushBlockImpl(block); |
172 } | 172 } |
173 }; | 173 }; |
174 | 174 |
175 | 175 |
176 } // namespace dart | 176 } // namespace dart |
177 | 177 |
178 #endif // VM_STORE_BUFFER_H_ | 178 #endif // VM_STORE_BUFFER_H_ |
OLD | NEW |