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 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 } | 1664 } |
1665 | 1665 |
1666 for (int i = 0; i < num_sweeper_threads_; i++) { | 1666 for (int i = 0; i < num_sweeper_threads_; i++) { |
1667 sweeper_thread_[i]->Stop(); | 1667 sweeper_thread_[i]->Stop(); |
1668 delete sweeper_thread_[i]; | 1668 delete sweeper_thread_[i]; |
1669 sweeper_thread_[i] = NULL; | 1669 sweeper_thread_[i] = NULL; |
1670 } | 1670 } |
1671 delete[] sweeper_thread_; | 1671 delete[] sweeper_thread_; |
1672 sweeper_thread_ = NULL; | 1672 sweeper_thread_ = NULL; |
1673 | 1673 |
| 1674 if (FLAG_job_based_sweeping && |
| 1675 heap_.mark_compact_collector()->IsConcurrentSweepingInProgress()) { |
| 1676 heap_.mark_compact_collector()->WaitUntilSweepingCompleted(); |
| 1677 } |
1674 | 1678 |
1675 if (FLAG_hydrogen_stats) GetHStatistics()->Print(); | 1679 if (FLAG_hydrogen_stats) GetHStatistics()->Print(); |
1676 | 1680 |
1677 if (FLAG_print_deopt_stress) { | 1681 if (FLAG_print_deopt_stress) { |
1678 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); | 1682 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); |
1679 } | 1683 } |
1680 | 1684 |
1681 // We must stop the logger before we tear down other components. | 1685 // We must stop the logger before we tear down other components. |
1682 Sampler* sampler = logger_->sampler(); | 1686 Sampler* sampler = logger_->sampler(); |
1683 if (sampler && sampler->IsActive()) sampler->Stop(); | 1687 if (sampler && sampler->IsActive()) sampler->Stop(); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 if (create_heap_objects) heap_.CreateStubsRequiringBuiltins(); | 2007 if (create_heap_objects) heap_.CreateStubsRequiringBuiltins(); |
2004 | 2008 |
2005 // Set default value if not yet set. | 2009 // Set default value if not yet set. |
2006 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults | 2010 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults |
2007 // once ResourceConstraints becomes an argument to the Isolate constructor. | 2011 // once ResourceConstraints becomes an argument to the Isolate constructor. |
2008 if (max_available_threads_ < 1) { | 2012 if (max_available_threads_ < 1) { |
2009 // Choose the default between 1 and 4. | 2013 // Choose the default between 1 and 4. |
2010 max_available_threads_ = Max(Min(CPU::NumberOfProcessorsOnline(), 4), 1); | 2014 max_available_threads_ = Max(Min(CPU::NumberOfProcessorsOnline(), 4), 1); |
2011 } | 2015 } |
2012 | 2016 |
2013 num_sweeper_threads_ = SweeperThread::NumberOfThreads(max_available_threads_); | 2017 if (!FLAG_job_based_sweeping) { |
| 2018 num_sweeper_threads_ = |
| 2019 SweeperThread::NumberOfThreads(max_available_threads_); |
| 2020 } |
2014 | 2021 |
2015 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { | 2022 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { |
2016 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2023 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
2017 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { | 2024 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { |
2018 optimizing_compiler_thread_ = new OptimizingCompilerThread(this); | 2025 optimizing_compiler_thread_ = new OptimizingCompilerThread(this); |
2019 optimizing_compiler_thread_->Start(); | 2026 optimizing_compiler_thread_->Start(); |
2020 } | 2027 } |
2021 | 2028 |
2022 if (num_sweeper_threads_ > 0) { | 2029 if (num_sweeper_threads_ > 0) { |
2023 sweeper_thread_ = new SweeperThread*[num_sweeper_threads_]; | 2030 sweeper_thread_ = new SweeperThread*[num_sweeper_threads_]; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 | 2315 |
2309 #ifdef DEBUG | 2316 #ifdef DEBUG |
2310 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2317 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2311 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2318 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2312 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2319 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2313 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2320 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2314 #undef ISOLATE_FIELD_OFFSET | 2321 #undef ISOLATE_FIELD_OFFSET |
2315 #endif | 2322 #endif |
2316 | 2323 |
2317 } } // namespace v8::internal | 2324 } } // namespace v8::internal |
OLD | NEW |