Trampoline

A trampoline is a mechanism used, for example, in JIT compilation without interpretation. A trampoline is usually a piece of native code placed in memory that "pretends" to be a fully compiled method. When the method is called, the trampoline is executed. The trampoline contains code that makes the called method generate itself and then dispatches control to the freshly generated code. Future calls to the trampoline are back patched to go directly to the real method. When no more calls are relayed through the trampoline, its code buffer can be reclaimed.

See also Method garbage collection and JIT compilation.

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.