| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1997 | 1997 |
| 1998 if (FLAG_preemption) { | 1998 if (FLAG_preemption) { |
| 1999 v8::Locker locker; | 1999 v8::Locker locker; |
| 2000 v8::Locker::StartPreemption(100); | 2000 v8::Locker::StartPreemption(100); |
| 2001 } | 2001 } |
| 2002 | 2002 |
| 2003 #ifdef ENABLE_DEBUGGER_SUPPORT | 2003 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 2004 debug_->SetUp(create_heap_objects); | 2004 debug_->SetUp(create_heap_objects); |
| 2005 #endif | 2005 #endif |
| 2006 | 2006 |
| 2007 deoptimizer_data_ = new DeoptimizerData; |
| 2008 |
| 2007 // If we are deserializing, read the state into the now-empty heap. | 2009 // If we are deserializing, read the state into the now-empty heap. |
| 2008 if (!create_heap_objects) { | 2010 if (!create_heap_objects) { |
| 2009 des->Deserialize(); | 2011 des->Deserialize(); |
| 2010 } | 2012 } |
| 2011 stub_cache_->Initialize(); | 2013 stub_cache_->Initialize(); |
| 2012 | 2014 |
| 2013 // Finish initialization of ThreadLocal after deserialization is done. | 2015 // Finish initialization of ThreadLocal after deserialization is done. |
| 2014 clear_pending_exception(); | 2016 clear_pending_exception(); |
| 2015 clear_pending_message(); | 2017 clear_pending_message(); |
| 2016 clear_scheduled_exception(); | 2018 clear_scheduled_exception(); |
| 2017 | 2019 |
| 2018 // Deserializing may put strange things in the root array's copy of the | 2020 // Deserializing may put strange things in the root array's copy of the |
| 2019 // stack guard. | 2021 // stack guard. |
| 2020 heap_.SetStackLimits(); | 2022 heap_.SetStackLimits(); |
| 2021 | 2023 |
| 2022 // Quiet the heap NaN if needed on target platform. | 2024 // Quiet the heap NaN if needed on target platform. |
| 2023 if (!create_heap_objects) Assembler::QuietNaN(heap_.nan_value()); | 2025 if (!create_heap_objects) Assembler::QuietNaN(heap_.nan_value()); |
| 2024 | 2026 |
| 2025 deoptimizer_data_ = new DeoptimizerData; | |
| 2026 runtime_profiler_ = new RuntimeProfiler(this); | 2027 runtime_profiler_ = new RuntimeProfiler(this); |
| 2027 runtime_profiler_->SetUp(); | 2028 runtime_profiler_->SetUp(); |
| 2028 | 2029 |
| 2029 // If we are deserializing, log non-function code objects and compiled | 2030 // If we are deserializing, log non-function code objects and compiled |
| 2030 // functions found in the snapshot. | 2031 // functions found in the snapshot. |
| 2031 if (create_heap_objects && | 2032 if (create_heap_objects && |
| 2032 (FLAG_log_code || FLAG_ll_prof || logger_->is_logging_code_events())) { | 2033 (FLAG_log_code || FLAG_ll_prof || logger_->is_logging_code_events())) { |
| 2033 HandleScope scope; | 2034 HandleScope scope; |
| 2034 LOG(this, LogCodeObjects()); | 2035 LOG(this, LogCodeObjects()); |
| 2035 LOG(this, LogCompiledFunctions()); | 2036 LOG(this, LogCompiledFunctions()); |
| 2036 } | 2037 } |
| 2037 | 2038 |
| 2038 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)), | 2039 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)), |
| 2039 Internals::kIsolateStateOffset); | 2040 Internals::kIsolateStateOffset); |
| 2040 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)), | 2041 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)), |
| 2041 Internals::kIsolateEmbedderDataOffset); | 2042 Internals::kIsolateEmbedderDataOffset); |
| 2042 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), | 2043 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), |
| 2043 Internals::kIsolateRootsOffset); | 2044 Internals::kIsolateRootsOffset); |
| 2044 | 2045 |
| 2045 state_ = INITIALIZED; | 2046 state_ = INITIALIZED; |
| 2046 time_millis_at_init_ = OS::TimeCurrentMillis(); | 2047 time_millis_at_init_ = OS::TimeCurrentMillis(); |
| 2048 |
| 2049 if (!create_heap_objects) { |
| 2050 // Now that the heap is consistent, it's OK to generate the code for the |
| 2051 // deopt entry table that might have been referred to by optimized code in |
| 2052 // the snapshot. |
| 2053 HandleScope scope(this); |
| 2054 Deoptimizer::EnsureCodeForDeoptimizationEntry( |
| 2055 Deoptimizer::LAZY, |
| 2056 kDeoptTableSerializeEntryCount - 1); |
| 2057 } |
| 2058 |
| 2047 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start(); | 2059 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start(); |
| 2048 return true; | 2060 return true; |
| 2049 } | 2061 } |
| 2050 | 2062 |
| 2051 | 2063 |
| 2052 // Initialized lazily to allow early | 2064 // Initialized lazily to allow early |
| 2053 // v8::V8::SetAddHistogramSampleFunction calls. | 2065 // v8::V8::SetAddHistogramSampleFunction calls. |
| 2054 StatsTable* Isolate::stats_table() { | 2066 StatsTable* Isolate::stats_table() { |
| 2055 if (stats_table_ == NULL) { | 2067 if (stats_table_ == NULL) { |
| 2056 stats_table_ = new StatsTable; | 2068 stats_table_ = new StatsTable; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 | 2172 |
| 2161 #ifdef DEBUG | 2173 #ifdef DEBUG |
| 2162 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2174 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2163 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2175 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2164 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2176 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2165 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2177 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2166 #undef ISOLATE_FIELD_OFFSET | 2178 #undef ISOLATE_FIELD_OFFSET |
| 2167 #endif | 2179 #endif |
| 2168 | 2180 |
| 2169 } } // namespace v8::internal | 2181 } } // namespace v8::internal |
| OLD | NEW |