// nothing to be done if called on "this" or implicit reference
if (!m_isThis && !m_isImplicit) {
// first check direct access to property from method class
ClassFile from = mb.getClassFile();
ClassItem access = m_setMethod;
if (access == null) {
access = m_fieldItem;
}
if (!from.isAccessible(access)) {
access = m_objContext.getBoundClass().
getStoreMethod(access, mb.getClassFile());
}
// save to local if no way of getting value
if (m_getMethod == null && m_fieldItem == null) {
duplicateValue(mb);
Integer index = (Integer)mb.getKeyValue(this);
if (index == null) {
int slot = mb.addLocal(null,
ClassItem.typeFromName(m_setValueType));
index = IntegerCache.getInteger(slot);
mb.setKeyValue(this, index);
} else {
mb.appendStoreLocal(index.intValue());
}
}
// generated instruction either stores a field value or calls a
// "set" method, as appropriate
if (access.isMethod()) {
if (access.getArgumentCount() > 1) {
// this test is ugly, needed because of backfill method
// calls from ValueChild
if (mb instanceof ContextMethodBuilder) {
((ContextMethodBuilder)mb).loadContext();
} else {
mb.appendACONST_NULL();
}
}
mb.addMethodExceptions(access);
mb.appendCall(access);
} else {
mb.appendPut(access);
}
if (access.isStatic()) {
discardValue(mb);
}
}
}
}