85 DeoptimizationBlob* SharedRuntime::_deopt_blob; 86 SafepointBlob* SharedRuntime::_polling_page_vectors_safepoint_handler_blob; 87 SafepointBlob* SharedRuntime::_polling_page_safepoint_handler_blob; 88 SafepointBlob* SharedRuntime::_polling_page_return_handler_blob; 89 90 #ifdef COMPILER2 91 UncommonTrapBlob* SharedRuntime::_uncommon_trap_blob; 92 #endif // COMPILER2 93 94 95 //----------------------------generate_stubs----------------------------------- 96 void SharedRuntime::generate_stubs() { 97 _wrong_method_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method), "wrong_method_stub"); 98 _wrong_method_abstract_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_abstract), "wrong_method_abstract_stub"); 99 _ic_miss_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_ic_miss), "ic_miss_stub"); 100 _resolve_opt_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_opt_virtual_call_C), "resolve_opt_virtual_call"); 101 _resolve_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_virtual_call_C), "resolve_virtual_call"); 102 _resolve_static_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_static_call_C), "resolve_static_call"); 103 _resolve_static_call_entry = _resolve_static_call_blob->entry_point(); 104 105 #if defined(COMPILER2) || INCLUDE_JVMCI 106 // Vectors are generated only by C2 and JVMCI. 107 bool support_wide = is_wide_vector(MaxVectorSize); 108 if (support_wide) { 109 _polling_page_vectors_safepoint_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_VECTOR_LOOP); 110 } 111 #endif // COMPILER2 || INCLUDE_JVMCI 112 _polling_page_safepoint_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_LOOP); 113 _polling_page_return_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_RETURN); 114 115 generate_deopt_blob(); 116 117 #ifdef COMPILER2 118 generate_uncommon_trap_blob(); 119 #endif // COMPILER2 120 } 121 122 #include <math.h> 123 124 // Implementation of SharedRuntime 125 126 #ifndef PRODUCT 127 // For statistics 128 int SharedRuntime::_ic_miss_ctr = 0; 129 int SharedRuntime::_wrong_method_ctr = 0; 130 int SharedRuntime::_resolve_static_ctr = 0; 131 int SharedRuntime::_resolve_virtual_ctr = 0; | 85 DeoptimizationBlob* SharedRuntime::_deopt_blob; 86 SafepointBlob* SharedRuntime::_polling_page_vectors_safepoint_handler_blob; 87 SafepointBlob* SharedRuntime::_polling_page_safepoint_handler_blob; 88 SafepointBlob* SharedRuntime::_polling_page_return_handler_blob; 89 90 #ifdef COMPILER2 91 UncommonTrapBlob* SharedRuntime::_uncommon_trap_blob; 92 #endif // COMPILER2 93 94 95 //----------------------------generate_stubs----------------------------------- 96 void SharedRuntime::generate_stubs() { 97 _wrong_method_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method), "wrong_method_stub"); 98 _wrong_method_abstract_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_abstract), "wrong_method_abstract_stub"); 99 _ic_miss_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_ic_miss), "ic_miss_stub"); 100 _resolve_opt_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_opt_virtual_call_C), "resolve_opt_virtual_call"); 101 _resolve_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_virtual_call_C), "resolve_virtual_call"); 102 _resolve_static_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_static_call_C), "resolve_static_call"); 103 _resolve_static_call_entry = _resolve_static_call_blob->entry_point(); 104 105 #if COMPILER2_OR_JVMCI 106 // Vectors are generated only by C2 and JVMCI. 107 bool support_wide = is_wide_vector(MaxVectorSize); 108 if (support_wide) { 109 _polling_page_vectors_safepoint_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_VECTOR_LOOP); 110 } 111 #endif // COMPILER2_OR_JVMCI 112 _polling_page_safepoint_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_LOOP); 113 _polling_page_return_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_RETURN); 114 115 generate_deopt_blob(); 116 117 #ifdef COMPILER2 118 generate_uncommon_trap_blob(); 119 #endif // COMPILER2 120 } 121 122 #include <math.h> 123 124 // Implementation of SharedRuntime 125 126 #ifndef PRODUCT 127 // For statistics 128 int SharedRuntime::_ic_miss_ctr = 0; 129 int SharedRuntime::_wrong_method_ctr = 0; 130 int SharedRuntime::_resolve_static_ctr = 0; 131 int SharedRuntime::_resolve_virtual_ctr = 0; |