WO2006077252A2 - Escape analysis in an object oriented language program for a virtual stack machine - Google Patents

Escape analysis in an object oriented language program for a virtual stack machine Download PDF

Info

Publication number
WO2006077252A2
WO2006077252A2 PCT/EP2006/050350 EP2006050350W WO2006077252A2 WO 2006077252 A2 WO2006077252 A2 WO 2006077252A2 EP 2006050350 W EP2006050350 W EP 2006050350W WO 2006077252 A2 WO2006077252 A2 WO 2006077252A2
Authority
WO
WIPO (PCT)
Prior art keywords
escape
analysis
program
signature
signatures
Prior art date
Application number
PCT/EP2006/050350
Other languages
French (fr)
Other versions
WO2006077252A3 (en
Inventor
Antoine Galland
Original Assignee
Gemplus
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gemplus filed Critical Gemplus
Publication of WO2006077252A2 publication Critical patent/WO2006077252A2/en
Publication of WO2006077252A3 publication Critical patent/WO2006077252A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis

Definitions

  • the invention relates generally to computer programs, and in particular to exhaust analysis methods in object-oriented programs for stacked virtual machines.
  • the exhaust analysis is performed on a program to determine the lifetime of objects.
  • An escape analysis allows possible optimizations during execution, for example memory management in stack of objects or elimination of synchronization.
  • a garbage collection function (referred to as garbage collection in English) is integrated into a virtual machine to retrieve memory locations that have ceased to be used by a program.
  • a garbage collector scans all the memory locations that have been allocated to objects in a dedicated memory space. Locations that have become unused are then identified. When an object is no longer pointed to by any other object, its locations are considered unused. These memory locations are then marked so that they can be reallocated to another process in the program.
  • the recovery of memory space requires a large number of operations and the recovery of memory space by the garbage collector can then occupy an excessive portion of the processing capacity of a device with limited processing capacity.
  • the time required for space recovery in a non-volatile memory can also be important, because of their long writing time.
  • the object of the invention is to adapt the program exhaust analyzes in order to implement this type of analysis by means of a device whose processing capacity does not allow it with the known techniques of analyze all the methods of the program.
  • the invention also aims to guarantee the integrity of the result of the exhaust analysis.
  • the invention thus relates to an exhaust analysis method, comprising the steps of:
  • the second processing device used is a device with limited processing capacity.
  • an escaping signature generated for a method includes information associated with its parameters such as its arguments, its current object and / or its return object.
  • the partial exhaust static analysis and the consistency check are performed after the loading of the program into the second processing device.
  • the program in intermediate execution language is in the form of Java or CLI pseudo-binary code.
  • FIG. 2 illustrates the process steps of analysis of a program according to the invention
  • FIG. 3 illustrates escape rules on instructions of a Java pseudo-binary code
  • FIGS. 4 to 6 illustrate a Java code and the static exhaust analysis carried out on its pseudo-binary code equivalent
  • FIG. 7 illustrates a static analysis and a verification carried out in a processing device loading the program.
  • An object o is said to be unescaped (or captured) by a method m in which it has been allocated only if its lifetime does not exceed that of method m.
  • a captured o allocation can be safely destroyed at the exit of this method m.
  • the memory locations occupied by the captured object o can be released at the end of the execution of the method m.
  • an escaped object o is an object that can potentially be referenced after the completion of the method m in which it was allocated.
  • a device with limited processing capacity will designate a processing device whose processing capacity is insufficient to carry out the static exhaust analysis on the entire program on its own. For example, a device with a limited processing capacity will have a RAM less than 32 kilobytes and an EEPROM of less than 512 kilobits.
  • the invention proposes an exhaust analysis method in which a static exhaust analysis is performed on an intermediate runtime program for a stacked virtual machine in a first processing device.
  • Escape signatures associated with the program methods are generated according to predetermined escape rules.
  • the program and the escape signatures are loaded into a second processing device and a partial exhaust static analysis, based on the loaded exhaust signatures is performed.
  • Test signatures associated with the objects of the loaded program are generated by the same predetermined escape rules.
  • the consistency between the loaded escape signatures and the test escape signatures is then checked. The integrity of the loaded program is thus verified.
  • the loaded escape signatures can not be fraudulently used to circumvent security rules on object references.
  • the invention provides an achievable exhaust analysis method on a form of the usually available program and limiting the resources required to perform the exhaust consistency check.
  • FIG. 1 illustrates an exemplary system implementing the invention.
  • a first processing device DTA is formed of a computer.
  • the DTA device is connected to an LEC chip card reader, through which it can communicate with the second DCTL processing device formed of a smart card.
  • the processing device DTA has a program in intermediate execution language, intended to be subjected to the method of static analysis of exhaust and loading into the device DCTL.
  • FIG. 2 An example of a method embodying the invention is illustrated with reference to FIG. 2.
  • the exhaust analysis will be illustrated on the instructions of the Java virtual machine (in English named bytecode Java, described in the specification named “The Java Virtual Machine Specification "written by Tim Lindholm and Frank Yellin at The Java Series editions, Addison-Wesley (1st ed.) In 1996).
  • the first processing device DTA performs a static exhaust analysis on the program in the form of pseudo-binary code.
  • the static exhaust analysis aims to determine the lifetime of objects and aims to generate escape signatures summarizing the escape behaviors.
  • For each method m we generate two escape signatures, one named direct and noted Se "1 and a second named unified and noted [Se] w.
  • the signatures focus on the call parameters of a method that are in order: the current object "this”, the arguments arg 1, ..., arg n and the return object returned by the method called "return".
  • the static exhaust analysis performed in the first DTA processing device can be performed as follows.
  • the static exhaust analysis establishes a graph of the control flow of the program and runs through this abstract representation of the program. A graph of the call methods and their interactions is thus established in order to perform an inter-method analysis and an execution graph of each method is established in order to perform an intra- method analysis.
  • Known methods for estimating control flow graphs of object-oriented languages can be used for this purpose.
  • the static exhaust analysis coordinates intra-method analysis and inter-method analysis. Indeed, to determine the behavior of a method m using another method m ', it is necessary to also study the behavior of this other method.
  • Object escape hypotheses are adopted at the beginning of the analysis (the initial hypotheses assume that all the objects are captured), then these hypotheses are updated incrementally during inter-method analysis. When the escape hypotheses converge to a fixed point, the static exhaust analysis is interrupted.
  • the analysis uses an abstract interpreter associating evaluation rules for each instruction of the program.
  • the abstract interpreter executes the instructions of the Java virtual machine by following the program's control flow.
  • Intra-method analysis evaluates the instructions of a method in isolation, method by method, without knowing the behavior of other methods.
  • the registers and cells of the stack manipulate values that are noted v. These values include both base types (integer, boolean ...) as well as object or table references.
  • v is thus defined as being the set of references contained in a register or cell of the stack at a point p of the execution of the program.
  • An alias analysis between the registers follows the contents of the registers at each point p of the execution of the program.
  • These references r come from allocations, and marked by the point of the program that created them r p .
  • an escape rule is associated at each instruction of the Java binary pseudo-code.
  • An allocation in p stacks on the stack a reference defined to captured r p : J .. (the sign J. will designate later the smallest element of the lattice is a reference defined as captured).
  • connection graph G is constructed which indicates the existing memory connections between the reference values manipulated by the program.
  • the data structure G makes it possible to process the assignments.
  • V be the set of values
  • P (V) is the set of parts of V.
  • the graph is updated during the putfield and aastore assignments by establishing a connection between the destination value Vd and the assigned value v a . This connection is added to those already existing since
  • Vd The areturn statement updates G to establish the escape signature on the parameter connections for the returned object.
  • G the values pointed by v denoted by G (v) are mounted in stack height.
  • Figure 3 illustrates escape rules on the pseudo-binary code
  • the intermethod analysis calculates a signature for each method that has undergone an intra-method analysis, this signature being valid whatever its context of call.
  • Inter-method analysis is a static analysis by abstract interpretation interacting with that of intra-method analysis.
  • the signature data are semi-lattices. Their structures are derived from those specified in the intra-method analysis.
  • the escape signature is defined as the smallest element of the lattice. Then, the inter-method algorithm processes the methods one after the other. For each method, an intra-method analysis is performed, the result of which gives the new escape signature.
  • the starting point of the intra-method analysis for a method m is based on its own Sem escapement signature:
  • FIGS. 5 and 6 illustrate the use of the static analysis rules, rules described with reference to FIG. 3, on each instruction of the methods of the associated Java pseudo-code.
  • the signature Se of the id () LC input method is: J. OL without connection.
  • the signature SE id () LC is J- OL with a connection re r tum to RTM S.
  • the right column shows the evolution of list L and connection graph G.
  • the signature Se of the facto ry () LC method taken as input is: J. OL without connection.
  • the analysis of the factory () LC milk method calls for the signature Se of id () LC.
  • the signature Se output of the method facto ry () LC is: -L OL without connection, the allocation of the point p 4 is non-escaped and that of the point p 0 is escaped.
  • escape signatures are thus obtained for at least some methods in step 202.
  • the escape signatures advantageously comprise escape information concerning various parameters: its arguments, its current object or its returned object.
  • An escape signature may thus include the following information:
  • escape definitions defining whether an object is captured by the method for all its parameters
  • a memory link reference defining whether, for each combination of two parameters defined in the signature, one refers to the other in the program. This information makes it possible to determine the following escape case: if an object is referenced by an escaping object, then it escapes as well.
  • Virtual method calls can make the prediction made during the improper static exhaust analysis. To remedy this, we generated for each method the direct escape signature Sem and the unified escape signature [Se] m.
  • the direct escape signature concerns an execution trace performed during the static analysis: this signature could be used by the second DCTL device if the type of the object is exact.
  • the type of the object is exact, if during its lifetime, its dynamic type is equal to its statistically declared type.
  • the unified escaping signature makes a prediction in the worst case, by unification of different possible execution traces: this escape signature can be used by the second device DCTL if, during a method call, the type of an object has varied since its creation. For example, the unified escape signature is generated by performing the unification of the direct escape signatures for all the methods that can be called at this point of the program. Thus, even if the unified escape signature does not correspond exactly to the execution conditions of the program, its escape indications are sufficiently approximate not to determine an erroneously captured object.
  • the unified escape signature is generated by browsing the inheritance tree and method overload. Of course, the use of the unified escape signature makes it possible to deduce a smaller number of captured objects than the use of the direct escape signature.
  • the DCTL device will use either one of the escape signatures based on the static calls declared in the pseudo-code or based on type information obtained from a pseudo-pseudo verification. code, as detailed later.
  • the skilled person will limit the number of methods to optimize to keep a program load of reasonable size. Thus, the skilled person can reserve the generation of escape signatures methods with the best optimization prospects during execution.
  • Step 203 comprises loading the program and escape signatures into the DCTL processing apparatus, a partial static exhaust analysis leading to the generation of test escape signatures and a consistency check between the signatures of loaded exhaust and test exhaust signatures.
  • Partial static analysis Exhaust uses the same exhaust analysis rules as those used in static DTA analysis.
  • the loaded escape signatures are used as assumptions for intra-method static escape analysis in step 204.
  • the loaded Sem' signature is used to continue the intra-method analysis on m.
  • step 205 is compared with the exhaust signature loaded at the test exhaust signature obtained. If all the escapements defined in the loaded signature are included in the set of escapements defined in the test signature Stm, it is considered that there is coherence between the loaded exhaust signature and the exhaust signature of test: the use of the loaded escape signature is not likely to erroneously determine an object as captured by the method. It is thus possible to check the integrity of the program and the loaded signatures.
  • the processing device DTA thus advantageously has treatment capacities that are significantly greater than those of the processing device DCTL.
  • Direct signatures concerning the methods of the program can be generated in the DTCL device by a pseudo-binary code verifier available where appropriate.
  • the verification can then be performed taking into account either the loaded direct escape signature or the unified escaped signature loaded.
  • an inconsistency is detected during the verification, it can be expected that the virtual machine blocks the further loading of the program, blocks the subsequent execution of the program or blocks the realization of a program optimization based on the escape signatures . Optimization may also be limited to methods for which the consistency check has yielded a favorable result.
  • loading will generally be performed from another machine on a production line.
  • the virtual machine of the processing device of the device DCTL exploits the loaded escape signatures in order to determine optimizations of the execution of the program.
  • the virtual machine can in particular determine, on the basis of the loaded escape signatures, the captured objects that can be managed in memory with a function different from the crumb management of the virtual machine.
  • the allocation and deallocation of stacked objects follows the stack of call methods.
  • the allocation of each captured object is at the top of the stack.
  • the deallocation is performed globally at the exit of the method in which the captured objects were allocated.
  • the virtual machine can still be used for eliminating synchronizations from escape signatures.
  • An object captured by a method is accessed by a single process, so it does not require access synchronization mechanisms (lock management and mutual exclusion mechanisms).
  • the elimination of synchronization eliminates the elements of unnecessary synchronization to optimize scheduling and concurrency management in the DCTL device.
  • the virtual machine executes the program taking into account the optimizations determined previously.

Abstract

The invention relates to an escape analysis method consisting in carrying out a static escape analysis on an intermediate execution language program for a virtual stack machine (201) in a first processing device and in generating escape signatures associated to the program methods according to escape rules (202), in loading the generated escape signatures and a program (203) in a second processing device provided with a virtual stack machine, in carrying out a partial escape static analysis (204) based on the loaded signatures, in generating test escape signatures according to said escape rules and in checking (205), for a given method, the coherence between the test and loaded escape signatures thereof. Said invention makes it possible, in particular, to limit an escape analysis carried out on a second device ensuring the integrity of the loaded program.

Description

ANALYSE D'ECHAPPEMENT DANS UN PROGRAMME EN LANGAGE ORIENTE OBJET POUR MACHINE VIRTUELLE A PILEEXHAUST ANALYSIS IN A PROGRAM IN ORIENTED LANGUAGE OBJECT FOR VIRTUAL MACHINE WITH BATTERY
L'invention concerne de façon générale les programmes informatiques, et en particulier les procédés d'analyse d'échappement dans les programmes en langage orienté objet pour machine virtuelle à pile.The invention relates generally to computer programs, and in particular to exhaust analysis methods in object-oriented programs for stacked virtual machines.
L'analyse d'échappement est effectuée sur un programme afin de déterminer la durée de vie d'objets. Une analyse d'échappement permet notamment des optimisations possibles lors de l'exécution, par exemple la gestion mémoire en pile d'objets ou une élimination de synchronisation.The exhaust analysis is performed on a program to determine the lifetime of objects. An escape analysis allows possible optimizations during execution, for example memory management in stack of objects or elimination of synchronization.
Une fonction de ramasse-miettes (désignée par le terme garbage collection en langue anglaise) est intégrée dans une machine virtuelle afin de récupérer des emplacements mémoire qui ont cessé d'être utilisés par un programme. Un ramasse-miettes balaye l'ensemble des emplacements mémoire qui ont été alloués à des objets dans un espace mémoire dédié. Des emplacements devenus inutilisés sont alors identifiés. Lorsqu'un objet n'est plus pointé par un quelconque autre objet, ses emplacements sont considérés comme inutilisés. Ces emplacements mémoire sont alors marqués pour pouvoir être réalloués à un autre processus du programme. La récupération de place mémoire requiert un nombre important d'opérations et la récupération de place mémoire par le ramasse-miettes peut alors occuper une partie excessive des capacités de traitement d'un dispositif à capacité de traitement limitée. Le temps requis pour la récupération de place dans une mémoire non volatile peut également être important, du fait de leur longue durée d'écriture.A garbage collection function (referred to as garbage collection in English) is integrated into a virtual machine to retrieve memory locations that have ceased to be used by a program. A garbage collector scans all the memory locations that have been allocated to objects in a dedicated memory space. Locations that have become unused are then identified. When an object is no longer pointed to by any other object, its locations are considered unused. These memory locations are then marked so that they can be reallocated to another process in the program. The recovery of memory space requires a large number of operations and the recovery of memory space by the garbage collector can then occupy an excessive portion of the processing capacity of a device with limited processing capacity. The time required for space recovery in a non-volatile memory can also be important, because of their long writing time.
L'objet de l'invention consiste à adapter les analyses d'échappement de programme dans le but de mettre en œuvre ce type d'analyse au moyen d'un dispositif dont les capacités de traitement ne lui permettent pas avec les techniques connues d'analyser l'intégralité des méthodes du programme. L'invention vise également à garantir l'intégrité du résultat de l'analyse d'échappement. L'invention porte ainsi sur un procédé d'analyse d'échappement, comprenant les étapes consistant à :The object of the invention is to adapt the program exhaust analyzes in order to implement this type of analysis by means of a device whose processing capacity does not allow it with the known techniques of analyze all the methods of the program. The invention also aims to guarantee the integrity of the result of the exhaust analysis. The invention thus relates to an exhaust analysis method, comprising the steps of:
- dans un premier dispositif de traitement, réaliser une analyse statique d'échappement sur un programme en langage intermédiaire d'exécution pour machine virtuelle à pile et générer des signatures d'échappement associées à des méthodes respectives du programme en fonction de règles d'échappement prédéterminées;in a first processing device, performing a static exhaust analysis on an intermediate runtime program for a stacked virtual machine and generating escape signatures associated with respective methods of the program according to escape rules predetermined;
- dans un second dispositif de traitement muni d'une machine virtuelle à pile : - charger les signatures d'échappement générées et le programme;in a second processing device equipped with a stack virtual machine: load the generated escape signatures and the program;
- réaliser une analyse statique d'échappement partielle basée sur les signatures chargées et générer, en fonction desdites règles d'échappement prédéterminées, des signatures d'échappement de test associées aux méthodes munies d'une signature d'échappement ; - pour une méthode donnée, vérifier la cohérence entre sa signature d'échappement de test et sa signature d'échappement chargée. Selon une variante, le deuxième dispositif de traitement utilisé est un dispositif à capacité de traitement limitée.performing a partial escape static analysis based on the loaded signatures and generating, according to said predetermined escape rules, test escape signatures associated with the methods provided with an escape signature; - for a given method, check the consistency between its test escape signature and its loaded escape signature. According to one variant, the second processing device used is a device with limited processing capacity.
Selon encore une variante, une signature d'échappement générée pour une méthode comprend des informations associées à ses paramètres tels que ses arguments, son objet courant et/ou son objet de retour.According to another variant, an escaping signature generated for a method includes information associated with its parameters such as its arguments, its current object and / or its return object.
Selon une autre variante, l'analyse statique d'échappement partielle et la vérification de cohérence sont réalisées après le chargement du programme dans le second dispositif de traitement. Selon encore une autre variante, le programme en langage intermédiaire d'exécution est sous forme de pseudo-code binaire Java ou CLI.According to another variant, the partial exhaust static analysis and the consistency check are performed after the loading of the program into the second processing device. According to yet another variant, the program in intermediate execution language is in the form of Java or CLI pseudo-binary code.
D'autres caractéristiques et avantages de l'invention ressortiront clairement de la description qui en est faite ci-après, à titre indicatif et nullement limitatif, en référence aux dessins annexés, dans lesquels : - la figure 1 illustre schématiquement deux dispositifs de traitement mis en œuvre dans l'invention ;Other characteristics and advantages of the invention will emerge clearly from the description which is given hereinafter, by way of indication and in no way limitative, with reference to the appended drawings, in which: - Figure 1 schematically illustrates two processing devices implemented in the invention;
- la figure 2 illustre les étapes de procédé d'analyse d'un programme selon l'invention ; - la figure 3 illustre des règles d'échappement sur des instructions d'un pseudo-code binaire Java ;FIG. 2 illustrates the process steps of analysis of a program according to the invention; FIG. 3 illustrates escape rules on instructions of a Java pseudo-binary code;
- les figures 4 à 6 illustrent un code Java et l'analyse statique d'échappement effectuée sur son équivalent en pseudo-code binaire;FIGS. 4 to 6 illustrate a Java code and the static exhaust analysis carried out on its pseudo-binary code equivalent;
- la figure 7 illustre une analyse statique et une vérification effectuées dans un dispositif de traitement chargeant le programme.FIG. 7 illustrates a static analysis and a verification carried out in a processing device loading the program.
On utilisera par la suite les notions suivantes :The following notions will be used later:
Un objet o est dit non échappé (ou capturé) par une méthode m dans laquelle il a été alloué seulement si sa durée de vie ne dépasse pas celle de la méthode m. Une allocation de o capturée peut être détruite sans risque à la sortie de cette méthode m. Les emplacements mémoire occupés par l'objet capturé o peuvent donc être libérés à la fin de l'exécution de la méthode m. Par opposition, un objet o échappé est un objet auquel il peut potentiellement être fait référence après la fin de l'exécution de la méthode m dans laquelle il a été alloué. Un dispositif à capacité de traitement limitée désignera un dispositif de traitement dont la capacité de traitement est insuffisante pour réaliser à lui seul l'analyse statique d'échappement sur l'intégralité du programme. Un dispositif à capacité de traitement limitée présentera par exemple une mémoire vive inférieure à 32 KiloOctets et une mémoire EEPROM inférieure à 512 KiloOctets.An object o is said to be unescaped (or captured) by a method m in which it has been allocated only if its lifetime does not exceed that of method m. A captured o allocation can be safely destroyed at the exit of this method m. The memory locations occupied by the captured object o can be released at the end of the execution of the method m. In contrast, an escaped object o is an object that can potentially be referenced after the completion of the method m in which it was allocated. A device with limited processing capacity will designate a processing device whose processing capacity is insufficient to carry out the static exhaust analysis on the entire program on its own. For example, a device with a limited processing capacity will have a RAM less than 32 kilobytes and an EEPROM of less than 512 kilobits.
L'invention propose un procédé d'analyse d'échappement dans lequel une analyse statique d'échappement est réalisée sur un programme en langage intermédiaire d'exécution pour machine virtuelle à pile, dans un premier dispositif de traitement. Des signatures d'échappement associées aux méthodes du programme sont générées selon des règles d'échappement prédéterminées. Le programme et les signatures d'échappement sont chargées dans un second dispositif de traitement et une analyse statique d'échappement partielle, basée sur les signatures d'échappement chargées est réalisée. Des signatures de test associées aux objets du programme chargé sont générées par les mêmes règles d'échappement prédéterminées. La cohérence entre les signatures d'échappement chargées et les signatures d'échappement de test est alors vérifiée. L'intégrité du programme chargé est ainsi vérifiée. Les signatures d'échappement chargées ne peuvent donc pas être frauduleusement utilisées pour contourner les règles de sécurité sur les références d'objets.The invention proposes an exhaust analysis method in which a static exhaust analysis is performed on an intermediate runtime program for a stacked virtual machine in a first processing device. Escape signatures associated with the program methods are generated according to predetermined escape rules. The program and the escape signatures are loaded into a second processing device and a partial exhaust static analysis, based on the loaded exhaust signatures is performed. Test signatures associated with the objects of the loaded program are generated by the same predetermined escape rules. The consistency between the loaded escape signatures and the test escape signatures is then checked. The integrity of the loaded program is thus verified. The loaded escape signatures can not be fraudulently used to circumvent security rules on object references.
L'invention propose un procédé d'analyse d'échappement réalisable sur une forme du programme habituellement disponible et limitant les ressources nécessaires pour effectuer la vérification de cohérence d'échappement.The invention provides an achievable exhaust analysis method on a form of the usually available program and limiting the resources required to perform the exhaust consistency check.
La figure 1 illustre un exemple de système mettant en œuvre l'invention. Un premier dispositif de traitement DTA est formé d'un ordinateur. Le dispositif DTA est connecté à un lecteur de carte à puce LEC, par l'intermédiaire duquel il peut communiquer avec le second dispositif de traitement DCTL formé d'une carte à puce. Le dispositif de traitement DTA dispose d'un programme en langage intermédiaire d'exécution, destiné à être soumis au procédé d'analyse statique d'échappement et à un chargement dans le dispositif DCTL.Figure 1 illustrates an exemplary system implementing the invention. A first processing device DTA is formed of a computer. The DTA device is connected to an LEC chip card reader, through which it can communicate with the second DCTL processing device formed of a smart card. The processing device DTA has a program in intermediate execution language, intended to be subjected to the method of static analysis of exhaust and loading into the device DCTL.
Un exemple de procédé mettant en œuvre l'invention est illustré en référence à la figure 2. L'analyse d'échappement sera illustrée sur les instructions de la machine virtuelle Java (en anglais nommé bytecode Java, décrites dans la spécification nommée « The Java Virtual Machine Spécification » écrite par Tim Lindholm et Frank Yellin aux éditions The Java Séries, Addison-Wesley (1ère éd.) en 1996).An example of a method embodying the invention is illustrated with reference to FIG. 2. The exhaust analysis will be illustrated on the instructions of the Java virtual machine (in English named bytecode Java, described in the specification named "The Java Virtual Machine Specification "written by Tim Lindholm and Frank Yellin at The Java Series editions, Addison-Wesley (1st ed.) In 1996).
A l'étape 201, le premier dispositif de traitement DTA réalise une analyse statique d'échappement sur le programme sous sa forme de pseudo-code binaire. L'analyse statique d'échappement a pour objectif de déterminer la durée de vie d'objets et vise à générer des signatures d'échappement résumant les comportements d'échappement. Pour chaque méthode m on génère deux signatures d'échappement, l'une nommée directe et notée Se»î et une seconde nommée unifiée et notée [Se]w. Les signatures se focalisent sur les paramètres d'appels d'une méthode qui sont dans l'ordre : l'objet courant « this », les arguments arg 1 , ... , arg n ainsi que l'objet de retour retourné par la méthode que l'on nomme « return ».In step 201, the first processing device DTA performs a static exhaust analysis on the program in the form of pseudo-binary code. The static exhaust analysis aims to determine the lifetime of objects and aims to generate escape signatures summarizing the escape behaviors. For each method m we generate two escape signatures, one named direct and noted Se "1 and a second named unified and noted [Se] w. The signatures focus on the call parameters of a method that are in order: the current object "this", the arguments arg 1, ..., arg n and the return object returned by the method called "return".
L'analyse statique d'échappement réalisée dans le premier dispositif de traitement DTA peut être réalisée comme suit. L'analyse statique d'échappement établit un graphe du flot de contrôle du programme et parcourt cette représentation abstraite du programme. Un graphe des méthodes d'appels et de leurs interactions est ainsi établi afin de réaliser une analyse inter-méthodes et un graphe d'exécution de chaque méthode est établi afin de réaliser une analyse intra- méthodes. Des procédés connus d'estimation de graphe de flot de contrôle de langages orientés objets peuvent être utilisés à cet effet. L'analyse statique d'échappement coordonne une analyse intra-méthodes et une analyse inter-méthodes. En effet, pour déterminer le comportement d'une méthode m faisant appel à une autre méthode m', il est nécessaire d'étudier également le comportement de cette autre méthode. Des hypothèses d'échappement d'objets sont adoptées en début d'analyse (les hypothèses de départ supposeront que tous les objets sont capturés), puis ces hypothèses sont mises à jour de façon incrémentale durant l'analyse inter-méthodes. Lorsque les hypothèses d'échappement convergent vers un point fixe, l'analyse statique d'échappement est interrompue.The static exhaust analysis performed in the first DTA processing device can be performed as follows. The static exhaust analysis establishes a graph of the control flow of the program and runs through this abstract representation of the program. A graph of the call methods and their interactions is thus established in order to perform an inter-method analysis and an execution graph of each method is established in order to perform an intra- method analysis. Known methods for estimating control flow graphs of object-oriented languages can be used for this purpose. The static exhaust analysis coordinates intra-method analysis and inter-method analysis. Indeed, to determine the behavior of a method m using another method m ', it is necessary to also study the behavior of this other method. Object escape hypotheses are adopted at the beginning of the analysis (the initial hypotheses assume that all the objects are captured), then these hypotheses are updated incrementally during inter-method analysis. When the escape hypotheses converge to a fixed point, the static exhaust analysis is interrupted.
On va par la suite détailler l'analyse intra-méthode réalisée. L'analyse utilise un interpréteur abstrait associant des règles d'évaluation pour chaque instruction du programme. L'interpréteur abstrait exécute les instructions de la machine virtuelle Java en suivant le flot de contrôle du programme. L'analyse intra-méthode évalue les instructions d'une méthode de manière isolée, méthode par méthode, sans avoir connaissance du comportement des autres méthodes. L'interpréteur peut être représenté par un ensemble de relations de transition : i : (R, P) => (R', P') où i est l'instruction évaluée, R et P représentent respectivement la valeur des registres et de la pile avant l'exécution de i, et R' et P' leur valeur après son exécution. Par simplification les registres et les cellules de la pile manipulent des valeurs que l'on note v. Ces valeurs regroupent à la fois les types de bases (entier, booléen...) ainsi que les références d'objets ou de tableaux.We will then detail the intra-method analysis performed. The analysis uses an abstract interpreter associating evaluation rules for each instruction of the program. The abstract interpreter executes the instructions of the Java virtual machine by following the program's control flow. Intra-method analysis evaluates the instructions of a method in isolation, method by method, without knowing the behavior of other methods. The interpreter can be represented by a set of transition relations: i: (R, P) => (R ', P') where i is the evaluated instruction, R and P respectively represent the value of the registers and the stack before the execution of i, and R 'and P' their value after its execution. For simplification, the registers and cells of the stack manipulate values that are noted v. These values include both base types (integer, boolean ...) as well as object or table references.
Par exemple, l'instruction aload_k duplique le contenu du registre k en sommet de pile : aloacLk : (R{k = v}, P) => (R{k = v}, P.v)For example, the instruction aload_k duplicates the contents of the register k at the top of the stack: aloacLk: (R {k = v}, P) => (R {k = v}, P.v)
Après exécution de l'instruction, le registre Rk et le sommet de pile contiennent donc la même valeur v. L'instruction inverse, astore_k, dépile la valeur v en sommet de pile pour la placer dans le registre k : astore.k : (R, P.v) => (R{k - v}, P)After executing the statement, the register Rk and the stack vertex therefore contain the same value v. The inverse statement, astore_k, unpacks the value v at the top of the stack to place it in the register k: astore.k: (R, P.v) => (R {k - v}, P)
v est ainsi défini comme étant l'ensemble des références contenues dans un registre ou une cellule de la pile en un point p de l'exécution du programme. Une analyse d'alias entre les registres suit le contenu des registres en chaque point p de l'exécution du programme. Ces références r sont issues des allocations, et marquées par le point du programme qui les ont créées rp. À chaque instruction du pseudo-code binaire Java, une règle d'échappement est associée. Une allocation en p empile sur la pile une référence définie à capturée rp : J.. (le signe J. désignera par la suite le plus petit élément du treillis soit une référence définie comme capturée). new : (R, P) => (R, P.v) tel que v = {rp} et rp : _L Une instruction a potentiellement plusieurs prédécesseurs. Ainsi, l'état des registres et de la pile avant évaluation de i est l'union (notée u) des états des prédécesseurs de i après leur évaluation. Si on désigne instr(p) pour l'instruction au point de programme p, in(p) l'état avant et out(p) celui après, le système d'équations de l'analyse d'échappement pour chaque point p du programme est le suivant : instr(p) : in(p) => out(p) in(p) = u(out(q)), q étant un prédécesseur de p ;v is thus defined as being the set of references contained in a register or cell of the stack at a point p of the execution of the program. An alias analysis between the registers follows the contents of the registers at each point p of the execution of the program. These references r come from allocations, and marked by the point of the program that created them r p . At each instruction of the Java binary pseudo-code, an escape rule is associated. An allocation in p stacks on the stack a reference defined to captured r p : J .. (the sign J. will designate later the smallest element of the lattice is a reference defined as captured). new: (R, P) => (R, Pv) such that v = {r p } and r p : _L An instruction has potentially several predecessors. Thus, the state of the registers and the stack before evaluation of i is the union (denoted u) of the states of the predecessors of i after their evaluation. If we designate instr (p) for the instruction at the program point p, in (p) the state before and out (p) that after, the system of equations of the exhaust analysis for each point p of the The program is: instr (p): in (p) => out (p) in (p) = u (out (q)), q being a predecessor of p;
avec comme point de départ pour in(po) les données de la signature d'échappement Sem (échappement des paramètres d'appels et connexion entre paramètres d'appels).with as starting point for in (po) the data of the escape signature Sem (escape of call parameters and connection between call parameters).
L'unification de deux valeurs v U v' est l'union de leur ensemble, sans doublons. Les équations sont ensuite résolues par un algorithme standard itératif jusqu'à atteinte du point fixe. Par simplification, une liste globale des valeurs L issues des allocations est maintenue pendant l'analyse (au départ de l'analyse, cette liste est définie à vide). Lorsque la référence d'une allocation s'échappe, elle est enlevée de la liste. L correspond alors à l'ensemble des références capturées LThe unification of two values v U v 'is the union of their set, without duplicates. The equations are then solved by a standard iterative algorithm until the fixed point is reached. For simplicity, a global list of the values L resulting from the allocations is maintained during the analysis (at the beginning of the analysis, this list is defined empty). When the reference of an allocation escapes, it is removed from the list. L then corresponds to all the references captured L
= {rp I rp : J.}. Selon une optimisation détaillée ultérieurement, les allocations correspondantes à ces références peuvent être gérées par une gestion en pile.= {r p I r p : J.}. According to a detailed optimization later, the allocations corresponding to these references can be managed by stack management.
En plus des registres et de la pile, on construit un graphe de connexion G qui indique les connexions mémoires existantes entre les valeurs références manipulées par le programme. La structure de données G permet de traiter les affectations. Soit V l'ensemble des valeurs, on définit G tel que G : V → P(V) où P(V) est l'ensemble des parties de V. Le graphe est mis à jour lors des affectations putfield et aastore en établissant une connexion entre la valeur destination Vd et la valeur affectée va. Cette connexion est rajoutée à celles déjà existantes depuisIn addition to the registers and the stack, a connection graph G is constructed which indicates the existing memory connections between the reference values manipulated by the program. The data structure G makes it possible to process the assignments. Let V be the set of values, we define G such that G: V → P (V) where P (V) is the set of parts of V. The graph is updated during the putfield and aastore assignments by establishing a connection between the destination value Vd and the assigned value v a . This connection is added to those already existing since
Vd. L'instruction areturn met à jour G afin d'établir la signature d'échappement sur les connexions entre paramètres pour l'objet retourné. En ce qui concerne la lecture d'un champ d'objet ou d'une cellule de tableau, instructions getfield et aaload, les valeurs pointées par v notées G(v) sont montées en somment de pile. L'échappement d'une valeur v lors de l'évaluation d'une instruction i est désignée par esc(v) = T telle que V rp e v, rp = T. De plus, l'échappement d'une valeur v lait échapper par atteignabilité toutes les valeurs accessibles depuis v telle que esc(G(v)) = T. La figure 3 illustre des règles d'échappement sur le pseudo-code binaireVd. The areturn statement updates G to establish the escape signature on the parameter connections for the returned object. With regard to reading an object field or a table cell, getfield and aaload instructions, the values pointed by v denoted by G (v) are mounted in stack height. The escape of a value v during the evaluation of an instruction i is denoted by esc (v) = T such that V r p ev, r p = T. In addition, the escape of a value v milk escape by reachability all values accessible from v such that esc (G (v)) = T. Figure 3 illustrates escape rules on the pseudo-binary code
Java appliqué à un certain nombre d'instructions et permettant de générer les signatures d'échappement Sem et [Se]w.Java applied to a number of instructions and used to generate the Sem and [Se] w escape signatures.
Quelles que soient les informations de l'analyse intra-méthode, le fonctionnement de l'analyse inter-méthodes est similaire. L'analyse interméthodes calcule une signature pour chaque méthode ayant subi une analyse intra-méthode, cette signature étant valable quel que soit son contexte d'appel. L'analyse inter-méthodes est une analyse statique par interprétation abstraite interagissant avec celle de l'analyse intra-méthode. Les données des signatures sont des semi-treillis. Leurs structures sont issues de celles spécifiées dans l'analyse intra-méthode. Pour la génération des signatures, au départ, on définit la signature d'échappement au plus petit élément du treillis. Ensuite, l'algorithme inter-méthodes traite les méthodes les unes après les autres. Pour chaque méthode, on effectue une analyse intra-méthode dont le résultat permet de donner la nouvelle signature d'échappement.Whatever the information of the intra-method analysis, the operation of the inter-method analysis is similar. The intermethod analysis calculates a signature for each method that has undergone an intra-method analysis, this signature being valid whatever its context of call. Inter-method analysis is a static analysis by abstract interpretation interacting with that of intra-method analysis. The signature data are semi-lattices. Their structures are derived from those specified in the intra-method analysis. For signature generation, at the outset, the escape signature is defined as the smallest element of the lattice. Then, the inter-method algorithm processes the methods one after the other. For each method, an intra-method analysis is performed, the result of which gives the new escape signature.
Lors d'une analyse intra-méthode de m, soit in(Se»î) sa signature en entrée et 0Ut(Se»î) celle en sortie, si in(Se»î) C out(Se»î) (au moins un des paramètres de la signature a progressé dans son semi-treillis) alors une seconde analyse intra- méthode doit être effectuée sur m ainsi que sur les méthodes appelant m. Ainsi, tant que le point fixe global des signatures n'est pas atteint, on continue l'analyse inter-méthodes. L'interaction entre les analyses inter-méthodes et intra-méthode permet de générer le point fixe des signatures d'échappement Sem et [Se]w.In an intra-method analysis of m, let in (Se ") be its input signature and 0Ut (Se") that output, if in (Se ") C out (Se") (at least one of the parameters the signature has progressed in its semi-lattice) then a second intra- method analysis must be performed on m as well as on the methods calling m. Thus, as long as the global fixed point of the signatures is not reached, the inter-method analysis is continued. The interaction between the inter-method and intra-method analyzes makes it possible to generate the fixed point of the Sem and [Se] w escape signatures.
On va maintenant définir la signature d'échappement sur les paramètres d'appels. Soit Sem ' la signature d'échappement de la méthode m' appelée pendant l'analyse de m. On définit cette première signature sur les paramètres d'appels par :We will now define the escape signature on the call parameters. Let Sem 'the escape signature of the method m' called during the analysis of m. This first signature is defined on the call parameters by:
T si vPar_k s'échappe par m ' VkeO...n-l Sem (vpar k) =T if v P ar_k escapes by m 'VkeO ... nl Sem (v by k) =
-L sinon-L otherwise
Le point de départ de l'analyse intra-méthode pour une méthode m se base sur sa propre signature d'échappement Sem :The starting point of the intra-method analysis for a method m is based on its own Sem escapement signature:
în(po) = ((Vpar_0 , ..., Vpar_n-1 , Ve, ..., Ve), e) tel que esc(vpar_k) = Se»î(vPar_k) pour k = 0...n - 1 et esc(ve) = _L avec VPar_k = {rPar_k} θt Ve = {} où rpar_k symbolise la référence passée en argument qui est encapsulée dans la structure de valeur afin d'effectuer l'analyse d'alias sur les registres. Au départ, chacune de ses références symboliques sur les paramètres est ajoutée à la liste L. À la fin d'une passe d'analyse intra-méthode, les paramètres restant dans la liste L servent à mettre à jour la nouvelle signature. Lors d'un appel de méthode, on applique une signature d'échappement sur les arguments de la pile.In (po) = ((Vpar_0, ..., V pa r_n-1, V e , ..., V e ), e) such that esc (v pa r_k) = S "(v P ar_k) for k = 0 ... n - 1 and esc (v e ) = _L with V P ar_k = {r P ar_k} θt V e = {} where r pa r_k symbolizes the passed reference in argument which is encapsulated in the structure of value to perform alias analysis on the registers. Initially, each of its symbolic references on the parameters is added to the list L. At the end of an intra-method analysis pass, the parameters remaining in the list L serve to update the new signature. During a method call, an escape signature is applied to the arguments of the stack.
Lorsque l'on connaît avec exactitude la méthode appelée (invokespecial et invokestatic) la signature calculée Sem' est appliquée sur les éléments de la pile. Dans le cas des méthodes virtuelles (invokevirtual et invokei interface), on applique la signature unifiée notée [Sé\m ' ' calculées depuis les signatures des méthodes m" appelables telle que :When one knows exactly the method called (invokespecial and invokestatic) the calculated signature Sem 'is applied on the elements of the stack. In the case of virtual methods (invokevirtual and invokei interface), we apply the unified signature noted [Se \ m '' computed from the signatures of the m "callable methods such as:
[Se]m '(Vpar_k) = U m » appleables Sθ»î ' '(vpar_k)[Se] m '(Vpar_k) = U m » appliables Sθ» i''(v by _k)
On va maintenant définir la signature d'échappement sur les connexions entre les paramètres d'appels. Cette signature sur les connexions entre les paramètres étend la signature précédente sur l'échappement des paramètres. Cette signature expose en dehors d'une méthode m les connexions entre les paramètres d'appels établies pendant l'analyse intra-méthode :We will now define the escape signature on the connections between the call parameters. This signature on the connections between the parameters extends the previous signature on the escaping parameters. This signature exposes outside a method m the connections between the call parameters established during the intra-method analysis:
T si il existe une connexion entre vpar k et vpar j VkjeO...n-l Sewî '(G(vpar k, vparj)) =T if there is a connection between v by k and v by j VkjeO ... nl Sewi '(G (v by k, v pa rj)) =
-L sinon-L otherwise
Le point de départ de l'analyse intra-méthode devient : in(po) = ((vpar_o , ..., vpar_n-i , ve, ..., ve), e) tel que esc(vpar_k) = Sewî(vpar_k) pour kj = O...n - 1 et esc(ve) = J. avec vpar_k = {rpar_k} , ve = {} et G(rpar_k)={rparj} lorsqueThe starting point of the intra-method analysis becomes: in (po) = ((v by _o, ..., v by _ n -i, v e , ..., v e ), e) such that esc (v by _k) = Sewî (v by _k) for kj = O ... n - 1 and esc (v e ) = J. with v by _k = {r by _k}, v e = {} and G (r by _k) = {r by j} when
Sew(G(vpar_k, vparj))= TSew (G (v by _k, v by j)) = T
La figure 4 illustre un exemple de code Java dans lequel l'allocation au point 1. est échappée et dont l'allocation au point 2. est non échappée. Les figures 5 et 6 illustrent l'utilisation des règles d'analyse statique, règles décrites en liaison avec la figure 3, sur chaque instruction des méthodes du pseudo-code Java associé.Figure 4 illustrates an example of Java code in which the allocation at point 1. is escaped and whose allocation at point 2. is not escaped. FIGS. 5 and 6 illustrate the use of the static analysis rules, rules described with reference to FIG. 3, on each instruction of the methods of the associated Java pseudo-code.
La signature Se de la méthode id()LC prise en entrée est : J. O-L sans connexion. A la sortie, la signature Se de id()LC vaut J- O-L avec une connexion de rretum vers rtMS. La colonne de droite indique l'évolution de la liste L et du graphe de connexion G. La signature Se de la méthode facto ry() LC prise en entrée est : J. O-L sans connexion. L'analyse de la méthode factory()LC lait appel à la signature Se de id()LC. La signature Se de sortie de la méthode facto ry() LC vaut : -L O-L sans connexion, l'allocation du point p4 est non-échappée et celle du point p0 est échappée. En effet, au moment de l'instruction areturn lors de l'appel à la méthode id()LC au point p10, la référence rinVOke_pio s'échappe et par atteignabilité, G(invoke_pio) ={rp0}fait échapper rp0.The signature Se of the id () LC input method is: J. OL without connection. At the output, the signature SE id () LC is J- OL with a connection re r tum to RTM S. The right column shows the evolution of list L and connection graph G. The signature Se of the facto ry () LC method taken as input is: J. OL without connection. The analysis of the factory () LC milk method calls for the signature Se of id () LC. The signature Se output of the method facto ry () LC is: -L OL without connection, the allocation of the point p 4 is non-escaped and that of the point p 0 is escaped. Indeed, at the moment of the instruction areturn during the call to the id () LC method at the point p 10 , the reference rin VO ke_pio escapes and by reachability, G (invoke_pio) = {r p0 } makes escape r p0 .
Suite à l'analyse d'échappement, des signatures d'échappement sont ainsi obtenues pour au moins certaines méthodes à l'étape 202.Following the exhaust analysis, escape signatures are thus obtained for at least some methods in step 202.
Comme détaillé dans les exemples ci-dessus, pour une méthode prédéterminée, les signatures d'échappement comprennent avantageusement des informations d'échappement concernant différents paramètres: ses arguments, son objet courant ou son objet renvoyé. Une signature d'échappement peut ainsi comprendre les informations suivantes :As detailed in the examples above, for a predetermined method, the escape signatures advantageously comprise escape information concerning various parameters: its arguments, its current object or its returned object. An escape signature may thus include the following information:
- des définitions d'échappement définissant si un objet est capturé par la méthode pour tous ses paramètres ;escape definitions defining whether an object is captured by the method for all its parameters;
- une référence de liaison mémoire définissant si, pour chaque combinaison de deux paramètres définis dans la signature, l'un fait référence à l'autre dans le programme. Ces informations permettent de déterminer le cas d'échappement suivant : si un objet est référencé par un objet s'échappant, alors il s'échappe également.a memory link reference defining whether, for each combination of two parameters defined in the signature, one refers to the other in the program. This information makes it possible to determine the following escape case: if an object is referenced by an escaping object, then it escapes as well.
Les appels de méthodes virtuelles peuvent rendre la prédiction effectuée durant l'analyse statique d'échappement peu précise. Pour remédier à cela, on a généré pour chaque méthode la signature d'échappement directe Sem et la signature d'échappement unifiée [Se] m.Virtual method calls can make the prediction made during the improper static exhaust analysis. To remedy this, we generated for each method the direct escape signature Sem and the unified escape signature [Se] m.
La signature d'échappement directe concerne une trace d'exécution effectuée durant l'analyse statique: cette signature pourra être utilisée par le second dispositif DCTL si le type de l'objet est exact. Le type de l'objet est exact, si au cours de sa durée de vie, son type dynamique est égal à son type déclaré statistiquement.The direct escape signature concerns an execution trace performed during the static analysis: this signature could be used by the second DCTL device if the type of the object is exact. The type of the object is exact, if during its lifetime, its dynamic type is equal to its statistically declared type.
La signature d'échappement unifiée réalise une prédiction au pire cas, par unification de différentes traces d'exécution possibles : cette signature d'échappement pourra être utilisée par le second dispositif DCTL si, lors d'un appel de méthode, le type d'un objet a varié depuis sa création. La signature d'échappement unifiée est par exemple générée en réalisant l'unification des signatures d'échappement directes pour l'ensemble des méthodes appelables en ce point du programme. Ainsi, même si la signature d'échappement unifiée ne correspond pas précisément aux conditions d'exécution du programme, ses indications d'échappement sont suffisamment approchées pour ne pas déterminer un objet capturé de façon erronée. La signature d'échappement unifiée est générée en parcourant l'arborescence d'héritage et la surcharge de méthode. Bien entendu, l'utilisation de la signature d'échappement unifiée permet de déduire un nombre plus réduit d'objets capturés par rapport à l'utilisation de la signature d'échappement directe. Lors de l'exécution, le dispositif DCTL utilisera soit l'une ou l'autre des signatures d'échappement en fonction des appels statiques déclarés dans le pseudo-code ou en fonction d'informations de type obtenues d'un vérifieur de pseudo-code, comme détaillé ultérieurement.The unified escaping signature makes a prediction in the worst case, by unification of different possible execution traces: this escape signature can be used by the second device DCTL if, during a method call, the type of an object has varied since its creation. For example, the unified escape signature is generated by performing the unification of the direct escape signatures for all the methods that can be called at this point of the program. Thus, even if the unified escape signature does not correspond exactly to the execution conditions of the program, its escape indications are sufficiently approximate not to determine an erroneously captured object. The unified escape signature is generated by browsing the inheritance tree and method overload. Of course, the use of the unified escape signature makes it possible to deduce a smaller number of captured objects than the use of the direct escape signature. At runtime, the DCTL device will use either one of the escape signatures based on the static calls declared in the pseudo-code or based on type information obtained from a pseudo-pseudo verification. code, as detailed later.
L'homme du métier saura limiter le nombre de méthodes à optimiser pour conserver un programme à charger de taille raisonnable. Ainsi, l'homme du métier pourra réserver la génération de signatures d'échappement aux méthodes présentant les meilleures perspectives d'optimisation lors de l'exécution.The skilled person will limit the number of methods to optimize to keep a program load of reasonable size. Thus, the skilled person can reserve the generation of escape signatures methods with the best optimization prospects during execution.
L'étape 203 comprend un chargement du programme et des signatures d'échappement dans le dispositif de traitement DCTL, une analyse statique partielle d'échappement conduisant à la génération de signatures d'échappement de test et une vérification de cohérence entre les signatures d'échappement chargées et les signatures d'échappement de test. L'analyse statique partielle d'échappement utilise les mêmes règles d'analyse d'échappement que celles utilisées dans l'analyse statique du dispositif DTA.Step 203 comprises loading the program and escape signatures into the DCTL processing apparatus, a partial static exhaust analysis leading to the generation of test escape signatures and a consistency check between the signatures of loaded exhaust and test exhaust signatures. Partial static analysis Exhaust uses the same exhaust analysis rules as those used in static DTA analysis.
Comme illustré à la figure 7, pour effectuer la vérification de cohérence d'échappement, les signatures d'échappement chargées sont utilisées comme hypothèses pour une analyse statique d'échappement intra-méthode à l'étape 204.As illustrated in FIG. 7, to perform the escape coherency check, the loaded escape signatures are used as assumptions for intra-method static escape analysis in step 204.
Lors de l'analyse intra-méthode de la méthode m, sa signature chargée est utilisée comme sa signature en entrée in(Se»î) est prise en entrée et la signatureDuring the intra-method analysis of the method m, its loaded signature is used as its input signature in (Se ") is taken as input and the signature
Figure imgf000015_0001
est obtenue en sortie comme signature de test. Lors d'un appel à la méthode m ', la signature Sem ' chargée est utilisée pour poursuivre l'analyse intra-méthode sur m.
Figure imgf000015_0001
is output as the test signature. When calling the method m ', the loaded Sem' signature is used to continue the intra-method analysis on m.
On compare alors à l'étape 205 la signature d'échappement chargée à la signature d'échappement de test obtenue. Si l'ensemble des échappements définis dans la signature chargée est inclus dans l'ensemble des échappements de définis dans la signature de test Stm, on considère qu'il y a cohérence entre la signature d'échappement chargée et la signature d'échappement de test : l'utilisation de la signature d'échappement chargée ne risque pas de déterminer de façon erronée un objet comme capturé par la méthode. On peut ainsi vérifier l'intégrité du programme et des signatures chargées.Then, step 205 is compared with the exhaust signature loaded at the test exhaust signature obtained. If all the escapements defined in the loaded signature are included in the set of escapements defined in the test signature Stm, it is considered that there is coherence between the loaded exhaust signature and the exhaust signature of test: the use of the loaded escape signature is not likely to erroneously determine an object as captured by the method. It is thus possible to check the integrity of the program and the loaded signatures.
Comme seule l'analyse intra-méthode est effectuée par le dispositif DCTL, la quantité de ressources dont il doit disposer pour mettre en œuvre l'analyse statique partielle et la vérification de cohérence d'échappement peut être limitée. L'intégrité du programme peut donc être vérifiée dans un temps raisonnable même avec un dispositif à ressources limitées, tel qu'une carte à puce. Le dispositif de traitement DTA présente ainsi avantageusement des capacités de traitement nettement supérieures à celles du dispositif de traitement DCTL.Since only the intra-method analysis is performed by the DCTL, the amount of resources it needs to implement the partial static analysis and the exhaust consistency check can be limited. The integrity of the program can therefore be verified in a reasonable time even with a device with limited resources, such as a smart card. The processing device DTA thus advantageously has treatment capacities that are significantly greater than those of the processing device DCTL.
Des signatures directes concernant les méthodes du programme peuvent être générées dans le dispositif DTCL par un vérifieur de pseudo-code binaire disponible le cas échéant. La vérification peut alors être effectuée en prenant en compte soit la signature d'échappement directe chargée, soit la signature d'échappement unifiée chargée. Lorsqu'une incohérence est détectée lors de la vérification, on peut prévoir que la machine virtuelle bloque la poursuite du chargement du programme, bloque l'exécution ultérieure du programme ou bloque la réalisation d'une optimisation du programme basée sur les signatures d'échappement. On peut également envisager de limiter l'optimisation aux méthodes pour lesquelles la vérification de cohérence a donné un résultat favorable.Direct signatures concerning the methods of the program can be generated in the DTCL device by a pseudo-binary code verifier available where appropriate. The verification can then be performed taking into account either the loaded direct escape signature or the unified escaped signature loaded. When an inconsistency is detected during the verification, it can be expected that the virtual machine blocks the further loading of the program, blocks the subsequent execution of the program or blocks the realization of a program optimization based on the escape signatures . Optimization may also be limited to methods for which the consistency check has yielded a favorable result.
Bien qu'il soit possible de réaliser la vérification de cohérence d'échappement lors de l'exécution du programme, on privilégiera en pratique une vérification de cohérence d'échappement réalisée durant ou juste après le chargement du programme dans le dispositif de traitement DCTL.Although it is possible to perform the escape coherency check during the execution of the program, in practice an escape consistency check performed during or just after the loading of the program in the DCTL processing device will be preferred.
Bien qu'on ait représenté un chargement du programme depuis le dispositif de traitement réalisant la première analyse statique d'échappement, le chargement sera généralement effectué depuis une autre machine sur une ligne de fabrication.Although a loading of the program has been shown from the processing device performing the first static exhaust analysis, loading will generally be performed from another machine on a production line.
A l'issue du procédé selon l'invention, la machine virtuelle du dispositif de traitement du dispositif DCTL exploite les signatures d'échappement chargées afin de déterminer des optimisations de l'exécution du programme.At the end of the method according to the invention, the virtual machine of the processing device of the device DCTL exploits the loaded escape signatures in order to determine optimizations of the execution of the program.
La machine virtuelle peut notamment déterminer, sur la base des signatures d'échappement chargées, les objets capturés qui pourront être gérés en mémoire avec une fonction différente de la gestion par ramasse-miettes de la machine virtuelle. Afin d'alléger la gestion mémoire, on peut notamment prévoir de gérer ces objets par allocation en pile. L'allocation et la désallocation des objets capturés en pile suit la pile des méthodes d'appel. L'allocation de chaque objet capturé se fait en sommet de pile. La désallocation est effectuée de façon globale à la sortie de la méthode dans laquelle les objets capturés ont été alloués.The virtual machine can in particular determine, on the basis of the loaded escape signatures, the captured objects that can be managed in memory with a function different from the crumb management of the virtual machine. In order to lighten memory management, it is possible in particular to manage these objects by stack allocation. The allocation and deallocation of stacked objects follows the stack of call methods. The allocation of each captured object is at the top of the stack. The deallocation is performed globally at the exit of the method in which the captured objects were allocated.
La machine virtuelle peut encore être utilisée pour l'élimination de synchronisations à partir des signatures d'échappement. Un objet capturé par une méthode étant accédé par un unique processus, il ne nécessite alors pas de mécanismes de synchronisation d'accès (gestion de verrous et de mécanismes d'exclusion mutuelle). L'élimination de synchronisation élimine les éléments de synchronisation inutiles afin d'optimiser la gestion de l'ordonnancement et de la concurrence d'accès dans le dispositif DCTL.The virtual machine can still be used for eliminating synchronizations from escape signatures. An object captured by a method is accessed by a single process, so it does not require access synchronization mechanisms (lock management and mutual exclusion mechanisms). The elimination of synchronization eliminates the elements of unnecessary synchronization to optimize scheduling and concurrency management in the DCTL device.
La machine virtuelle réalise l'exécution du programme en prenant en compte les optimisations déterminées précédemment. The virtual machine executes the program taking into account the optimizations determined previously.

Claims

REVENDICATIONS
1. Procédé d'analyse d'échappement, caractérisé en ce qu'il comprend les étapes consistant à : - dans un premier dispositif de traitement, réaliser une analyse statique d'échappement sur un programme en langage intermédiaire d'exécution pour machine virtuelle à pile (201) et générer des signatures d'échappement associées à des méthodes respectives du programme en fonction de règles d'échappement prédéterminées (202) ;An exhaust analysis method, characterized in that it comprises the steps of: in a first processing device, performing a static exhaust analysis on a program in intermediate execution language for virtual machine to stack (201) and generating escape signatures associated with respective methods of the program according to predetermined escape rules (202);
- dans un second dispositif de traitement muni d'une machine virtuelle à pile :in a second processing device equipped with a battery virtual machine:
- charger les signatures d'échappement générées et le programme (203); - réaliser une analyse statique d'échappement partielle (204) basée sur les signatures chargées et générer, en fonction desdites règles d'échappement prédéterminées, des signatures d'échappement de test associées aux méthodes munies d'une signature d'échappement ; - pour une méthode donnée, vérifier (205) la cohérence entre sa signature d'échappement de test et sa signature d'échappement chargée.- load the generated escape signatures and the program (203); performing a partial escape static analysis (204) based on the loaded signatures and generating, based on said predetermined escape rules, test escape signatures associated with the methods provided with an escape signature; for a given method, checking (205) the consistency between its test escape signature and its loaded escape signature.
2. Procédé selon la revendication 1, dans lequel le deuxième dispositif de traitement utilisé est un dispositif à capacité de traitement limitée.2. Method according to claim 1, wherein the second processing device used is a device with limited processing capacity.
3. Procédé selon la revendication 1 ou 2, dans lequel une signature d'échappement générée pour une méthode comprend des informations associées à ses paramètres tels que ses arguments, son objet courant et/ou son objet de retour. The method of claim 1 or 2, wherein an escape signature generated for a method includes information associated with its parameters such as its arguments, its current object and / or its return object.
4. Procédé selon l'une quelconque des revendications précédentes, dans lequel l'analyse statique d'échappement partielle et la vérification de cohérence sont réalisées après le chargement du programme dans le second dispositif de traitement.A method as claimed in any one of the preceding claims, wherein the partial escape static analysis and the consistency check are performed after the program has been loaded into the second processing device.
5. Procédé selon l'une quelconque des revendications précédentes, dans lequel le programme en langage intermédiaire d'exécution est sous forme de pseudo-code binaire Java ou CLI. 5. Method according to any one of the preceding claims, wherein the program in intermediate execution language is in the form of Java or CLI pseudo-binary code.
PCT/EP2006/050350 2005-01-21 2006-01-20 Escape analysis in an object oriented language program for a virtual stack machine WO2006077252A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
FR0500678A FR2881240B1 (en) 2005-01-21 2005-01-21 EXHAUST ANALYSIS IN A PROGRAM IN ORIENTED LANGUAGE OBJECT FOR VIRTUAL MACHINE WITH BATTERY
FR0500678 2005-01-21

Publications (2)

Publication Number Publication Date
WO2006077252A2 true WO2006077252A2 (en) 2006-07-27
WO2006077252A3 WO2006077252A3 (en) 2008-06-26

Family

ID=35063188

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2006/050350 WO2006077252A2 (en) 2005-01-21 2006-01-20 Escape analysis in an object oriented language program for a virtual stack machine

Country Status (2)

Country Link
FR (1) FR2881240B1 (en)
WO (1) WO2006077252A2 (en)

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
ANTOINE GALLAND ET AL: "économiser l'or du banquier" INTERNET CITATION, [Online] 15 octobre 2003 (2003-10-15), XP002350289 Extrait de l'Internet: URL:http://www-sor.inria.fr/galland/papers/GB03cfse.ps> [extrait le 2005-10-20] *
ANTOINE GALLAND: "Contrôle de Ressources dans les Cartes à Microprocesseur" THÈSE PRÉSENTÉE À L'UNIVERSITÉ PIERRE ET MARIE CURIE PARIS POUR OBTENIR LE GRADE DE DOCTEUR DE L'UNIVERSITÉ PARIS SPÉCIALITÉ SYSTÈMES INFORMATIQUES, XX, XX, 30 mai 2005 (2005-05-30), XP002350290 *
BLANCHET B: "Escape Analysis for JavaTM: Theory and Practice" ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, ACM, NEW YORK, NY, US, vol. 25, no. 6, novembre 2003 (2003-11), pages 713-775, XP002350285 ISSN: 0164-0925 *
CASSET L ET AL: "Formal development of an embedded verifier for Java Card byte code" PROCEEDINGS INTERNATIONAL CONFERENCE ON DEPENDABLE SYSTEMS AND NETWORKS IEEE COMPUT. SOC LOS ALAMITOS, CA, USA, 2002, pages 51-56, XP002350286 ISBN: 0-7695-1597-5 *
CHOI J-D ET AL: "Stack Allocation and Synchronization Optimizations for Java Using Escape Analysis" ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, ACM, NEW YORK, NY, US, vol. 25, no. 6, novembre 2003 (2003-11), pages 876-910, XP002350288 ISSN: 0164-0925 *

Also Published As

Publication number Publication date
FR2881240A1 (en) 2006-07-28
FR2881240B1 (en) 2007-03-30
WO2006077252A3 (en) 2008-06-26

Similar Documents

Publication Publication Date Title
EP1212678B1 (en) Management protocol, method for verifying and transforming a downloaded programme fragment and corresponding systems
EP1782191B1 (en) Method for loading software with an intermediate object oriented language in a portable device
Agesen et al. Garbage collection and local variable type-precision and liveness in Java virtual machines
JP2019536153A (en) Smart contract processing method and apparatus
FR2790844A1 (en) METHOD AND DEVICE FOR MONITORING THE PROGRESS OF A PROGRAM, PROGRAM DEVICE FOR MONITORING ITS PROGRAM
FR2667171A1 (en) Portable support with easily programmable microcircuit and method of programming this microcircuit
EP1960934B1 (en) Method for making secure execution of an intermediate language software code in a portable appliance
EP1287432A1 (en) Method for making secure a typed data language in particular in an integrated system and integrated system therefor
WO2003010666A1 (en) Method for compressing a code interpreted by semantic analysis
WO2005101725A1 (en) Method for dynamically authenticating programmes with an electronic portable object
US20090049258A1 (en) Method of verifying pseudo-code loaded in an embedded system, in particular a smart card
WO2005073860A2 (en) Method for determining operational characteristics of a program
FR2841997A1 (en) APPLICATION SECURITY DOWNLOADED IN PARTICULAR FROM A CHIP CARD
CN111523097A (en) APP brush user identification method and device based on android system and storage medium
CN104484211B (en) The method and device of shared image file
FR2967275A1 (en) METHOD, COMPUTER PROGRAM AND DEVICE FOR SECURING INTERMEDIATE PROGRAMMING CODE FOR ITS EXECUTION BY A VIRTUAL MACHINE
Elsayed et al. Reverse engineering approach for improving the quality of mobile applications
KR20010083781A (en) Arrangement for executing program code with reduced memory requirements
FR2795835A1 (en) METHOD FOR VERIFYING CODE TRANSFORMERS FOR AN ON-BOARD SYSTEM, IN PARTICULAR ON A CHIP CARD
WO2006077252A2 (en) Escape analysis in an object oriented language program for a virtual stack machine
WO2003027851A1 (en) Method and device for optimized code checker
EP1512071B1 (en) Code verification method for limited resource microcircuits
WO2008125479A1 (en) Method of secure execution of an application
FR3006471A1 (en) SYSTEM AND METHOD FOR EXECUTING APPLICATIONS OF A CHIP CARD
WO2007006697A1 (en) Class loader tree traced on directory tree

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 06704272

Country of ref document: EP

Kind code of ref document: A2

WWW Wipo information: withdrawn in national office

Ref document number: 6704272

Country of ref document: EP