8141585: CompilerDirectivesDCMDTest intermittently SEGVs in MethodMatcher::matcher

Missing methodHandle and read before lock

Reviewed-by: twisti
This commit is contained in:
Nils Eliasson 2015-11-13 10:08:44 +01:00
parent 0092880b1f
commit 5ea0e0d066
2 changed files with 13 additions and 9 deletions

View file

@ -527,12 +527,14 @@ void DirectivesStack::release(CompilerDirectives* dir) {
DirectiveSet* DirectivesStack::getMatchingDirective(methodHandle method, AbstractCompiler *comp) {
assert(_depth > 0, "Must never be empty");
CompilerDirectives* dir = _top;
assert(dir != NULL, "Must be initialized");
DirectiveSet* match = NULL;
{
MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag);
CompilerDirectives* dir = _top;
assert(dir != NULL, "Must be initialized");
while (dir != NULL) {
if (dir->is_default_directive() || dir->match(method)) {
match = dir->get_for(comp);