Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/compile.cpp @ 17780:606acabe7b5c
8031320: Use Intel RTM instructions for locks
Summary: Use RTM for inflated locks and stack locks.
Reviewed-by: iveresov, twisti, roland, dcubed
author | kvn |
---|---|
date | Thu, 20 Mar 2014 17:49:27 -0700 |
parents | b8413a9cbb84 |
children | 62c54fcc0a35 |
comparison
equal
deleted
inserted
replaced
17778:a48e16541e6b | 17780:606acabe7b5c |
---|---|
688 } | 688 } |
689 #endif | 689 #endif |
690 set_print_inlining(PrintInlining || method()->has_option("PrintInlining") NOT_PRODUCT( || PrintOptoInlining)); | 690 set_print_inlining(PrintInlining || method()->has_option("PrintInlining") NOT_PRODUCT( || PrintOptoInlining)); |
691 set_print_intrinsics(PrintIntrinsics || method()->has_option("PrintIntrinsics")); | 691 set_print_intrinsics(PrintIntrinsics || method()->has_option("PrintIntrinsics")); |
692 | 692 |
693 if (ProfileTraps) { | 693 if (ProfileTraps RTM_OPT_ONLY( || UseRTMLocking )) { |
694 // Make sure the method being compiled gets its own MDO, | 694 // Make sure the method being compiled gets its own MDO, |
695 // so we can at least track the decompile_count(). | 695 // so we can at least track the decompile_count(). |
696 // Need MDO to record RTM code generation state. | |
696 method()->ensure_method_data(); | 697 method()->ensure_method_data(); |
697 } | 698 } |
698 | 699 |
699 Init(::AliasLevel); | 700 Init(::AliasLevel); |
700 | 701 |
897 frame_size_in_words(), _oop_map_set, | 898 frame_size_in_words(), _oop_map_set, |
898 &_handler_table, &_inc_table, | 899 &_handler_table, &_inc_table, |
899 compiler, | 900 compiler, |
900 env()->comp_level(), | 901 env()->comp_level(), |
901 has_unsafe_access(), | 902 has_unsafe_access(), |
902 SharedRuntime::is_wide_vector(max_vector_size()) | 903 SharedRuntime::is_wide_vector(max_vector_size()), |
904 rtm_state() | |
903 ); | 905 ); |
904 | 906 |
905 if (log() != NULL) // Print code cache state into compiler log | 907 if (log() != NULL) // Print code cache state into compiler log |
906 log()->code_cache_state(); | 908 log()->code_cache_state(); |
907 } | 909 } |
1061 set_max_inline_size(MaxInlineSize); | 1063 set_max_inline_size(MaxInlineSize); |
1062 set_freq_inline_size(FreqInlineSize); | 1064 set_freq_inline_size(FreqInlineSize); |
1063 set_do_scheduling(OptoScheduling); | 1065 set_do_scheduling(OptoScheduling); |
1064 set_do_count_invocations(false); | 1066 set_do_count_invocations(false); |
1065 set_do_method_data_update(false); | 1067 set_do_method_data_update(false); |
1066 | 1068 set_rtm_state(NoRTM); // No RTM lock eliding by default |
1069 #if INCLUDE_RTM_OPT | |
1070 if (UseRTMLocking && has_method() && (method()->method_data_or_null() != NULL)) { | |
1071 int rtm_state = method()->method_data()->rtm_state(); | |
1072 if (method_has_option("NoRTMLockEliding") || ((rtm_state & NoRTM) != 0)) { | |
1073 // Don't generate RTM lock eliding code. | |
1074 set_rtm_state(NoRTM); | |
1075 } else if (method_has_option("UseRTMLockEliding") || ((rtm_state & UseRTM) != 0) || !UseRTMDeopt) { | |
1076 // Generate RTM lock eliding code without abort ratio calculation code. | |
1077 set_rtm_state(UseRTM); | |
1078 } else if (UseRTMDeopt) { | |
1079 // Generate RTM lock eliding code and include abort ratio calculation | |
1080 // code if UseRTMDeopt is on. | |
1081 set_rtm_state(ProfileRTM); | |
1082 } | |
1083 } | |
1084 #endif | |
1067 if (debug_info()->recording_non_safepoints()) { | 1085 if (debug_info()->recording_non_safepoints()) { |
1068 set_node_note_array(new(comp_arena()) GrowableArray<Node_Notes*> | 1086 set_node_note_array(new(comp_arena()) GrowableArray<Node_Notes*> |
1069 (comp_arena(), 8, 0, NULL)); | 1087 (comp_arena(), 8, 0, NULL)); |
1070 set_default_node_notes(Node_Notes::make(this)); | 1088 set_default_node_notes(Node_Notes::make(this)); |
1071 } | 1089 } |
2563 case Op_CmpD3: | 2581 case Op_CmpD3: |
2564 frc.inc_double_count(); | 2582 frc.inc_double_count(); |
2565 break; | 2583 break; |
2566 case Op_Opaque1: // Remove Opaque Nodes before matching | 2584 case Op_Opaque1: // Remove Opaque Nodes before matching |
2567 case Op_Opaque2: // Remove Opaque Nodes before matching | 2585 case Op_Opaque2: // Remove Opaque Nodes before matching |
2586 case Op_Opaque3: | |
2568 n->subsume_by(n->in(1), this); | 2587 n->subsume_by(n->in(1), this); |
2569 break; | 2588 break; |
2570 case Op_CallStaticJava: | 2589 case Op_CallStaticJava: |
2571 case Op_CallJava: | 2590 case Op_CallJava: |
2572 case Op_CallDynamicJava: | 2591 case Op_CallDynamicJava: |