Message309452
1. This will actually simplify the code for calculating the stack size. Instead of supporting special cases for jumping instructions in stackdepth_walk() you could just write something like
new_depth = depth + PyCompile_OpcodeStackEffectEx(opcode, oparg, 0);
if (new_depth > maxdepth)
maxdepth = new_depth;
if (isjump) {
target_depth = depth + PyCompile_OpcodeStackEffectEx(opcode, oparg, 1);
maxdepth = stackdepth_walk(c, instr->i_target, target_depth, maxdepth);
}
depth = new_depth;
After adding new opcodes or changing existing opcodes you would need to change the code only in one place.
2. This will simplify third-party compilers (like https://github.com/vstinner/bytecode). They wouldn't need to duplicate the complicated code. |
|
Date |
User |
Action |
Args |
2018-01-04 00:57:31 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ncoghlan, larry, benjamin.peterson, eric.snow |
2018-01-04 00:57:30 | serhiy.storchaka | set | messageid: <1515027450.87.0.467229070634.issue32455@psf.upfronthosting.co.za> |
2018-01-04 00:57:30 | serhiy.storchaka | link | issue32455 messages |
2018-01-04 00:57:30 | serhiy.storchaka | create | |
|