Source/JavaScriptCore/ChangeLog

 12017-03-15 Saam Barati <sbarati@apple.com>
 2
 3 WebAssembly: When we GC to try to get a fast memory, we should call collectAllGarbage(), not collectSync()
 4 https://bugs.webkit.org/show_bug.cgi?id=169704
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 We weren't always sweeping the memory needed to free
 9 the WasmMemory we wanted to use. collectAllGarbage()
 10 will do this if the JS objects wrapping WasmMemory
 11 are dead.
 12
 13 * wasm/WasmMemory.cpp:
 14 (JSC::Wasm::tryGetFastMemory):
 15
1162017-03-15 Mark Lam <mark.lam@apple.com>
217
318 Fix missing exception checks in Interpreter.cpp.
214011

Source/JavaScriptCore/wasm/WasmMemory.cpp

@@inline bool tryGetFastMemory(VM& vm, voi
119119 // If we have allocated all the fast memories... too bad.
120120 if (allocatedFastMemories == maxFastMemories) {
121121 // There is a reasonable chance that another module has died but has not been collected yet. Don't lose hope yet!
122  vm.heap.collectSync();
 122 vm.heap.collectAllGarbage();
123123 return dequeFastMemory();
124124 }
125125
126126 if (mmapBytes(fastMemoryMappedBytes, memory)) {
127127 mappedCapacity = fastMemoryMappedBytes;
128128 mode = Memory::Signaling;
129  allocatedFastMemories++;
130129 LockHolder locker(memoryLock);
 130 allocatedFastMemories++;
131131 auto result = activeFastMemories(locker).add(memory);
132132 ASSERT_UNUSED(result, result.isNewEntry);
133133 }
213983