comparison src/share/vm/code/pcDesc.hpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents 5857923e563c 7588156f5cf9
children 82af018d61db
comparison
equal deleted inserted replaced
3737:9dc19b7d89a3 4137:04b9a2566eec
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 rethrow_exception: 1; 46 PCDESC_rethrow_exception = 1 << 3
47 unsigned int is_method_handle_invoke: 1; 47 };
48 unsigned int return_oop: 1; 48
49 } bits; 49 int _flags;
50 bool operator ==(const PcDescFlags& other) { return word == other.word; } 50
51 } _flags; 51 void set_flag(int mask, bool z) {
52 _flags = z ? (_flags | mask) : (_flags & ~mask);
53 }
52 54
53 public: 55 public:
54 int pc_offset() const { return _pc_offset; } 56 int pc_offset() const { return _pc_offset; }
55 int scope_decode_offset() const { return _scope_decode_offset; } 57 int scope_decode_offset() const { return _scope_decode_offset; }
56 int obj_decode_offset() const { return _obj_decode_offset; } 58 int obj_decode_offset() const { return _obj_decode_offset; }
68 lower_offset_limit = -1, 70 lower_offset_limit = -1,
69 upper_offset_limit = (unsigned int)-1 >> 1 71 upper_offset_limit = (unsigned int)-1 >> 1
70 }; 72 };
71 73
72 // Flags 74 // Flags
73 bool should_reexecute() const { return _flags.bits.reexecute; } 75 bool rethrow_exception() const { return _flags & PCDESC_rethrow_exception; }
74 void set_should_reexecute(bool z) { _flags.bits.reexecute = z; } 76 void set_rethrow_exception(bool z) { set_flag(PCDESC_rethrow_exception, z); }
75 bool rethrow_exception() const { return _flags.bits.rethrow_exception; } 77 bool should_reexecute() const { return (_flags & PCDESC_reexecute) != 0; }
76 void set_rethrow_exception(bool z) { _flags.bits.rethrow_exception = z; } 78 void set_should_reexecute(bool z) { set_flag(PCDESC_reexecute, z); }
77 79
78 // Does pd refer to the same information as pd? 80 // Does pd refer to the same information as pd?
79 bool is_same_info(const PcDesc* pd) { 81 bool is_same_info(const PcDesc* pd) {
80 return _scope_decode_offset == pd->_scope_decode_offset && 82 return _scope_decode_offset == pd->_scope_decode_offset &&
81 _obj_decode_offset == pd->_obj_decode_offset && 83 _obj_decode_offset == pd->_obj_decode_offset &&
82 _flags == pd->_flags; 84 _flags == pd->_flags;
83 } 85 }
84 86
85 bool is_method_handle_invoke() const { return _flags.bits.is_method_handle_invoke; } 87 bool is_method_handle_invoke() const { return (_flags & PCDESC_is_method_handle_invoke) != 0; }
86 void set_is_method_handle_invoke(bool z) { _flags.bits.is_method_handle_invoke = z; } 88 void set_is_method_handle_invoke(bool z) { set_flag(PCDESC_is_method_handle_invoke, z); }
87 89
88 bool return_oop() const { return _flags.bits.return_oop; } 90 bool return_oop() const { return (_flags & PCDESC_return_oop) != 0; }
89 void set_return_oop(bool z) { _flags.bits.return_oop = z; } 91 void set_return_oop(bool z) { set_flag(PCDESC_return_oop, z); }
90 92
91 // Returns the real pc 93 // Returns the real pc
92 address real_pc(const nmethod* code) const; 94 address real_pc(const nmethod* code) const;
93 95
94 void print(nmethod* code); 96 void print(nmethod* code);