DETERMINING DESTINATIONS OF A DYNAMIC BRANCH

A method, a translator (10), and a computer-readable medium (17) for translating compiled programming code (20) from a first code state (12) to a second code state (14) are disclosed. The programming code in the first state has a plurality of basic blocks (24), where each basic block has a set of in...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: FENDER, TIMOTHY, N, STRATTON, WILLIAM, JENNINGS, ANDREW, T, KRABLIN, G., LAWRENCE
Format: Patent
Sprache:eng ; fre
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:A method, a translator (10), and a computer-readable medium (17) for translating compiled programming code (20) from a first code state (12) to a second code state (14) are disclosed. The programming code in the first state has a plurality of basic blocks (24), where each basic block has a set of instructions. At least one basic block ends in a dynamic branch, the dynamic branch being a transfer to one of a set of destinations based on a calculation of a destination address. The plurality of basic blocks in the first state of the programming code are identified, as are links between the identified basic blocks. A control flow graph (CFG)(26) of the programming code is then constructed based on the identified basic blocks and identified links, where the CFG is in a preliminary form. At least one basic block ending in a dynamic branch is identified, and all identified basic blocks that lead to the dynamic branch are explored, based on the CFG, as far back as is necessary to fully determine a set of destination addresses for the dynamic branch. The set of destination addresses defines the set of destinations from the dynamic branch. Such set of destinations is examined to identify a branch table, and the CFG is updated to reflect the set of destinations and the identified branch table. The programing code is then translated form the first state to the second state based at least in part on the updated CFG. L'invention concerne un procédé, un traducteur (10) et un support lisible par ordinateur (17) servant à traduire un code de programmation compilé (20), d'un premier état de code (12) à un deuxième état de code (14). Le code de programmation du premier état comporte plusieurs blocs de base (24), chaque bloc de base comportant un ensemble d'instructions. Au moins un bloc de base se termine dans un embranchement dynamique, l'embranchement dynamique constituant un transfert vers l'une des destinations d'un ensemble de destinations en fonction d'une adresse de destination. Les blocs de base du premier état du code de programmation sont identifiés, ainsi que les liaisons reliant les blocs de base identifiés. Un diagramme de contrôle (CFG)(26) du code de programmation est ensuite construit sur la base des blocs de base identifiés et des liaisons identifiées, le CFG se trouvant dans une forme préliminaire. Au moins un bloc de base se terminant dans un embranchement dynamique est identifié, et tous les blocs de base identifiés qui mènent à l'embranchement dynamique