src/jdk/nashorn/internal/runtime/ScriptEnvironment.java

Print this page




 245         }
 246 
 247         if (options.get("trace.callsites") instanceof KeyValueOption) {
 248             callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE;
 249             final KeyValueOption kv = (KeyValueOption)options.get("trace.callsites");
 250             if (kv.hasValue("miss")) {
 251                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_MISSES;
 252             }
 253             if (kv.hasValue("enterexit") || (callSiteFlags & NashornCallSiteDescriptor.CALLSITE_TRACE_MISSES) == 0) {
 254                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_ENTEREXIT;
 255             }
 256             if (kv.hasValue("objects")) {
 257                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_VALUES;
 258             }
 259             if (kv.hasValue("scope")) {
 260                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_SCOPE;
 261             }
 262         }
 263         this._callsite_flags = callSiteFlags;
 264 
 265         final Option<?> option = options.get("timezone");
 266         if (option != null) {
 267             this._timezone = (TimeZone)option.getValue();
 268         } else {
 269             this._timezone  = TimeZone.getDefault();
 270         }
 271 




 272         this._locale = Locale.getDefault();

 273     }
 274 
 275     /**
 276      * Can we specialize a particular method name?
 277      * @param functionName method name
 278      * @return true if we are allowed to generate versions of this method
 279      */
 280     public boolean canSpecialize(final String functionName) {
 281         if (_specialize_calls == null) {
 282             return false;
 283         }
 284         return _specialize_calls.isEmpty() || _specialize_calls.contains(functionName);
 285     }
 286 
 287     /**
 288      * Get the output stream for this environment
 289      * @return output print writer
 290      */
 291     public PrintWriter getOut() {
 292         return out;




 245         }
 246 
 247         if (options.get("trace.callsites") instanceof KeyValueOption) {
 248             callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE;
 249             final KeyValueOption kv = (KeyValueOption)options.get("trace.callsites");
 250             if (kv.hasValue("miss")) {
 251                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_MISSES;
 252             }
 253             if (kv.hasValue("enterexit") || (callSiteFlags & NashornCallSiteDescriptor.CALLSITE_TRACE_MISSES) == 0) {
 254                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_ENTEREXIT;
 255             }
 256             if (kv.hasValue("objects")) {
 257                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_VALUES;
 258             }
 259             if (kv.hasValue("scope")) {
 260                 callSiteFlags |= NashornCallSiteDescriptor.CALLSITE_TRACE_SCOPE;
 261             }
 262         }
 263         this._callsite_flags = callSiteFlags;
 264 
 265         final Option<?> timezoneOption = options.get("timezone");
 266         if (timezoneOption != null) {
 267             this._timezone = (TimeZone)timezoneOption.getValue();
 268         } else {
 269             this._timezone  = TimeZone.getDefault();
 270         }
 271 
 272         final Option<?> localeOption = options.get("locale");
 273         if (localeOption != null) {
 274             this._locale = (Locale)localeOption.getValue();
 275         } else {
 276             this._locale = Locale.getDefault();
 277         }
 278     }
 279 
 280     /**
 281      * Can we specialize a particular method name?
 282      * @param functionName method name
 283      * @return true if we are allowed to generate versions of this method
 284      */
 285     public boolean canSpecialize(final String functionName) {
 286         if (_specialize_calls == null) {
 287             return false;
 288         }
 289         return _specialize_calls.isEmpty() || _specialize_calls.contains(functionName);
 290     }
 291 
 292     /**
 293      * Get the output stream for this environment
 294      * @return output print writer
 295      */
 296     public PrintWriter getOut() {
 297         return out;