static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) { Map<ByteList, Regex> cache = patternCache.get(); Regex regex = cache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; regex = makeRegexp(runtime, bytes, options, enc); regex.setUserObject(bytes); cache.put(bytes, regex); return regex; }
static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) { Map<ByteList, Regex> cache = patternCache.get(); Regex regex = cache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; regex = makeRegexp(runtime, bytes, options, enc); regex.setUserObject(bytes); cache.put(bytes, regex); return regex; }
static Regex getQuotedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) { Map<ByteList, Regex> cache = quotedPatternCache.get(); Regex regex = cache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList quoted = quote(bytes, enc); regex = makeRegexp(runtime, quoted, options, enc); regex.setUserObject(quoted); cache.put(bytes, regex); return regex; }
private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, ErrorMode mode) { Map<ByteList, Regex> cache = preprocessedPatternCache.get(); Regex regex = cache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList preprocessed = preprocess(runtime, bytes, enc, new Encoding[]{null}, ErrorMode.RAISE); regex = makeRegexp(runtime, preprocessed, options, enc); regex.setUserObject(preprocessed); cache.put(bytes, regex); return regex; }
private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, ErrorMode mode) { Map<ByteList, Regex> cache = preprocessedPatternCache.get(); Regex regex = cache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList preprocessed = preprocess(runtime, bytes, enc, new Encoding[]{null}, ErrorMode.RAISE); regex = makeRegexp(runtime, preprocessed, options, enc); regex.setUserObject(preprocessed); cache.put(bytes, regex); return regex; }
static Regex getQuotedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) { Map<ByteList, Regex> cache = quotedPatternCache.get(); Regex regex = cache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList quoted = quote(bytes, enc); regex = makeRegexp(runtime, quoted, options, enc); regex.setUserObject(quoted); cache.put(bytes, regex); return regex; }
static Regex getQuotedRegexpFromCache19(Ruby runtime, ByteList bytes, RegexpOptions options, boolean asciiOnly) { Map<ByteList, Regex> cache = quotedPatternCache.get(); Regex regex = cache.get(bytes); Encoding enc = asciiOnly ? USASCIIEncoding.INSTANCE : bytes.getEncoding(); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList quoted = quote19(bytes, asciiOnly); regex = makeRegexp(runtime, quoted, options, quoted.getEncoding()); regex.setUserObject(quoted); cache.put(bytes, regex); return regex; }
static Regex getQuotedRegexpFromCache19(Ruby runtime, ByteList bytes, RegexpOptions options, boolean asciiOnly) { Map<ByteList, Regex> cache = quotedPatternCache.get(); Regex regex = cache.get(bytes); Encoding enc = asciiOnly ? USASCIIEncoding.INSTANCE : bytes.getEncoding(); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList quoted = quote19(bytes, asciiOnly); regex = makeRegexp(runtime, quoted, options, quoted.getEncoding()); regex.setUserObject(quoted); cache.put(bytes, regex); return regex; }
public static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) { Regex regex = patternCache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; regex = makeRegexp(runtime, bytes, options, enc); regex.setUserObject(bytes); patternCache.put(bytes, regex); return regex; }
public static Regex getRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options) { Regex regex = patternCache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; regex = makeRegexp(runtime, bytes, options, enc); regex.setUserObject(bytes); patternCache.put(bytes, regex); return regex; }
private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, RegexpSupport.ErrorMode mode) { Regex regex = preprocessedPatternCache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList preprocessed = RegexpSupport.preprocess(runtime, bytes, enc, new Encoding[]{null}, RegexpSupport.ErrorMode.RAISE); regex = makeRegexp(runtime, preprocessed, options, enc); regex.setUserObject(preprocessed); preprocessedPatternCache.put(bytes, regex); return regex; }
private static Regex getPreprocessedRegexpFromCache(Ruby runtime, ByteList bytes, Encoding enc, RegexpOptions options, RegexpSupport.ErrorMode mode) { Regex regex = preprocessedPatternCache.get(bytes); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; ByteList preprocessed = RegexpSupport.preprocess(runtime, bytes, enc, new Encoding[]{null}, RegexpSupport.ErrorMode.RAISE); regex = makeRegexp(runtime, preprocessed, options, enc); regex.setUserObject(preprocessed); preprocessedPatternCache.put(bytes, regex); return regex; }
static Regex getQuotedRegexpFromCache(Ruby runtime, RubyString str, RegexpOptions options) { final ByteList bytes = str.getByteList(); Regex regex = quotedPatternCache.get(bytes); Encoding enc = str.isAsciiOnly() ? USASCIIEncoding.INSTANCE : bytes.getEncoding(); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; final ByteList quoted = quote(str); regex = makeRegexp(runtime, quoted, options, quoted.getEncoding()); regex.setUserObject(quoted); quotedPatternCache.put(bytes, regex); return regex; }
static Regex getQuotedRegexpFromCache(Ruby runtime, RubyString str, RegexpOptions options) { final ByteList bytes = str.getByteList(); Regex regex = quotedPatternCache.get(bytes); Encoding enc = str.isAsciiOnly() ? USASCIIEncoding.INSTANCE : bytes.getEncoding(); if (regex != null && regex.getEncoding() == enc && regex.getOptions() == options.toJoniOptions()) return regex; final ByteList quoted = quote(str); regex = makeRegexp(runtime, quoted, options, quoted.getEncoding()); regex.setUserObject(quoted); quotedPatternCache.put(bytes, regex); return regex; }