| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(StoreBufferBlock); | 73 DISALLOW_COPY_AND_ASSIGN(StoreBufferBlock); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 | 76 |
| 77 class StoreBuffer { | 77 class StoreBuffer { |
| 78 public: | 78 public: |
| 79 StoreBuffer(); | 79 StoreBuffer(); |
| 80 ~StoreBuffer(); | 80 ~StoreBuffer(); |
| 81 static void InitOnce(); | 81 static void InitOnce(); |
| 82 static void ShutDown(); |
| 82 | 83 |
| 83 // Interrupt when crossing this threshold of non-empty blocks in the buffer. | 84 // Interrupt when crossing this threshold of non-empty blocks in the buffer. |
| 84 static const intptr_t kMaxNonEmpty = 100; | 85 static const intptr_t kMaxNonEmpty = 100; |
| 85 | 86 |
| 86 // Adds and transfers ownership of the block to the buffer. | 87 // Adds and transfers ownership of the block to the buffer. |
| 87 void PushBlock(StoreBufferBlock* block, bool check_threshold = true); | 88 void PushBlock(StoreBufferBlock* block, bool check_threshold = true); |
| 88 // Partially filled blocks can be reused, and there is an "inifite" supply | 89 // Partially filled blocks can be reused, and there is an "inifite" supply |
| 89 // of empty blocks (reused or newly allocated). In any case, the caller | 90 // of empty blocks (reused or newly allocated). In any case, the caller |
| 90 // takes ownership of the returned block. | 91 // takes ownership of the returned block. |
| 91 StoreBufferBlock* PopNonFullBlock(); | 92 StoreBufferBlock* PopNonFullBlock(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 static const intptr_t kMaxGlobalEmpty = 100; | 130 static const intptr_t kMaxGlobalEmpty = 100; |
| 130 static List* global_empty_; | 131 static List* global_empty_; |
| 131 static Mutex* global_mutex_; | 132 static Mutex* global_mutex_; |
| 132 | 133 |
| 133 DISALLOW_COPY_AND_ASSIGN(StoreBuffer); | 134 DISALLOW_COPY_AND_ASSIGN(StoreBuffer); |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 } // namespace dart | 137 } // namespace dart |
| 137 | 138 |
| 138 #endif // VM_STORE_BUFFER_H_ | 139 #endif // VM_STORE_BUFFER_H_ |
| OLD | NEW |