183 }
184 int index = _ICmiss_index++;
185 if (_ICmiss_index >= maxICmiss_count) _ICmiss_index = maxICmiss_count - 1;
186 _ICmiss_at[index] = at;
187 _ICmiss_count[index] = 1;
188 }
189
190 void SharedRuntime::print_ic_miss_histogram() {
191 if (ICMissHistogram) {
192 tty->print_cr("IC Miss Histogram:");
193 int tot_misses = 0;
194 for (int i = 0; i < _ICmiss_index; i++) {
195 tty->print_cr(" at: " INTPTR_FORMAT " nof: %d", p2i(_ICmiss_at[i]), _ICmiss_count[i]);
196 tot_misses += _ICmiss_count[i];
197 }
198 tty->print_cr("Total IC misses: %7d", tot_misses);
199 }
200 }
201 #endif // PRODUCT
202
203 #if INCLUDE_ALL_GCS
204
205 // G1 write-barrier pre: executed before a pointer store.
206 JRT_LEAF(void, SharedRuntime::g1_wb_pre(oopDesc* orig, JavaThread *thread))
207 if (orig == NULL) {
208 assert(false, "should be optimized out");
209 return;
210 }
211 assert(orig->is_oop(true /* ignore mark word */), "Error");
212 // store the original value that was in the field reference
213 thread->satb_mark_queue().enqueue(orig);
214 JRT_END
215
216 // G1 write-barrier post: executed after a pointer store.
217 JRT_LEAF(void, SharedRuntime::g1_wb_post(void* card_addr, JavaThread* thread))
218 thread->dirty_card_queue().enqueue(card_addr);
219 JRT_END
220
221 #endif // INCLUDE_ALL_GCS
222
223
224 JRT_LEAF(jlong, SharedRuntime::lmul(jlong y, jlong x))
225 return x * y;
226 JRT_END
227
228
229 JRT_LEAF(jlong, SharedRuntime::ldiv(jlong y, jlong x))
230 if (x == min_jlong && y == CONST64(-1)) {
231 return x;
232 } else {
233 return x / y;
234 }
235 JRT_END
236
237
238 JRT_LEAF(jlong, SharedRuntime::lrem(jlong y, jlong x))
239 if (x == min_jlong && y == CONST64(-1)) {
240 return 0;
241 } else {
242 return x % y;
243 }
3151 ResourceMark rm(thread);
3152 activation = fr;
3153 warning("Potentially dangerous stack overflow in "
3154 "ReservedStackAccess annotated method %s [%d]",
3155 method->name_and_sig_as_C_string(), count++);
3156 EventReservedStackActivation event;
3157 if (event.should_commit()) {
3158 event.set_method(method);
3159 event.commit();
3160 }
3161 }
3162 if (fr.is_first_java_frame()) {
3163 break;
3164 } else {
3165 fr = fr.java_sender();
3166 }
3167 }
3168 return activation;
3169 }
3170
|
183 }
184 int index = _ICmiss_index++;
185 if (_ICmiss_index >= maxICmiss_count) _ICmiss_index = maxICmiss_count - 1;
186 _ICmiss_at[index] = at;
187 _ICmiss_count[index] = 1;
188 }
189
190 void SharedRuntime::print_ic_miss_histogram() {
191 if (ICMissHistogram) {
192 tty->print_cr("IC Miss Histogram:");
193 int tot_misses = 0;
194 for (int i = 0; i < _ICmiss_index; i++) {
195 tty->print_cr(" at: " INTPTR_FORMAT " nof: %d", p2i(_ICmiss_at[i]), _ICmiss_count[i]);
196 tot_misses += _ICmiss_count[i];
197 }
198 tty->print_cr("Total IC misses: %7d", tot_misses);
199 }
200 }
201 #endif // PRODUCT
202
203 JRT_LEAF(jlong, SharedRuntime::lmul(jlong y, jlong x))
204 return x * y;
205 JRT_END
206
207
208 JRT_LEAF(jlong, SharedRuntime::ldiv(jlong y, jlong x))
209 if (x == min_jlong && y == CONST64(-1)) {
210 return x;
211 } else {
212 return x / y;
213 }
214 JRT_END
215
216
217 JRT_LEAF(jlong, SharedRuntime::lrem(jlong y, jlong x))
218 if (x == min_jlong && y == CONST64(-1)) {
219 return 0;
220 } else {
221 return x % y;
222 }
3130 ResourceMark rm(thread);
3131 activation = fr;
3132 warning("Potentially dangerous stack overflow in "
3133 "ReservedStackAccess annotated method %s [%d]",
3134 method->name_and_sig_as_C_string(), count++);
3135 EventReservedStackActivation event;
3136 if (event.should_commit()) {
3137 event.set_method(method);
3138 event.commit();
3139 }
3140 }
3141 if (fr.is_first_java_frame()) {
3142 break;
3143 } else {
3144 fr = fr.java_sender();
3145 }
3146 }
3147 return activation;
3148 }
3149
3150 void SharedRuntime::on_slowpath_allocation(JavaThread* thread) {
3151 // After any safepoint, just before going back to compiled code,
3152 // we inform the GC that we will be doing initializing writes to
3153 // this object in the future without emitting card-marks, so
3154 // GC may take any compensating steps.
3155
3156 oop new_obj = thread->vm_result();
3157 if (new_obj == NULL) return;
3158
3159 BarrierSet *bs = Universe::heap()->barrier_set();
3160 // GC may decide to give back a safer copy of new_obj.
3161 bs->on_slowpath_allocation(thread, new_obj);
3162 thread->set_vm_result(new_obj);
3163 }
|