Proxy compilation for Java via a code migration technique