Skip to content

Commit 655176e

Browse files
authored
Merge branch 'openjdk:master' into JDK-8369027
2 parents d936251 + 012e079 commit 655176e

File tree

322 files changed

+3925
-2917
lines changed

Some content is hidden

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

322 files changed

+3925
-2917
lines changed

make/devkit/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2025, 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
@@ -58,7 +58,7 @@
5858
COMMA := ,
5959

6060
os := $(shell uname -o)
61-
cpu := $(shell uname -p)
61+
cpu := $(shell uname -m)
6262

6363
# Figure out what platform this is building on.
6464
me := $(cpu)-$(if $(findstring Linux,$(os)),linux-gnu)

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,10 +2568,6 @@ RegMask Matcher::modL_proj_mask() {
25682568
return RegMask();
25692569
}
25702570

2571-
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
2572-
return FP_REG_mask();
2573-
}
2574-
25752571
bool size_fits_all_mem_uses(AddPNode* addp, int shift) {
25762572
for (DUIterator_Fast imax, i = addp->fast_outs(imax); i < imax; i++) {
25772573
Node* u = addp->fast_out(i);

src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,6 @@ LIR_Opr FrameMap::stack_pointer() {
383383
return FrameMap::sp_opr;
384384
}
385385

386-
387-
// JSR 292
388-
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
389-
return LIR_OprFact::illegalOpr; // Not needed on aarch64
390-
}
391-
392-
393386
bool FrameMap::validate_frame() {
394387
return true;
395388
}

src/hotspot/cpu/aarch64/frame_aarch64.cpp

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
228228

229229
nmethod* nm = sender_blob->as_nmethod_or_null();
230230
if (nm != nullptr) {
231-
if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||
232-
nm->method()->is_method_handle_intrinsic()) {
231+
if (nm->is_deopt_entry(sender_pc) || nm->method()->is_method_handle_intrinsic()) {
233232
return false;
234233
}
235234
}
@@ -454,48 +453,6 @@ JavaThread** frame::saved_thread_address(const frame& f) {
454453
return thread_addr;
455454
}
456455

457-
//------------------------------------------------------------------------------
458-
// frame::verify_deopt_original_pc
459-
//
460-
// Verifies the calculated original PC of a deoptimization PC for the
461-
// given unextended SP.
462-
#ifdef ASSERT
463-
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) {
464-
frame fr;
465-
466-
// This is ugly but it's better than to change {get,set}_original_pc
467-
// to take an SP value as argument. And it's only a debugging
468-
// method anyway.
469-
fr._unextended_sp = unextended_sp;
470-
471-
address original_pc = nm->get_original_pc(&fr);
472-
assert(nm->insts_contains_inclusive(original_pc),
473-
"original PC must be in the main code section of the compiled method (or must be immediately following it)");
474-
}
475-
#endif
476-
477-
//------------------------------------------------------------------------------
478-
// frame::adjust_unextended_sp
479-
#ifdef ASSERT
480-
void frame::adjust_unextended_sp() {
481-
// On aarch64, sites calling method handle intrinsics and lambda forms are treated
482-
// as any other call site. Therefore, no special action is needed when we are
483-
// returning to any of these call sites.
484-
485-
if (_cb != nullptr) {
486-
nmethod* sender_nm = _cb->as_nmethod_or_null();
487-
if (sender_nm != nullptr) {
488-
// If the sender PC is a deoptimization point, get the original PC.
489-
if (sender_nm->is_deopt_entry(_pc) ||
490-
sender_nm->is_deopt_mh_entry(_pc)) {
491-
verify_deopt_original_pc(sender_nm, _unextended_sp);
492-
}
493-
}
494-
}
495-
}
496-
#endif
497-
498-
499456
//------------------------------------------------------------------------------
500457
// frame::sender_for_interpreter_frame
501458
frame frame::sender_for_interpreter_frame(RegisterMap* map) const {

src/hotspot/cpu/aarch64/frame_aarch64.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, 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
*
@@ -141,8 +141,6 @@
141141
int _offset_unextended_sp; // for use in stack-chunk frames
142142
};
143143

144-
void adjust_unextended_sp() NOT_DEBUG_RETURN;
145-
146144
// true means _sp value is correct and we can use it to get the sender's sp
147145
// of the compiled frame, otherwise, _sp value may be invalid and we can use
148146
// _fp to get the sender's sp if PreserveFramePointer is enabled.
@@ -152,11 +150,6 @@
152150
return (intptr_t*) addr_at(offset);
153151
}
154152

155-
#ifdef ASSERT
156-
// Used in frame::sender_for_{interpreter,compiled}_frame
157-
static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp);
158-
#endif
159-
160153
public:
161154
// Constructors
162155

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ inline void frame::init(intptr_t* sp, intptr_t* fp, address pc) {
116116
}
117117

118118
inline void frame::setup(address pc) {
119-
adjust_unextended_sp();
120-
121119
address original_pc = get_deopt_original_pc();
122120
if (original_pc != nullptr) {
123121
_pc = original_pc;
@@ -223,7 +221,6 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) {
223221
// assert(_pc != nullptr, "no pc?");
224222

225223
_cb = CodeCache::find_blob(_pc);
226-
adjust_unextended_sp();
227224

228225
address original_pc = get_deopt_original_pc();
229226
if (original_pc != nullptr) {

src/hotspot/cpu/arm/arm.ad

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,10 +1154,6 @@ RegMask Matcher::modL_proj_mask() {
11541154
return RegMask();
11551155
}
11561156

1157-
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
1158-
return FP_REGP_mask();
1159-
}
1160-
11611157
bool maybe_far_call(const CallNode *n) {
11621158
return !MacroAssembler::_reachable_from_cache(n->as_Call()->entry_point());
11631159
}
@@ -1248,23 +1244,6 @@ encode %{
12481244
__ set_inst_mark(mark);
12491245
%}
12501246

1251-
enc_class preserve_SP %{
1252-
// preserve mark
1253-
address mark = __ inst_mark();
1254-
DEBUG_ONLY(int off0 = __ offset());
1255-
// FP is preserved across all calls, even compiled calls.
1256-
// Use it to preserve SP in places where the callee might change the SP.
1257-
__ mov(Rmh_SP_save, SP);
1258-
DEBUG_ONLY(int off1 = __ offset());
1259-
assert(off1 - off0 == 4, "correct size prediction");
1260-
// restore mark
1261-
__ set_inst_mark(mark);
1262-
%}
1263-
1264-
enc_class restore_SP %{
1265-
__ mov(SP, Rmh_SP_save);
1266-
%}
1267-
12681247
enc_class Java_Dynamic_Call (method meth) %{
12691248
Register R8_ic_reg = reg_to_register_object(Matcher::inline_cache_reg_encode());
12701249
assert(R8_ic_reg == Ricklass, "should be");
@@ -8799,7 +8778,6 @@ instruct safePoint_poll(iRegP poll, R12RegI tmp, flagsReg icc) %{
87998778
// Call Java Static Instruction
88008779
instruct CallStaticJavaDirect( method meth ) %{
88018780
match(CallStaticJava);
8802-
predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke());
88038781
effect(USE meth);
88048782

88058783
ins_cost(CALL_COST);
@@ -8808,20 +8786,6 @@ instruct CallStaticJavaDirect( method meth ) %{
88088786
ins_pipe(simple_call);
88098787
%}
88108788

8811-
// Call Java Static Instruction (method handle version)
8812-
instruct CallStaticJavaHandle( method meth ) %{
8813-
match(CallStaticJava);
8814-
predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke());
8815-
effect(USE meth);
8816-
// FP is saved by all callees (for interpreter stack correction).
8817-
// We use it here for a similar purpose, in {preserve,restore}_FP.
8818-
8819-
ins_cost(CALL_COST);
8820-
format %{ "CALL,static/MethodHandle ==> " %}
8821-
ins_encode( SetInstMark, preserve_SP, Java_Static_Call( meth ), restore_SP, call_epilog, ClearInstMark );
8822-
ins_pipe(simple_call);
8823-
%}
8824-
88258789
// Call Java Dynamic Instruction
88268790
instruct CallDynamicJavaDirect( method meth ) %{
88278791
match(CallDynamicJava);

src/hotspot/cpu/arm/arm_32.ad

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Copyright (c) 2008, 2025, 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
@@ -432,8 +432,7 @@ OptoRegPair c2::return_value(int ideal_reg) {
432432

433433
int MachCallStaticJavaNode::ret_addr_offset() {
434434
bool far = (_method == nullptr) ? maybe_far_call(this) : !cache_reachable();
435-
return ((far ? 3 : 1) + (_method_handle_invoke ? 1 : 0)) *
436-
NativeInstruction::instruction_size;
435+
return (far ? 3 : 1) * NativeInstruction::instruction_size;
437436
}
438437

439438
int MachCallDynamicJavaNode::ret_addr_offset() {

src/hotspot/cpu/arm/c1_FrameMap_arm.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,6 @@ LIR_Opr FrameMap::stack_pointer() {
174174
return FrameMap::SP_opr;
175175
}
176176

177-
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
178-
assert(Rmh_SP_save == FP, "Fix register used for saving SP for MethodHandle calls");
179-
return FP_opr;
180-
}
181-
182177
bool FrameMap::validate_frame() {
183178
int max_offset = in_bytes(framesize_in_bytes());
184179
int java_index = 0;

src/hotspot/cpu/arm/c1_Runtime1_arm.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,6 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe
275275
}
276276

277277

278-
static void restore_sp_for_method_handle(StubAssembler* sasm) {
279-
// Restore SP from its saved reg (FP) if the exception PC is a MethodHandle call site.
280-
__ ldr_s32(Rtemp, Address(Rthread, JavaThread::is_method_handle_return_offset()));
281-
__ cmp(Rtemp, 0);
282-
__ mov(SP, Rmh_SP_save, ne);
283-
}
284-
285-
286278
OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler* sasm) {
287279
__ block_comment("generate_handle_exception");
288280

@@ -339,7 +331,6 @@ OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler* sasm) {
339331
break;
340332
case StubId::c1_handle_exception_from_callee_id:
341333
restore_live_registers_without_return(sasm); // must not jump immediately to handler
342-
restore_sp_for_method_handle(sasm);
343334
__ ret();
344335
break;
345336
default: ShouldNotReachHere();
@@ -372,9 +363,6 @@ void Runtime1::generate_unwind_exception(StubAssembler* sasm) {
372363
// Jump to handler
373364
__ verify_not_null_oop(Rexception_obj);
374365

375-
// JSR292 extension
376-
restore_sp_for_method_handle(sasm);
377-
378366
__ jump(R0);
379367
}
380368

0 commit comments

Comments
 (0)