Dead Code Elimination - Dynamic Dead Code Elimination

Dynamic Dead Code Elimination

Dead code is normally considered dead unconditionally. Therefore, it is reasonable attempting to remove dead code through dead code elimination at compile time.

However, in practise it is also common for code sections to represent dead or unreachable code only under certain conditions, which may not be known at the time of compilation. Such conditions may be imposed by different runtime environments (for example different versions of an operating system, or different sets and combinations of drivers or services loaded in a particular target environment), which may require different sets of special cases in the code, but at the same time become conditionally dead code for the other cases. Also, the software (for example, a driver or resident service) may be configurable to include or exclude certain features depending on user preferences, rendering unused code portions useless in a particular scenario. While modular software may be developed to dynamically load libraries on demand only, in most cases, it is not possible to load only the relevant routines from a particular library, and even if this would be supported, a routine may still include code sections which can be considered dead code in a given scenario, but could not be ruled out at compile time, already.

The techniques used to dynamically detect demand, identify and resolve dependencies, remove conditionally dead code, and recombine the remaining code at load or runtime are called dynamic dead code elimination.

Most computer languages, compilers and operating systems offer no or little more support than dynamic loading of libraries and late linking, therefore software utilizing dynamic dead code elimination is very rare.

Read more about this topic:  Dead Code Elimination

Famous quotes containing the words dynamic, dead, code and/or elimination:

    Magic is the envelopment and coercion of the objective world by the ego; it is a dynamic subjectivism. Religion is the coercion of the ego by gods and spirits who are objectively conceived beings in control of nature and man.
    Richard Chase (b. 1914)

    Some sepulcher, remote, alone,
    Against whose portal she hath thrown,
    In childhood, many an idle stone—
    Some tomb from out whose sounding door
    She ne’er shall force an echo more,
    Thrilling to think, poor child of sin!
    It was the dead who groaned within.
    Edgar Allan Poe (1809–1849)

    Wise Draco comes, deep in the midnight roll
    Of black artillery; he comes, though late;
    In code corroborating Calvin’s creed
    And cynic tyrannies of honest kings;
    He comes, nor parlies; and the Town, redeemed,
    Gives thanks devout; nor, being thankful, heeds
    The grimy slur on the Republic’s faith implied,
    Which holds that Man is naturally good,
    And—more—is Nature’s Roman, never to be
    scourged.
    Herman Melville (1819–1891)

    The kind of Unitarian
    Who having by elimination got
    From many gods to Three, and Three to One,
    Thinks why not taper off to none at all.
    Robert Frost (1874–1963)