2136 return;
2137 }
2138
2139 const TypeInstPtr* itype = btype->isa_instptr();
2140 if (itype != NULL) {
2141 // Can the klass of base_oop be statically determined
2142 // to be _not_ a sub-class of Reference?
2143 ciKlass* klass = itype->klass();
2144 if (klass->is_subtype_of(env()->Reference_klass()) &&
2145 !env()->Reference_klass()->is_subtype_of(klass)) {
2146 return;
2147 }
2148 }
2149 }
2150
2151 // The compile time filters did not reject base_oop/offset so
2152 // we need to generate the following runtime filters
2153 //
2154 // if (offset == java_lang_ref_Reference::_reference_offset) {
2155 // if (base != null) {
2156 // if (klass(base)->reference_type() != REF_NONE)) {
2157 // pre_barrier(_, pre_val, ...);
2158 // }
2159 // }
2160 // }
2161
2162 float likely = PROB_LIKELY(0.999);
2163 float unlikely = PROB_UNLIKELY(0.999);
2164
2165 IdealKit ideal(this);
2166 #define __ ideal.
2167
2168 const int reference_type_offset = in_bytes(instanceKlass::reference_type_offset());
2169
2170 Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset);
2171
2172 __ if_then(offset, BoolTest::eq, referent_off, unlikely); {
2173 __ if_then(base_oop, BoolTest::ne, null(), likely); {
2174
2175 // Update graphKit memory and control from IdealKit.
2176 sync_kit(ideal);
2177
2178 Node* ref_klass_con = makecon(TypeKlassPtr::make(env()->Reference_klass()));
2179 Node* is_instof = gen_instanceof(base_oop, ref_klass_con);
2180
2181 // Update IdealKit memory and control from graphKit.
2182 __ sync_kit(this);
2183
2184 Node* one = __ ConI(1);
2185
2186 __ if_then(is_instof, BoolTest::eq, one, unlikely); {
2187
2188 // Update graphKit from IdeakKit.
2189 sync_kit(ideal);
|
2136 return;
2137 }
2138
2139 const TypeInstPtr* itype = btype->isa_instptr();
2140 if (itype != NULL) {
2141 // Can the klass of base_oop be statically determined
2142 // to be _not_ a sub-class of Reference?
2143 ciKlass* klass = itype->klass();
2144 if (klass->is_subtype_of(env()->Reference_klass()) &&
2145 !env()->Reference_klass()->is_subtype_of(klass)) {
2146 return;
2147 }
2148 }
2149 }
2150
2151 // The compile time filters did not reject base_oop/offset so
2152 // we need to generate the following runtime filters
2153 //
2154 // if (offset == java_lang_ref_Reference::_reference_offset) {
2155 // if (base != null) {
2156 // if (instance_of(base, java.lang.ref.Reference)) {
2157 // pre_barrier(_, pre_val, ...);
2158 // }
2159 // }
2160 // }
2161
2162 float likely = PROB_LIKELY(0.999);
2163 float unlikely = PROB_UNLIKELY(0.999);
2164
2165 IdealKit ideal(this);
2166 #define __ ideal.
2167
2168 Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset);
2169
2170 __ if_then(offset, BoolTest::eq, referent_off, unlikely); {
2171 __ if_then(base_oop, BoolTest::ne, null(), likely); {
2172
2173 // Update graphKit memory and control from IdealKit.
2174 sync_kit(ideal);
2175
2176 Node* ref_klass_con = makecon(TypeKlassPtr::make(env()->Reference_klass()));
2177 Node* is_instof = gen_instanceof(base_oop, ref_klass_con);
2178
2179 // Update IdealKit memory and control from graphKit.
2180 __ sync_kit(this);
2181
2182 Node* one = __ ConI(1);
2183
2184 __ if_then(is_instof, BoolTest::eq, one, unlikely); {
2185
2186 // Update graphKit from IdeakKit.
2187 sync_kit(ideal);
|