public class DynamicCallManager extends Object
DynamicCallManager provides facilities to retrieve information about
dynamic calls statically.
Most of the time, call relationships are explicit, which allows to properly
build the call graph statically. But in the case of dynamic linking, i.e.
invokedynamic instructions, this relationship might be unknown
until the code is actually executed. Indeed, bootstrap methods are used to
dynamically link the code at first call. One can read details about the
invokedynamic
instruction to know more about this mechanism.
Nested lambdas are particularly subject to such absence of concrete caller,
which lead us to produce method names like lambda$null$0, which
breaks the call graph. This information can however be retrieved statically
through the code of the bootstrap method called.
In retrieveCalls(Method, JavaClass), we retrieve the (called,
caller) relationships by analyzing the code of the caller Method.
This information is then used in linkCalls(Method) to rename the
called Method properly.
| 构造器和说明 |
|---|
DynamicCallManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
linkCalls(org.apache.bcel.classfile.Method method)
Link the
Method's name to its concrete caller if required. |
void |
retrieveCalls(org.apache.bcel.classfile.Method method,
org.apache.bcel.classfile.JavaClass jc)
Retrieve dynamic call relationships based on the code of the provided
Method. |
public void retrieveCalls(org.apache.bcel.classfile.Method method,
org.apache.bcel.classfile.JavaClass jc)
Method.method - Method to analyze the codejc - JavaClass info, which contains the bootstrap methodslinkCalls(Method)public void linkCalls(org.apache.bcel.classfile.Method method)
Method's name to its concrete caller if required.method - Method to analyzeretrieveCalls(Method, JavaClass)Copyright © 2023. All rights reserved.