org.jruby
Class RubyInstanceConfig

java.lang.Object
  extended by org.jruby.RubyInstanceConfig

public class RubyInstanceConfig
extends java.lang.Object


Nested Class Summary
static class RubyInstanceConfig.CompileMode
           
static interface RubyInstanceConfig.LoadServiceCreator
           
static class RubyInstanceConfig.ProfilingMode
           
 
Field Summary
static boolean CAN_SET_ACCESSIBLE
           
static int CHAINED_COMPILE_LINE_COUNT
          The number of lines at which a method, class, or block body is split into chained methods (to dodge 64k method-size limit in JVM).
static int CHAINED_COMPILE_LINE_COUNT_DEFAULT
          Default size for chained compilation.
 int characterIndex
           
static java.lang.String COMPILE_EXCLUDE
           
static boolean DEBUG_LAUNCHING
           
static boolean DEBUG_LOAD_SERVICE
           
static boolean DEBUG_LOAD_TIMINGS
           
static boolean DEBUG_SCRIPT_RESOLUTION
           
static boolean DYNOPT_COMPILE_ENABLED
           
static boolean ERRNO_BACKTRACE
           
static boolean FASTEST_COMPILE_ENABLED
           
static boolean FASTOPS_COMPILE_ENABLED
           
static boolean FASTSEND_COMPILE_ENABLED
           
static boolean FULL_TRACE_ENABLED
           
static boolean INLINE_DYNCALL_ENABLED
           
static boolean INTERFACES_USE_PROXY
           
static int JAVA_VERSION
          The version to use for generated classes.
static boolean JIT_CACHE_ENABLED
           
static java.lang.String JIT_CODE_CACHE
           
static boolean JIT_LOADING_DEBUG
           
static int JIT_MAX_METHODS_LIMIT
          The max count of active methods eligible for JIT-compilation.
static int JIT_MAX_SIZE_LIMIT
          The max size of JIT-compiled methods (full class size) allowed.
static int JIT_THRESHOLD
          The JIT threshold to the specified method invocation count.
static boolean JUMPS_HAVE_BACKTRACE
           
static boolean LAZYHANDLES_COMPILE
           
static boolean NATIVE_NET_PROTOCOL
           
static boolean nativeEnabled
           
static boolean NO_UNWRAP_PROCESS_STREAMS
           
static boolean NOGUARDS_COMPILE_ENABLED
           
static boolean PEEPHOLE_OPTZ
           
static int POOL_MAX
           
static int POOL_MIN
           
static int POOL_TTL
           
static boolean POOLING_ENABLED
           
static boolean REFLECTED_HANDLES
           
static boolean REIFY_LOG_ERRORS
           
static boolean REIFY_RUBY_CLASSES
           
static boolean THREADLESS_COMPILE_ENABLED
           
static boolean USE_GENERATED_HANDLES
           
 
Constructor Summary
RubyInstanceConfig()
           
RubyInstanceConfig(RubyInstanceConfig parentConfig)
           
 
Method Summary
 LoadService createLoadService(Ruby runtime)
           
 java.lang.String displayedFileName()
           
 java.lang.String[] getArgv()
           
 java.lang.String getBasicUsageHelp()
           
 ClassCache getClassCache()
           
 CompatVersion getCompatVersion()
           
 RubyInstanceConfig.CompileMode getCompileMode()
           
 java.lang.String getCopyrightString()
           
 java.lang.String getCurrentDirectory()
           
 java.util.Map getEnvironment()
           
 java.io.PrintStream getError()
           
 java.util.Set getExcludedMethods()
           
 java.lang.String getExtendedHelp()
           
 java.lang.String getExternalEncoding()
           
 java.lang.String getInPlaceBackupExtention()
           
 java.io.InputStream getInput()
           
 java.lang.String getInputFieldSeparator()
           
 java.lang.String getInternalEncoding()
           
 int getJitLogEvery()
           
 int getJitMax()
           
 int getJitMaxSize()
           
 int getJitThreshold()
           
 java.lang.String getJRubyHome()
           
 KCode getKCode()
           
 java.lang.ClassLoader getLoader()
           
 RubyInstanceConfig.LoadServiceCreator getLoadServiceCreator()
           
 java.util.Map getOptionGlobals()
           
 java.io.PrintStream getOutput()
           
 Profile getProfile()
           
 RubyInstanceConfig.ProfilingMode getProfilingMode()
           
 java.lang.String getPropertyHelp()
           
 java.lang.String getRecordSeparator()
           
 int getSafeLevel()
           
 java.lang.String getScriptFileName()
           
 java.io.InputStream getScriptSource()
           
 java.lang.String getThreadDumpSignal()
           
 TraceType getTraceType()
           
 java.lang.Boolean getVerbose()
           
 java.lang.String getVersionString()
           
static boolean hasLoadedNativeExtensions()
           
 boolean hasShebangLine()
           
 byte[] inlineScript()
           
 boolean isAssumeLoop()
           
 boolean isAssumePrinting()
           
 boolean isBenchmarking()
           
 boolean isDebug()
           
 boolean isDisableGems()
           
 boolean isHardExit()
           
 boolean isInlineScript()
           
 boolean isJitDumping()
           
 boolean isJitLogging()
           
 boolean isJitLoggingVerbose()
           
 boolean isManagementEnabled()
           
 boolean isObjectSpaceEnabled()
           
 boolean isParserDebug()
           
 boolean isProcessLineEnds()
           
 boolean isProfiling()
           
 boolean isProfilingEntireRun()
           
 boolean isRunRubyInProcess()
           
 boolean isSamplingEnabled()
           
protected static boolean isShebangLine(java.lang.String line)
           
 boolean isShouldCheckSyntax()
           
 boolean isShouldRunInterpreter()
           
 boolean isShowBytecode()
           
 boolean isShowCopyright()
           
 boolean isShowVersion()
           
 boolean isSplit()
           
 boolean isVerbose()
           
 boolean isxFlag()
           
 java.util.List<java.lang.String> loadPaths()
           
 AbstractProfilePrinter makeDefaultProfilePrinter(IProfileData profileData)
           
 ASTCompiler newCompiler()
           
 java.lang.String[] parseShebangOptions(java.io.InputStream in)
          The intent here is to gather up any options that might have been specified in the shebang line and return them so they can be merged into the ones specified on the commandline.
 void processArguments(java.lang.String[] arguments)
           
 java.util.Collection<java.lang.String> requiredLibraries()
           
 void setArgv(java.lang.String[] argv)
           
 void setClassCache(ClassCache classCache)
           
 void setCompatVersion(CompatVersion compatVersion)
           
 void setCompileMode(RubyInstanceConfig.CompileMode compileMode)
           
 void setCurrentDirectory(java.lang.String newCurrentDirectory)
           
 void setDebug(boolean debug)
           
 void setDisableGems(boolean dg)
           
 void setEnvironment(java.util.Map newEnvironment)
           
 void setError(java.io.PrintStream newError)
           
 void setHardExit(boolean hardExit)
           
 void setHasShebangLine(boolean hasShebangLine)
           
 void setInput(java.io.InputStream newInput)
           
 void setJitLogEvery(int jitLogEvery)
           
 void setJitMax(int jitMax)
           
 void setJitMaxSize(int jitMaxSize)
           
 void setJitThreshold(int jitThreshold)
           
 void setJRubyHome(java.lang.String home)
           
 void setKCode(KCode kcode)
           
static void setLoadedNativeExtensions(boolean loadedNativeExtensions)
           
 void setLoader(java.lang.ClassLoader loader)
           
 void setLoadPaths(java.util.List<java.lang.String> loadPaths)
           
 void setLoadServiceCreator(RubyInstanceConfig.LoadServiceCreator creator)
           
 void setObjectSpaceEnabled(boolean newObjectSpaceEnabled)
           
 void setOutput(java.io.PrintStream newOutput)
           
 void setProfile(Profile newProfile)
           
 void setRecordSeparator(java.lang.String recordSeparator)
           
 void setRunRubyInProcess(boolean flag)
           
 void setScriptFileName(java.lang.String scriptFileName)
           
protected  void setShowBytecode(boolean showBytecode)
           
protected  void setShowCopyright(boolean showCopyright)
           
protected  void setShowVersion(boolean showVersion)
           
 void setTraceType(TraceType traceType)
           
 boolean shouldPrintProperties()
           
 boolean shouldPrintUsage()
           
 boolean shouldRunInterpreter()
           
 void tryProcessArgumentsWithRubyopts()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JIT_MAX_METHODS_LIMIT

public static final int JIT_MAX_METHODS_LIMIT
The max count of active methods eligible for JIT-compilation.

See Also:
Constant Field Values

JIT_MAX_SIZE_LIMIT

public static final int JIT_MAX_SIZE_LIMIT
The max size of JIT-compiled methods (full class size) allowed.

See Also:
Constant Field Values

JIT_THRESHOLD

public static final int JIT_THRESHOLD
The JIT threshold to the specified method invocation count.

See Also:
Constant Field Values

JAVA_VERSION

public static final int JAVA_VERSION
The version to use for generated classes. Set to current JVM version by default


CHAINED_COMPILE_LINE_COUNT_DEFAULT

public static final int CHAINED_COMPILE_LINE_COUNT_DEFAULT
Default size for chained compilation.

See Also:
Constant Field Values

CHAINED_COMPILE_LINE_COUNT

public static final int CHAINED_COMPILE_LINE_COUNT
The number of lines at which a method, class, or block body is split into chained methods (to dodge 64k method-size limit in JVM).


PEEPHOLE_OPTZ

public static final boolean PEEPHOLE_OPTZ

DYNOPT_COMPILE_ENABLED

public static boolean DYNOPT_COMPILE_ENABLED

NOGUARDS_COMPILE_ENABLED

public static boolean NOGUARDS_COMPILE_ENABLED

FASTEST_COMPILE_ENABLED

public static boolean FASTEST_COMPILE_ENABLED

FASTOPS_COMPILE_ENABLED

public static boolean FASTOPS_COMPILE_ENABLED

THREADLESS_COMPILE_ENABLED

public static boolean THREADLESS_COMPILE_ENABLED

FASTSEND_COMPILE_ENABLED

public static boolean FASTSEND_COMPILE_ENABLED

LAZYHANDLES_COMPILE

public static boolean LAZYHANDLES_COMPILE

INLINE_DYNCALL_ENABLED

public static boolean INLINE_DYNCALL_ENABLED

POOLING_ENABLED

public static final boolean POOLING_ENABLED

POOL_MAX

public static final int POOL_MAX

POOL_MIN

public static final int POOL_MIN

POOL_TTL

public static final int POOL_TTL

NATIVE_NET_PROTOCOL

public static final boolean NATIVE_NET_PROTOCOL

FULL_TRACE_ENABLED

public static boolean FULL_TRACE_ENABLED

COMPILE_EXCLUDE

public static final java.lang.String COMPILE_EXCLUDE

nativeEnabled

public static boolean nativeEnabled

REIFY_RUBY_CLASSES

public static final boolean REIFY_RUBY_CLASSES

REIFY_LOG_ERRORS

public static final boolean REIFY_LOG_ERRORS

USE_GENERATED_HANDLES

public static final boolean USE_GENERATED_HANDLES

DEBUG_LOAD_SERVICE

public static final boolean DEBUG_LOAD_SERVICE

DEBUG_LOAD_TIMINGS

public static final boolean DEBUG_LOAD_TIMINGS

DEBUG_LAUNCHING

public static final boolean DEBUG_LAUNCHING

DEBUG_SCRIPT_RESOLUTION

public static final boolean DEBUG_SCRIPT_RESOLUTION

JUMPS_HAVE_BACKTRACE

public static final boolean JUMPS_HAVE_BACKTRACE

JIT_CACHE_ENABLED

public static final boolean JIT_CACHE_ENABLED

JIT_CODE_CACHE

public static final java.lang.String JIT_CODE_CACHE

REFLECTED_HANDLES

public static final boolean REFLECTED_HANDLES

NO_UNWRAP_PROCESS_STREAMS

public static final boolean NO_UNWRAP_PROCESS_STREAMS

INTERFACES_USE_PROXY

public static final boolean INTERFACES_USE_PROXY

JIT_LOADING_DEBUG

public static final boolean JIT_LOADING_DEBUG

CAN_SET_ACCESSIBLE

public static final boolean CAN_SET_ACCESSIBLE

ERRNO_BACKTRACE

public static final boolean ERRNO_BACKTRACE

characterIndex

public int characterIndex
Constructor Detail

RubyInstanceConfig

public RubyInstanceConfig(RubyInstanceConfig parentConfig)

RubyInstanceConfig

public RubyInstanceConfig()
Method Detail

hasShebangLine

public boolean hasShebangLine()

setHasShebangLine

public void setHasShebangLine(boolean hasShebangLine)

isxFlag

public boolean isxFlag()

getLoadServiceCreator

public RubyInstanceConfig.LoadServiceCreator getLoadServiceCreator()

setLoadServiceCreator

public void setLoadServiceCreator(RubyInstanceConfig.LoadServiceCreator creator)

createLoadService

public LoadService createLoadService(Ruby runtime)

getBasicUsageHelp

public java.lang.String getBasicUsageHelp()

getExtendedHelp

public java.lang.String getExtendedHelp()

getPropertyHelp

public java.lang.String getPropertyHelp()

getVersionString

public java.lang.String getVersionString()

getCopyrightString

public java.lang.String getCopyrightString()

processArguments

public void processArguments(java.lang.String[] arguments)

tryProcessArgumentsWithRubyopts

public void tryProcessArgumentsWithRubyopts()

parseShebangOptions

public java.lang.String[] parseShebangOptions(java.io.InputStream in)
The intent here is to gather up any options that might have been specified in the shebang line and return them so they can be merged into the ones specified on the commandline. This is kind of a hopeless task because it's impossible to figure out where the command invocation stops and the parameters start. We try to work with the common scenarios where /usr/bin/env is used to invoke the jruby shell script, and skip any parameters it might have. Then we look for the interpreter invokation and assume that the binary will have the word "ruby" in the name. This is error prone but should cover more cases than the previous code.


isShebangLine

protected static boolean isShebangLine(java.lang.String line)

getCompileMode

public RubyInstanceConfig.CompileMode getCompileMode()

setCompileMode

public void setCompileMode(RubyInstanceConfig.CompileMode compileMode)

isJitLogging

public boolean isJitLogging()

isJitDumping

public boolean isJitDumping()

isJitLoggingVerbose

public boolean isJitLoggingVerbose()

getJitLogEvery

public int getJitLogEvery()

setJitLogEvery

public void setJitLogEvery(int jitLogEvery)

isSamplingEnabled

public boolean isSamplingEnabled()

getJitThreshold

public int getJitThreshold()

setJitThreshold

public void setJitThreshold(int jitThreshold)

getJitMax

public int getJitMax()

setJitMax

public void setJitMax(int jitMax)

getJitMaxSize

public int getJitMaxSize()

setJitMaxSize

public void setJitMaxSize(int jitMaxSize)

isRunRubyInProcess

public boolean isRunRubyInProcess()

setRunRubyInProcess

public void setRunRubyInProcess(boolean flag)

setInput

public void setInput(java.io.InputStream newInput)

getInput

public java.io.InputStream getInput()

getCompatVersion

public CompatVersion getCompatVersion()

setCompatVersion

public void setCompatVersion(CompatVersion compatVersion)

setOutput

public void setOutput(java.io.PrintStream newOutput)

getOutput

public java.io.PrintStream getOutput()

setError

public void setError(java.io.PrintStream newError)

getError

public java.io.PrintStream getError()

setCurrentDirectory

public void setCurrentDirectory(java.lang.String newCurrentDirectory)

getCurrentDirectory

public java.lang.String getCurrentDirectory()

setProfile

public void setProfile(Profile newProfile)

getProfile

public Profile getProfile()

setObjectSpaceEnabled

public void setObjectSpaceEnabled(boolean newObjectSpaceEnabled)

isObjectSpaceEnabled

public boolean isObjectSpaceEnabled()

setEnvironment

public void setEnvironment(java.util.Map newEnvironment)

getEnvironment

public java.util.Map getEnvironment()

getLoader

public java.lang.ClassLoader getLoader()

setLoader

public void setLoader(java.lang.ClassLoader loader)

getArgv

public java.lang.String[] getArgv()

setArgv

public void setArgv(java.lang.String[] argv)

getJRubyHome

public java.lang.String getJRubyHome()

setJRubyHome

public void setJRubyHome(java.lang.String home)

inlineScript

public byte[] inlineScript()

requiredLibraries

public java.util.Collection<java.lang.String> requiredLibraries()

loadPaths

public java.util.List<java.lang.String> loadPaths()

setLoadPaths

public void setLoadPaths(java.util.List<java.lang.String> loadPaths)

shouldRunInterpreter

public boolean shouldRunInterpreter()

shouldPrintUsage

public boolean shouldPrintUsage()

shouldPrintProperties

public boolean shouldPrintProperties()

isInlineScript

public boolean isInlineScript()

getScriptSource

public java.io.InputStream getScriptSource()

displayedFileName

public java.lang.String displayedFileName()

setScriptFileName

public void setScriptFileName(java.lang.String scriptFileName)

getScriptFileName

public java.lang.String getScriptFileName()

isBenchmarking

public boolean isBenchmarking()

isAssumeLoop

public boolean isAssumeLoop()

isAssumePrinting

public boolean isAssumePrinting()

isProcessLineEnds

public boolean isProcessLineEnds()

isSplit

public boolean isSplit()

isVerbose

public boolean isVerbose()

getVerbose

public java.lang.Boolean getVerbose()

isDebug

public boolean isDebug()

setDebug

public void setDebug(boolean debug)

isParserDebug

public boolean isParserDebug()

isShowVersion

public boolean isShowVersion()

isShowBytecode

public boolean isShowBytecode()

isShowCopyright

public boolean isShowCopyright()

setShowVersion

protected void setShowVersion(boolean showVersion)

setShowBytecode

protected void setShowBytecode(boolean showBytecode)

setShowCopyright

protected void setShowCopyright(boolean showCopyright)

isShouldRunInterpreter

public boolean isShouldRunInterpreter()

isShouldCheckSyntax

public boolean isShouldCheckSyntax()

getInputFieldSeparator

public java.lang.String getInputFieldSeparator()

getKCode

public KCode getKCode()

setKCode

public void setKCode(KCode kcode)

getInternalEncoding

public java.lang.String getInternalEncoding()

getExternalEncoding

public java.lang.String getExternalEncoding()

getRecordSeparator

public java.lang.String getRecordSeparator()

getSafeLevel

public int getSafeLevel()

setRecordSeparator

public void setRecordSeparator(java.lang.String recordSeparator)

getClassCache

public ClassCache getClassCache()

getInPlaceBackupExtention

public java.lang.String getInPlaceBackupExtention()

setClassCache

public void setClassCache(ClassCache classCache)

getOptionGlobals

public java.util.Map getOptionGlobals()

isManagementEnabled

public boolean isManagementEnabled()

getExcludedMethods

public java.util.Set getExcludedMethods()

newCompiler

public ASTCompiler newCompiler()

getThreadDumpSignal

public java.lang.String getThreadDumpSignal()

isHardExit

public boolean isHardExit()

setHardExit

public void setHardExit(boolean hardExit)

isProfiling

public boolean isProfiling()

isProfilingEntireRun

public boolean isProfilingEntireRun()

getProfilingMode

public RubyInstanceConfig.ProfilingMode getProfilingMode()

makeDefaultProfilePrinter

public AbstractProfilePrinter makeDefaultProfilePrinter(IProfileData profileData)

isDisableGems

public boolean isDisableGems()

setDisableGems

public void setDisableGems(boolean dg)

getTraceType

public TraceType getTraceType()

setTraceType

public void setTraceType(TraceType traceType)

hasLoadedNativeExtensions

public static boolean hasLoadedNativeExtensions()

setLoadedNativeExtensions

public static void setLoadedNativeExtensions(boolean loadedNativeExtensions)


Copyright © 2002-2009 JRuby Team. All Rights Reserved.