void CodeGen::assignment(Location receiver, realSlotRef* path, Location val, bool isMem) { a.Comment("Begin Assignment"); // called from assignmentCode; real assignment method int32 offset = smiOop(path->desc->data)->byte_count() - Mem_Tag; if (path->holder->is_object_or_map()) { Location tmp = val == Temp1 ? Temp2 : Temp1; bool yipes = tmp == receiver; if (yipes) a.pushl(val); Location tr = loadPath(tmp, path->holder, receiver, tmp); a.leal(tr, offset, NumberOperand, tr); Location r; int32 d; OperandType t; Location other_temp = tr == Temp1 ? Temp2 : Temp1; if (yipes) a.popl(other_temp); else if (val != other_temp) { reg_disp_type_of_loc(&r, &d, &t, val); a.movl(r, d, t, other_temp); } a.movl(other_temp, tr, 0, NumberOperand); if (isMem) { recordStore(tr); } } else { fatal("don't support vframe lookups yet"); } a.Comment("End Assignment"); }
void CodeGen::assignment(Location receiver, realSlotRef* path, Location val, bool isMem) { // <move arg, t> // <loadPath rr, path, receiver> // store receiver/rr, offset - Mem_Tag, arg/t // <check_store> a.Comment("Begin Assignment"); Location t; if (isRegister(val) && val != CReceiverReg) { t = val; } else { t = Temp1; move(t, val); // load argument } assert(t != Temp2, "register conflict"); int32 offset = smiOop(path->desc->data)->byte_count() - Mem_Tag; if (path->holder->is_object_or_map()) { Location t1 = loadPath(CReceiverReg, path->holder, receiver, Temp1); a.StoreI(t1, offset, t); // store object data slot contents if (isMem) { a.AddI(t1, offset, Temp1); // compute store address recordStore(Temp1); } } else { fatal("don't support vframe lookups yet"); } a.Comment("End Assignment"); }
void CodeGen::assignment(Location receiver, slotDesc* s, Location val) { // this one called for impl self, arg on stack a.Comment("Begin Simple Assignment"); assert(!isRegister(receiver) && !isRegister(val), "called from genReceiverDataAccess, rcvr is self, val is arg or local, check this so I can use Temp[12]"); move(Temp2, receiver); int32 offset = smiOop(s->data)->byte_count() - Mem_Tag; a.leal(Temp2, offset, NumberOperand, Temp2); // store object data slot contents move(Temp1, val); a.movl(Temp1, Temp2, 0, NumberOperand); // store object data slot contents recordStore(Temp2); // NB: recordStore will clobber Temp2 till I put in ByteMapBaseReg a.Comment("End Simple Assignment"); }
int nRecords() const { int count = 0; const Extent* ext; for ( DiskLoc extLoc = nsd()->firstExtent(); !extLoc.isNull(); extLoc = ext->xnext) { ext = extentManager()->getExtent(extLoc); int fileNo = ext->firstRecord.a(); if ( fileNo == -1 ) continue; for ( int recOfs = ext->firstRecord.getOfs(); recOfs != DiskLoc::NullOfs; recOfs = recordStore()->recordFor(DiskLoc(fileNo, recOfs))->nextOfs() ) { ++count; } } ASSERT_EQUALS( count, nsd()->numRecords() ); return count; }
void CodeGen::assignment(Location receiver, slotDesc* s, Location val) { // <move arg, t> // store [receiver/rr, offset - Mem_Tag], t // <check_store> assert( isRegister(receiver), "receiver must be a register"); a.Comment("Begin Simple Assignment"); Location t; if (isRegister(val) && val != CReceiverReg) { t = val; } else { t = Temp1; move(t, val); // load argument } int32 offset = smiOop(s->data)->byte_count() - Mem_Tag; a.StoreI(receiver, offset, t); // store object data slot contents a.AddI(receiver, offset, Temp1); // compute store address recordStore(Temp1); a.Comment("End Simple Assignment"); }