Skip to content

Commit

Permalink
Adjust Javadocs to clarify lvIndex refers to slot
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Aug 26, 2024
1 parent f16c8a0 commit b821ae4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/net/fabricmc/mappingio/MappingVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ default boolean visitContent() throws IOException {
* Visit a parameter.
*
* @param argPosition Always starts at 0 and gets incremented by 1 for each additional parameter.
* @param lvIndex The parameter's local variable index in the current method.
* @param lvIndex The parameter's local variable index in the current method, also known as {@code slot}.
* Starts at 0 for static methods, 1 otherwise. For each additional parameter,
* it gets incremented by 1, or by 2 if it's a primitive {@code long} or {@code double}.
* it gets incremented by 1, or by 2 if it's a double-wide primitive ({@code long} or {@code double}).
* @param srcName The optional source name of the parameter.
* @return Whether or not the arg's content should be visited too.
*/
Expand All @@ -112,9 +112,10 @@ default boolean visitContent() throws IOException {
* (local variable table). It is optional, so -1 can be passed instead.
* This is the case since LVTs themselves are optional debug information, see
* <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.13">JVMS 4.7.13</a>.
* @param lvIndex The var's local variable index in the current method. For each additional variable,
* it gets incremented by 1, or by 2 if it's a primitive {@code long} or {@code double}.
* The first variable starts where the last parameter left off (plus the offset).
* @param lvIndex The var's local variable index in the current method, also known as {@code slot}.
* For each additional variable, it gets incremented by 1,
* or by 2 if it's a double-wide primitive ({@code long} or {@code double}).
* The first variable starts at the last parameter's slot plus wideness.
* @param startOpIdx Required for cases when the lvIndex alone doesn't uniquely identify a local variable.
* This is the case when variables get re-defined later on, in which case most decompilers opt to
* not re-define the existing var, but instead generate a new one (with both sharing the same lvIndex).
Expand Down

0 comments on commit b821ae4

Please sign in to comment.