Closed Bug 1472178 Opened 6 years ago Closed 6 years ago

Allow Ref in Globals

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: bbouvier, Assigned: lth)

References

Details

Attachments

(1 file, 2 obsolete files)

Same work as bug 1450261, but for any Ref in addition to AnyRef (!).

Some attention will be required when setting value (to take type system into account). (Also please be mindful that the postbarrier code checking if the set location is tenured has never been tested and could be awfully wrong)
Assignee: nobody → lhansen
Status: NEW → ASSIGNED
Priority: -- → P3
I think this should actually be good enough, given my existing patches for struct types.  The verifier is already doing the type checking as part of its normal operation with push/pop, so all we need to do is clean up a few places that handle AnyRef but not Ref.  I'll look around for more places and I'll write some more interesting test cases, but I don't expect to find any more problems really.  Input is very welcome.
Attachment #8994565 - Flags: feedback?(bbouvier)
Comment on attachment 8994565 [details] [diff] [review]
bug1472178-ref-in-wasm-globals.patch

Review of attachment 8994565 [details] [diff] [review]:
-----------------------------------------------------------------

Sweet. So there can't be pointer attributes within a user-defined struct type yet, right? (otherwise i'd expect changes in codegen)
With more tests (including ones for pre- and post-barriers) this would be good to land.

::: js/src/wasm/WasmValidate.cpp
@@ +1763,1 @@
>              return d.fail("expected anyref as type for ref.null");

nit: update error message
Attachment #8994565 - Flags: feedback?(bbouvier) → feedback+
With more test cases for import/export and with update to the error message.
Attachment #8994565 - Attachment is obsolete: true
Attachment #8994793 - Flags: feedback+
Depends on: 1478616
The test cases are a little lame because we don't have struct.new et al yet, only null pointers, but they did uncover a bug so they're not worthless.  I've preserved the better test cases from the WIP patches and will land them later with the struct code.
Attachment #8994793 - Attachment is obsolete: true
Attachment #8995227 - Flags: review?(bbouvier)
Comment on attachment 8995227 [details] [diff] [review]
bug1472178-ref-in-wasm-globals-v3.patch

Review of attachment 8995227 [details] [diff] [review]:
-----------------------------------------------------------------

Nice.
Attachment #8995227 - Flags: review?(bbouvier) → review+
https://hg.mozilla.org/mozilla-central/rev/c47ad4f17e19
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: