< prev index next >

src/share/vm/runtime/vframe.cpp

Print this page




 383 
 384 StackValueCollection* interpretedVFrame::expressions() const {
 385   return stack_data(true);
 386 }
 387 
 388 /*
 389  * Worker routine for fetching references and/or values
 390  * for a particular bci in the interpretedVFrame.
 391  *
 392  * Returns data for either "locals" or "expressions",
 393  * using bci relative oop_map (oop_mask) information.
 394  *
 395  * @param expressions  bool switch controlling what data to return
 396                        (false == locals / true == expression)
 397  *
 398  */
 399 StackValueCollection* interpretedVFrame::stack_data(bool expressions) const {
 400 
 401   InterpreterOopMap oop_mask;
 402   // oopmap for current bci
 403   if (TraceDeoptimization && Verbose) {
 404     methodHandle m_h(Thread::current(), method());
 405     OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
 406   } else {
 407     method()->mask_for(bci(), &oop_mask);
 408   }
 409 
 410   const int mask_len = oop_mask.number_of_entries();
 411 
 412   // If the method is native, method()->max_locals() is not telling the truth.
 413   // For our purposes, max locals instead equals the size of parameters.
 414   const int max_locals = method()->is_native() ?
 415     method()->size_of_parameters() : method()->max_locals();
 416 
 417   assert(mask_len >= max_locals, "invariant");
 418 
 419   const int length = expressions ? mask_len - max_locals : max_locals;
 420   assert(length >= 0, "invariant");
 421 
 422   StackValueCollection* const result = new StackValueCollection(length);
 423 




 383 
 384 StackValueCollection* interpretedVFrame::expressions() const {
 385   return stack_data(true);
 386 }
 387 
 388 /*
 389  * Worker routine for fetching references and/or values
 390  * for a particular bci in the interpretedVFrame.
 391  *
 392  * Returns data for either "locals" or "expressions",
 393  * using bci relative oop_map (oop_mask) information.
 394  *
 395  * @param expressions  bool switch controlling what data to return
 396                        (false == locals / true == expression)
 397  *
 398  */
 399 StackValueCollection* interpretedVFrame::stack_data(bool expressions) const {
 400 
 401   InterpreterOopMap oop_mask;
 402   // oopmap for current bci
 403   if ((TraceDeoptimization && Verbose) JVMCI_ONLY( || PrintDeoptimizationDetails)) {
 404     methodHandle m_h(Thread::current(), method());
 405     OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
 406   } else {
 407     method()->mask_for(bci(), &oop_mask);
 408   }
 409 
 410   const int mask_len = oop_mask.number_of_entries();
 411 
 412   // If the method is native, method()->max_locals() is not telling the truth.
 413   // For our purposes, max locals instead equals the size of parameters.
 414   const int max_locals = method()->is_native() ?
 415     method()->size_of_parameters() : method()->max_locals();
 416 
 417   assert(mask_len >= max_locals, "invariant");
 418 
 419   const int length = expressions ? mask_len - max_locals : max_locals;
 420   assert(length >= 0, "invariant");
 421 
 422   StackValueCollection* const result = new StackValueCollection(length);
 423 


< prev index next >