提交 c16a0d2c 编写于 作者: M mgerdin

7172226: HotSpot fails to build with GCC 4.7 because of stricter c++ argument dependent lookup

Summary: Add "using" keyword to import base class functions from FreeList<T> to fix template name lookup in gcc 4.7
Reviewed-by: brutisso, iveresov
上级 7adfe0cf
......@@ -230,7 +230,7 @@ void TreeList<Chunk>::return_chunk_at_tail(TreeChunk<Chunk>* chunk) {
link_tail(chunk);
assert(!tail() || size() == tail()->size(), "Wrong sized chunk in list");
FreeList<Chunk>::increment_count();
increment_count();
debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));)
assert(head() == NULL || head()->prev() == NULL, "list invariant");
assert(tail() == NULL || tail()->next() == NULL, "list invariant");
......@@ -258,7 +258,7 @@ void TreeList<Chunk>::return_chunk_at_head(TreeChunk<Chunk>* chunk) {
}
head()->link_after(chunk);
assert(!head() || size() == head()->size(), "Wrong sized chunk in list");
FreeList<Chunk>::increment_count();
increment_count();
debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));)
assert(head() == NULL || head()->prev() == NULL, "list invariant");
assert(tail() == NULL || tail()->next() == NULL, "list invariant");
......@@ -909,6 +909,7 @@ class TreeCensusClosure : public StackObj {
template <class Chunk>
class AscendTreeCensusClosure : public TreeCensusClosure<Chunk> {
using TreeCensusClosure<Chunk>::do_list;
public:
void do_tree(TreeList<Chunk>* tl) {
if (tl != NULL) {
......@@ -921,6 +922,7 @@ class AscendTreeCensusClosure : public TreeCensusClosure<Chunk> {
template <class Chunk>
class DescendTreeCensusClosure : public TreeCensusClosure<Chunk> {
using TreeCensusClosure<Chunk>::do_list;
public:
void do_tree(TreeList<Chunk>* tl) {
if (tl != NULL) {
......@@ -987,6 +989,7 @@ class AscendTreeSearchClosure : public TreeSearchClosure {
template <class Chunk>
class DescendTreeSearchClosure : public TreeSearchClosure<Chunk> {
using TreeSearchClosure<Chunk>::do_list;
public:
bool do_tree(TreeList<Chunk>* tl) {
if (tl != NULL) {
......
......@@ -60,13 +60,18 @@ class TreeList: public FreeList<Chunk> {
TreeList<Chunk>* left() const { return _left; }
TreeList<Chunk>* right() const { return _right; }
// Wrapper on call to base class, to get the template to compile.
Chunk* head() const { return FreeList<Chunk>::head(); }
Chunk* tail() const { return FreeList<Chunk>::tail(); }
void set_head(Chunk* head) { FreeList<Chunk>::set_head(head); }
void set_tail(Chunk* tail) { FreeList<Chunk>::set_tail(tail); }
size_t size() const { return FreeList<Chunk>::size(); }
// Explicitly import these names into our namespace to fix name lookup with templates
using FreeList<Chunk>::head;
using FreeList<Chunk>::set_head;
using FreeList<Chunk>::tail;
using FreeList<Chunk>::set_tail;
using FreeList<Chunk>::link_tail;
using FreeList<Chunk>::increment_count;
NOT_PRODUCT(using FreeList<Chunk>::increment_returned_bytes_by;)
using FreeList<Chunk>::verify_chunk_in_free_list;
using FreeList<Chunk>::size;
// Accessors for links in tree.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册