public IRubyObject inheritanceSearchConst(ThreadContext context, IRubyObject cmVal) throws Throwable { Ruby runtime = context.runtime; RubyModule module; if (cmVal instanceof RubyModule) { module = (RubyModule) cmVal; } else { throw runtime.newTypeError(cmVal + " is not a type/class"); } if (checkForBailout(module)) { return bail(context, cmVal, noCacheISC()); } // Inheritance lookup IRubyObject constant = module.getConstantNoConstMissingSkipAutoload(name); if (constant == null) { constant = UndefinedValue.UNDEFINED; } // bind constant until invalidated bind(runtime, module, constant, ISC()); tracker.addType(module.id); if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) { LOG.info(name + "\tconstant cached from type (inheritanceSearchConst) " + cmVal.getMetaClass()); } return constant; }
public IRubyObject inheritanceSearchConst(ThreadContext context, IRubyObject cmVal) throws Throwable { Ruby runtime = context.runtime; RubyModule module; if (cmVal instanceof RubyModule) { module = (RubyModule) cmVal; } else { throw runtime.newTypeError(cmVal + " is not a type/class"); } if (checkForBailout(module)) { return bail(context, cmVal, noCacheISC()); } // Inheritance lookup IRubyObject constant = module.getConstantNoConstMissingSkipAutoload(name); if (constant == null) { constant = UndefinedValue.UNDEFINED; } // bind constant until invalidated bind(runtime, module, constant, ISC()); tracker.addType(module.id); if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) { LOG.info(name + "\tconstant cached from type (inheritanceSearchConst) " + cmVal.getMetaClass()); } return constant; }
public IRubyObject searchModuleForConst(ThreadContext context, IRubyObject cmVal) throws Throwable { if (!(cmVal instanceof RubyModule)) throw context.runtime.newTypeError(cmVal + " is not a type/class"); RubyModule module = (RubyModule) cmVal; if (checkForBailout(module)) { return bail(context, cmVal, noCacheSMFC()); } // Inheritance lookup Ruby runtime = context.getRuntime(); IRubyObject constant = publicOnly ? module.getConstantFromNoConstMissing(name, false) : module.getConstantNoConstMissing(name); // Call const_missing or cache if (constant == null) { if (callConstMissing) { return module.callMethod(context, "const_missing", getSymbolicName(context)); } else { return UndefinedValue.UNDEFINED; } } // bind constant until invalidated bind(runtime, module, constant, SMFC()); if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) { LOG.info(name + "\tretrieved and cached from module (searchModuleForConst) " + cmVal.getMetaClass());// + " added to PIC" + extractSourceInfo(site)); } return constant; }
public IRubyObject searchModuleForConst(ThreadContext context, IRubyObject cmVal) throws Throwable { if (!(cmVal instanceof RubyModule)) throw context.runtime.newTypeError(cmVal + " is not a type/class"); RubyModule module = (RubyModule) cmVal; if (checkForBailout(module)) { return bail(context, cmVal, noCacheSMFC()); } // Inheritance lookup Ruby runtime = context.getRuntime(); IRubyObject constant = publicOnly ? module.getConstantFromNoConstMissing(name, false) : module.getConstantNoConstMissing(name); // Call const_missing or cache if (constant == null) { if (callConstMissing) { return module.callMethod(context, "const_missing", getSymbolicName(context)); } else { return UndefinedValue.UNDEFINED; } } // bind constant until invalidated bind(runtime, module, constant, SMFC()); if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) { LOG.info(name + "\tretrieved and cached from module (searchModuleForConst) " + cmVal.getMetaClass());// + " added to PIC" + extractSourceInfo(site)); } return constant; }