harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r562267 - in /harmony/enhanced/drlvm/trunk/vm: interpreter/src/interpreter.cpp vmcore/include/Class.h vmcore/src/exception/exceptions_jit.cpp vmcore/src/jit/jit_runtime_support.cpp
Date Thu, 02 Aug 2007 21:39:10 GMT
Author: gshimansky
Date: Thu Aug  2 14:39:09 2007
New Revision: 562267

URL: http://svn.apache.org/viewvc?view=rev&rev=562267
Log:
Applied patch from HARMONY-4515
[drlvm][classloader] ClassCastException is thrown with low detail


Modified:
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp?view=diff&rev=562267&r1=562266&r2=562267
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp Thu Aug  2 14:39:09 2007
@@ -2234,7 +2234,7 @@
     ManagedObject *obj = UNCOMPRESS_REF(frame.stack.pick().cr);
 
     if (!(obj == 0 || vm_instanceof(obj, objClass))) {
-        interp_throw_exception("java/lang/ClassCastException");
+        interp_throw_exception("java/lang/ClassCastException", obj->vt()->clss->get_java_name()->bytes);
         return;
     }
     frame.ip += 3;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h?view=diff&rev=562267&r1=562266&r2=562267
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h Thu Aug  2 14:39:09 2007
@@ -710,7 +710,7 @@
 /** Converts a class name from an internal (VM) form to the Java form.
  * @param[in] class_name - the class name in an internal form
  * @return The class name in the Java form.*/
-String* class_name_get_java_name(const String* class_name);
+VMEXPORT String* class_name_get_java_name(const String* class_name);
 
 // A Java class
 extern "C" {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp?view=diff&rev=562267&r1=562266&r2=562267
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp Thu Aug  2 14:39:09
2007
@@ -956,15 +956,7 @@
 Class_Handle exn_get_class_cast_exception_type()
 {
     assert(hythread_is_suspend_enabled());
-    Class *exn_clss;
-
-    Global_Env *env = VM_Global_State::loader_env;
-    String *exc_str = env->string_pool.lookup("java/lang/ClassCastException");
-    exn_clss =
-        env->bootstrap_class_loader->LoadVerifyAndPrepareClass(env, exc_str);
-    assert(exn_clss);
-
-    return exn_clss;
+    return VM_Global_State::loader_env->java_lang_ClassCastException_Class;
 }
 
 // rth_throw_class_cast_exception throws a class cast exception (lazily)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?view=diff&rev=562267&r1=562266&r2=562267
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Thu Aug  2 14:39:09
2007
@@ -2292,10 +2292,10 @@
     obj = obj_h->object;
     oh_discard_local_handle(obj_h);
     END_RAISE_AREA
-    
+
     Boolean res = class_is_subtype(objClass, castClass);
     if (!res) {
-        exn_throw_by_name("java/lang/ClassCastException");
+        exn_throw_by_name("java/lang/ClassCastException", objClass->get_java_name()->bytes);
     }
     return obj;
 }



Mime
View raw message