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

Side by Side Diff: src/heap/store-buffer-inl.h

Issue 1632913003: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips ports Created 4 years, 10 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 | « src/heap/spaces-inl.h ('k') | src/ia32/macro-assembler-ia32.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 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 #ifndef V8_STORE_BUFFER_INL_H_ 5 #ifndef V8_STORE_BUFFER_INL_H_
6 #define V8_STORE_BUFFER_INL_H_ 6 #define V8_STORE_BUFFER_INL_H_
7 7
8 #include "src/heap/heap.h" 8 #include "src/heap/heap.h"
9 #include "src/heap/spaces-inl.h" 9 #include "src/heap/spaces-inl.h"
10 #include "src/heap/store-buffer.h" 10 #include "src/heap/store-buffer.h"
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 if (offset < Page::kPageSize) { 25 if (offset < Page::kPageSize) {
26 *slots = chunk->old_to_new_slots(); 26 *slots = chunk->old_to_new_slots();
27 } else { 27 } else {
28 *slots = &chunk->old_to_new_slots()[offset / Page::kPageSize]; 28 *slots = &chunk->old_to_new_slots()[offset / Page::kPageSize];
29 offset = offset % Page::kPageSize; 29 offset = offset % Page::kPageSize;
30 } 30 }
31 return static_cast<uint32_t>(offset); 31 return static_cast<uint32_t>(offset);
32 } 32 }
33 33
34
35 void LocalStoreBuffer::Record(Address addr) { 34 void LocalStoreBuffer::Record(Address addr) {
36 if (top_->is_full()) top_ = new Node(top_); 35 if (top_->is_full()) top_ = new Node(top_);
37 top_->buffer[top_->count++] = addr; 36 top_->buffer[top_->count++] = addr;
38 } 37 }
39 38
40 void LocalStoreBuffer::Process(StoreBuffer* store_buffer) { 39 void LocalStoreBuffer::Process(StoreBuffer* store_buffer) {
41 Node* current = top_; 40 Node* current = top_;
42 while (current != nullptr) { 41 while (current != nullptr) {
43 for (int i = 0; i < current->count; i++) { 42 for (int i = 0; i < current->count; i++) {
44 store_buffer->Mark(current->buffer[i]); 43 store_buffer->Mark(current->buffer[i]);
45 } 44 }
46 current = current->next; 45 current = current->next;
47 } 46 }
48 } 47 }
49 48
50 void StoreBuffer::Mark(Address addr) { 49 void StoreBuffer::Mark(Address addr) {
51 SlotSet* slots; 50 SlotSet* slots;
52 uint32_t offset; 51 uint32_t offset;
53 offset = AddressToSlotSetAndOffset(addr, &slots); 52 offset = AddressToSlotSetAndOffset(addr, &slots);
54 slots->Insert(offset); 53 slots->Insert(offset);
55 } 54 }
56 55
57 } // namespace internal 56 } // namespace internal
58 } // namespace v8 57 } // namespace v8
59 58
60 #endif // V8_STORE_BUFFER_INL_H_ 59 #endif // V8_STORE_BUFFER_INL_H_
OLDNEW
« no previous file with comments | « src/heap/spaces-inl.h ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698