Skip to content

Commit 42b0084

Browse files
committed
No need for explicit accepts() for DelegatedArrayStorage and SharedArrayStorage
* Truffle libraries automatically merge the "nested" library for the backing store, i.e., `receiverStorageArrayStoreLibrary_ = ARRAY_STORE_LIBRARY_.create((castReceiver.storage));` in the generated DelegatedArrayStorageGen.ArrayStoreLibraryExports.Cached#Cached because `storage` is a final field and `@CachedLibrary("this.storage")` is used in messages.
1 parent 4dea5a3 commit 42b0084

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

src/main/java/org/truffleruby/core/array/library/DelegatedArrayStorage.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ public DelegatedArrayStorage(Object storage, int offset, int length) {
4848
this.length = length;
4949
}
5050

51-
@ExportMessage
52-
protected static boolean accepts(DelegatedArrayStorage store,
53-
@CachedLibrary("store.storage") ArrayStoreLibrary stores) {
54-
return true;
55-
}
56-
5751
@ExportMessage
5852
protected Object read(int index,
5953
@CachedLibrary("this.storage") ArrayStoreLibrary stores) {

src/main/java/org/truffleruby/core/array/library/SharedArrayStorage.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ public boolean allElementsShared(int size) {
6666
return true;
6767
}
6868

69-
@ExportMessage
70-
protected static boolean accepts(SharedArrayStorage store,
71-
@CachedLibrary("store.storage") ArrayStoreLibrary stores) {
72-
return true;
73-
}
74-
7569
@ExportMessage
7670
protected Object read(int index,
7771
@CachedLibrary("this.storage") ArrayStoreLibrary stores) {

0 commit comments

Comments
 (0)