Changeset 246487 in webkit
- Timestamp:
- Jun 16, 2019, 3:06:29 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/wasm/stress/wasm-table-grow-initialize.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/wasm/WasmTable.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/wasm/WasmTable.h (modified) (1 diff)
-
Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r246408 r246487 1 2019-06-16 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Grown region of WasmTable should be initialized with null 4 https://bugs.webkit.org/show_bug.cgi?id=198903 5 6 Reviewed by Saam Barati. 7 8 * wasm/stress/wasm-table-grow-initialize.js: Added. 9 (shouldBe): 10 1 11 2019-06-13 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r246451 r246487 1 2019-06-16 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Grown region of WasmTable should be initialized with null 4 https://bugs.webkit.org/show_bug.cgi?id=198903 5 6 Reviewed by Saam Barati. 7 8 Grown region of Wasmtable is now empty. We should initialize it with null. 9 We also rename Wasm::Table::visitChildren to Wasm::Table::visitAggregate to 10 align to the naming convention. 11 12 * wasm/WasmTable.cpp: 13 (JSC::Wasm::Table::grow): 14 (JSC::Wasm::Table::visitAggregate): 15 (JSC::Wasm::Table::visitChildren): Deleted. 16 * wasm/WasmTable.h: 17 * wasm/js/JSWebAssemblyTable.cpp: 18 (JSC::JSWebAssemblyTable::visitChildren): 19 1 20 2019-06-14 Keith Miller <keith_miller@apple.com> 2 21 -
trunk/Source/JavaScriptCore/wasm/WasmTable.cpp
r246328 r246487 101 101 return WTF::nullopt; 102 102 103 auto checkedGrow = [&] (auto& container ) {103 auto checkedGrow = [&] (auto& container, auto initializer) { 104 104 if (newLengthChecked.unsafeGet() > allocatedLength(m_length)) { 105 105 Checked reallocSizeChecked = allocatedLength(newLengthChecked.unsafeGet()); … … 111 111 container.realloc(reallocSize); 112 112 } 113 for (uint32_t i = m_length; i < allocatedLength(newLength); ++i) 113 for (uint32_t i = m_length; i < allocatedLength(newLength); ++i) { 114 114 new (&container.get()[i]) std::remove_reference_t<decltype(*container.get())>(); 115 initializer(container.get()[i]); 116 } 115 117 return true; 116 118 }; 117 119 118 120 if (auto* funcRefTable = asFuncrefTable()) { 119 if (!checkedGrow(funcRefTable->m_importableFunctions ))121 if (!checkedGrow(funcRefTable->m_importableFunctions, [] (auto&) { })) 120 122 return WTF::nullopt; 121 if (!checkedGrow(funcRefTable->m_instances ))123 if (!checkedGrow(funcRefTable->m_instances, [] (auto&) { })) 122 124 return WTF::nullopt; 123 125 } 124 126 125 if (!checkedGrow(m_jsValues ))127 if (!checkedGrow(m_jsValues, [] (WriteBarrier<Unknown>& slot) { slot.setStartingValue(jsNull()); })) 126 128 return WTF::nullopt; 127 129 … … 158 160 } 159 161 160 void Table::visit Children(SlotVisitor& visitor)162 void Table::visitAggregate(SlotVisitor& visitor) 161 163 { 162 164 RELEASE_ASSERT(m_owner); -
trunk/Source/JavaScriptCore/wasm/WasmTable.h
r246139 r246487 77 77 Optional<uint32_t> grow(uint32_t delta); 78 78 79 void visit Children(SlotVisitor&);79 void visitAggregate(SlotVisitor&); 80 80 81 81 protected: -
trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp
r246139 r246487 81 81 82 82 Base::visitChildren(thisObject, visitor); 83 thisObject->table()->visit Children(visitor);83 thisObject->table()->visitAggregate(visitor); 84 84 } 85 85
Note:
See TracChangeset
for help on using the changeset viewer.