Skip to content

Commit

Permalink
Add Truffle::Graal.{boundary,boundary_allow_inlining} for experimenta…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
eregon committed Oct 10, 2024
1 parent 68d59e9 commit b45c865
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/main/java/org/truffleruby/extra/TruffleGraalNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,26 @@ Object blackhole(Object value) {

}

@CoreMethod(names = "boundary", onSingleton = true)
public abstract static class BoundaryNode extends CoreMethodArrayArgumentsNode {

@TruffleBoundary(allowInlining = false)
@Specialization
Object boundary() {
return nil;
}
}

@CoreMethod(names = "boundary_allow_inlining", onSingleton = true)
public abstract static class BoundaryAllowInliningNode extends CoreMethodArrayArgumentsNode {

@TruffleBoundary(allowInlining = true)
@Specialization
Object boundaryAllowInlining() {
return nil;
}
}

@CoreMethod(names = "total_compilation_time", onSingleton = true)
public abstract static class TotalCompilationTimeNode extends CoreMethodArrayArgumentsNode {

Expand All @@ -236,7 +256,7 @@ public abstract static class TotalCompilationTimeNode extends CoreMethodArrayArg
@SuppressFBWarnings("LI_LAZY_INIT_STATIC")
@TruffleBoundary
@Specialization
final long totalCompilationTime() {
long totalCompilationTime() {
if (bean == null) {
var compilationMXBean = ManagementFactory.getCompilationMXBean();
VarHandle.storeStoreFence();
Expand Down

0 comments on commit b45c865

Please sign in to comment.