Class Builtins

java.lang.Object
org.jruby.runtime.Builtins

public class Builtins extends Object
  • Field Details

  • Constructor Details

    • Builtins

      public Builtins()
  • Method Details

    • allocate

      public static int[] allocate()
      Allocate a new builtin bits array for a ThreadContext. All bits start as 0 (no redefinitions detected).
      Returns:
      new short array sized for all BOP indices
    • invalidateBuiltin

      public static void invalidateBuiltin(int[] bits, ClassIndex classIndex, String method)
      Mark a builtin method as redefined for a specific class. After this call, fast-path checks for this method+class will return false.
      Parameters:
      bits - the builtinBits array to modify (from Ruby runtime)
      classIndex - the ClassIndex of the class being modified
      method - the method name being defined
    • resetAll

      public static void resetAll(short[] bits)
      Reset all builtin flags (for testing purposes). After this call, all fast-path checks will return true.
      Parameters:
      bits - the builtinBits array to reset
    • checkIntegerPlus

      public static boolean checkIntegerPlus(ThreadContext ctx)
      Check if Integer#+ is still builtin
    • checkIntegerMinus

      public static boolean checkIntegerMinus(ThreadContext ctx)
      Check if Integer#- is still builtin
    • checkIntegerMult

      public static boolean checkIntegerMult(ThreadContext ctx)
      Check if Integer#* is still builtin
    • checkIntegerDiv

      public static boolean checkIntegerDiv(ThreadContext ctx)
      Check if Integer#/ is still builtin
    • checkIntegerMod

      public static boolean checkIntegerMod(ThreadContext ctx)
      Check if Integer#% is still builtin
    • checkIntegerEquals

      public static boolean checkIntegerEquals(ThreadContext ctx)
      Check if Integer#== is still builtin
    • checkIntegerLt

      public static boolean checkIntegerLt(ThreadContext ctx)
      Check if Integer#invalid input: '<' is still builtin
    • checkIntegerLe

      public static boolean checkIntegerLe(ThreadContext ctx)
      Check if Integer#invalid input: '<'= is still builtin
    • checkIntegerGt

      public static boolean checkIntegerGt(ThreadContext ctx)
      Check if Integer#> is still builtin
    • checkIntegerGe

      public static boolean checkIntegerGe(ThreadContext ctx)
      Check if Integer#>= is still builtin
    • checkIntegerCompare

      public static boolean checkIntegerCompare(ThreadContext ctx)
      Check if all Integer comparison operators are still builtin
    • checkIntegerLshift

      public static boolean checkIntegerLshift(ThreadContext ctx)
      Check if Integer#invalid input: '<'invalid input: '<' is still builtin
    • checkIntegerAnd

      public static boolean checkIntegerAnd(ThreadContext ctx)
      Check if Integer#invalid input: '&' is still builtin
    • checkIntegerOr

      public static boolean checkIntegerOr(ThreadContext ctx)
      Check if Integer#| is still builtin
    • checkIntegerUminus

      public static boolean checkIntegerUminus(ThreadContext ctx)
      Check if Integer#-@ is still builtin
    • checkIntegerCmp

      public static boolean checkIntegerCmp(ThreadContext ctx)
      Check if Integer#<=> is still builtin
    • checkIntegerToF

      public static boolean checkIntegerToF(ThreadContext ctx)
      Check if Integer#to_f is still builtin
    • checkFloatPlus

      public static boolean checkFloatPlus(ThreadContext ctx)
      Check if Float#+ is still builtin
    • checkFloatMinus

      public static boolean checkFloatMinus(ThreadContext ctx)
      Check if Float#- is still builtin
    • checkFloatMult

      public static boolean checkFloatMult(ThreadContext ctx)
      Check if Float#* is still builtin
    • checkFloatDiv

      public static boolean checkFloatDiv(ThreadContext ctx)
      Check if Float#/ is still builtin
    • checkFloatEquals

      public static boolean checkFloatEquals(ThreadContext ctx)
      Check if Float#== is still builtin
    • checkFloatCompare

      public static boolean checkFloatCompare(ThreadContext ctx)
      Check if Float comparisons are still builtin
    • checkStringPlus

      public static boolean checkStringPlus(ThreadContext ctx)
      Check if String#+ is still builtin
    • checkStringEquals

      public static boolean checkStringEquals(ThreadContext ctx)
      Check if String#== is still builtin
    • checkStringConcat

      public static boolean checkStringConcat(ThreadContext ctx)
      Check if String#invalid input: '<'invalid input: '<' is still builtin
    • checkStringAref

      public static boolean checkStringAref(ThreadContext ctx)
      Check if String#[] is still builtin
    • checkStringLength

      public static boolean checkStringLength(ThreadContext ctx)
      Check if String#length/size is still builtin
    • checkStringEmpty

      public static boolean checkStringEmpty(ThreadContext ctx)
      Check if String#empty? is still builtin
    • checkStringFreeze

      public static boolean checkStringFreeze(ThreadContext ctx)
      Check if String#freeze is still builtin
    • checkStringMatch

      public static boolean checkStringMatch(ThreadContext ctx)
      Check if String#=~ is still builtin
    • checkStringHash

      public static boolean checkStringHash(ThreadContext ctx)
      Check if String#hash is still builtin
    • checkStringCmp

      public static boolean checkStringCmp(ThreadContext ctx)
      Check if String#<=> is still builtin
    • checkArrayAref

      public static boolean checkArrayAref(ThreadContext ctx)
      Check if Array#[] is still builtin
    • checkArrayAset

      public static boolean checkArrayAset(ThreadContext ctx)
      Check if Array#[]= is still builtin
    • checkArrayPush

      public static boolean checkArrayPush(ThreadContext ctx)
      Check if Array#invalid input: '<'invalid input: '<' is still builtin
    • checkArrayLength

      public static boolean checkArrayLength(ThreadContext ctx)
      Check if Array#length/size is still builtin
    • checkArrayEmpty

      public static boolean checkArrayEmpty(ThreadContext ctx)
      Check if Array#empty? is still builtin
    • checkArrayMax

      public static boolean checkArrayMax(ThreadContext ctx)
      Check if Array#max is still builtin
    • checkArrayMin

      public static boolean checkArrayMin(ThreadContext ctx)
      Check if Array#min is still builtin
    • checkArrayHash

      public static boolean checkArrayHash(ThreadContext ctx)
      Check if Array#hash is still builtin
    • checkArrayPack

      public static boolean checkArrayPack(ThreadContext ctx)
      Check if Array#pack is still builtin
    • checkArrayDig

      public static boolean checkArrayDig(ThreadContext ctx)
      Check if Array#dig is still builtin
    • checkHashAref

      public static boolean checkHashAref(ThreadContext ctx)
      Check if Hash#[] is still builtin
    • checkHashAset

      public static boolean checkHashAset(ThreadContext ctx)
      Check if Hash#[]= is still builtin
    • checkHashLength

      public static boolean checkHashLength(ThreadContext ctx)
      Check if Hash#length/size is still builtin
    • checkHashEmpty

      public static boolean checkHashEmpty(ThreadContext ctx)
      Check if Hash#empty? is still builtin
    • checkHashDefault

      public static boolean checkHashDefault(ThreadContext ctx)
      Check if Hash#default is still builtin
    • checkHashDig

      public static boolean checkHashDig(ThreadContext ctx)
      Check if Hash#dig is still builtin
    • checkRangeInclude

      public static boolean checkRangeInclude(ThreadContext ctx)
      Check if Range#include? is still builtin
    • checkRangeCover

      public static boolean checkRangeCover(ThreadContext ctx)
      Check if Range#cover? is still builtin (same as include? check)
    • checkRangeEqq

      public static boolean checkRangeEqq(ThreadContext ctx)
      Check if Range#=== is still builtin
    • checkRangeMin

      public static boolean checkRangeMin(ThreadContext ctx)
      Check if Range#min is still builtin
    • checkRangeMax

      public static boolean checkRangeMax(ThreadContext ctx)
      Check if Range#max is still builtin
    • checkSymbolEquals

      public static boolean checkSymbolEquals(ThreadContext ctx)
      Check if Symbol#== is still builtin
    • checkProcCall

      public static boolean checkProcCall(ThreadContext ctx)
      Check if Proc#call is still builtin
    • checkNilNot

      public static boolean checkNilNot(ThreadContext ctx)
      Check if NilClass#! is still builtin
    • checkTrueNot

      public static boolean checkTrueNot(ThreadContext ctx)
      Check if TrueClass#! is still builtin
    • checkFalseNot

      public static boolean checkFalseNot(ThreadContext ctx)
      Check if FalseClass#! is still builtin
    • checkRegexpMatch

      public static boolean checkRegexpMatch(ThreadContext ctx)
      Check if Regexp#=~ is still builtin
    • checkRegexpEqq

      public static boolean checkRegexpEqq(ThreadContext ctx)
      Check if Regexp#=== is still builtin
    • checkTimePlus

      public static boolean checkTimePlus(ThreadContext ctx)
      Check if Time#+ is still builtin
    • checkTimeMinus

      public static boolean checkTimeMinus(ThreadContext ctx)
      Check if Time#- is still builtin
    • checkTimeCompare

      public static boolean checkTimeCompare(ThreadContext ctx)
      Check if Time comparisons are still builtin
    • checkTimeCmp

      public static boolean checkTimeCmp(ThreadContext ctx)
      Check if Time#<=> is still builtin
    • checkStructDig

      public static boolean checkStructDig(ThreadContext ctx)
      Check if Struct#dig is still builtin
    • checkRationalToF

      public static boolean checkRationalToF(ThreadContext ctx)
      Check if Rational#to_f is still builtin
    • checkRationalPlus

      public static boolean checkRationalPlus(ThreadContext ctx)
      Check if Rational#+ is still builtin
    • checkRationalMult

      public static boolean checkRationalMult(ThreadContext ctx)
      Check if Rational#* is still builtin
    • checkRationalMinus

      public static boolean checkRationalMinus(ThreadContext ctx)
      Check if Rational#- is still builtin