Re-arrange code to avoid recursive locking of the JIT lock.
am: 085f7408de

Change-Id: I7479fc65de74b25c4de8528e94ad7fc2cda31c28