Changeset 269832 in webkit
- Timestamp:
- Nov 15, 2020, 11:58:07 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any.worker-expected.txt (modified) (2 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSArrayBufferView.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/runtime/JSArrayBufferView.h (modified) (1 diff)
-
Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r269820 r269832 1 2020-11-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Wasm should get byte length from source typed array 4 https://bugs.webkit.org/show_bug.cgi?id=218955 5 6 Reviewed by Sam Weinig. 7 8 * web-platform-tests/wasm/jsapi/constructor/validate.any-expected.txt: 9 * web-platform-tests/wasm/jsapi/constructor/validate.any.worker-expected.txt: 10 1 11 2020-11-14 Rob Buis <rbuis@igalia.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any-expected.txt
r267649 r269832 33 33 PASS Validating module [0 61 73 6d 1 0 0 0] in Uint8Array 34 34 PASS Validating module [0 61 73 6d 1 0 0 0] in Int8Array 35 FAIL Validating module [0 61 73 6d 1 0 0 0] in Uint16Array assert_equals: expected true but got false 36 FAIL Validating module [0 61 73 6d 1 0 0 0] in Int16Array assert_equals: expected true but got false 37 FAIL Validating module [0 61 73 6d 1 0 0 0] in Uint32Array assert_equals: expected true but got false 38 FAIL Validating module [0 61 73 6d 1 0 0 0] in Int32Array assert_equals: expected true but got false 35 PASS Validating module [0 61 73 6d 1 0 0 0] in Uint16Array 36 PASS Validating module [0 61 73 6d 1 0 0 0] in Int16Array 37 PASS Validating module [0 61 73 6d 1 0 0 0] in Uint32Array 38 PASS Validating module [0 61 73 6d 1 0 0 0] in Int32Array 39 39 PASS Validating module [0 61 73 6d 0 0 0 0] in Uint8Array 40 40 PASS Validating module [0 61 73 6d 0 0 0 0] in Int8Array … … 57 57 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint8Array 58 58 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int8Array 59 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint16Array assert_equals: expected true but got false 60 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int16Array assert_equals: expected true but got false 61 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint32Array assert_equals: expected true but got false 62 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int32Array assert_equals: expected true but got false 59 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint16Array 60 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int16Array 61 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint32Array 62 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int32Array 63 63 PASS Stray argument 64 64 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any.worker-expected.txt
r267649 r269832 33 33 PASS Validating module [0 61 73 6d 1 0 0 0] in Uint8Array 34 34 PASS Validating module [0 61 73 6d 1 0 0 0] in Int8Array 35 FAIL Validating module [0 61 73 6d 1 0 0 0] in Uint16Array assert_equals: expected true but got false 36 FAIL Validating module [0 61 73 6d 1 0 0 0] in Int16Array assert_equals: expected true but got false 37 FAIL Validating module [0 61 73 6d 1 0 0 0] in Uint32Array assert_equals: expected true but got false 38 FAIL Validating module [0 61 73 6d 1 0 0 0] in Int32Array assert_equals: expected true but got false 35 PASS Validating module [0 61 73 6d 1 0 0 0] in Uint16Array 36 PASS Validating module [0 61 73 6d 1 0 0 0] in Int16Array 37 PASS Validating module [0 61 73 6d 1 0 0 0] in Uint32Array 38 PASS Validating module [0 61 73 6d 1 0 0 0] in Int32Array 39 39 PASS Validating module [0 61 73 6d 0 0 0 0] in Uint8Array 40 40 PASS Validating module [0 61 73 6d 0 0 0 0] in Int8Array … … 57 57 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint8Array 58 58 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int8Array 59 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint16Array assert_equals: expected true but got false 60 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int16Array assert_equals: expected true but got false 61 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint32Array assert_equals: expected true but got false 62 FAIL Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int32Array assert_equals: expected true but got false 59 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint16Array 60 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int16Array 61 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Uint32Array 62 PASS Validating module [0 61 73 6d 1 0 0 0 0 2 1 61] in Int32Array 63 63 PASS Stray argument 64 64 -
trunk/Source/JavaScriptCore/ChangeLog
r269814 r269832 1 2020-11-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Wasm should get byte length from source typed array 4 https://bugs.webkit.org/show_bug.cgi?id=218955 5 6 Reviewed by Sam Weinig. 7 8 WebAssembly's module source should be read with byteLength instead of length of typed-array. 9 10 * runtime/JSArrayBufferView.cpp: 11 (JSC::JSArrayBufferView::byteLength const): 12 (JSC::JSArrayBufferView::slowDownAndWasteMemory): 13 * runtime/JSArrayBufferView.h: 14 * wasm/js/JSWebAssemblyHelpers.h: 15 (JSC::getWasmBufferFromValue): 16 1 17 2020-11-14 Don Olmstead <don.olmstead@sony.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp
r269343 r269832 234 234 FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(FACTORY) 235 235 #undef FACTORY 236 1, // DataViewType 236 237 }; 237 238 … … 242 243 static inline size_t elementSize(JSType type) 243 244 { 244 ASSERT(type >= Int8ArrayType && type <= Float64ArrayType); 245 ASSERT(type >= Int8ArrayType && type <= DataViewType); 246 static_assert(Float64ArrayType + 1 == DataViewType); 245 247 return ElementSizeData[type - Int8ArrayType]; 248 } 249 250 unsigned JSArrayBufferView::byteLength() const 251 { 252 return length() * elementSize(type()); 246 253 } 247 254 … … 270 277 271 278 RefPtr<ArrayBuffer> buffer; 272 unsigned byteLength = m_length * elementSize(type());279 unsigned byteLength = this->byteLength(); 273 280 274 281 switch (m_mode) { -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h
r269343 r269832 196 196 197 197 unsigned length() const { return m_length; } 198 unsigned byteLength() const; 198 199 199 200 DECLARE_EXPORT_INFO; -
trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h
r269343 r269832 85 85 86 86 uint8_t* base = arrayBufferView ? static_cast<uint8_t*>(arrayBufferView->vector()) : static_cast<uint8_t*>(arrayBuffer->impl()->data()); 87 size_t byteSize = arrayBufferView ? arrayBufferView-> length() : arrayBuffer->impl()->byteLength();87 size_t byteSize = arrayBufferView ? arrayBufferView->byteLength() : arrayBuffer->impl()->byteLength(); 88 88 return { base, byteSize }; 89 89 }
Note:
See TracChangeset
for help on using the changeset viewer.