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 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2431 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
2432 } else if (OptimizingCompileDispatcher::Enabled()) { | 2432 } else if (OptimizingCompileDispatcher::Enabled()) { |
2433 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); | 2433 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); |
2434 } | 2434 } |
2435 | 2435 |
2436 // Initialize runtime profiler before deserialization, because collections may | 2436 // Initialize runtime profiler before deserialization, because collections may |
2437 // occur, clearing/updating ICs. | 2437 // occur, clearing/updating ICs. |
2438 runtime_profiler_ = new RuntimeProfiler(this); | 2438 runtime_profiler_ = new RuntimeProfiler(this); |
2439 | 2439 |
2440 // If we are deserializing, read the state into the now-empty heap. | 2440 // If we are deserializing, read the state into the now-empty heap. |
2441 if (!create_heap_objects) { | 2441 { |
2442 des->Deserialize(this); | 2442 AlwaysAllocateScope always_allocate(this); |
2443 } | 2443 |
2444 load_stub_cache_->Initialize(); | 2444 if (!create_heap_objects) { |
2445 store_stub_cache_->Initialize(); | 2445 des->Deserialize(this); |
2446 if (FLAG_ignition || serializer_enabled()) { | 2446 } |
2447 interpreter_->Initialize(); | 2447 load_stub_cache_->Initialize(); |
| 2448 store_stub_cache_->Initialize(); |
| 2449 if (FLAG_ignition || serializer_enabled()) { |
| 2450 interpreter_->Initialize(); |
| 2451 } |
| 2452 |
| 2453 heap_.NotifyDeserializationComplete(); |
2448 } | 2454 } |
2449 | 2455 |
2450 // Finish initialization of ThreadLocal after deserialization is done. | 2456 // Finish initialization of ThreadLocal after deserialization is done. |
2451 clear_pending_exception(); | 2457 clear_pending_exception(); |
2452 clear_pending_message(); | 2458 clear_pending_message(); |
2453 clear_scheduled_exception(); | 2459 clear_scheduled_exception(); |
2454 | 2460 |
2455 // Deserializing may put strange things in the root array's copy of the | 2461 // Deserializing may put strange things in the root array's copy of the |
2456 // stack guard. | 2462 // stack guard. |
2457 heap_.SetStackLimits(); | 2463 heap_.SetStackLimits(); |
(...skipping 10 matching lines...) Expand all Loading... |
2468 Internals::kIsolateEmbedderDataOffset); | 2474 Internals::kIsolateEmbedderDataOffset); |
2469 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), | 2475 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), |
2470 Internals::kIsolateRootsOffset); | 2476 Internals::kIsolateRootsOffset); |
2471 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_)), | 2477 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_)), |
2472 Internals::kExternalMemoryOffset); | 2478 Internals::kExternalMemoryOffset); |
2473 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_limit_)), | 2479 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.external_memory_limit_)), |
2474 Internals::kExternalMemoryLimitOffset); | 2480 Internals::kExternalMemoryLimitOffset); |
2475 | 2481 |
2476 time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs(); | 2482 time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs(); |
2477 | 2483 |
2478 heap_.NotifyDeserializationComplete(); | |
2479 | |
2480 if (!create_heap_objects) { | 2484 if (!create_heap_objects) { |
2481 // Now that the heap is consistent, it's OK to generate the code for the | 2485 // Now that the heap is consistent, it's OK to generate the code for the |
2482 // deopt entry table that might have been referred to by optimized code in | 2486 // deopt entry table that might have been referred to by optimized code in |
2483 // the snapshot. | 2487 // the snapshot. |
2484 HandleScope scope(this); | 2488 HandleScope scope(this); |
2485 Deoptimizer::EnsureCodeForDeoptimizationEntry( | 2489 Deoptimizer::EnsureCodeForDeoptimizationEntry( |
2486 this, Deoptimizer::LAZY, | 2490 this, Deoptimizer::LAZY, |
2487 ExternalReferenceTable::kDeoptTableSerializeEntryCount - 1); | 2491 ExternalReferenceTable::kDeoptTableSerializeEntryCount - 1); |
2488 } | 2492 } |
2489 | 2493 |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3205 // Then check whether this scope intercepts. | 3209 // Then check whether this scope intercepts. |
3206 if ((flag & intercept_mask_)) { | 3210 if ((flag & intercept_mask_)) { |
3207 intercepted_flags_ |= flag; | 3211 intercepted_flags_ |= flag; |
3208 return true; | 3212 return true; |
3209 } | 3213 } |
3210 return false; | 3214 return false; |
3211 } | 3215 } |
3212 | 3216 |
3213 } // namespace internal | 3217 } // namespace internal |
3214 } // namespace v8 | 3218 } // namespace v8 |
OLD | NEW |