< prev index next >

src/hotspot/share/utilities/growableArray.hpp

Print this page
rev 49250 : [mq]: JDK-8199781.patch

*** 24,33 **** --- 24,34 ---- #ifndef SHARE_VM_UTILITIES_GROWABLEARRAY_HPP #define SHARE_VM_UTILITIES_GROWABLEARRAY_HPP #include "memory/allocation.hpp" + #include "oops/oop.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" // A growable array.
*** 209,218 **** --- 210,228 ---- bool is_full() const { return _len == _max; } DEBUG_ONLY(E* data_addr() const { return _data; }) void print(); + inline static bool safe_equals(oop obj1, oop obj2) { + return oopDesc::equals(obj1, obj2); + } + + template <class X> + inline static bool safe_equals(X i1, X i2) { + return i1 == i2; + } + int append(const E& elem) { check_nesting(); if (_len == _max) grow(_len); int idx = _len++; _data[idx] = elem;
*** 293,303 **** raw_at_put_grow(i, elem, fill); } bool contains(const E& elem) const { for (int i = 0; i < _len; i++) { ! if (_data[i] == elem) return true; } return false; } int find(const E& elem) const { --- 303,313 ---- raw_at_put_grow(i, elem, fill); } bool contains(const E& elem) const { for (int i = 0; i < _len; i++) { ! if (safe_equals(_data[i], elem)) return true; } return false; } int find(const E& elem) const {
< prev index next >