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 22 matching lines...) Expand all Loading... |
33 #include "bootstrapper.h" | 33 #include "bootstrapper.h" |
34 #include "codegen.h" | 34 #include "codegen.h" |
35 #include "compilation-cache.h" | 35 #include "compilation-cache.h" |
36 #include "debug.h" | 36 #include "debug.h" |
37 #include "deoptimizer.h" | 37 #include "deoptimizer.h" |
38 #include "heap-profiler.h" | 38 #include "heap-profiler.h" |
39 #include "hydrogen.h" | 39 #include "hydrogen.h" |
40 #include "isolate.h" | 40 #include "isolate.h" |
41 #include "lithium-allocator.h" | 41 #include "lithium-allocator.h" |
42 #include "log.h" | 42 #include "log.h" |
| 43 #include "marking-thread.h" |
43 #include "messages.h" | 44 #include "messages.h" |
44 #include "platform.h" | 45 #include "platform.h" |
45 #include "regexp-stack.h" | 46 #include "regexp-stack.h" |
46 #include "runtime-profiler.h" | 47 #include "runtime-profiler.h" |
47 #include "scopeinfo.h" | 48 #include "scopeinfo.h" |
48 #include "serialize.h" | 49 #include "serialize.h" |
49 #include "simulator.h" | 50 #include "simulator.h" |
50 #include "spaces.h" | 51 #include "spaces.h" |
51 #include "stub-cache.h" | 52 #include "stub-cache.h" |
52 #include "sweeper-thread.h" | 53 #include "sweeper-thread.h" |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 thread_manager_(NULL), | 1647 thread_manager_(NULL), |
1647 fp_stubs_generated_(false), | 1648 fp_stubs_generated_(false), |
1648 has_installed_extensions_(false), | 1649 has_installed_extensions_(false), |
1649 string_tracker_(NULL), | 1650 string_tracker_(NULL), |
1650 regexp_stack_(NULL), | 1651 regexp_stack_(NULL), |
1651 date_cache_(NULL), | 1652 date_cache_(NULL), |
1652 code_stub_interface_descriptors_(NULL), | 1653 code_stub_interface_descriptors_(NULL), |
1653 context_exit_happened_(false), | 1654 context_exit_happened_(false), |
1654 deferred_handles_head_(NULL), | 1655 deferred_handles_head_(NULL), |
1655 optimizing_compiler_thread_(this), | 1656 optimizing_compiler_thread_(this), |
| 1657 marking_thread_(NULL), |
1656 sweeper_thread_(NULL) { | 1658 sweeper_thread_(NULL) { |
1657 TRACE_ISOLATE(constructor); | 1659 TRACE_ISOLATE(constructor); |
1658 | 1660 |
1659 memset(isolate_addresses_, 0, | 1661 memset(isolate_addresses_, 0, |
1660 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); | 1662 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); |
1661 | 1663 |
1662 heap_.isolate_ = this; | 1664 heap_.isolate_ = this; |
1663 stack_guard_.isolate_ = this; | 1665 stack_guard_.isolate_ = this; |
1664 | 1666 |
1665 // ThreadManager is initialized early to support locking an isolate | 1667 // ThreadManager is initialized early to support locking an isolate |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 TRACE_ISOLATE(deinit); | 1740 TRACE_ISOLATE(deinit); |
1739 | 1741 |
1740 if (FLAG_concurrent_sweeping || FLAG_parallel_sweeping) { | 1742 if (FLAG_concurrent_sweeping || FLAG_parallel_sweeping) { |
1741 for (int i = 0; i < FLAG_sweeper_threads; i++) { | 1743 for (int i = 0; i < FLAG_sweeper_threads; i++) { |
1742 sweeper_thread_[i]->Stop(); | 1744 sweeper_thread_[i]->Stop(); |
1743 delete sweeper_thread_[i]; | 1745 delete sweeper_thread_[i]; |
1744 } | 1746 } |
1745 delete[] sweeper_thread_; | 1747 delete[] sweeper_thread_; |
1746 } | 1748 } |
1747 | 1749 |
| 1750 if (FLAG_parallel_marking) { |
| 1751 for (int i = 0; i < FLAG_marking_threads; i++) { |
| 1752 marking_thread_[i]->Stop(); |
| 1753 delete marking_thread_[i]; |
| 1754 } |
| 1755 delete[] marking_thread_; |
| 1756 } |
| 1757 |
1748 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop(); | 1758 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop(); |
1749 | 1759 |
1750 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); | 1760 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); |
1751 | 1761 |
1752 // We must stop the logger before we tear down other components. | 1762 // We must stop the logger before we tear down other components. |
1753 logger_->EnsureTickerStopped(); | 1763 logger_->EnsureTickerStopped(); |
1754 | 1764 |
1755 delete deoptimizer_data_; | 1765 delete deoptimizer_data_; |
1756 deoptimizer_data_ = NULL; | 1766 deoptimizer_data_ = NULL; |
1757 if (FLAG_preemption) { | 1767 if (FLAG_preemption) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2108 | 2118 |
2109 if (!Serializer::enabled()) { | 2119 if (!Serializer::enabled()) { |
2110 // Ensure that the stub failure trampoline has been generated. | 2120 // Ensure that the stub failure trampoline has been generated. |
2111 HandleScope scope(this); | 2121 HandleScope scope(this); |
2112 CodeStub::GenerateFPStubs(); | 2122 CodeStub::GenerateFPStubs(); |
2113 StubFailureTrampolineStub().GetCode(); | 2123 StubFailureTrampolineStub().GetCode(); |
2114 } | 2124 } |
2115 | 2125 |
2116 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start(); | 2126 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start(); |
2117 | 2127 |
| 2128 if (FLAG_parallel_marking) { |
| 2129 if (FLAG_marking_threads < 1) { |
| 2130 FLAG_marking_threads = 1; |
| 2131 } |
| 2132 marking_thread_ = new MarkingThread*[FLAG_marking_threads]; |
| 2133 for (int i = 0; i < FLAG_marking_threads; i++) { |
| 2134 marking_thread_[i] = new MarkingThread(this); |
| 2135 marking_thread_[i]->Start(); |
| 2136 } |
| 2137 } |
| 2138 |
2118 if (FLAG_parallel_sweeping || FLAG_concurrent_sweeping) { | 2139 if (FLAG_parallel_sweeping || FLAG_concurrent_sweeping) { |
2119 if (FLAG_sweeper_threads < 1) { | 2140 if (FLAG_sweeper_threads < 1) { |
2120 FLAG_sweeper_threads = 1; | 2141 FLAG_sweeper_threads = 1; |
2121 } | 2142 } |
2122 sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads]; | 2143 sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads]; |
2123 for (int i = 0; i < FLAG_sweeper_threads; i++) { | 2144 for (int i = 0; i < FLAG_sweeper_threads; i++) { |
2124 sweeper_thread_[i] = new SweeperThread(this); | 2145 sweeper_thread_[i] = new SweeperThread(this); |
2125 sweeper_thread_[i]->Start(); | 2146 sweeper_thread_[i]->Start(); |
2126 } | 2147 } |
2127 } | 2148 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2246 | 2267 |
2247 #ifdef DEBUG | 2268 #ifdef DEBUG |
2248 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2269 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2249 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2270 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2250 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2271 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2251 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2272 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2252 #undef ISOLATE_FIELD_OFFSET | 2273 #undef ISOLATE_FIELD_OFFSET |
2253 #endif | 2274 #endif |
2254 | 2275 |
2255 } } // namespace v8::internal | 2276 } } // namespace v8::internal |
OLD | NEW |