59 #include "runtime/frame.inline.hpp" 60 #include "runtime/handles.inline.hpp" 61 #include "runtime/init.hpp" 62 #include "runtime/interfaceSupport.inline.hpp" 63 #include "runtime/java.hpp" 64 #include "runtime/javaCalls.hpp" 65 #include "runtime/sharedRuntime.hpp" 66 #include "runtime/stubRoutines.hpp" 67 #include "runtime/vframe.inline.hpp" 68 #include "runtime/vframeArray.hpp" 69 #include "trace/tracing.hpp" 70 #include "utilities/copy.hpp" 71 #include "utilities/dtrace.hpp" 72 #include "utilities/events.hpp" 73 #include "utilities/hashtable.inline.hpp" 74 #include "utilities/macros.hpp" 75 #include "utilities/xmlstream.hpp" 76 #ifdef COMPILER1 77 #include "c1/c1_Runtime1.hpp" 78 #endif 79 #if INCLUDE_ALL_GCS 80 #include "gc/g1/g1ThreadLocalData.hpp" 81 #endif // INCLUDE_ALL_GCS 82 83 // Shared stub locations 84 RuntimeStub* SharedRuntime::_wrong_method_blob; 85 RuntimeStub* SharedRuntime::_wrong_method_abstract_blob; 86 RuntimeStub* SharedRuntime::_ic_miss_blob; 87 RuntimeStub* SharedRuntime::_resolve_opt_virtual_call_blob; 88 RuntimeStub* SharedRuntime::_resolve_virtual_call_blob; 89 RuntimeStub* SharedRuntime::_resolve_static_call_blob; 90 address SharedRuntime::_resolve_static_call_entry; 91 92 DeoptimizationBlob* SharedRuntime::_deopt_blob; 93 SafepointBlob* SharedRuntime::_polling_page_vectors_safepoint_handler_blob; 94 SafepointBlob* SharedRuntime::_polling_page_safepoint_handler_blob; 95 SafepointBlob* SharedRuntime::_polling_page_return_handler_blob; 96 97 #ifdef COMPILER2 98 UncommonTrapBlob* SharedRuntime::_uncommon_trap_blob; 99 #endif // COMPILER2 100 101 191 } 192 int index = _ICmiss_index++; 193 if (_ICmiss_index >= maxICmiss_count) _ICmiss_index = maxICmiss_count - 1; 194 _ICmiss_at[index] = at; 195 _ICmiss_count[index] = 1; 196 } 197 198 void SharedRuntime::print_ic_miss_histogram() { 199 if (ICMissHistogram) { 200 tty->print_cr("IC Miss Histogram:"); 201 int tot_misses = 0; 202 for (int i = 0; i < _ICmiss_index; i++) { 203 tty->print_cr(" at: " INTPTR_FORMAT " nof: %d", p2i(_ICmiss_at[i]), _ICmiss_count[i]); 204 tot_misses += _ICmiss_count[i]; 205 } 206 tty->print_cr("Total IC misses: %7d", tot_misses); 207 } 208 } 209 #endif // PRODUCT 210 211 #if INCLUDE_ALL_GCS 212 213 // G1 write-barrier pre: executed before a pointer store. 214 JRT_LEAF(void, SharedRuntime::g1_wb_pre(oopDesc* orig, JavaThread *thread)) 215 if (orig == NULL) { 216 assert(false, "should be optimized out"); 217 return; 218 } 219 assert(oopDesc::is_oop(orig, true /* ignore mark word */), "Error"); 220 // store the original value that was in the field reference 221 G1ThreadLocalData::satb_mark_queue(thread).enqueue(orig); 222 JRT_END 223 224 // G1 write-barrier post: executed after a pointer store. 225 JRT_LEAF(void, SharedRuntime::g1_wb_post(void* card_addr, JavaThread* thread)) 226 G1ThreadLocalData::dirty_card_queue(thread).enqueue(card_addr); 227 JRT_END 228 229 #endif // INCLUDE_ALL_GCS 230 231 232 JRT_LEAF(jlong, SharedRuntime::lmul(jlong y, jlong x)) 233 return x * y; 234 JRT_END 235 236 237 JRT_LEAF(jlong, SharedRuntime::ldiv(jlong y, jlong x)) 238 if (x == min_jlong && y == CONST64(-1)) { 239 return x; 240 } else { 241 return x / y; 242 } 243 JRT_END 244 245 246 JRT_LEAF(jlong, SharedRuntime::lrem(jlong y, jlong x)) 247 if (x == min_jlong && y == CONST64(-1)) { 248 return 0; 249 } else { | 59 #include "runtime/frame.inline.hpp" 60 #include "runtime/handles.inline.hpp" 61 #include "runtime/init.hpp" 62 #include "runtime/interfaceSupport.inline.hpp" 63 #include "runtime/java.hpp" 64 #include "runtime/javaCalls.hpp" 65 #include "runtime/sharedRuntime.hpp" 66 #include "runtime/stubRoutines.hpp" 67 #include "runtime/vframe.inline.hpp" 68 #include "runtime/vframeArray.hpp" 69 #include "trace/tracing.hpp" 70 #include "utilities/copy.hpp" 71 #include "utilities/dtrace.hpp" 72 #include "utilities/events.hpp" 73 #include "utilities/hashtable.inline.hpp" 74 #include "utilities/macros.hpp" 75 #include "utilities/xmlstream.hpp" 76 #ifdef COMPILER1 77 #include "c1/c1_Runtime1.hpp" 78 #endif 79 #if INCLUDE_G1GC 80 #include "gc/g1/g1ThreadLocalData.hpp" 81 #endif // INCLUDE_G1GC 82 83 // Shared stub locations 84 RuntimeStub* SharedRuntime::_wrong_method_blob; 85 RuntimeStub* SharedRuntime::_wrong_method_abstract_blob; 86 RuntimeStub* SharedRuntime::_ic_miss_blob; 87 RuntimeStub* SharedRuntime::_resolve_opt_virtual_call_blob; 88 RuntimeStub* SharedRuntime::_resolve_virtual_call_blob; 89 RuntimeStub* SharedRuntime::_resolve_static_call_blob; 90 address SharedRuntime::_resolve_static_call_entry; 91 92 DeoptimizationBlob* SharedRuntime::_deopt_blob; 93 SafepointBlob* SharedRuntime::_polling_page_vectors_safepoint_handler_blob; 94 SafepointBlob* SharedRuntime::_polling_page_safepoint_handler_blob; 95 SafepointBlob* SharedRuntime::_polling_page_return_handler_blob; 96 97 #ifdef COMPILER2 98 UncommonTrapBlob* SharedRuntime::_uncommon_trap_blob; 99 #endif // COMPILER2 100 101 191 } 192 int index = _ICmiss_index++; 193 if (_ICmiss_index >= maxICmiss_count) _ICmiss_index = maxICmiss_count - 1; 194 _ICmiss_at[index] = at; 195 _ICmiss_count[index] = 1; 196 } 197 198 void SharedRuntime::print_ic_miss_histogram() { 199 if (ICMissHistogram) { 200 tty->print_cr("IC Miss Histogram:"); 201 int tot_misses = 0; 202 for (int i = 0; i < _ICmiss_index; i++) { 203 tty->print_cr(" at: " INTPTR_FORMAT " nof: %d", p2i(_ICmiss_at[i]), _ICmiss_count[i]); 204 tot_misses += _ICmiss_count[i]; 205 } 206 tty->print_cr("Total IC misses: %7d", tot_misses); 207 } 208 } 209 #endif // PRODUCT 210 211 #if INCLUDE_G1GC 212 213 // G1 write-barrier pre: executed before a pointer store. 214 JRT_LEAF(void, SharedRuntime::g1_wb_pre(oopDesc* orig, JavaThread *thread)) 215 if (orig == NULL) { 216 assert(false, "should be optimized out"); 217 return; 218 } 219 assert(oopDesc::is_oop(orig, true /* ignore mark word */), "Error"); 220 // store the original value that was in the field reference 221 G1ThreadLocalData::satb_mark_queue(thread).enqueue(orig); 222 JRT_END 223 224 // G1 write-barrier post: executed after a pointer store. 225 JRT_LEAF(void, SharedRuntime::g1_wb_post(void* card_addr, JavaThread* thread)) 226 G1ThreadLocalData::dirty_card_queue(thread).enqueue(card_addr); 227 JRT_END 228 229 #endif // INCLUDE_G1GC 230 231 232 JRT_LEAF(jlong, SharedRuntime::lmul(jlong y, jlong x)) 233 return x * y; 234 JRT_END 235 236 237 JRT_LEAF(jlong, SharedRuntime::ldiv(jlong y, jlong x)) 238 if (x == min_jlong && y == CONST64(-1)) { 239 return x; 240 } else { 241 return x / y; 242 } 243 JRT_END 244 245 246 JRT_LEAF(jlong, SharedRuntime::lrem(jlong y, jlong x)) 247 if (x == min_jlong && y == CONST64(-1)) { 248 return 0; 249 } else { |