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

Unified Diff: src/snapshot/partial-serializer.cc

Issue 2628093003: [serializer] change internal field callbacks to take data pointer. (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.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/partial-serializer.cc
diff --git a/src/snapshot/partial-serializer.cc b/src/snapshot/partial-serializer.cc
index a141aac19339b9fa32da323ca755122b5ed7e7e9..b78a1edbd0647f52079a4a3ee1c4b922ad334c5f 100644
--- a/src/snapshot/partial-serializer.cc
+++ b/src/snapshot/partial-serializer.cc
@@ -103,7 +103,7 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
if (obj->IsJSObject()) {
JSObject* jsobj = JSObject::cast(obj);
if (jsobj->GetInternalFieldCount() > 0) {
- DCHECK_NOT_NULL(serialize_internal_fields_);
+ DCHECK_NOT_NULL(serialize_internal_fields_.callback);
internal_field_holders_.Add(jsobj);
}
}
@@ -132,7 +132,7 @@ void PartialSerializer::SerializeInternalFields() {
DisallowHeapAllocation no_gc;
DisallowJavascriptExecution no_js(isolate());
DisallowCompilation no_compile(isolate());
- DCHECK_NOT_NULL(serialize_internal_fields_);
+ DCHECK_NOT_NULL(serialize_internal_fields_.callback);
sink_.Put(kInternalFieldsData, "internal fields data");
while (internal_field_holders_.length() > 0) {
HandleScope scope(isolate());
@@ -142,7 +142,8 @@ void PartialSerializer::SerializeInternalFields() {
int internal_fields_count = obj->GetInternalFieldCount();
for (int i = 0; i < internal_fields_count; i++) {
if (obj->GetInternalField(i)->IsHeapObject()) continue;
- StartupData data = serialize_internal_fields_(v8::Utils::ToLocal(obj), i);
+ StartupData data = serialize_internal_fields_.callback(
+ v8::Utils::ToLocal(obj), i, serialize_internal_fields_.data);
sink_.Put(kNewObject + reference.space(), "internal field holder");
PutBackReference(*obj, reference);
sink_.PutInt(i, "internal field index");
« no previous file with comments | « src/snapshot/deserializer.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698