1. A method comprising: compiling a function including a byte code sequence having a field byte code that accesses or modifies a field, the compiled function providing a native code and occupying a code space; generating an instrumentation code corresponding to a field watch of the field; guarding execution of the instrumentation code if the field watch is not activated; and inserting the instrumentation code to the native code.