< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page

  61 #include "oops/method.inline.hpp"
  62 #include "oops/objArrayKlass.hpp"
  63 #include "oops/objArrayOop.inline.hpp"
  64 #include "oops/oop.inline.hpp"
  65 #include "oops/typeArrayOop.inline.hpp"
  66 #include "prims/resolvedMethodTable.hpp"
  67 #include "prims/wbtestmethods/parserTests.hpp"
  68 #include "prims/whitebox.inline.hpp"
  69 #include "runtime/arguments.hpp"
  70 #include "runtime/atomic.hpp"
  71 #include "runtime/deoptimization.hpp"
  72 #include "runtime/fieldDescriptor.inline.hpp"
  73 #include "runtime/flags/jvmFlag.hpp"
  74 #include "runtime/flags/jvmFlagAccess.hpp"
  75 #include "runtime/frame.inline.hpp"
  76 #include "runtime/handles.inline.hpp"
  77 #include "runtime/handshake.hpp"
  78 #include "runtime/interfaceSupport.inline.hpp"
  79 #include "runtime/javaCalls.hpp"
  80 #include "runtime/jniHandles.inline.hpp"

  81 #include "runtime/os.hpp"
  82 #include "runtime/stackFrameStream.inline.hpp"
  83 #include "runtime/sweeper.hpp"
  84 #include "runtime/synchronizer.hpp"
  85 #include "runtime/thread.hpp"
  86 #include "runtime/threadSMR.hpp"
  87 #include "runtime/vframe.hpp"
  88 #include "runtime/vm_version.hpp"
  89 #include "services/memoryService.hpp"
  90 #include "utilities/align.hpp"
  91 #include "utilities/debug.hpp"
  92 #include "utilities/elfFile.hpp"
  93 #include "utilities/exceptions.hpp"
  94 #include "utilities/macros.hpp"
  95 #include "utilities/ostream.hpp"
  96 #if INCLUDE_G1GC
  97 #include "gc/g1/g1Arguments.hpp"
  98 #include "gc/g1/g1CollectedHeap.inline.hpp"
  99 #include "gc/g1/g1ConcurrentMark.hpp"
 100 #include "gc/g1/g1ConcurrentMarkThread.inline.hpp"

1737 
1738 WB_ENTRY(jlong, WB_MetaspaceCapacityUntilGC(JNIEnv* env, jobject wb))
1739   return (jlong) MetaspaceGC::capacity_until_GC();
1740 WB_END
1741 
1742 // The function is only valid when CDS is available.
1743 WB_ENTRY(jlong, WB_MetaspaceSharedRegionAlignment(JNIEnv* env, jobject wb))
1744 #if INCLUDE_CDS
1745   return (jlong)MetaspaceShared::core_region_alignment();
1746 #else
1747   ShouldNotReachHere();
1748   return 0L;
1749 #endif
1750 WB_END
1751 
1752 WB_ENTRY(jboolean, WB_IsMonitorInflated(JNIEnv* env, jobject wb, jobject obj))
1753   oop obj_oop = JNIHandles::resolve(obj);
1754   return (jboolean) obj_oop->mark().has_monitor();
1755 WB_END
1756 








1757 WB_ENTRY(jboolean, WB_DeflateIdleMonitors(JNIEnv* env, jobject wb))
1758   log_info(monitorinflation)("WhiteBox initiated DeflateIdleMonitors");
1759   return ObjectSynchronizer::request_deflate_idle_monitors();
1760 WB_END
1761 
1762 WB_ENTRY(void, WB_ForceSafepoint(JNIEnv* env, jobject wb))
1763   VM_ForceSafepoint force_safepoint_op;
1764   VMThread::execute(&force_safepoint_op);
1765 WB_END
1766 
1767 WB_ENTRY(jlong, WB_GetConstantPool(JNIEnv* env, jobject wb, jclass klass))
1768   InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
1769   return (jlong) ik->constants();
1770 WB_END
1771 
1772 WB_ENTRY(jint, WB_GetConstantPoolCacheIndexTag(JNIEnv* env, jobject wb))
1773   return ConstantPool::CPCACHE_INDEX_TAG;
1774 WB_END
1775 
1776 WB_ENTRY(jint, WB_GetConstantPoolCacheLength(JNIEnv* env, jobject wb, jclass klass))

2532   {CC"getCodeHeapEntries", CC"(I)[Ljava/lang/Object;",(void*)&WB_GetCodeHeapEntries },
2533   {CC"getCompilationActivityMode",
2534                            CC"()I",                   (void*)&WB_GetCompilationActivityMode},
2535   {CC"getMethodData0",     CC"(Ljava/lang/reflect/Executable;)J",
2536                                                       (void*)&WB_GetMethodData      },
2537   {CC"getCodeBlob",        CC"(J)[Ljava/lang/Object;",(void*)&WB_GetCodeBlob        },
2538   {CC"getThreadStackSize", CC"()J",                   (void*)&WB_GetThreadStackSize },
2539   {CC"getThreadRemainingStackSize", CC"()J",          (void*)&WB_GetThreadRemainingStackSize },
2540   {CC"DefineModule",       CC"(Ljava/lang/Object;ZLjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V",
2541                                                       (void*)&WB_DefineModule },
2542   {CC"AddModuleExports",   CC"(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V",
2543                                                       (void*)&WB_AddModuleExports },
2544   {CC"AddReadsModule",     CC"(Ljava/lang/Object;Ljava/lang/Object;)V",
2545                                                       (void*)&WB_AddReadsModule },
2546   {CC"AddModuleExportsToAllUnnamed", CC"(Ljava/lang/Object;Ljava/lang/String;)V",
2547                                                       (void*)&WB_AddModuleExportsToAllUnnamed },
2548   {CC"AddModuleExportsToAll", CC"(Ljava/lang/Object;Ljava/lang/String;)V",
2549                                                       (void*)&WB_AddModuleExportsToAll },
2550   {CC"deflateIdleMonitors", CC"()Z",                  (void*)&WB_DeflateIdleMonitors },
2551   {CC"isMonitorInflated0", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated  },


2552   {CC"forceSafepoint",     CC"()V",                   (void*)&WB_ForceSafepoint     },
2553   {CC"getConstantPool0",   CC"(Ljava/lang/Class;)J",  (void*)&WB_GetConstantPool    },
2554   {CC"getConstantPoolCacheIndexTag0", CC"()I",  (void*)&WB_GetConstantPoolCacheIndexTag},
2555   {CC"getConstantPoolCacheLength0", CC"(Ljava/lang/Class;)I",  (void*)&WB_GetConstantPoolCacheLength},
2556   {CC"remapInstructionOperandFromCPCache0",
2557       CC"(Ljava/lang/Class;I)I",                      (void*)&WB_ConstantPoolRemapInstructionOperandFromCache},
2558   {CC"encodeConstantPoolIndyIndex0",
2559       CC"(I)I",                      (void*)&WB_ConstantPoolEncodeIndyIndex},
2560   {CC"getMethodBooleanOption",
2561       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Boolean;",
2562                                                       (void*)&WB_GetMethodBooleaneOption},
2563   {CC"getMethodIntxOption",
2564       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Long;",
2565                                                       (void*)&WB_GetMethodIntxOption},
2566   {CC"getMethodUintxOption",
2567       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Long;",
2568                                                       (void*)&WB_GetMethodUintxOption},
2569   {CC"getMethodDoubleOption",
2570       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Double;",
2571                                                       (void*)&WB_GetMethodDoubleOption},

  61 #include "oops/method.inline.hpp"
  62 #include "oops/objArrayKlass.hpp"
  63 #include "oops/objArrayOop.inline.hpp"
  64 #include "oops/oop.inline.hpp"
  65 #include "oops/typeArrayOop.inline.hpp"
  66 #include "prims/resolvedMethodTable.hpp"
  67 #include "prims/wbtestmethods/parserTests.hpp"
  68 #include "prims/whitebox.inline.hpp"
  69 #include "runtime/arguments.hpp"
  70 #include "runtime/atomic.hpp"
  71 #include "runtime/deoptimization.hpp"
  72 #include "runtime/fieldDescriptor.inline.hpp"
  73 #include "runtime/flags/jvmFlag.hpp"
  74 #include "runtime/flags/jvmFlagAccess.hpp"
  75 #include "runtime/frame.inline.hpp"
  76 #include "runtime/handles.inline.hpp"
  77 #include "runtime/handshake.hpp"
  78 #include "runtime/interfaceSupport.inline.hpp"
  79 #include "runtime/javaCalls.hpp"
  80 #include "runtime/jniHandles.inline.hpp"
  81 #include "runtime/lockStack.hpp"
  82 #include "runtime/os.hpp"
  83 #include "runtime/stackFrameStream.inline.hpp"
  84 #include "runtime/sweeper.hpp"
  85 #include "runtime/synchronizer.hpp"
  86 #include "runtime/thread.hpp"
  87 #include "runtime/threadSMR.hpp"
  88 #include "runtime/vframe.hpp"
  89 #include "runtime/vm_version.hpp"
  90 #include "services/memoryService.hpp"
  91 #include "utilities/align.hpp"
  92 #include "utilities/debug.hpp"
  93 #include "utilities/elfFile.hpp"
  94 #include "utilities/exceptions.hpp"
  95 #include "utilities/macros.hpp"
  96 #include "utilities/ostream.hpp"
  97 #if INCLUDE_G1GC
  98 #include "gc/g1/g1Arguments.hpp"
  99 #include "gc/g1/g1CollectedHeap.inline.hpp"
 100 #include "gc/g1/g1ConcurrentMark.hpp"
 101 #include "gc/g1/g1ConcurrentMarkThread.inline.hpp"

1738 
1739 WB_ENTRY(jlong, WB_MetaspaceCapacityUntilGC(JNIEnv* env, jobject wb))
1740   return (jlong) MetaspaceGC::capacity_until_GC();
1741 WB_END
1742 
1743 // The function is only valid when CDS is available.
1744 WB_ENTRY(jlong, WB_MetaspaceSharedRegionAlignment(JNIEnv* env, jobject wb))
1745 #if INCLUDE_CDS
1746   return (jlong)MetaspaceShared::core_region_alignment();
1747 #else
1748   ShouldNotReachHere();
1749   return 0L;
1750 #endif
1751 WB_END
1752 
1753 WB_ENTRY(jboolean, WB_IsMonitorInflated(JNIEnv* env, jobject wb, jobject obj))
1754   oop obj_oop = JNIHandles::resolve(obj);
1755   return (jboolean) obj_oop->mark().has_monitor();
1756 WB_END
1757 
1758 WB_ENTRY(jint, WB_getLockStackCapacity(JNIEnv* env))
1759   return (jint) LockStack::CAPACITY;
1760 WB_END
1761 
1762 WB_ENTRY(jboolean, WB_supportsRecursiveLightweightLocking(JNIEnv* env))
1763   return (jboolean) VM_Version::supports_recursive_lightweight_locking();
1764 WB_END
1765 
1766 WB_ENTRY(jboolean, WB_DeflateIdleMonitors(JNIEnv* env, jobject wb))
1767   log_info(monitorinflation)("WhiteBox initiated DeflateIdleMonitors");
1768   return ObjectSynchronizer::request_deflate_idle_monitors();
1769 WB_END
1770 
1771 WB_ENTRY(void, WB_ForceSafepoint(JNIEnv* env, jobject wb))
1772   VM_ForceSafepoint force_safepoint_op;
1773   VMThread::execute(&force_safepoint_op);
1774 WB_END
1775 
1776 WB_ENTRY(jlong, WB_GetConstantPool(JNIEnv* env, jobject wb, jclass klass))
1777   InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
1778   return (jlong) ik->constants();
1779 WB_END
1780 
1781 WB_ENTRY(jint, WB_GetConstantPoolCacheIndexTag(JNIEnv* env, jobject wb))
1782   return ConstantPool::CPCACHE_INDEX_TAG;
1783 WB_END
1784 
1785 WB_ENTRY(jint, WB_GetConstantPoolCacheLength(JNIEnv* env, jobject wb, jclass klass))

2541   {CC"getCodeHeapEntries", CC"(I)[Ljava/lang/Object;",(void*)&WB_GetCodeHeapEntries },
2542   {CC"getCompilationActivityMode",
2543                            CC"()I",                   (void*)&WB_GetCompilationActivityMode},
2544   {CC"getMethodData0",     CC"(Ljava/lang/reflect/Executable;)J",
2545                                                       (void*)&WB_GetMethodData      },
2546   {CC"getCodeBlob",        CC"(J)[Ljava/lang/Object;",(void*)&WB_GetCodeBlob        },
2547   {CC"getThreadStackSize", CC"()J",                   (void*)&WB_GetThreadStackSize },
2548   {CC"getThreadRemainingStackSize", CC"()J",          (void*)&WB_GetThreadRemainingStackSize },
2549   {CC"DefineModule",       CC"(Ljava/lang/Object;ZLjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V",
2550                                                       (void*)&WB_DefineModule },
2551   {CC"AddModuleExports",   CC"(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V",
2552                                                       (void*)&WB_AddModuleExports },
2553   {CC"AddReadsModule",     CC"(Ljava/lang/Object;Ljava/lang/Object;)V",
2554                                                       (void*)&WB_AddReadsModule },
2555   {CC"AddModuleExportsToAllUnnamed", CC"(Ljava/lang/Object;Ljava/lang/String;)V",
2556                                                       (void*)&WB_AddModuleExportsToAllUnnamed },
2557   {CC"AddModuleExportsToAll", CC"(Ljava/lang/Object;Ljava/lang/String;)V",
2558                                                       (void*)&WB_AddModuleExportsToAll },
2559   {CC"deflateIdleMonitors", CC"()Z",                  (void*)&WB_DeflateIdleMonitors },
2560   {CC"isMonitorInflated0", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated  },
2561   {CC"getLockStackCapacity", CC"()I",                 (void*)&WB_getLockStackCapacity },
2562   {CC"supportsRecursiveLightweightLocking", CC"()Z",  (void*)&WB_supportsRecursiveLightweightLocking },
2563   {CC"forceSafepoint",     CC"()V",                   (void*)&WB_ForceSafepoint     },
2564   {CC"getConstantPool0",   CC"(Ljava/lang/Class;)J",  (void*)&WB_GetConstantPool    },
2565   {CC"getConstantPoolCacheIndexTag0", CC"()I",  (void*)&WB_GetConstantPoolCacheIndexTag},
2566   {CC"getConstantPoolCacheLength0", CC"(Ljava/lang/Class;)I",  (void*)&WB_GetConstantPoolCacheLength},
2567   {CC"remapInstructionOperandFromCPCache0",
2568       CC"(Ljava/lang/Class;I)I",                      (void*)&WB_ConstantPoolRemapInstructionOperandFromCache},
2569   {CC"encodeConstantPoolIndyIndex0",
2570       CC"(I)I",                      (void*)&WB_ConstantPoolEncodeIndyIndex},
2571   {CC"getMethodBooleanOption",
2572       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Boolean;",
2573                                                       (void*)&WB_GetMethodBooleaneOption},
2574   {CC"getMethodIntxOption",
2575       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Long;",
2576                                                       (void*)&WB_GetMethodIntxOption},
2577   {CC"getMethodUintxOption",
2578       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Long;",
2579                                                       (void*)&WB_GetMethodUintxOption},
2580   {CC"getMethodDoubleOption",
2581       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Double;",
2582                                                       (void*)&WB_GetMethodDoubleOption},
< prev index next >