| 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 <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 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2115 | 2115 |
| 2116 InitializeThreadLocal(); | 2116 InitializeThreadLocal(); |
| 2117 | 2117 |
| 2118 bootstrapper_->Initialize(create_heap_objects); | 2118 bootstrapper_->Initialize(create_heap_objects); |
| 2119 builtins_.SetUp(this, create_heap_objects); | 2119 builtins_.SetUp(this, create_heap_objects); |
| 2120 | 2120 |
| 2121 if (FLAG_log_internal_timer_events) { | 2121 if (FLAG_log_internal_timer_events) { |
| 2122 set_event_logger(Logger::DefaultEventLoggerSentinel); | 2122 set_event_logger(Logger::DefaultEventLoggerSentinel); |
| 2123 } | 2123 } |
| 2124 | 2124 |
| 2125 // Set default value if not yet set. | |
| 2126 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults | |
| 2127 // once ResourceConstraints becomes an argument to the Isolate constructor. | |
| 2128 if (max_available_threads_ < 1) { | |
| 2129 // Choose the default between 1 and 4. | |
| 2130 max_available_threads_ = | |
| 2131 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1); | |
| 2132 } | |
| 2133 | |
| 2134 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { | 2125 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { |
| 2135 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2126 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
| 2136 } else if (OptimizingCompileDispatcher::Enabled(max_available_threads_)) { | 2127 } else if (OptimizingCompileDispatcher::Enabled()) { |
| 2137 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); | 2128 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); |
| 2138 } | 2129 } |
| 2139 | 2130 |
| 2140 // Initialize runtime profiler before deserialization, because collections may | 2131 // Initialize runtime profiler before deserialization, because collections may |
| 2141 // occur, clearing/updating ICs. | 2132 // occur, clearing/updating ICs. |
| 2142 runtime_profiler_ = new RuntimeProfiler(this); | 2133 runtime_profiler_ = new RuntimeProfiler(this); |
| 2143 | 2134 |
| 2144 // If we are deserializing, read the state into the now-empty heap. | 2135 // If we are deserializing, read the state into the now-empty heap. |
| 2145 if (!create_heap_objects) { | 2136 if (!create_heap_objects) { |
| 2146 des->Deserialize(this); | 2137 des->Deserialize(this); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 if (prev_ && prev_->Intercept(flag)) return true; | 2649 if (prev_ && prev_->Intercept(flag)) return true; |
| 2659 // Then check whether this scope intercepts. | 2650 // Then check whether this scope intercepts. |
| 2660 if ((flag & intercept_mask_)) { | 2651 if ((flag & intercept_mask_)) { |
| 2661 intercepted_flags_ |= flag; | 2652 intercepted_flags_ |= flag; |
| 2662 return true; | 2653 return true; |
| 2663 } | 2654 } |
| 2664 return false; | 2655 return false; |
| 2665 } | 2656 } |
| 2666 | 2657 |
| 2667 } } // namespace v8::internal | 2658 } } // namespace v8::internal |
| OLD | NEW |