Skip to content

Commit 83eba86

Browse files
author
Vladimir Kozlov
committed
8329332: Remove CompiledMethod and CodeBlobLayout classes
Reviewed-by: vlivanov, stefank
1 parent 28216aa commit 83eba86

File tree

118 files changed

+2114
-2580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2114
-2580
lines changed

src/hotspot/cpu/aarch64/continuationEntry_aarch64.inline.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
3535
inline frame ContinuationEntry::to_frame() const {
3636
static CodeBlob* cb = CodeCache::find_blob_fast(entry_pc());
3737
assert(cb != nullptr, "");
38-
assert(cb->as_compiled_method()->method()->is_continuation_enter_intrinsic(), "");
38+
assert(cb->as_nmethod()->method()->is_continuation_enter_intrinsic(), "");
3939
return frame(entry_sp(), entry_sp(), entry_fp(), entry_pc(), cb);
4040
}
4141

src/hotspot/cpu/aarch64/frame_aarch64.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
222222
return false;
223223
}
224224

225-
CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
225+
nmethod* nm = sender_blob->as_nmethod_or_null();
226226
if (nm != nullptr) {
227227
if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||
228228
nm->method()->is_method_handle_intrinsic()) {
@@ -234,7 +234,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
234234
// because the return address counts against the callee's frame.
235235

236236
if (sender_blob->frame_size() <= 0) {
237-
assert(!sender_blob->is_compiled(), "should count return address at least");
237+
assert(!sender_blob->is_nmethod(), "should count return address at least");
238238
return false;
239239
}
240240

@@ -243,7 +243,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
243243
// should not be anything but the call stub (already covered), the interpreter (already covered)
244244
// or an nmethod.
245245

246-
if (!sender_blob->is_compiled()) {
246+
if (!sender_blob->is_nmethod()) {
247247
return false;
248248
}
249249

@@ -297,7 +297,7 @@ void frame::patch_pc(Thread* thread, address pc) {
297297
DEBUG_ONLY(address old_pc = _pc;)
298298
*pc_addr = signed_pc;
299299
_pc = pc; // must be set before call to get_deopt_original_pc
300-
address original_pc = CompiledMethod::get_deopt_original_pc(this);
300+
address original_pc = nmethod::get_deopt_original_pc(this);
301301
if (original_pc != nullptr) {
302302
assert(original_pc == old_pc, "expected original PC to be stored before patching");
303303
_deopt_state = is_deoptimized;
@@ -426,7 +426,7 @@ frame frame::sender_for_upcall_stub_frame(RegisterMap* map) const {
426426
// Verifies the calculated original PC of a deoptimization PC for the
427427
// given unextended SP.
428428
#ifdef ASSERT
429-
void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp) {
429+
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) {
430430
frame fr;
431431

432432
// This is ugly but it's better than to change {get,set}_original_pc
@@ -449,12 +449,12 @@ void frame::adjust_unextended_sp() {
449449
// returning to any of these call sites.
450450

451451
if (_cb != nullptr) {
452-
CompiledMethod* sender_cm = _cb->as_compiled_method_or_null();
453-
if (sender_cm != nullptr) {
452+
nmethod* sender_nm = _cb->as_nmethod_or_null();
453+
if (sender_nm != nullptr) {
454454
// If the sender PC is a deoptimization point, get the original PC.
455-
if (sender_cm->is_deopt_entry(_pc) ||
456-
sender_cm->is_deopt_mh_entry(_pc)) {
457-
verify_deopt_original_pc(sender_cm, _unextended_sp);
455+
if (sender_nm->is_deopt_entry(_pc) ||
456+
sender_nm->is_deopt_mh_entry(_pc)) {
457+
verify_deopt_original_pc(sender_nm, _unextended_sp);
458458
}
459459
}
460460
}

src/hotspot/cpu/aarch64/frame_aarch64.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -153,7 +153,7 @@
153153

154154
#ifdef ASSERT
155155
// Used in frame::sender_for_{interpreter,compiled}_frame
156-
static void verify_deopt_original_pc( CompiledMethod* nm, intptr_t* unextended_sp);
156+
static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp);
157157
#endif
158158

159159
public:

src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ inline void frame::init(intptr_t* sp, intptr_t* fp, address pc) {
7171
inline void frame::setup(address pc) {
7272
adjust_unextended_sp();
7373

74-
address original_pc = CompiledMethod::get_deopt_original_pc(this);
74+
address original_pc = nmethod::get_deopt_original_pc(this);
7575
if (original_pc != nullptr) {
7676
_pc = original_pc;
7777
_deopt_state = is_deoptimized;
78-
assert(_cb == nullptr || _cb->as_compiled_method()->insts_contains_inclusive(_pc),
78+
assert(_cb == nullptr || _cb->as_nmethod()->insts_contains_inclusive(_pc),
7979
"original PC must be in the main code section of the compiled method (or must be immediately following it)");
8080
} else {
8181
if (_cb == SharedRuntime::deopt_blob()) {
@@ -178,7 +178,7 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) {
178178
_cb = CodeCache::find_blob(_pc);
179179
adjust_unextended_sp();
180180

181-
address original_pc = CompiledMethod::get_deopt_original_pc(this);
181+
address original_pc = nmethod::get_deopt_original_pc(this);
182182
if (original_pc != nullptr) {
183183
_pc = original_pc;
184184
_deopt_state = is_deoptimized;
@@ -240,8 +240,8 @@ inline int frame::frame_size() const {
240240
}
241241

242242
inline int frame::compiled_frame_stack_argsize() const {
243-
assert(cb()->is_compiled(), "");
244-
return (cb()->as_compiled_method()->method()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord;
243+
assert(cb()->is_nmethod(), "");
244+
return (cb()->as_nmethod()->method()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord;
245245
}
246246

247247
inline void frame::interpreted_frame_oop_map(InterpreterOopMap* mask) const {
@@ -417,7 +417,7 @@ inline frame frame::sender_for_compiled_frame(RegisterMap* map) const {
417417
// Tell GC to use argument oopmaps for some runtime stubs that need it.
418418
// For C1, the runtime stub might not have oop maps, so set this flag
419419
// outside of update_register_map.
420-
if (!_cb->is_compiled()) { // compiled frames do not use callee-saved registers
420+
if (!_cb->is_nmethod()) { // compiled frames do not use callee-saved registers
421421
map->set_include_argument_oops(_cb->caller_must_gc_arguments(map->thread()));
422422
if (oop_map() != nullptr) {
423423
_oop_map->update_register_map(this, map);

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ static bool is_always_within_branch_range(Address entry) {
867867
// Non-compiled methods stay forever in CodeCache.
868868
// We check whether the longest possible branch is within the branch range.
869869
assert(CodeCache::find_blob(target) != nullptr &&
870-
!CodeCache::find_blob(target)->is_compiled(),
870+
!CodeCache::find_blob(target)->is_nmethod(),
871871
"runtime call of compiled method");
872872
const address right_longest_branch_start = CodeCache::high_bound() - NativeInstruction::instruction_size;
873873
const address left_longest_branch_start = CodeCache::low_bound();

src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -25,7 +25,7 @@
2525

2626
#include "precompiled.hpp"
2727
#include "asm/macroAssembler.hpp"
28-
#include "code/compiledMethod.hpp"
28+
#include "code/nmethod.hpp"
2929
#include "code/relocInfo.hpp"
3030
#include "nativeInst_aarch64.hpp"
3131
#include "oops/oop.inline.hpp"

src/hotspot/cpu/aarch64/stackChunkFrameStream_aarch64.inline.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@ template <ChunkFrames frame_kind>
3535
inline bool StackChunkFrameStream<frame_kind>::is_in_frame(void* p0) const {
3636
assert(!is_done(), "");
3737
intptr_t* p = (intptr_t*)p0;
38-
int argsize = is_compiled() ? (_cb->as_compiled_method()->method()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord : 0;
38+
int argsize = is_compiled() ? (_cb->as_nmethod()->method()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord : 0;
3939
int frame_size = _cb->frame_size() + argsize;
4040
return p == sp() - frame::sender_sp_offset || ((p - unextended_sp()) >= 0 && (p - unextended_sp()) < frame_size);
4141
}

src/hotspot/cpu/arm/frame_arm.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
8080
// ok. adapter blobs never have a frame complete and are never ok.
8181

8282
if (!_cb->is_frame_complete_at(_pc)) {
83-
if (_cb->is_compiled() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) {
83+
if (_cb->is_nmethod() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) {
8484
return false;
8585
}
8686
}
@@ -179,7 +179,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
179179
// because the return address counts against the callee's frame.
180180

181181
if (sender_blob->frame_size() <= 0) {
182-
assert(!sender_blob->is_compiled(), "should count return address at least");
182+
assert(!sender_blob->is_nmethod(), "should count return address at least");
183183
return false;
184184
}
185185

@@ -188,7 +188,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
188188
// should not be anything but the call stub (already covered), the interpreter (already covered)
189189
// or an nmethod.
190190

191-
if (!sender_blob->is_compiled()) {
191+
if (!sender_blob->is_nmethod()) {
192192
return false;
193193
}
194194

@@ -229,7 +229,7 @@ void frame::patch_pc(Thread* thread, address pc) {
229229
DEBUG_ONLY(address old_pc = _pc;)
230230
*pc_addr = pc;
231231
_pc = pc; // must be set before call to get_deopt_original_pc
232-
address original_pc = CompiledMethod::get_deopt_original_pc(this);
232+
address original_pc = nmethod::get_deopt_original_pc(this);
233233
if (original_pc != nullptr) {
234234
assert(original_pc == old_pc, "expected original PC to be stored before patching");
235235
_deopt_state = is_deoptimized;
@@ -332,7 +332,7 @@ bool frame::upcall_stub_frame_is_first() const {
332332
// given unextended SP. The unextended SP might also be the saved SP
333333
// for MethodHandle call sites.
334334
#ifdef ASSERT
335-
void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) {
335+
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) {
336336
frame fr;
337337

338338
// This is ugly but it's better than to change {get,set}_original_pc
@@ -357,19 +357,19 @@ void frame::adjust_unextended_sp() {
357357
// simplest way to tell whether we are returning to such a call site
358358
// is as follows:
359359

360-
CompiledMethod* sender_cm = (_cb == nullptr) ? nullptr : _cb->as_compiled_method_or_null();
361-
if (sender_cm != nullptr) {
360+
nmethod* sender_nm = (_cb == nullptr) ? nullptr : _cb->as_nmethod_or_null();
361+
if (sender_nm != nullptr) {
362362
// If the sender PC is a deoptimization point, get the original
363363
// PC. For MethodHandle call site the unextended_sp is stored in
364364
// saved_fp.
365-
if (sender_cm->is_deopt_mh_entry(_pc)) {
366-
DEBUG_ONLY(verify_deopt_mh_original_pc(sender_cm, _fp));
365+
if (sender_nm->is_deopt_mh_entry(_pc)) {
366+
DEBUG_ONLY(verify_deopt_mh_original_pc(sender_nm, _fp));
367367
_unextended_sp = _fp;
368368
}
369-
else if (sender_cm->is_deopt_entry(_pc)) {
370-
DEBUG_ONLY(verify_deopt_original_pc(sender_cm, _unextended_sp));
369+
else if (sender_nm->is_deopt_entry(_pc)) {
370+
DEBUG_ONLY(verify_deopt_original_pc(sender_nm, _unextended_sp));
371371
}
372-
else if (sender_cm->is_method_handle_return(_pc)) {
372+
else if (sender_nm->is_method_handle_return(_pc)) {
373373
_unextended_sp = _fp;
374374
}
375375
}

src/hotspot/cpu/arm/frame_arm.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,8 @@
9393

9494
#ifdef ASSERT
9595
// Used in frame::sender_for_{interpreter,compiled}_frame
96-
static void verify_deopt_original_pc( CompiledMethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false);
97-
static void verify_deopt_mh_original_pc(CompiledMethod* nm, intptr_t* unextended_sp) {
96+
static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false);
97+
static void verify_deopt_mh_original_pc(nmethod* nm, intptr_t* unextended_sp) {
9898
verify_deopt_original_pc(nm, unextended_sp, true);
9999
}
100100
#endif

src/hotspot/cpu/arm/frame_arm.inline.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ inline void frame::init(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, add
5858
adjust_unextended_sp();
5959
DEBUG_ONLY(_frame_index = -1;)
6060

61-
address original_pc = CompiledMethod::get_deopt_original_pc(this);
61+
address original_pc = nmethod::get_deopt_original_pc(this);
6262
if (original_pc != nullptr) {
6363
_pc = original_pc;
64-
assert(_cb->as_compiled_method()->insts_contains_inclusive(_pc),
64+
assert(_cb->as_nmethod()->insts_contains_inclusive(_pc),
6565
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
6666
_deopt_state = is_deoptimized;
6767
} else {

0 commit comments

Comments
 (0)