[webkit-changes] [WebKit/WebKit] de71f3: Implement saturating truncation, remaining memory ...
Daniel Liu
noreply at github.com
Thu Aug 3 11:37:33 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: de71f3ac024b267bee64cf3a0e405171c5a4519d
https://github.com/WebKit/WebKit/commit/de71f3ac024b267bee64cf3a0e405171c5a4519d
Author: Daniel Liu <danlliu at umich.edu>
Date: 2023-08-03 (Thu, 03 Aug 2023)
Changed paths:
M JSTests/wasm/ipint-tests/ipint-error-check-call-null.js
M JSTests/wasm/ipint-tests/ipint-error-check-call-sig.js
A JSTests/wasm/ipint-tests/ipint-error-check-div-0.js
M JSTests/wasm/ipint-tests/ipint-error-check-mem-outofbounds.js
M JSTests/wasm/ipint-tests/ipint-error-check-trunc-outofbounds.js
A JSTests/wasm/ipint-tests/ipint-error-check-unreachable.js
A JSTests/wasm/ipint-tests/ipint-test-block-nobr.js
A JSTests/wasm/ipint-tests/ipint-test-branch-table.js
A JSTests/wasm/ipint-tests/ipint-test-call-add12.js
A JSTests/wasm/ipint-tests/ipint-test-call-arg-order.js
A JSTests/wasm/ipint-tests/ipint-test-call-empty.js
A JSTests/wasm/ipint-tests/ipint-test-call-stack-arg.js
A JSTests/wasm/ipint-tests/ipint-test-data-drop.js
A JSTests/wasm/ipint-tests/ipint-test-elem-drop.js
M JSTests/wasm/ipint-tests/ipint-test-i32-ops.js
M JSTests/wasm/ipint-tests/ipint-test-i64-ops.js
A JSTests/wasm/ipint-tests/ipint-test-if-emptyelse.js
A JSTests/wasm/ipint-tests/ipint-test-if.js
M JSTests/wasm/ipint-tests/ipint-test-loop.js
A JSTests/wasm/ipint-tests/ipint-test-memory-copy.js
A JSTests/wasm/ipint-tests/ipint-test-memory-fill.js
A JSTests/wasm/ipint-tests/ipint-test-memory-init.js
A JSTests/wasm/ipint-tests/ipint-test-memory-size.js
A JSTests/wasm/ipint-tests/ipint-test-select.js
A JSTests/wasm/ipint-tests/ipint-test-table-copy.js
A JSTests/wasm/ipint-tests/ipint-test-table-fill.js
A JSTests/wasm/ipint-tests/ipint-test-table-grow.js
A JSTests/wasm/ipint-tests/ipint-test-table-init.js
A JSTests/wasm/ipint-tests/ipint-test-trunc-sat.js
A JSTests/wasm/ipint-tests/ipint-test-typed-select.js
M Source/JavaScriptCore/llint/InPlaceInterpreter.asm
M Source/JavaScriptCore/llint/InPlaceInterpreter.cpp
M Source/JavaScriptCore/llint/InPlaceInterpreter.h
M Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
M Source/JavaScriptCore/runtime/InitializeThreading.cpp
M Source/JavaScriptCore/wasm/WasmCallee.cpp
M Source/JavaScriptCore/wasm/WasmCallee.h
M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp
M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h
M Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp
M Source/JavaScriptCore/wasm/WasmModule.cpp
M Source/JavaScriptCore/wasm/WasmSlowPaths.cpp
M Source/JavaScriptCore/wasm/WasmSlowPaths.h
Log Message:
-----------
Implement saturating truncation, remaining memory and table operations, and update call to pass stack parameters
https://bugs.webkit.org/show_bug.cgi?id=259665
rdar://113166666
Reviewed by Yusuke Suzuki.
Added implementations for all saturating truncation instructions, as well as the remaining memory and table operations. Fixed bugs with regards to handling call parameter ordering, and allowed calls to pass arguments on stack.
* JSTests/wasm/ipint-tests/ipint-test-branch-table.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i32.result.i32.block.block.block.block.local.0.br_table.0.1.2.3.i32.const.2.return.i32.const.3.return.i32.const.5.return.i32.const.7.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-call-add12.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.add.export.string_appeared_here.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.i32.add.local.2.i32.add.local.3.i32.add.local.4.i32.add.local.5.i32.add.local.6.i32.add.local.7.i32.add.local.8.i32.add.local.9.i32.add.local.10.i32.add.local.11.i32.add.return.func.export.string_appeared_here.param.i32.result.i32.local.0.local.0.local.0.local.0.local.0.local.0.local.0.local.0.local.0.local.0.local.0.local.0.call.add.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-call-arg-order.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.r2.param.i32.i32.result.i32.local.0.return.func.export.string_appeared_here.result.i32.i32.const.1.i32.const.2.call.r2.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-call-stack-arg.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.r9.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.8.return.func.export.string_appeared_here.result.i32.i32.const.1.i32.const.2.i32.const.3.i32.const.4.i32.const.5.i32.const.6.i32.const.7.i32.const.8.i32.const.9.i32.const.10.call.r9.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-data-drop.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.memory.export.string_appeared_here.1.10.data.string_appeared_here.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.memory.init.0.func.export.string_appeared_here.data.drop.0.decodeString):
(async test):
* JSTests/wasm/ipint-tests/ipint-test-elem-drop.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.type.i2i.func.param.i32.result.i32.table.table.export.string_appeared_here.3.funcref.elem.3.3.3.elem.elems.4.4.4.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.table.init.0.elems.func.export.string_appeared_here.result.i32.i32.const.0.table.table.ref.is_null.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.0.call_indirect.table.type.i2i.func.null.param.i32.result.i32.local.0.func.inc.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.1.i32.add.func.drop.export.string_appeared_here.elem.drop.elems.async test):
* JSTests/wasm/ipint-tests/ipint-test-i32-ops.js:
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.clz.return.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.ctz.return.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.popcnt.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.add.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.sub.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.mul.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.div_s.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.div_u.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.rem_s.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.rem_u.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.and.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.or.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.xor.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.shl.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.shr_s.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.shr_u.return.async test):
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.clz.return.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.ctz.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.add.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.sub.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.mul.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.div_s.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.div_u.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.and.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.or.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.xor.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.shl.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.shr_s.return.func.export.string_appeared_here.param.i32.i32.result.i32.local.0.local.1.i32.shr_u.return.async test): Deleted.
* JSTests/wasm/ipint-tests/ipint-test-i64-ops.js:
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i64.result.i64.local.0.i64.clz.return.func.export.string_appeared_here.param.i64.result.i64.local.0.i64.ctz.return.func.export.string_appeared_here.param.i64.result.i64.local.0.i64.popcnt.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.add.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.sub.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.mul.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.div_s.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.div_u.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.rem_s.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.rem_u.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.and.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.or.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.xor.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.shl.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.shr_s.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.shr_u.return.async test):
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i64.result.i64.local.0.i64.clz.return.func.export.string_appeared_here.param.i64.result.i64.local.0.i64.ctz.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.add.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.sub.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.mul.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.div_s.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.div_u.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.and.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.or.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.xor.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.shl.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.shr_s.return.func.export.string_appeared_here.param.i64.i64.result.i64.local.0.local.1.i64.shr_u.return.async test): Deleted.
* JSTests/wasm/ipint-tests/ipint-test-if.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i32.i32.i32.result.i32.local.0.then.local.1.return.local.2.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-loop.js:
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i32.result.i32.local.0.loop.param.i32.result.i32.i32.const.1.i32.add.local.tee.0.local.0.i32.const.5.i32.sub.br_if.1.return.async test): Deleted.
* JSTests/wasm/ipint-tests/ipint-test-memory-copy.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.memory.export.string_appeared_here.1.10.data.i32.const.0x0.string_appeared_here.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.memory.copy.decodeString):
(async test):
* JSTests/wasm/ipint-tests/ipint-test-memory-fill.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.memory.export.string_appeared_here.1.10.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.memory.fill.decodeString):
(async test):
* JSTests/wasm/ipint-tests/ipint-test-memory-init.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.memory.export.string_appeared_here.1.10.data.string_appeared_here.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.memory.init.0.decodeString):
(async test):
* JSTests/wasm/ipint-tests/ipint-test-memory-size.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.memory.export.string_appeared_here.1.10.func.export.string_appeared_here.result.i32.memory.size.func.export.string_appeared_here.param.i32.result.i32.local.0.memory.grow.async test):
* JSTests/wasm/ipint-tests/ipint-test-select.js: Copied from JSTests/wasm/ipint-tests/ipint-test-loop.js.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i32.result.i32.i32.const.2.i32.const.1.local.0.select.async test):
* JSTests/wasm/ipint-tests/ipint-test-table-copy.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.type.i2i.func.param.i32.result.i32.table.table.3.funcref.table.table2.3.funcref.elem.3.3.3.elem.elems.4.4.4.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.table.init.table.elems.func.export.string_appeared_here.result.i32.i32.const.0.table.table.ref.is_null.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.0.call_indirect.table2.type.i2i.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.table.copy.table2.table.func.inc.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.1.i32.add.async test):
* JSTests/wasm/ipint-tests/ipint-test-table-fill.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.type.i2i.func.param.i32.result.i32.table.table.5.funcref.elem.i32.const.0.0.0.0.0.0.func.export.string_appeared_here.result.i32.table.size.table.func.export.string_appeared_here.param.i32.i32.local.0.ref.null.func.local.1.table.fill.table.func.export.string_appeared_here.param.i32.result.i32.local.0.table.table.ref.is_null.async test):
* JSTests/wasm/ipint-tests/ipint-test-table-grow.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.type.i2i.func.param.i32.result.i32.table.table.3.funcref.elem.i32.const.0.0.0.0.func.export.string_appeared_here.result.i32.table.size.table.func.export.string_appeared_here.param.i32.result.i32.ref.null.func.local.0.table.grow.table.async test):
* JSTests/wasm/ipint-tests/ipint-test-table-init.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.type.i2i.func.param.i32.result.i32.table.table.export.string_appeared_here.3.funcref.elem.3.3.3.elem.elems.4.4.4.func.export.string_appeared_here.param.i32.i32.i32.local.0.local.1.local.2.table.init.0.elems.func.export.string_appeared_here.result.i32.i32.const.0.table.table.ref.is_null.func.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.0.call_indirect.table.type.i2i.func.null.param.i32.result.i32.local.0.func.inc.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.1.i32.add.async test):
* JSTests/wasm/ipint-tests/ipint-test-trunc-sat.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.f32.result.i32.local.0.i32.trunc_sat_f32_s.func.export.string_appeared_here.param.f32.result.i32.local.0.i32.trunc_sat_f32_u.func.export.string_appeared_here.param.f64.result.i32.local.0.i32.trunc_sat_f64_s.func.export.string_appeared_here.param.f64.result.i32.local.0.i32.trunc_sat_f64_u.func.export.string_appeared_here.param.f32.result.i64.local.0.i64.trunc_sat_f32_s.func.export.string_appeared_here.param.f32.result.i64.local.0.i64.trunc_sat_f32_u.func.export.string_appeared_here.param.f64.result.i64.local.0.i64.trunc_sat_f64_s.func.export.string_appeared_here.param.f64.result.i64.local.0.i64.trunc_sat_f64_u.async test):
* JSTests/wasm/ipint-tests/ipint-test-typed-select.js: Copied from JSTests/wasm/ipint-tests/ipint-test-loop.js.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i32.result.i32.i32.const.2.i32.const.1.local.0.select.result.i32.async test):
* Source/JavaScriptCore/llint/InPlaceInterpreter.asm:
* Source/JavaScriptCore/llint/InPlaceInterpreter.cpp:
(JSC::IPInt::initialize):
* Source/JavaScriptCore/llint/InPlaceInterpreter.h:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::IPIntCallee::IPIntCallee):
* Source/JavaScriptCore/wasm/WasmCallee.h:
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp:
(JSC::Wasm::FunctionIPIntMetadataGenerator::addReturnData):
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h:
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp:
(JSC::Wasm::IPIntGenerator::addTableInit):
(JSC::Wasm::IPIntGenerator::addElemDrop):
(JSC::Wasm::IPIntGenerator::addTableSize):
(JSC::Wasm::IPIntGenerator::addTableGrow):
(JSC::Wasm::IPIntGenerator::addTableFill):
(JSC::Wasm::IPIntGenerator::addTableCopy):
(JSC::Wasm::IPIntGenerator::addMemoryInit):
(JSC::Wasm::IPIntGenerator::addDataDrop):
(JSC::Wasm::IPIntGenerator::addSelect):
(JSC::Wasm::IPIntGenerator::addElse):
(JSC::Wasm::IPIntGenerator::addElseToUnreachable):
(JSC::Wasm::IPIntGenerator::addSwitch):
(JSC::Wasm::IPIntGenerator::addEndToUnreachable):
(JSC::Wasm::IPIntGenerator::addCallCommonData):
* Source/JavaScriptCore/wasm/WasmModule.cpp:
(JSC::Wasm::makeValidationCallback):
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::WASM_IPINT_EXTERN_CPP_DECL):
(JSC::LLInt::WASM_IPINT_EXTERN_CPP_DECL_1P):
* Source/JavaScriptCore/wasm/WasmSlowPaths.h:
Canonical link: https://commits.webkit.org/266545@main
More information about the webkit-changes
mailing list