| Index: src/isolate.cc
|
| diff --git a/src/isolate.cc b/src/isolate.cc
|
| index 7c06903ea917b14f75ec6288b5be4ec0b8f3403f..841e20f833e4dc85ac04d0d419149b1334841f75 100644
|
| --- a/src/isolate.cc
|
| +++ b/src/isolate.cc
|
| @@ -1999,7 +1999,14 @@ bool Isolate::Init(Deserializer* des) {
|
| InitializeThreadLocal();
|
|
|
| bootstrapper_->Initialize(create_heap_objects);
|
| - builtins_.SetUp(create_heap_objects);
|
| +
|
| + if (des == NULL && !Serializer::enabled()) {
|
| + builtins_.SetUp(Builtins::ALL);
|
| + } else if (des == NULL) {
|
| + builtins_.SetUp(Builtins::FOR_SNAPSHOT);
|
| + } else {
|
| + builtins_.SetUp(Builtins::BEFORE_DESERIALIZATION);
|
| + }
|
|
|
| // Only preallocate on the first initialization.
|
| if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) {
|
| @@ -2022,9 +2029,13 @@ bool Isolate::Init(Deserializer* des) {
|
| #endif
|
|
|
| // If we are deserializing, read the state into the now-empty heap.
|
| - if (!create_heap_objects) {
|
| + if (des) {
|
| des->Deserialize();
|
| +
|
| + // Set up builtins that were not included in snapshot.
|
| + builtins_.SetUp(Builtins::AFTER_DESERIALIZATION);
|
| }
|
| +
|
| stub_cache_->Initialize();
|
|
|
| // Finish initialization of ThreadLocal after deserialization is done.
|
|
|