Second line of class_alloc_new_object asserts
'!hythread_is_suspend_enabled()'. So, yes, we can assume the condition.

The line to add is something like
'assert(struct_Class_to_java_lang_Class());' to remove it in release.

WBR,
   Pavel.


On 3/12/07, Weldon Washburn <[EMAIL PROTECTED]> wrote:

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:


assert(c);

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

assert(hjlc);

ManagedObject* jlc = *hjlc;

assert(jlc != NULL);

assert(jlc->vt());

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




--
Pavel Pervov,
Intel Enterprise Solutions Software Division

Reply via email to