Expression rhs= stack.pop();
int index= bytes.readUnsignedShort();
ConstantFieldref fieldRef= (ConstantFieldref) constantPool.getConstant(index, Constants.CONSTANT_Fieldref);
FieldAccess fa= new FieldWrite();
fa.setName(getFieldName(fieldRef));
fa.setType(new ObjectType(fieldRef.getClass(constantPool)));
fa.initialize(methodDecl);
if (opcode == Const.PUTFIELD)
{
fa.setExpression(stack.pop());
}
a.setLeftHandSide(fa);
a.setRightHandSide(rhs);
instruction= a;
break;
}
case Const.GETFIELD:
{
int index= bytes.readUnsignedShort();
ConstantFieldref fieldRef= (ConstantFieldref) constantPool.getConstant(index, Constants.CONSTANT_Fieldref);
Expression ex= stack.pop();
FieldAccess fa= new FieldRead();
fa.setType(new ObjectType(fieldRef.getClass(constantPool)));
fa.setName(getFieldName(fieldRef));
fa.setExpression(ex);
fa.initialize(methodDecl);
instruction= fa;
break;
}
case Const.GETSTATIC:
{
int index= bytes.readUnsignedShort();
ConstantFieldref fieldRef= (ConstantFieldref) constantPool.getConstant(index, Constants.CONSTANT_Fieldref);
FieldAccess fa= new FieldRead();
fa.setType(new ObjectType(fieldRef.getClass(constantPool)));
fa.setName(getFieldName(fieldRef));
fa.initialize(methodDecl);
instruction= fa;
break;
}