src/share/vm/opto/callnode.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7088955 Sdiff src/share/vm/opto

src/share/vm/opto/callnode.hpp

Print this page


   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  *


 170 // Pop stack frame and jump indirect
 171 class TailJumpNode : public ReturnNode {
 172 public:
 173   TailJumpNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *target, Node *ex_oop)
 174     : ReturnNode(TypeFunc::Parms+2, cntrl, i_o, memory, frameptr, Compile::current()->top()) {
 175     init_req(TypeFunc::Parms, target);
 176     init_req(TypeFunc::Parms+1, ex_oop);
 177   }
 178 
 179   virtual int Opcode() const;
 180   virtual uint match_edge(uint idx) const;
 181 };
 182 
 183 //-------------------------------JVMState-------------------------------------
 184 // A linked list of JVMState nodes captures the whole interpreter state,
 185 // plus GC roots, for all active calls at some call site in this compilation
 186 // unit.  (If there is no inlining, then the list has exactly one link.)
 187 // This provides a way to map the optimized program back into the interpreter,
 188 // or to let the GC mark the stack.
 189 class JVMState : public ResourceObj {

 190 public:
 191   typedef enum {
 192     Reexecute_Undefined = -1, // not defined -- will be translated into false later
 193     Reexecute_False     =  0, // false       -- do not reexecute
 194     Reexecute_True      =  1  // true        -- reexecute the bytecode
 195   } ReexecuteState; //Reexecute State
 196 
 197 private:
 198   JVMState*         _caller;    // List pointer for forming scope chains
 199   uint              _depth;     // One mroe than caller depth, or one.
 200   uint              _locoff;    // Offset to locals in input edge mapping
 201   uint              _stkoff;    // Offset to stack in input edge mapping
 202   uint              _monoff;    // Offset to monitors in input edge mapping
 203   uint              _scloff;    // Offset to fields of scalar objs in input edge mapping
 204   uint              _endoff;    // Offset to end of input edge mapping
 205   uint              _sp;        // Jave Expression Stack Pointer for this state
 206   int               _bci;       // Byte Code Index of this JVM point
 207   ReexecuteState    _reexecute; // Whether this bytecode need to be re-executed
 208   ciMethod*         _method;    // Method Pointer
 209   SafePointNode*    _map;       // Map node associated with this scope


 483 // Simple container for the outgoing projections of a call.  Useful
 484 // for serious surgery on calls.
 485 class CallProjections : public StackObj {
 486 public:
 487   Node* fallthrough_proj;
 488   Node* fallthrough_catchproj;
 489   Node* fallthrough_memproj;
 490   Node* fallthrough_ioproj;
 491   Node* catchall_catchproj;
 492   Node* catchall_memproj;
 493   Node* catchall_ioproj;
 494   Node* resproj;
 495   Node* exobj;
 496 };
 497 
 498 
 499 //------------------------------CallNode---------------------------------------
 500 // Call nodes now subsume the function of debug nodes at callsites, so they
 501 // contain the functionality of a full scope chain of debug nodes.
 502 class CallNode : public SafePointNode {

 503 public:
 504   const TypeFunc *_tf;        // Function type
 505   address      _entry_point;  // Address of method being called
 506   float        _cnt;          // Estimate of number of times called
 507 
 508   CallNode(const TypeFunc* tf, address addr, const TypePtr* adr_type)
 509     : SafePointNode(tf->domain()->cnt(), NULL, adr_type),
 510       _tf(tf),
 511       _entry_point(addr),
 512       _cnt(COUNT_UNKNOWN)
 513   {
 514     init_class_id(Class_Call);
 515   }
 516 
 517   const TypeFunc* tf()        const { return _tf; }
 518   const address entry_point() const { return _entry_point; }
 519   const float   cnt()         const { return _cnt; }
 520 
 521   void set_tf(const TypeFunc* tf) { _tf = tf; }
 522   void set_entry_point(address p) { _entry_point = p; }


 548 
 549   // Collect all the interesting edges from a call for use in
 550   // replacing the call by something else.  Used by macro expansion
 551   // and the late inlining support.
 552   void extract_projections(CallProjections* projs, bool separate_io_proj);
 553 
 554   virtual uint match_edge(uint idx) const;
 555 
 556 #ifndef PRODUCT
 557   virtual void        dump_req()  const;
 558   virtual void        dump_spec(outputStream *st) const;
 559 #endif
 560 };
 561 
 562 
 563 //------------------------------CallJavaNode-----------------------------------
 564 // Make a static or dynamic subroutine call node using Java calling
 565 // convention.  (The "Java" calling convention is the compiler's calling
 566 // convention, as opposed to the interpreter's or that of native C.)
 567 class CallJavaNode : public CallNode {

 568 protected:
 569   virtual uint cmp( const Node &n ) const;
 570   virtual uint size_of() const; // Size is bigger
 571 
 572   bool    _optimized_virtual;
 573   bool    _method_handle_invoke;
 574   ciMethod* _method;            // Method being direct called
 575 public:
 576   const int       _bci;         // Byte Code Index of call byte code
 577   CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int bci)
 578     : CallNode(tf, addr, TypePtr::BOTTOM),
 579       _method(method), _bci(bci),
 580       _optimized_virtual(false),
 581       _method_handle_invoke(false)
 582   {
 583     init_class_id(Class_CallJava);
 584   }
 585 
 586   virtual int   Opcode() const;
 587   ciMethod* method() const                { return _method; }


   1 /*
   2  * Copyright (c) 1997, 2011, 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  *


 170 // Pop stack frame and jump indirect
 171 class TailJumpNode : public ReturnNode {
 172 public:
 173   TailJumpNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *target, Node *ex_oop)
 174     : ReturnNode(TypeFunc::Parms+2, cntrl, i_o, memory, frameptr, Compile::current()->top()) {
 175     init_req(TypeFunc::Parms, target);
 176     init_req(TypeFunc::Parms+1, ex_oop);
 177   }
 178 
 179   virtual int Opcode() const;
 180   virtual uint match_edge(uint idx) const;
 181 };
 182 
 183 //-------------------------------JVMState-------------------------------------
 184 // A linked list of JVMState nodes captures the whole interpreter state,
 185 // plus GC roots, for all active calls at some call site in this compilation
 186 // unit.  (If there is no inlining, then the list has exactly one link.)
 187 // This provides a way to map the optimized program back into the interpreter,
 188 // or to let the GC mark the stack.
 189 class JVMState : public ResourceObj {
 190   friend class VMStructs;
 191 public:
 192   typedef enum {
 193     Reexecute_Undefined = -1, // not defined -- will be translated into false later
 194     Reexecute_False     =  0, // false       -- do not reexecute
 195     Reexecute_True      =  1  // true        -- reexecute the bytecode
 196   } ReexecuteState; //Reexecute State
 197 
 198 private:
 199   JVMState*         _caller;    // List pointer for forming scope chains
 200   uint              _depth;     // One mroe than caller depth, or one.
 201   uint              _locoff;    // Offset to locals in input edge mapping
 202   uint              _stkoff;    // Offset to stack in input edge mapping
 203   uint              _monoff;    // Offset to monitors in input edge mapping
 204   uint              _scloff;    // Offset to fields of scalar objs in input edge mapping
 205   uint              _endoff;    // Offset to end of input edge mapping
 206   uint              _sp;        // Jave Expression Stack Pointer for this state
 207   int               _bci;       // Byte Code Index of this JVM point
 208   ReexecuteState    _reexecute; // Whether this bytecode need to be re-executed
 209   ciMethod*         _method;    // Method Pointer
 210   SafePointNode*    _map;       // Map node associated with this scope


 484 // Simple container for the outgoing projections of a call.  Useful
 485 // for serious surgery on calls.
 486 class CallProjections : public StackObj {
 487 public:
 488   Node* fallthrough_proj;
 489   Node* fallthrough_catchproj;
 490   Node* fallthrough_memproj;
 491   Node* fallthrough_ioproj;
 492   Node* catchall_catchproj;
 493   Node* catchall_memproj;
 494   Node* catchall_ioproj;
 495   Node* resproj;
 496   Node* exobj;
 497 };
 498 
 499 
 500 //------------------------------CallNode---------------------------------------
 501 // Call nodes now subsume the function of debug nodes at callsites, so they
 502 // contain the functionality of a full scope chain of debug nodes.
 503 class CallNode : public SafePointNode {
 504   friend class VMStructs;
 505 public:
 506   const TypeFunc *_tf;        // Function type
 507   address      _entry_point;  // Address of method being called
 508   float        _cnt;          // Estimate of number of times called
 509 
 510   CallNode(const TypeFunc* tf, address addr, const TypePtr* adr_type)
 511     : SafePointNode(tf->domain()->cnt(), NULL, adr_type),
 512       _tf(tf),
 513       _entry_point(addr),
 514       _cnt(COUNT_UNKNOWN)
 515   {
 516     init_class_id(Class_Call);
 517   }
 518 
 519   const TypeFunc* tf()        const { return _tf; }
 520   const address entry_point() const { return _entry_point; }
 521   const float   cnt()         const { return _cnt; }
 522 
 523   void set_tf(const TypeFunc* tf) { _tf = tf; }
 524   void set_entry_point(address p) { _entry_point = p; }


 550 
 551   // Collect all the interesting edges from a call for use in
 552   // replacing the call by something else.  Used by macro expansion
 553   // and the late inlining support.
 554   void extract_projections(CallProjections* projs, bool separate_io_proj);
 555 
 556   virtual uint match_edge(uint idx) const;
 557 
 558 #ifndef PRODUCT
 559   virtual void        dump_req()  const;
 560   virtual void        dump_spec(outputStream *st) const;
 561 #endif
 562 };
 563 
 564 
 565 //------------------------------CallJavaNode-----------------------------------
 566 // Make a static or dynamic subroutine call node using Java calling
 567 // convention.  (The "Java" calling convention is the compiler's calling
 568 // convention, as opposed to the interpreter's or that of native C.)
 569 class CallJavaNode : public CallNode {
 570   friend class VMStructs;
 571 protected:
 572   virtual uint cmp( const Node &n ) const;
 573   virtual uint size_of() const; // Size is bigger
 574 
 575   bool    _optimized_virtual;
 576   bool    _method_handle_invoke;
 577   ciMethod* _method;            // Method being direct called
 578 public:
 579   const int       _bci;         // Byte Code Index of call byte code
 580   CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int bci)
 581     : CallNode(tf, addr, TypePtr::BOTTOM),
 582       _method(method), _bci(bci),
 583       _optimized_virtual(false),
 584       _method_handle_invoke(false)
 585   {
 586     init_class_id(Class_CallJava);
 587   }
 588 
 589   virtual int   Opcode() const;
 590   ciMethod* method() const                { return _method; }


src/share/vm/opto/callnode.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File