17
17
import com .oracle .truffle .api .nodes .Node ;
18
18
import com .oracle .truffle .api .object .Shape ;
19
19
import com .oracle .truffle .api .profiles .InlinedBranchProfile ;
20
+ import com .oracle .truffle .api .profiles .InlinedConditionProfile ;
20
21
import com .oracle .truffle .api .strings .TruffleString ;
21
22
import org .truffleruby .RubyContext ;
22
23
import org .truffleruby .annotations .CoreMethod ;
43
44
import com .oracle .truffle .api .dsl .Cached .Shared ;
44
45
import com .oracle .truffle .api .dsl .ImportStatic ;
45
46
import com .oracle .truffle .api .dsl .Specialization ;
46
- import com .oracle .truffle .api .profiles .ConditionProfile ;
47
47
import org .truffleruby .language .objects .AllocationTracing ;
48
48
49
49
@ CoreModule (value = "Truffle::FFI::Pointer" , isClass = true )
@@ -291,10 +291,10 @@ public abstract static class PointerReadBytesToArrayNode extends PointerPrimitiv
291
291
292
292
@ Specialization
293
293
protected Object readBytes (RubyByteArray array , int arrayOffset , long address , int length ,
294
- @ Cached ConditionProfile zeroProfile ,
294
+ @ Cached InlinedConditionProfile zeroProfile ,
295
295
@ Cached InlinedBranchProfile nullPointerProfile ) {
296
296
final Pointer ptr = new Pointer (getContext (), address );
297
- if (zeroProfile .profile (length == 0 )) {
297
+ if (zeroProfile .profile (this , length == 0 )) {
298
298
// No need to check the pointer address if we read nothing
299
299
return nil ;
300
300
} else {
@@ -312,11 +312,11 @@ public abstract static class PointerReadBytesNode extends PointerPrimitiveArrayA
312
312
313
313
@ Specialization
314
314
protected RubyString readBytes (long address , int length ,
315
- @ Cached ConditionProfile zeroProfile ,
315
+ @ Cached InlinedConditionProfile zeroProfile ,
316
316
@ Cached TruffleString .FromByteArrayNode fromByteArrayNode ,
317
317
@ Cached InlinedBranchProfile nullPointerProfile ) {
318
318
final Pointer ptr = new Pointer (getContext (), address );
319
- if (zeroProfile .profile (length == 0 )) {
319
+ if (zeroProfile .profile (this , length == 0 )) {
320
320
// No need to check the pointer address if we read nothing
321
321
return createString (TStringConstants .EMPTY_BINARY , Encodings .BINARY );
322
322
} else {
@@ -334,7 +334,7 @@ public abstract static class PointerWriteBytesNode extends PointerPrimitiveArray
334
334
335
335
@ Specialization (guards = "libString.isRubyString(string)" , limit = "1" )
336
336
protected static Object writeBytes (long address , Object string , int index , int length ,
337
- @ Cached ConditionProfile nonZeroProfile ,
337
+ @ Cached InlinedConditionProfile nonZeroProfile ,
338
338
@ Cached TruffleString .CopyToNativeMemoryNode copyToNativeMemoryNode ,
339
339
@ Cached RubyStringLibrary libString ,
340
340
@ Cached InlinedBranchProfile nullPointerProfile ,
@@ -345,7 +345,7 @@ protected static Object writeBytes(long address, Object string, int index, int l
345
345
346
346
assert index + length <= tstring .byteLength (encoding );
347
347
348
- if (nonZeroProfile .profile (length != 0 )) {
348
+ if (nonZeroProfile .profile (node , length != 0 )) {
349
349
// No need to check the pointer address if we write nothing
350
350
checkNull (node , ptr , nullPointerProfile );
351
351
0 commit comments