% Set field in Object

meth PutField =^ (

var index : Int

var fdname : String

var entry : CpList

var e : Object

var Obj : ObjectInfo

var value : Object

var ref : Object

var CurrentFrame : FrameInfo

TopFrame.GetFrame(CurrentFrame);

% getting the entry number of the Constant Pool

currentFrame.GetNextBytecode(b);

b.GetCode(index);

% searching the constant pool – Finding the field name

currentFrame.FindCPList(index, entry);

 

entry.GetInfo(e);

if [] e isExactly CPentryFieldref

(CPentryFieldref)e.Getname(fdname)

[] not(e isExactly CPentryFieldref) miracle

fi

% getting the reference to the object that holds the field

currentFrame.Pop(value);

 

% getting the current class

currentFrame.GetcurrentClass(cl);

% getting the the object that holds the field

currentFrame.Pop(Ref);

if [] ref isExactly ObjectInfo Obj:= (ObjectInfo) ref;

[] not (ref isExactly ObjectInfo) miracle

fi

%searching the field name in the object

Obj.PutDataFd(fdname, value);

TopFrame.SetFrame(CurrentFrame);

end end end end end end end

)

end