hotspot/src/share/vm/runtime/rframe.hpp
changeset 31521 f57b2ce43484
parent 13728 882756847a04
equal deleted inserted replaced
31520:4a6cbcae9f46 31521:f57b2ce43484
    58   int invocations() const                 { return _invocations; }
    58   int invocations() const                 { return _invocations; }
    59   int num() const                         { return _num; }
    59   int num() const                         { return _num; }
    60   frame fr() const                        { return _fr; }
    60   frame fr() const                        { return _fr; }
    61   JavaThread* thread() const              { return _thread; }
    61   JavaThread* thread() const              { return _thread; }
    62   virtual int cost() const = 0;           // estimated inlining cost (size)
    62   virtual int cost() const = 0;           // estimated inlining cost (size)
    63   virtual methodHandle top_method() const  = 0;
    63   virtual Method* top_method() const  = 0;
    64   virtual javaVFrame* top_vframe() const = 0;
    64   virtual javaVFrame* top_vframe() const = 0;
    65   virtual nmethod* nm() const             { ShouldNotCallThis(); return NULL; }
    65   virtual nmethod* nm() const             { ShouldNotCallThis(); return NULL; }
    66 
    66 
    67   RFrame* caller();
    67   RFrame* caller();
    68   RFrame* callee() const                  { return _callee; }
    68   RFrame* callee() const                  { return _callee; }
    77 
    77 
    78 class CompiledRFrame : public RFrame {    // frame containing a compiled method
    78 class CompiledRFrame : public RFrame {    // frame containing a compiled method
    79  protected:
    79  protected:
    80   nmethod*    _nm;
    80   nmethod*    _nm;
    81   javaVFrame* _vf;                        // top vframe; may be NULL (for most recent frame)
    81   javaVFrame* _vf;                        // top vframe; may be NULL (for most recent frame)
    82   methodHandle _method;                   // top method
    82   Method* _method;                        // top method
    83 
    83 
    84   CompiledRFrame(frame fr, JavaThread* thread, RFrame*const  callee);
    84   CompiledRFrame(frame fr, JavaThread* thread, RFrame*const  callee);
    85   void init();
    85   void init();
    86   friend class RFrame;
    86   friend class RFrame;
    87 
    87 
    88  public:
    88  public:
    89   CompiledRFrame(frame fr, JavaThread* thread); // for nmethod triggering its counter (callee == NULL)
    89   CompiledRFrame(frame fr, JavaThread* thread); // for nmethod triggering its counter (callee == NULL)
    90   bool is_compiled() const                 { return true; }
    90   bool is_compiled() const                 { return true; }
    91   methodHandle top_method() const          { return _method; }
    91   Method* top_method() const               { return _method; }
    92   javaVFrame* top_vframe() const           { return _vf; }
    92   javaVFrame* top_vframe() const           { return _vf; }
    93   nmethod* nm() const                      { return _nm; }
    93   nmethod* nm() const                      { return _nm; }
    94   int cost() const;
    94   int cost() const;
    95   void print();
    95   void print();
    96 };
    96 };
    97 
    97 
    98 class InterpretedRFrame : public RFrame {    // interpreter frame
    98 class InterpretedRFrame : public RFrame {    // interpreter frame
    99  protected:
    99  protected:
   100   javaVFrame* _vf;                           // may be NULL (for most recent frame)
   100   javaVFrame* _vf;                           // may be NULL (for most recent frame)
   101   methodHandle   _method;
   101   Method* _method;
   102 
   102 
   103   InterpretedRFrame(frame fr, JavaThread* thread, RFrame*const  callee);
   103   InterpretedRFrame(frame fr, JavaThread* thread, RFrame*const  callee);
   104   void init();
   104   void init();
   105   friend class RFrame;
   105   friend class RFrame;
   106 
   106 
   107  public:
   107  public:
   108   InterpretedRFrame(frame fr, JavaThread* thread, methodHandle m); // constructor for method triggering its invocation counter
   108   InterpretedRFrame(frame fr, JavaThread* thread, Method* m); // constructor for method triggering its invocation counter
   109   bool is_interpreted() const                { return true; }
   109   bool is_interpreted() const                { return true; }
   110   methodHandle top_method() const            { return _method; }
   110   Method* top_method() const                 { return _method; }
   111   javaVFrame* top_vframe() const             { return _vf; }
   111   javaVFrame* top_vframe() const             { return _vf; }
   112   int cost() const;
   112   int cost() const;
   113   void print();
   113   void print();
   114 };
   114 };
   115 
   115