[issue2493] Remove unused constants from optimized code objects

2008-06-12 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: The issue with unused constants is an artifact of the peepholer running after the bytecode generation phase. When constant folding was written, I intentionally left-out a step to remove unused constants because of the code complexity, t

[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I've noticed that the original patch does not handle the error condition from failed consts resize correctly. Please see compress-consts-1.diff for a fix. Added file: http://bugs.python.org/file9868/compress-consts-1.diff __

[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Raymond Hettinger
Changes by Raymond Hettinger <[EMAIL PROTECTED]>: -- assignee: -> rhettinger nosy: +rhettinger __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bug

[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Alexander Belopolsky
New submission from Alexander Belopolsky <[EMAIL PROTECTED]>: When peephole optimizer folds multiple constants into one, the old constants remain in co_consts. Attached patch removes such unused constants. -- components: Interpreter Core files: compress-consts.diff keywords: patch mes