Index: src/spaces-inl.h |
=================================================================== |
--- src/spaces-inl.h (revision 1577) |
+++ src/spaces-inl.h (working copy) |
@@ -219,6 +219,43 @@ |
} |
+bool MemoryAllocator::InInitialChunk(Address address) { |
+ if (initial_chunk_ == NULL) return false; |
+ |
+ Address start = static_cast<Address>(initial_chunk_->address()); |
+ return (start <= address) && (address < start + initial_chunk_->size()); |
+} |
+ |
+ |
+#ifdef ENABLE_HEAP_PROTECTION |
+ |
+void MemoryAllocator::Protect(Address start, size_t size) { |
+ OS::Protect(start, size); |
+} |
+ |
+ |
+void MemoryAllocator::Unprotect(Address start, |
+ size_t size, |
+ Executability executable) { |
+ OS::Unprotect(start, size, executable); |
+} |
+ |
+ |
+void MemoryAllocator::ProtectChunkFromPage(Page* page) { |
+ int id = GetChunkId(page); |
+ OS::Protect(chunks_[id].address(), chunks_[id].size()); |
+} |
+ |
+ |
+void MemoryAllocator::UnprotectChunkFromPage(Page* page) { |
+ int id = GetChunkId(page); |
+ OS::Unprotect(chunks_[id].address(), chunks_[id].size(), |
+ chunks_[id].owner()->executable() == EXECUTABLE); |
+} |
+ |
+#endif |
+ |
+ |
// -------------------------------------------------------------------------- |
// PagedSpace |