Skip to content

Commit cb71b95

Browse files
committed
Addressing truffle-inlining warnings in ffi package
1 parent 0a0afb4 commit cb71b95

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/main/java/org/truffleruby/extra/ffi/PointerNodes.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import com.oracle.truffle.api.nodes.Node;
1818
import com.oracle.truffle.api.object.Shape;
1919
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
20+
import com.oracle.truffle.api.profiles.InlinedConditionProfile;
2021
import com.oracle.truffle.api.strings.TruffleString;
2122
import org.truffleruby.RubyContext;
2223
import org.truffleruby.annotations.CoreMethod;
@@ -43,7 +44,6 @@
4344
import com.oracle.truffle.api.dsl.Cached.Shared;
4445
import com.oracle.truffle.api.dsl.ImportStatic;
4546
import com.oracle.truffle.api.dsl.Specialization;
46-
import com.oracle.truffle.api.profiles.ConditionProfile;
4747
import org.truffleruby.language.objects.AllocationTracing;
4848

4949
@CoreModule(value = "Truffle::FFI::Pointer", isClass = true)
@@ -291,10 +291,10 @@ public abstract static class PointerReadBytesToArrayNode extends PointerPrimitiv
291291

292292
@Specialization
293293
protected Object readBytes(RubyByteArray array, int arrayOffset, long address, int length,
294-
@Cached ConditionProfile zeroProfile,
294+
@Cached InlinedConditionProfile zeroProfile,
295295
@Cached InlinedBranchProfile nullPointerProfile) {
296296
final Pointer ptr = new Pointer(getContext(), address);
297-
if (zeroProfile.profile(length == 0)) {
297+
if (zeroProfile.profile(this, length == 0)) {
298298
// No need to check the pointer address if we read nothing
299299
return nil;
300300
} else {
@@ -312,11 +312,11 @@ public abstract static class PointerReadBytesNode extends PointerPrimitiveArrayA
312312

313313
@Specialization
314314
protected RubyString readBytes(long address, int length,
315-
@Cached ConditionProfile zeroProfile,
315+
@Cached InlinedConditionProfile zeroProfile,
316316
@Cached TruffleString.FromByteArrayNode fromByteArrayNode,
317317
@Cached InlinedBranchProfile nullPointerProfile) {
318318
final Pointer ptr = new Pointer(getContext(), address);
319-
if (zeroProfile.profile(length == 0)) {
319+
if (zeroProfile.profile(this, length == 0)) {
320320
// No need to check the pointer address if we read nothing
321321
return createString(TStringConstants.EMPTY_BINARY, Encodings.BINARY);
322322
} else {
@@ -334,7 +334,7 @@ public abstract static class PointerWriteBytesNode extends PointerPrimitiveArray
334334

335335
@Specialization(guards = "libString.isRubyString(string)", limit = "1")
336336
protected static Object writeBytes(long address, Object string, int index, int length,
337-
@Cached ConditionProfile nonZeroProfile,
337+
@Cached InlinedConditionProfile nonZeroProfile,
338338
@Cached TruffleString.CopyToNativeMemoryNode copyToNativeMemoryNode,
339339
@Cached RubyStringLibrary libString,
340340
@Cached InlinedBranchProfile nullPointerProfile,
@@ -345,7 +345,7 @@ protected static Object writeBytes(long address, Object string, int index, int l
345345

346346
assert index + length <= tstring.byteLength(encoding);
347347

348-
if (nonZeroProfile.profile(length != 0)) {
348+
if (nonZeroProfile.profile(node, length != 0)) {
349349
// No need to check the pointer address if we write nothing
350350
checkNull(node, ptr, nullPointerProfile);
351351

src/main/java/org/truffleruby/extra/ffi/package-info.java

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)