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 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1); | 1924 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1); |
1925 } | 1925 } |
1926 | 1926 |
1927 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { | 1927 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { |
1928 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 1928 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
1929 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { | 1929 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { |
1930 optimizing_compiler_thread_ = new OptimizingCompilerThread(this); | 1930 optimizing_compiler_thread_ = new OptimizingCompilerThread(this); |
1931 optimizing_compiler_thread_->Start(); | 1931 optimizing_compiler_thread_->Start(); |
1932 } | 1932 } |
1933 | 1933 |
| 1934 // Initialize runtime profiler before deserialization, because collections may |
| 1935 // occur, clearing/updating ICs. |
| 1936 runtime_profiler_ = new RuntimeProfiler(this); |
| 1937 |
1934 // If we are deserializing, read the state into the now-empty heap. | 1938 // If we are deserializing, read the state into the now-empty heap. |
1935 if (!create_heap_objects) { | 1939 if (!create_heap_objects) { |
1936 des->Deserialize(this); | 1940 des->Deserialize(this); |
1937 } | 1941 } |
1938 stub_cache_->Initialize(); | 1942 stub_cache_->Initialize(); |
1939 | 1943 |
1940 // Finish initialization of ThreadLocal after deserialization is done. | 1944 // Finish initialization of ThreadLocal after deserialization is done. |
1941 clear_pending_exception(); | 1945 clear_pending_exception(); |
1942 clear_pending_message(); | 1946 clear_pending_message(); |
1943 clear_scheduled_exception(); | 1947 clear_scheduled_exception(); |
1944 | 1948 |
1945 // Deserializing may put strange things in the root array's copy of the | 1949 // Deserializing may put strange things in the root array's copy of the |
1946 // stack guard. | 1950 // stack guard. |
1947 heap_.SetStackLimits(); | 1951 heap_.SetStackLimits(); |
1948 | 1952 |
1949 // Quiet the heap NaN if needed on target platform. | 1953 // Quiet the heap NaN if needed on target platform. |
1950 if (!create_heap_objects) Assembler::QuietNaN(heap_.nan_value()); | 1954 if (!create_heap_objects) Assembler::QuietNaN(heap_.nan_value()); |
1951 | 1955 |
1952 runtime_profiler_ = new RuntimeProfiler(this); | |
1953 | |
1954 if (FLAG_trace_turbo) { | 1956 if (FLAG_trace_turbo) { |
1955 // Erase the file. | 1957 // Erase the file. |
1956 char buffer[512]; | 1958 char buffer[512]; |
1957 Vector<char> filename(buffer, sizeof(buffer)); | 1959 Vector<char> filename(buffer, sizeof(buffer)); |
1958 GetTurboCfgFileName(filename); | 1960 GetTurboCfgFileName(filename); |
1959 std::ofstream turbo_cfg_stream(filename.start(), | 1961 std::ofstream turbo_cfg_stream(filename.start(), |
1960 std::fstream::out | std::fstream::trunc); | 1962 std::fstream::out | std::fstream::trunc); |
1961 } | 1963 } |
1962 | 1964 |
1963 | |
1964 // If we are deserializing, log non-function code objects and compiled | 1965 // If we are deserializing, log non-function code objects and compiled |
1965 // functions found in the snapshot. | 1966 // functions found in the snapshot. |
1966 if (!create_heap_objects && | 1967 if (!create_heap_objects && |
1967 (FLAG_log_code || | 1968 (FLAG_log_code || |
1968 FLAG_ll_prof || | 1969 FLAG_ll_prof || |
1969 FLAG_perf_jit_prof || | 1970 FLAG_perf_jit_prof || |
1970 FLAG_perf_basic_prof || | 1971 FLAG_perf_basic_prof || |
1971 logger_->is_logging_code_events())) { | 1972 logger_->is_logging_code_events())) { |
1972 HandleScope scope(this); | 1973 HandleScope scope(this); |
1973 LOG(this, LogCodeObjects()); | 1974 LOG(this, LogCodeObjects()); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 if (prev_ && prev_->Intercept(flag)) return true; | 2402 if (prev_ && prev_->Intercept(flag)) return true; |
2402 // Then check whether this scope intercepts. | 2403 // Then check whether this scope intercepts. |
2403 if ((flag & intercept_mask_)) { | 2404 if ((flag & intercept_mask_)) { |
2404 intercepted_flags_ |= flag; | 2405 intercepted_flags_ |= flag; |
2405 return true; | 2406 return true; |
2406 } | 2407 } |
2407 return false; | 2408 return false; |
2408 } | 2409 } |
2409 | 2410 |
2410 } } // namespace v8::internal | 2411 } } // namespace v8::internal |
OLD | NEW |