if (extendedBehavior) doExtended(); else x = 11;and extendedBehavior is often false, then you can specialize the above code to just "x=11;". Usually, the assumption can't be proved (e.g. that extendedBehavior is false), so the specialized code has to be protected by a guard, which essentially says "if extendedBehavior is true, branch to the non specialized code; else branch to the specialized code".
Under appropriate circumstances, the performance gain from specialization can be quite considerable.
See also PartialEvaluation, ProgramSpecialization (a synonym for PartialEvaluation).
-- MikeVanEmmerik - 03 Dec 2001
(Specialization is not a WikiName; renamed the topic to ProgramSpecialization -- EelcoVisser - 04 Dec 2001)