Dynamic Basic Block vs Static Basic Blocks and Branching

Viewed 654

In the book "Virtual Machines" by Smith & Nair (on page number 57), it is described here (in context of interpretation & dynamic binary translation), that dynamic basic blocks have branch target in the middle of them, while static basic blocks have not. Static basic block has only single entry and single exit point, as shown in this figure: static vs dynamic basic blocks

Now, on the page number 58 of that book, it is said that complication occurs to the translation process when branch goes to middle of the block that is already translated. Emulation Manager can not get target address as it has only starting address of particular translated block, not the branch target which is inside somewhere in the translated block. So that source code is translated again, even if it is already translated. Solution is to use extra data structure to keep track of the address ranges for each translated block. But this apparent complication does not occur when dynamic basic blocks are used.

But, as we can see from the figure and book linked above, the dynamic basic blocks may have branch targets in the middle of them while static blocks do not have such multiple entries. So, how can the dynamic basic block solve that problem instead of static block ?

Thank you in advance...

Edit : In the figure linked above, in the dynamic basic block, there are multiple labels with same name i.e. loop and skip. So, how can interpreter decides which label is actual target ? Is it possible to have multiple labels with same name in same assembly code portion ?

1 Answers
Related