< prev index next >

src/share/vm/prims/whitebox.cpp

Print this page
rev 8048 : 8058354: SPECjvm2008-Derby -2.7% performance regression on Solaris-X64 starting with 9-b29
Summary: Allow partial use of large pages for auxiliary data structures in G1.
Reviewed-by: jmasa


  72 class VM_WhiteBoxOperation : public VM_Operation {
  73  public:
  74   VM_WhiteBoxOperation()                         { }
  75   VMOp_Type type()                  const        { return VMOp_WhiteBoxOperation; }
  76   bool allow_nested_vm_operations() const        { return true; }
  77 };
  78 
  79 
  80 WB_ENTRY(jlong, WB_GetObjectAddress(JNIEnv* env, jobject o, jobject obj))
  81   return (jlong)(void*)JNIHandles::resolve(obj);
  82 WB_END
  83 
  84 WB_ENTRY(jint, WB_GetHeapOopSize(JNIEnv* env, jobject o))
  85   return heapOopSize;
  86 WB_END
  87 
  88 WB_ENTRY(jint, WB_GetVMPageSize(JNIEnv* env, jobject o))
  89   return os::vm_page_size();
  90 WB_END
  91 




  92 class WBIsKlassAliveClosure : public KlassClosure {
  93     Symbol* _name;
  94     bool _found;
  95 public:
  96     WBIsKlassAliveClosure(Symbol* name) : _name(name), _found(false) {}
  97 
  98     void do_klass(Klass* k) {
  99       if (_found) return;
 100       Symbol* ksym = k->name();
 101       if (ksym->fast_compare(_name) == 0) {
 102         _found = true;
 103       }
 104     }
 105 
 106     bool found() const {
 107         return _found;
 108     }
 109 };
 110 
 111 WB_ENTRY(jboolean, WB_IsClassAlive(JNIEnv* env, jobject target, jstring name))


1284         }
1285       } else {
1286         // Registration failed unexpectedly.
1287         tty->print_cr("Warning: unexpected error on register of sun.hotspot.WhiteBox::%s%s. All methods will be unregistered",
1288             method_array[i].name, method_array[i].signature);
1289         env->UnregisterNatives(wbclass);
1290         break;
1291       }
1292     }
1293   }
1294 }
1295 
1296 #define CC (char*)
1297 
1298 static JNINativeMethod methods[] = {
1299   {CC"getObjectAddress",   CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress  },
1300   {CC"getObjectSize",      CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize     },
1301   {CC"isObjectInOldGen",   CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen  },
1302   {CC"getHeapOopSize",     CC"()I",                   (void*)&WB_GetHeapOopSize    },
1303   {CC"getVMPageSize",      CC"()I",                   (void*)&WB_GetVMPageSize     },

1304   {CC"isClassAlive0",      CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
1305   {CC"parseCommandLine",
1306       CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
1307       (void*) &WB_ParseCommandLine
1308   },
1309   {CC"addToBootstrapClassLoaderSearch", CC"(Ljava/lang/String;)V",
1310                                                       (void*)&WB_AddToBootstrapClassLoaderSearch},
1311   {CC"addToSystemClassLoaderSearch",    CC"(Ljava/lang/String;)V",
1312                                                       (void*)&WB_AddToSystemClassLoaderSearch},
1313   {CC"getCompressedOopsMaxHeapSize", CC"()J",
1314       (void*)&WB_GetCompressedOopsMaxHeapSize},
1315   {CC"printHeapSizes",     CC"()V",                   (void*)&WB_PrintHeapSizes    },
1316   {CC"runMemoryUnitTests", CC"()V",                   (void*)&WB_RunMemoryUnitTests},
1317   {CC"readFromNoaccessArea",CC"()V",                  (void*)&WB_ReadFromNoaccessArea},
1318   {CC"stressVirtualSpaceResize",CC"(JJJ)I",           (void*)&WB_StressVirtualSpaceResize},
1319 #if INCLUDE_ALL_GCS
1320   {CC"g1InConcurrentMark", CC"()Z",                   (void*)&WB_G1InConcurrentMark},
1321   {CC"g1IsHumongous",      CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous     },
1322   {CC"g1NumMaxRegions",    CC"()J",                   (void*)&WB_G1NumMaxRegions  },
1323   {CC"g1NumFreeRegions",   CC"()J",                   (void*)&WB_G1NumFreeRegions  },




  72 class VM_WhiteBoxOperation : public VM_Operation {
  73  public:
  74   VM_WhiteBoxOperation()                         { }
  75   VMOp_Type type()                  const        { return VMOp_WhiteBoxOperation; }
  76   bool allow_nested_vm_operations() const        { return true; }
  77 };
  78 
  79 
  80 WB_ENTRY(jlong, WB_GetObjectAddress(JNIEnv* env, jobject o, jobject obj))
  81   return (jlong)(void*)JNIHandles::resolve(obj);
  82 WB_END
  83 
  84 WB_ENTRY(jint, WB_GetHeapOopSize(JNIEnv* env, jobject o))
  85   return heapOopSize;
  86 WB_END
  87 
  88 WB_ENTRY(jint, WB_GetVMPageSize(JNIEnv* env, jobject o))
  89   return os::vm_page_size();
  90 WB_END
  91 
  92 WB_ENTRY(jlong, WB_GetVMLargePageSize(JNIEnv* env, jobject o))
  93   return os::large_page_size();
  94 WB_END
  95 
  96 class WBIsKlassAliveClosure : public KlassClosure {
  97     Symbol* _name;
  98     bool _found;
  99 public:
 100     WBIsKlassAliveClosure(Symbol* name) : _name(name), _found(false) {}
 101 
 102     void do_klass(Klass* k) {
 103       if (_found) return;
 104       Symbol* ksym = k->name();
 105       if (ksym->fast_compare(_name) == 0) {
 106         _found = true;
 107       }
 108     }
 109 
 110     bool found() const {
 111         return _found;
 112     }
 113 };
 114 
 115 WB_ENTRY(jboolean, WB_IsClassAlive(JNIEnv* env, jobject target, jstring name))


1288         }
1289       } else {
1290         // Registration failed unexpectedly.
1291         tty->print_cr("Warning: unexpected error on register of sun.hotspot.WhiteBox::%s%s. All methods will be unregistered",
1292             method_array[i].name, method_array[i].signature);
1293         env->UnregisterNatives(wbclass);
1294         break;
1295       }
1296     }
1297   }
1298 }
1299 
1300 #define CC (char*)
1301 
1302 static JNINativeMethod methods[] = {
1303   {CC"getObjectAddress",   CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress  },
1304   {CC"getObjectSize",      CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize     },
1305   {CC"isObjectInOldGen",   CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen  },
1306   {CC"getHeapOopSize",     CC"()I",                   (void*)&WB_GetHeapOopSize    },
1307   {CC"getVMPageSize",      CC"()I",                   (void*)&WB_GetVMPageSize     },
1308   {CC"getVMLargePageSize", CC"()J",                   (void*)&WB_GetVMLargePageSize},
1309   {CC"isClassAlive0",      CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
1310   {CC"parseCommandLine",
1311       CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
1312       (void*) &WB_ParseCommandLine
1313   },
1314   {CC"addToBootstrapClassLoaderSearch", CC"(Ljava/lang/String;)V",
1315                                                       (void*)&WB_AddToBootstrapClassLoaderSearch},
1316   {CC"addToSystemClassLoaderSearch",    CC"(Ljava/lang/String;)V",
1317                                                       (void*)&WB_AddToSystemClassLoaderSearch},
1318   {CC"getCompressedOopsMaxHeapSize", CC"()J",
1319       (void*)&WB_GetCompressedOopsMaxHeapSize},
1320   {CC"printHeapSizes",     CC"()V",                   (void*)&WB_PrintHeapSizes    },
1321   {CC"runMemoryUnitTests", CC"()V",                   (void*)&WB_RunMemoryUnitTests},
1322   {CC"readFromNoaccessArea",CC"()V",                  (void*)&WB_ReadFromNoaccessArea},
1323   {CC"stressVirtualSpaceResize",CC"(JJJ)I",           (void*)&WB_StressVirtualSpaceResize},
1324 #if INCLUDE_ALL_GCS
1325   {CC"g1InConcurrentMark", CC"()Z",                   (void*)&WB_G1InConcurrentMark},
1326   {CC"g1IsHumongous",      CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous     },
1327   {CC"g1NumMaxRegions",    CC"()J",                   (void*)&WB_G1NumMaxRegions  },
1328   {CC"g1NumFreeRegions",   CC"()J",                   (void*)&WB_G1NumFreeRegions  },


< prev index next >