Skip to content

Commit

Permalink
Rely only on extentLocalCache and scopedLocalCache presence
Browse files Browse the repository at this point in the history
Rely on extentLocalCache and scopedLocalCache presence for substituting
setExtentLocalCache and setScopedLocalCache, as these methods are
tightly coupled.
  • Loading branch information
zakkak committed Jan 20, 2023
1 parent b6d364e commit cb727c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 99 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
import com.oracle.svm.core.annotate.TargetElement;
import com.oracle.svm.core.jdk.ContinuationsNotSupported;
import com.oracle.svm.core.jdk.ContinuationsSupported;
import com.oracle.svm.core.jdk.HasSetExtentLocalCache;
import com.oracle.svm.core.jdk.HasSetScopedValueCache;
import com.oracle.svm.core.jdk.JDK11OrEarlier;
import com.oracle.svm.core.jdk.JDK17OrEarlier;
import com.oracle.svm.core.jdk.JDK17OrLater;
Expand Down Expand Up @@ -186,7 +184,7 @@ public final class Target_java_lang_Thread {
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
Object lockHelper;

@Inject @TargetElement(onlyWith = {HasSetScopedValueCache.class, HasScopedValueCache.class, HasSetExtentLocalCache.class, HasExtentLocalCache.class, LoomJDK.class}) //
@Inject @TargetElement(onlyWith = {HasScopedValueCache.class, HasExtentLocalCache.class, LoomJDK.class}) //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
Object[] scopedValueCache;

Expand Down Expand Up @@ -657,7 +655,7 @@ static Object[] extentLocalCache() {
}

@Substitute
@TargetElement(onlyWith = HasSetExtentLocalCache.class)
@TargetElement(onlyWith = HasExtentLocalCache.class)
static void setExtentLocalCache(Object[] cache) {
JavaThreads.toTarget(currentCarrierThread()).scopedValueCache = cache;
}
Expand All @@ -669,7 +667,7 @@ static Object[] scopedValueCache() {
}

@Substitute
@TargetElement(onlyWith = HasSetScopedValueCache.class)
@TargetElement(onlyWith = HasScopedValueCache.class)
static void setScopedValueCache(Object[] cache) {
JavaThreads.toTarget(currentCarrierThread()).scopedValueCache = cache;
}
Expand Down

0 comments on commit cb727c4

Please sign in to comment.