@@ -348,8 +348,11 @@ const char* Runtime1::name_for_address(address entry) {
348
348
349
349
350
350
JRT_ENTRY (void , Runtime1::new_instance(JavaThread* current, Klass* klass))
351
- NOT_PRODUCT(_new_instance_slowcase_cnt++;)
352
-
351
+ #ifndef PRODUCT
352
+ if (PrintC1Statistics) {
353
+ _new_instance_slowcase_cnt++;
354
+ }
355
+ #endif
353
356
assert (klass->is_klass (), "not a class");
354
357
Handle holder (current, klass->klass_holder ()); // keep the klass alive
355
358
InstanceKlass* h = InstanceKlass::cast(klass);
@@ -363,7 +366,11 @@ JRT_END
363
366
364
367
365
368
JRT_ENTRY (void , Runtime1::new_type_array(JavaThread* current, Klass* klass, jint length))
366
- NOT_PRODUCT(_new_type_array_slowcase_cnt++;)
369
+ #ifndef PRODUCT
370
+ if (PrintC1Statistics) {
371
+ _new_type_array_slowcase_cnt++;
372
+ }
373
+ #endif
367
374
// Note: no handle for klass needed since they are not used
368
375
// anymore after new_typeArray() and no GC can happen before.
369
376
// (This may have to change if this code changes!)
@@ -381,8 +388,11 @@ JRT_END
381
388
382
389
383
390
JRT_ENTRY (void , Runtime1::new_object_array(JavaThread* current, Klass* array_klass, jint length))
384
- NOT_PRODUCT(_new_object_array_slowcase_cnt++;)
385
-
391
+ #ifndef PRODUCT
392
+ if (PrintC1Statistics) {
393
+ _new_object_array_slowcase_cnt++;
394
+ }
395
+ #endif
386
396
// Note: no handle for klass needed since they are not used
387
397
// anymore after new_objArray() and no GC can happen before.
388
398
// (This may have to change if this code changes!)
@@ -400,8 +410,11 @@ JRT_END
400
410
401
411
402
412
JRT_ENTRY (void , Runtime1::new_multi_array(JavaThread* current, Klass* klass, int rank, jint* dims))
403
- NOT_PRODUCT(_new_multi_array_slowcase_cnt++;)
404
-
413
+ #ifndef PRODUCT
414
+ if (PrintC1Statistics) {
415
+ _new_multi_array_slowcase_cnt++;
416
+ }
417
+ #endif
405
418
assert (klass->is_klass (), "not a class");
406
419
assert (rank >= 1 , " rank must be nonzero" );
407
420
Handle holder (current, klass->klass_holder ()); // keep the klass alive
@@ -653,7 +666,11 @@ address Runtime1::exception_handler_for_pc(JavaThread* current) {
653
666
654
667
655
668
JRT_ENTRY (void , Runtime1::throw_range_check_exception(JavaThread* current, int index, arrayOopDesc* a))
656
- NOT_PRODUCT(_throw_range_check_exception_count++;)
669
+ #ifndef PRODUCT
670
+ if (PrintC1Statistics) {
671
+ _throw_range_check_exception_count++;
672
+ }
673
+ #endif
657
674
const int len = 35 ;
658
675
assert (len < strlen(" Index %d out of bounds for length %d" ), "Must allocate more space for message.");
659
676
char message[2 * jintAsStringSize + len];
@@ -663,42 +680,66 @@ JRT_END
663
680
664
681
665
682
JRT_ENTRY (void , Runtime1::throw_index_exception(JavaThread* current, int index))
666
- NOT_PRODUCT(_throw_index_exception_count++;)
683
+ #ifndef PRODUCT
684
+ if (PrintC1Statistics) {
685
+ _throw_index_exception_count++;
686
+ }
687
+ #endif
667
688
char message[16 ];
668
689
sprintf (message, " %d" , index);
669
690
SharedRuntime::throw_and_post_jvmti_exception (current, vmSymbols::java_lang_IndexOutOfBoundsException(), message);
670
691
JRT_END
671
692
672
693
673
694
JRT_ENTRY (void , Runtime1::throw_div0_exception(JavaThread* current))
674
- NOT_PRODUCT(_throw_div0_exception_count++;)
695
+ #ifndef PRODUCT
696
+ if (PrintC1Statistics) {
697
+ _throw_div0_exception_count++;
698
+ }
699
+ #endif
675
700
SharedRuntime::throw_and_post_jvmti_exception (current, vmSymbols::java_lang_ArithmeticException(), "/ by zero");
676
701
JRT_END
677
702
678
703
679
704
JRT_ENTRY (void , Runtime1::throw_null_pointer_exception(JavaThread* current))
680
- NOT_PRODUCT(_throw_null_pointer_exception_count++;)
705
+ #ifndef PRODUCT
706
+ if (PrintC1Statistics) {
707
+ _throw_null_pointer_exception_count++;
708
+ }
709
+ #endif
681
710
SharedRuntime::throw_and_post_jvmti_exception (current, vmSymbols::java_lang_NullPointerException());
682
711
JRT_END
683
712
684
713
685
714
JRT_ENTRY (void , Runtime1::throw_class_cast_exception(JavaThread* current, oopDesc* object))
686
- NOT_PRODUCT(_throw_class_cast_exception_count++;)
715
+ #ifndef PRODUCT
716
+ if (PrintC1Statistics) {
717
+ _throw_class_cast_exception_count++;
718
+ }
719
+ #endif
687
720
ResourceMark rm (current);
688
721
char * message = SharedRuntime::generate_class_cast_message(current, object->klass ());
689
722
SharedRuntime::throw_and_post_jvmti_exception (current, vmSymbols::java_lang_ClassCastException(), message);
690
723
JRT_END
691
724
692
725
693
726
JRT_ENTRY (void , Runtime1::throw_incompatible_class_change_error(JavaThread* current))
694
- NOT_PRODUCT(_throw_incompatible_class_change_error_count++;)
727
+ #ifndef PRODUCT
728
+ if (PrintC1Statistics) {
729
+ _throw_incompatible_class_change_error_count++;
730
+ }
731
+ #endif
695
732
ResourceMark rm (current);
696
733
SharedRuntime::throw_and_post_jvmti_exception (current, vmSymbols::java_lang_IncompatibleClassChangeError());
697
734
JRT_END
698
735
699
736
700
737
JRT_BLOCK_ENTRY (void , Runtime1::monitorenter(JavaThread* current, oopDesc* obj, BasicObjectLock* lock))
701
- NOT_PRODUCT(_monitorenter_slowcase_cnt++;)
738
+ #ifndef PRODUCT
739
+ if (PrintC1Statistics) {
740
+ _monitorenter_slowcase_cnt++;
741
+ }
742
+ #endif
702
743
if (!UseFastLocking) {
703
744
lock->set_obj (obj);
704
745
}
@@ -708,7 +749,11 @@ JRT_END
708
749
709
750
710
751
JRT_LEAF (void , Runtime1::monitorexit(JavaThread* current, BasicObjectLock* lock))
711
- NOT_PRODUCT(_monitorexit_slowcase_cnt++;)
752
+ #ifndef PRODUCT
753
+ if (PrintC1Statistics) {
754
+ _monitorexit_slowcase_cnt++;
755
+ }
756
+ #endif
712
757
assert (current->last_Java_sp (), "last_Java_sp must be set");
713
758
oop obj = lock->obj ();
714
759
assert (oopDesc::is_oop(obj), "must be NULL or an object");
@@ -860,7 +905,11 @@ static Klass* resolve_field_return_klass(const methodHandle& caller, int bci, TR
860
905
// patch only naturally aligned words, as single, full-word writes.
861
906
862
907
JRT_ENTRY (void , Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_id ))
863
- NOT_PRODUCT(_patch_code_slowcase_cnt++;)
908
+ #ifndef PRODUCT
909
+ if (PrintC1Statistics) {
910
+ _patch_code_slowcase_cnt++;
911
+ }
912
+ #endif
864
913
865
914
ResourceMark rm (current);
866
915
RegisterMap reg_map (current, false );
@@ -1255,7 +1304,11 @@ JRT_END
1255
1304
#else // DEOPTIMIZE_WHEN_PATCHING
1256
1305
1257
1306
void Runtime1::patch_code (JavaThread* current, Runtime1::StubID stub_id) {
1258
- NOT_PRODUCT (_patch_code_slowcase_cnt++);
1307
+ #ifndef PRODUCT
1308
+ if (PrintC1Statistics) {
1309
+ _patch_code_slowcase_cnt++;
1310
+ }
1311
+ #endif
1259
1312
1260
1313
// Enable WXWrite: the function is called by c1 stub as a runtime function
1261
1314
// (see another implementation above).
0 commit comments