Skip to content

Commit

Permalink
Remove deprecated ReferenceLibrary.
Browse files Browse the repository at this point in the history
  • Loading branch information
rschatz committed Sep 17, 2021
1 parent d8c5643 commit 3fe1c7f
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 239 deletions.
5 changes: 5 additions & 0 deletions sulong/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changes:

* Updated LLVM toolchain to version 12.0.0.

Removals:

* Removed ReferenceLibrary (deprecated since version 20.2).
Implement InteropLibrary.isIdenticalOrUndefined instead.

# Version 21.2.0

Fixes:
Expand Down
4 changes: 1 addition & 3 deletions sulong/mx.sulong/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@
"license" : "BSD-new",
"testProject" : True,
"jacoco" : "exclude",
# TODO Remove deprecated ReferenceLibrary. [GR-24632]
"javac.lint.overrides" : "-deprecation",
},
"com.oracle.truffle.llvm.tests.native" : {
"subDir" : "tests",
Expand Down Expand Up @@ -335,7 +333,7 @@
"workingSets" : "Truffle, LLVM",
"license" : "BSD-new",
"jacoco" : "include",
# TODO Remove deprecated ReferenceLibrary. [GR-24632]
# Using finalizer in signals implementation. GR-7018
"javac.lint.overrides" : "-deprecation",
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
*
* For foreign objects, this node delegates to the {@link InteropLibrary#isIdentical} message.
*/
@SuppressWarnings("deprecation") // for backwards compatibility
@GenerateUncached
public abstract class LLVMSameObjectNode extends LLVMNode {

Expand Down Expand Up @@ -112,22 +111,11 @@ boolean doSame(Object a, Object b) {
return true;
}

// for backwards compatibility
@Specialization(limit = "3", guards = {"a != b", "references.isSame(a, b)"})
@GenerateAOT.Exclude
boolean doReferenceLibrary(Object a, Object b,
@CachedLibrary("a") com.oracle.truffle.llvm.spi.ReferenceLibrary references) {
assert references.isSame(a, b);
return true;
}

@Specialization(limit = "3", guards = {"a != b", "!references.isSame(a, b)"})
@Specialization(limit = "3", guards = {"a != b"})
@GenerateAOT.Exclude
boolean doIdentical(Object a, Object b,
@CachedLibrary("a") com.oracle.truffle.llvm.spi.ReferenceLibrary references,
@CachedLibrary("a") InteropLibrary aInterop,
@CachedLibrary("b") InteropLibrary bInterop) {
assert !references.isSame(a, b);
return aInterop.isIdentical(a, b, bInterop);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@
@ExportLibrary(value = InteropLibrary.class, receiverType = LLVMPointerImpl.class)
@ExportLibrary(value = LLVMManagedWriteLibrary.class, receiverType = LLVMPointerImpl.class, useForAOT = true, useForAOTPriority = 1)
@ExportLibrary(value = LLVMManagedReadLibrary.class, receiverType = LLVMPointerImpl.class, useForAOT = true, useForAOTPriority = 2)
@ExportLibrary(value = com.oracle.truffle.llvm.spi.ReferenceLibrary.class, receiverType = LLVMPointerImpl.class)
@SuppressWarnings({"static-method", "deprecation"})

// implements deprecated ReferenceLibrary for backwards compatibility
@SuppressWarnings({"static-method"})
abstract class CommonPointerLibraries {
@ExportMessage
static boolean isReadable(@SuppressWarnings("unused") LLVMPointerImpl receiver) {
Expand Down Expand Up @@ -442,25 +439,6 @@ Object readArrayElement(long idx,
}
}

@ExportMessage
static class IsSame {

@Specialization
static boolean doNative(LLVMPointerImpl receiver, LLVMPointerImpl other,
@Cached LLVMAddressEqualsNode.Operation equals) {
return equals.executeWithTarget(receiver, other);
}

/**
* @param receiver
* @param other
*/
@Fallback
static boolean doOther(LLVMPointerImpl receiver, Object other) {
return false;
}
}

/**
* @param receiver
* @see InteropLibrary#hasLanguage(Object)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

@ExportLibrary(value = InteropLibrary.class, receiverType = LLVMPointerImpl.class)
@ExportLibrary(value = LLVMAsForeignLibrary.class, receiverType = LLVMPointerImpl.class, useForAOT = false)
@SuppressWarnings("deprecation") // needed because the superclass implements ReferenceLibrary
abstract class ManagedPointerLibraries extends CommonPointerLibraries {

@ExportMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

@ExportLibrary(value = InteropLibrary.class, receiverType = LLVMPointerImpl.class)
@ExportLibrary(value = LLVMAsForeignLibrary.class, receiverType = LLVMPointerImpl.class, useForAOT = true, useForAOTPriority = 1)
@SuppressWarnings("deprecation") // needed because the superclass implements ReferenceLibrary
abstract class NativePointerLibraries extends CommonPointerLibraries {

@ExportMessage
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 3fe1c7f

Please sign in to comment.