Title: [207476] trunk/Source/_javascript_Core
Revision
207476
Author
keith_mil...@apple.com
Date
2016-10-18 12:03:29 -0700 (Tue, 18 Oct 2016)

Log Message

Cleanup Wasm memory.
https://bugs.webkit.org/show_bug.cgi?id=163601

Reviewed by Saam Barati.

There were a couple of issues with the original Wasm memory patch.
This is a follow-up patch to fix those issues.

* wasm/WASMMemory.cpp:
(JSC::WASM::Memory::Memory):
* wasm/WASMMemory.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (207475 => 207476)


--- trunk/Source/_javascript_Core/ChangeLog	2016-10-18 18:30:05 UTC (rev 207475)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-10-18 19:03:29 UTC (rev 207476)
@@ -1,3 +1,17 @@
+2016-10-18  Keith Miller  <keith_mil...@apple.com>
+
+        Cleanup Wasm memory.
+        https://bugs.webkit.org/show_bug.cgi?id=163601
+
+        Reviewed by Saam Barati.
+
+        There were a couple of issues with the original Wasm memory patch.
+        This is a follow-up patch to fix those issues.
+
+        * wasm/WASMMemory.cpp:
+        (JSC::WASM::Memory::Memory):
+        * wasm/WASMMemory.h:
+
 2016-10-15  Filip Pizlo  <fpi...@apple.com>
 
         DFG and FTL should be able to use DirectCall ICs when they proved the callee or its executable

Modified: trunk/Source/_javascript_Core/wasm/WASMMemory.cpp (207475 => 207476)


--- trunk/Source/_javascript_Core/wasm/WASMMemory.cpp	2016-10-18 18:30:05 UTC (rev 207475)
+++ trunk/Source/_javascript_Core/wasm/WASMMemory.cpp	2016-10-18 19:03:29 UTC (rev 207476)
@@ -40,15 +40,17 @@
 {
     ASSERT(pinnedSizeRegisters.size() > 0);
 
-    void* result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, 0, 0);
+    // FIXME: It would be nice if we had a VM tag for wasm memory. https://bugs.webkit.org/show_bug.cgi?id=163600
+    void* result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
     if (result == MAP_FAILED) {
         // Try again with a different number.
         m_mappedCapacity = m_capacity;
-        result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, 0, 0);
+        result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
         if (result == MAP_FAILED)
             return;
     }
 
+    ASSERT(startingSize <= m_mappedCapacity);
     if (mprotect(result, startingSize, PROT_READ | PROT_WRITE)) {
         munmap(result, m_mappedCapacity);
         return;

Modified: trunk/Source/_javascript_Core/wasm/WASMMemory.h (207475 => 207476)


--- trunk/Source/_javascript_Core/wasm/WASMMemory.h	2016-10-18 18:30:05 UTC (rev 207475)
+++ trunk/Source/_javascript_Core/wasm/WASMMemory.h	2016-10-18 19:03:29 UTC (rev 207476)
@@ -39,7 +39,7 @@
 };
 
 // FIXME: We should support more than one memory size register. Right now we take a vector with only one
-// entry. Specifically an extry where the sizeOffset == 0. If we have more than one size register,
+// entry. Specifically an entry where the sizeOffset == 0. If we have more than one size register,
 // we can have one for each load size class. see: https://bugs.webkit.org/show_bug.cgi?id=162952
 struct PinnedRegisterInfo {
     Vector<PinnedSizeRegisterInfo> sizeRegisters;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to