21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

374 C.–C. L<strong>in</strong> and C.–L. Chen<br />

of demonstration, but it is easy to apply our theory to other platforms and tools.<br />

Figure 5 illustrates the layout of the <strong>in</strong>terpreter <strong>in</strong> assembly form (FastInterpret() <strong>in</strong><br />

<strong>in</strong>terp.c). The first trunk BytecodeFetch<strong>in</strong>g is the code block for reschedul<strong>in</strong>g and<br />

fetch<strong>in</strong>g, it is exactly the first part <strong>in</strong> the orig<strong>in</strong>al source code. The second trunk<br />

LookupTable is a large lookup table used <strong>in</strong> dispatch<strong>in</strong>g bytecode <strong>in</strong>structions. Each<br />

entry l<strong>in</strong>ks to a bytecode handler. It is actually the translated result of the<br />

“switch…case…case” statement.<br />

Fig. 5. The organization of the <strong>in</strong>terpreter <strong>in</strong> assembly aspect<br />

The third trunk BytecodeDispatch is the aggregation of more than a hundred<br />

bytecode handlers. Most bytecode handlers are self-conta<strong>in</strong>ed which means a<br />

bytecode handler occupies a contiguous memory space <strong>in</strong> this trunk and it does not<br />

jump to program codes stored <strong>in</strong> other trunks. There are only a few exceptions which<br />

call functions stored <strong>in</strong> other trunks, such as “<strong>in</strong>vokevirtual.” Besides, there are<br />

several constant symbol tables spread over this trunk. These tables are referenced by<br />

the program codes with<strong>in</strong> the BytecodeDispatch trunk.<br />

The last trunk ExceptionHandl<strong>in</strong>g conta<strong>in</strong>s code fragments related with exception<br />

handl<strong>in</strong>g. Each trunk occupies a number of NAND flash pages. In fact, the total size

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!