Index: src/snapshot/deserializer.cc |
diff --git a/src/snapshot/deserializer.cc b/src/snapshot/deserializer.cc |
index 45909a0e5ae4b5aba799f38910e059fee287590f..adbeba06ad708400a3424445c6cd387ad7030032 100644 |
--- a/src/snapshot/deserializer.cc |
+++ b/src/snapshot/deserializer.cc |
@@ -112,7 +112,8 @@ void Deserializer::Deserialize(Isolate* isolate) { |
} |
MaybeHandle<Object> Deserializer::DeserializePartial( |
- Isolate* isolate, Handle<JSGlobalProxy> global_proxy) { |
+ Isolate* isolate, Handle<JSGlobalProxy> global_proxy, |
+ v8::DeserializeInternalFieldsCallback internal_fields_deserializer) { |
Initialize(isolate); |
if (!ReserveSpace()) { |
V8::FatalProcessOutOfMemory("deserialize context"); |
@@ -129,7 +130,7 @@ MaybeHandle<Object> Deserializer::DeserializePartial( |
Object* root; |
VisitPointer(&root); |
DeserializeDeferredObjects(); |
- DeserializeInternalFields(); |
+ DeserializeInternalFields(internal_fields_deserializer); |
isolate->heap()->RegisterReservationsForBlackAllocation(reservations_); |
@@ -214,14 +215,13 @@ void Deserializer::DeserializeDeferredObjects() { |
} |
} |
-void Deserializer::DeserializeInternalFields() { |
+void Deserializer::DeserializeInternalFields( |
+ v8::DeserializeInternalFieldsCallback internal_fields_deserializer) { |
if (!source_.HasMore() || source_.Get() != kInternalFieldsData) return; |
DisallowHeapAllocation no_gc; |
DisallowJavascriptExecution no_js(isolate_); |
DisallowCompilation no_compile(isolate_); |
- v8::DeserializeInternalFieldsCallback callback = |
- isolate_->deserialize_internal_fields_callback(); |
- DCHECK_NOT_NULL(callback); |
+ DCHECK_NOT_NULL(internal_fields_deserializer); |
for (int code = source_.Get(); code != kSynchronize; code = source_.Get()) { |
HandleScope scope(isolate_); |
int space = code & kSpaceMask; |
@@ -233,8 +233,8 @@ void Deserializer::DeserializeInternalFields() { |
int size = source_.GetInt(); |
byte* data = new byte[size]; |
source_.CopyRaw(data, size); |
- callback(v8::Utils::ToLocal(obj), index, |
- {reinterpret_cast<char*>(data), size}); |
+ internal_fields_deserializer(v8::Utils::ToLocal(obj), index, |
+ {reinterpret_cast<char*>(data), size}); |
delete[] data; |
} |
} |