This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: interpreter and checkcast message
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 29 Jun 2005 10:13:15 -0600
- Subject: Patch: FYI: interpreter and checkcast message
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk. If I remember I'll put it on the
4.0 branch once it reopens (there are a fair number of patches pending
for it ... I hope it reopens soon).
The checkcast opcode in the interpreter put a different, and less
useful, message into the ClassCastException it threw. I changed this
to use _Jv_CheckCast instead.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* interpret.cc (run) <insn_checkcast, checkcast_resolved>: Use
_Jv_CheckCast.
Index: interpret.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/interpret.cc,v
retrieving revision 1.51
diff -u -r1.51 interpret.cc
--- interpret.cc 24 Jun 2005 22:04:11 -0000 1.51
+++ interpret.cc 29 Jun 2005 16:15:34 -0000
@@ -25,7 +25,6 @@
#include <java/lang/StringBuffer.h>
#include <java/lang/Class.h>
#include <java/lang/reflect/Modifier.h>
-#include <java/lang/ClassCastException.h>
#include <java/lang/VirtualMachineError.h>
#include <java/lang/InternalError.h>
#include <java/lang/NullPointerException.h>
@@ -3022,8 +3021,7 @@
jclass to = (_Jv_Linker::resolve_pool_entry (meth->defining_class,
index)).clazz;
- if (value != NULL && ! to->isInstance (value))
- throw new java::lang::ClassCastException (to->getName());
+ value = (jobject) _Jv_CheckCast (to, value);
PUSHA (value);
@@ -3040,8 +3038,7 @@
SAVE_PC();
jobject value = POPA ();
jclass to = (jclass) AVAL ();
- if (value != NULL && ! to->isInstance (value))
- throw new java::lang::ClassCastException (to->getName());
+ value = (jobject) _Jv_CheckCast (to, value);
PUSHA (value);
}
NEXT_INSN;