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
|
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 static void init(AsmRemarks& asm_remarks);
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 uint print(uint offset, outputStream* strm = tty) const;
438
439 // For testing purposes only.
440 const AsmRemarkCollection* ref() const { return _remarks; }
441
442 template<typename Function>
443 inline bool iterate(Function function) const { return _remarks->iterate(function); }
444
445 private:
446 AsmRemarkCollection* _remarks;
447 };
448
449 // The assumption made here is that the number of debug strings (with a fixed
450 // address requirement) is a rather small set per compilation unit.
451
452 class DbgStrings {
453 public:
454 DbgStrings();
455 ~DbgStrings();
456
457 static void init(DbgStrings& dbg_strings);
458
459 const char* insert(const char* dbgstr);
460
461 bool is_empty() const;
462
463 void share(const DbgStrings &src);
464 void clear();
465
466 // For testing purposes only.
467 const DbgStringCollection* ref() const { return _strings; }
468
469 template<typename Function>
470 bool iterate(Function function) const { return _strings->iterate(function); }
471
472 private:
473 DbgStringCollection* _strings;
474 };
475 #endif // not PRODUCT
476
477
478 #ifdef ASSERT
|