< prev index next >

src/share/vm/prims/jvm.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 891   if (t != T_ILLEGAL && t != T_OBJECT && t != T_ARRAY) {
 892     mirror = Universe::java_mirror(t);
 893   }
 894   if (mirror == NULL) {
 895     THROW_MSG_0(vmSymbols::java_lang_ClassNotFoundException(), (char*) utf);
 896   } else {
 897     return (jclass) JNIHandles::make_local(env, mirror);
 898   }
 899 JVM_END
 900 
 901 
 902 JVM_ENTRY(void, JVM_ResolveClass(JNIEnv* env, jclass cls))
 903   JVMWrapper("JVM_ResolveClass");
 904   if (PrintJVMWarnings) warning("JVM_ResolveClass not implemented");
 905 JVM_END
 906 
 907 
 908 JVM_ENTRY(jboolean, JVM_KnownToNotExist(JNIEnv *env, jobject loader, const char *classname))
 909   JVMWrapper("JVM_KnownToNotExist");
 910 #if INCLUDE_CDS
 911   return ClassLoaderExt::known_to_not_exist(env, loader, classname, CHECK_(false));
 912 #else
 913   return false;
 914 #endif
 915 JVM_END
 916 
 917 
 918 JVM_ENTRY(jobjectArray, JVM_GetResourceLookupCacheURLs(JNIEnv *env, jobject loader))
 919   JVMWrapper("JVM_GetResourceLookupCacheURLs");
 920 #if INCLUDE_CDS
 921   return ClassLoaderExt::get_lookup_cache_urls(env, loader, CHECK_NULL);
 922 #else
 923   return NULL;
 924 #endif
 925 JVM_END
 926 
 927 
 928 JVM_ENTRY(jintArray, JVM_GetResourceLookupCache(JNIEnv *env, jobject loader, const char *resource_name))
 929   JVMWrapper("JVM_GetResourceLookupCache");
 930 #if INCLUDE_CDS
 931   return ClassLoaderExt::get_lookup_cache(env, loader, resource_name, CHECK_NULL);
 932 #else
 933   return NULL;
 934 #endif
 935 JVM_END
 936 
 937 
 938 // Returns a class loaded by the bootstrap class loader; or null
 939 // if not found.  ClassNotFoundException is not thrown.
 940 //
 941 // Rationale behind JVM_FindClassFromBootLoader
 942 // a> JVM_FindClassFromClassLoader was never exported in the export tables.
 943 // b> because of (a) java.dll has a direct dependecy on the  unexported
 944 //    private symbol "_JVM_FindClassFromClassLoader@20".
 945 // c> the launcher cannot use the private symbol as it dynamically opens
 946 //    the entry point, so if something changes, the launcher will fail
 947 //    unexpectedly at runtime, it is safest for the launcher to dlopen a
 948 //    stable exported interface.
 949 // d> re-exporting JVM_FindClassFromClassLoader as public, will cause its
 950 //    signature to change from _JVM_FindClassFromClassLoader@20 to
 951 //    JVM_FindClassFromClassLoader and will not be backward compatible


4326   volatile jlong* addr    = (volatile jlong*)((address)o + fldOffs);
4327 
4328   assert(VM_Version::supports_cx8(), "cx8 not supported");
4329   res = Atomic::cmpxchg(newVal, addr, oldVal);
4330 
4331   return res == oldVal;
4332 JVM_END
4333 
4334 // DTrace ///////////////////////////////////////////////////////////////////
4335 
4336 JVM_ENTRY(jint, JVM_DTraceGetVersion(JNIEnv* env))
4337   JVMWrapper("JVM_DTraceGetVersion");
4338   return (jint)JVM_TRACING_DTRACE_VERSION;
4339 JVM_END
4340 
4341 JVM_ENTRY(jlong,JVM_DTraceActivate(
4342     JNIEnv* env, jint version, jstring module_name, jint providers_count,
4343     JVM_DTraceProvider* providers))
4344   JVMWrapper("JVM_DTraceActivate");
4345   return DTraceJSDT::activate(
4346     version, module_name, providers_count, providers, CHECK_0);
4347 JVM_END
4348 
4349 JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method))
4350   JVMWrapper("JVM_DTraceIsProbeEnabled");
4351   return DTraceJSDT::is_probe_enabled(method);
4352 JVM_END
4353 
4354 JVM_ENTRY(void,JVM_DTraceDispose(JNIEnv* env, jlong handle))
4355   JVMWrapper("JVM_DTraceDispose");
4356   DTraceJSDT::dispose(handle);
4357 JVM_END
4358 
4359 JVM_ENTRY(jboolean,JVM_DTraceIsSupported(JNIEnv* env))
4360   JVMWrapper("JVM_DTraceIsSupported");
4361   return DTraceJSDT::is_supported();
4362 JVM_END
4363 
4364 // Returns an array of all live Thread objects (VM internal JavaThreads,
4365 // jvmti agent threads, and JNI attaching threads  are skipped)
4366 // See CR 6404306 regarding JNI attaching threads


   1 /*
   2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 891   if (t != T_ILLEGAL && t != T_OBJECT && t != T_ARRAY) {
 892     mirror = Universe::java_mirror(t);
 893   }
 894   if (mirror == NULL) {
 895     THROW_MSG_0(vmSymbols::java_lang_ClassNotFoundException(), (char*) utf);
 896   } else {
 897     return (jclass) JNIHandles::make_local(env, mirror);
 898   }
 899 JVM_END
 900 
 901 
 902 JVM_ENTRY(void, JVM_ResolveClass(JNIEnv* env, jclass cls))
 903   JVMWrapper("JVM_ResolveClass");
 904   if (PrintJVMWarnings) warning("JVM_ResolveClass not implemented");
 905 JVM_END
 906 
 907 
 908 JVM_ENTRY(jboolean, JVM_KnownToNotExist(JNIEnv *env, jobject loader, const char *classname))
 909   JVMWrapper("JVM_KnownToNotExist");
 910 #if INCLUDE_CDS
 911   return ClassLoaderExt::known_to_not_exist(env, loader, classname, THREAD);
 912 #else
 913   return false;
 914 #endif
 915 JVM_END
 916 
 917 
 918 JVM_ENTRY(jobjectArray, JVM_GetResourceLookupCacheURLs(JNIEnv *env, jobject loader))
 919   JVMWrapper("JVM_GetResourceLookupCacheURLs");
 920 #if INCLUDE_CDS
 921   return ClassLoaderExt::get_lookup_cache_urls(env, loader, THREAD);
 922 #else
 923   return NULL;
 924 #endif
 925 JVM_END
 926 
 927 
 928 JVM_ENTRY(jintArray, JVM_GetResourceLookupCache(JNIEnv *env, jobject loader, const char *resource_name))
 929   JVMWrapper("JVM_GetResourceLookupCache");
 930 #if INCLUDE_CDS
 931   return ClassLoaderExt::get_lookup_cache(env, loader, resource_name, THREAD);
 932 #else
 933   return NULL;
 934 #endif
 935 JVM_END
 936 
 937 
 938 // Returns a class loaded by the bootstrap class loader; or null
 939 // if not found.  ClassNotFoundException is not thrown.
 940 //
 941 // Rationale behind JVM_FindClassFromBootLoader
 942 // a> JVM_FindClassFromClassLoader was never exported in the export tables.
 943 // b> because of (a) java.dll has a direct dependecy on the  unexported
 944 //    private symbol "_JVM_FindClassFromClassLoader@20".
 945 // c> the launcher cannot use the private symbol as it dynamically opens
 946 //    the entry point, so if something changes, the launcher will fail
 947 //    unexpectedly at runtime, it is safest for the launcher to dlopen a
 948 //    stable exported interface.
 949 // d> re-exporting JVM_FindClassFromClassLoader as public, will cause its
 950 //    signature to change from _JVM_FindClassFromClassLoader@20 to
 951 //    JVM_FindClassFromClassLoader and will not be backward compatible


4326   volatile jlong* addr    = (volatile jlong*)((address)o + fldOffs);
4327 
4328   assert(VM_Version::supports_cx8(), "cx8 not supported");
4329   res = Atomic::cmpxchg(newVal, addr, oldVal);
4330 
4331   return res == oldVal;
4332 JVM_END
4333 
4334 // DTrace ///////////////////////////////////////////////////////////////////
4335 
4336 JVM_ENTRY(jint, JVM_DTraceGetVersion(JNIEnv* env))
4337   JVMWrapper("JVM_DTraceGetVersion");
4338   return (jint)JVM_TRACING_DTRACE_VERSION;
4339 JVM_END
4340 
4341 JVM_ENTRY(jlong,JVM_DTraceActivate(
4342     JNIEnv* env, jint version, jstring module_name, jint providers_count,
4343     JVM_DTraceProvider* providers))
4344   JVMWrapper("JVM_DTraceActivate");
4345   return DTraceJSDT::activate(
4346     version, module_name, providers_count, providers, THREAD);
4347 JVM_END
4348 
4349 JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method))
4350   JVMWrapper("JVM_DTraceIsProbeEnabled");
4351   return DTraceJSDT::is_probe_enabled(method);
4352 JVM_END
4353 
4354 JVM_ENTRY(void,JVM_DTraceDispose(JNIEnv* env, jlong handle))
4355   JVMWrapper("JVM_DTraceDispose");
4356   DTraceJSDT::dispose(handle);
4357 JVM_END
4358 
4359 JVM_ENTRY(jboolean,JVM_DTraceIsSupported(JNIEnv* env))
4360   JVMWrapper("JVM_DTraceIsSupported");
4361   return DTraceJSDT::is_supported();
4362 JVM_END
4363 
4364 // Returns an array of all live Thread objects (VM internal JavaThreads,
4365 // jvmti agent threads, and JNI attaching threads  are skipped)
4366 // See CR 6404306 regarding JNI attaching threads


< prev index next >