hotspot/src/share/vm/code/pcDesc.hpp
changeset 10517 f92c9ff3a15f
parent 7397 5b173b4ca846
child 33160 c59f1676d27e
equal deleted inserted replaced
10516:2797e487c09f 10517:f92c9ff3a15f
    37  private:
    37  private:
    38   int _pc_offset;           // offset from start of nmethod
    38   int _pc_offset;           // offset from start of nmethod
    39   int _scope_decode_offset; // offset for scope in nmethod
    39   int _scope_decode_offset; // offset for scope in nmethod
    40   int _obj_decode_offset;
    40   int _obj_decode_offset;
    41 
    41 
    42   union PcDescFlags {
    42   enum {
    43     int word;
    43     PCDESC_reexecute               = 1 << 0,
    44     struct {
    44     PCDESC_is_method_handle_invoke = 1 << 1,
    45       unsigned int reexecute: 1;
    45     PCDESC_return_oop              = 1 << 2
    46       unsigned int is_method_handle_invoke: 1;
    46   };
    47       unsigned int return_oop: 1;
    47 
    48     } bits;
    48   int _flags;
    49     bool operator ==(const PcDescFlags& other) { return word == other.word; }
    49 
    50   } _flags;
    50   void set_flag(int mask, bool z) {
       
    51     _flags = z ? (_flags | mask) : (_flags & ~mask);
       
    52   }
    51 
    53 
    52  public:
    54  public:
    53   int pc_offset() const           { return _pc_offset;   }
    55   int pc_offset() const           { return _pc_offset;   }
    54   int scope_decode_offset() const { return _scope_decode_offset; }
    56   int scope_decode_offset() const { return _scope_decode_offset; }
    55   int obj_decode_offset() const   { return _obj_decode_offset; }
    57   int obj_decode_offset() const   { return _obj_decode_offset; }
    67     lower_offset_limit = -1,
    69     lower_offset_limit = -1,
    68     upper_offset_limit = (unsigned int)-1 >> 1
    70     upper_offset_limit = (unsigned int)-1 >> 1
    69   };
    71   };
    70 
    72 
    71   // Flags
    73   // Flags
    72   bool     should_reexecute()              const { return _flags.bits.reexecute; }
    74   bool     should_reexecute()              const { return (_flags & PCDESC_reexecute) != 0; }
    73   void set_should_reexecute(bool z)              { _flags.bits.reexecute = z;    }
    75   void set_should_reexecute(bool z)              { set_flag(PCDESC_reexecute, z); }
    74 
    76 
    75   // Does pd refer to the same information as pd?
    77   // Does pd refer to the same information as pd?
    76   bool is_same_info(const PcDesc* pd) {
    78   bool is_same_info(const PcDesc* pd) {
    77     return _scope_decode_offset == pd->_scope_decode_offset &&
    79     return _scope_decode_offset == pd->_scope_decode_offset &&
    78       _obj_decode_offset == pd->_obj_decode_offset &&
    80       _obj_decode_offset == pd->_obj_decode_offset &&
    79       _flags == pd->_flags;
    81       _flags == pd->_flags;
    80   }
    82   }
    81 
    83 
    82   bool     is_method_handle_invoke()       const { return _flags.bits.is_method_handle_invoke;     }
    84   bool     is_method_handle_invoke()       const { return (_flags & PCDESC_is_method_handle_invoke) != 0;     }
    83   void set_is_method_handle_invoke(bool z)       {        _flags.bits.is_method_handle_invoke = z; }
    85   void set_is_method_handle_invoke(bool z)       { set_flag(PCDESC_is_method_handle_invoke, z); }
    84 
    86 
    85   bool     return_oop()                    const { return _flags.bits.return_oop;     }
    87   bool     return_oop()                    const { return (_flags & PCDESC_return_oop) != 0;     }
    86   void set_return_oop(bool z)                    {        _flags.bits.return_oop = z; }
    88   void set_return_oop(bool z)                    { set_flag(PCDESC_return_oop, z); }
    87 
    89 
    88   // Returns the real pc
    90   // Returns the real pc
    89   address real_pc(const nmethod* code) const;
    91   address real_pc(const nmethod* code) const;
    90 
    92 
    91   void print(nmethod* code);
    93   void print(nmethod* code);