Bug 1518210 - Wasm: Make wasm::IsHugeMemoryEnabled() a component of the BuildID for correct invalidation of cached code. r=lth
☠☠ backed out by ea9924171afd ☠ ☠
authorRyan Hunt <rhunt@eqrion.net>
Fri, 30 Aug 2019 02:33:56 +0000
changeset 554553 39fc18ada840d9de69c45ca8484361a58ce0449b
parent 554552 b88d66dddefff7b557143585fb73f2cf9d3c6648
child 554554 6e2e9274465d755271a5c1ffc32e1a42a608d879
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1518210
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518210 - Wasm: Make wasm::IsHugeMemoryEnabled() a component of the BuildID for correct invalidation of cached code. r=lth We can't deserialize code that doesn't contain bounds checks if we have dynamically switched to not using huge memory. This commit uses BuildID to invalidate cached code correctly. Differential Revision: https://phabricator.services.mozilla.com/D41870
js/src/wasm/WasmModule.cpp
--- a/js/src/wasm/WasmModule.cpp
+++ b/js/src/wasm/WasmModule.cpp
@@ -340,27 +340,31 @@ bool wasm::GetOptimizedEncodingBuildId(J
   // and cpu-id.
 
   if (!GetBuildId || !GetBuildId(buildId)) {
     return false;
   }
 
   uint32_t cpu = ObservedCPUFeatures();
 
-  if (!buildId->reserve(buildId->length() + 10 /* "()" + 8 nibbles */)) {
+  if (!buildId->reserve(buildId->length() +
+                        12 /* "()" + 8 nibbles + "m[+-]" */)) {
     return false;
   }
 
   buildId->infallibleAppend('(');
   while (cpu) {
     buildId->infallibleAppend('0' + (cpu & 0xf));
     cpu >>= 4;
   }
   buildId->infallibleAppend(')');
 
+  buildId->infallibleAppend('m');
+  buildId->infallibleAppend(wasm::IsHugeMemoryEnabled() ? '+' : '-');
+
   return true;
 }
 
 /* virtual */
 void Module::addSizeOfMisc(MallocSizeOf mallocSizeOf,
                            Metadata::SeenSet* seenMetadata,
                            Code::SeenSet* seenCode, size_t* code,
                            size_t* data) const {