8156548: gc/gctests/StringInternSyncWithGC2 fails with Test level exit status: 151

Avoid repeated verification.

Reviewed-by: jmasa, drwhite
This commit is contained in:
Kim Barrett 2016-05-25 13:46:05 -04:00
parent f1c490f5fa
commit 83dbb0faba
5 changed files with 26 additions and 20 deletions

View file

@ -6096,19 +6096,23 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m(
size = CompactibleFreeListSpace::adjustObjectSize( size = CompactibleFreeListSpace::adjustObjectSize(
p->oop_iterate_size(_scanningClosure)); p->oop_iterate_size(_scanningClosure));
} }
#ifdef ASSERT #ifdef ASSERT
size_t direct_size = size_t direct_size =
CompactibleFreeListSpace::adjustObjectSize(p->size()); CompactibleFreeListSpace::adjustObjectSize(p->size());
assert(size == direct_size, "Inconsistency in size"); assert(size == direct_size, "Inconsistency in size");
assert(size >= 3, "Necessary for Printezis marks to work"); assert(size >= 3, "Necessary for Printezis marks to work");
if (!_bitMap->isMarked(addr+1)) { HeapWord* start_pbit = addr + 1;
_bitMap->verifyNoOneBitsInRange(addr+2, addr+size); HeapWord* end_pbit = addr + size - 1;
} else { assert(_bitMap->isMarked(start_pbit) == _bitMap->isMarked(end_pbit),
_bitMap->verifyNoOneBitsInRange(addr+2, addr+size-1); "inconsistent Printezis mark");
assert(_bitMap->isMarked(addr+size-1), // Verify inner mark bits (between Printezis bits) are clear,
"inconsistent Printezis mark"); // but don't repeat if there are multiple dirty regions for
} // the same object, to avoid potential O(N^2) performance.
#endif // ASSERT if (addr != _last_scanned_object) {
_bitMap->verifyNoOneBitsInRange(start_pbit + 1, end_pbit);
_last_scanned_object = addr;
}
#endif // ASSERT
} else { } else {
// An uninitialized object. // An uninitialized object.
assert(_bitMap->isMarked(addr+1), "missing Printezis mark?"); assert(_bitMap->isMarked(addr+1), "missing Printezis mark?");

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1501,6 +1501,7 @@ class ScanMarkedObjectsAgainCarefullyClosure: public ObjectClosureCareful {
CMSBitMap* _bitMap; CMSBitMap* _bitMap;
CMSMarkStack* _markStack; CMSMarkStack* _markStack;
MarkRefsIntoAndScanClosure* _scanningClosure; MarkRefsIntoAndScanClosure* _scanningClosure;
DEBUG_ONLY(HeapWord* _last_scanned_object;)
public: public:
ScanMarkedObjectsAgainCarefullyClosure(CMSCollector* collector, ScanMarkedObjectsAgainCarefullyClosure(CMSCollector* collector,
@ -1514,8 +1515,9 @@ class ScanMarkedObjectsAgainCarefullyClosure: public ObjectClosureCareful {
_yield(should_yield), _yield(should_yield),
_bitMap(bitMap), _bitMap(bitMap),
_markStack(markStack), _markStack(markStack),
_scanningClosure(cl) { _scanningClosure(cl)
} DEBUG_ONLY(COMMA _last_scanned_object(NULL))
{ }
void do_object(oop p) { void do_object(oop p) {
guarantee(false, "call do_object_careful instead"); guarantee(false, "call do_object_careful instead");

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -235,7 +235,6 @@ address PhaseMacroExpand::basictype2arraycopy(BasicType t,
return StubRoutines::select_arraycopy_function(t, aligned, disjoint, name, dest_uninitialized); return StubRoutines::select_arraycopy_function(t, aligned, disjoint, name, dest_uninitialized);
} }
#define COMMA ,
#define XTOP LP64_ONLY(COMMA top()) #define XTOP LP64_ONLY(COMMA top())
// Generate an optimized call to arraycopy. // Generate an optimized call to arraycopy.

View file

@ -163,8 +163,6 @@ extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
#define FP_SELECT(TypeName, intcode, fpcode) \ #define FP_SELECT(TypeName, intcode, fpcode) \
FP_SELECT_##TypeName(intcode, fpcode) FP_SELECT_##TypeName(intcode, fpcode)
#define COMMA ,
// Choose DT_RETURN_MARK macros based on the type: float/double -> void // Choose DT_RETURN_MARK macros based on the type: float/double -> void
// (dtrace doesn't do FP yet) // (dtrace doesn't do FP yet)
#define DT_RETURN_MARK_DECL_FOR(TypeName, name, type, probe) \ #define DT_RETURN_MARK_DECL_FOR(TypeName, name, type, probe) \

View file

@ -34,6 +34,9 @@
// Makes a string of the macro expansion of a // Makes a string of the macro expansion of a
#define XSTR(a) STR(a) #define XSTR(a) STR(a)
// Allow commas in macro arguments.
#define COMMA ,
// Apply pre-processor token pasting to the expansions of x and y. // Apply pre-processor token pasting to the expansions of x and y.
// The token pasting operator (##) prevents its arguments from being // The token pasting operator (##) prevents its arguments from being
// expanded. This macro allows expansion of its arguments before the // expanded. This macro allows expansion of its arguments before the