nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
changeset 24779 3bf490e146c3
parent 24778 2ff5d7041566
child 25422 199a23bee487
equal deleted inserted replaced
24778:2ff5d7041566 24779:3bf490e146c3
    57 import javax.script.SimpleBindings;
    57 import javax.script.SimpleBindings;
    58 import jdk.nashorn.internal.objects.Global;
    58 import jdk.nashorn.internal.objects.Global;
    59 import jdk.nashorn.internal.runtime.Context;
    59 import jdk.nashorn.internal.runtime.Context;
    60 import jdk.nashorn.internal.runtime.ErrorManager;
    60 import jdk.nashorn.internal.runtime.ErrorManager;
    61 import jdk.nashorn.internal.runtime.Property;
    61 import jdk.nashorn.internal.runtime.Property;
    62 import jdk.nashorn.internal.runtime.ScriptEnvironment;
       
    63 import jdk.nashorn.internal.runtime.ScriptFunction;
    62 import jdk.nashorn.internal.runtime.ScriptFunction;
    64 import jdk.nashorn.internal.runtime.ScriptObject;
    63 import jdk.nashorn.internal.runtime.ScriptObject;
    65 import jdk.nashorn.internal.runtime.ScriptRuntime;
    64 import jdk.nashorn.internal.runtime.ScriptRuntime;
    66 import jdk.nashorn.internal.runtime.Source;
    65 import jdk.nashorn.internal.runtime.Source;
    67 import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
    66 import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
   634                 return NashornScriptEngine.this;
   633                 return NashornScriptEngine.this;
   635             }
   634             }
   636         };
   635         };
   637     }
   636     }
   638 
   637 
   639     /**
       
   640      * Check if the global script environment tells us to do optimistic
       
   641      * compilation
       
   642      * @return true if optimistic compilation enabled
       
   643      */
       
   644     public static boolean isOptimistic() {
       
   645         return ScriptEnvironment.globalOptimistic();
       
   646     }
       
   647 
       
   648     private ScriptFunction compileImpl(final Source source, final ScriptContext ctxt) throws ScriptException {
   638     private ScriptFunction compileImpl(final Source source, final ScriptContext ctxt) throws ScriptException {
   649         return compileImpl(source, getNashornGlobalFrom(ctxt));
   639         return compileImpl(source, getNashornGlobalFrom(ctxt));
   650     }
   640     }
   651 
   641 
   652     private ScriptFunction compileImpl(final Source source, final Global newGlobal) throws ScriptException {
   642     private ScriptFunction compileImpl(final Source source, final Global newGlobal) throws ScriptException {