void VMProcess::loop() { while (true) { assert(vm_operation(), "A VM_Operation should be present"); vm_operation()->evaluate(); DeltaProcess* p = vm_operation()->calling_process(); _vm_operation = NULL; if (p) { transfer_to(p); } else { transfer_to(DeltaProcess::scheduler()); } } }
void VMProcess::activate_system() { // Find the Delta level 'Processor' processOop proc = processOop(Universe::find_global("Processor")); if (!proc->is_process()) { klassOop scheduler_klass = klassOop(Universe::find_global("ProcessorScheduler")); proc = processOop(scheduler_klass->klass_part()->allocateObject()); associationOop assoc = Universe::find_global_association("Processor"); assoc->set_value(proc); } DeltaProcess::initialize_async_dll_event(); // Create the initial process DeltaProcess::set_scheduler(new DeltaProcess(proc, oopFactory::new_symbol("start"))); // Bind the scheduler to Processor proc->set_process(DeltaProcess::scheduler()); DeltaProcess::scheduler()->set_processObj(proc); // Transfer control to the scheduler transfer_to(DeltaProcess::scheduler()); // Call the ever running loop handling vm operations loop(); }
void VMProcess::loop() { while (true) { assert(vm_operation(), "A VM_Operation should be present"); vm_operation()->evaluate(); // if the process's thread is dead then the stack may already be released // in which case the vm_operation is no longer valid, so check for a // terminated process first. Can't use accessor as it resets the flag! DeltaProcess* p = DeltaProcess::_process_has_terminated ? DeltaProcess::scheduler() : vm_operation()->calling_process(); _vm_operation = NULL; transfer_to(p); } }