Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java @ 16989:19faa7ca37c1
Truffle/Source: use a synchronized hash table
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Wed, 27 Aug 2014 17:59:48 -0700 |
parents | 7109baa7b9eb |
children | 0bcefb0f8488 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Wed Aug 27 17:59:17 2014 -0700 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Wed Aug 27 17:59:48 2014 -0700 @@ -73,7 +73,7 @@ // TOOD (mlvdv) connect SourceSections into a spatial tree for fast geometric lookup // Files and pseudo files are indexed. - private static final Map<String, WeakReference<Source>> filePathToSource = new HashMap<>(); + private static final Map<String, WeakReference<Source>> filePathToSource = new Hashtable<>(); private static boolean fileCacheEnabled = true; @@ -171,6 +171,7 @@ return source; } + // TODO (mlvdv) enable per-file choice whether to cache? /** * Enables/disables caching of file contents, <em>disabled</em> by default. Caching of sources * created from literal text or readers is always enabled.