Mercurial > hg > truffle
diff truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/Profile.java @ 22534:1133c68332ef
Compute the isProfilingEnabled information everytime to accomodate possible change in the Truffle runtime
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Fri, 08 Jan 2016 11:51:54 +0100 |
parents | d80a5ff56f51 |
children |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/Profile.java Thu Jan 07 11:07:28 2016 +0100 +++ b/truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/Profile.java Fri Jan 08 11:51:54 2016 +0100 @@ -91,8 +91,7 @@ * @see Assumption */ public abstract class Profile extends NodeCloneable { - private static final boolean ENABLED; - static { + static boolean isProfilingEnabled() { boolean enabled; try { enabled = Truffle.getRuntime().isProfilingEnabled(); @@ -100,11 +99,7 @@ // running on old version of Graal enabled = true; } - ENABLED = enabled; - } - - static boolean isProfilingEnabled() { - return ENABLED; + return enabled; } Profile() {