< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page




1130   if (JvmtiExport::should_post_compiled_method_load()) {
1131     method->jmethod_id();
1132   }
1133 
1134   // do the compilation
1135   if (method->is_native()) {
1136     if (!PreferInterpreterNativeStubs || method->is_method_handle_intrinsic()) {
1137       // The following native methods:
1138       //
1139       // java.lang.Float.intBitsToFloat
1140       // java.lang.Float.floatToRawIntBits
1141       // java.lang.Double.longBitsToDouble
1142       // java.lang.Double.doubleToRawLongBits
1143       //
1144       // are called through the interpreter even if interpreter native stubs
1145       // are not preferred (i.e., calling through adapter handlers is preferred).
1146       // The reason is that on x86_32 signaling NaNs (sNaNs) are not preserved
1147       // if the version of the methods from the native libraries is called.
1148       // As the interpreter and the C2-intrinsified version of the methods preserves
1149       // sNaNs, that would result in an inconsistent way of handling of sNaNs.

1150       if ((UseSSE >= 1 &&
1151           (method->intrinsic_id() == vmIntrinsics::_intBitsToFloat ||
1152            method->intrinsic_id() == vmIntrinsics::_floatToRawIntBits)) ||
1153           (UseSSE >= 2 &&
1154            (method->intrinsic_id() == vmIntrinsics::_longBitsToDouble ||
1155             method->intrinsic_id() == vmIntrinsics::_doubleToRawLongBits))) {
1156         return NULL;
1157       }

1158 
1159       // To properly handle the appendix argument for out-of-line calls we are using a small trampoline that
1160       // pops off the appendix argument and jumps to the target (see gen_special_dispatch in SharedRuntime).
1161       //
1162       // Since normal compiled-to-compiled calls are not able to handle such a thing we MUST generate an adapter
1163       // in this case.  If we can't generate one and use it we can not execute the out-of-line method handle calls.
1164       AdapterHandlerLibrary::create_native_wrapper(method);
1165     } else {
1166       return NULL;
1167     }
1168   } else {
1169     // If the compiler is shut off due to code cache getting full
1170     // fail out now so blocking compiles dont hang the java thread
1171     if (!should_compile_new_jobs()) {
1172       CompilationPolicy::policy()->delay_compilation(method());
1173       return NULL;
1174     }
1175     bool is_blocking = !directive->BackgroundCompilationOption || CompileTheWorld || ReplayCompiles;
1176     compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, is_blocking, THREAD);
1177   }




1130   if (JvmtiExport::should_post_compiled_method_load()) {
1131     method->jmethod_id();
1132   }
1133 
1134   // do the compilation
1135   if (method->is_native()) {
1136     if (!PreferInterpreterNativeStubs || method->is_method_handle_intrinsic()) {
1137       // The following native methods:
1138       //
1139       // java.lang.Float.intBitsToFloat
1140       // java.lang.Float.floatToRawIntBits
1141       // java.lang.Double.longBitsToDouble
1142       // java.lang.Double.doubleToRawLongBits
1143       //
1144       // are called through the interpreter even if interpreter native stubs
1145       // are not preferred (i.e., calling through adapter handlers is preferred).
1146       // The reason is that on x86_32 signaling NaNs (sNaNs) are not preserved
1147       // if the version of the methods from the native libraries is called.
1148       // As the interpreter and the C2-intrinsified version of the methods preserves
1149       // sNaNs, that would result in an inconsistent way of handling of sNaNs.
1150 #ifdef X86
1151       if ((UseSSE >= 1 &&
1152           (method->intrinsic_id() == vmIntrinsics::_intBitsToFloat ||
1153            method->intrinsic_id() == vmIntrinsics::_floatToRawIntBits)) ||
1154           (UseSSE >= 2 &&
1155            (method->intrinsic_id() == vmIntrinsics::_longBitsToDouble ||
1156             method->intrinsic_id() == vmIntrinsics::_doubleToRawLongBits))) {
1157         return NULL;
1158       }
1159 #endif
1160       
1161       // To properly handle the appendix argument for out-of-line calls we are using a small trampoline that
1162       // pops off the appendix argument and jumps to the target (see gen_special_dispatch in SharedRuntime).
1163       //
1164       // Since normal compiled-to-compiled calls are not able to handle such a thing we MUST generate an adapter
1165       // in this case.  If we can't generate one and use it we can not execute the out-of-line method handle calls.
1166       AdapterHandlerLibrary::create_native_wrapper(method);
1167     } else {
1168       return NULL;
1169     }
1170   } else {
1171     // If the compiler is shut off due to code cache getting full
1172     // fail out now so blocking compiles dont hang the java thread
1173     if (!should_compile_new_jobs()) {
1174       CompilationPolicy::policy()->delay_compilation(method());
1175       return NULL;
1176     }
1177     bool is_blocking = !directive->BackgroundCompilationOption || CompileTheWorld || ReplayCompiles;
1178     compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, is_blocking, THREAD);
1179   }


< prev index next >