Skip to content

Commit 1b6f294

Browse files
committed
Change IntValueProfile from Exclusive to Shared
1 parent 5d4d64a commit 1b6f294

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/main/java/org/truffleruby/cext/UnwrapNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ protected ValueWrapper wrappedValueWrapper(ValueWrapper value) {
154154

155155
@Specialization
156156
protected ValueWrapper longToWrapper(long value,
157-
@Cached @Exclusive NativeToWrapperNode nativeToWrapperNode) {
157+
@Cached @Shared NativeToWrapperNode nativeToWrapperNode) {
158158
return nativeToWrapperNode.execute(value);
159159
}
160160

161161
@Specialization(guards = { "!isWrapper(value)", "values.isPointer(value)" }, limit = "getCacheLimit()")
162162
protected ValueWrapper genericToWrapper(Object value,
163163
@CachedLibrary("value") InteropLibrary values,
164-
@Cached @Exclusive NativeToWrapperNode nativeToWrapperNode,
164+
@Cached @Shared NativeToWrapperNode nativeToWrapperNode,
165165
@Cached BranchProfile unsupportedProfile) {
166166
long handle;
167167
try {

src/main/java/org/truffleruby/core/array/ArrayNodes.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ public abstract static class DeleteNode extends YieldingCoreMethodNode {
671671
protected Object delete(RubyArray array, Object value, Object maybeBlock,
672672
@Bind("array.getStore()") Object store,
673673
@CachedLibrary("store") ArrayStoreLibrary stores,
674-
@Cached @Exclusive IntValueProfile arraySizeProfile,
674+
@Cached @Shared IntValueProfile arraySizeProfile,
675675
@Cached @Exclusive LoopConditionProfile loopProfile) {
676676

677677
return delete(array, value, maybeBlock, true, store, store, stores, stores, arraySizeProfile, loopProfile);
@@ -684,7 +684,7 @@ protected Object delete(RubyArray array, Object value, Object maybeBlock,
684684
@Bind("array.getStore()") Object store,
685685
@CachedLibrary("store") ArrayStoreLibrary stores,
686686
@CachedLibrary(limit = "1") ArrayStoreLibrary newStores,
687-
@Cached @Exclusive IntValueProfile arraySizeProfile,
687+
@Cached @Shared IntValueProfile arraySizeProfile,
688688
@Cached @Exclusive LoopConditionProfile loopProfile) {
689689

690690
final Object newStore = stores.allocator(store).allocate(arraySizeProfile.profile(array.size));
@@ -770,7 +770,7 @@ protected ToIntNode coerceOtherToInt(RubyBaseNodeWithExecute index) {
770770
protected Object deleteAt(RubyArray array, int index,
771771
@Bind("array.getStore()") Object store,
772772
@CachedLibrary("store") ArrayStoreLibrary stores,
773-
@Cached @Exclusive IntValueProfile arraySizeProfile,
773+
@Cached @Shared IntValueProfile arraySizeProfile,
774774
@Cached @Shared ConditionProfile negativeIndexProfile,
775775
@Cached @Shared ConditionProfile notInBoundsProfile) {
776776
final int size = arraySizeProfile.profile(array.size);
@@ -796,7 +796,7 @@ protected Object deleteAt(RubyArray array, int index,
796796
protected Object deleteAtCopying(RubyArray array, int index,
797797
@Bind("array.getStore()") Object store,
798798
@CachedLibrary("store") ArrayStoreLibrary stores,
799-
@Cached @Exclusive IntValueProfile arraySizeProfile,
799+
@Cached @Shared IntValueProfile arraySizeProfile,
800800
@Cached @Shared ConditionProfile negativeIndexProfile,
801801
@Cached @Shared ConditionProfile notInBoundsProfile) {
802802
final int size = arraySizeProfile.profile(array.size);
@@ -1420,7 +1420,7 @@ protected Object injectSymbolNoInitial(
14201420
VirtualFrame frame, RubyArray array, RubySymbol initialOrSymbol, NotProvided symbol, Nil block,
14211421
@Bind("array.getStore()") Object store,
14221422
@CachedLibrary("store") ArrayStoreLibrary stores,
1423-
@Cached @Exclusive IntValueProfile arraySizeProfile,
1423+
@Cached @Shared IntValueProfile arraySizeProfile,
14241424
@Cached @Exclusive LoopConditionProfile loopProfile,
14251425
@Cached @Shared ToJavaStringNode toJavaString) {
14261426
return injectSymbolHelper(
@@ -1444,7 +1444,7 @@ protected Object injectSymbolWithInitial(
14441444
VirtualFrame frame, RubyArray array, Object initialOrSymbol, RubySymbol symbol, Nil block,
14451445
@Bind("array.getStore()") Object store,
14461446
@CachedLibrary("store") ArrayStoreLibrary stores,
1447-
@Cached @Exclusive IntValueProfile arraySizeProfile,
1447+
@Cached @Shared IntValueProfile arraySizeProfile,
14481448
@Cached @Exclusive LoopConditionProfile loopProfile,
14491449
@Cached @Shared ToJavaStringNode toJavaString) {
14501450
return injectSymbolHelper(
@@ -1672,7 +1672,7 @@ protected RubyArray popZeroNotEmpty(RubyArray array, int n) {
16721672
protected RubyArray popNotEmptySharedStorage(RubyArray array, int n,
16731673
@Bind("array.getStore()") Object store,
16741674
@CachedLibrary("store") ArrayStoreLibrary stores,
1675-
@Cached @Exclusive IntValueProfile arraySizeProfile,
1675+
@Cached @Shared IntValueProfile arraySizeProfile,
16761676
@Cached @Shared ConditionProfile minProfile) {
16771677
final int size = arraySizeProfile.profile(array.size);
16781678
final int numPop = minProfile.profile(size < n) ? size : n;
@@ -1691,7 +1691,7 @@ protected RubyArray popNotEmptySharedStorage(RubyArray array, int n,
16911691
protected RubyArray popNotEmptyUnsharedStorage(RubyArray array, int n,
16921692
@Bind("array.getStore()") Object store,
16931693
@CachedLibrary("store") ArrayStoreLibrary stores,
1694-
@Cached @Exclusive IntValueProfile arraySizeProfile,
1694+
@Cached @Shared IntValueProfile arraySizeProfile,
16951695
@Cached @Shared ConditionProfile minProfile) {
16961696
final int size = arraySizeProfile.profile(array.size);
16971697
final int numPop = minProfile.profile(size < n) ? size : n;
@@ -1879,8 +1879,8 @@ public abstract static class RotateInplaceNode extends PrimitiveArrayArgumentsNo
18791879
protected RubyArray rotate(RubyArray array, int rotation,
18801880
@Bind("array.getStore()") Object store,
18811881
@CachedLibrary("store") ArrayStoreLibrary stores,
1882-
@Cached @Exclusive IntValueProfile arraySizeProfile,
1883-
@Cached @Exclusive IntValueProfile rotationProfile,
1882+
@Cached @Shared IntValueProfile arraySizeProfile,
1883+
@Cached @Shared IntValueProfile rotationProfile,
18841884
@Cached LoopConditionProfile loop1Profile,
18851885
@Cached LoopConditionProfile loop2Profile,
18861886
@Cached LoopConditionProfile loop3Profile) {
@@ -1912,8 +1912,8 @@ protected RubyArray rotate(RubyArray array, int rotation,
19121912
protected RubyArray rotateStorageNotMutable(RubyArray array, int rotation,
19131913
@Bind("array.getStore()") Object store,
19141914
@CachedLibrary("store") ArrayStoreLibrary stores,
1915-
@Cached @Exclusive IntValueProfile arraySizeProfile,
1916-
@Cached @Exclusive IntValueProfile rotationProfile) {
1915+
@Cached @Shared IntValueProfile arraySizeProfile,
1916+
@Cached @Shared IntValueProfile rotationProfile) {
19171917
final int size = arraySizeProfile.profile(array.size);
19181918
rotation = rotationProfile.profile(rotation);
19191919
assert 0 < rotation && rotation < size;
@@ -2109,7 +2109,7 @@ protected RubyArray sortVeryShort(VirtualFrame frame, RubyArray array, Nil block
21092109
@Bind("array.getStore()") Object store,
21102110
@CachedLibrary("store") ArrayStoreLibrary stores,
21112111
@CachedLibrary(limit = "1") @Exclusive ArrayStoreLibrary newStores,
2112-
@Cached @Exclusive IntValueProfile arraySizeProfile,
2112+
@Cached @Shared IntValueProfile arraySizeProfile,
21132113
@Cached @Exclusive DispatchNode compareDispatchNode,
21142114
@Cached CmpIntNode cmpIntNode) {
21152115
final Object newStore = stores
@@ -2159,7 +2159,7 @@ protected Object sortPrimitiveArrayNoBlock(RubyArray array, Nil block,
21592159
@Bind("array.getStore()") Object store,
21602160
@CachedLibrary("store") ArrayStoreLibrary stores,
21612161
@CachedLibrary(limit = "1") @Exclusive ArrayStoreLibrary mutableStores,
2162-
@Cached @Exclusive IntValueProfile arraySizeProfile) {
2162+
@Cached @Shared IntValueProfile arraySizeProfile) {
21632163
final int size = arraySizeProfile.profile(array.size);
21642164
Object newStore = stores.unsharedAllocator(store).allocate(size);
21652165
stores.copyContents(store, 0, newStore, 0, size);

0 commit comments

Comments
 (0)