409 cell->prev = tail;
410 prev = cell;
411 }
412 Cell* prev;
413 Cell* next;
414 };
415 uint _ref_cnt;
416 Cell* _strings;
417 };
418
419 // The assumption made here is that most code remarks (or comments) added to
420 // the generated assembly code are unique, i.e. there is very little gain in
421 // trying to share the strings between the different offsets tracked in a
422 // buffer (or blob).
423
424 class AsmRemarks {
425 public:
426 AsmRemarks();
427 ~AsmRemarks();
428
429 const char* insert(uint offset, const char* remstr);
430
431 bool is_empty() const;
432
433 void share(const AsmRemarks &src);
434 void clear();
435 uint print(uint offset, outputStream* strm = tty) const;
436
437 // For testing purposes only.
438 const AsmRemarkCollection* ref() const { return _remarks; }
439
440 template<typename Function>
441 inline bool iterate(Function function) const { return _remarks->iterate(function); }
442
443 private:
444 AsmRemarkCollection* _remarks;
445 };
446
447 // The assumption made here is that the number of debug strings (with a fixed
448 // address requirement) is a rather small set per compilation unit.
449
450 class DbgStrings {
451 public:
452 DbgStrings();
453 ~DbgStrings();
454
455 const char* insert(const char* dbgstr);
456
457 bool is_empty() const;
458
459 void share(const DbgStrings &src);
460 void clear();
461
462 // For testing purposes only.
463 const DbgStringCollection* ref() const { return _strings; }
464
465 template<typename Function>
466 bool iterate(Function function) const { return _strings->iterate(function); }
467
468 private:
469 DbgStringCollection* _strings;
470 };
471 #endif // not PRODUCT
472
473
474 #ifdef ASSERT
475 #include "utilities/copy.hpp"
476
477 class Scrubber {
478 public:
479 Scrubber(void* addr, size_t size) : _addr(addr), _size(size) {}
480 ~Scrubber() {
|
409 cell->prev = tail;
410 prev = cell;
411 }
412 Cell* prev;
413 Cell* next;
414 };
415 uint _ref_cnt;
416 Cell* _strings;
417 };
418
419 // The assumption made here is that most code remarks (or comments) added to
420 // the generated assembly code are unique, i.e. there is very little gain in
421 // trying to share the strings between the different offsets tracked in a
422 // buffer (or blob).
423
424 class AsmRemarks {
425 public:
426 AsmRemarks();
427 ~AsmRemarks();
428
429 void init();
430
431 const char* insert(uint offset, const char* remstr);
432
433 bool is_empty() const;
434
435 void share(const AsmRemarks &src);
436 void clear();
437 // Clear Collection refence when storing AOT code,
438 // new one will be created during AOT code load.
439 void clear_ref() { _remarks = nullptr; }
440 uint print(uint offset, outputStream* strm = tty) const;
441
442 // For testing purposes only.
443 const AsmRemarkCollection* ref() const { return _remarks; }
444
445 template<typename Function>
446 inline bool iterate(Function function) const { return _remarks->iterate(function); }
447
448 private:
449 AsmRemarkCollection* _remarks;
450 };
451
452 // The assumption made here is that the number of debug strings (with a fixed
453 // address requirement) is a rather small set per compilation unit.
454
455 class DbgStrings {
456 public:
457 DbgStrings();
458 ~DbgStrings();
459
460 void init();
461
462 const char* insert(const char* dbgstr);
463
464 bool is_empty() const;
465
466 void share(const DbgStrings &src);
467 void clear();
468 // Clear Collection refence when storing AOT code,
469 // new one will be created during AOT code load.
470 void clear_ref() { _strings = nullptr; }
471
472 // For testing purposes only.
473 const DbgStringCollection* ref() const { return _strings; }
474
475 template<typename Function>
476 bool iterate(Function function) const { return _strings->iterate(function); }
477
478 private:
479 DbgStringCollection* _strings;
480 };
481 #endif // not PRODUCT
482
483
484 #ifdef ASSERT
485 #include "utilities/copy.hpp"
486
487 class Scrubber {
488 public:
489 Scrubber(void* addr, size_t size) : _addr(addr), _size(size) {}
490 ~Scrubber() {
|