[drlvm][gc] obj_info agreement between VM and GC
------------------------------------------------
Key: HARMONY-4282
URL: https://issues.apache.org/jira/browse/HARMONY-4282
Project: Harmony
Issue Type: Wish
Components: DRLVM
Environment: All
Reporter: Li-Gang Wang
The original assumption on obj_info is new object has no obj_info. But I think this is not
convenient or necessarily correct to utilize obj_info sufficiently.
For example, in order to know an object is a small (<= small_threshold) or large (>large_threshold)
object, checking a bit in obj_info is more time-saving than searching its size through function
vm_object_size. This needs the according bit in obj_info to be set while allocating. But under
the original assumption, VM will reset obj_info after allocation sometimes, so that this bit
will be misleading. The following is the code resetting obj_info:
jobject object_clone(JNIEnv *jenv, jobject jobj)
{
......
result = (ManagedObject*)vm_new_vector_using_vtable_and_thread_pointer(length, vt->clss->get_allocation_handle(),
vm_get_gc_thread_local()); // call gc_alloc
......
memcpy(result, h->object, size); // copy the old object
result->set_obj_info(0); // obj_info is reset here
......
}
I suggest that we'd better modify the original assumption so that VM and GC could manipulate
bits in obj_info they are in charge of without interfering each other.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.