2163 // The compile time filters did not reject base_oop/offset so
2164 // we need to generate the following runtime filters
2165 //
2166 // if (offset == java_lang_ref_Reference::_reference_offset) {
2167 // if (base != null) {
2168 // if (klass(base)->reference_type() != REF_NONE)) {
2169 // pre_barrier(_, pre_val, ...);
2170 // }
2171 // }
2172 // }
2173
2174 float likely = PROB_LIKELY(0.999);
2175 float unlikely = PROB_UNLIKELY(0.999);
2176
2177 IdealKit ideal(gvn(), control(), merged_memory());
2178 #define __ ideal.
2179
2180 const int reference_type_offset = instanceKlass::reference_type_offset_in_bytes() +
2181 sizeof(oopDesc);
2182
2183 Node* referent_off = __ ConI(java_lang_ref_Reference::referent_offset);
2184
2185 __ if_then(offset, BoolTest::eq, referent_off, unlikely); {
2186 __ if_then(base_oop, BoolTest::ne, null(), likely); {
2187
2188 // Update graphKit memory and control from IdealKit.
2189 set_all_memory(__ merged_memory());
2190 set_control(__ ctrl());
2191
2192 Node* ref_klass_con = makecon(TypeKlassPtr::make(env()->Reference_klass()));
2193 Node* is_instof = gen_instanceof(base_oop, ref_klass_con);
2194
2195 // Update IdealKit memory and control from graphKit.
2196 __ set_all_memory(merged_memory());
2197 __ set_ctrl(control());
2198
2199 Node* one = __ ConI(1);
2200
2201 __ if_then(is_instof, BoolTest::eq, one, unlikely); {
2202
2203 // Update graphKit from IdeakKit.
|
2163 // The compile time filters did not reject base_oop/offset so
2164 // we need to generate the following runtime filters
2165 //
2166 // if (offset == java_lang_ref_Reference::_reference_offset) {
2167 // if (base != null) {
2168 // if (klass(base)->reference_type() != REF_NONE)) {
2169 // pre_barrier(_, pre_val, ...);
2170 // }
2171 // }
2172 // }
2173
2174 float likely = PROB_LIKELY(0.999);
2175 float unlikely = PROB_UNLIKELY(0.999);
2176
2177 IdealKit ideal(gvn(), control(), merged_memory());
2178 #define __ ideal.
2179
2180 const int reference_type_offset = instanceKlass::reference_type_offset_in_bytes() +
2181 sizeof(oopDesc);
2182
2183 Node* referent_off;
2184
2185 if (offset->bottom_type()->isa_int() != NULL) {
2186 referent_off = __ makecon(TypeInt::make(java_lang_ref_Reference::referent_offset));
2187 } else {
2188 assert(offset->bottom_type()->isa_long() != NULL, "what else?");
2189 referent_off = __ makecon(TypeLong::make(java_lang_ref_Reference::referent_offset));
2190 }
2191
2192 __ if_then(offset, BoolTest::eq, referent_off, unlikely); {
2193 __ if_then(base_oop, BoolTest::ne, null(), likely); {
2194
2195 // Update graphKit memory and control from IdealKit.
2196 set_all_memory(__ merged_memory());
2197 set_control(__ ctrl());
2198
2199 Node* ref_klass_con = makecon(TypeKlassPtr::make(env()->Reference_klass()));
2200 Node* is_instof = gen_instanceof(base_oop, ref_klass_con);
2201
2202 // Update IdealKit memory and control from graphKit.
2203 __ set_all_memory(merged_memory());
2204 __ set_ctrl(control());
2205
2206 Node* one = __ ConI(1);
2207
2208 __ if_then(is_instof, BoolTest::eq, one, unlikely); {
2209
2210 // Update graphKit from IdeakKit.
|