hotspot/src/share/vm/utilities/fakeRttiSupport.hpp
changeset 33105 294e48b4f704
parent 31033 5b6d0c94767a
child 33198 b37ad9fbf681
equal deleted inserted replaced
33104:a7c0f60a1294 33105:294e48b4f704
    74   // has been added to the tag set.  The tag must not already be
    74   // has been added to the tag set.  The tag must not already be
    75   // present in the tag set.
    75   // present in the tag set.
    76   FakeRttiSupport add_tag(TagType tag) const {
    76   FakeRttiSupport add_tag(TagType tag) const {
    77     uintx tbit = tag_bit(tag);
    77     uintx tbit = tag_bit(tag);
    78     assert((_tag_set & tbit) == 0,
    78     assert((_tag_set & tbit) == 0,
    79            err_msg("Tag " UINTX_FORMAT " is already present in tag set: " UINTX_FORMAT,
    79            "Tag " UINTX_FORMAT " is already present in tag set: " UINTX_FORMAT,
    80                    (uintx)tag, _tag_set));
    80            (uintx)tag, _tag_set);
    81     return FakeRttiSupport(_concrete_tag, _tag_set | tbit);
    81     return FakeRttiSupport(_concrete_tag, _tag_set | tbit);
    82   }
    82   }
    83 
    83 
    84 private:
    84 private:
    85   uintx _tag_set;
    85   uintx _tag_set;
    88   static uintx tag_bit(TagType tag) {
    88   static uintx tag_bit(TagType tag) {
    89     return ((uintx)1) << validate_tag(tag);
    89     return ((uintx)1) << validate_tag(tag);
    90   }
    90   }
    91 
    91 
    92   static TagType validate_tag(TagType tag) {
    92   static TagType validate_tag(TagType tag) {
    93     assert(0 <= tag, err_msg("Tag " INTX_FORMAT " is negative", (intx)tag));
    93     assert(0 <= tag, "Tag " INTX_FORMAT " is negative", (intx)tag);
    94     assert(tag < BitsPerWord,
    94     assert(tag < BitsPerWord,
    95            err_msg("Tag " UINTX_FORMAT " is too large", (uintx)tag));
    95            "Tag " UINTX_FORMAT " is too large", (uintx)tag);
    96     return tag;
    96     return tag;
    97   }
    97   }
    98 };
    98 };
    99 
    99 
   100 #endif // include guard
   100 #endif // include guard