dd-trace-java
dd-trace-java copied to clipboard
add safe local var hoisting
What Does This Do
Introduce local var hoisting level: 0: no hoisting 1: safe hoisting 2: aggressive hoisting. for now we are only implementing safe hoisting. Aggressive will be later. Safe hoisting consists of scanning the bytecode instructions of the methods to find the store and load for local var, scan local variable table to find potential slot or name conflicts. the safe hoisting is done when there is only one variable per slot without name conflict and for the same type. hoisting is done by extending the range of the local variable to range of the method and initializing to 0 at the beginning of the method. Long and double variable are not part of the safe hoisting because they are using 2 slots and hoisting them can result in a conflict with another variable in another range. Also we prevent hoisting for the second slot for the same reason (forbidden slots)
Motivation
capture local variables for method probe and exception probes
Additional Notes
Contributor Checklist
- Format the title according the contribution guidelines
- Assign the
type:and (comp:orinst:) labels in addition to any usefull labels - Don't use
close,fixor any linking keywords when referencing an issue.
Usesolvesinstead, and assign the PR milestone to the issue - Update the CODEOWNERS file on source file addition, move, or deletion
- Update the public documentation in case of new configuration flag or behavior
Jira ticket: DEBUG-3304