Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: src/isolate.cc

Issue 938683002: Add --single-threaded flag that disables background threads. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 set_event_logger(Logger::DefaultEventLoggerSentinel); 2104 set_event_logger(Logger::DefaultEventLoggerSentinel);
2105 } 2105 }
2106 2106
2107 // Set default value if not yet set. 2107 // Set default value if not yet set.
2108 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults 2108 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults
2109 // once ResourceConstraints becomes an argument to the Isolate constructor. 2109 // once ResourceConstraints becomes an argument to the Isolate constructor.
2110 if (max_available_threads_ < 1) { 2110 if (max_available_threads_ < 1) {
2111 // Choose the default between 1 and 4. 2111 // Choose the default between 1 and 4.
2112 max_available_threads_ = 2112 max_available_threads_ =
2113 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1); 2113 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1);
2114 if (FLAG_single_threaded) max_available_threads_ = 1;
2114 } 2115 }
2115 2116
2116 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { 2117 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) {
2117 PrintF("Concurrent recompilation has been disabled for tracing.\n"); 2118 PrintF("Concurrent recompilation has been disabled for tracing.\n");
2118 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { 2119 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) {
2119 optimizing_compiler_thread_ = new OptimizingCompilerThread(this); 2120 optimizing_compiler_thread_ = new OptimizingCompilerThread(this);
2120 optimizing_compiler_thread_->Start(); 2121 optimizing_compiler_thread_->Start();
2121 } 2122 }
2122 2123
2123 // Initialize runtime profiler before deserialization, because collections may 2124 // Initialize runtime profiler before deserialization, because collections may
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 if (prev_ && prev_->Intercept(flag)) return true; 2641 if (prev_ && prev_->Intercept(flag)) return true;
2641 // Then check whether this scope intercepts. 2642 // Then check whether this scope intercepts.
2642 if ((flag & intercept_mask_)) { 2643 if ((flag & intercept_mask_)) {
2643 intercepted_flags_ |= flag; 2644 intercepted_flags_ |= flag;
2644 return true; 2645 return true;
2645 } 2646 }
2646 return false; 2647 return false;
2647 } 2648 }
2648 2649
2649 } } // namespace v8::internal 2650 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698