OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/store-buffer.h" | 5 #include "src/store-buffer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 callback_(NULL), | 30 callback_(NULL), |
31 may_move_store_buffer_entries_(true), | 31 may_move_store_buffer_entries_(true), |
32 virtual_memory_(NULL), | 32 virtual_memory_(NULL), |
33 hash_set_1_(NULL), | 33 hash_set_1_(NULL), |
34 hash_set_2_(NULL), | 34 hash_set_2_(NULL), |
35 hash_sets_are_empty_(true) { | 35 hash_sets_are_empty_(true) { |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 void StoreBuffer::SetUp() { | 39 void StoreBuffer::SetUp() { |
40 virtual_memory_ = new VirtualMemory(kStoreBufferSize * 3); | 40 virtual_memory_ = new base::VirtualMemory(kStoreBufferSize * 3); |
41 uintptr_t start_as_int = | 41 uintptr_t start_as_int = |
42 reinterpret_cast<uintptr_t>(virtual_memory_->address()); | 42 reinterpret_cast<uintptr_t>(virtual_memory_->address()); |
43 start_ = | 43 start_ = |
44 reinterpret_cast<Address*>(RoundUp(start_as_int, kStoreBufferSize * 2)); | 44 reinterpret_cast<Address*>(RoundUp(start_as_int, kStoreBufferSize * 2)); |
45 limit_ = start_ + (kStoreBufferSize / kPointerSize); | 45 limit_ = start_ + (kStoreBufferSize / kPointerSize); |
46 | 46 |
47 old_virtual_memory_ = | 47 old_virtual_memory_ = |
48 new VirtualMemory(kOldStoreBufferLength * kPointerSize); | 48 new base::VirtualMemory(kOldStoreBufferLength * kPointerSize); |
49 old_top_ = old_start_ = | 49 old_top_ = old_start_ = |
50 reinterpret_cast<Address*>(old_virtual_memory_->address()); | 50 reinterpret_cast<Address*>(old_virtual_memory_->address()); |
51 // Don't know the alignment requirements of the OS, but it is certainly not | 51 // Don't know the alignment requirements of the OS, but it is certainly not |
52 // less than 0xfff. | 52 // less than 0xfff. |
53 ASSERT((reinterpret_cast<uintptr_t>(old_start_) & 0xfff) == 0); | 53 ASSERT((reinterpret_cast<uintptr_t>(old_start_) & 0xfff) == 0); |
54 int initial_length = static_cast<int>(OS::CommitPageSize() / kPointerSize); | 54 int initial_length = |
| 55 static_cast<int>(base::OS::CommitPageSize() / kPointerSize); |
55 ASSERT(initial_length > 0); | 56 ASSERT(initial_length > 0); |
56 ASSERT(initial_length <= kOldStoreBufferLength); | 57 ASSERT(initial_length <= kOldStoreBufferLength); |
57 old_limit_ = old_start_ + initial_length; | 58 old_limit_ = old_start_ + initial_length; |
58 old_reserved_limit_ = old_start_ + kOldStoreBufferLength; | 59 old_reserved_limit_ = old_start_ + kOldStoreBufferLength; |
59 | 60 |
60 CHECK(old_virtual_memory_->Commit( | 61 CHECK(old_virtual_memory_->Commit( |
61 reinterpret_cast<void*>(old_start_), | 62 reinterpret_cast<void*>(old_start_), |
62 (old_limit_ - old_start_) * kPointerSize, | 63 (old_limit_ - old_start_) * kPointerSize, |
63 false)); | 64 false)); |
64 | 65 |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 } | 612 } |
612 old_buffer_is_sorted_ = false; | 613 old_buffer_is_sorted_ = false; |
613 old_buffer_is_filtered_ = false; | 614 old_buffer_is_filtered_ = false; |
614 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 615 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
615 ASSERT(old_top_ <= old_limit_); | 616 ASSERT(old_top_ <= old_limit_); |
616 } | 617 } |
617 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 618 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
618 } | 619 } |
619 | 620 |
620 } } // namespace v8::internal | 621 } } // namespace v8::internal |
OLD | NEW |