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 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 handle_scope_implementer_(NULL), | 1763 handle_scope_implementer_(NULL), |
1764 unicode_cache_(NULL), | 1764 unicode_cache_(NULL), |
1765 runtime_zone_(this), | 1765 runtime_zone_(this), |
1766 in_use_list_(0), | 1766 in_use_list_(0), |
1767 free_list_(0), | 1767 free_list_(0), |
1768 preallocated_storage_preallocated_(false), | 1768 preallocated_storage_preallocated_(false), |
1769 inner_pointer_to_code_cache_(NULL), | 1769 inner_pointer_to_code_cache_(NULL), |
1770 write_iterator_(NULL), | 1770 write_iterator_(NULL), |
1771 global_handles_(NULL), | 1771 global_handles_(NULL), |
1772 eternal_handles_(NULL), | 1772 eternal_handles_(NULL), |
1773 context_switcher_(NULL), | |
1774 thread_manager_(NULL), | 1773 thread_manager_(NULL), |
1775 fp_stubs_generated_(false), | 1774 fp_stubs_generated_(false), |
1776 has_installed_extensions_(false), | 1775 has_installed_extensions_(false), |
1777 string_tracker_(NULL), | 1776 string_tracker_(NULL), |
1778 regexp_stack_(NULL), | 1777 regexp_stack_(NULL), |
1779 date_cache_(NULL), | 1778 date_cache_(NULL), |
1780 code_stub_interface_descriptors_(NULL), | 1779 code_stub_interface_descriptors_(NULL), |
1781 // TODO(bmeurer) Initialized lazily because it depends on flags; can | 1780 // TODO(bmeurer) Initialized lazily because it depends on flags; can |
1782 // be fixed once the default isolate cleanup is done. | 1781 // be fixed once the default isolate cleanup is done. |
1783 random_number_generator_(NULL), | 1782 random_number_generator_(NULL), |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 if (FLAG_print_deopt_stress) { | 1899 if (FLAG_print_deopt_stress) { |
1901 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); | 1900 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); |
1902 } | 1901 } |
1903 | 1902 |
1904 // We must stop the logger before we tear down other components. | 1903 // We must stop the logger before we tear down other components. |
1905 Sampler* sampler = logger_->sampler(); | 1904 Sampler* sampler = logger_->sampler(); |
1906 if (sampler && sampler->IsActive()) sampler->Stop(); | 1905 if (sampler && sampler->IsActive()) sampler->Stop(); |
1907 | 1906 |
1908 delete deoptimizer_data_; | 1907 delete deoptimizer_data_; |
1909 deoptimizer_data_ = NULL; | 1908 deoptimizer_data_ = NULL; |
1910 if (FLAG_preemption) { | |
1911 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this)); | |
1912 v8::Locker::StopPreemption(reinterpret_cast<v8::Isolate*>(this)); | |
1913 } | |
1914 builtins_.TearDown(); | 1909 builtins_.TearDown(); |
1915 bootstrapper_->TearDown(); | 1910 bootstrapper_->TearDown(); |
1916 | 1911 |
1917 // Remove the external reference to the preallocated stack memory. | 1912 // Remove the external reference to the preallocated stack memory. |
1918 delete preallocated_message_space_; | 1913 delete preallocated_message_space_; |
1919 preallocated_message_space_ = NULL; | 1914 preallocated_message_space_ = NULL; |
1920 PreallocatedMemoryThreadStop(); | 1915 PreallocatedMemoryThreadStop(); |
1921 | 1916 |
1922 if (runtime_profiler_ != NULL) { | 1917 if (runtime_profiler_ != NULL) { |
1923 runtime_profiler_->TearDown(); | 1918 runtime_profiler_->TearDown(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 | 2015 |
2021 delete compilation_cache_; | 2016 delete compilation_cache_; |
2022 compilation_cache_ = NULL; | 2017 compilation_cache_ = NULL; |
2023 delete bootstrapper_; | 2018 delete bootstrapper_; |
2024 bootstrapper_ = NULL; | 2019 bootstrapper_ = NULL; |
2025 delete inner_pointer_to_code_cache_; | 2020 delete inner_pointer_to_code_cache_; |
2026 inner_pointer_to_code_cache_ = NULL; | 2021 inner_pointer_to_code_cache_ = NULL; |
2027 delete write_iterator_; | 2022 delete write_iterator_; |
2028 write_iterator_ = NULL; | 2023 write_iterator_ = NULL; |
2029 | 2024 |
2030 delete context_switcher_; | |
2031 context_switcher_ = NULL; | |
2032 delete thread_manager_; | 2025 delete thread_manager_; |
2033 thread_manager_ = NULL; | 2026 thread_manager_ = NULL; |
2034 | 2027 |
2035 delete string_tracker_; | 2028 delete string_tracker_; |
2036 string_tracker_ = NULL; | 2029 string_tracker_ = NULL; |
2037 | 2030 |
2038 delete memory_allocator_; | 2031 delete memory_allocator_; |
2039 memory_allocator_ = NULL; | 2032 memory_allocator_ = NULL; |
2040 delete code_range_; | 2033 delete code_range_; |
2041 code_range_ = NULL; | 2034 code_range_ = NULL; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { | 2235 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { |
2243 // Start the thread which will set aside some memory. | 2236 // Start the thread which will set aside some memory. |
2244 PreallocatedMemoryThreadStart(); | 2237 PreallocatedMemoryThreadStart(); |
2245 preallocated_message_space_ = | 2238 preallocated_message_space_ = |
2246 new NoAllocationStringAllocator( | 2239 new NoAllocationStringAllocator( |
2247 preallocated_memory_thread_->data(), | 2240 preallocated_memory_thread_->data(), |
2248 preallocated_memory_thread_->length()); | 2241 preallocated_memory_thread_->length()); |
2249 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); | 2242 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); |
2250 } | 2243 } |
2251 | 2244 |
2252 if (FLAG_preemption) { | |
2253 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this)); | |
2254 v8::Locker::StartPreemption(reinterpret_cast<v8::Isolate*>(this), 100); | |
2255 } | |
2256 | |
2257 #ifdef ENABLE_DEBUGGER_SUPPORT | 2245 #ifdef ENABLE_DEBUGGER_SUPPORT |
2258 debug_->SetUp(create_heap_objects); | 2246 debug_->SetUp(create_heap_objects); |
2259 #endif | 2247 #endif |
2260 | 2248 |
2261 // If we are deserializing, read the state into the now-empty heap. | 2249 // If we are deserializing, read the state into the now-empty heap. |
2262 if (!create_heap_objects) { | 2250 if (!create_heap_objects) { |
2263 des->Deserialize(this); | 2251 des->Deserialize(this); |
2264 } | 2252 } |
2265 stub_cache_->Initialize(); | 2253 stub_cache_->Initialize(); |
2266 | 2254 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2523 | 2511 |
2524 #ifdef DEBUG | 2512 #ifdef DEBUG |
2525 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2513 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2526 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2514 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2527 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2515 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2528 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2516 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2529 #undef ISOLATE_FIELD_OFFSET | 2517 #undef ISOLATE_FIELD_OFFSET |
2530 #endif | 2518 #endif |
2531 | 2519 |
2532 } } // namespace v8::internal | 2520 } } // namespace v8::internal |
OLD | NEW |