Top Description Inners Fields Constructors Methods
org.jruby.runtime

public Class Helpers

extends Object
Class Inheritance
Known Direct Subclasses
org.jruby.javasupport.util.RuntimeHelpers
Imports
java.io.EOFException, .FileNotFoundException, .IOException, java.lang.invoke.MethodHandle, .MethodHandles, .MethodType, java.lang.reflect.Array, java.net.PortUnreachableException, java.nio.channels.ClosedChannelException, .NonReadableChannelException, .NonWritableChannelException, .NotYetConnectedException, java.nio.charset.Charset, java.nio.file.AccessDeniedException, .AtomicMoveNotSupportedException, .FileAlreadyExistsException, .FileSystemLoopException, .NoSuchFileException, .NotDirectoryException, java.util.ArrayList, .Arrays, .BitSet, .Collection, .Collections, .HashMap, .List, .Map, .StringTokenizer, java.util.concurrent.Callable, java.util.function.Function, .IntFunction, java.util.regex.Pattern, java.util.stream.Collectors, com.headius.invokebinder.Binder, jnr.constants.platform.Errno, org.jruby.*, org.jruby.api.Create, org.jruby.ast.ArgsNode, .ArgumentNode, .MultipleAsgnNode, .Node, .UnnamedRestArgNode, .RequiredKeywordArgumentValueNode, org.jruby.ast.types.INameNode, org.jruby.ast.util.ArgsUtil, org.jruby.exceptions.ArgumentError, .NoMethodError, .RaiseException, .Unrescuable, org.jruby.internal.runtime.methods.*, org.jruby.ir.IRScope, .IRScopeType, .Interp, .JIT, org.jruby.ir.operands.UndefinedValue, org.jruby.ir.runtime.IRRuntimeHelpers, org.jruby.javasupport.Java, .JavaUtil, org.jruby.javasupport.proxy.ReifiedJavaProxy, org.jruby.parser.StaticScope, .StaticScopeFactory, org.jruby.runtime.JavaSites.HelpersSites, org.jruby.runtime.backtrace.BacktraceData, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.callsite.CacheEntry, org.jruby.runtime.invokedynamic.MethodNames, org.jruby.util.ArraySupport, .ByteList, .CodegenUtils, .CommonByteLists, .MurmurHash, .TypeConverter, org.jcodings.Encoding, org.jcodings.specific.ASCIIEncoding, .USASCIIEncoding, .UTF8Encoding, org.jcodings.unicode.UnicodeEncoding, org.jruby.util.io.EncodingUtils

Helper methods which are called by the compiler.

Note

These will show no consumers, but generated code does call these so don't remove them thinking they are dead code.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Helpers.MethodMissingWrapper

Wraps the target method_missing implementation, passing the called method name as a leading symbol argument.

Field Summary

Modifier and TypeField and Description
private static final MethodHandle[]
private static final MethodHandle[]
private static final MethodHandles.Lookup
public static final int
public static final int
public static final int
public static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static int
addBufferLength(Ruby runtime, int base, int extra)
Deprecated since 10.0.

public static int

Returns:

the combined buffer size, or MAX_ARRAY_SIZE
addBufferLength
(ThreadContext
the current thread context
context
,
int
the base size
base
,
int
the extra buffer size
extra
)

Calculate a buffer length based on a base size and a extra size.

public static RubySymbol
addInstanceMethod(RubyModule containingClass, String name, DynamicMethod method, Visibility visibility, ThreadContext context, Ruby runtime)
Deprecated

public static RubySymbol
addInstanceMethod(RubyModule containingClass, RubySymbol symbol, DynamicMethod method, Visibility visibility, ThreadContext context, Ruby runtime)
Deprecated

public static RubySymbol
addInstanceMethod(RubyModule containingClass, RubySymbol symbol, DynamicMethod method, Visibility visibility, ThreadContext context)

public static boolean
additionOverflowed(long original, long other, long result)

private static void
addModuleMethod(RubyModule containingClass, DynamicMethod method, ThreadContext context, RubySymbol sym)

public static IRubyObject[]
public static RubyString
appendAsString(RubyString target, IRubyObject other)
Deprecated

public static RubyString
appendByteList(RubyString target, ByteList source)
Deprecated

public static IRubyObject[]
public static RubyArray<T extends IRubyObject>
argsCat(ThreadContext context, IRubyObject first, IRubyObject second)

public static RubyArray<T extends IRubyObject>
argsCat(IRubyObject first, IRubyObject second)
Deprecated

public static IRubyObject[]
argsCatToArguments(IRubyObject[] args, IRubyObject cat)
Deprecated

public static ArgumentDescriptor[]
argsNodeToArgumentDescriptors(ArgsNode argsNode)

Use an ArgsNode (used for blocks) to generate ArgumentDescriptors

public static RubyArray<T extends IRubyObject>
argsPush(ThreadContext context, RubyArray<T extends IRubyObject> first, IRubyObject second)
Deprecated

public static RubyArray<T extends IRubyObject>
argsPush(ThreadContext context, IRubyObject first, IRubyObject second, boolean usesKeywords)

public static RubyArray<T extends IRubyObject>
argumentDescriptorsToParameters(Ruby runtime, ArgumentDescriptor[] argsDesc, boolean isLambda)
Deprecated since 10.0.

public static RubyArray<T extends IRubyObject>
argumentDescriptorsToParameters(ThreadContext context, ArgumentDescriptor[] argsDesc, boolean isLambda)

Convert a parameter list from ArgumentDescriptor format to "Array of Array" format

public static IRubyObject
arrayEntryOrNil(RubyArray<T extends IRubyObject> array, int index)
Deprecated

public static IRubyObject
arrayEntryOrNilOne(RubyArray<T extends IRubyObject> array)
Deprecated

public static IRubyObject
arrayEntryOrNilTwo(RubyArray<T extends IRubyObject> array)
Deprecated

public static IRubyObject
arrayEntryOrNilZero(RubyArray<T extends IRubyObject> array)
Deprecated

public static <T> T[]
arrayOf(T... values)

public static IRubyObject[]
arrayOf(IRubyObject first, IRubyObject... values)

public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static <T> T[]
arrayOf(T[] values, T last, IntFunction<T[]> allocator)

public static <T> T[]
arrayOf(Class<T> t, int size, T fill)

public static IRubyObject
arrayPostOrNil(RubyArray<T extends IRubyObject> array, int pre, int post, int index)
Deprecated

public static IRubyObject
arrayPostOrNilOne(RubyArray<T extends IRubyObject> array, int pre, int post)
Deprecated

public static IRubyObject
arrayPostOrNilTwo(RubyArray<T extends IRubyObject> array, int pre, int post)
Deprecated

public static IRubyObject
arrayPostOrNilZero(RubyArray<T extends IRubyObject> array, int pre, int post)
Deprecated

public static RubyArray<T extends IRubyObject>
arrayValue(IRubyObject value)
Deprecated since 10.0.

public static RubyArray<T extends IRubyObject>

Returns:

""
arrayValue
(ThreadContext context, Ruby runtime, IRubyObject value)

public static RubyArray<T extends IRubyObject>
public static IRubyObject
public static IRubyObject
aryToAry(IRubyObject value)
Deprecated

public static IRubyObject
public static RubyArray<T extends IRubyObject>
asArray(ThreadContext context, IRubyObject value)
Deprecated

public static IRubyObject
aValueSplat(IRubyObject value)
Deprecated

public static IRubyObject
backref(ThreadContext context)
Deprecated

public static IRubyObject
backrefLastMatch(ThreadContext context)
Deprecated

public static IRubyObject
backrefMatchLast(ThreadContext context)
Deprecated

public static IRubyObject
backrefMatchPost(ThreadContext context)
Deprecated

public static IRubyObject
backrefMatchPre(ThreadContext context)
Deprecated

public static boolean
BNE(ThreadContext context, IRubyObject value1, IRubyObject value2)

public static IRubyObject
public static String

Returns:

the decoded string
byteListToString
(final ByteList
the bytelist to decode
bytes
)

Convert a ByteList into a Java String by using its Encoding's Charset.

public static int

Returns:

a larger buffer length with extra room for growth, or else the max array size
calculateBufferLength
(int
the required length
length
)

Calculate a buffer length based on the required length, expanding by 1.5x or to the maximum array size.

public static int
calculateBufferLength(Ruby runtime, int length)

Same as calculateBufferLength(int) but raises a Ruby ArgumentError.

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject[] args, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject[] args, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, Block block)

public static IRubyObject
callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, Block block)

private static void
callNormalMethodHook(RubyModule containingClass, ThreadContext context, RubySymbol name)

private static void
public static void
checkArgumentCount(ThreadContext
thread context
context
,
IRubyObject[]
arguments array
args
,
int
minimum required
min
,
int
maximum allowed
max
)

Used by the compiler to simplify arg checking in variable-arity paths

public static void
checkArgumentCount(ThreadContext
thread context
context
,
IRubyObject[]
arguments array
args
,
int
required number
req
)

Used by the compiler to simplify arg checking in variable-arity paths

public static void
checkArgumentCount(ThreadContext context, int length, int min, int max)

public static RubyModule
checkIsModule(IRubyObject maybeModule)
Deprecated since 10.0.

public static boolean
checkJavaException(final IRubyObject wrappedEx, final Throwable ex, IRubyObject catchable, ThreadContext context)

public static boolean
checkJavaException(final Throwable ex, IRubyObject catchable, ThreadContext context)

public static void
public static void
public static void
private static IRubyObject
coerceProc(IRubyObject maybeProc, Ruby runtime)

public static IRubyObject[]
public static RubyHash
constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1)

public static RubyHash
constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2)

public static RubyHash
constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2, IRubyObject key3, IRubyObject value3, boolean prepareString3)

public static RubyHash
constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2, IRubyObject key3, IRubyObject value3, boolean prepareString3, IRubyObject key4, IRubyObject value4, boolean prepareString4)

public static RubyHash
constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2, IRubyObject key3, IRubyObject value3, boolean prepareString3, IRubyObject key4, IRubyObject value4, boolean prepareString4, IRubyObject key5, IRubyObject value5, boolean prepareString5)

public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static MethodHandle
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyArray<T extends IRubyObject>
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static RubyString[]
public static MethodHandle
public static RubyHash
public static RubyHash
public static RubyHash
constructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3)

public static RubyHash
constructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3, IRubyObject key4, IRubyObject value4)

public static RubyHash
constructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3, IRubyObject key4, IRubyObject value4, IRubyObject key5, IRubyObject value5)

public static String[]
public static String[]
public static String[]
public static String[]
public static String[]
constructStringArray(String one, String two, String three, String four, String five)

public static String[]
constructStringArray(String one, String two, String three, String four, String five, String six)

public static String[]
constructStringArray(String one, String two, String three, String four, String five, String six, String seven)

public static String[]
constructStringArray(String one, String two, String three, String four, String five, String six, String seven, String eight)

public static String[]
constructStringArray(String one, String two, String three, String four, String five, String six, String seven, String eight, String nine)

public static String[]
constructStringArray(String one, String two, String three, String four, String five, String six, String seven, String eight, String nine, String ten)

private static IRubyObject[]
convertSplatToJavaArray(ThreadContext context, IRubyObject value)
Deprecated since 9.4-.

public static CacheEntry
createMethodMissingEntry(ThreadContext context, RubyClass selfClass, CallType callType, Visibility visibility, int token, String methodName)

public static RubyArray<T extends IRubyObject>
createSubarray(RubyArray<T extends IRubyObject> input, int start)

public static RubyArray<T extends IRubyObject>
createSubarray(RubyArray<T extends IRubyObject> input, int start, int post)

public static RubyArray<T extends IRubyObject>
createSubarray(IRubyObject[] input, Ruby runtime, int start)

public static RubyArray<T extends IRubyObject>
createSubarray(IRubyObject[] input, Ruby runtime, int start, int exclude)

public static String

Returns:

a Java String representation of the ByteList
decodeByteList
(Ruby
the current runtime
runtime
,
ByteList
the bytelist
value
)

Decode a given ByteList to a Java string.

public static int[]
public static double[]
decodeDoubleString(String fixnumString)

private static long
decodeLongFromChars(char[] charValues, int index)

public static long[]
decodeLongString(String fixnumString)

pack-priv static StaticScope
decodeScope(ThreadContext context, StaticScope parent, String scopeString)

public static StaticScope
private static String[][]
public static String
public static IRubyObject
elementOrNil(IRubyObject[] input, int element, IRubyObject nil)

public static IRubyObject
elementOrNull(IRubyObject[] input, int element)

public static String
encodeCaptureOffsets(int[] scopeOffsets)

public static String
private static void
encodeLongAsChars(char[] chars, int index, long value)

public static String
public static String
encodeParameterList(List<String[]> args)
Deprecated

pack-priv static String
public static RubyArray<T extends IRubyObject>
ensureRubyArray(IRubyObject value)
Deprecated

public static RubyArray<T extends IRubyObject>
ensureRubyArray(Ruby runtime, IRubyObject value)
Deprecated since 10.0.

public static RubyArray<T extends IRubyObject>
public static Errno

Returns:

the resulting Errno value, or null if none could be determined.
errnoFromException
(Throwable
the exception to convert to an Errno
t
)

This method attempts to produce an Errno value for the given exception.

private static Errno
public static boolean

Returns:

false if `exception: false`, true otherwise
extractExceptionOnlyArg
(ThreadContext context, RubyHash opts)

Note

Assumes exception: ...

public static boolean

Returns:

false if `exception: false`, true (or default value) otherwise
extractExceptionOnlyArg
(ThreadContext context, IRubyObject
the keyword args hash
opts
,
boolean
to return when no keyword options
defValue
)

Note

Assumes exception: ...

public static boolean

Returns:

false if `exception: false`, true (or default value) otherwise
extractExceptionOnlyArg
(ThreadContext context, IRubyObject[]
method args
args
,
boolean
to return when no keyword options
defValue
)

Note

Assumes exception: ...

public static void
fillNil(final IRubyObject[] arr, int from, int to, Ruby runtime)
Deprecated since 10.0.

public static void
fillNil(ThreadContext context, final IRubyObject[] arr, int from, int to)

public static void
fillNil(IRubyObject[] arr, Ruby runtime)
Deprecated since 10.0.

public static void
public static RubyModule
findImplementerIfNecessary(RubyModule clazz, RubyModule implementationClass)

public static IRubyObject
getBackref(Ruby runtime, ThreadContext context)
Deprecated

public static Block
getBlock(ThreadContext context, IRubyObject self, Node node)

public static Block
getBlock(Ruby runtime, ThreadContext context, IRubyObject self, Node node, Block aBlock)

public static Block
getBlockFromBlockPassBody(Ruby runtime, IRubyObject proc, Block currentBlock)

public static Block
getBlockFromBlockPassBody(IRubyObject proc, Block currentBlock)
Deprecated since 10.0.

private static Block
getBlockFromProc(Block currentBlock, IRubyObject proc)

public static String
public static IRubyObject
getDefinedCall(ThreadContext context, IRubyObject self, IRubyObject receiver, String name, IRubyObject definedMessage)

public static IRubyObject
getDefinedConstantOrBoundMethod(IRubyObject left, String name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage)
Deprecated since 10.0.

public static IRubyObject
getDefinedConstantOrBoundMethod(ThreadContext context, IRubyObject left, String name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage)

public static IRubyObject
getErrorInfo(Ruby runtime)
Deprecated

public static IRubyObject
getGlobalVariable(Ruby runtime, String name)

public static Block
public static IRubyObject
getInstanceVariable(IRubyObject self, Ruby runtime, String internedName)

public static IRubyObject
public static IRubyObject
getLastLine(Ruby runtime, ThreadContext context)

public static String
getLocalJumpTypeOrRethrow(RaiseException re)
Deprecated since 10.0.

private static CacheEntry
getMethodCached(ThreadContext context, RubyClass metaclass, int index, String name)

public static RubyModule
getNthScopeModule(StaticScope scope, int depth)

public static String[]
getScopeNames(String scopeNames)

public static RubyClass
getSingletonClass(Ruby runtime, IRubyObject receiver)
Deprecated since 10.0.

public static Class<T>[]
getStaticMethodParams(Class<T> target, int args)

public static String
getStaticMethodSignature(String classname, int args)

public static StaticScope
public static RubyModule
getSuperClassForDefined(Ruby runtime, RubyModule klazz)
Deprecated since 10.0.

public static String
public static void
handleArgumentSizes(ThreadContext context, Ruby runtime, int given, int required, int opt, int rest)

public static long
hashEnd(long value)

public static long
hashStart(Ruby runtime, long value)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, Block block)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, Block block)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, Block block)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject... args)

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, CallType callType, Block block)
Deprecated since 9.4-. Use finvoke if you do not want visibility-checking or invokeFrom if you do.

This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that.

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg, CallType callType, Block block)
Deprecated since 9.4-. Use finvoke if you do not want visibility-checking or invokeFrom if you do.

This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that.

public static IRubyObject
invoke(ThreadContext context, IRubyObject self, String name, CallType callType)
Deprecated since 9.4-. Use finvoke if you do not want visibility-checking or invokeFrom if you do.

This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that.

public static IRubyObject
invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject[] args, Block block)

public static IRubyObject
invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, Block block)

public static IRubyObject
invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, Block block)

public static IRubyObject
invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block)

public static IRubyObject
invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
invokedynamic(ThreadContext context, IRubyObject self, int index)
Deprecated

public static IRubyObject
invokedynamic(ThreadContext context, IRubyObject self, int index, IRubyObject arg0)
Deprecated

public static IRubyObject
invokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, IRubyObject[] args, CallType callType, Block block)
Deprecated

public static IRubyObject
invokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, IRubyObject arg, CallType callType, Block block)
Deprecated

public static IRubyObject
invokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, CallType callType)
Deprecated

public static IRubyObject
invokePublic(ThreadContext context, IRubyObject self, String name, IRubyObject arg)

MRI: rb_funcallv_public

public static IRubyObject
invokeSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block)

The protocol for super method invocation is a bit complicated in Ruby.

public static IRubyObject
invokeSuper(ThreadContext context, IRubyObject self, RubyModule klass, String name, IRubyObject[] args, Block block)

public static IRubyObject
invokeSuper(ThreadContext context, IRubyObject self, RubyModule klass, String name, IRubyObject arg0, Block block)

public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static void
irCheckArgsArrayArity(ThreadContext context, RubyArray<T extends IRubyObject> args, int required, int opt, boolean rest)

public static IRubyObject
isExceptionHandled(RubyException currentException, IRubyObject[] exceptions, ThreadContext context)

public static IRubyObject
isExceptionHandled(RubyException currentException, IRubyObject exception, ThreadContext context)

public static IRubyObject
isExceptionHandled(IRubyObject currentException, IRubyObject exception, ThreadContext context)

public static IRubyObject
isExceptionHandled(RubyException currentException, IRubyObject exception0, IRubyObject exception1, ThreadContext context)

public static IRubyObject
isExceptionHandled(RubyException currentException, IRubyObject exception0, IRubyObject exception1, IRubyObject exception2, ThreadContext context)

public static IRubyObject
isJavaExceptionHandled(Throwable currentThrowable, IRubyObject[] throwables, ThreadContext context)
Deprecated

public static IRubyObject
isJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable, ThreadContext context)
Deprecated

public static IRubyObject
isJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable0, IRubyObject throwable1, ThreadContext context)
Deprecated

public static IRubyObject
isJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable0, IRubyObject throwable1, IRubyObject throwable2, ThreadContext context)
Deprecated

public static boolean
isModuleAndHasConstant(IRubyObject left, String name)
Deprecated since 10.0.

public static boolean
public static boolean
public static String
javaStringFromPath(Ruby runtime, IRubyObject loadPathEntry)

public static IRubyObject
lastElement(IRubyObject[] ary)
Deprecated

public static final Map<String, String>
map(String... keyValues)

public static IRubyObject
match3(RubyRegexp regexp, IRubyObject value, ThreadContext context)
Deprecated

public static int

Returns:

the index of the requested byte or -1 if not found
memchr
(byte[]
the byte[] to search
ptr
,
int
starting position for search
start
,
final int
byte to find
find
,
int
length to search
len
)

Equivalent to C memchr with byte*.

public static int

Returns:

the index of the requested boolean or -1 if not found
memchr
(boolean[]
the boolean[] to search
ary
,
int
starting position for search
start
,
boolean
boolean to find
find
,
int
length to search
len
)

Equivalent to C memchr with bool*.

public static int
memchr(boolean[] ary, int start, int len, boolean find)
Deprecated since 10.0.

public static RubyClass
public static ArgumentDescriptor[]
methodToArgumentDescriptors(DynamicMethod method)
Deprecated since 10.0.

public static ArgumentDescriptor[]
public static IRubyObject
methodToParameters(Ruby runtime, AbstractRubyMethod recv)
Deprecated since 10.0.

public static IRubyObject
public static long
multAndMix(long seed, long hash)

public static int
multiplyBufferLength(Ruby runtime, int base, int multiplier)
Deprecated since 10.0.

public static int

Returns:

the multiplied size, if valid
multiplyBufferLength
(ThreadContext
the thread context
context
,
int
the base size
base
,
int
the multiplier
multiplier
)

Calculate a buffer length based on a base size and a multiplier.

public static long
murmur(long h, long k, int r)

public static long
murmur1(long h)

public static long
murmur_finish(long h)

public static long
murmur_step(long h, long k)

public static long
murmurCombine(long h, long i)

public static IRubyObject
negate(IRubyObject value, Ruby runtime)

public static Throwable

Returns:

a RaiseException subtype instance appropriate for the given exception
newErrorFromException
(Ruby
the current runtime
runtime
,
Throwable
the exception to translate into a Ruby error
t
,
Function<Throwable, Throwable>
a fallback function if the exception cannot be translated
els
)

Return a Ruby-friendly Throwable for a given Throwable.

public static Throwable

Returns:

a RaiseException subtype instance appropriate for the given exception
newErrorFromException
(Ruby
the current runtime
runtime
,
Throwable
the exception to translate into a Ruby error
t
)

Simplified form of Ruby#newErrorFromException with no default function.

public static RaiseException

Returns:

a RaiseException subtype instance appropriate for the given exception
newIOErrorFromException
(Ruby
the current runtime
runtime
,
IOException
the exception to translate into a Ruby error
ex
)

Construct an appropriate error (which may ultimately not be an IOError) for a given IOException.

public static RubyProc
public static RaiseException
public static IRubyObject[]

Returns:

a nil-filled IRubyObject array of the requested length
nilledArray
(int
the length of the array requested
length
,
Ruby
the current runtime
runtime
)

Return a nil-filled IRubyObject array of the specified length.

public static IRubyObject
nullToNil(IRubyObject value, ThreadContext context)
Deprecated

public static IRubyObject
nullToNil(IRubyObject value, Ruby runtime)
Deprecated

public static IRubyObject
public static IRubyObject
public static IRubyObject
optElementOrNull(IRubyObject[] input, int element, int postCount)

public static ArgumentDescriptor[]
parameterListToArgumentDescriptors(Ruby runtime, String[] parameterList, boolean isLambda)
Deprecated since 10.0.

public static ArgumentDescriptor[]
parameterListToArgumentDescriptors(ThreadContext context, String[] parameterList, boolean isLambda)

Convert a parameter list from prefix format to ArgumentDescriptor format.

public static Visibility
performNormalMethodChecksAndDetermineVisibility(Ruby runtime, RubyModule clazz, RubySymbol symbol, Visibility visibility)
Deprecated since 10.0.

public static Visibility
public static void
public static StaticScope
preLoad(ThreadContext context, String[] varNames)

public static void
preLoadCommon(ThreadContext context, StaticScope staticScope, boolean wrap)

public static String
rawBytesToString(byte[] bytes)

public static RubyBoolean
rbEql(ThreadContext context, IRubyObject a, IRubyObject b)

Equivalent to rb_eql in MRI

public static RubyBoolean
rbEqual(ThreadContext context, IRubyObject a, IRubyObject b)

Equivalent to rb_equal in MRI

public static RubyBoolean
rbEqual(ThreadContext context, IRubyObject a, IRubyObject b, CallSite equal)

Equivalent to rb_equal in MRI

public static void
registerEndBlock(Block block, Ruby runtime)
Deprecated

private static boolean
public static boolean
respondsToMethod(DynamicMethod method, boolean checkVisibility)

We have respondTo logic in RubyModule and we have a special callsite for respond_to?.

public static StaticScope
restoreScope(String descriptor, StaticScope enclosingScope)

pack-priv static IRubyObject[]
public static void
rewriteStackTrace(final Ruby runtime, final Throwable e)
Deprecated

public static IRubyObject
public static RubyFixnum
safeHash(final ThreadContext context, IRubyObject obj)

private static DynamicMethod
selectInternalMM(Ruby runtime, Visibility visibility, CallType callType)

public static DynamicMethod
selectMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType)

public static DynamicMethod
selectMethodMissing(ThreadContext context, RubyClass selfClass, Visibility visibility, String name, CallType callType)

public static DynamicMethod
selectMethodMissing(RubyClass selfClass, Visibility visibility, String name, CallType callType)

private static void
public static IRubyObject
setBackref(Ruby runtime, ThreadContext context, IRubyObject value)
Deprecated

public static IRubyObject
public static void
setErrorInfo(Ruby runtime, IRubyObject error)
Deprecated

public static IRubyObject
setGlobalVariable(IRubyObject value, Ruby runtime, String name)

public static IRubyObject
public static IRubyObject
setLastLine(Ruby runtime, ThreadContext context, IRubyObject value)

private static JavaSites.HelpersSites
public static IRubyObject[]
splatToArguments(IRubyObject value)
Deprecated since 9.4-.

public static RubyArray<T extends IRubyObject>
splatValue(IRubyObject value)
Deprecated since 9.4-.

public static void
storeExceptionInErrorInfo(Throwable currentThrowable, ThreadContext context)
Deprecated

public static IRubyObject
stringOrNil(ByteList value, ThreadContext context)
Deprecated

public static byte[]
public static RubyArray<T extends IRubyObject>
subarrayOrEmpty(RubyArray<T extends IRubyObject> array, Ruby runtime, int index)
Deprecated

public static RubyArray<T extends IRubyObject>
subarrayOrEmpty(RubyArray<T extends IRubyObject> array, Ruby runtime, int index, int post)
Deprecated

public static byte[]
subseq(byte[] ary, int start, int len)

public static boolean
subtractionOverflowed(long original, long other, long result)

public static String

Returns:

the resulting symbol string
symbolBytesToString
(ByteList
the value to decode
value
)

Decode the given value to a Java string using the following rules: * If the string is all US-ASCII characters, it will be decoded as US-ASCII.

public static void
throwErrorFromException(Ruby
the current runtime
runtime
,
Throwable
the exception to raise as an error, if appropriate, or as itself otherwise
t
)

Throw an appropriate Ruby-friendly error or exception for a given Java exception.

public static void
private static <T extends Throwable> void
public static IRubyObject[]
toArray(IRubyObject[] array, IRubyObject... rest)

public static IRubyObject[]
public static IRubyObject[]
public static IRubyObject[]
public static <T> T
tryThrow(Callable<T> call)

public static IRubyObject
public static int
validateBufferLength(Ruby runtime, long length)

public static int
validateBufferLength(ThreadContext context, long length)

Check that the buffer length requested is within the valid range of 0 to MAX_ARRAY_SIZE, or raise an argument error.

public static RubyArray<T extends IRubyObject>
viewArgsArray(ThreadContext context, RubyArray<T extends IRubyObject> rubyArray, int preArgsCount, int postArgsCount)

public static IRubyObject
wrapJavaException(final Ruby runtime, final Throwable ex)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait