This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients benjamin.peterson, eric.snow, larry, ncoghlan, serhiy.storchaka
Date 2018-01-04.00:57:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515027450.87.0.467229070634.issue32455@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-01-04 00:57:31serhiy.storchakasetrecipients: + serhiy.storchaka, ncoghlan, larry, benjamin.peterson, eric.snow
2018-01-04 00:57:30serhiy.storchakasetmessageid: <1515027450.87.0.467229070634.issue32455@psf.upfronthosting.co.za>
2018-01-04 00:57:30serhiy.storchakalinkissue32455 messages
2018-01-04 00:57:30serhiy.storchakacreate