You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gs...@apache.org on 2007/11/14 21:50:49 UTC

svn commit: r595048 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_watch.cpp

Author: gshimansky
Date: Wed Nov 14 12:50:48 2007
New Revision: 595048

URL: http://svn.apache.org/viewvc?rev=595048&view=rev
Log:
Applied patch from HARMONY-5033
[drlvm][jvmti] FieldModificationEvent should support compressed references on x86_64


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_watch.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_watch.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_watch.cpp?rev=595048&r1=595047&r2=595048&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_watch.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_watch.cpp Wed Nov 14 12:50:48 2007
@@ -37,6 +37,7 @@
 #include "jvmti_direct.h"
 #include "object_handles.h"
 #include "jvmti_utils.h"
+#include "jvmti_heap.h"
 #include "type.h"
 #include "cxxlog.h"
 
@@ -331,10 +332,14 @@
 
     jvalue new_value = *p_new_value;
 
-    if (! field->get_field_type_desc()->is_primitive() && NULL != new_value.l) {
+    if (! field->get_field_type_desc()->is_primitive())
+    {
+        if ((void*)new_value.l == REF_MANAGED_NULL)
+        { // Compressed null is not NULL, so let's convert value
+            new_value.l = NULL;
+        }
         // if new_value.l is not a handle but a direct pointer to java heap
-        if ((ManagedObject*)new_value.l >= (ManagedObject*)VM_Global_State::loader_env->heap_base
-            && (ManagedObject*)new_value.l <= (ManagedObject*)VM_Global_State::loader_env->heap_end)
+        else if (is_object_valid((Managed_Object_Handle)new_value.l))
         {
             new_value.l = oh_allocate_local_handle();
             new_value.l->object = (ManagedObject*)p_new_value->l;