File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 33
33
import com .oracle .graal .python .builtins .CoreFunctions ;
34
34
import com .oracle .graal .python .builtins .PythonBuiltins ;
35
35
import com .oracle .graal .python .builtins .objects .PNone ;
36
+ import com .oracle .graal .python .builtins .objects .cext .PythonNativeClass ;
37
+ import com .oracle .graal .python .builtins .objects .cext .PythonNativeObject ;
36
38
import com .oracle .graal .python .builtins .objects .tuple .PTuple ;
37
39
import com .oracle .graal .python .nodes .function .PythonBuiltinNode ;
38
40
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
41
+ import com .oracle .truffle .api .dsl .Fallback ;
39
42
import com .oracle .truffle .api .dsl .GenerateNodeFactory ;
40
43
import com .oracle .truffle .api .dsl .Specialization ;
41
44
@@ -75,4 +78,24 @@ public PTuple count() {
75
78
return factory ().createTuple (new Object []{count , 0 , 0 });
76
79
}
77
80
}
81
+
82
+ @ Builtin (name = "is_tracked" , fixedNumOfArguments = 1 )
83
+ @ GenerateNodeFactory
84
+ abstract static class GcIsTrackedNode extends PythonBuiltinNode {
85
+ @ Specialization
86
+ public boolean isTracked (@ SuppressWarnings ("unused" ) PythonNativeObject object ) {
87
+ return false ;
88
+ }
89
+
90
+ @ Specialization
91
+ public boolean isTracked (@ SuppressWarnings ("unused" ) PythonNativeClass object ) {
92
+ // TODO: this is not correct
93
+ return true ;
94
+ }
95
+
96
+ @ Fallback
97
+ public boolean isTracked (@ SuppressWarnings ("unused" ) Object object ) {
98
+ return true ;
99
+ }
100
+ }
78
101
}
You can’t perform that action at this time.
0 commit comments