summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-15 00:24:38 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-15 00:24:38 +0000
commit0366f054ef30b0684d3ce0133fbfe7109a9d9702 (patch)
tree208a8abdb751404247089309e3921baaa3d1b893 /libjava
parent633403fb0b786c9df9678070295585dbac1cf3e1 (diff)
downloadgcc-0366f054ef30b0684d3ce0133fbfe7109a9d9702.tar.gz
* verify.cc (class _Jv_BytecodeVerifier) [op_dup2]: Fixed logic.
[op_dup_x2]: Likewise. [op_dup2_x1]: Likewise. [op_dup2_x2]: Likewise. (branch_prepass): Added `op_newarray' case. Updated unrecognized instruction error. (verify_instructions_0): Updated unrecognized instruction error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47033 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/verify.cc88
2 files changed, 78 insertions, 18 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index b32af473fc6..e8b6e8838d9 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,13 @@
2001-11-14 Tom Tromey <tromey@redhat.com>
+ * verify.cc (class _Jv_BytecodeVerifier) [op_dup2]: Fixed logic.
+ [op_dup_x2]: Likewise.
+ [op_dup2_x1]: Likewise.
+ [op_dup2_x2]: Likewise.
+ (branch_prepass): Added `op_newarray' case. Updated unrecognized
+ instruction error.
+ (verify_instructions_0): Updated unrecognized instruction error.
+
* java/lang/reflect/Constructor.java (toString): Use more
efficient form of Modifier.toString().
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 49bc0f4eb88..6deb80b08d6 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1314,6 +1314,7 @@ private:
case op_putfield:
case op_putstatic:
case op_new:
+ case op_newarray:
case op_anewarray:
case op_instanceof:
case op_checkcast:
@@ -1402,7 +1403,7 @@ private:
break;
default:
- verify_fail ("unrecognized instruction");
+ verify_fail ("unrecognized instruction in branch_prepass");
}
// See if any previous branch tried to branch to the middle of
@@ -1915,39 +1916,90 @@ private:
case op_dup_x2:
{
type t1 = pop32 ();
- type t2 = pop32 ();
- type t3 = pop32 ();
- push_type (t1);
- push_type (t3);
+ type t2 = pop_raw ();
+ if (! t2.iswide ())
+ {
+ type t3 = pop32 ();
+ push_type (t1);
+ push_type (t3);
+ }
+ else
+ push_type (t1);
push_type (t2);
push_type (t1);
}
break;
case op_dup2:
{
- type t = pop64 ();
- push_type (t);
+ type t = pop_raw ();
+ if (! t.iswide ())
+ {
+ type t2 = pop32 ();
+ push_type (t2);
+ push_type (t);
+ push_type (t2);
+ }
push_type (t);
}
break;
case op_dup2_x1:
{
- type t1 = pop64 ();
- type t2 = pop64 ();
- push_type (t1);
+ type t1 = pop_raw ();
+ type t2 = pop32 ();
+ if (! t1.iswide ())
+ {
+ type t3 = pop32 ();
+ push_type (t2);
+ push_type (t1);
+ push_type (t3);
+ }
+ else
+ push_type (t1);
push_type (t2);
push_type (t1);
}
break;
case op_dup2_x2:
{
- type t1 = pop64 ();
- type t2 = pop64 ();
- type t3 = pop64 ();
- push_type (t1);
- push_type (t3);
- push_type (t2);
- push_type (t1);
+ // FIXME
+ type t1 = pop_raw ();
+ if (t1.iswide ())
+ {
+ type t2 = pop_raw ();
+ if (t2.iswide ())
+ {
+ push_type (t1);
+ push_type (t2);
+ }
+ else
+ {
+ type t3 = pop32 ();
+ push_type (t1);
+ push_type (t3);
+ push_type (t2);
+ }
+ push_type (t1);
+ }
+ else
+ {
+ type t2 = pop32 ();
+ type t3 = pop_raw ();
+ if (t3.iswide ())
+ {
+ push_type (t2);
+ push_type (t1);
+ }
+ else
+ {
+ type t4 = pop32 ();
+ push_type (t2);
+ push_type (t1);
+ push_type (t4);
+ }
+ push_type (t3);
+ push_type (t2);
+ push_type (t1);
+ }
}
break;
case op_swap:
@@ -2385,7 +2437,7 @@ private:
default:
// Unrecognized opcode.
- verify_fail ("unrecognized instruction");
+ verify_fail ("unrecognized instruction in verify_instructions_0");
}
}
}