src/share/vm/compiler/compilerDirectives.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/compiler/compilerDirectives.cpp
src/share/vm/compiler/compilerDirectives.cpp
Print this page
rev 9918 : 8145331: SEGV in DirectivesStack::release(DirectiveSet*)
Summary: getDefaultDirective was not updated in 8144873
Reviewed-by:
*** 162,185 ****
return _ref_count;
}
DirectiveSet* CompilerDirectives::get_for(AbstractCompiler *comp) {
assert(DirectivesStack_lock->owned_by_self(), "");
- inc_refcount(); // The compiling thread is responsible to decrement this when finished.
if (comp == NULL) { // Xint
return _c1_store;
} else if (comp->is_c2()) {
return _c2_store;
! } else if (comp->is_c1()) {
return _c1_store;
- } else if (comp->is_shark()) {
- return NULL;
- } else if (comp->is_jvmci()) {
- return NULL;
}
- ShouldNotReachHere();
- return NULL;
}
// In the list of disabled intrinsics, the ID of the disabled intrinsics can separated:
// - by ',' (if -XX:DisableIntrinsic is used once when invoking the VM) or
// - by '\n' (if -XX:DisableIntrinsic is used multiple times when invoking the VM) or
--- 162,180 ----
return _ref_count;
}
DirectiveSet* CompilerDirectives::get_for(AbstractCompiler *comp) {
assert(DirectivesStack_lock->owned_by_self(), "");
if (comp == NULL) { // Xint
return _c1_store;
} else if (comp->is_c2()) {
return _c2_store;
! } else {
! // use c1_store as default
! assert(comp->is_c1() || comp->is_jvmci() || comp->is_shark(), "");
return _c1_store;
}
}
// In the list of disabled intrinsics, the ID of the disabled intrinsics can separated:
// - by ',' (if -XX:DisableIntrinsic is used once when invoking the VM) or
// - by '\n' (if -XX:DisableIntrinsic is used multiple times when invoking the VM) or
*** 457,466 ****
--- 452,462 ----
DirectiveSet* DirectivesStack::getDefaultDirective(AbstractCompiler* comp) {
MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag);
assert(_bottom != NULL, "Must never be empty");
+ _bottom->inc_refcount();
return _bottom->get_for(comp);
}
void DirectivesStack::push(CompilerDirectives* directive) {
MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag);
*** 519,534 ****
st->cr();
}
}
void DirectivesStack::release(DirectiveSet* set) {
MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag);
if (set->is_exclusive_copy()) {
// Old CompilecCmmands forced us to create an exclusive copy
delete set;
} else {
! assert(set->directive() != NULL, "");
release(set->directive());
}
}
--- 515,531 ----
st->cr();
}
}
void DirectivesStack::release(DirectiveSet* set) {
+ assert(set != NULL, "Never NULL");
MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag);
if (set->is_exclusive_copy()) {
// Old CompilecCmmands forced us to create an exclusive copy
delete set;
} else {
! assert(set->directive() != NULL, "Never NULL");
release(set->directive());
}
}
*** 551,578 ****
assert(dir != NULL, "Must be initialized");
while (dir != NULL) {
if (dir->is_default_directive() || dir->match(method)) {
match = dir->get_for(comp);
! if (match == NULL) {
! // temporary workaround for compilers without directives.
! if (dir->is_default_directive()) {
! // default dir is always enabled
! // match c1 store - it contains all common flags even if C1 is unavailable
! match = dir->_c1_store;
! break;
! }
! } else {
if (match->EnableOption) {
// The directiveSet for this compile is also enabled -> success
break;
}
}
- }
dir = dir->next();
}
}
-
guarantee(match != NULL, "There should always be a default directive that matches");
// Check for legacy compile commands update, without DirectivesStack_lock
return match->compilecommand_compatibility_init(method);
}
--- 548,567 ----
assert(dir != NULL, "Must be initialized");
while (dir != NULL) {
if (dir->is_default_directive() || dir->match(method)) {
match = dir->get_for(comp);
! assert(match != NULL, "Consistency");
if (match->EnableOption) {
// The directiveSet for this compile is also enabled -> success
+ dir->inc_refcount();
break;
}
}
dir = dir->next();
}
}
guarantee(match != NULL, "There should always be a default directive that matches");
+
// Check for legacy compile commands update, without DirectivesStack_lock
return match->compilecommand_compatibility_init(method);
}
src/share/vm/compiler/compilerDirectives.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File