w_clazz createClazzArray(void) { w_string string_clone = cstring2String("clone",5); w_clazz clazz = allocClazz(); w_method arrayclone = &Array_clone_method; w_size i; for (i = 0; i < clazzObject->numDeclaredMethods; i++) { if (clazzObject->own_methods[i].spec.name == string_clone) { woempa(7, "Found clone method of clazzObject in slot [%d], using it as basis of array clone\n", i); w_memcpy(arrayclone, &clazzObject->own_methods[i], sizeof(w_Method)); arrayclone->exec.function = (w_function)(w_void_fun)Array_clone; unsetFlag(arrayclone->flags, ACC_PROTECTED); setFlag(arrayclone->flags, ACC_PUBLIC); } } w_memcpy(clazz, clazzObject, sizeof(w_Clazz)); clazz->resolution_monitor = allocMem(sizeof(x_Monitor)); if (!clazz->resolution_monitor) { wabort(ABORT_WONKA, "Unable to allocate clazz->resolution_monitor\n"); } x_monitor_create(clazz->resolution_monitor); clazz->dotified = cstring2String("array prototype", 15); clazz->tags = allocMem(clazzObject->numConstants * sizeof(w_ConstantType)); if (!clazz->tags) { wabort(ABORT_WONKA, "Unable to allocate clazz->tags\n"); } memcpy((char*)clazz->tags, (char*)clazzObject->tags, clazzObject->numConstants * sizeof(w_ConstantType)); clazz->values = allocMem(clazzObject->numConstants * sizeof(w_word)); if (!clazz->values) { wabort(ABORT_WONKA, "Unable to allocate clazz->values\n"); } memcpy((char*)clazz->values, (char*)clazzObject->values, clazzObject->numConstants * sizeof(w_word)); clazz->numDeclaredMethods = 1; clazz->own_methods = arrayclone; clazz->numInterfaces = 2; clazz->numDirectInterfaces = 2; clazz->interfaces = Array_interfaces; clazz->interfaces[0] = clazzCloneable; clazz->interfaces[1] = clazzSerializable; clazz->numSuperClasses = 1; clazz->supers = Array_supers; clazz->supers[0] = clazzObject; clazz->numConstants = 0; F_Array_length = 0; F_Array_data = 1; return clazz; }
static void jdwp_vm_disconnect(jdwp_command_packet cmd) { w_fifo fifo = ht_list_values(thread_hashtable); w_thread thread; jdwp_send_reply(cmd->id, &reply_grobag, jdwp_err_none); while((thread = getFifo(fifo)) != NULL) { woempa(7, "Clearing suspend count of %t\n", thread); thread->flags &= ~WT_THREAD_SUSPEND_COUNT_MASK; } while (jdwp_global_suspend_count) { jdwp_internal_resume_all(); } unsetFlag(blocking_all_threads, BLOCKED_BY_JDWP); jdwp_state = jdwp_state_initialised; jdwp_events_enabled = 0; jdwp_clear_all_events(); /* TODO: if garbage collection was disabled, enable it again. */ }
void PageMarker::setFlag(flag_t f, bool value) { value ? setFlag(f) : unsetFlag(f); }