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

Unified Diff: src/heap-inl.h

Issue 8477030: Ensure that promotion queue does not overlap with objects relocated to ToSpace. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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
« src/heap.h ('K') | « src/heap.cc ('k') | src/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index c065b73daa70354c5652b7775d1f46b671b2d6d4..33bc2c7cb5649d60a1c9bfe6e89146a9a0e8c945 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -40,12 +40,26 @@ namespace v8 {
namespace internal {
void PromotionQueue::insert(HeapObject* target, int size) {
+ if (emergency_stack_ != NULL) {
+ emergency_stack_->Add(Entry(target, size));
+ return;
+ }
+
if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(rear_))) {
NewSpacePage* rear_page =
NewSpacePage::FromAddress(reinterpret_cast<Address>(rear_));
ASSERT(!rear_page->prev_page()->is_anchor());
rear_ = reinterpret_cast<intptr_t*>(rear_page->prev_page()->body_limit());
}
+
+ Page* rear_page = Page::FromAddress(reinterpret_cast<Address>(rear_ - 2));
+ Page* limit_page = Page::FromAllocationTop(reinterpret_cast<Address>(limit_));
+ if (rear_page == limit_page && (rear_ - 2) < limit_) {
+ RelocateQueueHead();
Erik Corry 2011/11/07 16:35:25 This one asserts that there is something to reloca
+ emergency_stack_->Add(Entry(target, size));
+ return;
+ }
+
*(--rear_) = reinterpret_cast<intptr_t>(target);
*(--rear_) = size;
// Assert no overflow into live objects.
« src/heap.h ('K') | « src/heap.cc ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698