oop objVectorMap::cloneSize(oop obj, fint len, bool mustAllocate, oop filler) { assert_objVector(obj, "not an obj vector"); fint l = objVectorOop(obj)->length(); objVectorOop v; if (l < len) { // growing array v= objVectorOop(obj)->grow(len - l, mustAllocate); if (oop(v) != failedAllocationOop) { set_oops(v->objs(l), len - l, filler); if (v->is_old()) { if (filler->is_new()) { // do all of object Memory->remembered_set->record_multistores(v->oops(), v->objs(len)); } else { // just do beginning of object; filler isn't new Memory->remembered_set->record_multistores(v->oops(), v->objs(l)); } } } } else if (l > len) { // shrinking array v= objVectorOop(obj)->shrink(l - len, mustAllocate); } else { // copying array v= objVectorOop(obj)->copy(mustAllocate); } if (oop(v) != failedAllocationOop) v->init_mark(); return v; }
void space::clear() { set_top(bottom()); # ifdef ASSERT // to detect scavenging bugs set_oops(bottom(), capacity()/oopSize, oop(1)); # endif }
i386_sp* i386_sp::push_new_sp( char* pc, fint size_in_oops, bool zapAlways ) { assert((size_in_oops & (frame_word_alignment - 1)) == 0, "alignment"); assert( ((frame*)this)->is_aligned(), "alignment"); i386_sp* sp = (i386_sp*)( ((oop*)this) - size_in_oops ); # if GENERATE_DEBUGGING_AIDS if (CheckAssertions) { zapAlways = true; } # endif if (zapAlways) // If errorObj starts showing up where it shouldn't, I recommend // substituting 0xfffffffe for it below: (dmu) set_oops(sp->as_oops(), size_in_oops, (oop)Memory->errorObj); sp->set_link(this); sp->set_return_addr(pc); assert( ((frame*)sp)->is_aligned(), "alignment"); return sp; }
sparc_sp* sparc_sp::push_new_sp( char* pc, fint size_in_oops, bool zapAlways ) { // ( this was 1024 in one previous version and 64 in another!) if (size_in_oops == 0) { size_in_oops = stackTempCountToFrameSize(0); size_in_oops += size_in_oops & (frame_word_alignment-1); // make even } assert((size_in_oops & 1) == 0, "sparc frames must be even length"); sparc_sp* sp = (sparc_sp*)( as_oops() - size_in_oops ); # if GENERATE_DEBUGGING_AIDS if (CheckAssertions) { zapAlways = true; } # endif if (zapAlways) // If errorObj starts showing up where it shouldn't, I recommend // substituting 0xfffffffe for it below: (dmu) set_oops(sp->as_oops(), size_in_oops, (oop)Memory->errorObj); sp->set_link(as_callees_fp()); sp->set_return_addr(pc); assert(sp->link() == (sparc_fp*)this, "just checkin'"); return sp; }
void nmethod::flush() { BlockProfilerTicks bpt(exclude_nmethod_flush); CSect cs(profilerSemaphore); // for profiler # if GENERATE_DEBUGGING_AIDS if (CheckAssertions) { // for debugging if (nmethodFlushCount && --nmethodFlushCount == 0) warning("nmethodFlushCount"); if (this == (nmethod*)catchThisOne) warning("caught nmethod"); } # endif // EventMarker em("flushing nmethod %#lx %s", this, ""); if (PrintMethodFlushing) { ResourceMark m; char *compilerName = VMString[compiler()]->copy_null_terminated(); lprintf("*flushing %s%s%s-nmethod 0x%lx %d\t(", isZombie() ? "zombie " : "", isAccess() ? "access " : "", compilerName, (void*)(long unsigned)this, (void*)useCount[id]); printName(0, key.selector); lprintf(")"); } // always check the following - tests are really cheap if (flags.flushed) fatal1("nmethod %#lx already flushed", this); if (zone::frame_chain_nesting == 0) fatal("frames must be chained when flushing"); if (frame_chain != NoFrameChain) { // Can't remove an nmethod from deps chains now, because later // programming changes may need to invalidate it. // That is, don't unlink() now. // See comment for makeZombie routine. The comment above is the // "original comment" referred to there. // -- dmu 1/12/03 if (this == recompilee) { // nmethod is being recompiled; cannot really flush yet // em.event.args[1] = "(being recompiled)"; if (PrintMethodFlushing) { lprintf(" (being recompiled)\n"); } } else { // nmethod is currently being executed; cannot flush yet // em.event.args[1] = "(currently active)"; if (PrintMethodFlushing) { lprintf(" (currently active)\n"); } } makeZombie(false); } else { unlink(); // nmethod is not being executed; completely throw away // em.event.args[1] = "(not currently active)"; if (PrintMethodFlushing) { lprintf("\n"); } flatProfiler->flush((char*)this, instsEnd()); zoneLink.remove(); rememberLink.remove(); for (addrDesc* p = locs(), *pend = locsEnd(); p < pend; p++) { if (p->isSendDesc()) { p->asSendDesc(this)->unlink(); } else if (p->isDIDesc()) { p->asDIDesc(this)->dependency()->flush(); } } flags.flushed = 1; // to detect flushing errors # if GENERATE_DEBUGGING_AIDS if (CheckAssertions) { set_oops((oop*)insts(), instsLen()/oopSize, 0); // for quicker detection } # endif Memory->code->free_nmethod(this); } MachineCache::flush_instruction_cache_for_debugging(); }
inline void set_words(int* from, int count, int value = 0) { set_oops((oop*) from, count, (oop) value); }