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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 | 657 |
658 void Deserializer::Deserialize(Isolate* isolate) { | 658 void Deserializer::Deserialize(Isolate* isolate) { |
659 Initialize(isolate); | 659 Initialize(isolate); |
660 if (!ReserveSpace()) FatalProcessOutOfMemory("deserializing context"); | 660 if (!ReserveSpace()) FatalProcessOutOfMemory("deserializing context"); |
661 // No active threads. | 661 // No active threads. |
662 DCHECK_EQ(NULL, isolate_->thread_manager()->FirstThreadStateInUse()); | 662 DCHECK_EQ(NULL, isolate_->thread_manager()->FirstThreadStateInUse()); |
663 // No active handles. | 663 // No active handles. |
664 DCHECK(isolate_->handle_scope_implementer()->blocks()->is_empty()); | 664 DCHECK(isolate_->handle_scope_implementer()->blocks()->is_empty()); |
665 isolate_->heap()->IterateSmiRoots(this); | 665 isolate_->heap()->IterateSmiRoots(this); |
666 isolate_->heap()->IterateStrongRoots(this, VISIT_ONLY_STRONG); | 666 isolate_->heap()->IterateStrongRoots(this, VISIT_ONLY_STRONG); |
667 isolate_->heap()->RepairFreeListsAfterBoot(); | 667 isolate_->heap()->RepairFreeListsAfterDeserialization(); |
668 isolate_->heap()->IterateWeakRoots(this, VISIT_ALL); | 668 isolate_->heap()->IterateWeakRoots(this, VISIT_ALL); |
669 | 669 |
670 isolate_->heap()->set_native_contexts_list( | 670 isolate_->heap()->set_native_contexts_list( |
671 isolate_->heap()->undefined_value()); | 671 isolate_->heap()->undefined_value()); |
672 isolate_->heap()->set_array_buffers_list( | 672 isolate_->heap()->set_array_buffers_list( |
673 isolate_->heap()->undefined_value()); | 673 isolate_->heap()->undefined_value()); |
674 | 674 |
675 // The allocation site list is build during root iteration, but if no sites | 675 // The allocation site list is build during root iteration, but if no sites |
676 // were encountered then it needs to be initialized to undefined. | 676 // were encountered then it needs to be initialized to undefined. |
677 if (isolate_->heap()->allocation_sites_list() == Smi::FromInt(0)) { | 677 if (isolate_->heap()->allocation_sites_list() == Smi::FromInt(0)) { |
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 return GetHeaderValue(kNumInternalizedStringsOffset); | 2548 return GetHeaderValue(kNumInternalizedStringsOffset); |
2549 } | 2549 } |
2550 | 2550 |
2551 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { | 2551 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { |
2552 int reservations_size = GetHeaderValue(kReservationsOffset) * kInt32Size; | 2552 int reservations_size = GetHeaderValue(kReservationsOffset) * kInt32Size; |
2553 const byte* start = data_ + kHeaderSize + reservations_size; | 2553 const byte* start = data_ + kHeaderSize + reservations_size; |
2554 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), | 2554 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), |
2555 GetHeaderValue(kNumCodeStubKeysOffset)); | 2555 GetHeaderValue(kNumCodeStubKeysOffset)); |
2556 } | 2556 } |
2557 } } // namespace v8::internal | 2557 } } // namespace v8::internal |
OLD | NEW |