comparison src/share/vm/interpreter/interpreter.cpp @ 3249:e1162778c1c8

7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error Summary: A referent object that is only weakly reachable at the start of concurrent marking but is re-attached to the strongly reachable object graph during marking may not be marked as live. This can cause the reference object to be processed prematurely and leave dangling pointers to the referent object. Implement a read barrier for the java.lang.ref.Reference::referent field by intrinsifying the Reference.get() method, and intercepting accesses though JNI, reflection, and Unsafe, so that when a non-null referent object is read it is also logged in an SATB buffer. Reviewed-by: kvn, iveresov, never, tonyp, dholmes
author johnc
date Thu, 07 Apr 2011 09:53:20 -0700
parents 3582bf76420e
children a03f3fd16b22 6759698e3140
comparison
equal deleted inserted replaced
3248:e6beb62de02d 3249:e1162778c1c8
206 // Empty method? 206 // Empty method?
207 if (m->is_empty_method()) { 207 if (m->is_empty_method()) {
208 return empty; 208 return empty;
209 } 209 }
210 210
211 // Accessor method?
212 if (m->is_accessor()) {
213 assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1");
214 return accessor;
215 }
216
217 // Special intrinsic method? 211 // Special intrinsic method?
218 // Note: This test must come _after_ the test for native methods, 212 // Note: This test must come _after_ the test for native methods,
219 // otherwise we will run into problems with JDK 1.2, see also 213 // otherwise we will run into problems with JDK 1.2, see also
220 // AbstractInterpreterGenerator::generate_method_entry() for 214 // AbstractInterpreterGenerator::generate_method_entry() for
221 // for details. 215 // for details.
225 case vmIntrinsics::_dtan : return java_lang_math_tan ; 219 case vmIntrinsics::_dtan : return java_lang_math_tan ;
226 case vmIntrinsics::_dabs : return java_lang_math_abs ; 220 case vmIntrinsics::_dabs : return java_lang_math_abs ;
227 case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ; 221 case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ;
228 case vmIntrinsics::_dlog : return java_lang_math_log ; 222 case vmIntrinsics::_dlog : return java_lang_math_log ;
229 case vmIntrinsics::_dlog10: return java_lang_math_log10; 223 case vmIntrinsics::_dlog10: return java_lang_math_log10;
224
225 case vmIntrinsics::_Reference_get:
226 return java_lang_ref_reference_get;
227 }
228
229 // Accessor method?
230 if (m->is_accessor()) {
231 assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1");
232 return accessor;
230 } 233 }
231 234
232 // Note: for now: zero locals for all non-empty methods 235 // Note: for now: zero locals for all non-empty methods
233 return zerolocals; 236 return zerolocals;
234 } 237 }