harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r559583 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp
Date Wed, 25 Jul 2007 20:35:48 GMT
Author: gshimansky
Date: Wed Jul 25 13:35:47 2007
New Revision: 559583

URL: http://svn.apache.org/viewvc?view=rev&rev=559583
Log:
Applied patches from HARMONY-4282
[drlvm][vmcore] obj_info agreement between VM and GC


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp?view=diff&rev=559583&r1=559582&r2=559583
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp Wed Jul 25 13:35:47
2007
@@ -155,8 +155,15 @@
     if(gc_requires_barriers())
         gc_heap_wrote_object(result);
 
-    memcpy(result, h->object, size);
-    result->set_obj_info(0);
+    // Gregory - Skip object header copying, it should be initialized
+    // by GC already, and copying may erase some information that GC
+    // wrote in it at allocation time
+    const size_t skip = ManagedObject::get_constant_header_size();
+    assert(skip <= size);
+    jbyte *dest = (jbyte *)result + skip;
+    jbyte *src = (jbyte *)h->object + skip;
+    memcpy(dest, src, size - skip);
+
     ObjectHandle new_handle = oh_allocate_local_handle();
     new_handle->object = result;
     tmn_suspend_enable(); 



Mime
View raw message