Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 61d2b2d89d05888261129db687b60efcc8def66e..4ee3b300493ce9b4cb93feff1ac19d8c9646bac2 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -2039,13 +2039,20 @@ bool Isolate::Init(Deserializer* des) { |
} |
// SetUp the object heap. |
- const bool create_heap_objects = (des == NULL); |
ASSERT(!heap_.HasBeenSetUp()); |
- if (!heap_.SetUp(create_heap_objects)) { |
+ if (!heap_.SetUp()) { |
V8::FatalProcessOutOfMemory("heap setup"); |
return false; |
} |
+ deoptimizer_data_ = new DeoptimizerData; |
+ |
+ const bool create_heap_objects = (des == NULL); |
+ if (create_heap_objects && !heap_.CreateHeapObjects()) { |
+ V8::FatalProcessOutOfMemory("heap object creation"); |
+ return false; |
+ } |
+ |
if (create_heap_objects) { |
// Terminate the cache array with the sentinel so we can iterate. |
PushToPartialSnapshotCache(heap_.undefined_value()); |
@@ -2076,8 +2083,6 @@ bool Isolate::Init(Deserializer* des) { |
debug_->SetUp(create_heap_objects); |
#endif |
- deoptimizer_data_ = new DeoptimizerData; |
- |
// If we are deserializing, read the state into the now-empty heap. |
if (!create_heap_objects) { |
des->Deserialize(); |