[webkit-changes] [WebKit/WebKit] 602c7b: Fix edge cases in IPInt tail calls

Commit Queue noreply at github.com
Wed Dec 18 17:11:36 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 602c7b2295a8dd9f3bedfa9f23d09579f682c11d
      https://github.com/WebKit/WebKit/commit/602c7b2295a8dd9f3bedfa9f23d09579f682c11d
  Author: Daniel Liu <daniel_liu4 at apple.com>
  Date:   2024-12-18 (Wed, 18 Dec 2024)

  Changed paths:
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-doubleargs.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-fpargs.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-indirect-doubleargs.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-manyargs.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-manyret.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-stress.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-stress2.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-stress3.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-stress4.js
    A JSTests/wasm/ipint-tests/ipint-test-tail-call-stress5.js
    M JSTests/wasm/stress/dont-stack-overflow-in-air.js
    M Source/JavaScriptCore/llint/InPlaceInterpreter.asm
    M Source/JavaScriptCore/llint/InPlaceInterpreter64.asm
    M Source/JavaScriptCore/wasm/WasmCalleeGroup.cpp
    M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h
    M Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp

  Log Message:
  -----------
  Fix edge cases in IPInt tail calls
https://bugs.webkit.org/show_bug.cgi?id=284785
rdar://141575550

Reviewed by Yusuke Suzuki.

IPInt's tail calls previously failed on changes in the stack frame layout, since the stack pointer
was not correctly updated prior to the tail call. This patch resolves that issue, as well as a few
others related to tail calls. IPInt is able to pass the `wasm/stress/tail-call.js` stress test
consistently now.

* JSTests/wasm/ipint-tests/ipint-test-tail-call-doubleargs.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.func.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.local.12.local.13.local.14.local.15.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.func.main.export.string_appeared_here.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.local.8.local.9.local.10.local.11.return_call.func.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-fpargs.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.func.param.f32.f32.f32.f32.i32.i32.i32.i32.i32.i32.i32.i32.f32.f32.f32.f32.f32.f32.f32.f32.result.f32.local.0.local.1.local.2.local.3.local.12.local.13.local.14.local.15.local.16.local.17.local.18.local.19.f32.add.f32.add.f32.add.f32.add.f32.add.f32.add.f32.add.f32.add.f32.add.f32.add.f32.add.func.main.export.string_appeared_here.param.f32.f32.f32.f32.i32.i32.i32.i32.i32.i32.i32.i32.f32.f32.f32.f32.f32.f32.f32.f32.result.f32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.local.12.local.13.local.14.local.15.local.16.local.17.local.18.local.19.return_call.func.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-indirect-doubleargs.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.type.sig.func.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.table.table.export.string_appeared_here.1.funcref.elem.i32.const.0.func.func.func.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.local.12.local.13.local.14.local.15.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.func.main.export.string_appeared_here.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.local.8.local.9.local.10.local.11.i32.const.0.return_call_indirect.table.type.sig.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-manyargs.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.func.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.func.main.export.string_appeared_here.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.return_call.func.func.func2.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.local.12.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.i32.add.func.main2.export.string_appeared_here.param.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.result.i32.local.0.local.1.local.2.local.3.local.4.local.5.local.6.local.7.local.8.local.9.local.10.local.11.local.12.return_call.func2.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-manyret.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.helper.result.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.const.0.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.i32.const.11.func.main.export.string_appeared_here.result.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.i32.return_call.helper.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-stress.js: Added.
(i32.const.0.func.0.1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-stress2.js: Added.
(i64.const.30.call.6.export.string_appeared_here.func.0.export.string_appeared_here.func.1.export.string_appeared_here.func.2.export.string_appeared_here.func.3.export.string_appeared_here.func.4.export.string_appeared_here.func.5.export.string_appeared_here.func.6.export.string_appeared_here.func.7.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-stress3.js: Added.
(type.1.param.i32.i64.f32.i64.f32.f64.f32.f64.i32.i32.i32.f64.f64.i64.f64.i32.i64.i64.f32.f64.f32.i32.i64.i64.f64.f64.result.i64.i64.f64.i32.i32.f64.i64.f64.f64.i32.i64.i32.f64.f32.f64.i64.local.2.local.1.local.0.local.8.local.5.local.7.local.9.return_call.0.export.string_appeared_here.func.0.export.string_appeared_here.func.1.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-stress4.js: Added.
(24.funcref.export.string_appeared_here.func.0.export.string_appeared_here.func.1.export.string_appeared_here.func.2.export.string_appeared_here.func.3.async test):
* JSTests/wasm/ipint-tests/ipint-test-tail-call-stress5.js: Added.
(type.1.result.f64.i32.f32.f32.const.8.f64.const.9.i64.const.10.i32.const.11.f64.const.12.i64.const.13.f32.const.14.f64.const.15.i32.const.16.f32.const.17.i32.const.18.f64.const.19.i32.const.20.f32.const.21.f64.const.22.i32.const.23.f64.const.24.i32.const.25.f32.const.26.i64.const.27.f64.const.28.i32.const.29.i32.const.30.f64.const.31.f32.const.32.f32.const.33.i64.const.34.f32.const.35.i32.const.36.f32.const.37.i32.const.38.f64.const.39.f32.const.40.i32.const.41.i32.const.42.i64.const.43.i64.const.44.i64.const.45.i64.const.46.return_call.0.export.string_appeared_here.func.0.export.string_appeared_here.func.1.async test):
* Source/JavaScriptCore/llint/InPlaceInterpreter.asm:
* Source/JavaScriptCore/llint/InPlaceInterpreter64.asm:
* Source/JavaScriptCore/llint/LLIntSlowPaths.h:
* Source/JavaScriptCore/wasm/WasmCalleeGroup.cpp:
(JSC::Wasm::CalleeGroup::CalleeGroup):
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp:
(JSC::Wasm::FunctionIPIntMetadataGenerator::setTailCall):
(JSC::Wasm::FunctionIPIntMetadataGenerator::addReturnData):
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h:
(JSC::Wasm::FunctionIPIntMetadataGenerator::setTailCallClobbersInstance):
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp:
(JSC::Wasm::IPIntGenerator::assertAboutStackSize):
(JSC::Wasm::IPIntGenerator::didParseOpcode):
(JSC::Wasm::IPIntGenerator::addBlock):
(JSC::Wasm::IPIntGenerator::addLoop):
(JSC::Wasm::IPIntGenerator::addTryTable):
(JSC::Wasm::IPIntGenerator::addCatchToUnreachable):
(JSC::Wasm::IPIntGenerator::addCatchAllToUnreachable):
(JSC::Wasm::IPIntGenerator::addSwitch):
(JSC::Wasm::IPIntGenerator::addCallCommonData):
(JSC::Wasm::IPIntGenerator::addTailCallCommonData):
(JSC::Wasm::IPIntGenerator::addCall):
(JSC::Wasm::IPIntGenerator::addCallIndirect):
(JSC::Wasm::IPIntGenerator::addCallRef):

Canonical link: https://commits.webkit.org/288056@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list