Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: src/snapshot/deserializer.cc

Issue 2619203002: [serializer] pass internal fields deserializer callback as argument. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/snapshot/deserializer.h ('k') | src/snapshot/partial-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « src/snapshot/deserializer.h ('k') | src/snapshot/partial-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698