Changeset 221126 in webkit
- Timestamp:
- Aug 23, 2017 7:11:02 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r221125 r221126 1 2017-08-23 Keith Miller <keith_miller@apple.com> 2 3 Fix Titzer bench on iOS. 4 https://bugs.webkit.org/show_bug.cgi?id=175917 5 6 Reviewed by Ryosuke Niwa. 7 8 Currently, Titzer bench doesn't run on iOS since the benchmark 9 allocates lots of physical pages that it never actually writes 10 to. We limited the total number wasm physical pages to the ram 11 size of the phone, which caused us to fail a memory 12 allocation. This patch changes it so we will allocate up to 3x ram 13 size, which seems to fix the problem. 14 15 * wasm/WasmMemory.cpp: 16 1 17 2017-08-23 Yusuke Suzuki <utatane.tea@gmail.com> 2 18 -
trunk/Source/JavaScriptCore/wasm/WasmMemory.cpp
r220401 r221126 141 141 return false; 142 142 } 143 143 144 // We allow people to "commit" more wasm memory than there is on the system since most of the time 145 // people don't actually write to most of that memory. There is some chance that this gets us 146 // JetSammed but that's possible anyway. 147 inline size_t memoryLimit() const { return ramSize() * 3; } 148 144 149 // FIXME: Ideally, bmalloc would have this kind of mechanism. Then, we would just forward to that 145 150 // mechanism here. … … 148 153 MemoryResult::Kind result = [&] { 149 154 auto holder = holdLock(m_lock); 150 if (m_physicalBytes + bytes > ramSize())155 if (m_physicalBytes + bytes > memoryLimit()) 151 156 return MemoryResult::SyncGCAndRetry; 152 157 153 158 m_physicalBytes += bytes; 154 159 155 if (m_physicalBytes >= ramSize() / 2)160 if (m_physicalBytes >= memoryLimit() / 2) 156 161 return MemoryResult::SuccessAndAsyncGC; 157 162 … … 178 183 void dump(PrintStream& out) const 179 184 { 180 out.print(" memories = ", m_memories.size(), "/", m_maxCount, ", bytes = ", m_physicalBytes, "/", ramSize());185 out.print("virtual memories = ", m_memories.size(), "/", m_maxCount, ", bytes = ", m_physicalBytes, "/", memoryLimit()); 181 186 } 182 187
Note: See TracChangeset
for help on using the changeset viewer.