src/share/vm/prims/forte.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8004128_2 Sdiff src/share/vm/prims

src/share/vm/prims/forte.cpp

Print this page




 217     // The frame code should completely validate the frame so that
 218     // references to Method* and bci are completely safe to access
 219     // If they aren't the frame code should be fixed not this
 220     // code. However since gc isn't locked out the values could be
 221     // stale. This is a race we can never completely win since we can't
 222     // lock out gc so do one last check after retrieving their values
 223     // from the frame for additional safety
 224 
 225     Method* method = fr->interpreter_frame_method();
 226 
 227     // We've at least found a method.
 228     // NOTE: there is something to be said for the approach that
 229     // if we don't find a valid bci then the method is not likely
 230     // a valid method. Then again we may have caught an interpreter
 231     // frame in the middle of construction and the bci field is
 232     // not yet valid.
 233 
 234     *method_p = method;
 235     if (!method->is_valid_method()) return false;
 236 
 237     intptr_t bcx = fr->interpreter_frame_bcx();
 238 
 239     int      bci = method->validate_bci_from_bcx(bcx);
 240 
 241     // note: bci is set to -1 if not a valid bci
 242     *bci_p = bci;
 243     return true;
 244   }
 245 
 246   return false;
 247 }
 248 
 249 
 250 // Determine if 'fr' can be used to find an initial Java frame.
 251 // Return false if it can not find a fully decipherable Java frame
 252 // (in other words a frame that isn't safe to use in a vframe stream).
 253 // Obviously if it can't even find a Java frame false will also be returned.
 254 //
 255 // If we find a Java frame decipherable or not then by definition we have
 256 // identified a method and that will be returned to the caller via method_p.
 257 // If we can determine a bci that is returned also. (Hmm is it possible
 258 // to return a method and bci and still return false? )
 259 //




 217     // The frame code should completely validate the frame so that
 218     // references to Method* and bci are completely safe to access
 219     // If they aren't the frame code should be fixed not this
 220     // code. However since gc isn't locked out the values could be
 221     // stale. This is a race we can never completely win since we can't
 222     // lock out gc so do one last check after retrieving their values
 223     // from the frame for additional safety
 224 
 225     Method* method = fr->interpreter_frame_method();
 226 
 227     // We've at least found a method.
 228     // NOTE: there is something to be said for the approach that
 229     // if we don't find a valid bci then the method is not likely
 230     // a valid method. Then again we may have caught an interpreter
 231     // frame in the middle of construction and the bci field is
 232     // not yet valid.
 233 
 234     *method_p = method;
 235     if (!method->is_valid_method()) return false;
 236 
 237     address bcp = fr->interpreter_frame_bcp();
 238     int bci = method->validate_bci_from_bcp(bcp);

 239 
 240     // note: bci is set to -1 if not a valid bci
 241     *bci_p = bci;
 242     return true;
 243   }
 244 
 245   return false;
 246 }
 247 
 248 
 249 // Determine if 'fr' can be used to find an initial Java frame.
 250 // Return false if it can not find a fully decipherable Java frame
 251 // (in other words a frame that isn't safe to use in a vframe stream).
 252 // Obviously if it can't even find a Java frame false will also be returned.
 253 //
 254 // If we find a Java frame decipherable or not then by definition we have
 255 // identified a method and that will be returned to the caller via method_p.
 256 // If we can determine a bci that is returned also. (Hmm is it possible
 257 // to return a method and bci and still return false? )
 258 //


src/share/vm/prims/forte.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File