harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r500178 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: class_support/classloader.cpp exception/exceptions_impl.cpp
Date Fri, 26 Jan 2007 08:24:49 GMT
Author: gshimansky
Date: Fri Jan 26 00:24:47 2007
New Revision: 500178

URL: http://svn.apache.org/viewvc?view=rev&rev=500178
Log:
Applied HARMONY-2022 [drlvm] Fix ClassLoading in exception raised state.

Tests passed on Ubuntu6 x86, Windows 2003 server x86 and SuSE9 x86_64


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp?view=diff&rev=500178&r1=500177&r2=500178
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Fri Jan 26 00:24:47
2007
@@ -218,6 +218,7 @@
                                 uint8* bytecode, unsigned offset, unsigned length,
                                 const String** res_name)
 {
+    assert(!exn_raised());
     const String *className;
 
     LOG2("classloader.defineclass", "Defining class " << (NULL != class_name ? class_name
: "NULL") << " with loader " << this);
@@ -226,6 +227,7 @@
     } else {
         className = class_extract_name(env, bytecode, offset, length);
         if(className == NULL) {
+            FailedLoadingClass(className);
             exn_raise_by_name("java/lang/ClassFormatError",
                 "class name could not be extracted from provided class data", NULL);
             return NULL;
@@ -235,7 +237,7 @@
         *res_name = className;
     }
 
-    Class* clss;
+    Class* clss = NULL;
     if((clss = WaitDefinition(env, className)) != NULL || exn_raised())
         return clss;
 
@@ -336,6 +338,7 @@
 
 Class* ClassLoader::LoadVerifyAndPrepareClass(Global_Env* env, const String* name)
 {
+    assert(!exn_raised());
     assert(hythread_is_suspend_enabled());
 
     Class* clss = LoadClass(env, name);
@@ -908,6 +911,7 @@
 */
 Class* ClassLoader::AllocateAndReportInstance(const Global_Env* env, Class* clss)
 {
+     ASSERT_RAISE_AREA;
     const String* name = clss->get_name();
     assert(name);
 
@@ -1486,6 +1490,7 @@
 Class* BootstrapClassLoader::DoLoadClass(Global_Env* UNREF env,
                                        const String* className)
 {
+    assert(!exn_raised());
     assert(env == m_env);
     assert(!exn_raised());
 
@@ -1669,6 +1674,8 @@
 
 Class* BootstrapClassLoader::LoadFromFile(const String* class_name)
 {
+    assert(!exn_raised());
+
     // the symptom of circularity (illegal) is that a null class name is passed,
     // so detect this immediately
     if( !class_name->bytes || *(class_name->bytes) == 0 ) {
@@ -1788,6 +1795,8 @@
 Class* BootstrapClassLoader::LoadFromJarFile( JarFile* jar_file,
     const char* class_name_in_jar, const String* class_name, bool* not_found)
 {
+    assert(!exn_raised());
+
     // find archive entry in archive file
     *not_found = false;
     const JarEntry *entry = jar_file->Lookup(class_name_in_jar);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp?view=diff&rev=500178&r1=500177&r2=500178
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp Fri Jan 26 00:24:47
2007
@@ -42,11 +42,19 @@
     String *exc_str = env->string_pool.lookup(exception_name);
     Class *exc_class =
         env->bootstrap_class_loader->LoadVerifyAndPrepareClass(env, exc_str);
-    if (exc_class == NULL) return NULL;
+
+    if (exc_class == NULL) {
+        return NULL;
+    }
+
     tmn_suspend_disable();
     class_initialize(exc_class);
     tmn_suspend_enable();
-    assert(!exn_raised());
+
+    if (exn_raised()) {
+        return NULL;
+    }
+
     return exc_class;
 }
 



Mime
View raw message