diff truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/BranchProfile.java @ 22504:d80a5ff56f51

Storing the profiling enabled information in a static field; checking it only once; shielding against missing method in the TruffleRuntime interface
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Thu, 17 Dec 2015 13:45:37 +0100
parents 828c67903db2
children a5e58793bbca
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/BranchProfile.java	Thu Dec 17 10:01:38 2015 +0100
+++ b/truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/BranchProfile.java	Thu Dec 17 13:45:37 2015 +0100
@@ -26,7 +26,6 @@
 
 import com.oracle.truffle.api.CompilerDirectives;
 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
-import com.oracle.truffle.api.Truffle;
 
 /**
  * <p>
@@ -78,7 +77,7 @@
      * Call to create a new instance of a branch profile.
      */
     public static BranchProfile create() {
-        if (Truffle.getRuntime().isProfilingEnabled()) {
+        if (Profile.isProfilingEnabled()) {
             return Enabled.create0();
         } else {
             return Disabled.INSTANCE;