Package org.jruby.runtime
Class Helpers
java.lang.Object
org.jruby.runtime.Helpers
- Direct Known Subclasses:
RuntimeHelpers
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 Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWraps the target method_missing implementation, passing the called method name as a leading symbol argument. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, int start) static IRubyObject[]aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, IRubyObject ten, int start) static intaddBufferLength(Ruby runtime, int base, int extra) Deprecated.static intaddBufferLength(ThreadContext context, int base, int extra) Calculate a buffer length based on a base size and a extra size.static RubySymboladdInstanceMethod(RubyModule containingClass, String name, DynamicMethod method, Visibility visibility, ThreadContext context, Ruby runtime) Deprecated.static RubySymboladdInstanceMethod(RubyModule containingClass, RubySymbol symbol, DynamicMethod method, Visibility visibility, ThreadContext context) static RubySymboladdInstanceMethod(RubyModule containingClass, RubySymbol symbol, DynamicMethod method, Visibility visibility, ThreadContext context, Ruby runtime) Deprecated.static booleanadditionOverflowed(long original, long other, long result) static IRubyObject[]anewarrayIRubyObjects(int size) static RubyStringappendAsString(RubyString target, IRubyObject other) Deprecated.static RubyStringappendByteList(RubyString target, ByteList source) Deprecated.static IRubyObject[]appendToObjectArray(IRubyObject[] array, IRubyObject add) static RubyArrayargsCat(IRubyObject first, IRubyObject second) Deprecated.static RubyArrayargsCat(ThreadContext context, IRubyObject first, IRubyObject second) static IRubyObject[]argsCatToArguments(IRubyObject[] args, IRubyObject cat) Deprecated.static ArgumentDescriptor[]argsNodeToArgumentDescriptors(ArgsNode argsNode) Use an ArgsNode (used for blocks) to generate ArgumentDescriptorsstatic RubyArrayargsPush(ThreadContext context, RubyArray first, IRubyObject second) Deprecated.static RubyArrayargsPush(ThreadContext context, IRubyObject first, IRubyObject second, boolean usesKeywords) static RubyArrayargumentDescriptorsToParameters(Ruby runtime, ArgumentDescriptor[] argsDesc, boolean isLambda) Deprecated.static RubyArrayargumentDescriptorsToParameters(ThreadContext context, ArgumentDescriptor[] argsDesc, boolean isLambda) Convert a parameter list from ArgumentDescriptor format to "Array of Array" formatstatic IRubyObjectarrayEntryOrNil(RubyArray array, int index) Deprecated.static IRubyObjectarrayEntryOrNilOne(RubyArray array) Deprecated.static IRubyObjectarrayEntryOrNilTwo(RubyArray array) Deprecated.static IRubyObjectarrayEntryOrNilZero(RubyArray array) Deprecated.static <T> T[]static IRubyObject[]arrayOf(IRubyObject first) static IRubyObject[]arrayOf(IRubyObject first, IRubyObject second) static IRubyObject[]arrayOf(IRubyObject first, IRubyObject... values) static IRubyObject[]arrayOf(IRubyObject first, IRubyObject second, IRubyObject third) static <T> T[]arrayOf(T... values) static <T> T[]arrayOf(T[] values, T last, IntFunction<T[]> allocator) static IRubyObjectarrayPostOrNil(RubyArray array, int pre, int post, int index) Deprecated.static IRubyObjectarrayPostOrNilOne(RubyArray array, int pre, int post) Deprecated.static IRubyObjectarrayPostOrNilTwo(RubyArray array, int pre, int post) Deprecated.static IRubyObjectarrayPostOrNilZero(RubyArray array, int pre, int post) Deprecated.static RubyArrayarrayValue(IRubyObject value) Deprecated.static RubyArrayarrayValue(ThreadContext context, Ruby runtime, IRubyObject value) Deprecated.static RubyArrayarrayValue(ThreadContext context, IRubyObject value) static IRubyObjectaryOrToAry(ThreadContext context, IRubyObject value) static IRubyObjectaryToAry(IRubyObject value) Deprecated.static IRubyObjectaryToAry(ThreadContext context, IRubyObject value) static RubyArrayasArray(ThreadContext context, IRubyObject value) Deprecated.static IRubyObjectaValueSplat(IRubyObject value) Deprecated.static IRubyObjectbackref(ThreadContext context) Deprecated.static IRubyObjectbackrefLastMatch(ThreadContext context) Deprecated.static IRubyObjectbackrefMatchLast(ThreadContext context) Deprecated.static IRubyObjectbackrefMatchPost(ThreadContext context) Deprecated.static IRubyObjectbackrefMatchPre(ThreadContext context) Deprecated.static booleanBNE(ThreadContext context, IRubyObject value1, IRubyObject value2) static IRubyObjectbreakLocalJumpError(Ruby runtime, IRubyObject value) static StringbyteListToString(ByteList bytes) Convert a ByteList into a Java String by using its Encoding's Charset.static intcalculateBufferLength(int length) Calculate a buffer length based on the required length, expanding by 1.5x or to the maximum array size.static intcalculateBufferLength(Ruby runtime, int length) Same ascalculateBufferLength(int)but raises a Ruby ArgumentError.static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject[] args, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject[] args, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, Block block) static IRubyObjectcallMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) static voidcheckArgumentCount(ThreadContext context, int length, int min, int max) static voidcheckArgumentCount(ThreadContext context, IRubyObject[] args, int req) Used by the compiler to simplify arg checking in variable-arity pathsstatic voidcheckArgumentCount(ThreadContext context, IRubyObject[] args, int min, int max) Used by the compiler to simplify arg checking in variable-arity pathsstatic RubyModulecheckIsModule(IRubyObject maybeModule) Deprecated.static booleancheckJavaException(Throwable ex, IRubyObject catchable, ThreadContext context) static booleancheckJavaException(IRubyObject wrappedEx, Throwable ex, IRubyObject catchable, ThreadContext context) static voidstatic voidcheckSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule klass, String name) static voidclearErrorInfo(ThreadContext context) static IRubyObject[]concatObjectArrays(IRubyObject[] array, IRubyObject[] add) static RubyHashconstructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1) static RubyHashconstructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2) static RubyHashconstructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2, IRubyObject key3, IRubyObject value3, boolean prepareString3) static RubyHashconstructHash(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) static RubyHashconstructHash(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) static IRubyObject[]static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine) static IRubyObject[]constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, IRubyObject ten) static MethodHandleconstructObjectArrayHandle(int size) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine) static RubyArrayconstructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, IRubyObject ten) static RubyString[]static RubyString[]constructRubyStringArray(RubyString one, RubyString two) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven, RubyString eight) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven, RubyString eight, RubyString nine) static RubyString[]constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven, RubyString eight, RubyString nine, RubyString ten) static MethodHandleconstructRubyStringArrayHandle(int size) static RubyHashconstructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1) static RubyHashconstructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2) static RubyHashconstructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3) static RubyHashconstructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3, IRubyObject key4, IRubyObject value4) static RubyHashconstructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3, IRubyObject key4, IRubyObject value4, IRubyObject key5, IRubyObject value5) static String[]static String[]constructStringArray(String one, String two) static String[]constructStringArray(String one, String two, String three) static String[]constructStringArray(String one, String two, String three, String four) static String[]static String[]static String[]constructStringArray(String one, String two, String three, String four, String five, String six, String seven) static String[]constructStringArray(String one, String two, String three, String four, String five, String six, String seven, String eight) static String[]constructStringArray(String one, String two, String three, String four, String five, String six, String seven, String eight, String nine) static String[]constructStringArray(String one, String two, String three, String four, String five, String six, String seven, String eight, String nine, String ten) static CacheEntrycreateMethodMissingEntry(ThreadContext context, RubyClass selfClass, CallType callType, Visibility visibility, int token, String methodName) static RubyArraycreateSubarray(RubyArray input, int start) static RubyArraycreateSubarray(RubyArray input, int start, int post) static RubyArraycreateSubarray(IRubyObject[] input, Ruby runtime, int start) static RubyArraycreateSubarray(IRubyObject[] input, Ruby runtime, int start, int exclude) static StringdecodeByteList(Ruby runtime, ByteList value) Decode a given ByteList to a Java string.static int[]decodeCaptureOffsets(String encoded) static double[]decodeDoubleString(String fixnumString) static long[]decodeLongString(String fixnumString) static StaticScopedecodeScopeAndDetermineModule(ThreadContext context, StaticScope parent, String scopeString) static StringdescribeScope(StaticScope scope) static IRubyObjectelementOrNil(IRubyObject[] input, int element, IRubyObject nil) static IRubyObjectelementOrNull(IRubyObject[] input, int element) static StringencodeCaptureOffsets(int[] scopeOffsets) static StringencodeDoubleString(List<Double> values) static StringencodeLongString(List<Long> values) static StringencodeParameterList(List<String[]> args) Deprecated.static RubyArrayensureRubyArray(Ruby runtime, IRubyObject value) Deprecated.static RubyArrayensureRubyArray(IRubyObject value) Deprecated.static RubyArrayensureRubyArray(ThreadContext context, IRubyObject value) static jnr.constants.platform.ErrnoThis method attempts to produce an Errno value for the given exception.static booleanextractExceptionOnlyArg(ThreadContext context, RubyHash opts) Note: Assumes exception: ...static booleanextractExceptionOnlyArg(ThreadContext context, IRubyObject[] args, boolean defValue) Note: Assumes exception: ...static booleanextractExceptionOnlyArg(ThreadContext context, IRubyObject opts, boolean defValue) Note: Assumes exception: ...static voidfillNil(IRubyObject[] arr, int from, int to, Ruby runtime) Deprecated.static voidfillNil(IRubyObject[] arr, Ruby runtime) Deprecated.static voidfillNil(ThreadContext context, IRubyObject[] arr) static voidfillNil(ThreadContext context, IRubyObject[] arr, int from, int to) static RubyModulefindImplementerIfNecessary(RubyModule clazz, RubyModule implementationClass) static IRubyObjectgetBackref(Ruby runtime, ThreadContext context) Deprecated.static BlockgetBlock(Ruby runtime, ThreadContext context, IRubyObject self, Node node, Block aBlock) static BlockgetBlock(ThreadContext context, IRubyObject self, Node node) static BlockgetBlockFromBlockPassBody(Ruby runtime, IRubyObject proc, Block currentBlock) static BlockgetBlockFromBlockPassBody(IRubyObject proc, Block currentBlock) Deprecated.static StringgetCalleeNameFromCompositeName(String compositeName) static IRubyObjectgetDefinedCall(ThreadContext context, IRubyObject self, IRubyObject receiver, String name, IRubyObject definedMessage) static IRubyObjectgetDefinedConstantOrBoundMethod(IRubyObject left, String name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage) Deprecated.static IRubyObjectgetDefinedConstantOrBoundMethod(ThreadContext context, IRubyObject left, String name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage) static IRubyObjectgetErrorInfo(Ruby runtime) Deprecated.static IRubyObjectgetGlobalVariable(Ruby runtime, String name) static Blockstatic IRubyObjectgetInstanceVariable(IRubyObject self, Ruby runtime, String internedName) static IRubyObjectgetInstanceVariableNoWarn(IRubyObject self, ThreadContext context, String internedName) static IRubyObjectgetLastLine(Ruby runtime, ThreadContext context) static StringDeprecated.static RubyModulegetNthScopeModule(StaticScope scope, int depth) static String[]getScopeNames(String scopeNames) static RubyClassgetSingletonClass(Ruby runtime, IRubyObject receiver) Deprecated.static Class[]getStaticMethodParams(Class target, int args) static StringgetStaticMethodSignature(String classname, int args) static StaticScopegetStaticScope(IRScope scope) static RubyModulegetSuperClassForDefined(Ruby runtime, RubyModule klazz) Deprecated.static StringgetSuperNameFromCompositeName(String compositeName) static voidhandleArgumentSizes(ThreadContext context, Ruby runtime, int given, int required, int opt, int rest) static longhashEnd(long value) static longstatic IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, Block block) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject... args) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, Block block) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, CallType callType, Block block) Deprecated.Use finvoke if you do not want visibility-checking or invokeFrom if you do.static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, Block block) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg, CallType callType, Block block) Deprecated.Use finvoke if you do not want visibility-checking or invokeFrom if you do.static IRubyObjectinvoke(ThreadContext context, IRubyObject self, String name, CallType callType) Deprecated.Use finvoke if you do not want visibility-checking or invokeFrom if you do.static IRubyObjectinvokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, Block block) static IRubyObjectinvokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject[] args, Block block) static IRubyObjectinvokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, Block block) static IRubyObjectinvokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block) static IRubyObjectinvokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) static IRubyObjectinvokeChecked(ThreadContext context, IRubyObject self, String name) static IRubyObjectinvokeChecked(ThreadContext context, IRubyObject self, String name, IRubyObject... args) static IRubyObjectinvokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites) static IRubyObjectinvokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites, IRubyObject arg0) static IRubyObjectinvokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites, IRubyObject... args) static IRubyObjectinvokedynamic(ThreadContext context, IRubyObject self, int index) Deprecated.static IRubyObjectinvokedynamic(ThreadContext context, IRubyObject self, int index, IRubyObject arg0) Deprecated.static IRubyObjectinvokedynamic(ThreadContext context, IRubyObject self, MethodNames method) static IRubyObjectinvokedynamic(ThreadContext context, IRubyObject self, MethodNames method, IRubyObject arg0) static IRubyObjectinvokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, IRubyObject[] args, CallType callType, Block block) Deprecated.static IRubyObjectinvokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, IRubyObject arg, CallType callType, Block block) Deprecated.static IRubyObjectinvokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, CallType callType) Deprecated.static IRubyObjectinvokePublic(ThreadContext context, IRubyObject self, String name, IRubyObject arg) MRI: rb_funcallv_publicstatic IRubyObjectinvokeSuper(ThreadContext context, IRubyObject self, RubyModule klass, String name, IRubyObject[] args, Block block) static IRubyObjectinvokeSuper(ThreadContext context, IRubyObject self, RubyModule klass, String name, IRubyObject arg0, Block block) static IRubyObjectinvokeSuper(ThreadContext context, IRubyObject self, Block block) static IRubyObjectinvokeSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) The protocol for super method invocation is a bit complicated in Ruby.static IRubyObjectinvokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObjectinvokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) static IRubyObjectinvokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) static voidirCheckArgsArrayArity(ThreadContext context, RubyArray args, int required, int opt, boolean rest) static IRubyObjectisExceptionHandled(RubyException currentException, IRubyObject[] exceptions, ThreadContext context) static IRubyObjectisExceptionHandled(RubyException currentException, IRubyObject exception0, IRubyObject exception1, IRubyObject exception2, ThreadContext context) static IRubyObjectisExceptionHandled(RubyException currentException, IRubyObject exception0, IRubyObject exception1, ThreadContext context) static IRubyObjectisExceptionHandled(RubyException currentException, IRubyObject exception, ThreadContext context) static IRubyObjectisExceptionHandled(IRubyObject currentException, IRubyObject exception, ThreadContext context) static IRubyObjectisJavaExceptionHandled(Throwable currentThrowable, IRubyObject[] throwables, ThreadContext context) Deprecated.static IRubyObjectisJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable0, IRubyObject throwable1, IRubyObject throwable2, ThreadContext context) Deprecated.static IRubyObjectisJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable0, IRubyObject throwable1, ThreadContext context) Deprecated.static IRubyObjectisJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable, ThreadContext context) Deprecated.static booleanisModuleAndHasConstant(IRubyObject left, String name) Deprecated.static booleanisModuleAndHasConstant(ThreadContext context, IRubyObject left, String name) static booleanisRequiredKeywordArgumentValueNode(Node asgnNode) static StringjavaStringFromPath(Ruby runtime, IRubyObject loadPathEntry) static IRubyObjectlastElement(IRubyObject[] ary) Deprecated.static IRubyObjectmatch3(RubyRegexp regexp, IRubyObject value, ThreadContext context) Deprecated.static intmemchr(boolean[] ary, int start, boolean find, int len) Equivalent to C memchr with bool*.static intmemchr(boolean[] ary, int start, int len, boolean find) Deprecated.static intmemchr(byte[] ptr, int start, int find, int len) Equivalent to C memchr with byte*.static RubyClassmetaclass(IRubyObject object) static ArgumentDescriptor[]Deprecated.static ArgumentDescriptor[]methodToArgumentDescriptors(ThreadContext context, DynamicMethod method) static IRubyObjectmethodToParameters(Ruby runtime, AbstractRubyMethod recv) Deprecated.static IRubyObjectmethodToParameters(ThreadContext context, AbstractRubyMethod recv) static longmultAndMix(long seed, long hash) static intmultiplyBufferLength(Ruby runtime, int base, int multiplier) Deprecated.static intmultiplyBufferLength(ThreadContext context, int base, int multiplier) Calculate a buffer length based on a base size and a multiplier.static longmurmur(long h, long k, int r) static longmurmur_finish(long h) static longmurmur_step(long h, long k) static longmurmur1(long h) static longmurmurCombine(long h, long i) static IRubyObjectnegate(IRubyObject value, Ruby runtime) static ThrowablenewErrorFromException(Ruby runtime, Throwable t) Simplified form of Ruby#newErrorFromException with no default function.static ThrowableReturn a Ruby-friendly Throwable for a given Throwable.static RaiseExceptionnewIOErrorFromException(Ruby runtime, IOException ex) Construct an appropriate error (which may ultimately not be an IOError) for a given IOException.static RubyProcnewLiteralLambda(ThreadContext context, Block block, IRubyObject self) static RaiseExceptionnewLocalJumpErrorForBreak(Ruby runtime, IRubyObject breakValue) static IRubyObject[]nilledArray(int length, Ruby runtime) Return a nil-filled IRubyObject array of the specified length.static IRubyObjectnullToNil(IRubyObject value, Ruby runtime) Deprecated.static IRubyObjectnullToNil(IRubyObject value, IRubyObject nil) static IRubyObjectnullToNil(IRubyObject value, ThreadContext context) Deprecated.static IRubyObjectnullToUndefined(IRubyObject value) static IRubyObjectoptElementOrNull(IRubyObject[] input, int element, int postCount) static ArgumentDescriptor[]parameterListToArgumentDescriptors(Ruby runtime, String[] parameterList, boolean isLambda) Deprecated.static ArgumentDescriptor[]parameterListToArgumentDescriptors(ThreadContext context, String[] parameterList, boolean isLambda) Convert a parameter list from prefix format to ArgumentDescriptor format.static VisibilityperformNormalMethodChecksAndDetermineVisibility(Ruby runtime, RubyModule clazz, RubySymbol symbol, Visibility visibility) Deprecated.static VisibilityperformNormalMethodChecksAndDetermineVisibility(ThreadContext context, RubyModule clazz, RubySymbol symbol, Visibility visibility) static voidpostLoad(ThreadContext context) static StaticScopepreLoad(ThreadContext context, String[] varNames) static voidpreLoadCommon(ThreadContext context, StaticScope staticScope, boolean wrap) static StringrawBytesToString(byte[] bytes) static RubyBooleanrbEql(ThreadContext context, IRubyObject a, IRubyObject b) Equivalent to rb_eql in MRIstatic RubyBooleanrbEqual(ThreadContext context, IRubyObject a, IRubyObject b) Equivalent to rb_equal in MRIstatic RubyBooleanrbEqual(ThreadContext context, IRubyObject a, IRubyObject b, CallSite equal) Equivalent to rb_equal in MRIstatic voidregisterEndBlock(Block block, Ruby runtime) Deprecated.static booleanrespondsToMethod(DynamicMethod method, boolean checkVisibility) We have respondTo logic in RubyModule and we have a special callsite for respond_to?.static StaticScoperestoreScope(String descriptor, StaticScope enclosingScope) static voidrewriteStackTrace(Ruby runtime, Throwable e) Deprecated.static IRubyObjectrewriteStackTraceAndThrow(ThreadContext context, Throwable t) static RubyFixnumsafeHash(ThreadContext context, IRubyObject obj) static DynamicMethodselectMethodMissing(RubyClass selfClass, Visibility visibility, String name, CallType callType) static DynamicMethodselectMethodMissing(ThreadContext context, RubyClass selfClass, Visibility visibility, String name, CallType callType) static DynamicMethodselectMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType) static IRubyObjectsetBackref(Ruby runtime, ThreadContext context, IRubyObject value) Deprecated.static IRubyObjectsetConstantInModule(ThreadContext context, String name, IRubyObject value, IRubyObject module) static voidsetErrorInfo(Ruby runtime, IRubyObject error) Deprecated.static IRubyObjectsetGlobalVariable(IRubyObject value, Ruby runtime, String name) static IRubyObjectsetInstanceVariable(IRubyObject value, IRubyObject self, String name) static IRubyObjectsetLastLine(Ruby runtime, ThreadContext context, IRubyObject value) static IRubyObject[]splatToArguments(IRubyObject value) Deprecated.static RubyArraysplatValue(IRubyObject value) Deprecated.static voidstoreExceptionInErrorInfo(Throwable currentThrowable, ThreadContext context) Deprecated.static IRubyObjectstringOrNil(ByteList value, ThreadContext context) Deprecated.static byte[]stringToRawBytes(String string) static RubyArraysubarrayOrEmpty(RubyArray array, Ruby runtime, int index) Deprecated.static RubyArraysubarrayOrEmpty(RubyArray array, Ruby runtime, int index, int post) Deprecated.static byte[]subseq(byte[] ary, int start, int len) static booleansubtractionOverflowed(long original, long other, long result) static StringsymbolBytesToString(ByteList 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.static voidthrowErrorFromException(Ruby runtime, Throwable t) Throw an appropriate Ruby-friendly error or exception for a given Java exception.static voidstatic IRubyObject[]toArray(IRubyObject[] array, IRubyObject... rest) static IRubyObject[]toArray(IRubyObject obj, IRubyObject... rest) static IRubyObject[]toArray(IRubyObject obj0, IRubyObject obj1, IRubyObject... rest) static IRubyObject[]toArray(IRubyObject obj0, IRubyObject obj1, IRubyObject obj2, IRubyObject... rest) static <T> Tstatic IRubyObjectstatic intvalidateBufferLength(Ruby runtime, long length) static intvalidateBufferLength(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.static RubyArrayviewArgsArray(ThreadContext context, RubyArray rubyArray, int preArgsCount, int postArgsCount) static IRubyObjectwrapJavaException(Ruby runtime, Throwable ex)
-
Field Details
-
SEMICOLON_PATTERN
-
MAX_ARRAY_SIZE
public static final int MAX_ARRAY_SIZE- See Also:
-
MAX_SPECIFIC_ARITY_OBJECT_ARRAY
public static final int MAX_SPECIFIC_ARITY_OBJECT_ARRAY- See Also:
-
MAX_SPECIFIC_ARITY_HASH
public static final int MAX_SPECIFIC_ARITY_HASH- See Also:
-
-
Constructor Details
-
Helpers
public Helpers()
-
-
Method Details
-
getSingletonClass
@Deprecated(since="10.0") public static RubyClass getSingletonClass(Ruby runtime, IRubyObject receiver) Deprecated. -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject[] args, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject[] args, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, RubyClass klass, Visibility visibility, String name, CallType callType, Block block) -
callMethodMissing
public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType, Block block) -
selectMethodMissing
public static DynamicMethod selectMethodMissing(ThreadContext context, IRubyObject receiver, Visibility visibility, String name, CallType callType) -
selectMethodMissing
public static DynamicMethod selectMethodMissing(ThreadContext context, RubyClass selfClass, Visibility visibility, String name, CallType callType) -
selectMethodMissing
public static DynamicMethod selectMethodMissing(RubyClass selfClass, Visibility visibility, String name, CallType callType) -
map
-
additionOverflowed
public static boolean additionOverflowed(long original, long other, long result) -
subtractionOverflowed
public static boolean subtractionOverflowed(long original, long other, long result) -
errnoFromException
This method attempts to produce an Errno value for the given exception. Many low-level operations wrapped by the JDK will raise IOException or subclasses of it when there's a system- level error. In most cases, the only way to determine the cause of the IOException is by inspecting its contents, usually by checking the error message string. This is obviously fragile and breaks on platforms localized to languages other than English, so we also try as much as possible to detect the cause of the error by its actual type (if it is indeed a specialized subtype of IOException).- Parameters:
t- the exception to convert to anErrno- Returns:
- the resulting
Errnovalue, or null if none could be determined.
-
newIOErrorFromException
Construct an appropriate error (which may ultimately not be an IOError) for a given IOException. If this method is used on an exception which can't be translated to a Ruby error usingnewErrorFromException(Ruby, Throwable)then a RuntimeError will be returned, due to the unhandled exception type.- Parameters:
runtime- the current runtimeex- the exception to translate into a Ruby error- Returns:
- a RaiseException subtype instance appropriate for the given exception
-
newErrorFromException
public static Throwable newErrorFromException(Ruby runtime, Throwable t, Function<Throwable, Throwable> els) Return a Ruby-friendly Throwable for a given Throwable. The following translations will be attempted in order:- if the Throwable is already a Ruby exception type, return it as-is
- convert to a Ruby Errno exception via
errnoFromException(Throwable) - convert to a Ruby IOError if the exception is a java.io.IOException
- using the provided function as a fallback transformation
- Parameters:
runtime- the current runtimet- the exception to translate into a Ruby errorels- a fallback function if the exception cannot be translated- Returns:
- a RaiseException subtype instance appropriate for the given exception
-
newErrorFromException
Simplified form of Ruby#newErrorFromException with no default function.- Parameters:
runtime- the current runtimet- the exception to translate into a Ruby error- Returns:
- a RaiseException subtype instance appropriate for the given exception
-
throwErrorFromException
Throw an appropriate Ruby-friendly error or exception for a given Java exception. This method will first attempt to translate the exception into a Ruby error usingnewErrorFromException(Ruby, Throwable, Function). Failing that, it will raise the original Java exception as-is.- Parameters:
runtime- the current runtimet- the exception to raise as an error, if appropriate, or as itself otherwise
-
getNthScopeModule
-
viewArgsArray
public static RubyArray viewArgsArray(ThreadContext context, RubyArray rubyArray, int preArgsCount, int postArgsCount) -
getStaticMethodParams
-
getStaticMethodSignature
-
calculateBufferLength
public static int calculateBufferLength(int length) Calculate a buffer length based on the required length, expanding by 1.5x or to the maximum array size.- Parameters:
length- the required length- Returns:
- a larger buffer length with extra room for growth, or else the max array size
- Throws:
OutOfMemoryError- if the requested length is greated than the max array size
-
calculateBufferLength
Same ascalculateBufferLength(int)but raises a Ruby ArgumentError. -
multiplyBufferLength
@Deprecated(since="10.0") public static int multiplyBufferLength(Ruby runtime, int base, int multiplier) Deprecated. -
multiplyBufferLength
Calculate a buffer length based on a base size and a multiplier. If the resulting size exceeds MAX_ARRAY_SIZE, anArgumentErrorwill be thrown, similar to when asking the JVM to allocate a too-large array.- Parameters:
context- the thread contextbase- the base sizemultiplier- the multiplier- Returns:
- the multiplied size, if valid
- Throws:
ArgumentError- if the requested length is greated than the max array size
-
addBufferLength
Deprecated. -
addBufferLength
Calculate a buffer length based on a base size and a extra size. If the resulting size exceeds MAX_ARRAY_SIZE and the extra size is nonzero, use the MAX_ARRAY_SIZE as the buffer length.- Parameters:
context- the current thread contextbase- the base sizeextra- the extra buffer size- Returns:
- the combined buffer size, or MAX_ARRAY_SIZE
- Throws:
ArgumentError- if the original or combined size cannot be accommodated by MAX_ARRAY_SIZE
-
validateBufferLength
-
validateBufferLength
Check that the buffer length requested is within the valid range of 0 to MAX_ARRAY_SIZE, or raise an argument error. -
createMethodMissingEntry
public static CacheEntry createMethodMissingEntry(ThreadContext context, RubyClass selfClass, CallType callType, Visibility visibility, int token, String methodName) -
encodeLongString
-
decodeLongString
-
encodeDoubleString
-
decodeDoubleString
-
invoke
-
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, Block block) -
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block) -
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, Block block) -
invoke
-
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0) -
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1) -
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) -
invoke
public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject... args) -
invokeAs
public static IRubyObject invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject[] args, Block block) -
invokeAs
public static IRubyObject invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, Block block) -
invokeAs
public static IRubyObject invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, Block block) -
invokeAs
public static IRubyObject invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block) -
invokeAs
public static IRubyObject invokeAs(ThreadContext context, RubyClass asClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
invokePublic
public static IRubyObject invokePublic(ThreadContext context, IRubyObject self, String name, IRubyObject arg) MRI: rb_funcallv_public -
invokeChecked
-
invokeChecked
public static IRubyObject invokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites) -
invokeChecked
public static IRubyObject invokeChecked(ThreadContext context, IRubyObject self, String name, IRubyObject... args) -
invokeChecked
public static IRubyObject invokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites, IRubyObject arg0) -
invokeChecked
public static IRubyObject invokeChecked(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites, IRubyObject... args) -
invokeSuper
public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) The protocol for super method invocation is a bit complicated in Ruby. In real terms it involves first finding the real implementation class (the super class), getting the name of the method to call from the frame, and then invoke that on the super class with the current self as the actual object invoking. -
getSuperNameFromCompositeName
-
getCalleeNameFromCompositeName
-
invokeSuper
public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, RubyModule klass, String name, IRubyObject[] args, Block block) -
invokeSuper
public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, RubyModule klass, String name, IRubyObject arg0, Block block) -
invokeSuper
-
invokeSuper
public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) -
invokeSuper
public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) -
invokeSuper
public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
ensureRubyArray
Deprecated. -
ensureRubyArray
Deprecated. -
ensureRubyArray
-
nullToNil
Deprecated. -
nullToNil
Deprecated. -
nullToNil
- See Also:
-
nullToUndefined
-
handleArgumentSizes
public static void handleArgumentSizes(ThreadContext context, Ruby runtime, int given, int required, int opt, int rest) -
getLocalJumpTypeOrRethrow
Deprecated. -
unwrapLocalJumpErrorValue
-
getBlockFromBlockPassBody
-
getImplicitBlockFromBlockBinding
-
getBlockFromBlockPassBody
@Deprecated(since="10.0") public static Block getBlockFromBlockPassBody(IRubyObject proc, Block currentBlock) Deprecated. -
backrefLastMatch
Deprecated. -
backrefMatchPre
Deprecated. -
backrefMatchPost
Deprecated. -
backrefMatchLast
Deprecated. -
appendToObjectArray
-
breakLocalJumpError
-
newLocalJumpErrorForBreak
-
concatObjectArrays
-
toArray
-
toArray
-
toArray
-
toArray
public static IRubyObject[] toArray(IRubyObject obj0, IRubyObject obj1, IRubyObject obj2, IRubyObject... rest) -
isExceptionHandled
public static IRubyObject isExceptionHandled(RubyException currentException, IRubyObject[] exceptions, ThreadContext context) -
isExceptionHandled
public static IRubyObject isExceptionHandled(RubyException currentException, IRubyObject exception, ThreadContext context) -
isExceptionHandled
public static IRubyObject isExceptionHandled(IRubyObject currentException, IRubyObject exception, ThreadContext context) -
isExceptionHandled
public static IRubyObject isExceptionHandled(RubyException currentException, IRubyObject exception0, IRubyObject exception1, ThreadContext context) -
isExceptionHandled
public static IRubyObject isExceptionHandled(RubyException currentException, IRubyObject exception0, IRubyObject exception1, IRubyObject exception2, ThreadContext context) -
checkJavaException
public static boolean checkJavaException(IRubyObject wrappedEx, Throwable ex, IRubyObject catchable, ThreadContext context) -
checkJavaException
public static boolean checkJavaException(Throwable ex, IRubyObject catchable, ThreadContext context) -
wrapJavaException
-
isJavaExceptionHandled
@Deprecated public static IRubyObject isJavaExceptionHandled(Throwable currentThrowable, IRubyObject[] throwables, ThreadContext context) Deprecated. -
isJavaExceptionHandled
@Deprecated public static IRubyObject isJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable, ThreadContext context) Deprecated. -
isJavaExceptionHandled
@Deprecated public static IRubyObject isJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable0, IRubyObject throwable1, ThreadContext context) Deprecated. -
isJavaExceptionHandled
@Deprecated public static IRubyObject isJavaExceptionHandled(Throwable currentThrowable, IRubyObject throwable0, IRubyObject throwable1, IRubyObject throwable2, ThreadContext context) Deprecated. -
storeExceptionInErrorInfo
@Deprecated public static void storeExceptionInErrorInfo(Throwable currentThrowable, ThreadContext context) Deprecated. -
clearErrorInfo
-
checkSuperDisabledOrOutOfMethod
-
checkSuperDisabledOrOutOfMethod
public static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule klass, String name) -
findImplementerIfNecessary
public static RubyModule findImplementerIfNecessary(RubyModule clazz, RubyModule implementationClass) -
createSubarray
-
createSubarray
-
createSubarray
-
createSubarray
-
elementOrNull
-
optElementOrNull
-
elementOrNil
-
setConstantInModule
public static IRubyObject setConstantInModule(ThreadContext context, String name, IRubyObject value, IRubyObject module) -
anewarrayIRubyObjects
-
aastoreIRubyObjects
-
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, int start) -
aastoreIRubyObjects
public static IRubyObject[] aastoreIRubyObjects(IRubyObject[] ary, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, IRubyObject ten, int start) -
constructObjectArray
-
constructObjectArray
-
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three) -
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four) -
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five) -
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six) -
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven) -
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight) -
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine) -
constructObjectArray
public static IRubyObject[] constructObjectArray(IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, IRubyObject ten) -
constructObjectArrayHandle
-
constructRubyStringArray
-
constructRubyStringArray
-
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three) -
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four) -
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five) -
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six) -
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven) -
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven, RubyString eight) -
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven, RubyString eight, RubyString nine) -
constructRubyStringArray
public static RubyString[] constructRubyStringArray(RubyString one, RubyString two, RubyString three, RubyString four, RubyString five, RubyString six, RubyString seven, RubyString eight, RubyString nine, RubyString ten) -
constructRubyStringArrayHandle
-
constructRubyArray
-
constructRubyArray
-
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three) -
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four) -
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five) -
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six) -
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven) -
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight) -
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine) -
constructRubyArray
public static RubyArray constructRubyArray(Ruby runtime, IRubyObject one, IRubyObject two, IRubyObject three, IRubyObject four, IRubyObject five, IRubyObject six, IRubyObject seven, IRubyObject eight, IRubyObject nine, IRubyObject ten) -
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructStringArray
-
constructHash
public static RubyHash constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1) -
constructHash
public static RubyHash constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2) -
constructHash
public static RubyHash constructHash(Ruby runtime, IRubyObject key1, IRubyObject value1, boolean prepareString1, IRubyObject key2, IRubyObject value2, boolean prepareString2, IRubyObject key3, IRubyObject value3, boolean prepareString3) -
constructHash
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) -
constructHash
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) -
constructSmallHash
-
constructSmallHash
public static RubyHash constructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2) -
constructSmallHash
public static RubyHash constructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3) -
constructSmallHash
public static RubyHash constructSmallHash(Ruby runtime, IRubyObject key1, IRubyObject value1, IRubyObject key2, IRubyObject value2, IRubyObject key3, IRubyObject value3, IRubyObject key4, IRubyObject value4) -
constructSmallHash
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) -
negate
-
stringOrNil
Deprecated. -
preLoad
-
preLoadCommon
-
postLoad
-
registerEndBlock
Deprecated. -
match3
@Deprecated public static IRubyObject match3(RubyRegexp regexp, IRubyObject value, ThreadContext context) Deprecated. -
getErrorInfo
Deprecated. -
setErrorInfo
Deprecated. -
setLastLine
-
getLastLine
-
arrayValue
Deprecated. -
arrayValue
@Deprecated(since="10.0") public static RubyArray arrayValue(ThreadContext context, Ruby runtime, IRubyObject value) Deprecated.- Parameters:
context-runtime-value-- Returns:
- ""
-
arrayValue
-
asArray
Deprecated. -
aryToAry
Deprecated. -
aryToAry
-
aryOrToAry
-
aValueSplat
Deprecated. -
splatValue
Deprecated. -
splatToArguments
Deprecated. -
argsCatToArguments
Deprecated. -
addInstanceMethod
@Deprecated public static RubySymbol addInstanceMethod(RubyModule containingClass, String name, DynamicMethod method, Visibility visibility, ThreadContext context, Ruby runtime) Deprecated. -
addInstanceMethod
@Deprecated public static RubySymbol addInstanceMethod(RubyModule containingClass, RubySymbol symbol, DynamicMethod method, Visibility visibility, ThreadContext context, Ruby runtime) Deprecated. -
addInstanceMethod
public static RubySymbol addInstanceMethod(RubyModule containingClass, RubySymbol symbol, DynamicMethod method, Visibility visibility, ThreadContext context) -
decodeScopeAndDetermineModule
public static StaticScope decodeScopeAndDetermineModule(ThreadContext context, StaticScope parent, String scopeString) -
describeScope
-
restoreScope
-
performNormalMethodChecksAndDetermineVisibility
@Deprecated(since="10.0") public static Visibility performNormalMethodChecksAndDetermineVisibility(Ruby runtime, RubyModule clazz, RubySymbol symbol, Visibility visibility) throws RaiseException Deprecated.- Throws:
RaiseException
-
performNormalMethodChecksAndDetermineVisibility
public static Visibility performNormalMethodChecksAndDetermineVisibility(ThreadContext context, RubyModule clazz, RubySymbol symbol, Visibility visibility) throws RaiseException - Throws:
RaiseException
-
arrayEntryOrNil
Deprecated. -
arrayEntryOrNilZero
Deprecated. -
arrayEntryOrNilOne
Deprecated. -
arrayEntryOrNilTwo
Deprecated. -
arrayPostOrNil
Deprecated. -
arrayPostOrNilZero
Deprecated. -
arrayPostOrNilOne
Deprecated. -
arrayPostOrNilTwo
Deprecated. -
subarrayOrEmpty
Deprecated. -
subarrayOrEmpty
@Deprecated public static RubyArray subarrayOrEmpty(RubyArray array, Ruby runtime, int index, int post) Deprecated. -
checkIsModule
Deprecated. -
getGlobalVariable
-
setGlobalVariable
-
getInstanceVariable
-
getInstanceVariableNoWarn
public static IRubyObject getInstanceVariableNoWarn(IRubyObject self, ThreadContext context, String internedName) -
setInstanceVariable
-
newLiteralLambda
-
fillNil
@Deprecated(since="10.0") public static void fillNil(IRubyObject[] arr, int from, int to, Ruby runtime) Deprecated. -
fillNil
-
nilledArray
Return a nil-filled IRubyObject array of the specified length.- Parameters:
length- the length of the array requestedruntime- the current runtime- Returns:
- a nil-filled IRubyObject array of the requested length
-
fillNil
Deprecated. -
fillNil
-
getBlock
-
getBlock
public static Block getBlock(Ruby runtime, ThreadContext context, IRubyObject self, Node node, Block aBlock) -
rbEqual
Equivalent to rb_equal in MRI- Parameters:
context-a-b-- Returns:
-
rbEqual
public static RubyBoolean rbEqual(ThreadContext context, IRubyObject a, IRubyObject b, CallSite equal) Equivalent to rb_equal in MRI- Parameters:
context-a-b-- Returns:
-
rbEql
Equivalent to rb_eql in MRI- Parameters:
context-a-b-- Returns:
-
checkArgumentCount
Used by the compiler to simplify arg checking in variable-arity paths- Parameters:
context- thread contextargs- arguments arraymin- minimum requiredmax- maximum allowed
-
checkArgumentCount
Used by the compiler to simplify arg checking in variable-arity paths- Parameters:
context- thread contextargs- arguments arrayreq- required number
-
checkArgumentCount
-
isModuleAndHasConstant
@Deprecated(since="10.0") public static boolean isModuleAndHasConstant(IRubyObject left, String name) Deprecated. -
isModuleAndHasConstant
-
getDefinedConstantOrBoundMethod
@Deprecated(since="10.0") public static IRubyObject getDefinedConstantOrBoundMethod(IRubyObject left, String name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage) Deprecated. -
getDefinedConstantOrBoundMethod
public static IRubyObject getDefinedConstantOrBoundMethod(ThreadContext context, IRubyObject left, String name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage) -
getSuperClassForDefined
@Deprecated(since="10.0") public static RubyModule getSuperClassForDefined(Ruby runtime, RubyModule klazz) Deprecated. -
getScopeNames
-
metaclass
-
rawBytesToString
-
stringToRawBytes
-
encodeCaptureOffsets
-
decodeCaptureOffsets
-
argsPush
@Deprecated public static RubyArray argsPush(ThreadContext context, RubyArray first, IRubyObject second) Deprecated. -
argsPush
public static RubyArray argsPush(ThreadContext context, IRubyObject first, IRubyObject second, boolean usesKeywords) -
argsCat
-
argsCat
Deprecated. -
argsNodeToArgumentDescriptors
Use an ArgsNode (used for blocks) to generate ArgumentDescriptors -
parameterListToArgumentDescriptors
@Deprecated(since="10.0") public static ArgumentDescriptor[] parameterListToArgumentDescriptors(Ruby runtime, String[] parameterList, boolean isLambda) Deprecated. -
parameterListToArgumentDescriptors
public static ArgumentDescriptor[] parameterListToArgumentDescriptors(ThreadContext context, String[] parameterList, boolean isLambda) Convert a parameter list from prefix format to ArgumentDescriptor format. This source is expected to come from a native path. Therefore we will be assuming parameterList is UTF-8. -
argumentDescriptorsToParameters
@Deprecated(since="10.0") public static RubyArray argumentDescriptorsToParameters(Ruby runtime, ArgumentDescriptor[] argsDesc, boolean isLambda) Deprecated. -
argumentDescriptorsToParameters
public static RubyArray argumentDescriptorsToParameters(ThreadContext context, ArgumentDescriptor[] argsDesc, boolean isLambda) Convert a parameter list from ArgumentDescriptor format to "Array of Array" format -
methodToArgumentDescriptors
@Deprecated(since="10.0") public static ArgumentDescriptor[] methodToArgumentDescriptors(DynamicMethod method) Deprecated. -
methodToArgumentDescriptors
public static ArgumentDescriptor[] methodToArgumentDescriptors(ThreadContext context, DynamicMethod method) -
methodToParameters
@Deprecated(since="10.0") public static IRubyObject methodToParameters(Ruby runtime, AbstractRubyMethod recv) Deprecated. -
methodToParameters
-
getDefinedCall
public static IRubyObject getDefinedCall(ThreadContext context, IRubyObject self, IRubyObject receiver, String name, IRubyObject definedMessage) -
invokedynamic
public static IRubyObject invokedynamic(ThreadContext context, IRubyObject self, MethodNames method) -
invokedynamic
public static IRubyObject invokedynamic(ThreadContext context, IRubyObject self, MethodNames method, IRubyObject arg0) -
lastElement
Deprecated. -
appendAsString
Deprecated. -
appendByteList
Deprecated. -
BNE
-
irCheckArgsArrayArity
public static void irCheckArgsArrayArity(ThreadContext context, RubyArray args, int required, int opt, boolean rest) -
invokedynamic
@Deprecated public static IRubyObject invokedynamic(ThreadContext context, IRubyObject self, int index) Deprecated. -
invokedynamic
@Deprecated public static IRubyObject invokedynamic(ThreadContext context, IRubyObject self, int index, IRubyObject arg0) Deprecated. -
extractExceptionOnlyArg
Note: Assumes exception: ... to be the only (optional) keyword argument!
- Parameters:
context-opts-- Returns:
- false if `exception: false`, true otherwise
-
extractExceptionOnlyArg
public static boolean extractExceptionOnlyArg(ThreadContext context, IRubyObject opts, boolean defValue) Note: Assumes exception: ... to be the only (optional) keyword argument!
- Parameters:
context-opts- the keyword args hashdefValue- to return when no keyword options- Returns:
- false if `exception: false`, true (or default value) otherwise
-
extractExceptionOnlyArg
public static boolean extractExceptionOnlyArg(ThreadContext context, IRubyObject[] args, boolean defValue) Note: Assumes exception: ... to be the only (optional) keyword argument!
- Parameters:
context-args- method argsdefValue- to return when no keyword options- Returns:
- false if `exception: false`, true (or default value) otherwise
-
throwException
-
tryThrow
-
symbolBytesToString
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. * If the string is a unicode encoding, it will be decoded as such. * If the string is any other encoding, it will be encoded as raw bytes using ISO-8859-1. This allows non-unicode, non-US-ASCII encodings to be represented in the symbol table as their raw versions, but properly decodes unicode- encoded strings.- Parameters:
value- the value to decode- Returns:
- the resulting symbol string
-
decodeByteList
Decode a given ByteList to a Java string.- Parameters:
runtime- the current runtimevalue- the bytelist- Returns:
- a Java String representation of the ByteList
-
byteListToString
Convert a ByteList into a Java String by using its Encoding's Charset. If the Charset is not available, fall back on other logic.- Parameters:
bytes- the bytelist to decode- Returns:
- the decoded string
-
rewriteStackTraceAndThrow
-
rewriteStackTrace
Deprecated. -
arrayOf
public static <T> T[] arrayOf(T... values) -
arrayOf
-
arrayOf
-
arrayOf
-
arrayOf
-
arrayOf
-
arrayOf
-
memchr
public static int memchr(byte[] ptr, int start, int find, int len) Equivalent to C memchr with byte*.- Parameters:
ptr- the byte[] to searchstart- starting position for searchfind- byte to findlen- length to search- Returns:
- the index of the requested byte or -1 if not found
-
memchr
public static int memchr(boolean[] ary, int start, boolean find, int len) Equivalent to C memchr with bool*.- Parameters:
ary- the boolean[] to searchstart- starting position for searchfind- boolean to findlen- length to search- Returns:
- the index of the requested boolean or -1 if not found
-
memchr
Deprecated. -
isRequiredKeywordArgumentValueNode
-
hashStart
-
hashEnd
public static long hashEnd(long value) -
safeHash
-
multAndMix
public static long multAndMix(long seed, long hash) -
murmurCombine
public static long murmurCombine(long h, long i) -
murmur
public static long murmur(long h, long k, int r) -
murmur_finish
public static long murmur_finish(long h) -
murmur_step
public static long murmur_step(long h, long k) -
murmur1
public static long murmur1(long h) -
encodeParameterList
Deprecated. -
subseq
public static byte[] subseq(byte[] ary, int start, int len) -
respondsToMethod
We have respondTo logic in RubyModule and we have a special callsite for respond_to?. This method is just so we can share that logic. -
getStaticScope
-
javaStringFromPath
-
invoke
@Deprecated(since="9.4-") public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject[] args, CallType callType, Block block) Deprecated.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. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134 -
invoke
@Deprecated(since="9.4-") public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, IRubyObject arg, CallType callType, Block block) Deprecated.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. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134 -
invoke
@Deprecated(since="9.4-") public static IRubyObject invoke(ThreadContext context, IRubyObject self, String name, CallType callType) Deprecated.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. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134 -
invokeFrom
@Deprecated public static IRubyObject invokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, IRubyObject[] args, CallType callType, Block block) Deprecated. -
invokeFrom
@Deprecated public static IRubyObject invokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, IRubyObject arg, CallType callType, Block block) Deprecated. -
invokeFrom
@Deprecated public static IRubyObject invokeFrom(ThreadContext context, IRubyObject caller, IRubyObject self, String name, CallType callType) Deprecated. -
setBackref
@Deprecated public static IRubyObject setBackref(Ruby runtime, ThreadContext context, IRubyObject value) Deprecated. -
getBackref
Deprecated. -
backref
Deprecated.
-
arrayValue(ThreadContext, IRubyObject)