Mercurial > hg > truffle
changeset 22430:1c39c96a1703
remove support for auto-reloading of files from disk
author | Christian Wirth <christian.wirth@oracle.com> |
---|---|
date | Thu, 03 Dec 2015 14:40:52 +0100 |
parents | 5692953272eb |
children | e62921416112 |
files | truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java |
diffstat | 2 files changed, 3 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java Thu Dec 03 09:14:20 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java Thu Dec 03 14:40:52 2015 +0100 @@ -29,7 +29,6 @@ import com.oracle.truffle.api.nodes.NodeCost; import com.oracle.truffle.api.nodes.NodeInfo; -import com.oracle.truffle.api.source.Source; /** * Class containing general Truffle options. @@ -87,13 +86,6 @@ public static final boolean TraceASTJSON; /** - * Enables auto-reload of file-based {@link Source} when the file is changed on disk. - * <p> - * Can be set with {@code -Dtruffle.AutoReloadFileSource=true}. - */ - public static final boolean AutoReloadFileSource; - - /** * Forces ahead-of-time initialization. */ public static final boolean AOT; @@ -107,7 +99,7 @@ } static { - final boolean[] values = new boolean[5]; + final boolean[] values = new boolean[4]; AccessController.doPrivileged(new PrivilegedAction<Void>() { public Void run() { values[0] = Boolean.getBoolean("truffle.TraceRewrites"); @@ -117,7 +109,6 @@ values[1] = Boolean.getBoolean("truffle.DetailedRewriteReasons"); values[2] = Boolean.getBoolean("truffle.TraceASTJSON"); values[3] = Boolean.getBoolean("com.oracle.truffle.aot"); - values[4] = Boolean.getBoolean("truffle.AutoReloadFileSource"); return null; } }); @@ -125,6 +116,5 @@ DetailedRewriteReasons = values[1]; TraceASTJSON = values[2]; AOT = values[3]; - AutoReloadFileSource = values[4]; } }
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Thu Dec 03 09:14:20 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Thu Dec 03 14:40:52 2015 +0100 @@ -54,7 +54,6 @@ import com.oracle.truffle.api.CompilerAsserts; import com.oracle.truffle.api.TruffleLanguage.Registration; -import com.oracle.truffle.api.TruffleOptions; /** * Representation of a guest language source code unit and its contents. Sources originate in @@ -834,12 +833,6 @@ private String code = null; // A cache of the file's contents - /** - * Timestamp of the cache in the file system. Enabled by setting - * {@link TruffleOptions.AutoReloadFileSource} to true. - */ - private long timeStamp; - public FileSource(File file, String name, String path) { this.file = file.getAbsoluteFile(); this.name = name; @@ -864,12 +857,9 @@ @Override public String getCode() { if (fileCacheEnabled) { - if (code == null || (TruffleOptions.AutoReloadFileSource && timeStamp != file.lastModified())) { + if (code == null) { try { code = read(getReader()); - if (TruffleOptions.AutoReloadFileSource) { - timeStamp = file.lastModified(); - } } catch (IOException e) { } } @@ -894,7 +884,7 @@ @Override public Reader getReader() { - if (code != null && (TruffleOptions.AutoReloadFileSource && timeStamp == file.lastModified())) { + if (code != null) { return new StringReader(code); } try {