< prev index next >
src/share/vm/opto/type.cpp
Print this page
*** 26,35 ****
--- 26,36 ----
#include "ci/ciMethodData.hpp"
#include "ci/ciTypeFlow.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "compiler/compileLog.hpp"
+ #include "gc_implementation/shenandoah/shenandoahBrooksPointer.hpp"
#include "libadt/dict.hpp"
#include "memory/gcLocker.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/instanceKlass.hpp"
*** 2499,2508 ****
--- 2500,2511 ----
}
#ifdef _LP64
if (_offset != 0) {
if (_offset == oopDesc::klass_offset_in_bytes()) {
_is_ptr_to_narrowklass = UseCompressedClassPointers;
+ } else if (UseShenandoahGC && _offset == ShenandoahBrooksPointer::byte_offset()) {
+ // Shenandoah doesn't support compressed forwarding pointers
} else if (klass() == NULL) {
// Array with unknown body type
assert(this->isa_aryptr(), "only arrays without klass");
_is_ptr_to_narrowoop = UseCompressedOops;
} else if (this->isa_aryptr()) {
*** 2524,2534 ****
_offset == java_lang_Class::array_klass_offset_in_bytes())) {
// Special hidden fields from the Class.
assert(this->isa_instptr(), "must be an instance ptr.");
_is_ptr_to_narrowoop = false;
} else if (klass() == ciEnv::current()->Class_klass() &&
! _offset >= InstanceMirrorKlass::offset_of_static_fields()) {
// Static fields
assert(o != NULL, "must be constant");
ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
ciField* field = k->get_field_by_offset(_offset, true);
assert(field != NULL, "missing field");
--- 2527,2538 ----
_offset == java_lang_Class::array_klass_offset_in_bytes())) {
// Special hidden fields from the Class.
assert(this->isa_instptr(), "must be an instance ptr.");
_is_ptr_to_narrowoop = false;
} else if (klass() == ciEnv::current()->Class_klass() &&
! _offset >= InstanceMirrorKlass::offset_of_static_fields() &&
! !UseShenandoahGC) {
// Static fields
assert(o != NULL, "must be constant");
ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
ciField* field = k->get_field_by_offset(_offset, true);
assert(field != NULL, "missing field");
*** 2580,2589 ****
--- 2584,2597 ----
// There are no instances of a general oop.
// Return self unchanged.
return this;
}
+ const TypeOopPtr *TypeOopPtr::cast_to_nonconst() const {
+ return this;
+ }
+
//-----------------------------cast_to_exactness-------------------------------
const Type *TypeOopPtr::cast_to_exactness(bool klass_is_exact) const {
// There is no such thing as an exact general oop.
// Return self unchanged.
return this;
*** 3233,3242 ****
--- 3241,3255 ----
const TypeOopPtr *TypeInstPtr::cast_to_instance_id(int instance_id) const {
if( instance_id == _instance_id ) return this;
return make(_ptr, klass(), _klass_is_exact, const_oop(), _offset, instance_id, _speculative, _inline_depth);
}
+ const TypeOopPtr *TypeInstPtr::cast_to_nonconst() const {
+ if (const_oop() == NULL) return this;
+ return make(NotNull, klass(), _klass_is_exact, NULL, _offset, _instance_id, _speculative, _inline_depth);
+ }
+
//------------------------------xmeet_unloaded---------------------------------
// Compute the MEET of two InstPtrs when at least one is unloaded.
// Assume classes are different since called after check for same name/class-loader
const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst) const {
int off = meet_offset(tinst->offset());
*** 3751,3760 ****
--- 3764,3779 ----
const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const {
if( instance_id == _instance_id ) return this;
return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
}
+ const TypeOopPtr *TypeAryPtr::cast_to_nonconst() const {
+ if (const_oop() == NULL) return this;
+ return make(NotNull, NULL, _ary, klass(), _klass_is_exact, _offset, _instance_id, _speculative, _inline_depth);
+ }
+
+
//-----------------------------narrow_size_type-------------------------------
// Local cache for arrayOopDesc::max_array_length(etype),
// which is kind of slow (and cached elsewhere by other users).
static jint max_array_length_cache[T_CONFLICT+1];
static jint max_array_length(BasicType etype) {
< prev index next >