OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1992 } | 1992 } |
1993 | 1993 |
1994 if (create_heap_objects) { | 1994 if (create_heap_objects) { |
1995 // Terminate the cache array with the sentinel so we can iterate. | 1995 // Terminate the cache array with the sentinel so we can iterate. |
1996 PushToPartialSnapshotCache(heap_.undefined_value()); | 1996 PushToPartialSnapshotCache(heap_.undefined_value()); |
1997 } | 1997 } |
1998 | 1998 |
1999 InitializeThreadLocal(); | 1999 InitializeThreadLocal(); |
2000 | 2000 |
2001 bootstrapper_->Initialize(create_heap_objects); | 2001 bootstrapper_->Initialize(create_heap_objects); |
2002 builtins_.SetUp(create_heap_objects); | 2002 builtins_.SetUp(create_heap_objects, false); |
2003 | 2003 |
2004 // Only preallocate on the first initialization. | 2004 // Only preallocate on the first initialization. |
2005 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { | 2005 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { |
2006 // Start the thread which will set aside some memory. | 2006 // Start the thread which will set aside some memory. |
2007 PreallocatedMemoryThreadStart(); | 2007 PreallocatedMemoryThreadStart(); |
2008 preallocated_message_space_ = | 2008 preallocated_message_space_ = |
2009 new NoAllocationStringAllocator( | 2009 new NoAllocationStringAllocator( |
2010 preallocated_memory_thread_->data(), | 2010 preallocated_memory_thread_->data(), |
2011 preallocated_memory_thread_->length()); | 2011 preallocated_memory_thread_->length()); |
2012 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); | 2012 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); |
2013 } | 2013 } |
2014 | 2014 |
2015 if (FLAG_preemption) { | 2015 if (FLAG_preemption) { |
2016 v8::Locker locker; | 2016 v8::Locker locker; |
2017 v8::Locker::StartPreemption(100); | 2017 v8::Locker::StartPreemption(100); |
2018 } | 2018 } |
2019 | 2019 |
2020 #ifdef ENABLE_DEBUGGER_SUPPORT | 2020 #ifdef ENABLE_DEBUGGER_SUPPORT |
2021 debug_->SetUp(create_heap_objects); | 2021 debug_->SetUp(create_heap_objects); |
2022 #endif | 2022 #endif |
2023 | 2023 |
2024 // If we are deserializing, read the state into the now-empty heap. | 2024 // If we are deserializing, read the state into the now-empty heap. |
2025 if (!create_heap_objects) { | 2025 if (!create_heap_objects) { |
2026 des->Deserialize(); | 2026 des->Deserialize(); |
2027 | |
2028 // Set up builtins that are not included in snapshot. | |
2029 builtins_.SetUp(false, true); | |
ulan
2012/12/17 10:44:52
This doesn't cover the case when snapshot is compl
hans
2012/12/17 12:31:44
That sounds like a good idea.
ulan
2012/12/17 13:03:36
Thanks, this part looks good now.
On 2012/12/17 12
| |
2027 } | 2030 } |
2031 | |
2028 stub_cache_->Initialize(); | 2032 stub_cache_->Initialize(); |
2029 | 2033 |
2030 // Finish initialization of ThreadLocal after deserialization is done. | 2034 // Finish initialization of ThreadLocal after deserialization is done. |
2031 clear_pending_exception(); | 2035 clear_pending_exception(); |
2032 clear_pending_message(); | 2036 clear_pending_message(); |
2033 clear_scheduled_exception(); | 2037 clear_scheduled_exception(); |
2034 | 2038 |
2035 // Deserializing may put strange things in the root array's copy of the | 2039 // Deserializing may put strange things in the root array's copy of the |
2036 // stack guard. | 2040 // stack guard. |
2037 heap_.SetStackLimits(); | 2041 heap_.SetStackLimits(); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2177 | 2181 |
2178 #ifdef DEBUG | 2182 #ifdef DEBUG |
2179 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2183 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2180 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2184 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2181 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2185 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2182 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2186 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2183 #undef ISOLATE_FIELD_OFFSET | 2187 #undef ISOLATE_FIELD_OFFSET |
2184 #endif | 2188 #endif |
2185 | 2189 |
2186 } } // namespace v8::internal | 2190 } } // namespace v8::internal |
OLD | NEW |