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 2391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2402 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2402 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
2403 } else if (OptimizingCompileDispatcher::Enabled()) { | 2403 } else if (OptimizingCompileDispatcher::Enabled()) { |
2404 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); | 2404 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); |
2405 } | 2405 } |
2406 | 2406 |
2407 // Initialize runtime profiler before deserialization, because collections may | 2407 // Initialize runtime profiler before deserialization, because collections may |
2408 // occur, clearing/updating ICs. | 2408 // occur, clearing/updating ICs. |
2409 runtime_profiler_ = new RuntimeProfiler(this); | 2409 runtime_profiler_ = new RuntimeProfiler(this); |
2410 | 2410 |
2411 // If we are deserializing, read the state into the now-empty heap. | 2411 // If we are deserializing, read the state into the now-empty heap. |
2412 { | 2412 if (!create_heap_objects) { |
2413 AlwaysAllocateScope always_allocate(this); | 2413 des->Deserialize(this); |
2414 | 2414 } |
2415 if (!create_heap_objects) { | 2415 load_stub_cache_->Initialize(); |
2416 des->Deserialize(this); | 2416 store_stub_cache_->Initialize(); |
2417 } | 2417 if (FLAG_ignition || serializer_enabled()) { |
2418 load_stub_cache_->Initialize(); | 2418 interpreter_->Initialize(); |
2419 store_stub_cache_->Initialize(); | |
2420 if (FLAG_ignition || serializer_enabled()) { | |
2421 interpreter_->Initialize(); | |
2422 } | |
2423 | |
2424 heap_.NotifyDeserializationComplete(); | |
2425 } | 2419 } |
2426 | 2420 |
2427 // Finish initialization of ThreadLocal after deserialization is done. | 2421 // Finish initialization of ThreadLocal after deserialization is done. |
2428 clear_pending_exception(); | 2422 clear_pending_exception(); |
2429 clear_pending_message(); | 2423 clear_pending_message(); |
2430 clear_scheduled_exception(); | 2424 clear_scheduled_exception(); |
2431 | 2425 |
2432 // Deserializing may put strange things in the root array's copy of the | 2426 // Deserializing may put strange things in the root array's copy of the |
2433 // stack guard. | 2427 // stack guard. |
2434 heap_.SetStackLimits(); | 2428 heap_.SetStackLimits(); |
(...skipping 10 matching lines...) Expand all Loading... |
2445 Internals::kIsolateEmbedderDataOffset); | 2439 Internals::kIsolateEmbedderDataOffset); |
2446 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), | 2440 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), |
2447 Internals::kIsolateRootsOffset); | 2441 Internals::kIsolateRootsOffset); |
2448 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_)), | 2442 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_)), |
2449 Internals::kExternalMemoryOffset); | 2443 Internals::kExternalMemoryOffset); |
2450 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_limit_)), | 2444 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_limit_)), |
2451 Internals::kExternalMemoryLimitOffset); | 2445 Internals::kExternalMemoryLimitOffset); |
2452 | 2446 |
2453 time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs(); | 2447 time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs(); |
2454 | 2448 |
| 2449 heap_.NotifyDeserializationComplete(); |
| 2450 |
2455 if (!create_heap_objects) { | 2451 if (!create_heap_objects) { |
2456 // Now that the heap is consistent, it's OK to generate the code for the | 2452 // Now that the heap is consistent, it's OK to generate the code for the |
2457 // deopt entry table that might have been referred to by optimized code in | 2453 // deopt entry table that might have been referred to by optimized code in |
2458 // the snapshot. | 2454 // the snapshot. |
2459 HandleScope scope(this); | 2455 HandleScope scope(this); |
2460 Deoptimizer::EnsureCodeForDeoptimizationEntry( | 2456 Deoptimizer::EnsureCodeForDeoptimizationEntry( |
2461 this, Deoptimizer::LAZY, | 2457 this, Deoptimizer::LAZY, |
2462 ExternalReferenceTable::kDeoptTableSerializeEntryCount - 1); | 2458 ExternalReferenceTable::kDeoptTableSerializeEntryCount - 1); |
2463 } | 2459 } |
2464 | 2460 |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3179 // Then check whether this scope intercepts. | 3175 // Then check whether this scope intercepts. |
3180 if ((flag & intercept_mask_)) { | 3176 if ((flag & intercept_mask_)) { |
3181 intercepted_flags_ |= flag; | 3177 intercepted_flags_ |= flag; |
3182 return true; | 3178 return true; |
3183 } | 3179 } |
3184 return false; | 3180 return false; |
3185 } | 3181 } |
3186 | 3182 |
3187 } // namespace internal | 3183 } // namespace internal |
3188 } // namespace v8 | 3184 } // namespace v8 |
OLD | NEW |