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

Unified Diff: src/heap/spaces.cc

Issue 581223004: Support large objects in the serializer/deserializer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
« no previous file with comments | « src/heap/spaces.h ('k') | src/mksnapshot.cc » ('j') | src/serialize.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index f8d340f18278b3d5ded9deecfe24fe329634bdbe..6d8bff64d69f870fbc5719432805659c20adb4b4 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -2840,9 +2840,7 @@ AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
return AllocationResult::Retry(identity());
}
- if (Size() + object_size > max_capacity_) {
- return AllocationResult::Retry(identity());
- }
+ if (!CanAllocateSize(object_size)) return AllocationResult::Retry(identity());
LargePage* page = heap()->isolate()->memory_allocator()->AllocateLargePage(
object_size, this, executable);
@@ -2887,6 +2885,13 @@ AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
}
+void LargeObjectSpace::PrepareForDeserialization(int large_objects_total_size) {
+ if (CanAllocateSize(large_objects_total_size)) return;
+ heap()->CollectAllAvailableGarbage("prepare for deserialization");
+ if (!CanAllocateSize(large_objects_total_size)) FatalProcessOutOfMemory();
+}
+
+
size_t LargeObjectSpace::CommittedPhysicalMemory() {
if (!base::VirtualMemory::HasLazyCommits()) return CommittedMemory();
size_t size = 0;
« no previous file with comments | « src/heap/spaces.h ('k') | src/mksnapshot.cc » ('j') | src/serialize.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698