-
Notifications
You must be signed in to change notification settings - Fork 40
Remove subtyping #87
Remove subtyping #87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
document/js-api/index.bs
Outdated
@@ -902,9 +898,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each | |||
1. If |valuetype| equals [=𝗂𝟨𝟦=], return [=𝗂𝟨𝟦.𝖼𝗈𝗇𝗌𝗍=] 0. | |||
1. If |valuetype| equals [=𝖿𝟥𝟤=], return [=𝖿𝟥𝟤.𝖼𝗈𝗇𝗌𝗍=] 0. | |||
1. If |valuetype| equals [=𝖿𝟨𝟦=], return [=𝖿𝟨𝟦.𝖼𝗈𝗇𝗌𝗍=] 0. | |||
1. If |valuetype| equals [=nullref=], return [=ref.null=]. | |||
1. If |valuetype| equals [=anyref=], return [=ToWebAssemblyValue=](undefined, |valuetype|). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
interpreter/README.md
Outdated
offset: offset=<nat> | ||
align: align=(1|2|4|8|...) | ||
cvtop: trunc | extend | wrap | ... | ||
|
||
num_type: i32 | i64 | f32 | f64 | ||
ref_type: anyref | funcref | nullref | ||
ref_kind: any | func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/any/extern/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -47,8 +46,8 @@ Notes: | |||
|
|||
Typing extensions: | |||
|
|||
* Introduce `anyref`, `funcref`, and `nullref` as a new class of *reference types*. | |||
- `reftype ::= anyref | funcref | nullref` | |||
* Introduce `funref` and `externref` as a new class of *reference types*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
funcref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
test/core/linking.wast
Outdated
(global (import "Mref_ex" "g-const-func") funcref) | ||
(global (import "Mref_ex" "g-const-func") anyref) | ||
(global (import "Mref_ex" "g-const-any") anyref) | ||
(global (import "Mref_ex" "g-const-any") externref) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to rename these to "g-const-extern" too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
test/core/ref_func.wast
Outdated
@@ -9,8 +9,8 @@ | |||
(i32.add (local.get $x) (i32.const 1)) | |||
) | |||
|
|||
(global anyref (ref.func $f)) | |||
(global anyref (ref.func $g)) | |||
(global externref (ref.null extern)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Update the implementation given WebAssembly/reference-types#87 which removed subtyping and renamed "anyref" to "externref"
Update the implementation given WebAssembly/reference-types#87 which has a number of changes to the reference types implementation: * Subtyping is removed * `nullref` as a type was removed * `anyref` was renamed to `externref` * `ref.null` and `ref.is_null` take immediate type arguments as to what kind of `null` they're producing. The spec testsuite repo has not yet updated with this change yet, so the tests are temporarily vendored here in the `tests/wast` directory.
Update the implementation given WebAssembly/reference-types#87 which has a number of changes to the reference types implementation: * Subtyping is removed * `nullref` as a type was removed * `anyref` was renamed to `externref` * `ref.null` and `ref.is_null` take immediate type arguments as to what kind of `null` they're producing. The spec testsuite repo has not yet updated with this change yet, so the tests are temporarily vendored here in the `tests/wast` directory.
Update the implementation given WebAssembly/reference-types#87 which has a number of changes to the reference types implementation: * Subtyping is removed * `nullref` as a type was removed * `anyref` was renamed to `externref` * `ref.null` and `ref.is_null` take immediate type arguments as to what kind of `null` they're producing. The spec testsuite repo has not yet updated with this change yet, so the tests are temporarily vendored here in the `tests/wast` directory.
* Update implementation of reference types Update the implementation given WebAssembly/reference-types#87 which has a number of changes to the reference types implementation: * Subtyping is removed * `nullref` as a type was removed * `anyref` was renamed to `externref` * `ref.null` and `ref.is_null` take immediate type arguments as to what kind of `null` they're producing. The spec testsuite repo has not yet updated with this change yet, so the tests are temporarily vendored here in the `tests/wast` directory. * Update TypedSelect validation
anyref future semantics were changed to only represent opaque host values, and thus renamed to externref. [Chromium](https://bugs.chromium.org/p/v8/issues/detail?id=7748#c360) was just updated to today (not yet released). I couldn't find a Mozilla bugzilla ticket mentioning externref so I don't immediately know if they've updated yet. WebAssembly/reference-types#87
This updates reference types proposal up-to-date, per WebAssembly/reference-types#87. Only maybe half of tests have been updated, so CI will not pass. I was in the process of updating them fully, but I noticed WebAssembly#3084, so I'm not sure if I continue to do this anymore. I asked him if he wanted to do it himself to prevent this situation but apparently my questions weren't answered and I didn't know that he was working on this at the same time. I'm uploading this anyway in case this is necessary for discussions.
This updates reference types proposal up-to-date, per WebAssembly/reference-types#87. Only maybe half of tests have been updated, so CI will not pass. I was in the process of updating them fully, but then I noticed WebAssembly#3084, so I'm not sure if I should continue to do this anymore. I asked him if he wanted to do it himself to prevent this situation but apparently my questions weren't answered and I didn't know that he was working on this at the same time. I'm uploading this anyway in case this is necessary for discussions.
https://bugs.webkit.org/show_bug.cgi?id=218885 Patch by Dmitry Bezhetskov <dbezhetskov@igalia.com> on 2020-11-18 Reviewed by Yusuke Suzuki. Make funcref is not a subtype of externref. The spec: https://webassembly.github.io/reference-types/core/ The PR for removing subtype from the spec: WebAssembly/reference-types#87. JSTests: * wasm/references/func_ref.js: (assert.eq.instance.exports.fix.fun): (assert.eq.instance.exports.fix): * wasm/references/validation.js: Source/JavaScriptCore: * wasm/WasmFormat.h: (JSC::Wasm::isSubtype): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@270015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=218885 Patch by Dmitry Bezhetskov <dbezhetskov@igalia.com> on 2020-11-18 Reviewed by Yusuke Suzuki. Make funcref is not a subtype of externref. The spec: https://webassembly.github.io/reference-types/core/ The PR for removing subtype from the spec: WebAssembly/reference-types#87. JSTests: * wasm/references/func_ref.js: (assert.eq.instance.exports.fix.fun): (assert.eq.instance.exports.fix): * wasm/references/validation.js: Source/JavaScriptCore: * wasm/WasmFormat.h: (JSC::Wasm::isSubtype): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): Canonical link: https://commits.webkit.org/231756@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Per the vote on #69, this PR removes subtyping from the proposal. List of changes:
nullref
typeanyref
type toexternref
ref.null
andref.is_null
instructions with new immediate of the formfunc
orextern
(this will later have to generalise to aconstype
per the typed references proposal)ref.null
,ref.is_null
: determine reference type based on new immediateselect
,call_indirect
,table.copy
,table.init
: drop subtypingbr_table
: revert to rule requiring same label typeselem
segment: drop subtypingglobal
import: drop subtyping (link time)"nullref"
"anyref"
to"externref"
ref
result toref.extern
ref.host
value toref.extern