harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weldon Washburn" <weldon...@gmail.com>
Subject [drlvm][runtime support] a question about an old JIRA -- H1922
Date Mon, 12 Mar 2007 17:51:45 GMT
Looking at just the procedure named, class_alloc_new_object(), the assert
definitely looks wrong.  However, I think the patch ignores the intent of
the assert.  I think the developer intended to somehow assert that the input
arg, a ptr to struct Class, is valid.  In other words the original intent is
to do something like:


ManagedObject** hjlc = c->get_class_handle();


ManagedObject* jlc = *hjlc;

assert(jlc != NULL);


assert(jlc->vt()->clss == VM_Global_State::loader_env->JavaLangClass_Class);

assert(java_lang_Class_to_struct_Class(jlc) == clss); // else clss's
java.lang.Class had a bad "back" pointer
Note that I stole all the above code from the existing function called,

ManagedObject *struct_Class_to_java_lang_Class(Class *clss) {...}

Rather than cut/paste the body of struct_Class_to_java_lang_Class into
class_alloc_new_object(), how about simply calling
struct_Class_to_java_lang_Class()?  The only unknown is if we can assume
the condition assert(!hythread_is_suspend_enabled() );  will be OK from the
body of class_alloc_new_object().  Thoughts?

Weldon Washburn
Intel Enterprise Solutions Software Division

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message