VM

Suggested patch to strip out dead code

Bug #1036384 reported by Stefan Monnier
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
VM
Triaged
Low
Uday Reddy

Bug Description

[ I sent this mail to <email address hidden>, but I"m not sure if that mailing-list is actually in use (I hope it is, I hate those bug-tracker thingies that only work when you're connected), so here's a copy of that message, just in case. ]

The patch below replaces the vm-(x|fsf)emacs-p constants with
(featurep 'xemacs) tests (basically applying constant-folding).
The reason why this is a good idea is that nowadays such featurep calls
are optimized away by the byte-compiler, resulting in more efficient
code since (if (featurep 'xemacs) FOO BAR) can get directly turned into
either FOO or BAR depending on which emacs flavor is used to compile
the file, whereas (if vm-xemacs-p FOO BAR) cannot be optimized similarly
since Elisp allows vm-xemacs-p to be modified later on.
Other than resulting in more efficient code, it also reduces the
false-positive warnings by preventing the byte-compiler from seeing code
that's only meant for the other flavor.

Additionally to doing such constant-folding, the patch adds a few more
changes, such as eliminating the use of `local-map' at one place
(`keymap' is supported in Emacs since Emacs-21), eliminating some dead
code (made more obvious by the constant-folding), and do a bit of
common-subexpression-elimination, typically turning some (if A (foo B)
(foo C)) into (foo (if A B C)).

The patch is against the tip of http://bazaar.launchpad.net/~vm/vm/trunk.

        Stefan

Revision history for this message
Stefan Monnier (monnier) wrote :
Uday Reddy (reddyuday)
Changed in vm:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Uday Reddy (reddyuday)
milestone: none → 8.2.1a
Uday Reddy (reddyuday)
Changed in vm:
milestone: 8.2.1a → 8.2.90a
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.