summaryrefslogtreecommitdiff
path: root/chromium/v8/src/snapshot/deserializer.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/snapshot/deserializer.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/snapshot/deserializer.h')
-rw-r--r--chromium/v8/src/snapshot/deserializer.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/chromium/v8/src/snapshot/deserializer.h b/chromium/v8/src/snapshot/deserializer.h
index 3af3eca5910..344db431a18 100644
--- a/chromium/v8/src/snapshot/deserializer.h
+++ b/chromium/v8/src/snapshot/deserializer.h
@@ -8,6 +8,7 @@
#include <utility>
#include <vector>
+#include "src/execution/local-isolate-wrapper.h"
#include "src/objects/allocation-site.h"
#include "src/objects/api-callbacks.h"
#include "src/objects/backing-store.h"
@@ -47,7 +48,7 @@ class V8_EXPORT_PRIVATE Deserializer : public SerializerDeserializer {
// Create a deserializer from a snapshot byte source.
template <class Data>
Deserializer(Data* data, bool deserializing_user_code)
- : isolate_(nullptr),
+ : local_isolate_(nullptr),
source_(data->Payload()),
magic_number_(data->GetMagicNumber()),
deserializing_user_code_(deserializing_user_code),
@@ -58,7 +59,10 @@ class V8_EXPORT_PRIVATE Deserializer : public SerializerDeserializer {
backing_stores_.push_back({});
}
- void Initialize(Isolate* isolate);
+ void Initialize(Isolate* isolate) {
+ Initialize(LocalIsolateWrapper(isolate));
+ }
+ void Initialize(LocalIsolateWrapper isolate);
void DeserializeDeferredObjects();
// Create Log events for newly deserialized objects.
@@ -80,7 +84,11 @@ class V8_EXPORT_PRIVATE Deserializer : public SerializerDeserializer {
CHECK_EQ(new_off_heap_array_buffers().size(), 0);
}
- Isolate* isolate() const { return isolate_; }
+ LocalIsolateWrapper local_isolate() const { return local_isolate_; }
+ Isolate* isolate() const { return local_isolate().main_thread(); }
+ bool is_main_thread() const { return local_isolate().is_main_thread(); }
+ bool is_off_thread() const { return local_isolate().is_off_thread(); }
+
SnapshotByteSource* source() { return &source_; }
const std::vector<AllocationSite>& new_allocation_sites() const {
return new_allocation_sites_;
@@ -117,9 +125,6 @@ class V8_EXPORT_PRIVATE Deserializer : public SerializerDeserializer {
void Rehash();
- // Cached current isolate.
- Isolate* isolate_;
-
private:
void VisitRootPointers(Root root, const char* description,
FullObjectSlot start, FullObjectSlot end) override;
@@ -148,9 +153,8 @@ class V8_EXPORT_PRIVATE Deserializer : public SerializerDeserializer {
// Returns the new value of {current}.
template <typename TSlot, Bytecode bytecode,
SnapshotSpace space_number_if_any>
- inline TSlot ReadDataCase(Isolate* isolate, TSlot current,
- Address current_object_address, byte data,
- bool write_barrier_needed);
+ inline TSlot ReadDataCase(TSlot current, Address current_object_address,
+ byte data, bool write_barrier_needed);
// A helper function for ReadData for reading external references.
inline Address ReadExternalReferenceCase();
@@ -175,6 +179,9 @@ class V8_EXPORT_PRIVATE Deserializer : public SerializerDeserializer {
// Special handling for serialized code like hooking up internalized strings.
HeapObject PostProcessNewObject(HeapObject obj, SnapshotSpace space);
+ // Cached current isolate.
+ LocalIsolateWrapper local_isolate_;
+
// Objects from the attached object descriptions in the serialized user code.
std::vector<Handle<HeapObject>> attached_objects_;
@@ -197,6 +204,11 @@ class V8_EXPORT_PRIVATE Deserializer : public SerializerDeserializer {
// TODO(6593): generalize rehashing, and remove this flag.
bool can_rehash_;
std::vector<HeapObject> to_rehash_;
+ // Store the objects whose maps are deferred and thus initialized as filler
+ // maps during deserialization, so that they can be processed later when the
+ // maps become available.
+ std::unordered_map<HeapObject, SnapshotSpace, Object::Hasher>
+ fillers_to_post_process_;
#ifdef DEBUG
uint32_t num_api_references_;