hotspot/src/share/vm/prims/whitebox.cpp
changeset 36304 3a742df23055
parent 35943 e726308008c0
child 36321 d3618f1ff1bb
equal deleted inserted replaced
36303:6241574f5982 36304:3a742df23055
    32 #include "compiler/methodMatcher.hpp"
    32 #include "compiler/methodMatcher.hpp"
    33 #include "jvmtifiles/jvmtiEnv.hpp"
    33 #include "jvmtifiles/jvmtiEnv.hpp"
    34 #include "memory/metadataFactory.hpp"
    34 #include "memory/metadataFactory.hpp"
    35 #include "memory/metaspaceShared.hpp"
    35 #include "memory/metaspaceShared.hpp"
    36 #include "memory/universe.hpp"
    36 #include "memory/universe.hpp"
       
    37 #include "oops/constantPool.hpp"
    37 #include "oops/oop.inline.hpp"
    38 #include "oops/oop.inline.hpp"
    38 #include "prims/wbtestmethods/parserTests.hpp"
    39 #include "prims/wbtestmethods/parserTests.hpp"
    39 #include "prims/whitebox.hpp"
    40 #include "prims/whitebox.hpp"
    40 #include "runtime/arguments.hpp"
    41 #include "runtime/arguments.hpp"
    41 #include "runtime/compilationPolicy.hpp"
    42 #include "runtime/compilationPolicy.hpp"
  1301 WB_END
  1302 WB_END
  1302 
  1303 
  1303 WB_ENTRY(jlong, WB_GetConstantPool(JNIEnv* env, jobject wb, jclass klass))
  1304 WB_ENTRY(jlong, WB_GetConstantPool(JNIEnv* env, jobject wb, jclass klass))
  1304   instanceKlassHandle ikh(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
  1305   instanceKlassHandle ikh(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
  1305   return (jlong) ikh->constants();
  1306   return (jlong) ikh->constants();
       
  1307 WB_END
       
  1308 
       
  1309 WB_ENTRY(jint, WB_GetConstantPoolCacheIndexTag(JNIEnv* env, jobject wb))
       
  1310   return ConstantPool::CPCACHE_INDEX_TAG;
       
  1311 WB_END
       
  1312 
       
  1313 WB_ENTRY(jint, WB_GetConstantPoolCacheLength(JNIEnv* env, jobject wb, jclass klass))
       
  1314   instanceKlassHandle ikh(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
       
  1315   ConstantPool* cp = ikh->constants();
       
  1316   if (cp->cache() == NULL) {
       
  1317       return -1;
       
  1318   }
       
  1319   return cp->cache()->length();
       
  1320 WB_END
       
  1321 
       
  1322 WB_ENTRY(jint, WB_ConstantPoolRemapInstructionOperandFromCache(JNIEnv* env, jobject wb, jclass klass, jint index))
       
  1323   instanceKlassHandle ikh(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
       
  1324   ConstantPool* cp = ikh->constants();
       
  1325   if (cp->cache() == NULL) {
       
  1326     THROW_MSG_0(vmSymbols::java_lang_IllegalStateException(), "Constant pool does not have a cache");
       
  1327   }
       
  1328   jint cpci = index;
       
  1329   jint cpciTag = ConstantPool::CPCACHE_INDEX_TAG;
       
  1330   if (cpciTag > cpci || cpci >= cp->cache()->length() + cpciTag) {
       
  1331     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Constant pool cache index is out of range");
       
  1332   }
       
  1333   jint cpi = cp->remap_instruction_operand_from_cache(cpci);
       
  1334   return cpi;
       
  1335 WB_END
       
  1336 
       
  1337 WB_ENTRY(jint, WB_ConstantPoolEncodeIndyIndex(JNIEnv* env, jobject wb, jint index))
       
  1338   return ConstantPool::encode_invokedynamic_index(index);
  1306 WB_END
  1339 WB_END
  1307 
  1340 
  1308 WB_ENTRY(void, WB_ClearInlineCaches(JNIEnv* env, jobject wb))
  1341 WB_ENTRY(void, WB_ClearInlineCaches(JNIEnv* env, jobject wb))
  1309   VM_ClearICs clear_ics;
  1342   VM_ClearICs clear_ics;
  1310   VMThread::execute(&clear_ics);
  1343   VMThread::execute(&clear_ics);
  1618   {CC"getThreadRemainingStackSize", CC"()J",          (void*)&WB_GetThreadRemainingStackSize },
  1651   {CC"getThreadRemainingStackSize", CC"()J",          (void*)&WB_GetThreadRemainingStackSize },
  1619   {CC"assertMatchingSafepointCalls", CC"(ZZ)V",       (void*)&WB_AssertMatchingSafepointCalls },
  1652   {CC"assertMatchingSafepointCalls", CC"(ZZ)V",       (void*)&WB_AssertMatchingSafepointCalls },
  1620   {CC"isMonitorInflated0", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated  },
  1653   {CC"isMonitorInflated0", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated  },
  1621   {CC"forceSafepoint",     CC"()V",                   (void*)&WB_ForceSafepoint     },
  1654   {CC"forceSafepoint",     CC"()V",                   (void*)&WB_ForceSafepoint     },
  1622   {CC"getConstantPool0",   CC"(Ljava/lang/Class;)J",  (void*)&WB_GetConstantPool    },
  1655   {CC"getConstantPool0",   CC"(Ljava/lang/Class;)J",  (void*)&WB_GetConstantPool    },
       
  1656   {CC"getConstantPoolCacheIndexTag0", CC"()I",  (void*)&WB_GetConstantPoolCacheIndexTag},
       
  1657   {CC"getConstantPoolCacheLength0", CC"(Ljava/lang/Class;)I",  (void*)&WB_GetConstantPoolCacheLength},
       
  1658   {CC"remapInstructionOperandFromCPCache0",
       
  1659       CC"(Ljava/lang/Class;I)I",                      (void*)&WB_ConstantPoolRemapInstructionOperandFromCache},
       
  1660   {CC"encodeConstantPoolIndyIndex0",
       
  1661       CC"(I)I",                      (void*)&WB_ConstantPoolEncodeIndyIndex},
  1623   {CC"getMethodBooleanOption",
  1662   {CC"getMethodBooleanOption",
  1624       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Boolean;",
  1663       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Boolean;",
  1625                                                       (void*)&WB_GetMethodBooleaneOption},
  1664                                                       (void*)&WB_GetMethodBooleaneOption},
  1626   {CC"getMethodIntxOption",
  1665   {CC"getMethodIntxOption",
  1627       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Long;",
  1666       CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Long;",