< prev index next >

src/share/vm/classfile/classLoader.cpp

Print this page




1856   }
1857   // The CHECK at the caller will propagate the exception out
1858 }
1859 
1860 /**
1861  * Returns if the given method should be compiled when doing compile-the-world.
1862  *
1863  * TODO:  This should be a private method in a CompileTheWorld class.
1864  */
1865 static bool can_be_compiled(methodHandle m, int comp_level) {
1866   assert(CompileTheWorld, "must be");
1867 
1868   // It's not valid to compile a native wrapper for MethodHandle methods
1869   // that take a MemberName appendix since the bytecode signature is not
1870   // correct.
1871   vmIntrinsics::ID iid = m->intrinsic_id();
1872   if (MethodHandles::is_signature_polymorphic(iid) && MethodHandles::has_member_arg(iid)) {
1873     return false;
1874   }
1875 





1876   return CompilationPolicy::can_be_compiled(m, comp_level);
1877 }
1878 
1879 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
1880   if (string_ends_with(name, ".class")) {
1881     // We have a .class file
1882     int len = (int)strlen(name);
1883     char buffer[2048];
1884     strncpy(buffer, name, len - 6);
1885     buffer[len-6] = 0;
1886     // If the file has a period after removing .class, it's not really a
1887     // valid class file.  The class loader will check everything else.
1888     if (strchr(buffer, '.') == NULL) {
1889       _compile_the_world_class_counter++;
1890       if (_compile_the_world_class_counter > CompileTheWorldStopAt) return;
1891 
1892       // Construct name without extension
1893       TempNewSymbol sym = SymbolTable::new_symbol(buffer, CHECK);
1894       // Use loader to load and initialize class
1895       Klass* k = SystemDictionary::resolve_or_null(sym, loader, Handle(), THREAD);




1856   }
1857   // The CHECK at the caller will propagate the exception out
1858 }
1859 
1860 /**
1861  * Returns if the given method should be compiled when doing compile-the-world.
1862  *
1863  * TODO:  This should be a private method in a CompileTheWorld class.
1864  */
1865 static bool can_be_compiled(methodHandle m, int comp_level) {
1866   assert(CompileTheWorld, "must be");
1867 
1868   // It's not valid to compile a native wrapper for MethodHandle methods
1869   // that take a MemberName appendix since the bytecode signature is not
1870   // correct.
1871   vmIntrinsics::ID iid = m->intrinsic_id();
1872   if (MethodHandles::is_signature_polymorphic(iid) && MethodHandles::has_member_arg(iid)) {
1873     return false;
1874   }
1875 
1876   // Don't compile methods in __Value if value types are disabled
1877   if (!EnableMVT && !EnableValhalla && m->method_holder()->name() == vmSymbols::java_lang____Value()) {
1878     return false;
1879   }
1880 
1881   return CompilationPolicy::can_be_compiled(m, comp_level);
1882 }
1883 
1884 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
1885   if (string_ends_with(name, ".class")) {
1886     // We have a .class file
1887     int len = (int)strlen(name);
1888     char buffer[2048];
1889     strncpy(buffer, name, len - 6);
1890     buffer[len-6] = 0;
1891     // If the file has a period after removing .class, it's not really a
1892     // valid class file.  The class loader will check everything else.
1893     if (strchr(buffer, '.') == NULL) {
1894       _compile_the_world_class_counter++;
1895       if (_compile_the_world_class_counter > CompileTheWorldStopAt) return;
1896 
1897       // Construct name without extension
1898       TempNewSymbol sym = SymbolTable::new_symbol(buffer, CHECK);
1899       // Use loader to load and initialize class
1900       Klass* k = SystemDictionary::resolve_or_null(sym, loader, Handle(), THREAD);


< prev index next >