< prev index next >

src/share/vm/prims/whitebox.cpp

Print this page
rev 8368 : imported patch 8079208-TestLargePageUseForAuxMemory.java-failing-on-windows


  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;


1251         }
1252       } else {
1253         // Registration failed unexpectedly.
1254         tty->print_cr("Warning: unexpected error on register of sun.hotspot.WhiteBox::%s%s. All methods will be unregistered",
1255             method_array[i].name, method_array[i].signature);
1256         env->UnregisterNatives(wbclass);
1257         break;
1258       }
1259     }
1260   }
1261 }
1262 
1263 #define CC (char*)
1264 
1265 static JNINativeMethod methods[] = {
1266   {CC"getObjectAddress0",   CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress  },
1267   {CC"getObjectSize0",      CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize     },
1268   {CC"isObjectInOldGen0",   CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen  },
1269   {CC"getHeapOopSize",     CC"()I",                   (void*)&WB_GetHeapOopSize    },
1270   {CC"getVMPageSize",      CC"()I",                   (void*)&WB_GetVMPageSize     },

1271   {CC"getVMLargePageSize", CC"()J",                   (void*)&WB_GetVMLargePageSize},
1272   {CC"isClassAlive0",      CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
1273   {CC"parseCommandLine0",
1274       CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
1275       (void*) &WB_ParseCommandLine
1276   },
1277   {CC"addToBootstrapClassLoaderSearch0", CC"(Ljava/lang/String;)V",
1278                                                       (void*)&WB_AddToBootstrapClassLoaderSearch},
1279   {CC"addToSystemClassLoaderSearch0",    CC"(Ljava/lang/String;)V",
1280                                                       (void*)&WB_AddToSystemClassLoaderSearch},
1281   {CC"getCompressedOopsMaxHeapSize", CC"()J",
1282       (void*)&WB_GetCompressedOopsMaxHeapSize},
1283   {CC"printHeapSizes",     CC"()V",                   (void*)&WB_PrintHeapSizes    },
1284   {CC"runMemoryUnitTests", CC"()V",                   (void*)&WB_RunMemoryUnitTests},
1285   {CC"readFromNoaccessArea",CC"()V",                  (void*)&WB_ReadFromNoaccessArea},
1286   {CC"stressVirtualSpaceResize",CC"(JJJ)I",           (void*)&WB_StressVirtualSpaceResize},
1287 #if INCLUDE_ALL_GCS
1288   {CC"g1InConcurrentMark", CC"()Z",                   (void*)&WB_G1InConcurrentMark},
1289   {CC"g1IsHumongous0",      CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous     },
1290   {CC"g1NumMaxRegions",    CC"()J",                   (void*)&WB_G1NumMaxRegions  },




  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_GetVMAllocationGranularity(JNIEnv* env, jobject o))
  93   return os::vm_allocation_granularity();
  94 WB_END
  95         
  96 WB_ENTRY(jlong, WB_GetVMLargePageSize(JNIEnv* env, jobject o))
  97   return os::large_page_size();
  98 WB_END
  99 
 100 class WBIsKlassAliveClosure : public KlassClosure {
 101     Symbol* _name;
 102     bool _found;
 103 public:
 104     WBIsKlassAliveClosure(Symbol* name) : _name(name), _found(false) {}
 105 
 106     void do_klass(Klass* k) {
 107       if (_found) return;
 108       Symbol* ksym = k->name();
 109       if (ksym->fast_compare(_name) == 0) {
 110         _found = true;
 111       }
 112     }
 113 
 114     bool found() const {
 115         return _found;


1255         }
1256       } else {
1257         // Registration failed unexpectedly.
1258         tty->print_cr("Warning: unexpected error on register of sun.hotspot.WhiteBox::%s%s. All methods will be unregistered",
1259             method_array[i].name, method_array[i].signature);
1260         env->UnregisterNatives(wbclass);
1261         break;
1262       }
1263     }
1264   }
1265 }
1266 
1267 #define CC (char*)
1268 
1269 static JNINativeMethod methods[] = {
1270   {CC"getObjectAddress0",                CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress  },
1271   {CC"getObjectSize0",                   CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize     },
1272   {CC"isObjectInOldGen0",                CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen  },
1273   {CC"getHeapOopSize",                   CC"()I",                   (void*)&WB_GetHeapOopSize    },
1274   {CC"getVMPageSize",                    CC"()I",                   (void*)&WB_GetVMPageSize     },
1275   {CC"getVMAllocationGranularity",       CC"()J",                   (void*)&WB_GetVMAllocationGranularity },
1276   {CC"getVMLargePageSize",               CC"()J",                   (void*)&WB_GetVMLargePageSize},
1277   {CC"isClassAlive0",                    CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
1278   {CC"parseCommandLine0",
1279       CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
1280       (void*) &WB_ParseCommandLine
1281   },
1282   {CC"addToBootstrapClassLoaderSearch0", CC"(Ljava/lang/String;)V",
1283                                                       (void*)&WB_AddToBootstrapClassLoaderSearch},
1284   {CC"addToSystemClassLoaderSearch0",    CC"(Ljava/lang/String;)V",
1285                                                       (void*)&WB_AddToSystemClassLoaderSearch},
1286   {CC"getCompressedOopsMaxHeapSize", CC"()J",
1287       (void*)&WB_GetCompressedOopsMaxHeapSize},
1288   {CC"printHeapSizes",     CC"()V",                   (void*)&WB_PrintHeapSizes    },
1289   {CC"runMemoryUnitTests", CC"()V",                   (void*)&WB_RunMemoryUnitTests},
1290   {CC"readFromNoaccessArea",CC"()V",                  (void*)&WB_ReadFromNoaccessArea},
1291   {CC"stressVirtualSpaceResize",CC"(JJJ)I",           (void*)&WB_StressVirtualSpaceResize},
1292 #if INCLUDE_ALL_GCS
1293   {CC"g1InConcurrentMark", CC"()Z",                   (void*)&WB_G1InConcurrentMark},
1294   {CC"g1IsHumongous0",      CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous     },
1295   {CC"g1NumMaxRegions",    CC"()J",                   (void*)&WB_G1NumMaxRegions  },


< prev index next >