Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeytewari-ul committed Jan 2, 2024
1 parent 98af4c1 commit 735014c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions src/main/java/io/unlogged/core/bytecode/ClassTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ protected ClassTransformer(WeaveLog weaver, WeaveConfig config, ClassWriter cw)
private MethodVisitor addProbe (MethodVisitor methodVisitorProbed, int access, String name, String desc, String[] exceptions) {
if (methodVisitorProbed != null) {
methodVisitorProbed = new TryCatchBlockSorter(methodVisitorProbed, access, name, desc, signature, exceptions);
MethodTransformer transformer_probed = new MethodTransformer(
MethodTransformer transformerProbed = new MethodTransformer(
weavingInfo, config, sourceFileName,
fullClassName, outerClassName, access,
name, desc, signature, exceptions, methodVisitorProbed
);

methodVisitorProbed = new JSRInliner(transformer_probed, access, name, desc, signature, exceptions);
methodVisitorProbed = new JSRInliner(transformerProbed, access, name, desc, signature, exceptions);
}
return methodVisitorProbed;
}
Expand Down Expand Up @@ -176,7 +176,7 @@ public void visit(int version, int access, String name, String signature,
className = name.substring(index + 1);
}

this.alwaysProbeClassFlag = ProbeFlagUtil.getalwaysProbeClassFlag(access);
this.alwaysProbeClassFlag = ProbeFlagUtil.getAlwaysProbeClassFlag(access);
super.visit(version, access, name, signature, superName, interfaces);
}

Expand Down Expand Up @@ -218,7 +218,7 @@ public MethodVisitor visitMethod(int access, String name, String desc, String si

// calcuclate probe flag at method level
Boolean alwaysProbeMethodFlag = this.alwaysProbeClassFlag || ProbeFlagUtil.getalwaysProbeMethodFlag(name, access, desc);
Boolean neverProbeMethodFlag = ProbeFlagUtil.getneverProbeMethodFlag(name);
Boolean neverProbeMethodFlag = ProbeFlagUtil.getNeverProbeMethodFlag(name);

// early exit for clinit. It is already defined in class with initial method
if (name.equals("<clinit>")) {
Expand Down Expand Up @@ -247,9 +247,9 @@ public MethodVisitor visitMethod(int access, String name, String desc, String si
}

this.methodList.add(name);
String name_probed = name + Constants.probedValue;
MethodVisitor methodVisitorProbed = super.visitMethod(access, name_probed , desc, signature, exceptions);
methodVisitorProbed = addProbe(methodVisitorProbed, access, name_probed, desc, exceptions);
String nameProbed = name + Constants.probedValue;
MethodVisitor methodVisitorProbed = super.visitMethod(access, nameProbed , desc, signature, exceptions);
methodVisitorProbed = addProbe(methodVisitorProbed, access, nameProbed, desc, exceptions);

long classCounter = getCounter(this.classCounterMap, className);
MethodVisitorWithoutProbe methodVisitorWithoutProbe = new MethodVisitorWithoutProbe(api, name, fullClassName, access, desc, classCounter, super.visitMethod(access, name , desc, signature, exceptions));
Expand Down Expand Up @@ -300,7 +300,7 @@ public void visitEnd() {
staticNew.visitLdcInsn(localMethod);
staticNew.visitLdcInsn(0L);

// cast long_object to long_primitive
// cast long object to long primitive
staticNew.visitMethodInsn(
Opcodes.INVOKESTATIC,
Type.getInternalName(Long.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void visitCode() {
mv.visitLdcInsn(localMethod);
mv.visitLdcInsn(0L);

// cast long_object to long_primitive
// cast long object to long primitive
mv.visitMethodInsn(
Opcodes.INVOKESTATIC,
Type.getInternalName(Long.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private long getDivisor(){

@Override
public void visitCode() {
// Start of block-A. This adds the line: mapStore.put(method_name, mapStore.get(method_name) + 1);
// Start of block-A. This adds the line: mapStore.put(methodName, mapStore.get(methodName) + 1);

// load mapStore
mv.visitFieldInsn(
Expand All @@ -118,7 +118,7 @@ public void visitCode() {
// load string for mapStore
mv.visitLdcInsn(this.methodName);

// Start of block-B. This adds the logic for mapStore.get("method_name") + 1 and loads the value to stack
// Start of block-B. This adds the logic for mapStore.get("methodName") + 1 and loads the value to stack
// load mapStore
mv.visitFieldInsn(
Opcodes.GETSTATIC,
Expand All @@ -139,7 +139,7 @@ public void visitCode() {
false
);

// cast long_object to long_primitive
// cast long object to long primitive
mv.visitTypeInsn(Opcodes.CHECKCAST, Type.getInternalName(Long.class));
mv.visitMethodInsn(
Opcodes.INVOKEVIRTUAL,
Expand All @@ -155,7 +155,7 @@ public void visitCode() {
mv.visitInsn(Opcodes.LADD);
// End of Block-B

// cast long_primitive to long_object
// cast long primitive to long object
mv.visitMethodInsn(
Opcodes.INVOKESTATIC,
Type.getInternalName(Long.class),
Expand All @@ -178,7 +178,7 @@ public void visitCode() {
// End of Block-A

// Start of block-C
// This adds the line for if (probecounter(methodCounter, divisor, argument_list))
// This adds the line for if (probecounter(methodCounter, divisor, argument list))
// add the if condition
Label exitLabel = new Label();

Expand All @@ -193,7 +193,7 @@ public void visitCode() {
// load the method name
mv.visitLdcInsn(this.methodName);

// this is logic for: mapStore.get("method_name")
// this is logic for: mapStore.get("methodName")
mv.visitMethodInsn(
Opcodes.INVOKEVIRTUAL,
Type.getInternalName(java.util.HashMap.class),
Expand All @@ -202,7 +202,7 @@ public void visitCode() {
false
);

// cast long_object to long_primitive
// cast long object to long primitive
mv.visitTypeInsn(Opcodes.CHECKCAST, Type.getInternalName(Long.class));
mv.visitMethodInsn(
Opcodes.INVOKEVIRTUAL,
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/unlogged/core/bytecode/method/JSRInliner.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class JSRInliner extends JSRInlinerAdapter {

private MethodTransformer analysis_probed;
private MethodTransformer analysisProbed;

/**
* Create an instance of the object
Expand All @@ -20,10 +20,10 @@ public class JSRInliner extends JSRInlinerAdapter {
* @param signature is a generics signature
* @param exceptions specifies exceptions thrown by the method
*/
public JSRInliner(MethodTransformer transfromer_probed, int access, String name, String desc, String signature, String[] exceptions) {
public JSRInliner(MethodTransformer transformerProbed, int access, String name, String desc, String signature, String[] exceptions) {
// The second parameter is null so that the object delays the execution of the given MethodTransformer
super(Opcodes.ASM5, null, access, name, desc, signature, exceptions);
this.analysis_probed = transfromer_probed;
this.analysisProbed = transformerProbed;
}

/**
Expand All @@ -37,10 +37,10 @@ public void visitEnd() {
super.visitEnd();

// Provide the resultant instruction list for creating a list of labels in the method
analysis_probed.setup(localVariables, instructions);
analysisProbed.setup(localVariables, instructions);

// Analyze the inlined method
super.accept(analysis_probed);
super.accept(analysisProbed);
}

}
4 changes: 2 additions & 2 deletions src/main/java/io/unlogged/util/ProbeFlagUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.objectweb.asm.Opcodes;

public class ProbeFlagUtil {
public static boolean getalwaysProbeClassFlag (int access) {
public static boolean getAlwaysProbeClassFlag (int access) {
if ((access & Opcodes.ACC_INTERFACE) != 0) {
// class is an interface
return true;
Expand Down Expand Up @@ -43,7 +43,7 @@ public static boolean getalwaysProbeMethodFlag (String methodName, int access, S
return false;
}

public static Boolean getneverProbeMethodFlag(String methodName) {
public static Boolean getNeverProbeMethodFlag (String methodName) {
if (methodName.equals("equals")) {
return true;
}
Expand Down

0 comments on commit 735014c

Please sign in to comment.