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

Unified Diff: src/spaces-inl.h

Issue 6745033: On store buffer overflow we mark individidual pages for... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/spaces-inl.h
===================================================================
--- src/spaces-inl.h (revision 7374)
+++ src/spaces-inl.h (working copy)
@@ -113,14 +113,6 @@
// --------------------------------------------------------------------------
// PagedSpace
-
-bool PagedSpace::Contains(Address addr) {
- Page* p = Page::FromAddress(addr);
- if (!p->is_valid()) return false;
- return p->owner() == this;
-}
-
-
Page* Page::Initialize(MemoryChunk* chunk,
Executability executable,
PagedSpace* owner) {
@@ -136,6 +128,40 @@
}
+bool PagedSpace::Contains(Address addr) {
+ Page* p = Page::FromAddress(addr);
+ if (!p->is_valid()) return false;
+ return p->owner() == this;
+}
+
+
+MemoryChunk* MemoryChunk::FromAnyPointerAddress(Address addr) {
+ MemoryChunk* maybe = reinterpret_cast<MemoryChunk*>(
+ OffsetFrom(addr) & ~Page::kPageAlignmentMask);
+ if (maybe->owner() != NULL) return maybe;
+ LargeObjectIterator iterator(Heap::lo_space());
+ for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) {
+ // Fixed arrays are the only pointer-containing objects in large object
+ // space.
+ if (o->IsFixedArray()) {
+ MemoryChunk* chunk = MemoryChunk::FromAddress(o->address());
+ if (chunk->Contains(addr)) {
+ return chunk;
+ }
+ }
+ }
+ UNREACHABLE();
+ return NULL;
+}
+
+
+PointerChunkIterator::PointerChunkIterator()
+ : state_(kOldPointerState),
+ old_pointer_iterator_(Heap::old_pointer_space()),
+ map_iterator_(Heap::map_space()),
+ lo_iterator_(Heap::lo_space()) { }
+
+
Page* Page::next_page() {
ASSERT(next_chunk()->owner() == owner());
return static_cast<Page*>(next_chunk());

Powered by Google App Engine
This is Rietveld 408576698