src/share/vm/runtime/vframe.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 













  25 // vframes are virtual stack frames representing source level activations.
  26 // A single frame may hold several source level activations in the case of
  27 // optimized code. The debugging stored with the optimized code enables
  28 // us to unfold a frame as a stack of vframes.
  29 // A cVFrame represents an activation of a non-java method.
  30 
  31 // The vframe inheritance hierarchy:
  32 // - vframe
  33 //   - javaVFrame
  34 //     - interpretedVFrame
  35 //     - compiledVFrame     ; (used for both compiled Java methods and native stubs)
  36 //   - externalVFrame
  37 //     - entryVFrame        ; special frame created when calling Java from C
  38 
  39 // - BasicLock
  40 
  41 class vframe: public ResourceObj {
  42  protected:
  43   frame        _fr;      // Raw frame behind the virtual frame.
  44   RegisterMap  _reg_map; // Register map for the raw frame (used to handle callee-saved registers).


 491     return true;
 492   }
 493 
 494   return false;
 495 }
 496 
 497 
 498 inline void vframeStreamCommon::fill_from_interpreter_frame() {
 499   methodOop method = _frame.interpreter_frame_method();
 500   intptr_t  bcx    = _frame.interpreter_frame_bcx();
 501   int       bci    = method->validate_bci_from_bcx(bcx);
 502   // 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
 503   if (bci < 0) {
 504     found_bad_method_frame();
 505     bci = 0;  // pretend it's on the point of entering
 506   }
 507   _mode   = interpreted_mode;
 508   _method = method;
 509   _bci    = bci;
 510 }


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_VFRAME_HPP
  26 #define SHARE_VM_RUNTIME_VFRAME_HPP
  27 
  28 #include "code/debugInfo.hpp"
  29 #include "code/debugInfoRec.hpp"
  30 #include "code/location.hpp"
  31 #include "oops/oop.hpp"
  32 #include "runtime/frame.hpp"
  33 #include "runtime/frame.inline.hpp"
  34 #include "runtime/stackValue.hpp"
  35 #include "runtime/stackValueCollection.hpp"
  36 #include "utilities/growableArray.hpp"
  37 
  38 // vframes are virtual stack frames representing source level activations.
  39 // A single frame may hold several source level activations in the case of
  40 // optimized code. The debugging stored with the optimized code enables
  41 // us to unfold a frame as a stack of vframes.
  42 // A cVFrame represents an activation of a non-java method.
  43 
  44 // The vframe inheritance hierarchy:
  45 // - vframe
  46 //   - javaVFrame
  47 //     - interpretedVFrame
  48 //     - compiledVFrame     ; (used for both compiled Java methods and native stubs)
  49 //   - externalVFrame
  50 //     - entryVFrame        ; special frame created when calling Java from C
  51 
  52 // - BasicLock
  53 
  54 class vframe: public ResourceObj {
  55  protected:
  56   frame        _fr;      // Raw frame behind the virtual frame.
  57   RegisterMap  _reg_map; // Register map for the raw frame (used to handle callee-saved registers).


 504     return true;
 505   }
 506 
 507   return false;
 508 }
 509 
 510 
 511 inline void vframeStreamCommon::fill_from_interpreter_frame() {
 512   methodOop method = _frame.interpreter_frame_method();
 513   intptr_t  bcx    = _frame.interpreter_frame_bcx();
 514   int       bci    = method->validate_bci_from_bcx(bcx);
 515   // 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
 516   if (bci < 0) {
 517     found_bad_method_frame();
 518     bci = 0;  // pretend it's on the point of entering
 519   }
 520   _mode   = interpreted_mode;
 521   _method = method;
 522   _bci    = bci;
 523 }
 524 
 525 #endif // SHARE_VM_RUNTIME_VFRAME_HPP