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

Unified Diff: src/api.cc

Issue 73463004: Add a proper way to pass the number of processors to V8 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 7966e2c57c95d0a987db6c15f302e3417ae22895..c59ace1036b3b13f54217c9d0433dfb127cc0651 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -566,8 +566,8 @@ ResourceConstraints::ResourceConstraints()
stack_limit_(NULL),
max_available_threads_(0) { }
-
-void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory) {
+void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
+ uint32_t number_of_processors) {
const int lump_of_memory = (i::kPointerSize / 4) * i::MB;
#if V8_OS_ANDROID
// Android has higher physical memory requirements before raising the maximum
@@ -601,7 +601,12 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory) {
set_max_executable_size(256 * lump_of_memory);
}
- set_max_available_threads(0);
+ set_max_available_threads(i::Max(i::Min(number_of_processors, 4u), 1u));
+}
+
+
+void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory) {
+ ConfigureDefaults(physical_memory, i::CPU::NumberOfProcessorsOnline());
}
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698