Commit 6c5a8271 by Tom Tromey Committed by Tom Tromey

verify.cc (class _Jv_BytecodeVerifier): Fixed logic.

	* 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.

From-SVN: r47033
parent 9da85b16
2001-11-14 Tom Tromey <tromey@redhat.com> 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 * java/lang/reflect/Constructor.java (toString): Use more
efficient form of Modifier.toString(). efficient form of Modifier.toString().
......
...@@ -1314,6 +1314,7 @@ private: ...@@ -1314,6 +1314,7 @@ private:
case op_putfield: case op_putfield:
case op_putstatic: case op_putstatic:
case op_new: case op_new:
case op_newarray:
case op_anewarray: case op_anewarray:
case op_instanceof: case op_instanceof:
case op_checkcast: case op_checkcast:
...@@ -1402,7 +1403,7 @@ private: ...@@ -1402,7 +1403,7 @@ private:
break; break;
default: default:
verify_fail ("unrecognized instruction"); verify_fail ("unrecognized instruction in branch_prepass");
} }
// See if any previous branch tried to branch to the middle of // See if any previous branch tried to branch to the middle of
...@@ -1915,39 +1916,90 @@ private: ...@@ -1915,39 +1916,90 @@ private:
case op_dup_x2: case op_dup_x2:
{ {
type t1 = pop32 (); type t1 = pop32 ();
type t2 = pop32 (); type t2 = pop_raw ();
type t3 = pop32 (); if (! t2.iswide ())
push_type (t1); {
push_type (t3); type t3 = pop32 ();
push_type (t1);
push_type (t3);
}
else
push_type (t1);
push_type (t2); push_type (t2);
push_type (t1); push_type (t1);
} }
break; break;
case op_dup2: case op_dup2:
{ {
type t = pop64 (); type t = pop_raw ();
push_type (t); if (! t.iswide ())
{
type t2 = pop32 ();
push_type (t2);
push_type (t);
push_type (t2);
}
push_type (t); push_type (t);
} }
break; break;
case op_dup2_x1: case op_dup2_x1:
{ {
type t1 = pop64 (); type t1 = pop_raw ();
type t2 = pop64 (); type t2 = pop32 ();
push_type (t1); if (! t1.iswide ())
{
type t3 = pop32 ();
push_type (t2);
push_type (t1);
push_type (t3);
}
else
push_type (t1);
push_type (t2); push_type (t2);
push_type (t1); push_type (t1);
} }
break; break;
case op_dup2_x2: case op_dup2_x2:
{ {
type t1 = pop64 (); // FIXME
type t2 = pop64 (); type t1 = pop_raw ();
type t3 = pop64 (); if (t1.iswide ())
push_type (t1); {
push_type (t3); type t2 = pop_raw ();
push_type (t2); if (t2.iswide ())
push_type (t1); {
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; break;
case op_swap: case op_swap:
...@@ -2385,7 +2437,7 @@ private: ...@@ -2385,7 +2437,7 @@ private:
default: default:
// Unrecognized opcode. // Unrecognized opcode.
verify_fail ("unrecognized instruction"); verify_fail ("unrecognized instruction in verify_instructions_0");
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment