File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
src/main/java/org/truffleruby/cext Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 12
12
import static org .truffleruby .cext .ValueWrapperManager .isMallocAligned ;
13
13
14
14
import com .oracle .truffle .api .dsl .Fallback ;
15
+ import com .oracle .truffle .api .dsl .GenerateCached ;
16
+ import com .oracle .truffle .api .dsl .GenerateInline ;
17
+ import com .oracle .truffle .api .nodes .Node ;
15
18
import org .truffleruby .language .RubyBaseNode ;
16
19
17
20
import com .oracle .truffle .api .dsl .GenerateUncached ;
20
23
/** The IsNativeObjectNode is implemented to determine if a native pointer belongs to a natively allocated NODE* which
21
24
* are used in Ripper. */
22
25
@ GenerateUncached
26
+ @ GenerateInline
27
+ @ GenerateCached (false )
23
28
public abstract class IsNativeObjectNode extends RubyBaseNode {
24
29
25
30
/** Returns true if handle was natively allocated. */
26
- public abstract Object execute (Object handle );
31
+ public abstract Object execute (Node node , Object handle );
27
32
28
33
@ Specialization
29
- protected boolean isNativeObjectTaggedObject (long handle ) {
34
+ protected static boolean isNativeObjectTaggedObject (long handle ) {
30
35
return isMallocAligned (handle ) && handle < ValueWrapperManager .ALLOCATION_BASE ;
31
36
}
32
37
33
38
@ Fallback
34
- protected boolean isNativeObjectFallback (Object handle ) {
39
+ protected static boolean isNativeObjectFallback (Object handle ) {
35
40
return false ;
36
41
}
37
42
Original file line number Diff line number Diff line change @@ -465,8 +465,9 @@ protected boolean isExecutable() {
465
465
466
466
@ ExportMessage
467
467
protected Object execute (Object [] arguments ,
468
- @ Cached IsNativeObjectNode isNativeObjectNode ) {
469
- return isNativeObjectNode .execute (arguments [0 ]);
468
+ @ Cached IsNativeObjectNode isNativeObjectNode ,
469
+ @ Bind ("$node" ) Node node ) {
470
+ return isNativeObjectNode .execute (node , arguments [0 ]);
470
471
}
471
472
}
472
473
You can’t perform that action at this time.
0 commit comments