Bug 1318252 - Baldr: Serialize Import's DefinitionKind. r=bbouvier, a=jcristau
authorLuke Wagner <luke@mozilla.com>
Wed, 16 Nov 2016 22:51:00 -0500
changeset 367585 f6527a5a10d09c0e068253fcefe0e429f7c81f53
parent 367584 e852f73b1eff96339ecee9e62bd6aefcffcaa67b
child 367586 063eae32d7016f0513bbe6de5c77e956dc712949
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier, jcristau
bugs1318252
milestone52.0a2
Bug 1318252 - Baldr: Serialize Import's DefinitionKind. r=bbouvier, a=jcristau MozReview-Commit-ID: J270dKp6KvZ
js/src/wasm/WasmModule.cpp
--- a/js/src/wasm/WasmModule.cpp
+++ b/js/src/wasm/WasmModule.cpp
@@ -136,32 +136,35 @@ LinkData::sizeOfExcludingThis(MallocSize
     return internalLinks.sizeOfExcludingThis(mallocSizeOf) +
            symbolicLinks.sizeOfExcludingThis(mallocSizeOf);
 }
 
 size_t
 Import::serializedSize() const
 {
     return module.serializedSize() +
-           field.serializedSize();
+           field.serializedSize() +
+           sizeof(kind);
 }
 
 uint8_t*
 Import::serialize(uint8_t* cursor) const
 {
     cursor = module.serialize(cursor);
     cursor = field.serialize(cursor);
+    cursor = WriteScalar<DefinitionKind>(cursor, kind);
     return cursor;
 }
 
 const uint8_t*
 Import::deserialize(const uint8_t* cursor)
 {
     (cursor = module.deserialize(cursor)) &&
-    (cursor = field.deserialize(cursor));
+    (cursor = field.deserialize(cursor)) &&
+    (cursor = ReadScalar<DefinitionKind>(cursor, &kind));
     return cursor;
 }
 
 size_t
 Import::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const
 {
     return module.sizeOfExcludingThis(mallocSizeOf) +
            field.sizeOfExcludingThis(mallocSizeOf);