101 // A placeholder value that has no concrete meaning other than helping constructing
102 // other values.
103
104 class MarkerValue: public ScopeValue {
105 public:
106 bool is_marker() const { return true; }
107
108 // Serialization of debugging information
109 void write_on(DebugInfoWriteStream* stream);
110
111 // Printing
112 void print_on(outputStream* st) const;
113 };
114
115 // An ObjectValue describes an object eliminated by escape analysis.
116
117 class ObjectValue: public ScopeValue {
118 protected:
119 int _id;
120 ScopeValue* _klass;
121 GrowableArray<ScopeValue*> _field_values;
122 Handle _value;
123 bool _visited;
124 public:
125 ObjectValue(int id, ScopeValue* klass)
126 : _id(id)
127 , _klass(klass)
128 , _field_values()
129 , _value()
130 , _visited(false) {
131 assert(klass->is_constant_oop(), "should be constant java mirror oop");
132 }
133
134 ObjectValue(int id)
135 : _id(id)
136 , _klass(NULL)
137 , _field_values()
138 , _value()
139 , _visited(false) {}
140
141 // Accessors
142 bool is_object() const { return true; }
143 int id() const { return _id; }
144 ScopeValue* klass() const { return _klass; }
145 GrowableArray<ScopeValue*>* field_values() { return &_field_values; }
146 ScopeValue* field_at(int i) const { return _field_values.at(i); }
147 int field_size() { return _field_values.length(); }
148 Handle value() const { return _value; }
149 bool is_visited() const { return _visited; }
150
151 void set_value(oop value);
152 void set_visited(bool visited) { _visited = visited; }
153
154 // Serialization of debugging information
155 void read_object(DebugInfoReadStream* stream);
156 void write_on(DebugInfoWriteStream* stream);
157
158 // Printing
159 void print_on(outputStream* st) const;
160 void print_fields_on(outputStream* st) const;
161 };
162
163 class AutoBoxObjectValue : public ObjectValue {
164 bool _cached;
165 public:
166 bool is_auto_box() const { return true; }
167 bool is_cached() const { return _cached; }
168 void set_cached(bool cached) { _cached = cached; }
169 AutoBoxObjectValue(int id, ScopeValue* klass) : ObjectValue(id, klass), _cached(false) { }
|
101 // A placeholder value that has no concrete meaning other than helping constructing
102 // other values.
103
104 class MarkerValue: public ScopeValue {
105 public:
106 bool is_marker() const { return true; }
107
108 // Serialization of debugging information
109 void write_on(DebugInfoWriteStream* stream);
110
111 // Printing
112 void print_on(outputStream* st) const;
113 };
114
115 // An ObjectValue describes an object eliminated by escape analysis.
116
117 class ObjectValue: public ScopeValue {
118 protected:
119 int _id;
120 ScopeValue* _klass;
121 ScopeValue* _is_init;
122 GrowableArray<ScopeValue*> _field_values;
123 Handle _value;
124 bool _visited;
125 public:
126 ObjectValue(int id, ScopeValue* klass, ScopeValue* is_init = NULL)
127 : _id(id)
128 , _klass(klass)
129 , _is_init(is_init)
130 , _field_values()
131 , _value()
132 , _visited(false) {
133 assert(klass->is_constant_oop(), "should be constant java mirror oop");
134 }
135
136 ObjectValue(int id)
137 : _id(id)
138 , _klass(NULL)
139 , _is_init(NULL)
140 , _field_values()
141 , _value()
142 , _visited(false) {}
143
144 // Accessors
145 bool is_object() const { return true; }
146 int id() const { return _id; }
147 ScopeValue* klass() const { return _klass; }
148 ScopeValue* is_init() const { return _is_init; }
149 GrowableArray<ScopeValue*>* field_values() { return &_field_values; }
150 ScopeValue* field_at(int i) const { return _field_values.at(i); }
151 int field_size() { return _field_values.length(); }
152 Handle value() const { return _value; }
153 bool is_visited() const { return _visited; }
154 bool maybe_null() const { return !_is_init->is_marker(); }
155
156 void set_value(oop value);
157 void set_visited(bool visited) { _visited = visited; }
158
159 // Serialization of debugging information
160 void read_object(DebugInfoReadStream* stream);
161 void write_on(DebugInfoWriteStream* stream);
162
163 // Printing
164 void print_on(outputStream* st) const;
165 void print_fields_on(outputStream* st) const;
166 };
167
168 class AutoBoxObjectValue : public ObjectValue {
169 bool _cached;
170 public:
171 bool is_auto_box() const { return true; }
172 bool is_cached() const { return _cached; }
173 void set_cached(bool cached) { _cached = cached; }
174 AutoBoxObjectValue(int id, ScopeValue* klass) : ObjectValue(id, klass), _cached(false) { }
|