changeset 1025:67600de741be

2008-08-20 Gary Benson <gbenson@redhat.com> * ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp (VMlongDiv): Handle the special case of division of the most negative value possible by -1. (VMlongRem): Likewise.
author Gary Benson <gbenson@redhat.com>
date Wed, 20 Aug 2008 04:12:41 -0400
parents 8bd5f7718ae0
children 4f4d268762d7
files ChangeLog ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Aug 17 16:03:52 2008 +0200
+++ b/ChangeLog	Wed Aug 20 04:12:41 2008 -0400
@@ -1,3 +1,10 @@
+2008-08-20  Gary Benson  <gbenson@redhat.com>
+
+	* ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp
+	(VMlongDiv): Handle the special case of division of the most
+	negative value possible by -1.
+	(VMlongRem): Likewise.
+
 2008-08-15  Matthias Klose  <doko@ubuntu.com>
 
 	* acinclude.m4 (FIND_LIBGCJ_JAR): Extend check for libgcj-4.2.*.jar.
--- a/ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp	Sun Aug 17 16:03:52 2008 +0200
+++ b/ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp	Wed Aug 20 04:12:41 2008 -0400
@@ -54,8 +54,9 @@
 }
 
 inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) {
-  // QQQ what about check and throw...
-  return op1 / op2;
+  /* it's possible we could catch this special case implicitly */
+  if (op1 == (jlong) 0x8000000000000000LL && op2 == -1) return op1;
+  else return op1 / op2;
 }
 
 inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) {
@@ -75,7 +76,9 @@
 }
 
 inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) {
-  return op1 % op2;
+  /* it's possible we could catch this special case implicitly */
+  if (op1 == (jlong) 0x8000000000000000LL && op2 == -1) return 0;
+  else return op1 % op2;
 }
 
 inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) {