--- a/src/hotspot/share/libadt/set.hpp Thu Sep 20 22:01:12 2018 +0200
+++ b/src/hotspot/share/libadt/set.hpp Thu Oct 17 11:07:24 2019 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
*
*/
-#ifndef SHARE_VM_LIBADT_SET_HPP
-#define SHARE_VM_LIBADT_SET_HPP
+#ifndef SHARE_LIBADT_SET_HPP
+#define SHARE_LIBADT_SET_HPP
#include "memory/allocation.hpp"
@@ -112,16 +112,15 @@
//------------------------------Set--------------------------------------------
class Set : public ResourceObj {
- public:
+ protected:
// Creates a new, empty set.
- // DO NOT CONSTRUCT A Set. THIS IS AN ABSTRACT CLASS, FOR INHERITENCE ONLY
Set(Arena *arena) : _set_arena(arena) {};
// Creates a new set from an existing set
- // DO NOT CONSTRUCT A Set. THIS IS AN ABSTRACT CLASS, FOR INHERITENCE ONLY
- Set(const Set &s) : ResourceObj(s) {};
+ Set(const Set & s) : ResourceObj(s) {};
+ public:
// Set assignment; deep-copy guts
virtual Set &operator =(const Set &s)=0;
virtual Set &clone(void) const=0;
@@ -165,9 +164,6 @@
virtual int operator <=(const Set &s) const=0;
int operator >=(const Set &s) const { return s <= *this; }
- // Return any member of the Set. Undefined if the Set is empty.
- virtual uint getelem(void) const=0;
-
// Clear all the elements in the Set
virtual void Clear(void)=0;
@@ -189,15 +185,7 @@
virtual int parse(const char *s);
// Convert a generic Set to a specific Set
- /* Removed for MCC BUG
- virtual operator const SparseSet* (void) const;
- virtual operator const VectorSet* (void) const;
- virtual operator const ListSet * (void) const;
- virtual operator const CoSet * (void) const; */
- virtual const SparseSet *asSparseSet(void) const;
virtual const VectorSet *asVectorSet(void) const;
- virtual const ListSet *asListSet (void) const;
- virtual const CoSet *asCoSet (void) const;
// Hash the set. Sets of different types but identical elements will NOT
// hash the same. Same set type, same elements WILL hash the same.
@@ -205,16 +193,11 @@
protected:
friend class SetI;
- friend class CoSet;
virtual class SetI_ *iterate(uint&) const=0;
// Need storeage for the set
Arena *_set_arena;
};
-typedef Set&((*Set_Constructor)(Arena *arena));
-extern Set &ListSet_Construct(Arena *arena);
-extern Set &VectorSet_Construct(Arena *arena);
-extern Set &SparseSet_Construct(Arena *arena);
//------------------------------Iteration--------------------------------------
// Loop thru all elements of the set, setting "elem" to the element numbers
@@ -245,4 +228,4 @@
int test(void) { return impl->test(); }
};
-#endif // SHARE_VM_LIBADT_SET_HPP
+#endif // SHARE_LIBADT_SET_HPP