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 #ifndef V8_SPACES_INL_H_ | 5 #ifndef V8_SPACES_INL_H_ |
6 #define V8_SPACES_INL_H_ | 6 #define V8_SPACES_INL_H_ |
7 | 7 |
8 #include "src/heap-profiler.h" | 8 #include "src/heap-profiler.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/spaces.h" | 10 #include "src/spaces.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return NULL; | 102 return NULL; |
103 } | 103 } |
104 | 104 |
105 | 105 |
106 // ----------------------------------------------------------------------------- | 106 // ----------------------------------------------------------------------------- |
107 // MemoryAllocator | 107 // MemoryAllocator |
108 | 108 |
109 #ifdef ENABLE_HEAP_PROTECTION | 109 #ifdef ENABLE_HEAP_PROTECTION |
110 | 110 |
111 void MemoryAllocator::Protect(Address start, size_t size) { | 111 void MemoryAllocator::Protect(Address start, size_t size) { |
112 OS::Protect(start, size); | 112 base::OS::Protect(start, size); |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 void MemoryAllocator::Unprotect(Address start, | 116 void MemoryAllocator::Unprotect(Address start, |
117 size_t size, | 117 size_t size, |
118 Executability executable) { | 118 Executability executable) { |
119 OS::Unprotect(start, size, executable); | 119 base::OS::Unprotect(start, size, executable); |
120 } | 120 } |
121 | 121 |
122 | 122 |
123 void MemoryAllocator::ProtectChunkFromPage(Page* page) { | 123 void MemoryAllocator::ProtectChunkFromPage(Page* page) { |
124 int id = GetChunkId(page); | 124 int id = GetChunkId(page); |
125 OS::Protect(chunks_[id].address(), chunks_[id].size()); | 125 base::OS::Protect(chunks_[id].address(), chunks_[id].size()); |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 void MemoryAllocator::UnprotectChunkFromPage(Page* page) { | 129 void MemoryAllocator::UnprotectChunkFromPage(Page* page) { |
130 int id = GetChunkId(page); | 130 int id = GetChunkId(page); |
131 OS::Unprotect(chunks_[id].address(), chunks_[id].size(), | 131 base::OS::Unprotect(chunks_[id].address(), chunks_[id].size(), |
132 chunks_[id].owner()->executable() == EXECUTABLE); | 132 chunks_[id].owner()->executable() == EXECUTABLE); |
133 } | 133 } |
134 | 134 |
135 #endif | 135 #endif |
136 | 136 |
137 | 137 |
138 // -------------------------------------------------------------------------- | 138 // -------------------------------------------------------------------------- |
139 // PagedSpace | 139 // PagedSpace |
140 Page* Page::Initialize(Heap* heap, | 140 Page* Page::Initialize(Heap* heap, |
141 MemoryChunk* chunk, | 141 MemoryChunk* chunk, |
142 Executability executable, | 142 Executability executable, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 Map* map = object->map(); | 306 Map* map = object->map(); |
307 Heap* heap = object->GetHeap(); | 307 Heap* heap = object->GetHeap(); |
308 return map == heap->raw_unchecked_free_space_map() | 308 return map == heap->raw_unchecked_free_space_map() |
309 || map == heap->raw_unchecked_one_pointer_filler_map() | 309 || map == heap->raw_unchecked_one_pointer_filler_map() |
310 || map == heap->raw_unchecked_two_pointer_filler_map(); | 310 || map == heap->raw_unchecked_two_pointer_filler_map(); |
311 } | 311 } |
312 | 312 |
313 } } // namespace v8::internal | 313 } } // namespace v8::internal |
314 | 314 |
315 #endif // V8_SPACES_INL_H_ | 315 #endif // V8_SPACES_INL_H_ |
OLD | NEW |