OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1732 } | 1732 } |
1733 | 1733 |
1734 // Setup the object heap. | 1734 // Setup the object heap. |
1735 const bool create_heap_objects = (des == NULL); | 1735 const bool create_heap_objects = (des == NULL); |
1736 ASSERT(!heap_.HasBeenSetup()); | 1736 ASSERT(!heap_.HasBeenSetup()); |
1737 if (!heap_.Setup(create_heap_objects)) { | 1737 if (!heap_.Setup(create_heap_objects)) { |
1738 V8::SetFatalError(); | 1738 V8::SetFatalError(); |
1739 return false; | 1739 return false; |
1740 } | 1740 } |
1741 | 1741 |
1742 InitializeThreadLocal(); | |
1743 | |
1744 bootstrapper_->Initialize(create_heap_objects); | 1742 bootstrapper_->Initialize(create_heap_objects); |
1745 builtins_.Setup(create_heap_objects); | 1743 builtins_.Setup(create_heap_objects); |
1746 | 1744 |
1747 // Only preallocate on the first initialization. | 1745 // Only preallocate on the first initialization. |
1748 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { | 1746 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { |
1749 // Start the thread which will set aside some memory. | 1747 // Start the thread which will set aside some memory. |
1750 PreallocatedMemoryThreadStart(); | 1748 PreallocatedMemoryThreadStart(); |
1751 preallocated_message_space_ = | 1749 preallocated_message_space_ = |
1752 new NoAllocationStringAllocator( | 1750 new NoAllocationStringAllocator( |
1753 preallocated_memory_thread_->data(), | 1751 preallocated_memory_thread_->data(), |
(...skipping 10 matching lines...) Expand all Loading... | |
1764 debug_->Setup(create_heap_objects); | 1762 debug_->Setup(create_heap_objects); |
1765 #endif | 1763 #endif |
1766 stub_cache_->Initialize(create_heap_objects); | 1764 stub_cache_->Initialize(create_heap_objects); |
1767 | 1765 |
1768 // If we are deserializing, read the state into the now-empty heap. | 1766 // If we are deserializing, read the state into the now-empty heap. |
1769 if (des != NULL) { | 1767 if (des != NULL) { |
1770 des->Deserialize(); | 1768 des->Deserialize(); |
1771 stub_cache_->Initialize(true); | 1769 stub_cache_->Initialize(true); |
1772 } | 1770 } |
1773 | 1771 |
1772 InitializeThreadLocal(); | |
fschneider
2011/10/04 10:48:52
Calls clear_pending_exception() which uses heap->t
| |
1773 | |
1774 // Deserializing may put strange things in the root array's copy of the | 1774 // Deserializing may put strange things in the root array's copy of the |
1775 // stack guard. | 1775 // stack guard. |
1776 heap_.SetStackLimits(); | 1776 heap_.SetStackLimits(); |
1777 | 1777 |
1778 deoptimizer_data_ = new DeoptimizerData; | 1778 deoptimizer_data_ = new DeoptimizerData; |
1779 runtime_profiler_ = new RuntimeProfiler(this); | 1779 runtime_profiler_ = new RuntimeProfiler(this); |
1780 runtime_profiler_->Setup(); | 1780 runtime_profiler_->Setup(); |
1781 | 1781 |
1782 // If we are deserializing, log non-function code objects and compiled | 1782 // If we are deserializing, log non-function code objects and compiled |
1783 // functions found in the snapshot. | 1783 // functions found in the snapshot. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1873 | 1873 |
1874 #ifdef DEBUG | 1874 #ifdef DEBUG |
1875 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1875 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
1876 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1876 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
1877 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1877 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
1878 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1878 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
1879 #undef ISOLATE_FIELD_OFFSET | 1879 #undef ISOLATE_FIELD_OFFSET |
1880 #endif | 1880 #endif |
1881 | 1881 |
1882 } } // namespace v8::internal | 1882 } } // namespace v8::internal |
OLD | NEW |