void pr57::entry() { c = a; d = ! a.read(); b = pres1(1, 0); wait(); c = ! a.read(); d = a; b = pres1(0, 1); wait(); c = a; d = ! a.read(); b = pres2(0); wait(); pres3(!a.read()); d = a; b = pres2(1); wait(); }
oop processOopClass::KillUpTo_prim(smi index, void *FH) { ResourceMark rm; preserved pres1(this); Process* p; frame* last; abstract_vframe* vf = vframe_at(index, FH, p, last); if (!vf) return NULL; if (!p->isRunnable()) { failure(FH, "process is not runnable"); return 0; } if (p == currentProcess) { failure(FH, "cannot operate on current process"); return 0; } if (p == twainsProcess) { failure(FH, "cannot operate on scheduler process"); return 0; } p->killFrames(vf); assert(!p->isKilling(), "shouldn't be in killing mode anymore"); return pres1.value; }
oop processOopClass::GotoByteCode_prim(smi bci, objVectorOop exprStack, void *FH) { ResourceMark rm; preserved pres1(this); Process* p; frame* last; abstract_vframe* vf = vframe_at(0, FH, p, last); if (!vf) return NULL; if (!p->isRunnable()) { failure(FH, "processes is not runnable"); return 0; } if (p == currentProcess) { failure(FH, "cannot operate on current process"); return 0; } if (p == twainsProcess) { failure(FH, "cannot operate on scheduler process"); return 0; } p->gotoByteCode(vf, bci, exprStack, FH); return pres1.value; }
void processOopClass::TWAINS_transfer_to_another_process( Process* proc, objVectorOop& resultArg, bool stepping, vframeOop stop_vfo) { if (proc->hasStack() || proc->allocate()) { // transfer to the other process preserved pres1(resultArg); if (stepping) { proc->setSingleStepping(); preemptCause = cSingleStepped; // so it isn't overridden by signals } if (stop_vfo) proc->setStopPoint(stop_vfo); LOG_EVENT3("TWAINS: transfer to %#lx %s stop=%#lx", proc, stepping ? "stepping" : "", stop_vfo); proc->transfer(); // run the other process resultArg = objVectorOop(pres1.value); if (stepping) { assert(preemptCause == cSingleStepped || isFatalCause(preemptCause), "wrong preemptCause"); proc->resetSingleStepping(); } if (proc->stopping) { // returned from stopActivation (but could be way past it, e.g. // when process was aborted) proc->resetStopping(); if (!isFatalCause(preemptCause)) preemptCause = cFinishedActivation; } proc->setStopPoint(NULL); } else { // couldn't allocate stack preemptCause= cCouldntAllocateStack; proc->state= aborting; } }