Java-oriented program evolution model and incremental pointer analysis method
By using a program change model and incremental pointer analysis method, the problem of identifying semantic equivalence changes in Java programs during program changes is solved, and efficient and accurate pointer analysis results are calculated. This method is applicable to program change scenarios in Java and similar languages.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-14
AI Technical Summary
Existing incremental pointer analysis techniques for Java programs cannot correctly identify semantically equivalent changes such as method overriding and class hierarchy refactoring when dealing with program changes, resulting in inaccurate definition of the scope of impact. Furthermore, they lack optimization for Java language features, making it difficult to perform pointer analysis efficiently in continuous integration and just-in-time compilation optimization scenarios.
The program variation model is used to transform Java programs into corresponding intermediate program representations. By atomic decomposition and subtraction, an atomic program variation list is generated. Combined with the Andersen full program pointer analysis and incremental pointer analysis framework, the pointer analysis results of the new Java program are efficiently calculated.
It achieves efficient pointer analysis without sacrificing reliability, saves computing resources, is applicable to Java and similar object-oriented programming languages, and supports incremental updates of fine-grained pointer results.
Smart Images

Figure CN122387504A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a program variation model and incremental pointer analysis method for the Java language, belonging to the field of static program analysis technology. Background Technology
[0002] Pointer analysis is a core technique in Java static analysis. It statically calculates the set of objects that all pointers in a program might point to at runtime, without requiring dynamic code execution. Based on the relationships between these pointers, further calculations can be made to obtain alias information, function call graphs, and class hierarchies. These results can be used for higher-level application analysis, such as compiler optimization (e.g., inlining and escape analysis), security analysis (e.g., vulnerability and privacy detection), and program understanding (e.g., code slicing and refactoring). However, with the increasing scale of modern Java projects and the adoption of agile development models in large software programs, leading to frequent code iterations, classic full-program pointer analysis faces significant challenges in terms of both runtime costs and computational resource consumption.
[0003] Existing incremental pointer analysis techniques are mainly divided into two categories: path dependency tracing methods based on CFL reachability and incremental analysis methods based on the Andersen algorithm. CFL-based methods achieve incremental updates by recording variable dependencies along the program's change path, but their strategy of storing all path tracing information leads to excessive memory overhead. Andersen-based incremental analysis methods exploit the transitive properties of pointer analysis rules and use strongly connected components to optimize and reduce redundant computations, but this method still requires traversing a large number of irrelevant nodes when handling cross-method data flow updates and lacks specific design and optimization tailored to Java language characteristics.
[0004] Existing technologies suffer from the problem of not establishing a semantic-level model of program changes. Incremental pointer analysis typically requires running a full program analysis for a specified version first. Based on this, when developers update the program, incremental pointer analysis only analyzes the changed parts. However, existing solutions simply map code differences to the addition or deletion of syntax tree nodes, failing to identify semantically equivalent changes such as method overriding and class hierarchy refactoring. When program changes cause changes in field resolution or method dispatch, existing tools struggle to accurately define and handle the impact.
[0005] Furthermore, mainstream Java pointer analysis frameworks generally lack system support for incremental scenarios, and they cannot adapt to dynamically changing program structures and their intermediate representations.
[0006] Therefore, in continuous integration, code completion, and just-in-time compilation optimization scenarios, there is an urgent need for a technical solution that is Java-oriented, can correctly capture atomic changes, and supports fine-grained incremental updates of pointer results, so as to accelerate the completion of pointer analysis tasks and optimize the efficiency of computing resource utilization without losing reliability. Summary of the Invention
[0007] Objective: To address the problems and shortcomings of existing technologies, this invention provides a program change model and incremental pointer analysis method for the Java language. Given two versions of a Java program, old and new, the program change model is used to transform them into corresponding intermediate program representations. Atomic decomposition and subtraction are then performed to obtain their atomic program change lists. Based on the pointer analysis results corresponding to the old Java program, the atomic program change list is applied, and the incremental pointer analysis framework is run to efficiently calculate the pointer analysis results corresponding to the new Java program without sacrificing reliability.
[0008] Technical solution: A program change model and incremental pointer analysis method for Java language, the method comprising the following steps: S1. Given an old Java program and a new Java program, use the program variation model to transform them into their corresponding intermediate program representations P. old and P new ; S2. Perform Andersen full-program pointer analysis on the old Java program to obtain the old pointer analysis result R. old This includes the old pointer flow graph G. old Relationship with the old pointer pt old ; S3. Perform atomic decomposition and subtraction on the intermediate representation of the program after the transformation in step S1 to obtain the list of atomic program changes ΔP between the old and new Java programs. S4. Analyze the old pointer result R obtained in step S2. old Using the atomic program change list ΔP obtained in step S3, the incremental pointer analysis framework is run to finally obtain the pointer analysis result R corresponding to the new Java program. new .
[0009] Preferably, in step S1, the intermediate program representation P converted from the program variation model is a triple <IR, DT, RT>, where IR is a set of intermediate program statements compiled by the analyzer (open-source static analysis framework Tai-e) front end; DT is a method dispatch table containing entries (t, kn, m), representing a receiving object of type t and a method signature kn, with the dispatched method calculated as m; RT is a field resolution table containing entries (t, fn, f), representing a receiving object of type t and a field signature fn, with the resolved field calculated as f. The program variation model is a triple representation <IR, DT, RT>, and six atomic program variation operations based on the triple representation.
[0010] Preferably, in step S2, Andersen full-program pointer analysis is performed on the old Java program to obtain the old pointer analysis result R. old This includes the old pointer flow graph G. old Relationship with the old pointer pt old A pointer flow graph is a tuple consisting of a set of pointer nodes and a set of pointer propagation edges, used to represent the associations between all pointers in a Java program; a pointer relation is a mapping from pointers to object power sets, used to represent the set information that all pointers point to in a Java program.
[0011] Preferably, the atomic program changes between the old and new Java programs in step S3 include six types of atomic program changes, specifically including: S31. The newly added intermediate code statement is obtained by combining and subtracting the intermediate code statements that exist in the new Java program but not in the old Java program. S32. The newly added method dispatch entry is obtained by combining and subtracting the method dispatch entries contained in the class method table and class hierarchy of the new Java program, while the method dispatch entries not contained in the class method table and class hierarchy of the old Java program. S33. The newly added field parsing entry is obtained by combining and subtracting the field parsing entries contained in the class field table and class inheritance relationship of the new Java program, while the field parsing entries not contained in the class field table and class inheritance relationship of the old Java program. S34. Deleting intermediate code statements is obtained by taking the difference between sets of intermediate code statements that exist in the old Java program but do not exist in the new Java program. S35. Deleting method dispatch entries is obtained by taking the difference between the method dispatch entries contained in the class method table and class hierarchy of the old Java program and the method dispatch entries not contained in the class method table and class hierarchy of the new Java program. S36. Deleting field parsing entries is obtained by subtracting the field parsing entries contained in the class field table and class inheritance relationship of the old Java program, while the field parsing entries not contained in the class field table and class inheritance relationship of the new Java program are collected.
[0012] Preferably, in step S4, the old pointer analysis result R obtained in step S2 is... old The atomic program change list ΔP obtained in step S3 is used as input to run an incremental pointer analysis algorithm based on the working list, iterating continuously until a fixed point is found, and finally the pointer analysis result R corresponding to the new Java program is obtained. new The specific steps of the incremental pointer analysis algorithm include: S41, analyze the old pointer result R old Assigning the result of the analysis to a global pointer R g This is for use and modification by the various sub-processes in subsequent incremental pointer analysis; S42. For each new type of atomic program change, perform single-step change processing according to the type of the new atomic change, and maintain a working list WL containing nodes to be updated during the processing. S43. For each type of atomic program change, perform single-step deletion change processing according to the type of atomic deletion change, and maintain a working list WL containing nodes to be updated during the processing. S44. Based on the nodes to be updated in the working list, perform a loop iteration. For each dequeue node, remove it from the pointer set of its corresponding variable, and propagate and update the changes along the corresponding variable, pointer edges, and pointer objects in the pointer flow graph G. This will improve the global pointer analysis result R. g The new pointer analysis result is now calculated as a fixed point; S45. Continue until the nodes to be updated in the work list are empty, i.e., the loop iteration is complete. Retrieve the current pointer analysis result and assign it to the pointer analysis result R from the second version of the program information. new .
[0013] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the Java-oriented program variation model and incremental pointer analysis method as described above.
[0014] A computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of the Java-oriented program variation model and incremental pointer analysis method as described above.
[0015] Beneficial effects: Compared with existing technical solutions, the present invention has the following advantages: 1) This invention provides a program change model for the Java language. This model can express complex Java program changes as six atomic program changes, effectively simplifying the calculation of differences between old and new Java programs, and laying the foundation for the design and implementation of subsequent incremental pointer analysis methods; 2) This invention provides an incremental pointer analysis method for the Java language. This method can perform corresponding initial processing and iterative calculations based on six atomic program changes, ultimately outputting incremental pointer analysis results with the same reliability as classic full-program pointer analysis, while saving runtime and computational resources; 3) The program variation model and incremental pointer analysis method proposed in this invention are also applicable to analyzing other object-oriented programming languages that are similar to Java in terms of syntax, features and programming paradigm. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention. Detailed Implementation
[0017] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0018] like Figure 1 As shown, the Java-oriented program change model and incremental pointer analysis method, for two versions of a given Java program (old and new), transforms them into corresponding intermediate program representations using the program change model, performs atomic decomposition and subtraction to obtain their atomic program change lists. Based on the pointer analysis results corresponding to the old Java program, the atomic program change list is applied to run the incremental pointer analysis framework, efficiently calculating the pointer analysis results corresponding to the new Java program without sacrificing reliability. Specifically, the steps include: S1. Given an old Java program and a new Java program, use the program variation model to transform them into their corresponding intermediate program representations P. old and P new ; The intermediate program representation P, transformed using the program variation model, is a triple <IR, DT, RT>. IR, DT, and RT are all compiled and generated by the front-end of the open-source static analysis framework Tai-e. IR is a set of intermediate program statements compiled by the analyzer (Tai-e front-end), including object creation statements, assignment statements, field read / write statements, and method call statements. DT is a method dispatch table containing entries (t, kn, m), representing a receiving object of type t and a method signature kn, with the dispatched method being calculated as m. RT is a field resolution table containing entries (t, fn, f), representing a receiving object of type t and a field signature fn, with the resolved field being calculated as f.
[0019] S2. Perform Andersen full-program pointer analysis on the old Java program to obtain the old pointer analysis result R. old This includes the old pointer flow graph G. old Relationship with the old pointer pt old ; A pointer flow graph is a tuple consisting of a set of pointer nodes and a set of pointer propagation edges, used to represent the associations between all pointers in a Java program; a pointer relation is a mapping from pointers to object power sets, used to represent the pointer set information of all pointers in a Java program.
[0020] S3. Perform atomic decomposition and subtraction on the intermediate representation of the program after the transformation in step S1 to obtain the list of atomic program changes ΔP between the old and new Java programs. S31. The newly added intermediate code statement is obtained by combining and subtracting the intermediate code statements that exist in the new Java program but not in the old Java program. S32. The newly added method dispatch entry is obtained by combining and subtracting the method dispatch entries contained in the class method table and class hierarchy of the new Java program, while the method dispatch entries not contained in the class method table and class hierarchy of the old Java program. S33. The newly added field parsing entry is obtained by combining and subtracting the field parsing entries contained in the class field table and class inheritance relationship of the new Java program, while the field parsing entries not contained in the class field table and class inheritance relationship of the old Java program. S34. The deletion of intermediate code statements is obtained by taking the difference between sets of intermediate code statements that exist in the old Java program but do not exist in the new Java program. S35. Deleting a method dispatch entry is obtained by taking the difference between the method dispatch entries contained in the class method table and class hierarchy of the old Java program and the method dispatch entries not contained in the class method table and class hierarchy of the new Java program. S36. Deleting field resolution entries is obtained by subtracting the field resolution entries contained in the class field table and class inheritance relationship of the old Java program, and the field resolution entries not contained in the class field table and class inheritance relationship of the new Java program.
[0021] S4. Analyze the old pointer result R obtained in step S2. old Using the atomic program change list ΔP obtained in step S3, the incremental pointer analysis framework is run to finally obtain the pointer analysis result R corresponding to the new Java program. new .
[0022] The incremental pointer analysis framework runs an incremental pointer analysis algorithm based on a working list, iterating continuously until a fixed point is found. The specific steps of the algorithm include: S41, analyze the old pointer result R old Assigning the result of the analysis to a global pointer R g This is for use and modification by the various sub-processes in subsequent incremental pointer analysis; S42. For each new type of atomic program change, perform single-step change processing according to the type of the new atomic change, and maintain a working list WL containing nodes to be updated during the processing. S43. For each type of atomic program change, perform single-step deletion change processing according to the type of atomic deletion change, and maintain a working list WL containing nodes to be updated during the processing. S44. Based on the nodes to be updated in the working list, perform a loop iteration. For each dequeue node, remove it from the pointer set of its corresponding variable, and propagate and update the changes along the corresponding variable, pointer edges, and pointer objects in the pointer flow graph G. This will improve the global pointer analysis result R. g The new pointer analysis result is now calculated as a fixed point; S45. Continue until the nodes to be updated in the work list are empty, i.e., the loop iteration is complete. Retrieve the current pointer analysis result and assign it to the pointer analysis result R from the second version of the program information. new .
[0023] Since this invention pertains to a static analysis method for the Java language, the specific implementation method will be described below with reference to Java code examples.
[0024] The following code example demonstrates an older Java program containing three classes: a main class `Main`, class `A`, and class `C`. The main class `Main` contains a `main` method, which handles the main execution logic. Classes `A` and `C` both contain ordinary methods with the method signature `foo`, but their method bodies differ. In this older Java program, class `A` does not inherit from class `C`. Therefore, after line 5 is executed, the call to the `foo` method under the variable `a` is dispatched to the `foo` method in class `A`, and the system console will print "foo in A".
[0025] Line 01, / / Main class Line 02, public class Main { Line 03, public static void main(String[] args) { Line 04, A a = new A(); Line 05, a.foo(); Line 06,} Line 07, Line 08 Line 09, / / Class A (not inheriting from class C) Line 10, class A { Line 11, void foo() { Line 12, System.out.println("foo in A"); Line 13,} Line 14, Line 15 Line 16, / / Class C Line 17, class C { Line 18, void foo() { Line 19, System.out.println("foo in C"); Line 20,} Line 21, The following example code demonstrates a new Java program containing three classes: a main class `Main`, a subclass `A`, and a superclass `C`. The main class `Main` contains a `main` method, which serves as the main execution logic (exactly the same as in the old Java program). Subclass `A` does not contain a regular method with the method signature `foo`, while superclass `C` contains a regular method with the method signature `foo`. In this new Java program, subclass `A` inherits from superclass `C`. Therefore, after line 26 is executed, the call to the `foo` method under the variable `a` is dispatched to the `foo` method in class `C`, and the system console will print "foo in C".
[0026] Line 22, / / Main class Line 23, public class Main { Line 24, public static void main(String[] args) { Line 25, A a = new A(); Line 26, a.foo(); Line 27,} Line 28, Line 29 Line 30, / / Subclass A (inherits from parent class C) Line 31, class A extends C {} Line 32 Line 33, / / Parent class C Line 34, class C { Line 35, void foo() { Line 36, System.out.println("foo in C"); Line 37,} Line 38, To concisely refer to the intermediate code statements corresponding to each line in the example code and the program entities in the analysis results, the notations used in this embodiment are first defined as follows: (1) “ir@line number” represents the intermediate code statement corresponding to a certain line in the source code. For example, ir@04 represents the intermediate code statement generated after the front-end compilation of line 04 of the old Java program “A a = new A()”, and ir@25 represents the intermediate code statement corresponding to line 25 of the new Java program, and so on; (2) “class name::method name.this” represents the this parameter variable automatically introduced by the analyzer in a certain method. For example, A::foo.this represents the this parameter variable of the foo method in class A, and C::foo.this represents the this parameter variable of the foo method in class C; (3) “obj@line number” represents the heap object abstracted by the object creation statement of a certain line. For example, obj@04 represents the heap object abstracted by the object creation statement of line 04 of the old Java program “new The heap object abstracted by A()”, obj@25 represents the heap object abstracted by line 25 of the new Java program; (4) the concrete method entity defined in a class is represented by “class name::method name”, for example A::foo represents the foo method defined in class A, C::foo represents the foo method defined in class C; (5) the directed edge in the pointer flow graph is represented by “source node → target node”, which means that the object in the pointer set of the source node should be propagated to the pointer set of the target node.
[0027] For the example code, step S1 uses the program variation model to transform them into the corresponding intermediate program representation P. old =〈IR old DT old RT old > and P new =〈IR new DT new RT new >, where IR old = {ir@04, ir@05, ir@12, ir@19}, which represents the intermediate code statements corresponding to lines 04, 05, 12, and 19 of the old Java program; DT old = {(A, foo, A::foo), (C, foo, C::foo)}, meaning that when an object of type A calls foo, it is dispatched to the A::foo method, and when an object of type C calls foo, it is dispatched to the C::foo method; RT old = {}, meaning that in older Java programs, there was no need for additional parsing of field accesses; IR new = {ir@25, ir@26, ir@36}, which represents the intermediate code statements corresponding to lines 25, 26, and 36 of the new Java program; DTnew ={(A, foo, C::foo), (C, foo, C::foo)}, meaning that when an object of type A calls the foo method, it is dispatched to the C::foo method due to the change in inheritance; RT new = {} means that the new Java program does not involve field access that requires additional parsing.
[0028] For the example code, step S2 performs Andersen full-program pointer analysis on the old Java program to obtain the old pointer analysis result R. old The result includes: the old pointer flow graph G old =〈N old E old >, where the pointer node set N old = { a,this A::foo The local variable 'a' and the 'this' parameter variable of the 'foo' method in class A together constitute the pointer nodes involved in the analysis; pointing to the propagation edge set E. old = { a → this A::foo That is, there exists a propagation edge from variable a to the `this` parameter variable of the `A::foo` method. This edge is generated by the method call statement on line 05, meaning that objects in the `a` pointer set should be propagated to the `this` parameter variable pointer set of the `A::foo` method; old pointer relationship pt old pt(a) = { obj@04} indicates that variable a points to the abstract heap object created by line 04, and pt(A::foo.this) = { obj@04} indicates that the this parameter variable of the A::foo method also points to this object. This is because the object obj@04 flows from variable a into the pointer set of A::foo.this from the above propagation edge.
[0029] For the example code, step S3 performs atomic decomposition and subtraction on the transformed intermediate representation of the program to obtain a list of atomic program changes ΔP between the old and new Java programs. Specifically, this is achieved by comparing IR... old With IR new DT old With DT new RT old With RT newThe calculated value is ΔP = { del ir@12, del (A, foo, A::foo), add (A, foo, C::foo)}. Here: del ir@12 represents deleting the intermediate code statement corresponding to line 12 of the old Java program (because class A no longer contains the foo method body in the new Java program, this statement no longer exists); del (A, foo, A::foo) represents deleting the entry in the method dispatch table, meaning that when an object of type A calls foo, it will no longer be dispatched to the A::foo method (because class A no longer has this method definition); add(A, foo, C::foo) represents adding the entry in the method dispatch table, meaning that when an object of type A calls foo, it will now be dispatched to the C::foo method (because class A now inherits from parent class C, and the foo method is provided by C::foo).
[0030] For the example code, step S4 analyzes the old pointer result R. old By applying the atomic program change list ΔP and running the incremental pointer analysis framework, the pointer analysis result R corresponding to the new Java program is finally obtained. new This includes a new pointer flow graph G. new =〈N new E new > and the new pointing relationship pt new The incremental pointer analysis framework runs an incremental pointer analysis algorithm based on a working list, iterating continuously until a fixed point is found. The specific steps of the algorithm include: For the example code, step S41 analyzes the old pointer result R. old Assigning the result of the analysis to a global pointer R g This is for use and modification by the various sub-processes in subsequent incremental pointer analysis, at which point R... g Pointer flow graphs, pointer relationships, and R old Completely identical; For the example code, step S42 adds (A, foo, C::foo) to the atomic program change of the new type. According to the type of the atomic change, the change is added step by step. During the process, a working list WL containing nodes to be updated is maintained. For the example code, step S43 performs single-step deletion processing on the atomic program changes del ir@12 and del (A, foo, A::foo) of the deletion type, and maintains a working list WL containing nodes to be updated during the processing. For the example code, step S44 iterates through the nodes to be updated in the working list. For each dequeued node, it removes it from the pointer set of the corresponding variable, and propagates and updates the change along the corresponding variable, the pointer edge, and the pointer object in the pointer flow graph G, thereby updating the global pointer analysis result R. g The new pointer analysis result is now calculated as a fixed point; For the example code, in step S45, the loop iteration continues until the nodes to be updated in the work list are empty, that is, the current pointer analysis result is retrieved and assigned to the pointer analysis result R in the second version of the program information. new The result includes: a new pointer flow graph G. new =〈N new E new >, where the pointer node set N new = { a,this C::foo}, that is, the local variable a and the this parameter variable of the foo method in class C; pointing to the propagation edge set E. new = { a → this C::foo That is, there exists a propagation edge from variable a to the `this` parameter variable of the `C::foo` method, which is generated by the method call statement on line 26 via the new dispatch entry; the new pointer relation `pt` new , of which pt new (a) = { obj@25} means that variable a points to the abstract heap object created by line 25 of the new Java program, pt new `(C::foo.this) = { obj@25}` indicates that the `this` parameter variable of the `C::foo` method also points to this object. Compared with the old pointer analysis results, the propagation edge in the pointer flow graph has changed from "a → A::foo.this" to "a → C::foo.this", and the object in the pointer set has been updated from the heap object created in line 04 of the old version to the heap object created in line 25 of the new version. This accurately reflects the semantic evolution of the program when the method dispatch target changes after subclass A adds inheritance from parent class C.
[0031] It is obvious to those skilled in the art that the steps of the methods described in the embodiments of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using device-executable program code, which can then be stored in a storage device for execution by a computing device. Furthermore, in some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of the present invention are not limited to any particular hardware and software combination.
[0032] Obviously, those skilled in the art should understand that the steps of the Java-oriented program variation model and incremental pointer analysis method described in the above embodiments of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using device-executable program code, thereby storing them in a storage device for execution by a computing device. Furthermore, in some cases, the steps shown or described can be performed in a different order than presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of the present invention are not limited to any particular hardware and software combination.
Claims
1. A program change model and incremental pointer analysis method for the Java language, characterized in that, The method for performing pointer analysis on two versions of a Java program includes the following steps: S1. Given an old Java program and a new Java program, use the program variation model to transform them into corresponding intermediate program representations; S2. Perform Andersen full program pointer analysis on the old Java program to obtain the old pointer analysis results, which include the old pointer flow graph and the old pointer relationships; S3. Perform atomic decomposition and subtraction on the intermediate representation of the program after the transformation in step S1 to obtain a list of atomic program changes between the old and new Java programs. S4. Apply the atomic program change list obtained in step S3 to the old pointer analysis results obtained in step S2, run the incremental pointer analysis framework, and finally obtain the pointer analysis results corresponding to the new Java program.
2. The program variation model and incremental pointer analysis method for Java language according to claim 1, characterized in that, In step S1, the intermediate program representation converted from the program variation model is a triple <IR, DT, RT>, where IR is the set of intermediate program statements; DT is the method dispatch table; and RT is the field parsing table. They are all compiled and generated by the front end of the open-source static analysis framework Tai-e.
3. The program variation model and incremental pointer analysis method for Java language according to claim 1, characterized in that, In step S2, the old Java program is subjected to Andersen full program pointer analysis to obtain the old pointer analysis results, which include the old pointer flow graph and the old pointer relationship. A pointer flow graph is a tuple consisting of a set of pointer nodes and a set of pointer propagation edges, used to represent the relationships between all pointers in a Java program; A pointer relationship is a mapping from pointers to a set of objects, used to represent the set of pointers that all pointers point to in a Java program.
4. The program variation model and incremental pointer analysis method for Java language according to claim 1, characterized in that, The atomic program changes between the old and new Java programs in step S3 include six types of atomic program changes, specifically: S31. The newly added intermediate code statement is obtained by combining and subtracting the intermediate code statements that exist in the new Java program but not in the old Java program. S32. The newly added method dispatch entry is obtained by combining and subtracting the method dispatch entries contained in the class method table and class hierarchy of the new Java program, while the method dispatch entries not contained in the class method table and class hierarchy of the old Java program. S33. The newly added field parsing entry is obtained by combining and subtracting the field parsing entries contained in the class field table and class inheritance relationship of the new Java program, while the field parsing entries not contained in the class field table and class inheritance relationship of the old Java program. S34. Deleting intermediate code statements is obtained by taking the difference between sets of intermediate code statements that exist in the old Java program but do not exist in the new Java program. S35. Deleting method dispatch entries is obtained by taking the difference between the method dispatch entries contained in the class method table and class hierarchy of the old Java program and the method dispatch entries not contained in the class method table and class hierarchy of the new Java program. S36. Deleting field parsing entries is obtained by subtracting the field parsing entries contained in the class field table and class inheritance relationship of the old Java program, while the field parsing entries not contained in the class field table and class inheritance relationship of the new Java program are collected.
5. The program variation model and incremental pointer analysis method for Java language according to claim 1, characterized in that, In step S4, the old pointer analysis result obtained in step S2 and the atomic program change list obtained in step S3 are used as input to run the incremental pointer analysis algorithm based on the working list. This process iterates continuously until a fixed point is found, ultimately yielding the pointer analysis result corresponding to the new Java program. The specific steps of the incremental pointer analysis algorithm include: S41. Assign the old pointer analysis result to a global pointer analysis result for use and modification by the various sub-procedures of subsequent incremental pointer analysis; S42. For each new type of atomic program change, perform single-step change processing according to the type of the new atomic change, and maintain a working list containing nodes to be updated during the processing. S43. For each type of atomic program change, perform single-step deletion change processing according to the type of atomic deletion change, and maintain a working list containing nodes to be updated during the processing. S44. Based on the nodes to be updated in the working list, perform a loop iteration. For each dequeue node, remove it from the pointer set of the corresponding variable, and propagate and update the change along the corresponding variable, pointer edge and pointer object in the pointer flow graph. In this way, calculate the new pointer analysis result fixed point on the global pointer analysis result. S45. Continue until the nodes to be updated in the work list are empty, i.e., the loop iteration is complete. Retrieve the current pointer analysis result and assign it to the pointer analysis result R from the second version of the program information. new .
6. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the program variation model and incremental pointer analysis method for Java language as described in any one of claims 1-5.
7. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that: When the computer program / instruction is executed by the processor, it implements the steps of the program variation model and incremental pointer analysis method for the Java language as described in any one of claims 1-5.