File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/main/java/org/truffleruby/extra Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 41
41
import com .oracle .truffle .api .frame .MaterializedFrame ;
42
42
import com .oracle .truffle .api .nodes .NodeUtil ;
43
43
44
+ import java .lang .management .CompilationMXBean ;
45
+ import java .lang .management .ManagementFactory ;
46
+
44
47
@ CoreModule ("Truffle::Graal" )
45
48
public abstract class TruffleGraalNodes {
46
49
@@ -222,4 +225,18 @@ protected Object blackhole(Object value) {
222
225
223
226
}
224
227
228
+ @ CoreMethod (names = "total_compilation_time" , onSingleton = true )
229
+ public abstract static class TotalCompilationTimeNode extends CoreMethodArrayArgumentsNode {
230
+ private static CompilationMXBean bean ;
231
+
232
+ @ TruffleBoundary
233
+ @ Specialization
234
+ protected final long totalCompilationTime () {
235
+ if (bean == null ) {
236
+ bean = ManagementFactory .getCompilationMXBean ();
237
+ }
238
+
239
+ return bean .getTotalCompilationTime ();
240
+ }
241
+ }
225
242
}
You can’t perform that action at this time.
0 commit comments