changeset 1430:949ade3f2ff3

added assertions, nop added to implicit exception sites
author Lukas Stadler <lukas.stadler@oracle.com>
date Wed, 01 Sep 2010 13:45:57 -0700
parents abc670a709dc
children c01535d7fcc6
files c1x4hotspotsrc/HotSpotTest/src/jttTests.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeResolved.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java
diffstat 3 files changed, 23 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotTest/src/jttTests.java	Tue Aug 31 22:13:30 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotTest/src/jttTests.java	Wed Sep 01 13:45:57 2010 -0700
@@ -4,7 +4,7 @@
 public class jttTests {
 
 	public static void main(String[] args) {
-		runTests(0, 1000);
+		runTests(526, 526);
 		Logger.info("total: " + executed + " tests executed, " + passed + " passed, " + failed + " failed");
 	}
 
@@ -1630,13 +1630,13 @@
 			jtt_reflect_Class_getField01();
 			break;
 		case 526:
-			//jtt_reflect_Class_getField02();
+			jtt_reflect_Class_getField02();
 			break;
 		case 527:
 			jtt_reflect_Class_getMethod01();
 			break;
 		case 528:
-			//jtt_reflect_Class_getMethod02();
+			jtt_reflect_Class_getMethod02();
 			break;
 		case 529:
 			jtt_reflect_Class_newInstance01();
@@ -1681,19 +1681,19 @@
 			jtt_reflect_Invoke_except01();
 			break;
 		case 543:
-			//jtt_reflect_Invoke_main01();
+			jtt_reflect_Invoke_main01();
 			break;
 		case 544:
-			//jtt_reflect_Invoke_main02();
+			jtt_reflect_Invoke_main02();
 			break;
 		case 545:
-			//jtt_reflect_Invoke_main03();
+			jtt_reflect_Invoke_main03();
 			break;
 		case 546:
-			//jtt_reflect_Invoke_virtual01();
+			jtt_reflect_Invoke_virtual01();
 			break;
 		case 547:
-			//jtt_reflect_Method_getParameterTypes01();
+			jtt_reflect_Method_getParameterTypes01();
 			break;
 		case 548:
 			jtt_reflect_Method_getReturnType01();
@@ -1795,10 +1795,10 @@
 			jtt_jdk_Class_getName();
 			break;
 		case 581:
-			//jtt_jdk_EnumMap01();
+			jtt_jdk_EnumMap01();
 			break;
 		case 582:
-			//jtt_jdk_EnumMap02();
+			jtt_jdk_EnumMap02();
 			break;
 		case 583:
 			jtt_jdk_System_currentTimeMillis01();
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeResolved.java	Tue Aug 31 22:13:30 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeResolved.java	Wed Sep 01 13:45:57 2010 -0700
@@ -145,7 +145,7 @@
 
     @Override
     public boolean isSubtypeOf(RiType other) {
-        assert other instanceof HotSpotType;
+        assert other instanceof HotSpotType  : "unexpected 'other' type: " + other;
         if (other instanceof HotSpotTypeResolved)
             return Compiler.getVMEntries().RiType_isSubtypeOf(vmId, other);
         // no resolved type is a subtype of an unresolved type
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java	Tue Aug 31 22:13:30 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java	Wed Sep 01 13:45:57 2010 -0700
@@ -242,6 +242,7 @@
     private XirTemplate buildArrayLength() {
         XirOperand result = asm.restart(CiKind.Int);
         XirParameter object = asm.createInputParameter("object", CiKind.Object);
+        asm.nop(1);
         asm.mark(MARK_IMPLICIT_NULL);
         asm.pload(CiKind.Int, result, object, asm.i(config.arrayLengthOffset), true);
         return asm.finishTemplate("arrayLength");
@@ -274,6 +275,7 @@
             XirOperand result = asm.restart(kind);
             XirParameter object = asm.createInputParameter("object", CiKind.Object);
             XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
+            asm.nop(1);
             asm.mark(MARK_IMPLICIT_NULL);
             asm.pload(kind, result, object, fieldOffset, true);
             resolved = asm.finishTemplate("getfield<" + kind + ">");
@@ -291,6 +293,7 @@
             XirParameter object = asm.createInputParameter("object", CiKind.Object);
             XirParameter value = asm.createInputParameter("value", kind);
             XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
+            asm.nop(1);
             asm.mark(MARK_IMPLICIT_NULL);
             asm.pstore(kind, object, fieldOffset, value, true);
             if (genWriteBarrier) {
@@ -311,6 +314,7 @@
             XirOperand result = asm.restart(kind);
             XirParameter object = asm.createInputParameter("object", CiKind.Object);
             XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
+            asm.nop(1);
             asm.mark(MARK_IMPLICIT_NULL);
             asm.pload(kind, result, object, fieldOffset, true);
             resolved = asm.finishTemplate("getfield<" + kind + ">");
@@ -328,6 +332,7 @@
             XirParameter object = asm.createInputParameter("object", CiKind.Object);
             XirParameter value = asm.createInputParameter("value", kind);
             XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
+            asm.nop(1);
             asm.mark(MARK_IMPLICIT_NULL);
             asm.pstore(kind, object, fieldOffset, value, true);
             if (genWriteBarrier) {
@@ -500,6 +505,7 @@
                 length = asm.createInputParameter("length", CiKind.Int);
             } else {
                 length = asm.createTemp("length", CiKind.Int);
+                asm.nop(1);
                 asm.mark(MARK_IMPLICIT_NULL);
                 asm.pload(CiKind.Int, length, array, asm.i(config.arrayLengthOffset), true);
                 implicitNullException = false;
@@ -565,6 +571,7 @@
                 length = asm.createInputParameter("length", CiKind.Int);
             } else {
                 length = asm.createTemp("length", CiKind.Int);
+                asm.nop(1);
                 asm.mark(MARK_IMPLICIT_NULL);
                 asm.pload(CiKind.Int, length, array, asm.i(config.arrayLengthOffset), true);
                 implicitNullException = false;
@@ -574,6 +581,7 @@
         }
         int elemSize = target.sizeInBytes(kind);
         if (implicitNullException) {
+            asm.nop(1);
             asm.mark(MARK_IMPLICIT_NULL);
         }
         asm.pload(kind, result, array, index, config.getArrayOffset(kind), Scale.fromInt(elemSize), implicitNullException);
@@ -611,6 +619,7 @@
         XirOperand temp = asm.createRegister("temp", CiKind.Word, AMD64.rax);
         XirLabel stub = asm.createOutOfLineLabel("call stub");
 
+        asm.nop(1);
         asm.mark(MARK_IMPLICIT_NULL);
         asm.pload(CiKind.Word, temp, receiver, true);
         asm.mark(MARK_INVOKESPECIAL);
@@ -635,6 +644,7 @@
         XirOperand temp = asm.createRegister("temp", CiKind.Word, AMD64.rax);
         XirLabel stub = asm.createOutOfLineLabel("call stub");
 
+        asm.nop(1);
         asm.mark(MARK_IMPLICIT_NULL);
         asm.pload(CiKind.Word, temp, receiver, true);
         asm.mark(MARK_INVOKEINTERFACE);
@@ -659,6 +669,7 @@
         XirOperand temp = asm.createRegister("temp", CiKind.Word, AMD64.rax);
         XirLabel stub = asm.createOutOfLineLabel("call stub");
 
+        asm.nop(1);
         asm.mark(MARK_IMPLICIT_NULL);
         asm.pload(CiKind.Word, temp, receiver, true);
         asm.mark(MARK_INVOKEVIRTUAL);
@@ -972,7 +983,7 @@
 
     @Override
     public XirSnippet genResolveClass(XirSite site, RiType type, Representation representation) {
-        assert representation == Representation.ObjectHub;
+        assert representation == Representation.ObjectHub : "unexpected representation: " + representation;
         if (type instanceof HotSpotTypeResolved) {
             return new XirSnippet(resolveClassTemplate.resolved, XirArgument.forObject(type));
         }