Skip to main content
Post Made Community Wiki
Source Link
kdgregory
  • 39.7k
  • 11
  • 82
  • 107

I don't know specifically how Java does it, but in general you'd insert "trap" opcodes into the interpreter's instruction stream. There are two opcodes in the JVM spec that seem tailor-made for this purpose.

If you want to know for sure, there's no better answer than the source: http://download.java.net/jdk6/source/