src/share/vm/compiler/oopMap.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/compiler/oopMap.hpp	Wed Sep 16 15:18:29 2015
--- new/src/share/vm/compiler/oopMap.hpp	Wed Sep 16 15:18:29 2015

*** 186,195 **** --- 186,197 ---- int heap_size() const; void copy_data_to(address addr) const; OopMap* deep_copy(); + bool has_derived_pointer() const PRODUCT_RETURN0; + bool legal_vm_reg_name(VMReg local) { return OopMapValue::legal_vm_reg_name(local); } // Printing
*** 352,368 **** --- 354,439 ---- #ifdef ASSERT int stream_position() const { return _stream->position(); } #endif }; + class ImmutableOopMapBuilder { + private: + class Mapping; + + private: + const OopMapSet* _set; + const OopMap* _empty; + const OopMap* _last; + int _empty_offset; + int _last_offset; + int _offset; + int _required; + Mapping* _mapping; + ImmutableOopMapSet* _new_set; + + /* Used for bookkeeping when building ImmutableOopMaps */ + class Mapping : public ResourceObj { + public: + enum kind_t { OOPMAP_UNKNOWN = 0, OOPMAP_NEW = 1, OOPMAP_EMPTY = 2, OOPMAP_DUPLICATE = 3 }; + + kind_t _kind; + int _offset; + int _size; + const OopMap* _map; + const OopMap* _other; + + Mapping() : _kind(OOPMAP_UNKNOWN), _offset(-1), _size(-1), _map(NULL) {} + + void set(kind_t kind, int offset, int size, const OopMap* map = 0, const OopMap* other = 0) { + _kind = kind; + _offset = offset; + _size = size; + _map = map; + _other = other; + } + }; + + public: + ImmutableOopMapBuilder(const OopMapSet* set); + + int heap_size(); + ImmutableOopMapSet* build(); + ImmutableOopMapSet* generate_into(address buffer); + private: + bool is_empty(const OopMap* map) const { + return map->count() == 0; + } + + bool is_last_duplicate(const OopMap* map) { + if (_last != NULL && _last->count() > 0 && _last->equals(map)) { + return true; + } + return false; + } + + #ifdef ASSERT + void verify(address buffer, int size, const ImmutableOopMapSet* set); + #endif + + bool has_empty() const { + return _empty_offset != -1; + } + + int size_for(const OopMap* map) const; + void fill_pair(ImmutableOopMapPair* pair, const OopMap* map, int offset, const ImmutableOopMapSet* set); + int fill_map(ImmutableOopMapPair* pair, const OopMap* map, int offset, const ImmutableOopMapSet* set); + void fill(ImmutableOopMapSet* set, int size); + }; + // Derived pointer support. This table keeps track of all derived points on a // stack. It is cleared before each scavenge/GC. During the traversal of all // oops, it is filled in with references to all locations that contains a // derived oop (assumed to be very few). When the GC is complete, the derived // pointers are updated based on their base pointers new value and an offset. ! #ifdef COMPILER2 ! #if defined(COMPILER2) || INCLUDE_JVMCI class DerivedPointerTable : public AllStatic { friend class VMStructs; private: static GrowableArray<DerivedPointerEntry*>* _list; static bool _active; // do not record pointers for verify pass etc.
*** 394,401 **** --- 465,472 ---- if (_active) { DerivedPointerTable::set_active(true); } } }; ! #endif // COMPILER2 || JVMCI #endif // SHARE_VM_COMPILER_OOPMAP_HPP

src/share/vm/compiler/oopMap.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File