test/hotspot/jtreg/serviceability/jvmti/GetLocalVariable/libGetLocalVars.cpp

Print this page

        

@@ -87,13 +87,10 @@
 DECL_TEST_FUNC(double, Double);
 DECL_TEST_FUNC(object, Object);
 
 DECL_TEST_INV_SLOT_FUNC(int, Int);
 DECL_TEST_INV_SLOT_FUNC(float, Float);
-DECL_TEST_INV_SLOT_FUNC(long, Long);
-DECL_TEST_INV_SLOT_FUNC(double, Double);
-DECL_TEST_INV_SLOT_FUNC(object, Object);
 
 DECL_TEST_TYPE_MISMATCH_FUNC(int, Int);
 DECL_TEST_TYPE_MISMATCH_FUNC(float, Float);
 DECL_TEST_TYPE_MISMATCH_FUNC(long, Long);
 DECL_TEST_TYPE_MISMATCH_FUNC(double, Double);

@@ -141,13 +138,11 @@
 static void
 test_local_integer(jthread thr, int depth, int slot) {
   printf("\n test_local_integer: BEGIN\n\n");
 
   test_int(thr, depth, slot, "int");
-  test_long_inv_slot(thr, depth, slot, "int");
   test_float(thr, depth, slot, "int");
-  test_double_inv_slot(thr, depth, slot, "int");
   test_object_type_mismatch(thr, depth, slot, "double");
 
   printf("\n test_local_integer: END\n\n");
 }
 

@@ -157,11 +152,10 @@
 
   test_int_inv_slot(thr, depth, slot, "invalid");
   test_long_inv_slot(thr, depth, slot, "invalid");
   test_float_inv_slot(thr, depth, slot, "invalid");
   test_double_inv_slot(thr, depth, slot, "invalid");
-  test_object_inv_slot(thr, depth, slot, "invalid");
 
   printf("\n test_local_invalid: END\n\n");
 }
 
 jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {

@@ -203,10 +197,22 @@
   return Agent_Initialize(jvm, options, reserved);
 }
 
 JNIEXPORT void JNICALL
 Java_GetLocalVars_testLocals(JNIEnv *env, jclass cls, jobject thread) {
+  /*
+   * We test the JVMTI GetLocal<Type> for locals of the method:
+   * 
+   *  int staticMeth(byte byteArg, Object objArg, double dblArg, int intArg) {
+   *      testLocals(Thread.currentThread());
+   *      {
+   *          int intLoc = 9999;
+   *          intArg = intLoc;
+   *      }
+   *      return intArg;
+   *  }
+   */
   static const char* METHOD_NAME = "staticMeth";
   static const char* METHOD_SIGN = "(BLjava/lang/Object;DI)I";
   static const int Depth = 1;
   static const int ByteSlot = 0;
   static const int ObjSlot = 1;