comparison src/cpu/x86/vm/cppInterpreter_x86.cpp @ 2346: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 638119ce7cfd
children 3d2ab563047a
comparison
equal deleted inserted replaced
11:bb8d372ec4b6 12:4efa8e6d2032
934 return NULL; 934 return NULL;
935 } 935 }
936 936
937 } 937 }
938 938
939 address InterpreterGenerator::generate_Reference_get_entry(void) {
940 #ifndef SERIALGC
941 if (UseG1GC) {
942 // We need to generate have a routine that generates code to:
943 // * load the value in the referent field
944 // * passes that value to the pre-barrier.
945 //
946 // In the case of G1 this will record the value of the
947 // referent in an SATB buffer if marking is active.
948 // This will cause concurrent marking to mark the referent
949 // field as live.
950 Unimplemented();
951 }
952 #endif // SERIALGC
953
954 // If G1 is not enabled then attempt to go through the accessor entry point
955 // Reference.get is an accessor
956 return generate_accessor_entry();
957 }
958
939 // 959 //
940 // C++ Interpreter stub for calling a native method. 960 // C++ Interpreter stub for calling a native method.
941 // This sets up a somewhat different looking stack for calling the native method 961 // This sets up a somewhat different looking stack for calling the native method
942 // than the typical interpreter frame setup but still has the pointer to 962 // than the typical interpreter frame setup but still has the pointer to
943 // an interpreter state. 963 // an interpreter state.
2208 case Interpreter::java_lang_math_tan : // fall thru 2228 case Interpreter::java_lang_math_tan : // fall thru
2209 case Interpreter::java_lang_math_abs : // fall thru 2229 case Interpreter::java_lang_math_abs : // fall thru
2210 case Interpreter::java_lang_math_log : // fall thru 2230 case Interpreter::java_lang_math_log : // fall thru
2211 case Interpreter::java_lang_math_log10 : // fall thru 2231 case Interpreter::java_lang_math_log10 : // fall thru
2212 case Interpreter::java_lang_math_sqrt : entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind); break; 2232 case Interpreter::java_lang_math_sqrt : entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind); break;
2233 case Interpreter::java_lang_ref_reference_get
2234 : entry_point = ((InterpreterGenerator*)this)->generate_Reference_get_entry(); break;
2213 default : ShouldNotReachHere(); break; 2235 default : ShouldNotReachHere(); break;
2214 } 2236 }
2215 2237
2216 if (entry_point) return entry_point; 2238 if (entry_point) return entry_point;
2217 2239