@@ -119,11 +119,6 @@ class CodeBlob {
119119#ifndef PRODUCT
120120 AsmRemarks _asm_remarks;
121121 DbgStrings _dbg_strings;
122-
123- ~CodeBlob () {
124- _asm_remarks.clear ();
125- _dbg_strings.clear ();
126- }
127122#endif // not PRODUCT
128123
129124 CodeBlob (const char * name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset,
@@ -132,10 +127,17 @@ class CodeBlob {
132127 CodeBlob (const char * name, CompilerType type, const CodeBlobLayout& layout, CodeBuffer* cb, int frame_complete_offset,
133128 int frame_size, OopMapSet* oop_maps,
134129 bool caller_must_gc_arguments, bool compiled = false );
130+
131+ void operator delete (void * p) { }
132+
135133public:
136134 // Only used by unit test.
137135 CodeBlob () : _type(compiler_none) {}
138136
137+ virtual ~CodeBlob () {
138+ assert (_oop_maps == nullptr , " Not flushed" );
139+ }
140+
139141 // Returns the space needed for CodeBlob
140142 static unsigned int allocation_size (CodeBuffer* cb, int header_size);
141143 static unsigned int align_code_offset (int offset);
@@ -404,10 +406,6 @@ class BufferBlob: public RuntimeBlob {
404406 BufferBlob (const char * name, int size);
405407 BufferBlob (const char * name, int size, CodeBuffer* cb);
406408
407- // This ordinary operator delete is needed even though not used, so the
408- // below two-argument operator delete will be treated as a placement
409- // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
410- void operator delete (void * p);
411409 void * operator new (size_t s, unsigned size) throw ();
412410
413411 public:
@@ -492,10 +490,6 @@ class RuntimeStub: public RuntimeBlob {
492490 bool caller_must_gc_arguments
493491 );
494492
495- // This ordinary operator delete is needed even though not used, so the
496- // below two-argument operator delete will be treated as a placement
497- // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
498- void operator delete (void * p);
499493 void * operator new (size_t s, unsigned size) throw ();
500494
501495 public:
@@ -532,10 +526,6 @@ class SingletonBlob: public RuntimeBlob {
532526 friend class VMStructs ;
533527
534528 protected:
535- // This ordinary operator delete is needed even though not used, so the
536- // below two-argument operator delete will be treated as a placement
537- // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
538- void operator delete (void * p);
539529 void * operator new (size_t s, unsigned size) throw ();
540530
541531 public:
@@ -750,10 +740,6 @@ class UpcallStub: public RuntimeBlob {
750740 intptr_t exception_handler_offset,
751741 jobject receiver, ByteSize frame_data_offset);
752742
753- // This ordinary operator delete is needed even though not used, so the
754- // below two-argument operator delete will be treated as a placement
755- // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
756- void operator delete (void * p);
757743 void * operator new (size_t s, unsigned size) throw ();
758744
759745 struct FrameData {
0 commit comments