< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page




1927     // Might as well try to fill the cache for the flattened version, too.
1928     AliasCacheEntry* face = probe_alias_cache(flat);
1929     if (face->_adr_type == NULL) {
1930       face->_adr_type = flat;
1931       face->_index    = idx;
1932       assert(alias_type(flat) == alias_type(idx), "flat type must work too");
1933     }
1934   }
1935 
1936   return alias_type(idx);
1937 }
1938 
1939 
1940 Compile::AliasType* Compile::alias_type(ciField* field) {
1941   const TypeOopPtr* t;
1942   if (field->is_static())
1943     t = TypeInstPtr::make(field->holder()->java_mirror());
1944   else
1945     t = TypeOopPtr::make_from_klass_raw(field->holder());
1946   AliasType* atp = alias_type(t->add_offset(field->offset_in_bytes()), field);









1947   assert((field->is_final() || field->is_stable()) == !atp->is_rewritable(), "must get the rewritable bits correct");
1948   return atp;
1949 }
1950 
1951 
1952 //------------------------------have_alias_type--------------------------------
1953 bool Compile::have_alias_type(const TypePtr* adr_type) {
1954   AliasCacheEntry* ace = probe_alias_cache(adr_type);
1955   if (ace->_adr_type == adr_type) {
1956     return true;
1957   }
1958 
1959   // Handle special cases.
1960   if (adr_type == NULL)             return true;
1961   if (adr_type == TypePtr::BOTTOM)  return true;
1962 
1963   return find_alias_type(adr_type, true, NULL) != NULL;
1964 }
1965 
1966 //-----------------------------must_alias--------------------------------------




1927     // Might as well try to fill the cache for the flattened version, too.
1928     AliasCacheEntry* face = probe_alias_cache(flat);
1929     if (face->_adr_type == NULL) {
1930       face->_adr_type = flat;
1931       face->_index    = idx;
1932       assert(alias_type(flat) == alias_type(idx), "flat type must work too");
1933     }
1934   }
1935 
1936   return alias_type(idx);
1937 }
1938 
1939 
1940 Compile::AliasType* Compile::alias_type(ciField* field) {
1941   const TypeOopPtr* t;
1942   if (field->is_static())
1943     t = TypeInstPtr::make(field->holder()->java_mirror());
1944   else
1945     t = TypeOopPtr::make_from_klass_raw(field->holder());
1946   AliasType* atp = alias_type(t->add_offset(field->offset_in_bytes()), field);
1947   if(!((field->is_final() || field->is_stable()) == !atp->is_rewritable())) {
1948     ResourceMark rm;
1949     tty->print_cr("Problematic field: %s %s.%s",
1950         field->signature()->as_utf8(),
1951         field->holder()->name()->as_utf8(),
1952         field->name()->as_utf8());
1953     tty->print_cr("is_final = %d is_stable = %d is_rewritable = %d",
1954         field->is_final(), field->is_stable(), atp->is_rewritable());
1955   }
1956   assert((field->is_final() || field->is_stable()) == !atp->is_rewritable(), "must get the rewritable bits correct");
1957   return atp;
1958 }
1959 
1960 
1961 //------------------------------have_alias_type--------------------------------
1962 bool Compile::have_alias_type(const TypePtr* adr_type) {
1963   AliasCacheEntry* ace = probe_alias_cache(adr_type);
1964   if (ace->_adr_type == adr_type) {
1965     return true;
1966   }
1967 
1968   // Handle special cases.
1969   if (adr_type == NULL)             return true;
1970   if (adr_type == TypePtr::BOTTOM)  return true;
1971 
1972   return find_alias_type(adr_type, true, NULL) != NULL;
1973 }
1974 
1975 //-----------------------------must_alias--------------------------------------


< prev index next >