src/share/vm/runtime/deoptimization.hpp

Print this page




 124 
 125   // Interface used for unpacking deoptimized frames
 126 
 127   // UnrollBlock is returned by fetch_unroll_info() to the deoptimization handler (blob).
 128   // This is only a CheapObj to ease debugging after a deopt failure
 129   class UnrollBlock : public CHeapObj {
 130    private:
 131     int       _size_of_deoptimized_frame; // Size, in bytes, of current deoptimized frame
 132     int       _caller_adjustment;         // Adjustment, in bytes, to caller's SP by initial interpreted frame
 133     int       _number_of_frames;          // Number frames to unroll
 134     int       _total_frame_sizes;         // Total of number*sizes frames
 135     intptr_t* _frame_sizes;               // Array of frame sizes, in bytes, for unrolling the stack
 136     address*  _frame_pcs;                 // Array of frame pc's, in bytes, for unrolling the stack
 137     intptr_t* _register_block;            // Block for storing callee-saved registers.
 138     BasicType _return_type;               // Tells if we have to restore double or long return value
 139     // The following fields are used as temps during the unpacking phase
 140     // (which is tight on registers, especially on x86). They really ought
 141     // to be PD variables but that involves moving this class into its own
 142     // file to use the pd include mechanism. Maybe in a later cleanup ...
 143     intptr_t  _counter_temp;              // SHOULD BE PD VARIABLE (x86 frame count temp)
 144     intptr_t  _initial_fp;                // SHOULD BE PD VARIABLE (x86/c2 initial ebp)
 145     intptr_t  _unpack_kind;               // SHOULD BE PD VARIABLE (x86 unpack kind)
 146     intptr_t  _sender_sp_temp;            // SHOULD BE PD VARIABLE (x86 sender_sp)
 147    public:
 148     // Constructor
 149     UnrollBlock(int  size_of_deoptimized_frame,
 150                 int  caller_adjustment,
 151                 int  number_of_frames,
 152                 intptr_t* frame_sizes,
 153                 address* frames_pcs,
 154                 BasicType return_type);
 155     ~UnrollBlock();
 156 
 157     // Returns where a register is located.
 158     intptr_t* value_addr_at(int register_number) const;
 159 
 160     // Accessors
 161     intptr_t* frame_sizes()  const { return _frame_sizes; }
 162     int number_of_frames()  const { return _number_of_frames; }
 163     address*  frame_pcs()   const { return _frame_pcs ; }
 164 
 165     // Returns the total size of frames
 166     int size_of_frames() const;
 167 


 168     // Accessors used by the code generator for the unpack stub.
 169     static int size_of_deoptimized_frame_offset_in_bytes() { return offset_of(UnrollBlock, _size_of_deoptimized_frame); }
 170     static int caller_adjustment_offset_in_bytes()         { return offset_of(UnrollBlock, _caller_adjustment);         }
 171     static int number_of_frames_offset_in_bytes()          { return offset_of(UnrollBlock, _number_of_frames);          }
 172     static int frame_sizes_offset_in_bytes()               { return offset_of(UnrollBlock, _frame_sizes);               }
 173     static int total_frame_sizes_offset_in_bytes()         { return offset_of(UnrollBlock, _total_frame_sizes);         }
 174     static int frame_pcs_offset_in_bytes()                 { return offset_of(UnrollBlock, _frame_pcs);                 }
 175     static int register_block_offset_in_bytes()            { return offset_of(UnrollBlock, _register_block);            }
 176     static int return_type_offset_in_bytes()               { return offset_of(UnrollBlock, _return_type);               }
 177     static int counter_temp_offset_in_bytes()              { return offset_of(UnrollBlock, _counter_temp);              }
 178     static int initial_fp_offset_in_bytes()                { return offset_of(UnrollBlock, _initial_fp);                }
 179     static int unpack_kind_offset_in_bytes()               { return offset_of(UnrollBlock, _unpack_kind);               }
 180     static int sender_sp_temp_offset_in_bytes()            { return offset_of(UnrollBlock, _sender_sp_temp);            }
 181 
 182     BasicType return_type() const { return _return_type; }
 183     void print();
 184   };
 185 
 186   //** Returns an UnrollBlock continuing information
 187   // how to make room for the resulting interpreter frames.




 124 
 125   // Interface used for unpacking deoptimized frames
 126 
 127   // UnrollBlock is returned by fetch_unroll_info() to the deoptimization handler (blob).
 128   // This is only a CheapObj to ease debugging after a deopt failure
 129   class UnrollBlock : public CHeapObj {
 130    private:
 131     int       _size_of_deoptimized_frame; // Size, in bytes, of current deoptimized frame
 132     int       _caller_adjustment;         // Adjustment, in bytes, to caller's SP by initial interpreted frame
 133     int       _number_of_frames;          // Number frames to unroll
 134     int       _total_frame_sizes;         // Total of number*sizes frames
 135     intptr_t* _frame_sizes;               // Array of frame sizes, in bytes, for unrolling the stack
 136     address*  _frame_pcs;                 // Array of frame pc's, in bytes, for unrolling the stack
 137     intptr_t* _register_block;            // Block for storing callee-saved registers.
 138     BasicType _return_type;               // Tells if we have to restore double or long return value
 139     // The following fields are used as temps during the unpacking phase
 140     // (which is tight on registers, especially on x86). They really ought
 141     // to be PD variables but that involves moving this class into its own
 142     // file to use the pd include mechanism. Maybe in a later cleanup ...
 143     intptr_t  _counter_temp;              // SHOULD BE PD VARIABLE (x86 frame count temp)
 144     intptr_t  _initial_fp;                // no longer PD (beneficial to other ports)
 145     intptr_t  _unpack_kind;               // SHOULD BE PD VARIABLE (x86 unpack kind)
 146     intptr_t  _sender_sp_temp;            // SHOULD BE PD VARIABLE (x86 sender_sp)
 147    public:
 148     // Constructor
 149     UnrollBlock(int  size_of_deoptimized_frame,
 150                 int  caller_adjustment,
 151                 int  number_of_frames,
 152                 intptr_t* frame_sizes,
 153                 address* frames_pcs,
 154                 BasicType return_type);
 155     ~UnrollBlock();
 156 
 157     // Returns where a register is located.
 158     intptr_t* value_addr_at(int register_number) const;
 159 
 160     // Accessors
 161     intptr_t* frame_sizes()  const { return _frame_sizes; }
 162     int number_of_frames()  const { return _number_of_frames; }
 163     address*  frame_pcs()   const { return _frame_pcs ; }
 164 
 165     // Returns the total size of frames
 166     int size_of_frames() const;
 167 
 168     void set_initial_fp(intptr_t fp) { _initial_fp = fp; }
 169 
 170     // Accessors used by the code generator for the unpack stub.
 171     static int size_of_deoptimized_frame_offset_in_bytes() { return offset_of(UnrollBlock, _size_of_deoptimized_frame); }
 172     static int caller_adjustment_offset_in_bytes()         { return offset_of(UnrollBlock, _caller_adjustment);         }
 173     static int number_of_frames_offset_in_bytes()          { return offset_of(UnrollBlock, _number_of_frames);          }
 174     static int frame_sizes_offset_in_bytes()               { return offset_of(UnrollBlock, _frame_sizes);               }
 175     static int total_frame_sizes_offset_in_bytes()         { return offset_of(UnrollBlock, _total_frame_sizes);         }
 176     static int frame_pcs_offset_in_bytes()                 { return offset_of(UnrollBlock, _frame_pcs);                 }
 177     static int register_block_offset_in_bytes()            { return offset_of(UnrollBlock, _register_block);            }
 178     static int return_type_offset_in_bytes()               { return offset_of(UnrollBlock, _return_type);               }
 179     static int counter_temp_offset_in_bytes()              { return offset_of(UnrollBlock, _counter_temp);              }
 180     static int initial_fp_offset_in_bytes()                { return offset_of(UnrollBlock, _initial_fp);                }
 181     static int unpack_kind_offset_in_bytes()               { return offset_of(UnrollBlock, _unpack_kind);               }
 182     static int sender_sp_temp_offset_in_bytes()            { return offset_of(UnrollBlock, _sender_sp_temp);            }
 183 
 184     BasicType return_type() const { return _return_type; }
 185     void print();
 186   };
 187 
 188   //** Returns an UnrollBlock continuing information
 189   // how to make room for the resulting interpreter frames.