All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.runtime.callsite.CacheEntry Maven / Gradle / Ivy

package org.jruby.runtime.callsite;

import org.jruby.RubyClass;
import org.jruby.internal.runtime.methods.DynamicMethod;
import org.jruby.internal.runtime.methods.UndefinedMethod;

public class CacheEntry {
    public static final CacheEntry NULL_CACHE = new CacheEntry(UndefinedMethod.INSTANCE, 0);
    public final DynamicMethod method;
    public final int token;

    public CacheEntry(DynamicMethod method, int token) {
        this.method = method;
        this.token = token;
    }

    public final boolean typeOk(RubyClass incomingType) {
        return typeOk(this, incomingType);
    }

    public static final boolean typeOk(CacheEntry entry, RubyClass incomingType) {
        return entry.token == incomingType.getCacheToken();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy