Skip to content

Commit

Permalink
Resolve DSL warnings/errors in Truffle & Languages code
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Humer <christian.humer@oracle.com>
  • Loading branch information
DSouzaM and chumer committed Nov 25, 2024
1 parent 16ea5c9 commit 5b90d0f
Show file tree
Hide file tree
Showing 62 changed files with 499 additions and 497 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ abstract static class ReadMember {
@Specialization(guards = "language.isShared()")
static Object doShared(Klass receiver, String member,
@CachedLibrary("receiver") InteropLibrary lib,
@Bind("$node") Node node,
@Bind Node node,
@Cached @Shared InlinedBranchProfile error,
@Bind("getLang(lib)") @SuppressWarnings("unused") EspressoLanguage language) throws UnknownIdentifierException {
return readMember(receiver, member, LookupFieldNodeGen.getUncached(), LookupDeclaredMethodNodeGen.getUncached(), node, error, lib, language);
Expand All @@ -184,7 +184,7 @@ static Object doShared(Klass receiver, String member,
static Object readMember(Klass receiver, String member,
@Shared("lookupField") @Cached LookupFieldNode lookupFieldNode,
@Shared("lookupMethod") @Cached LookupDeclaredMethod lookupMethod,
@Bind("$node") Node node,
@Bind Node node,
@Cached @Shared InlinedBranchProfile error,
@CachedLibrary("receiver") InteropLibrary lib,
@Bind("getLang(lib)") @SuppressWarnings("unused") EspressoLanguage language) throws UnknownIdentifierException {
Expand Down Expand Up @@ -261,7 +261,7 @@ abstract static class WriteMember {
// Specialization prevents caching a node that would leak the context
@Specialization(guards = "language.isShared()")
static void doShared(Klass receiver, String member, Object value,
@Bind("$node") Node node,
@Bind Node node,
@Cached @Shared InlinedBranchProfile error,
@CachedLibrary("receiver") @SuppressWarnings("unused") InteropLibrary lib,
@Bind("getLang(lib)") @SuppressWarnings("unused") EspressoLanguage language) throws UnknownIdentifierException, UnsupportedTypeException {
Expand All @@ -272,7 +272,7 @@ static void doShared(Klass receiver, String member, Object value,
static void writeMember(Klass receiver, String member, Object value,
@Shared("lookupField") @Cached LookupFieldNode lookupFieldNode,
@Exclusive @Cached ToEspressoNode.DynamicToEspresso toEspressoNode,
@Bind("$node") Node node,
@Bind Node node,
@Cached @Shared InlinedBranchProfile error) throws UnknownIdentifierException, UnsupportedTypeException {
Field field = lookupFieldNode.execute(receiver, member, true);
// Can only write to non-final fields.
Expand Down Expand Up @@ -397,7 +397,7 @@ abstract static class Instantiate {
@Specialization(guards = "language.isShared()")
static Object doShared(Klass receiver, Object[] args,
@CachedLibrary("receiver") @SuppressWarnings("unused") InteropLibrary receiverInterop,
@Bind("$node") Node node,
@Bind Node node,
@Bind("getLang(receiverInterop)") @SuppressWarnings("unused") EspressoLanguage language) throws UnsupportedMessageException, UnsupportedTypeException, ArityException {
if (receiver.isPrimitive()) {
return doPrimitive(receiver, args);
Expand Down Expand Up @@ -480,7 +480,7 @@ static StaticObject doReferenceArray(Klass receiver, Object[] arguments,

@Specialization(guards = "isMultidimensionalArray(receiver)")
static StaticObject doMultidimensionalArray(Klass receiver, Object[] arguments,
@Bind("$node") Node node,
@Bind Node node,
@Cached InlinedBranchProfile error,
@Cached ToPrimitive.ToInt toInt) throws ArityException, UnsupportedTypeException {
ArrayKlass arrayKlass = (ArrayKlass) receiver;
Expand All @@ -502,7 +502,7 @@ static StaticObject doMultidimensionalArray(Klass receiver, Object[] arguments,

@Specialization(guards = "isObjectKlass(receiver)")
static Object doObject(Klass receiver, Object[] arguments,
@Bind("$node") Node node,
@Bind Node node,
@Cached InlinedBranchProfile error,
@CachedLibrary("receiver") InteropLibrary receiverInterop,
@Cached InteropLookupAndInvoke.NonVirtual lookupAndInvoke) throws UnsupportedTypeException, ArityException, UnsupportedMessageException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static boolean isStaticObject(Object value) {

@Specialization
public static Object doStaticObject(StaticObject value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached InstanceOf.Dynamic instanceOf,
@Cached InlinedBranchProfile error) throws UnsupportedTypeException {
assert !value.isForeignObject();
Expand All @@ -177,7 +177,7 @@ public static Object doStaticObject(StaticObject value, EspressoType targetType,
"!isStaticObject(value)"
})
public static Object doForeignNull(Object value, @SuppressWarnings("unused") EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@SuppressWarnings("unused") @CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Cached InlinedBranchProfile error) throws UnsupportedTypeException {
if (targetType.getRawType().isPrimitive()) {
Expand All @@ -193,7 +193,7 @@ public static Object doForeignNull(Object value, @SuppressWarnings("unused") Esp
"!isStaticObject(value)"
})
public static Object doMappedInterface(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached LookupProxyKlassNode lookupProxyKlassNode,
@Cached ProxyInstantiateNode proxyInstantiateNode,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
Expand All @@ -217,7 +217,7 @@ public static Object doMappedInterface(Object value, EspressoType targetType,
"!isStaticObject(value)"
})
public static Object doArray(Object value, ArrayKlass targetType,
@Bind("$node") Node node,
@Bind Node node,
@SuppressWarnings("unused") @CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Cached InlinedBranchProfile error) throws UnsupportedTypeException {
Meta meta = EspressoContext.get(node).getMeta();
Expand All @@ -239,7 +239,7 @@ public static Object doArray(Object value, ArrayKlass targetType,
"!isStaticObject(value)"
})
public static Object doTypeConverter(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached LookupTypeConverterNode lookupTypeConverter,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Cached InlinedBranchProfile error) throws UnsupportedTypeException {
Expand Down Expand Up @@ -269,7 +269,7 @@ public static Object doTypeConverter(Object value, EspressoType targetType,
"!isStaticObject(value)"
})
public static Object doInternalTypeConverter(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached ToReference.DynamicToReference converterToEspresso,
@Cached LookupInternalTypeConverterNode lookupInternalTypeConverter,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
Expand All @@ -296,7 +296,7 @@ public static Object doInternalTypeConverter(Object value, EspressoType targetTy
"!isStaticObject(value)"
})
public static Object doBuiltinCollectionMapped(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached LookupProxyKlassNode lookupProxyKlassNode,
@Cached ProxyInstantiateNode proxyInstantiateNode,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
Expand Down Expand Up @@ -325,7 +325,7 @@ public static Object doBuiltinCollectionMapped(Object value, EspressoType target
"!isInternalTypeConverterEnabled(targetType)",
})
public static Object doGeneric(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Cached LookupTypeConverterNode lookupTypeConverterNode,
@Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public StaticObject doForeignNull(Object value, @SuppressWarnings("unused") Espr
"!isStaticObject(value)"
})
public static StaticObject doMappedInterface(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached LookupProxyKlassNode lookupProxyKlassNode,
@Cached ProxyInstantiateNode proxyInstantiateNode,
@CachedLibrary(limit = "LIMIT") @Exclusive InteropLibrary interop,
Expand Down Expand Up @@ -387,7 +387,7 @@ public StaticObject doArray(Object value, @SuppressWarnings("unused") ArrayKlass
"!isStaticObject(value)"
})
public static StaticObject doTypeConverter(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached @Exclusive LookupTypeConverterNode lookupTypeConverterNode,
@Cached @Shared InlinedBranchProfile errorProfile,
@CachedLibrary(limit = "LIMIT") @Exclusive InteropLibrary interop) throws UnsupportedTypeException {
Expand Down Expand Up @@ -422,7 +422,7 @@ public static StaticObject doTypeConverter(Object value, EspressoType targetType
"!isStaticObject(value)"
})
public static StaticObject doInternalTypeConverter(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached @Exclusive LookupInternalTypeConverterNode lookupInternalTypeConverterNode,
@Cached @Exclusive ToReference.DynamicToReference converterToEspresso,
@Cached @Shared InlinedBranchProfile errorProfile,
Expand All @@ -449,7 +449,7 @@ public static StaticObject doInternalTypeConverter(Object value, EspressoType ta
"!isStaticObject(value)"
})
public static StaticObject doBuiltinTypeConverter(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@Cached @Exclusive LookupProxyKlassNode lookupProxyKlassNode,
@Cached @Exclusive ProxyInstantiateNode proxyInstantiatorNode,
@CachedLibrary(limit = "LIMIT") @Exclusive InteropLibrary interop,
Expand Down Expand Up @@ -479,7 +479,7 @@ public static StaticObject doBuiltinTypeConverter(Object value, EspressoType tar
"!isTypeMappingEnabled(targetType)"
})
public static StaticObject doGeneric(Object value, EspressoType targetType,
@Bind("$node") Node node,
@Bind Node node,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Cached LookupTypeConverterNode lookupTypeConverterNode,
@Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode,
Expand Down Expand Up @@ -1194,7 +1194,7 @@ StaticObject doForeignString(Object value,
"!isBoxedPrimitive(value)"
})
static StaticObject doForeignException(Object value,
@Bind("$node") Node node,
@Bind Node node,
@Bind("get(node)") EspressoContext context,
@Shared("value") @CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Cached LookupProxyKlassNode lookupProxyKlassNode,
Expand Down Expand Up @@ -2590,7 +2590,7 @@ public StaticObject doEspresso(StaticObject value) throws UnsupportedTypeExcepti
"!isStaticObject(value)"
})
static StaticObject doForeignWrapper(Object value,
@Bind("$node") Node node,
@Bind Node node,
@Shared("value") @CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Bind("get(node)") EspressoContext context,
@Bind("targetType") EspressoType target,
Expand Down
Loading

0 comments on commit 5b90d0f

Please # to comment.