107 #endif
108 };
109
110 class ciTypeStackSlotEntries : public TypeStackSlotEntries, ciTypeEntries {
111 public:
112 void translate_type_data_from(const TypeStackSlotEntries* args);
113
114 ciKlass* valid_type(int i) const {
115 return valid_ciklass(type(i));
116 }
117
118 ProfilePtrKind ptr_kind(int i) const {
119 return ciTypeEntries::ptr_kind(type(i));
120 }
121
122 #ifndef PRODUCT
123 void print_data_on(outputStream* st) const;
124 #endif
125 };
126
127 class ciReturnTypeEntry : public ReturnTypeEntry, ciTypeEntries {
128 public:
129 void translate_type_data_from(const ReturnTypeEntry* ret);
130
131 ciKlass* valid_type() const {
132 return valid_ciklass(type());
133 }
134
135 ProfilePtrKind ptr_kind() const {
136 return ciTypeEntries::ptr_kind(type());
137 }
138
139 #ifndef PRODUCT
140 void print_data_on(outputStream* st) const;
141 #endif
142 };
143
144 class ciCallTypeData : public CallTypeData {
145 public:
146 ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {}
147
148 ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); }
149 ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)CallTypeData::ret(); }
150
151 void translate_from(const ProfileData* data) {
152 if (has_arguments()) {
153 args()->translate_type_data_from(data->as_CallTypeData()->args());
154 }
155 if (has_return()) {
156 ret()->translate_type_data_from(data->as_CallTypeData()->ret());
157 }
158 }
159
160 intptr_t argument_type(int i) const {
161 assert(has_arguments(), "no arg type profiling data");
162 return args()->type(i);
163 }
164
165 ciKlass* valid_argument_type(int i) const {
166 assert(has_arguments(), "no arg type profiling data");
167 return args()->valid_type(i);
168 }
169
241 void print_data_on(outputStream* st, const char* extra = nullptr) const;
242 #endif
243 };
244
245 class ciVirtualCallTypeData : public VirtualCallTypeData {
246 private:
247 // Fake multiple inheritance... It's a ciReceiverTypeData also.
248 ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; }
249 public:
250 ciVirtualCallTypeData(DataLayout* layout) : VirtualCallTypeData(layout) {}
251
252 void set_receiver(uint row, ciKlass* recv) {
253 rtd_super()->set_receiver(row, recv);
254 }
255
256 ciKlass* receiver(uint row) const {
257 return rtd_super()->receiver(row);
258 }
259
260 ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)VirtualCallTypeData::args(); }
261 ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)VirtualCallTypeData::ret(); }
262
263 // Copy & translate from oop based VirtualCallData
264 virtual void translate_from(const ProfileData* data) {
265 rtd_super()->translate_receiver_data_from(data);
266 if (has_arguments()) {
267 args()->translate_type_data_from(data->as_VirtualCallTypeData()->args());
268 }
269 if (has_return()) {
270 ret()->translate_type_data_from(data->as_VirtualCallTypeData()->ret());
271 }
272 }
273
274 ciKlass* valid_argument_type(int i) const {
275 assert(has_arguments(), "no arg type profiling data");
276 return args()->valid_type(i);
277 }
278
279 intptr_t return_type() const {
280 assert(has_return(), "no ret type profiling data");
281 return ret()->type();
345
346 class ciSpeculativeTrapData : public SpeculativeTrapData {
347 public:
348 ciSpeculativeTrapData(DataLayout* layout) : SpeculativeTrapData(layout) {}
349
350 virtual void translate_from(const ProfileData* data);
351
352 ciMethod* method() const {
353 return (ciMethod*)intptr_at(speculative_trap_method);
354 }
355
356 void set_method(ciMethod* m) {
357 set_intptr_at(speculative_trap_method, (intptr_t)m);
358 }
359
360 #ifndef PRODUCT
361 void print_data_on(outputStream* st, const char* extra = nullptr) const;
362 #endif
363 };
364
365 // ciMethodData
366 //
367 // This class represents a MethodData* in the HotSpot virtual
368 // machine.
369
370 class ciMethodData : public ciMetadata {
371 CI_PACKAGE_ACCESS
372 friend class ciReplay;
373
374 private:
375 // Size in bytes
376 int _data_size;
377 int _extra_data_size;
378
379 // Data entries
380 intptr_t* _data;
381
382 // layout of _data
383 int _parameters_data_offset;
384 int _exception_handlers_data_offset;
|
107 #endif
108 };
109
110 class ciTypeStackSlotEntries : public TypeStackSlotEntries, ciTypeEntries {
111 public:
112 void translate_type_data_from(const TypeStackSlotEntries* args);
113
114 ciKlass* valid_type(int i) const {
115 return valid_ciklass(type(i));
116 }
117
118 ProfilePtrKind ptr_kind(int i) const {
119 return ciTypeEntries::ptr_kind(type(i));
120 }
121
122 #ifndef PRODUCT
123 void print_data_on(outputStream* st) const;
124 #endif
125 };
126
127 class ciSingleTypeEntry : public SingleTypeEntry, ciTypeEntries {
128 public:
129 void translate_type_data_from(const SingleTypeEntry* ret);
130
131 ciKlass* valid_type() const {
132 return valid_ciklass(type());
133 }
134
135 ProfilePtrKind ptr_kind() const {
136 return ciTypeEntries::ptr_kind(type());
137 }
138
139 #ifndef PRODUCT
140 void print_data_on(outputStream* st) const;
141 #endif
142 };
143
144 class ciCallTypeData : public CallTypeData {
145 public:
146 ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {}
147
148 ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); }
149 ciSingleTypeEntry* ret() const { return (ciSingleTypeEntry*)CallTypeData::ret(); }
150
151 void translate_from(const ProfileData* data) {
152 if (has_arguments()) {
153 args()->translate_type_data_from(data->as_CallTypeData()->args());
154 }
155 if (has_return()) {
156 ret()->translate_type_data_from(data->as_CallTypeData()->ret());
157 }
158 }
159
160 intptr_t argument_type(int i) const {
161 assert(has_arguments(), "no arg type profiling data");
162 return args()->type(i);
163 }
164
165 ciKlass* valid_argument_type(int i) const {
166 assert(has_arguments(), "no arg type profiling data");
167 return args()->valid_type(i);
168 }
169
241 void print_data_on(outputStream* st, const char* extra = nullptr) const;
242 #endif
243 };
244
245 class ciVirtualCallTypeData : public VirtualCallTypeData {
246 private:
247 // Fake multiple inheritance... It's a ciReceiverTypeData also.
248 ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; }
249 public:
250 ciVirtualCallTypeData(DataLayout* layout) : VirtualCallTypeData(layout) {}
251
252 void set_receiver(uint row, ciKlass* recv) {
253 rtd_super()->set_receiver(row, recv);
254 }
255
256 ciKlass* receiver(uint row) const {
257 return rtd_super()->receiver(row);
258 }
259
260 ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)VirtualCallTypeData::args(); }
261 ciSingleTypeEntry* ret() const { return (ciSingleTypeEntry*)VirtualCallTypeData::ret(); }
262
263 // Copy & translate from oop based VirtualCallData
264 virtual void translate_from(const ProfileData* data) {
265 rtd_super()->translate_receiver_data_from(data);
266 if (has_arguments()) {
267 args()->translate_type_data_from(data->as_VirtualCallTypeData()->args());
268 }
269 if (has_return()) {
270 ret()->translate_type_data_from(data->as_VirtualCallTypeData()->ret());
271 }
272 }
273
274 ciKlass* valid_argument_type(int i) const {
275 assert(has_arguments(), "no arg type profiling data");
276 return args()->valid_type(i);
277 }
278
279 intptr_t return_type() const {
280 assert(has_return(), "no ret type profiling data");
281 return ret()->type();
345
346 class ciSpeculativeTrapData : public SpeculativeTrapData {
347 public:
348 ciSpeculativeTrapData(DataLayout* layout) : SpeculativeTrapData(layout) {}
349
350 virtual void translate_from(const ProfileData* data);
351
352 ciMethod* method() const {
353 return (ciMethod*)intptr_at(speculative_trap_method);
354 }
355
356 void set_method(ciMethod* m) {
357 set_intptr_at(speculative_trap_method, (intptr_t)m);
358 }
359
360 #ifndef PRODUCT
361 void print_data_on(outputStream* st, const char* extra = nullptr) const;
362 #endif
363 };
364
365 class ciArrayStoreData : public ArrayStoreData {
366 // Fake multiple inheritance... It's a ciReceiverTypeData also.
367 ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; }
368
369 public:
370 ciArrayStoreData(DataLayout* layout) : ArrayStoreData(layout) {}
371
372 ciSingleTypeEntry* array() const { return (ciSingleTypeEntry*)ArrayStoreData::array(); }
373
374 virtual void translate_from(const ProfileData* data) {
375 array()->translate_type_data_from(data->as_ArrayStoreData()->array());
376 rtd_super()->translate_receiver_data_from(data);
377 }
378
379 ciKlass* receiver(uint row) {
380 return rtd_super()->receiver(row);
381 }
382 #ifndef PRODUCT
383 void print_data_on(outputStream* st, const char* extra = nullptr) const;
384 #endif
385 };
386
387 class ciArrayLoadData : public ArrayLoadData {
388 public:
389 ciArrayLoadData(DataLayout* layout) : ArrayLoadData(layout) {}
390
391 ciSingleTypeEntry* array() const { return (ciSingleTypeEntry*)ArrayLoadData::array(); }
392 ciSingleTypeEntry* element() const { return (ciSingleTypeEntry*)ArrayLoadData::element(); }
393
394 virtual void translate_from(const ProfileData* data) {
395 array()->translate_type_data_from(data->as_ArrayLoadData()->array());
396 element()->translate_type_data_from(data->as_ArrayLoadData()->element());
397 }
398
399 #ifndef PRODUCT
400 void print_data_on(outputStream* st, const char* extra = nullptr) const;
401 #endif
402 };
403
404
405 class ciACmpData : public ACmpData {
406 public:
407 ciACmpData(DataLayout* layout) : ACmpData(layout) {}
408
409 ciSingleTypeEntry* left() const { return (ciSingleTypeEntry*)ACmpData::left(); }
410 ciSingleTypeEntry* right() const { return (ciSingleTypeEntry*)ACmpData::right(); }
411
412 virtual void translate_from(const ProfileData* data) {
413 left()->translate_type_data_from(data->as_ACmpData()->left());
414 right()->translate_type_data_from(data->as_ACmpData()->right());
415 }
416
417 #ifndef PRODUCT
418 void print_data_on(outputStream* st, const char* extra = nullptr) const;
419 #endif
420 };
421
422 // ciMethodData
423 //
424 // This class represents a MethodData* in the HotSpot virtual
425 // machine.
426
427 class ciMethodData : public ciMetadata {
428 CI_PACKAGE_ACCESS
429 friend class ciReplay;
430
431 private:
432 // Size in bytes
433 int _data_size;
434 int _extra_data_size;
435
436 // Data entries
437 intptr_t* _data;
438
439 // layout of _data
440 int _parameters_data_offset;
441 int _exception_handlers_data_offset;
|