Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java @ 13882:afd6fa5e8229
SL: Feedback from reviewers
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Wed, 05 Feb 2014 08:02:15 -0800 |
parents | 64c77f0577bb |
children | f675818d9ad0 |
comparison
equal
deleted
inserted
replaced
13881:272a166a9574 | 13882:afd6fa5e8229 |
---|---|
37 * The run-time state of SL during execution. One context is instantiated before any source code is | 37 * The run-time state of SL during execution. One context is instantiated before any source code is |
38 * parsed, and this context is passed around to all methods that need access to it. For example, the | 38 * parsed, and this context is passed around to all methods that need access to it. For example, the |
39 * context is used during {@link SLNodeFactory parsing} and by {@link SLBuiltinNode#getContext() | 39 * context is used during {@link SLNodeFactory parsing} and by {@link SLBuiltinNode#getContext() |
40 * builtin functions}. | 40 * builtin functions}. |
41 * <p> | 41 * <p> |
42 * It would be an error to have two different context instances at the same. From a software | 42 * It would be an error to have two different context instances during the execution of one script. |
43 * engineering point of view, it is better to pass around this encapsulated context object instead | 43 * However, if two separate scripts run in one Java VM at the same time, they have a different |
44 * of storing the data in static Java fields. | 44 * context. Therefore, the context is not a singleton. |
45 */ | 45 */ |
46 public final class SLContext { | 46 public final class SLContext { |
47 private final SourceManager sourceManager; | 47 private final SourceManager sourceManager; |
48 private final BufferedReader input; | 48 private final BufferedReader input; |
49 private final PrintStream output; | 49 private final PrintStream output; |