In the Java bytecodes, it is common for an instruction that copies data from a local variable to the top of the stack to precede an instruction that uses it. The picoJava corefoldsthese two instructions into one by accessing the local variable directly and using it in the operation. Thisfolding operation accelerates Java bytecode execution by taking advantage of the singlecycle random access to the stack cache. Hardware support for synchronization is provided to the operating system by using the low-order 2-bits in shared objects as flags to control access to the object.