Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove atomic setter transformers #428

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bootstrap/src/sun/nio/ch/lincheck/EventTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ boolean beforeWriteField(Object obj, String className, String fieldName, Object
boolean beforeWriteArrayElement(Object array, int index, Object value, int codeLocation);
void afterWrite();

void afterReflectiveSetter(Object receiver, Object value);

void beforeMethodCall(Object owner, String className, String methodName, int codeLocation, int methodId, Object[] params);
void onMethodCallReturn(Object result);
void onMethodCallException(Throwable t);
Expand Down
13 changes: 0 additions & 13 deletions bootstrap/src/sun/nio/ch/lincheck/Injections.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,6 @@ public static void afterWrite() {
getEventTracker().afterWrite();
}

/**
* Called from the instrumented code after atomic write is performed through either
* the AtomicXXXFieldUpdater, VarHandle, or Unsafe APIs.
* Incorporates all atomic methods that can set the field (or array element) of an object,
* such as `set`, `compareAndSet`, `compareAndExchange`, etc.
*
* @param receiver The object to which field (or array element) the value is set.
* @param value The value written into [receiver] field (or array element).
*/
public static void afterReflectiveSetter(Object receiver, Object value) {
getEventTracker().afterReflectiveSetter(receiver, value);
}

/**
* Called from the instrumented code before any method call.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -874,10 +874,6 @@ abstract class ManagedStrategy(
}
}

override fun afterReflectiveSetter(receiver: Any?, value: Any?) = runInIgnoredSection {
objectTracker.registerObjectLink(fromObject = receiver ?: StaticObject, toObject = value)
}

override fun getThreadLocalRandom(): Random = runInIgnoredSection {
return randoms[currentThread]
}
Expand Down Expand Up @@ -937,6 +933,12 @@ abstract class ManagedStrategy(
if (owner == null && atomicMethodDescriptor == null && guarantee == null) { // static method
LincheckJavaAgent.ensureClassHierarchyIsTransformed(className.canonicalClassName)
}
if (atomicMethodDescriptor != null && atomicMethodDescriptor.kind.isSetter) {
objectTracker.registerObjectLink(
fromObject = atomicMethodDescriptor.getAccessedObject(owner!!, params),
toObject = atomicMethodDescriptor.getSetValue(owner, params)
)
}
if (collectTrace) {
traceCollector!!.checkActiveLockDetected()
addBeforeMethodCallTracePoint(owner, codeLocation, methodId, className, methodName, params, atomicMethodDescriptor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ internal class LincheckClassVisitor(
mv = DeterministicHashCodeTransformer(fileName, className, methodName, mv.newAdapter())
mv = DeterministicTimeTransformer(mv.newAdapter())
mv = DeterministicRandomTransformer(fileName, className, methodName, mv.newAdapter())
mv = UnsafeMethodTransformer(fileName, className, methodName, mv.newAdapter())
mv = AtomicFieldUpdaterMethodTransformer(fileName, className, methodName, mv.newAdapter())
mv = VarHandleMethodTransformer(fileName, className, methodName, mv.newAdapter())
// `SharedMemoryAccessTransformer` goes first because it relies on `AnalyzerAdapter`,
// which should be put in front of the byte-code transformer chain,
// so that it can correctly analyze the byte-code and compute required type-information
Expand Down

This file was deleted.

Loading