-
Notifications
You must be signed in to change notification settings - Fork 74
Comments/Questions regarding classification opcodes #183
Comments
Excellent suggestions! PTAL at #184 for a fix.
Absolutely! Also refined the other
Agreed, changed as well.
I relaxed the typing rules to allow the label to have a supertype of the type tested for. With that, I think the equivalence you are looking for holds. I'm not sure I understand what you mean by allowing "more values" or "no values" or why that is needed, can you elaborate? |
Sorry for not being clear. Let me use an example: |
Ah, I see. No, these examples aren't valid, but the "equivalent" ones wouldn't type-check either. For the latter example, you'd need to replace the
That is, the exact expansion would be dependent on the label's type. That said, it would be possible to generalise I'm afraid the former example doesn't make sense to me, since it would require |
Right. What I meant is |
You mean the result type of the instruction would depend on the label? That would be pretty ad-hoc. If the label has no parameters, then why would you want to use |
Fixed via #184. |
Hello,
I have been implementing the latest version of the gc proposal in V8 and have come up with the following comments/questions:
ref.cast
succeeds on null, it is not clear what should happen with theref.as_*
instructions. As stated, it seems they should all fail for null, but thenref.as_func
should return(ref func)
overfuncref == (ref null func)
. What is the intended behavior?br_on_func
should branch with a(ref func)
type.br_on_* : [anyref]->[anyref]
instructions needlessly loosens the type of its argument. E.g., if we pass aneqref
tobr_on_data
and the branch is not taken, we will end up with ananyref
value instead ofeqref
. In my opinion, those instructions should return the type of their argument.br_on_*
instructions only work if the targeted label expects as result exactly the value produced by the branch instruction. This could be loosened to allow the branch type to have more values, or even no values (in which case the matched value is discarded). If both are allowed, the behavior of(br_on_t $l arg)
wherearg: ta
. would be equivalent to(if (result ta) (ref.is_t arg) (then (ref_as_t arg) (br $l)) (else arg))
.The text was updated successfully, but these errors were encountered: