< prev index next >

src/hotspot/share/opto/type.hpp

Print this page
@@ -190,10 +190,21 @@
  
    void assert_type_verify_empty() const NOT_DEBUG_RETURN;
  
  public:
  
+   // This is used as a marker to identify narrow Klass* loads, which
+   // are really extracted from the mark-word, but we still want to
+   // distinguish it.
+   static int klass_offset() {
+     if (UseCompactObjectHeaders) {
+       return 1;
+     } else {
+       return oopDesc::klass_offset_in_bytes();
+     }
+   }
+ 
    inline void* operator new( size_t x ) throw() {
      Compile* compile = Compile::current();
      compile->set_type_last_size(x);
      return compile->type_arena()->AmallocWords(x);
    }

@@ -1387,11 +1398,11 @@
      int dummy;
      bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
  
      if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
          _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
-         _offset != arrayOopDesc::klass_offset_in_bytes()) {
+         _offset != Type::klass_offset()) {
        _is_ptr_to_narrowoop = true;
      }
  
    }
    virtual bool eq( const Type *t ) const;
< prev index next >