摘要:
Disclosed is a method and apparatus for detecting and monitoring program hot spots during execution that may be implemented in hardware. A hot spot detector tracks branch instructions which are retired. Frequently executed branch instruction addresses within a particular interval are designated as hot spot candidates. A hot spot detection counter is used to track non-hot spot branches and hot spot candidate branches. When hot spot candidate branches are frequently encountered compared to non-hot spot candidate branches, the hot spot detector may notify the operating system and hot spot candidate branch addresses may be supplied to a runtime optimizing compiler and a monitor table or a hot spot monitor. The hot spot monitor may disable the hot spot detector when a program is operating in known hot spots and may enable the hot spot detector if the program has strayed from known hot spots.