[WIP] [x86/Linux] Call EH Funclet with CallEHFunclet#9489
Conversation
Implement CallEHFunclet same as ARM/ARM64.
| add_compile_options("--sysroot=${CROSS_ROOTFS}") | ||
| add_compile_options("-Wno-error=unused-command-line-argument") | ||
| add_compile_options("-mstack-alignment=4") | ||
|
|
| inst_RV(INS_push, REG_EBX, TYP_REF); | ||
| inst_RV(INS_push, REG_ESI, TYP_REF); | ||
| inst_RV(INS_push, REG_EDI, TYP_REF); | ||
|
|
There was a problem hiding this comment.
It would be better to use genPushCalleeSavedRegisters instead of explicitly adding push instructions.
There was a problem hiding this comment.
Is there a good reason for saving these registers here? The asm helper that calls the funclet will save them, so the funclet does not have to ... unless there is some other reason.
There was a problem hiding this comment.
I'll remove them, thanks.
| // TODO Restore callee-saved registers | ||
| inst_RV(INS_pop, REG_EDI, TYP_REF); | ||
| inst_RV(INS_pop, REG_ESI, TYP_REF); | ||
| inst_RV(INS_pop, REG_EBX, TYP_REF); |
There was a problem hiding this comment.
Similarly before, genPopCalleeSavedRegisters would be better.
|
About nested catch failure, for the test case like below: When excuting the funclet that catches |
|
@jkotas @parjong |
|
@wateret While digging I made a draft patch in https://github.com/parjong/coreclr/commit/a992b93ec85cf70c54558ff63a3b11ee0809b4db, it seems to work for I'm not sure whether that patch could be aligned with your current patch as it does not use PSPSym at all, but it would be worthwhile to take a look. |
|
Closing as #9601 includes this. |
Implement CallEHFunclet same as ARM/ARM64.'
This follows ARM/ARM64 way for calling non-filter funclets which is actually not the way discussed in #9484. This can handle simple
try-catchstatements but fails for nested exceptions. (e.g. throw in catch block)