void MethodBlock::load_const(Location& loc, DexType* value) { always_assert(!loc.is_wide()); DexInstruction* load = new DexOpcodeType(OPCODE_CONST_CLASS, value); load->set_dest(reg_num(loc)); loc.type = get_class_type(); push_instruction(load); }
void MethodBlock::load_const(Location& loc, DexType* value) { always_assert(!loc.is_wide()); IRInstruction* load = new IRInstruction(OPCODE_CONST_CLASS); load->set_type(value); push_instruction(load); IRInstruction* move_result_pseudo = new IRInstruction(IOPCODE_MOVE_RESULT_PSEUDO_OBJECT); loc.type = get_class_type(); move_result_pseudo->set_dest(loc.get_reg()); push_instruction(move_result_pseudo); }
void GenericFunctionInterval::priv_instant() { check_stopped(get_class_type(), "priv_instant"); // Evaluate the function if(m_functionPtr != NULL) { // Note: the following code would deadlock when trying to access data from another // running interval (such as in the Boxing-Robots tutorial, i.e. checkPunch // accessing resetHead). I'm guessing it is because the running thread1 is // asking data from thread2 who is waiting for thread1 to finish... // // (*m_functionPtr)(m_dataPtr); // // The truth is I did not try to figure it out, but I rather looked for a // workaround to indirectly ask data to thread2 using an AsyncTask. string taskName("GenericFunctionIntervalTask"); taskName += InstanceCounter; AsyncTaskManager::get_global_ptr()->add(new GenericAsyncTask(taskName, wrapper, this)); } _state = S_final; }