@Override public void SearchConstInstr(SearchConstInstr searchconstinstr) { jvmMethod().loadContext(); visit(searchconstinstr.getStartingScope()); jvmMethod().searchConst(searchconstinstr.getId(), searchconstinstr.isNoPrivateConsts()); jvmStoreLocal(searchconstinstr.getResult()); }
@Override public void SearchConstInstr(SearchConstInstr searchconstinstr) { jvmMethod().loadContext(); visit(searchconstinstr.getStartingScope()); jvmMethod().searchConst(searchconstinstr.getId(), searchconstinstr.isNoPrivateConsts()); jvmStoreLocal(searchconstinstr.getResult()); }
public Object cache(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { // Lexical lookup Ruby runtime = context.getRuntime(); RubyModule object = runtime.getObject(); String id = getId(); StaticScope staticScope = (StaticScope) getStartingScope().retrieve(context, self, currScope, currDynScope, temp); Object constant = (staticScope == null) ? object.getConstant(id) : staticScope.getConstantInner(id); // Inheritance lookup RubyModule module = null; if (constant == null) { // SSS FIXME: Is this null check case correct? module = staticScope == null ? object : staticScope.getModule(); constant = noPrivateConsts ? module.getConstantFromNoConstMissing(id, false) : module.getConstantNoConstMissing(id); } // Call const_missing or cache if (constant == null) { constant = module.callMethod(context, "const_missing", runtime.fastNewSymbol(id)); } else { // recache Invalidator invalidator = runtime.getConstantInvalidator(id); cache = new ConstantCache((IRubyObject)constant, invalidator.getData(), invalidator); } return constant; }
public Object cache(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { // Lexical lookup Ruby runtime = context.getRuntime(); RubyModule object = runtime.getObject(); String id = getId(); StaticScope staticScope = (StaticScope) getStartingScope().retrieve(context, self, currScope, currDynScope, temp); Object constant = (staticScope == null) ? object.getConstant(id) : staticScope.getConstantInner(id); // Inheritance lookup RubyModule module = null; if (constant == null) { // SSS FIXME: Is this null check case correct? module = staticScope == null ? object : staticScope.getModule(); constant = noPrivateConsts ? module.getConstantFromNoConstMissing(id, false) : module.getConstantNoConstMissing(id); } // Call const_missing or cache if (constant == null) { constant = module.callMethod(context, "const_missing", runtime.fastNewSymbol(id)); } else { // recache Invalidator invalidator = runtime.getConstantInvalidator(id); cache = new ConstantCache((IRubyObject)constant, invalidator.getData(), invalidator); } return constant; }