2
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
25
#include "precompiled.hpp"
26
#include "code/codeBlob.hpp"
27
#include "code/codeCache.hpp"
28
#include "code/relocInfo.hpp"
29
#include "code/vtableStubs.hpp"
30
#include "compiler/disassembler.hpp"
31
#include "compiler/oopMap.hpp"
32
#include "interpreter/bytecode.hpp"
33
#include "interpreter/interpreter.hpp"
35
#include "memory/allocation.inline.hpp"
36
#include "memory/heap.hpp"
37
#include "memory/resourceArea.hpp"
38
#include "oops/oop.inline.hpp"
39
#include "prims/forte.hpp"
40
#include "prims/jvmtiExport.hpp"
41
#include "runtime/handles.inline.hpp"
42
#include "runtime/interfaceSupport.inline.hpp"
43
#include "runtime/javaFrameAnchor.hpp"
44
#include "runtime/jniHandles.hpp"
45
#include "runtime/mutexLocker.hpp"
46
#include "runtime/safepoint.hpp"
47
#include "runtime/sharedRuntime.hpp"
48
#include "runtime/stubCodeGenerator.hpp"
49
#include "runtime/stubRoutines.hpp"
50
#include "runtime/vframe.hpp"
51
#include "services/memoryService.hpp"
52
#include "utilities/align.hpp"
54
#include "c1/c1_Runtime1.hpp"
58
unsigned int CodeBlob::align_code_offset(int offset) {
59
// align the size to CodeEntryAlignment
60
int header_size = (int)CodeHeap::header_size();
61
return align_up(offset + header_size, CodeEntryAlignment) - header_size;
64
// This must be consistent with the CodeBlob constructor's layout actions.
65
unsigned int CodeBlob::allocation_size(CodeBuffer* cb, int header_size) {
66
unsigned int size = header_size;
67
size += align_up(cb->total_relocation_size(), oopSize);
68
// align the size to CodeEntryAlignment
69
size = align_code_offset(size);
70
size += align_up(cb->total_content_size(), oopSize);
71
size += align_up(cb->total_oop_size(), oopSize);
72
size += align_up(cb->total_metadata_size(), oopSize);
76
CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, uint16_t header_size,
77
int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) :
78
_oop_maps(nullptr), // will be set by set_oop_maps() call
81
_relocation_size(align_up(cb->total_relocation_size(), oopSize)),
82
_content_offset(CodeBlob::align_code_offset(header_size + _relocation_size)),
83
_code_offset(_content_offset + cb->total_offset_of(cb->insts())),
84
_data_offset(_content_offset + align_up(cb->total_content_size(), oopSize)),
85
_frame_size(frame_size),
86
S390_ONLY(_ctable_offset(0) COMMA)
87
_header_size(header_size),
88
_frame_complete_offset(frame_complete_offset),
90
_caller_must_gc_arguments(caller_must_gc_arguments)
92
assert(is_aligned(_size, oopSize), "unaligned size");
93
assert(is_aligned(header_size, oopSize), "unaligned size");
94
assert(is_aligned(_relocation_size, oopSize), "unaligned size");
95
assert(_data_offset <= _size, "codeBlob is too small: %d > %d", _data_offset, _size);
96
assert(code_end() == content_end(), "must be the same - see code_end()");
98
// probably wrong for tiered
99
assert(_frame_size >= -1, "must use frame size or -1 for runtime stubs");
102
set_oop_maps(oop_maps);
105
// Simple CodeBlob used for simple BufferBlob.
106
CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, int size, uint16_t header_size) :
111
_content_offset(CodeBlob::align_code_offset(header_size)),
112
_code_offset(_content_offset),
115
S390_ONLY(_ctable_offset(0) COMMA)
116
_header_size(header_size),
117
_frame_complete_offset(CodeOffsets::frame_never_safe),
119
_caller_must_gc_arguments(false)
121
assert(is_aligned(size, oopSize), "unaligned size");
122
assert(is_aligned(header_size, oopSize), "unaligned size");
125
void CodeBlob::purge() {
126
if (_oop_maps != nullptr) {
130
NOT_PRODUCT(_asm_remarks.clear());
131
NOT_PRODUCT(_dbg_strings.clear());
134
void CodeBlob::set_oop_maps(OopMapSet* p) {
135
// Danger Will Robinson! This method allocates a big
136
// chunk of memory, its your job to free it.
138
_oop_maps = ImmutableOopMapSet::build_from(p);
144
const ImmutableOopMap* CodeBlob::oop_map_for_return_address(address return_address) const {
145
assert(_oop_maps != nullptr, "nope");
146
return _oop_maps->find_map_at_offset((intptr_t) return_address - (intptr_t) code_begin());
149
void CodeBlob::print_code_on(outputStream* st) {
151
Disassembler::decode(this, st);
154
//-----------------------------------------------------------------------------------------
155
// Creates a RuntimeBlob from a CodeBuffer and copy code and relocation info.
157
RuntimeBlob::RuntimeBlob(
162
uint16_t header_size,
163
int16_t frame_complete,
166
bool caller_must_gc_arguments)
167
: CodeBlob(name, kind, cb, size, header_size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments)
169
cb->copy_code_and_locs_to(this);
172
void RuntimeBlob::free(RuntimeBlob* blob) {
173
assert(blob != nullptr, "caller must check for nullptr");
174
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
177
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
178
CodeCache::free(blob);
180
// Track memory usage statistic after releasing CodeCache_lock
181
MemoryService::track_code_cache_memory_usage();
184
void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const char* name2) {
185
// Do not hold the CodeCache lock during name formatting.
186
assert(!CodeCache_lock->owned_by_self(), "release CodeCache before registering the stub");
188
if (stub != nullptr && (PrintStubCode ||
189
Forte::is_enabled() ||
190
JvmtiExport::should_post_dynamic_code_generated())) {
192
assert(strlen(name1) + strlen(name2) < sizeof(stub_id), "");
193
jio_snprintf(stub_id, sizeof(stub_id), "%s%s", name1, name2);
196
tty->print_cr("- - - [BEGIN] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
197
tty->print_cr("Decoding %s " PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (%d bytes)",
198
stub_id, p2i(stub), p2i(stub->code_begin()), p2i(stub->code_end()), stub->code_size());
199
Disassembler::decode(stub->code_begin(), stub->code_end(), tty
200
NOT_PRODUCT(COMMA &stub->asm_remarks()));
201
if ((stub->oop_maps() != nullptr) && AbstractDisassembler::show_structs()) {
202
tty->print_cr("- - - [OOP MAPS]- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
203
stub->oop_maps()->print();
205
tty->print_cr("- - - [END] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
208
if (Forte::is_enabled()) {
209
Forte::register_stub(stub_id, stub->code_begin(), stub->code_end());
212
if (JvmtiExport::should_post_dynamic_code_generated()) {
213
const char* stub_name = name2;
214
if (name2[0] == '\0') stub_name = name1;
215
JvmtiExport::post_dynamic_code_generated(stub_name, stub->code_begin(), stub->code_end());
219
// Track memory usage statistic after releasing CodeCache_lock
220
MemoryService::track_code_cache_memory_usage();
223
//----------------------------------------------------------------------------------------------------
224
// Implementation of BufferBlob
226
BufferBlob::BufferBlob(const char* name, CodeBlobKind kind, int size)
227
: RuntimeBlob(name, kind, size, sizeof(BufferBlob))
230
BufferBlob* BufferBlob::create(const char* name, uint buffer_size) {
231
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
233
BufferBlob* blob = nullptr;
234
unsigned int size = sizeof(BufferBlob);
235
// align the size to CodeEntryAlignment
236
size = CodeBlob::align_code_offset(size);
237
size += align_up(buffer_size, oopSize);
238
assert(name != nullptr, "must provide a name");
240
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
241
blob = new (size) BufferBlob(name, CodeBlobKind::Buffer, size);
243
// Track memory usage statistic after releasing CodeCache_lock
244
MemoryService::track_code_cache_memory_usage();
250
BufferBlob::BufferBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size)
251
: RuntimeBlob(name, kind, cb, size, sizeof(BufferBlob), CodeOffsets::frame_never_safe, 0, nullptr)
255
BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
256
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
258
BufferBlob* blob = nullptr;
259
unsigned int size = CodeBlob::allocation_size(cb, sizeof(BufferBlob));
260
assert(name != nullptr, "must provide a name");
262
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
263
blob = new (size) BufferBlob(name, CodeBlobKind::Buffer, cb, size);
265
// Track memory usage statistic after releasing CodeCache_lock
266
MemoryService::track_code_cache_memory_usage();
271
void* BufferBlob::operator new(size_t s, unsigned size) throw() {
272
return CodeCache::allocate(size, CodeBlobType::NonNMethod);
275
void BufferBlob::free(BufferBlob *blob) {
276
RuntimeBlob::free(blob);
280
//----------------------------------------------------------------------------------------------------
281
// Implementation of AdapterBlob
283
AdapterBlob::AdapterBlob(int size, CodeBuffer* cb) :
284
BufferBlob("I2C/C2I adapters", CodeBlobKind::Adapter, cb, size) {
285
CodeCache::commit(this);
288
AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
289
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
291
CodeCache::gc_on_allocation();
293
AdapterBlob* blob = nullptr;
294
unsigned int size = CodeBlob::allocation_size(cb, sizeof(AdapterBlob));
296
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
297
blob = new (size) AdapterBlob(size, cb);
299
// Track memory usage statistic after releasing CodeCache_lock
300
MemoryService::track_code_cache_memory_usage();
305
//----------------------------------------------------------------------------------------------------
306
// Implementation of VtableBlob
308
void* VtableBlob::operator new(size_t s, unsigned size) throw() {
309
// Handling of allocation failure stops compilation and prints a bunch of
310
// stuff, which requires unlocking the CodeCache_lock, so that the Compile_lock
311
// can be locked, and then re-locking the CodeCache_lock. That is not safe in
312
// this context as we hold the CompiledICLocker. So we just don't handle code
313
// cache exhaustion here; we leave that for a later allocation that does not
314
// hold the CompiledICLocker.
315
return CodeCache::allocate(size, CodeBlobType::NonNMethod, false /* handle_alloc_failure */);
318
VtableBlob::VtableBlob(const char* name, int size) :
319
BufferBlob(name, CodeBlobKind::Vtable, size) {
322
VtableBlob* VtableBlob::create(const char* name, int buffer_size) {
323
assert(JavaThread::current()->thread_state() == _thread_in_vm, "called with the wrong state");
325
VtableBlob* blob = nullptr;
326
unsigned int size = sizeof(VtableBlob);
327
// align the size to CodeEntryAlignment
328
size = align_code_offset(size);
329
size += align_up(buffer_size, oopSize);
330
assert(name != nullptr, "must provide a name");
332
if (!CodeCache_lock->try_lock()) {
333
// If we can't take the CodeCache_lock, then this is a bad time to perform the ongoing
334
// IC transition to megamorphic, for which this stub will be needed. It is better to
335
// bail out the transition, and wait for a more opportune moment. Not only is it not
336
// worth waiting for the lock blockingly for the megamorphic transition, it might
337
// also result in a deadlock to blockingly wait, when concurrent class unloading is
338
// performed. At this point in time, the CompiledICLocker is taken, so we are not
339
// allowed to blockingly wait for the CodeCache_lock, as these two locks are otherwise
340
// consistently taken in the opposite order. Bailing out results in an IC transition to
341
// the clean state instead, which will cause subsequent calls to retry the transitioning
345
blob = new (size) VtableBlob(name, size);
346
CodeCache_lock->unlock();
348
// Track memory usage statistic after releasing CodeCache_lock
349
MemoryService::track_code_cache_memory_usage();
354
//----------------------------------------------------------------------------------------------------
355
// Implementation of MethodHandlesAdapterBlob
357
MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) {
358
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
360
MethodHandlesAdapterBlob* blob = nullptr;
361
unsigned int size = sizeof(MethodHandlesAdapterBlob);
362
// align the size to CodeEntryAlignment
363
size = CodeBlob::align_code_offset(size);
364
size += align_up(buffer_size, oopSize);
366
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
367
blob = new (size) MethodHandlesAdapterBlob(size);
368
if (blob == nullptr) {
369
vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "CodeCache: no room for method handle adapter blob");
372
// Track memory usage statistic after releasing CodeCache_lock
373
MemoryService::track_code_cache_memory_usage();
378
//----------------------------------------------------------------------------------------------------
379
// Implementation of RuntimeStub
381
RuntimeStub::RuntimeStub(
385
int16_t frame_complete,
388
bool caller_must_gc_arguments
390
: RuntimeBlob(name, CodeBlobKind::Runtime_Stub, cb, size, sizeof(RuntimeStub),
391
frame_complete, frame_size, oop_maps, caller_must_gc_arguments)
395
RuntimeStub* RuntimeStub::new_runtime_stub(const char* stub_name,
397
int16_t frame_complete,
400
bool caller_must_gc_arguments,
401
bool alloc_fail_is_fatal)
403
RuntimeStub* stub = nullptr;
404
unsigned int size = CodeBlob::allocation_size(cb, sizeof(RuntimeStub));
405
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
407
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
408
stub = new (size) RuntimeStub(stub_name, cb, size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments);
409
if (stub == nullptr) {
410
if (!alloc_fail_is_fatal) {
413
fatal("Initial size of CodeCache is too small");
417
trace_new_stub(stub, "RuntimeStub - ", stub_name);
423
void* RuntimeStub::operator new(size_t s, unsigned size) throw() {
424
return CodeCache::allocate(size, CodeBlobType::NonNMethod);
427
// operator new shared by all singletons:
428
void* SingletonBlob::operator new(size_t s, unsigned size) throw() {
429
void* p = CodeCache::allocate(size, CodeBlobType::NonNMethod);
430
if (!p) fatal("Initial size of CodeCache is too small");
435
//----------------------------------------------------------------------------------------------------
436
// Implementation of DeoptimizationBlob
438
DeoptimizationBlob::DeoptimizationBlob(
443
int unpack_with_exception_offset,
444
int unpack_with_reexecution_offset,
447
: SingletonBlob("DeoptimizationBlob", CodeBlobKind::Deoptimization, cb,
448
size, sizeof(DeoptimizationBlob), frame_size, oop_maps)
450
_unpack_offset = unpack_offset;
451
_unpack_with_exception = unpack_with_exception_offset;
452
_unpack_with_reexecution = unpack_with_reexecution_offset;
454
_unpack_with_exception_in_tls = -1;
459
DeoptimizationBlob* DeoptimizationBlob::create(
463
int unpack_with_exception_offset,
464
int unpack_with_reexecution_offset,
467
DeoptimizationBlob* blob = nullptr;
468
unsigned int size = CodeBlob::allocation_size(cb, sizeof(DeoptimizationBlob));
469
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
471
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
472
blob = new (size) DeoptimizationBlob(cb,
476
unpack_with_exception_offset,
477
unpack_with_reexecution_offset,
481
trace_new_stub(blob, "DeoptimizationBlob");
487
//----------------------------------------------------------------------------------------------------
488
// Implementation of UncommonTrapBlob
491
UncommonTrapBlob::UncommonTrapBlob(
497
: SingletonBlob("UncommonTrapBlob", CodeBlobKind::Uncommon_Trap, cb,
498
size, sizeof(UncommonTrapBlob), frame_size, oop_maps)
502
UncommonTrapBlob* UncommonTrapBlob::create(
507
UncommonTrapBlob* blob = nullptr;
508
unsigned int size = CodeBlob::allocation_size(cb, sizeof(UncommonTrapBlob));
509
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
511
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
512
blob = new (size) UncommonTrapBlob(cb, size, oop_maps, frame_size);
515
trace_new_stub(blob, "UncommonTrapBlob");
524
//----------------------------------------------------------------------------------------------------
525
// Implementation of ExceptionBlob
528
ExceptionBlob::ExceptionBlob(
534
: SingletonBlob("ExceptionBlob", CodeBlobKind::Exception, cb,
535
size, sizeof(ExceptionBlob), frame_size, oop_maps)
539
ExceptionBlob* ExceptionBlob::create(
544
ExceptionBlob* blob = nullptr;
545
unsigned int size = CodeBlob::allocation_size(cb, sizeof(ExceptionBlob));
546
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
548
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
549
blob = new (size) ExceptionBlob(cb, size, oop_maps, frame_size);
552
trace_new_stub(blob, "ExceptionBlob");
561
//----------------------------------------------------------------------------------------------------
562
// Implementation of SafepointBlob
564
SafepointBlob::SafepointBlob(
570
: SingletonBlob("SafepointBlob", CodeBlobKind::Safepoint, cb,
571
size, sizeof(SafepointBlob), frame_size, oop_maps)
575
SafepointBlob* SafepointBlob::create(
580
SafepointBlob* blob = nullptr;
581
unsigned int size = CodeBlob::allocation_size(cb, sizeof(SafepointBlob));
582
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
584
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
585
blob = new (size) SafepointBlob(cb, size, oop_maps, frame_size);
588
trace_new_stub(blob, "SafepointBlob");
593
//----------------------------------------------------------------------------------------------------
594
// Implementation of UpcallStub
596
UpcallStub::UpcallStub(const char* name, CodeBuffer* cb, int size, jobject receiver, ByteSize frame_data_offset) :
597
RuntimeBlob(name, CodeBlobKind::Upcall, cb, size, sizeof(UpcallStub),
598
CodeOffsets::frame_never_safe, 0 /* no frame size */,
599
/* oop maps = */ nullptr, /* caller must gc arguments = */ false),
601
_frame_data_offset(frame_data_offset)
603
CodeCache::commit(this);
606
void* UpcallStub::operator new(size_t s, unsigned size) throw() {
607
return CodeCache::allocate(size, CodeBlobType::NonNMethod);
610
UpcallStub* UpcallStub::create(const char* name, CodeBuffer* cb, jobject receiver, ByteSize frame_data_offset) {
611
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
613
UpcallStub* blob = nullptr;
614
unsigned int size = CodeBlob::allocation_size(cb, sizeof(UpcallStub));
616
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
617
blob = new (size) UpcallStub(name, cb, size, receiver, frame_data_offset);
619
if (blob == nullptr) {
620
return nullptr; // caller must handle this
623
// Track memory usage statistic after releasing CodeCache_lock
624
MemoryService::track_code_cache_memory_usage();
626
trace_new_stub(blob, "UpcallStub");
631
void UpcallStub::oops_do(OopClosure* f, const frame& frame) {
632
frame_data_for_frame(frame)->old_handles->oops_do(f);
635
JavaFrameAnchor* UpcallStub::jfa_for_frame(const frame& frame) const {
636
return &frame_data_for_frame(frame)->jfa;
639
void UpcallStub::free(UpcallStub* blob) {
640
assert(blob != nullptr, "caller must check for nullptr");
641
JNIHandles::destroy_global(blob->receiver());
642
RuntimeBlob::free(blob);
645
//----------------------------------------------------------------------------------------------------
646
// Verification and printing
648
void CodeBlob::print_on(outputStream* st) const {
649
st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", p2i(this));
650
st->print_cr("Framesize: %d", _frame_size);
653
void CodeBlob::print() const { print_on(tty); }
655
void CodeBlob::print_value_on(outputStream* st) const {
656
st->print_cr("[CodeBlob]");
659
void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const {
660
if (is_buffer_blob()) {
661
// the interpreter is generated into a buffer blob
662
InterpreterCodelet* i = Interpreter::codelet_containing(addr);
664
st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an Interpreter codelet", p2i(addr), (int)(addr - i->code_begin()));
668
if (Interpreter::contains(addr)) {
669
st->print_cr(INTPTR_FORMAT " is pointing into interpreter code"
670
" (not bytecode specific)", p2i(addr));
674
if (AdapterHandlerLibrary::contains(this)) {
675
st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an AdapterHandler", p2i(addr), (int)(addr - code_begin()));
676
AdapterHandlerLibrary::print_handler_on(st, this);
678
// the stubroutines are generated into a buffer blob
679
StubCodeDesc* d = StubCodeDesc::desc_for(addr);
681
st->print_cr(INTPTR_FORMAT " is at begin+%d in a stub", p2i(addr), (int)(addr - d->begin()));
686
if (StubRoutines::contains(addr)) {
687
st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) stub routine", p2i(addr));
690
VtableStub* v = VtableStubs::stub_containing(addr);
692
st->print_cr(INTPTR_FORMAT " is at entry_point+%d in a vtable stub", p2i(addr), (int)(addr - v->entry_point()));
699
nmethod* nm = (nmethod*)this;
701
st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
702
p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
705
nm->method()->print_value_on(st);
708
if (verbose && st == tty) {
709
// verbose is only ever true when called from findpc in debug.cpp
710
nm->print_nmethod(true);
716
st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - code_begin()));
720
void BufferBlob::verify() {
724
void BufferBlob::print_on(outputStream* st) const {
725
RuntimeBlob::print_on(st);
729
void BufferBlob::print_value_on(outputStream* st) const {
730
st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", p2i(this), name());
733
void RuntimeStub::verify() {
737
void RuntimeStub::print_on(outputStream* st) const {
739
RuntimeBlob::print_on(st);
740
st->print("Runtime Stub (" INTPTR_FORMAT "): ", p2i(this));
741
st->print_cr("%s", name());
742
Disassembler::decode((RuntimeBlob*)this, st);
745
void RuntimeStub::print_value_on(outputStream* st) const {
746
st->print("RuntimeStub (" INTPTR_FORMAT "): ", p2i(this)); st->print("%s", name());
749
void SingletonBlob::verify() {
753
void SingletonBlob::print_on(outputStream* st) const {
755
RuntimeBlob::print_on(st);
756
st->print_cr("%s", name());
757
Disassembler::decode((RuntimeBlob*)this, st);
760
void SingletonBlob::print_value_on(outputStream* st) const {
761
st->print_cr("%s", name());
764
void DeoptimizationBlob::print_value_on(outputStream* st) const {
765
st->print_cr("Deoptimization (frame not available)");
768
void UpcallStub::verify() {
772
void UpcallStub::print_on(outputStream* st) const {
773
RuntimeBlob::print_on(st);
775
Disassembler::decode((RuntimeBlob*)this, st);
778
void UpcallStub::print_value_on(outputStream* st) const {
779
st->print_cr("UpcallStub (" INTPTR_FORMAT ") used for %s", p2i(this), name());