376 // Deal with Disassembler, VTune, Forte, JvmtiExport, MemoryService. 377 static void trace_new_stub(RuntimeBlob* blob, const char* name1, const char* name2 = ""); 378 }; 379 380 class WhiteBox; 381 //---------------------------------------------------------------------------------------------------- 382 // BufferBlob: used to hold non-relocatable machine code such as the interpreter, stubroutines, etc. 383 384 class BufferBlob: public RuntimeBlob { 385 friend class VMStructs; 386 friend class AdapterBlob; 387 friend class VtableBlob; 388 friend class MethodHandlesAdapterBlob; 389 friend class WhiteBox; 390 391 private: 392 // Creation support 393 BufferBlob(const char* name, int size); 394 BufferBlob(const char* name, int size, CodeBuffer* cb); 395 396 void* operator new(size_t s, unsigned size) throw(); 397 398 public: 399 // Creation 400 static BufferBlob* create(const char* name, int buffer_size); 401 static BufferBlob* create(const char* name, CodeBuffer* cb); 402 403 static void free(BufferBlob* buf); 404 405 // Typing 406 virtual bool is_buffer_blob() const { return true; } 407 408 // GC/Verification support 409 void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f) { /* nothing to do */ } 410 bool is_alive() const { return true; } 411 412 void verify(); 413 void print_on(outputStream* st) const; 414 void print_value_on(outputStream* st) const; 415 }; 459 }; 460 461 462 //---------------------------------------------------------------------------------------------------- 463 // RuntimeStub: describes stubs used by compiled code to call a (static) C++ runtime routine 464 465 class RuntimeStub: public RuntimeBlob { 466 friend class VMStructs; 467 private: 468 // Creation support 469 RuntimeStub( 470 const char* name, 471 CodeBuffer* cb, 472 int size, 473 int frame_complete, 474 int frame_size, 475 OopMapSet* oop_maps, 476 bool caller_must_gc_arguments 477 ); 478 479 void* operator new(size_t s, unsigned size) throw(); 480 481 public: 482 // Creation 483 static RuntimeStub* new_runtime_stub( 484 const char* stub_name, 485 CodeBuffer* cb, 486 int frame_complete, 487 int frame_size, 488 OopMapSet* oop_maps, 489 bool caller_must_gc_arguments 490 ); 491 492 // Typing 493 bool is_runtime_stub() const { return true; } 494 495 address entry_point() const { return code_begin(); } 496 497 // GC/Verification support 498 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ } 499 bool is_alive() const { return true; } 500 501 void verify(); 502 void print_on(outputStream* st) const; 503 void print_value_on(outputStream* st) const; 504 }; 505 506 507 //---------------------------------------------------------------------------------------------------- 508 // Super-class for all blobs that exist in only one instance. Implements default behaviour. 509 510 class SingletonBlob: public RuntimeBlob { 511 friend class VMStructs; 512 513 protected: 514 void* operator new(size_t s, unsigned size) throw(); 515 516 public: 517 SingletonBlob( 518 const char* name, 519 CodeBuffer* cb, 520 int header_size, 521 int size, 522 int frame_size, 523 OopMapSet* oop_maps 524 ) 525 : RuntimeBlob(name, cb, header_size, size, CodeOffsets::frame_never_safe, frame_size, oop_maps) 526 {}; 527 528 address entry_point() { return code_begin(); } 529 530 bool is_alive() const { return true; } 531 532 // GC/Verification support 533 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ } | 376 // Deal with Disassembler, VTune, Forte, JvmtiExport, MemoryService. 377 static void trace_new_stub(RuntimeBlob* blob, const char* name1, const char* name2 = ""); 378 }; 379 380 class WhiteBox; 381 //---------------------------------------------------------------------------------------------------- 382 // BufferBlob: used to hold non-relocatable machine code such as the interpreter, stubroutines, etc. 383 384 class BufferBlob: public RuntimeBlob { 385 friend class VMStructs; 386 friend class AdapterBlob; 387 friend class VtableBlob; 388 friend class MethodHandlesAdapterBlob; 389 friend class WhiteBox; 390 391 private: 392 // Creation support 393 BufferBlob(const char* name, int size); 394 BufferBlob(const char* name, int size, CodeBuffer* cb); 395 396 // This ordinary operator delete is needed even though not used, so the 397 // below two-argument operator delete will be treated as a placement 398 // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2. 399 void operator delete(void* p); 400 void* operator new(size_t s, unsigned size) throw(); 401 402 public: 403 // Creation 404 static BufferBlob* create(const char* name, int buffer_size); 405 static BufferBlob* create(const char* name, CodeBuffer* cb); 406 407 static void free(BufferBlob* buf); 408 409 // Typing 410 virtual bool is_buffer_blob() const { return true; } 411 412 // GC/Verification support 413 void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f) { /* nothing to do */ } 414 bool is_alive() const { return true; } 415 416 void verify(); 417 void print_on(outputStream* st) const; 418 void print_value_on(outputStream* st) const; 419 }; 463 }; 464 465 466 //---------------------------------------------------------------------------------------------------- 467 // RuntimeStub: describes stubs used by compiled code to call a (static) C++ runtime routine 468 469 class RuntimeStub: public RuntimeBlob { 470 friend class VMStructs; 471 private: 472 // Creation support 473 RuntimeStub( 474 const char* name, 475 CodeBuffer* cb, 476 int size, 477 int frame_complete, 478 int frame_size, 479 OopMapSet* oop_maps, 480 bool caller_must_gc_arguments 481 ); 482 483 // This ordinary operator delete is needed even though not used, so the 484 // below two-argument operator delete will be treated as a placement 485 // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2. 486 void operator delete(void* p); 487 void* operator new(size_t s, unsigned size) throw(); 488 489 public: 490 // Creation 491 static RuntimeStub* new_runtime_stub( 492 const char* stub_name, 493 CodeBuffer* cb, 494 int frame_complete, 495 int frame_size, 496 OopMapSet* oop_maps, 497 bool caller_must_gc_arguments 498 ); 499 500 // Typing 501 bool is_runtime_stub() const { return true; } 502 503 address entry_point() const { return code_begin(); } 504 505 // GC/Verification support 506 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ } 507 bool is_alive() const { return true; } 508 509 void verify(); 510 void print_on(outputStream* st) const; 511 void print_value_on(outputStream* st) const; 512 }; 513 514 515 //---------------------------------------------------------------------------------------------------- 516 // Super-class for all blobs that exist in only one instance. Implements default behaviour. 517 518 class SingletonBlob: public RuntimeBlob { 519 friend class VMStructs; 520 521 protected: 522 // This ordinary operator delete is needed even though not used, so the 523 // below two-argument operator delete will be treated as a placement 524 // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2. 525 void operator delete(void* p); 526 void* operator new(size_t s, unsigned size) throw(); 527 528 public: 529 SingletonBlob( 530 const char* name, 531 CodeBuffer* cb, 532 int header_size, 533 int size, 534 int frame_size, 535 OopMapSet* oop_maps 536 ) 537 : RuntimeBlob(name, cb, header_size, size, CodeOffsets::frame_never_safe, frame_size, oop_maps) 538 {}; 539 540 address entry_point() { return code_begin(); } 541 542 bool is_alive() const { return true; } 543 544 // GC/Verification support 545 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ } |