26 SanitizeIsolateScope(Isolate* isolate,
bool allow_active_isolate_for_testing,
27 const DisallowGarbageCollection& no_gc)
30 isolate->
heap()->feedback_vectors_for_profiling_tools()),
33 if (!allow_active_isolate_for_testing) {
36 ReadOnlyRoots(isolate).undefined_value());
38 ReadOnlyRoots(isolate).empty_weak_array_list());
42 isolate->SetFeedbackVectorsForProfilingTools(
43 ReadOnlyRoots(isolate).undefined_value());
44 isolate->heap()->SetDetachedContexts(
45 ReadOnlyRoots(isolate).empty_weak_array_list());
48 ~SanitizeIsolateScope() {
50 isolate_->SetFeedbackVectorsForProfilingTools(
67 shared_heap_serializer_(shared_heap_serializer),
68 accessor_infos_(isolate->
heap()),
69 function_template_infos_(isolate->
heap()) {
81 if (encoded_reference.
index() !=
i) {
87 "end of deduplicated reference indices");
105 v8::base::OS::PrintError(
"Reference stack:\n");
106 PrintStack(std::cerr);
107 Print(*obj, std::cerr);
109 "JSFunction should be added through the context snapshot instead of "
110 "the isolate snapshot");
116 DCHECK(!IsInstructionStream(raw));
128 info->remove_getter_redirection(
isolate());
132 info->remove_callback_redirection(
isolate());
138 }
else if (IsSharedFunctionInfo(*obj,
cage_base)) {
141 if (!shared->IsSubjectToDebugging() && shared->HasUncompiledData()) {
142 shared->uncompiled_data(
isolate())->set_inferred_name(
175 SanitizeIsolateScope sanitize_isolate(
180 isolate->heap()->IterateSmiRoots(
this);
181 isolate->heap()->IterateRoots(
190 for (
auto const& context : *contexts) {
205 sink->
PutUint30(cache_index,
"startup_object_cache_index");
210 CHECK(IsUndefined(isolate->heap()->dirty_js_finalization_registries_list(),
213 isolate->heap()->dirty_js_finalization_registries_list_tail(), isolate));
217 int length = serialized->length();
222 const char* description,
227 PrintF(
"%s handle not serialized: ",
228 root == Root::kGlobalHandles ?
"global" :
"eternal");
void IterateAllRoots(RootVisitor *visitor)
static constexpr int kSizeIsolateIndependent
void IterateAllRoots(RootVisitor *v)
void IterateWeakRoots(RootVisitor *v, base::EnumSet< SkipRoot > options)
GlobalHandles * global_handles() const
EternalHandles * eternal_handles() const
TracedHandles * traced_handles()
ThreadManager * thread_manager() const
static V8_EXPORT_PRIVATE bool Contains(Address address)
virtual void VisitRootPointer(Root root, const char *description, FullObjectSlot p)
void CheckRehashability(Tagged< HeapObject > obj)
int SerializeInObjectCache(Handle< HeapObject > object)
bool IsRootAndHasBeenSerialized(Tagged< HeapObject > obj) const
std::unordered_set< Tagged< Object >, Object::Hasher > serialized_
SerializedHandleChecker(Isolate *isolate, std::vector< Tagged< Context > > *contexts)
void VisitRootPointers(Root root, const char *description, FullObjectSlot start, FullObjectSlot end) override
void AddToSet(Tagged< FixedArray > serialized)
bool CheckGlobalAndEternalHandles()
void RestoreExternalReferenceRedirector(Isolate *isolate, Tagged< AccessorInfo > accessor_info)
void Serialize(SlotType slot_type)
void InitializeCodeAddressMap()
PtrComprCageBase cage_base() const
ExternalReferenceEncoder::Value EncodeExternalReference(Address addr)
Isolate * isolate() const
void SerializeDeferredObjects()
bool SerializeRoot(Tagged< HeapObject > obj)
bool SerializeReadOnlyObjectReference(Tagged< HeapObject > obj, SnapshotByteSink *sink)
void OutputStatistics(const char *name)
void Pad(int padding_offset=0)
bool allow_active_isolate_for_testing() const
bool SerializeHotObject(Tagged< HeapObject > obj)
bool SerializeBackReference(Tagged< HeapObject > obj)
bool SerializeUsingSharedHeapObjectCache(SnapshotByteSink *sink, Handle< HeapObject > obj)
void PutUint30(uint32_t integer, const char *description)
void Put(uint8_t b, const char *description)
SharedHeapSerializer *const shared_heap_serializer_
GlobalHandleVector< FunctionTemplateInfo > function_template_infos_
~StartupSerializer() override
StartupSerializer(Isolate *isolate, Snapshot::SerializerFlags flags, SharedHeapSerializer *shared_heap_serializer)
void SerializeUsingStartupObjectCache(SnapshotByteSink *sink, Handle< HeapObject > obj)
void SerializeObjectImpl(Handle< HeapObject > o, SlotType slot_type) override
void SerializeWeakReferencesAndDeferred()
bool SerializeUsingSharedHeapObjectCache(SnapshotByteSink *sink, Handle< HeapObject > obj)
void SerializeStrongReferences(const DisallowGarbageCollection &no_gc)
void CheckNoDirtyFinalizationRegistries()
GlobalHandleVector< AccessorInfo > accessor_infos_
ThreadState * FirstThreadStateInUse()
void Iterate(RootVisitor *)
#define USE_SIMULATOR_BOOL
void PrintF(const char *format,...)
void Print(Tagged< Object > obj)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
const Tagged< Object > feedback_vectors_for_profiling_tools_
const Tagged< WeakArrayList > detached_contexts_