OLD | NEW |
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 "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| 11 #include "src/base/sys-info.h" |
11 #include "src/base/utils/random-number-generator.h" | 12 #include "src/base/utils/random-number-generator.h" |
12 #include "src/bootstrapper.h" | 13 #include "src/bootstrapper.h" |
13 #include "src/codegen.h" | 14 #include "src/codegen.h" |
14 #include "src/compilation-cache.h" | 15 #include "src/compilation-cache.h" |
15 #include "src/cpu-profiler.h" | 16 #include "src/cpu-profiler.h" |
16 #include "src/debug.h" | 17 #include "src/debug.h" |
17 #include "src/deoptimizer.h" | 18 #include "src/deoptimizer.h" |
18 #include "src/heap/spaces.h" | 19 #include "src/heap/spaces.h" |
19 #include "src/heap/sweeper-thread.h" | 20 #include "src/heap/sweeper-thread.h" |
20 #include "src/heap-profiler.h" | 21 #include "src/heap-profiler.h" |
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 } else { | 1941 } else { |
1941 set_event_logger(Logger::EmptyTimerEventsLogger); | 1942 set_event_logger(Logger::EmptyTimerEventsLogger); |
1942 } | 1943 } |
1943 | 1944 |
1944 // Set default value if not yet set. | 1945 // Set default value if not yet set. |
1945 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults | 1946 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults |
1946 // once ResourceConstraints becomes an argument to the Isolate constructor. | 1947 // once ResourceConstraints becomes an argument to the Isolate constructor. |
1947 if (max_available_threads_ < 1) { | 1948 if (max_available_threads_ < 1) { |
1948 // Choose the default between 1 and 4. | 1949 // Choose the default between 1 and 4. |
1949 max_available_threads_ = | 1950 max_available_threads_ = |
1950 Max(Min(base::OS::NumberOfProcessorsOnline(), 4), 1); | 1951 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1); |
1951 } | 1952 } |
1952 | 1953 |
1953 if (!FLAG_job_based_sweeping) { | 1954 if (!FLAG_job_based_sweeping) { |
1954 num_sweeper_threads_ = | 1955 num_sweeper_threads_ = |
1955 SweeperThread::NumberOfThreads(max_available_threads_); | 1956 SweeperThread::NumberOfThreads(max_available_threads_); |
1956 } | 1957 } |
1957 | 1958 |
1958 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { | 1959 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { |
1959 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 1960 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
1960 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { | 1961 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 if (prev_ && prev_->Intercept(flag)) return true; | 2418 if (prev_ && prev_->Intercept(flag)) return true; |
2418 // Then check whether this scope intercepts. | 2419 // Then check whether this scope intercepts. |
2419 if ((flag & intercept_mask_)) { | 2420 if ((flag & intercept_mask_)) { |
2420 intercepted_flags_ |= flag; | 2421 intercepted_flags_ |= flag; |
2421 return true; | 2422 return true; |
2422 } | 2423 } |
2423 return false; | 2424 return false; |
2424 } | 2425 } |
2425 | 2426 |
2426 } } // namespace v8::internal | 2427 } } // namespace v8::internal |
OLD | NEW |