Mercurial > hg > truffle
changeset 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 | 1f7fe9f4207a |
children | 9b9301abe3ff |
files | truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/Profile.java |
diffstat | 1 files changed, 2 insertions(+), 7 deletions(-) [+] |
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() {