Bug 229707 - [WASM-Function-References] Add support for (ref.null heaptype)
Summary: [WASM-Function-References] Add support for (ref.null heaptype)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dmitry
URL:
Keywords: InRadar
Depends on:
Blocks: 247393
  Show dependency treegraph
 
Reported: 2021-08-31 04:23 PDT by Dmitry
Modified: 2022-11-02 17:08 PDT (History)
8 users (show)

See Also:


Attachments
Patch (15.93 KB, patch)
2021-10-05 02:22 PDT, Dmitry
no flags Details | Formatted Diff | Diff
Patch (18.27 KB, patch)
2021-10-05 02:29 PDT, Dmitry
no flags Details | Formatted Diff | Diff
Patch (18.58 KB, patch)
2021-10-28 00:26 PDT, Dmitry
no flags Details | Formatted Diff | Diff
Patch (18.49 KB, patch)
2021-10-29 01:35 PDT, Dmitry
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry 2021-08-31 04:23:54 PDT
Function references proposal introduces new form of ref.null instruction that can take <heaptype> immediate.
To fully support the proposal we need to add new form of ref.null.
Comment 1 Radar WebKit Bug Importer 2021-09-07 04:24:15 PDT
<rdar://problem/82816107>
Comment 2 Dmitry 2021-10-05 02:22:48 PDT
Created attachment 440184 [details]
Patch
Comment 3 Dmitry 2021-10-05 02:29:33 PDT
Created attachment 440187 [details]
Patch
Comment 4 Dmitry 2021-10-28 00:26:15 PDT
Created attachment 442681 [details]
Patch
Comment 5 Yusuke Suzuki 2021-10-28 15:33:36 PDT
Comment on attachment 442681 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442681&action=review

r=me with nit.

> Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp:3456
> +    append(Move, Arg::bigImm(JSValue::encode(jsNull())), tmp1);
> +    append(Compare64, Arg::relCond(MacroAssembler::Equal), calleeFunction, tmp1, tmp2);
> +    emitCheck([&] {
> +        return Inst(BranchTest32, nullptr, Arg::resCond(MacroAssembler::NonZero), tmp2, tmp2);
> +    }, [=] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
> +        this->emitThrowException(jit, ExceptionType::NullReference);
> +    });

We should use Branch64 instead of Compare64 and BranchTest32.
Comment 6 Dmitry 2021-10-29 01:35:17 PDT
Created attachment 442794 [details]
Patch
Comment 7 Yusuke Suzuki 2021-10-29 17:35:07 PDT
Comment on attachment 442794 [details]
Patch

r=me
Comment 8 EWS 2021-10-29 17:46:34 PDT
Committed r285065 (243707@main): <https://commits.webkit.org/243707@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442794 [details].