View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

BCMode

The "bytecode execution mode" is similar, in some regards, to the original Jazelle technology developed by ARM. That was essentially a 12 thousand gate circuit that translated Java bytecodes to 32 bit ARM instructions. Four registers served as a cache for the elements on the top of the stack and several other registers were dedicated to pointing to the important memory regions used by the Java system. Most Java bytecodes can be translated into one or two ARM instructions and the few that can't just jump into a software implementation of their function.

The BC Mode also shares a few features with the PICMode technology. In both cases a special memory is involved and instructions are streamed without changing the program counter.

When in BC Mode the processor fetches the byte indicated by the PC and instead of using this as an instruction it uses it to select a two word line from a small local memory. The instructions in that word (up to four) are streamed to the processor for execution, but in addition to the 16 bits that make up the instruction each half word has 2 more bits which are used to control the fetching of more bytes from the instruction cache.

One of the extra bits indicates that a new bytecode should be fetched. This normally means the one following the currently executing bytecode, but if this bit is used with a branch or jumpl instruction then the new PC is used to get the next bytecode.

The other extra bit indicates that the byte following the current bytecode is to be used as a source for the instruction, and the PC is updated to reflect that. For now there isn't an efficient way to do a 4 or 8 way dispatch based on these bits, but given how rare extended bytecodes are at run time it probably isn't worth investing in extra hardware to fix this.

Link to this Page

  • RISC42 last edited on 22 August 2008 at 11:55:58 pm by 192.168.1.23