@Override public MethodHandle generate(JRubyCallSite site, RubyClass cls, DynamicMethod method, String realName) { AttrWriterMethod attrReader = (AttrWriterMethod)method; String varName = attrReader.getVariableName(); // we getVariableAccessorForWrite here so it is eagerly created and we don't cache the DUMMY VariableAccessor accessor = cls.getRealClass().getVariableAccessorForWrite(varName); // Ruby to attr reader if (RubyInstanceConfig.LOG_INDY_BINDINGS) { if (accessor instanceof FieldVariableAccessor) { LOG.info(site.name() + "\tbound as field attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName()); } else { LOG.info(site.name() + "\tbound as attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName()); } } return createAttrWriterHandle(site, cls, accessor); } }
@Override public MethodHandle generate(JRubyCallSite site, RubyClass cls, DynamicMethod method, String realName) { AttrWriterMethod attrReader = (AttrWriterMethod)method; String varName = attrReader.getVariableName(); // we getVariableAccessorForWrite here so it is eagerly created and we don't cache the DUMMY VariableAccessor accessor = cls.getRealClass().getVariableAccessorForWrite(varName); // Ruby to attr reader if (RubyInstanceConfig.LOG_INDY_BINDINGS) { if (accessor instanceof FieldVariableAccessor) { LOG.info(site.name() + "\tbound as field attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName()); } else { LOG.info(site.name() + "\tbound as attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName()); } } return createAttrWriterHandle(site, cls, accessor); } }
} else if (method instanceof AttrWriterMethod && site.arity == 1) { AttrWriterMethod attrReader = (AttrWriterMethod)method; String varName = attrReader.getVariableName(); LOG.info(site.name() + "\tbound as field attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName()); } else { LOG.info(site.name() + "\tbound as attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName());
} else if (method instanceof AttrWriterMethod && site.arity == 1) { AttrWriterMethod attrReader = (AttrWriterMethod)method; String varName = attrReader.getVariableName(); LOG.info(site.name() + "\tbound as field attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName()); } else { LOG.info(site.name() + "\tbound as attr writer " + logMethod(method) + ":" + ((AttrWriterMethod) method).getVariableName());