< prev index next >

src/hotspot/share/asm/codeBuffer.hpp

Print this page

415 };
416 
417 // The assumption made here is that most code remarks (or comments) added to
418 // the generated assembly code are unique, i.e. there is very little gain in
419 // trying to share the strings between the different offsets tracked in a
420 // buffer (or blob).
421 
422 class AsmRemarks {
423  public:
424   AsmRemarks();
425  ~AsmRemarks();
426 
427   void init();
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   void init();
456 
457   const char* insert(const char* dbgstr);
458 
459   bool is_empty() const;
460 
461   void share(const DbgStrings &src);
462   void clear();



463 
464   // For testing purposes only.
465   const DbgStringCollection* ref() const { return _strings; }
466 
467   template<typename Function>
468   bool iterate(Function function) const { return _strings->iterate(function); }
469 
470 private:
471   DbgStringCollection* _strings;
472 };
473 #endif // not PRODUCT
474 
475 
476 #ifdef ASSERT
477 #include "utilities/copy.hpp"
478 
479 class Scrubber {
480  public:
481   Scrubber(void* addr, size_t size) : _addr(addr), _size(size) {}
482  ~Scrubber() {

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