8031320: Use Intel RTM instructions for locks

Use RTM for inflated locks and stack locks.

Reviewed-by: iveresov, twisti, roland, dcubed
This commit is contained in:
Vladimir Kozlov 2014-03-20 17:49:27 -07:00
parent 315e4838e9
commit 97a51c5c2a
46 changed files with 1251 additions and 87 deletions

View file

@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "compiler/compilerOracle.hpp"
#include "interpreter/bytecode.hpp"
#include "interpreter/bytecodeStream.hpp"
#include "interpreter/linkResolver.hpp"
@ -1153,6 +1154,21 @@ void MethodData::init() {
_highest_osr_comp_level = 0;
_would_profile = true;
#if INCLUDE_RTM_OPT
_rtm_state = NoRTM; // No RTM lock eliding by default
if (UseRTMLocking &&
!CompilerOracle::has_option_string(_method, "NoRTMLockEliding")) {
if (CompilerOracle::has_option_string(_method, "UseRTMLockEliding") || !UseRTMDeopt) {
// Generate RTM lock eliding code without abort ratio calculation code.
_rtm_state = UseRTM;
} else if (UseRTMDeopt) {
// Generate RTM lock eliding code and include abort ratio calculation
// code if UseRTMDeopt is on.
_rtm_state = ProfileRTM;
}
}
#endif
// Initialize flags and trap history.
_nof_decompiles = 0;
_nof_overflow_recompiles = 0;