File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
proposals/custom-descriptors Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,9 @@ br_on_cast_desc labelidx reftype reftype
388
388
C |- br_on_cast_desc l rt_1 rt_2 : t* rt_1 (ref null (exact_1 y)) -> t* (rt_1 \ rt_2)
389
389
-- C.labels[l] = t* rt
390
390
-- C |- rt_2 <: rt
391
- -- C |- rt_2 <: rt_1
391
+ -- C |- rt_1 <: rt'
392
+ -- C |- rt_2 <: rt'
393
+ -- C |- rt' : ok
392
394
-- rt_2 = (ref null? (exact_1 x))
393
395
-- C.types[x] ~ descriptor y ct
394
396
```
@@ -399,11 +401,19 @@ br_on_cast_desc_fail labelidx reftype reftype
399
401
C |- br_on_cast_desc_fail l rt_1 rt_2 : t* rt_1 (ref null (exact_1 y)) -> t* rt_2
400
402
-- C.labels[l] = t* rt
401
403
-- C |- rt_1 \ rt_2 <: rt
402
- -- C |- rt_2 <: rt_1
404
+ -- C |- rt_1 <: rt'
405
+ -- C |- rt_2 <: rt'
406
+ -- C |- rt' : ok
403
407
-- rt_2 = (ref null? (exact_1 x))
404
408
-- C.types[x] ~ descriptor y ct
405
409
```
406
410
411
+ Note that the constraint ` C |- rt_2 <: rt_1 ` on branching cast instructions before this proposal
412
+ is relaxed to the constraint that ` rt_1 ` and ` rt_2 ` share some arbitrary valid supertype ` rt' ` ,
413
+ i.e. that ` rt_1 ` and ` rt_2 ` must be in the same heap type hierarchy.
414
+ This relaxation is applied not only to the new ` br_on_cast_desc ` and ` br_on_cast_desc_fail ` instructions,
415
+ but also the existing ` br_on_cast ` and ` br_on_cast_fail ` instructions.
416
+
407
417
## JS Prototypes
408
418
409
419
In JS engines,
You can’t perform that action at this time.
0 commit comments