| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 DCHECK_NULL(isolate_); | 650 DCHECK_NULL(isolate_); |
| 651 DCHECK_NOT_NULL(isolate); | 651 DCHECK_NOT_NULL(isolate); |
| 652 isolate_ = isolate; | 652 isolate_ = isolate; |
| 653 DCHECK_NULL(external_reference_decoder_); | 653 DCHECK_NULL(external_reference_decoder_); |
| 654 external_reference_decoder_ = new ExternalReferenceDecoder(isolate); | 654 external_reference_decoder_ = new ExternalReferenceDecoder(isolate); |
| 655 } | 655 } |
| 656 | 656 |
| 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()) V8::FatalProcessOutOfMemory("deserializing context"); |
| 661 // No active threads. | 661 // No active threads. |
| 662 DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse()); | 662 DCHECK_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()->RepairFreeListsAfterDeserialization(); | 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( |
| (...skipping 24 matching lines...) Expand all Loading... |
| 695 LOG_CODE_EVENT(isolate_, LogCodeObjects()); | 695 LOG_CODE_EVENT(isolate_, LogCodeObjects()); |
| 696 LOG_CODE_EVENT(isolate_, LogCompiledFunctions()); | 696 LOG_CODE_EVENT(isolate_, LogCompiledFunctions()); |
| 697 } | 697 } |
| 698 | 698 |
| 699 | 699 |
| 700 MaybeHandle<Object> Deserializer::DeserializePartial( | 700 MaybeHandle<Object> Deserializer::DeserializePartial( |
| 701 Isolate* isolate, Handle<JSGlobalProxy> global_proxy, | 701 Isolate* isolate, Handle<JSGlobalProxy> global_proxy, |
| 702 Handle<FixedArray>* outdated_contexts_out) { | 702 Handle<FixedArray>* outdated_contexts_out) { |
| 703 Initialize(isolate); | 703 Initialize(isolate); |
| 704 if (!ReserveSpace()) { | 704 if (!ReserveSpace()) { |
| 705 FatalProcessOutOfMemory("deserialize context"); | 705 V8::FatalProcessOutOfMemory("deserialize context"); |
| 706 return MaybeHandle<Object>(); | 706 return MaybeHandle<Object>(); |
| 707 } | 707 } |
| 708 | 708 |
| 709 Vector<Handle<Object> > attached_objects = Vector<Handle<Object> >::New(1); | 709 Vector<Handle<Object> > attached_objects = Vector<Handle<Object> >::New(1); |
| 710 attached_objects[kGlobalProxyReference] = global_proxy; | 710 attached_objects[kGlobalProxyReference] = global_proxy; |
| 711 SetAttachedObjects(attached_objects); | 711 SetAttachedObjects(attached_objects); |
| 712 | 712 |
| 713 DisallowHeapAllocation no_gc; | 713 DisallowHeapAllocation no_gc; |
| 714 // Keep track of the code space start and end pointers in case new | 714 // Keep track of the code space start and end pointers in case new |
| 715 // code objects were unserialized | 715 // code objects were unserialized |
| (...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2641 return GetHeaderValue(kNumInternalizedStringsOffset); | 2641 return GetHeaderValue(kNumInternalizedStringsOffset); |
| 2642 } | 2642 } |
| 2643 | 2643 |
| 2644 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { | 2644 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { |
| 2645 int reservations_size = GetHeaderValue(kNumReservationsOffset) * kInt32Size; | 2645 int reservations_size = GetHeaderValue(kNumReservationsOffset) * kInt32Size; |
| 2646 const byte* start = data_ + kHeaderSize + reservations_size; | 2646 const byte* start = data_ + kHeaderSize + reservations_size; |
| 2647 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), | 2647 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), |
| 2648 GetHeaderValue(kNumCodeStubKeysOffset)); | 2648 GetHeaderValue(kNumCodeStubKeysOffset)); |
| 2649 } | 2649 } |
| 2650 } } // namespace v8::internal | 2650 } } // namespace v8::internal |
| OLD | NEW |