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 "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2373 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2373 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
2374 } else if (OptimizingCompileDispatcher::Enabled()) { | 2374 } else if (OptimizingCompileDispatcher::Enabled()) { |
2375 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); | 2375 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); |
2376 } | 2376 } |
2377 | 2377 |
2378 // Initialize runtime profiler before deserialization, because collections may | 2378 // Initialize runtime profiler before deserialization, because collections may |
2379 // occur, clearing/updating ICs. | 2379 // occur, clearing/updating ICs. |
2380 runtime_profiler_ = new RuntimeProfiler(this); | 2380 runtime_profiler_ = new RuntimeProfiler(this); |
2381 | 2381 |
2382 // If we are deserializing, read the state into the now-empty heap. | 2382 // If we are deserializing, read the state into the now-empty heap. |
2383 if (!create_heap_objects) { | 2383 { |
2384 des->Deserialize(this); | 2384 AlwaysAllocateScope always_allocate(this); |
2385 } | 2385 |
2386 load_stub_cache_->Initialize(); | 2386 if (!create_heap_objects) { |
2387 store_stub_cache_->Initialize(); | 2387 des->Deserialize(this); |
2388 if (FLAG_ignition || serializer_enabled()) { | 2388 } |
2389 interpreter_->Initialize(); | 2389 load_stub_cache_->Initialize(); |
| 2390 store_stub_cache_->Initialize(); |
| 2391 if (FLAG_ignition || serializer_enabled()) { |
| 2392 interpreter_->Initialize(); |
| 2393 } |
| 2394 |
| 2395 heap_.NotifyDeserializationComplete(); |
2390 } | 2396 } |
2391 | 2397 |
2392 // Finish initialization of ThreadLocal after deserialization is done. | 2398 // Finish initialization of ThreadLocal after deserialization is done. |
2393 clear_pending_exception(); | 2399 clear_pending_exception(); |
2394 clear_pending_message(); | 2400 clear_pending_message(); |
2395 clear_scheduled_exception(); | 2401 clear_scheduled_exception(); |
2396 | 2402 |
2397 // Deserializing may put strange things in the root array's copy of the | 2403 // Deserializing may put strange things in the root array's copy of the |
2398 // stack guard. | 2404 // stack guard. |
2399 heap_.SetStackLimits(); | 2405 heap_.SetStackLimits(); |
(...skipping 10 matching lines...) Expand all Loading... |
2410 Internals::kIsolateEmbedderDataOffset); | 2416 Internals::kIsolateEmbedderDataOffset); |
2411 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), | 2417 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), |
2412 Internals::kIsolateRootsOffset); | 2418 Internals::kIsolateRootsOffset); |
2413 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_)), | 2419 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_)), |
2414 Internals::kExternalMemoryOffset); | 2420 Internals::kExternalMemoryOffset); |
2415 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_limit_)), | 2421 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_limit_)), |
2416 Internals::kExternalMemoryLimitOffset); | 2422 Internals::kExternalMemoryLimitOffset); |
2417 | 2423 |
2418 time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs(); | 2424 time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs(); |
2419 | 2425 |
2420 heap_.NotifyDeserializationComplete(); | |
2421 | |
2422 if (!create_heap_objects) { | 2426 if (!create_heap_objects) { |
2423 // Now that the heap is consistent, it's OK to generate the code for the | 2427 // Now that the heap is consistent, it's OK to generate the code for the |
2424 // deopt entry table that might have been referred to by optimized code in | 2428 // deopt entry table that might have been referred to by optimized code in |
2425 // the snapshot. | 2429 // the snapshot. |
2426 HandleScope scope(this); | 2430 HandleScope scope(this); |
2427 Deoptimizer::EnsureCodeForDeoptimizationEntry( | 2431 Deoptimizer::EnsureCodeForDeoptimizationEntry( |
2428 this, Deoptimizer::LAZY, | 2432 this, Deoptimizer::LAZY, |
2429 ExternalReferenceTable::kDeoptTableSerializeEntryCount - 1); | 2433 ExternalReferenceTable::kDeoptTableSerializeEntryCount - 1); |
2430 } | 2434 } |
2431 | 2435 |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3157 // Then check whether this scope intercepts. | 3161 // Then check whether this scope intercepts. |
3158 if ((flag & intercept_mask_)) { | 3162 if ((flag & intercept_mask_)) { |
3159 intercepted_flags_ |= flag; | 3163 intercepted_flags_ |= flag; |
3160 return true; | 3164 return true; |
3161 } | 3165 } |
3162 return false; | 3166 return false; |
3163 } | 3167 } |
3164 | 3168 |
3165 } // namespace internal | 3169 } // namespace internal |
3166 } // namespace v8 | 3170 } // namespace v8 |
OLD | NEW |