Conversation
|
|
||
| ;; TODO(3, rossberg): enable t_2* <: C.RETURN | ||
| rule Instr_ok2/return_call_addr: | ||
| s; C |- RETURN_CALL_ADDR a : t_3* t_1* (REF NULL dt) -> t_4* |
There was a problem hiding this comment.
Same for the ref null dt here
| -- Instrtype_ok: C |- t_3* -> t_4* : OK | ||
|
|
||
| rule Instr_ok2/throw_addr: | ||
| s; C |- THROW_ADDR a : t_1* t* -> t_2* |
There was a problem hiding this comment.
t^* here looks to be droppable as well (same as the above 2)
| -- Instrs_ok2: s; C |- instr* : eps ->_(x*) t* | ||
|
|
||
| rule Instr_ok2/call_addr: | ||
| s; C |- CALL_ADDR a : t_1* (REF NULL dt) -> t_2* |
There was a problem hiding this comment.
Hmm, I thought we would be able to drop the additional REF NULL dt here given that call_addr is now the dedicated invoke admin instruction (so it only resolves the lookup and invoke the function frame).
|
That's a nice and helpful cleanup! Most of the changes look correct, although there are some The AL breakage might be due to Upd: Oh I might have seen the point -- without the guard it seems to introduce nondet reduction paths. But I think the program above is genuinely stuck, as the reference cannot be resolved to a Given that we now have |
|
Ah, too many copy&paste errors, thanks! As for the the AL problem, that already occurs during translation, so isn't a stuck rule. Fixing the throw_ref rule didn't change it. I suspect that I need to change where the ThrowI arg is coming from in the translate.ml, but I'm not sure how to get (and transform) the immediate. |
|
I see. iirc the AL had some hard coded implementations for evaluation context instructions, and On a side note, I'd only wish if a similar clean restriction could apply to the reference instructions like In my work I've made |
|
@f52985, did you have any chance to look into this? |
|
Oh, I've been a bit busy lately and haven't had time to look into it yet. I'll take a look soon. |
|
Sorry for the delay. The issue with the AL interpreter was indeed the hardcoded injection of the In the fixed version, the generated prose for this case looks like: I wasn't entirely sure what the exact wording should be, so I used |
|
Thanks @f52985. I think that specific wording is fine, but I agree that there still are some stylistic issues and unexpected changes in the prose:
Can these perhaps be tweaked somehow? |
|
@f52985, just tagging you again to make sure that you saw my questions above. :) |
|
Oh, somehow I missed the rest of questions. I'll take a look. |
|
Hi @f52985, did you ever get a chance to look into this? |
|
Oops, my bad. It completely slipped my mind. I've investigated each issue, and all of them are now fixed:
Context rules are now excluded from the prose generation target. The filter depends on the naming convention of the rules, where they all end with
The rst renderer had an issue where it could not correctly render long if-else chains. This is now fixed, which also uncovered and fixed a similar issue in other rendered algorithms.
The translator now enforces that the single Throw appears in the latter position of an if-else block. |
@raoxiaojia, this makes the change suggested in #2188 and replaces the use of call_ref as a semi-administrative instruction with a dedicated call_addr. Analogously, do the same change for throw_ref/throw_addr. This allowed to remove all occurrences of typeuse from the instruction syntax. PTAL.
@f52985, the change to throw_ref breaks AL translation. There appears to be some special handling of throw rules, but I couldn't figure out exactly what it does and
why the tweak I did wasn't enoughhow to get the immediate of the throw_addr instruction instead of the stack top. Can you please take a look?