Skip to content

Commit ed0c689

Browse files
Merge tag 'jdk-24+32' into ola/24.2_jdk-24+32
Added tag jdk-24+32 for changeset 1495f7a
2 parents a5b1992 + 1495f7a commit ed0c689

File tree

100 files changed

+2123
-1318
lines changed

Some content is hidden

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

100 files changed

+2123
-1318
lines changed

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
189189
} else {
190190
fn = CAST_FROM_FN_PTR(address, StubRoutines::dsin());
191191
}
192-
__ call(fn);
192+
__ rt_call(fn);
193193
__ mv(ra, x9);
194194
break;
195195
case Interpreter::java_lang_math_cos :
@@ -202,7 +202,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
202202
} else {
203203
fn = CAST_FROM_FN_PTR(address, StubRoutines::dcos());
204204
}
205-
__ call(fn);
205+
__ rt_call(fn);
206206
__ mv(ra, x9);
207207
break;
208208
case Interpreter::java_lang_math_tan :
@@ -215,7 +215,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
215215
} else {
216216
fn = CAST_FROM_FN_PTR(address, StubRoutines::dtan());
217217
}
218-
__ call(fn);
218+
__ rt_call(fn);
219219
__ mv(ra, x9);
220220
break;
221221
case Interpreter::java_lang_math_log :
@@ -228,7 +228,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
228228
} else {
229229
fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog());
230230
}
231-
__ call(fn);
231+
__ rt_call(fn);
232232
__ mv(ra, x9);
233233
break;
234234
case Interpreter::java_lang_math_log10 :
@@ -241,7 +241,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
241241
} else {
242242
fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog10());
243243
}
244-
__ call(fn);
244+
__ rt_call(fn);
245245
__ mv(ra, x9);
246246
break;
247247
case Interpreter::java_lang_math_exp :
@@ -254,7 +254,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
254254
} else {
255255
fn = CAST_FROM_FN_PTR(address, StubRoutines::dexp());
256256
}
257-
__ call(fn);
257+
__ rt_call(fn);
258258
__ mv(ra, x9);
259259
break;
260260
case Interpreter::java_lang_math_pow :
@@ -268,7 +268,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
268268
} else {
269269
fn = CAST_FROM_FN_PTR(address, StubRoutines::dpow());
270270
}
271-
__ call(fn);
271+
__ rt_call(fn);
272272
__ mv(ra, x9);
273273
break;
274274
case Interpreter::java_lang_math_fmaD :

src/hotspot/cpu/x86/stubRoutines_x86.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum platform_dependent_constants {
3838
// AVX512 intrinsics add more code in 64-bit VM,
3939
// Windows have more code to save/restore registers
4040
_compiler_stubs_code_size = 20000 LP64_ONLY(+47000) WINDOWS_ONLY(+2000),
41-
_final_stubs_code_size = 10000 LP64_ONLY(+20000) WINDOWS_ONLY(+2000) ZGC_ONLY(+20000)
41+
_final_stubs_code_size = 10000 LP64_ONLY(+20000) WINDOWS_ONLY(+22000) ZGC_ONLY(+20000)
4242
};
4343

4444
class x86 {

src/hotspot/share/code/codeCache.cpp

+2-2
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
* 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
@@ -205,7 +205,7 @@ void CodeCache::initialize_heaps() {
205205
const bool cache_size_set = FLAG_IS_CMDLINE(ReservedCodeCacheSize);
206206
const size_t ps = page_size(false, 8);
207207
const size_t min_size = MAX2(os::vm_allocation_granularity(), ps);
208-
const size_t min_cache_size = CompilerConfig::min_code_cache_size(); // Make sure we have enough space for VM internal code
208+
const size_t min_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3); // Make sure we have enough space for VM internal code
209209
size_t cache_size = align_up(ReservedCodeCacheSize, min_size);
210210

211211
// Prerequisites

src/hotspot/share/compiler/compilationPolicy.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 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
@@ -455,7 +455,7 @@ void CompilationPolicy::initialize() {
455455
c2_size = C2Compiler::initial_code_buffer_size();
456456
#endif
457457
size_t buffer_size = c1_only ? c1_size : (c1_size/3 + 2*c2_size/3);
458-
int max_count = (ReservedCodeCacheSize - (int)CompilerConfig::min_code_cache_size()) / (int)buffer_size;
458+
int max_count = (ReservedCodeCacheSize - (CodeCacheMinimumUseSpace DEBUG_ONLY(* 3))) / (int)buffer_size;
459459
if (count > max_count) {
460460
// Lower the compiler count such that all buffers fit into the code cache
461461
count = MAX2(max_count, c1_only ? 1 : 2);

src/hotspot/share/compiler/compilerDefinitions.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 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
@@ -475,7 +475,8 @@ void CompilerConfig::set_jvmci_specific_flags() {
475475

476476
bool CompilerConfig::check_args_consistency(bool status) {
477477
// Check lower bounds of the code cache
478-
size_t min_code_cache_size = CompilerConfig::min_code_cache_size();
478+
// Template Interpreter code is approximately 3X larger in debug builds.
479+
uint min_code_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3);
479480
if (ReservedCodeCacheSize < InitialCodeCacheSize) {
480481
jio_fprintf(defaultStream::error_stream(),
481482
"Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n",

src/hotspot/share/compiler/compilerDefinitions.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 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
@@ -148,8 +148,6 @@ class CompilerConfig : public AllStatic {
148148
inline static bool is_c2_or_jvmci_compiler_only();
149149
inline static bool is_c2_or_jvmci_compiler_enabled();
150150

151-
inline static size_t min_code_cache_size();
152-
153151
private:
154152
static bool is_compilation_mode_selected();
155153
static void set_compilation_policy_flags();

src/hotspot/share/compiler/compilerDefinitions.inline.hpp

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 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
@@ -25,12 +25,6 @@
2525
#ifndef SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP
2626
#define SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP
2727

28-
#ifdef COMPILER1
29-
#include "c1/c1_Compiler.hpp"
30-
#endif
31-
#ifdef COMPILER2
32-
#include "opto/c2compiler.hpp"
33-
#endif
3428
#include "compiler/compilerDefinitions.hpp"
3529

3630
#include "compiler/compiler_globals.hpp"
@@ -138,13 +132,4 @@ inline bool CompilerConfig::is_c2_or_jvmci_compiler_enabled() {
138132
return is_c2_enabled() || is_jvmci_compiler_enabled();
139133
}
140134

141-
inline size_t CompilerConfig::min_code_cache_size() {
142-
size_t min_code_cache_size = CodeCacheMinimumUseSpace;
143-
// Template Interpreter code is approximately 3X larger in debug builds.
144-
DEBUG_ONLY(min_code_cache_size *= 3);
145-
COMPILER1_PRESENT(min_code_cache_size += Compiler::code_buffer_size());
146-
COMPILER2_PRESENT(min_code_cache_size += C2Compiler::initial_code_buffer_size());
147-
return min_code_cache_size;
148-
}
149-
150135
#endif // SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP

src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ size_t ShenandoahGenerationalMemoryPool::used_in_bytes() {
9393
return _generation->used();
9494
}
9595

96-
size_t ShenandoahGenerationalMemoryPool::max_size() const {
97-
return _generation->max_capacity();
98-
}
99-
100-
10196
ShenandoahYoungGenMemoryPool::ShenandoahYoungGenMemoryPool(ShenandoahHeap* heap) :
10297
ShenandoahGenerationalMemoryPool(heap,
10398
"Shenandoah Young Gen",

src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class ShenandoahGenerationalMemoryPool: public ShenandoahMemoryPool {
5555
explicit ShenandoahGenerationalMemoryPool(ShenandoahHeap* heap, const char* name, ShenandoahGeneration* generation);
5656
MemoryUsage get_memory_usage() override;
5757
size_t used_in_bytes() override;
58-
size_t max_size() const override;
5958
};
6059

6160
class ShenandoahYoungGenMemoryPool : public ShenandoahGenerationalMemoryPool {

src/hotspot/share/opto/addnode.cpp

-150
Original file line numberDiff line numberDiff line change
@@ -395,159 +395,9 @@ Node* AddNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) {
395395
}
396396
}
397397

398-
// Convert a + a + ... + a into a*n
399-
Node* serial_additions = convert_serial_additions(phase, bt);
400-
if (serial_additions != nullptr) {
401-
return serial_additions;
402-
}
403-
404398
return AddNode::Ideal(phase, can_reshape);
405399
}
406400

407-
// Try to convert a serial of additions into a single multiplication. Also convert `(a * CON) + a` to `(CON + 1) * a` as
408-
// a side effect. On success, a new MulNode is returned.
409-
Node* AddNode::convert_serial_additions(PhaseGVN* phase, BasicType bt) {
410-
// We need to make sure that the current AddNode is not part of a MulNode that has already been optimized to a
411-
// power-of-2 addition (e.g., 3 * a => (a << 2) + a). Without this check, GVN would keep trying to optimize the same
412-
// node and can't progress. For example, 3 * a => (a << 2) + a => 3 * a => (a << 2) + a => ...
413-
if (find_power_of_two_addition_pattern(this, bt, nullptr) != nullptr) {
414-
return nullptr;
415-
}
416-
417-
Node* in1 = in(1);
418-
Node* in2 = in(2);
419-
jlong multiplier;
420-
421-
// While multiplications can be potentially optimized to power-of-2 subtractions (e.g., a * 7 => (a << 3) - a),
422-
// (x - y) + y => x is already handled by the Identity() methods. So, we don't need to check for that pattern here.
423-
if (find_simple_addition_pattern(in1, bt, &multiplier) == in2
424-
|| find_simple_lshift_pattern(in1, bt, &multiplier) == in2
425-
|| find_simple_multiplication_pattern(in1, bt, &multiplier) == in2
426-
|| find_power_of_two_addition_pattern(in1, bt, &multiplier) == in2) {
427-
multiplier++; // +1 for the in2 term
428-
429-
Node* con = (bt == T_INT)
430-
? (Node*) phase->intcon((jint) multiplier) // intentional type narrowing to allow overflow at max_jint
431-
: (Node*) phase->longcon(multiplier);
432-
return MulNode::make(con, in2, bt);
433-
}
434-
435-
return nullptr;
436-
}
437-
438-
// Try to match `a + a`. On success, return `a` and set `2` as `multiplier`.
439-
// The method matches `n` for pattern: AddNode(a, a).
440-
Node* AddNode::find_simple_addition_pattern(Node* n, BasicType bt, jlong* multiplier) {
441-
if (n->Opcode() == Op_Add(bt) && n->in(1) == n->in(2)) {
442-
*multiplier = 2;
443-
return n->in(1);
444-
}
445-
446-
return nullptr;
447-
}
448-
449-
// Try to match `a << CON`. On success, return `a` and set `1 << CON` as `multiplier`.
450-
// Match `n` for pattern: LShiftNode(a, CON).
451-
// Note that the power-of-2 multiplication optimization could potentially convert a MulNode to this pattern.
452-
Node* AddNode::find_simple_lshift_pattern(Node* n, BasicType bt, jlong* multiplier) {
453-
// Note that power-of-2 multiplication optimization could potentially convert a MulNode to this pattern
454-
if (n->Opcode() == Op_LShift(bt) && n->in(2)->is_Con()) {
455-
Node* con = n->in(2);
456-
if (con->is_top()) {
457-
return nullptr;
458-
}
459-
460-
*multiplier = ((jlong) 1 << con->get_int());
461-
return n->in(1);
462-
}
463-
464-
return nullptr;
465-
}
466-
467-
// Try to match `CON * a`. On success, return `a` and set `CON` as `multiplier`.
468-
// Match `n` for patterns:
469-
// - MulNode(CON, a)
470-
// - MulNode(a, CON)
471-
Node* AddNode::find_simple_multiplication_pattern(Node* n, BasicType bt, jlong* multiplier) {
472-
// This optimization technically only produces MulNode(CON, a), but we might as match MulNode(a, CON), too.
473-
if (n->Opcode() == Op_Mul(bt) && (n->in(1)->is_Con() || n->in(2)->is_Con())) {
474-
Node* con = n->in(1);
475-
Node* base = n->in(2);
476-
477-
// swap ConNode to lhs for easier matching
478-
if (!con->is_Con()) {
479-
swap(con, base);
480-
}
481-
482-
if (con->is_top()) {
483-
return nullptr;
484-
}
485-
486-
*multiplier = con->get_integer_as_long(bt);
487-
return base;
488-
}
489-
490-
return nullptr;
491-
}
492-
493-
// Try to match `(a << CON1) + (a << CON2)`. On success, return `a` and set `(1 << CON1) + (1 << CON2)` as `multiplier`.
494-
// Match `n` for patterns:
495-
// - AddNode(LShiftNode(a, CON), LShiftNode(a, CON)/a)
496-
// - AddNode(LShiftNode(a, CON)/a, LShiftNode(a, CON))
497-
// given that lhs is different from rhs.
498-
// Note that one of the term of the addition could simply be `a` (i.e., a << 0). Calling this function with `multiplier`
499-
// being null is safe.
500-
Node* AddNode::find_power_of_two_addition_pattern(Node* n, BasicType bt, jlong* multiplier) {
501-
if (n->Opcode() == Op_Add(bt) && n->in(1) != n->in(2)) {
502-
Node* lhs = n->in(1);
503-
Node* rhs = n->in(2);
504-
505-
// swap LShiftNode to lhs for easier matching
506-
if (lhs->Opcode() != Op_LShift(bt)) {
507-
swap(lhs, rhs);
508-
}
509-
510-
// AddNode(LShiftNode(a, CON), *)?
511-
if (lhs->Opcode() != Op_LShift(bt) || !lhs->in(2)->is_Con()) {
512-
return nullptr;
513-
}
514-
515-
jlong lhs_multiplier = 0;
516-
if (multiplier != nullptr) {
517-
Node* con = lhs->in(2);
518-
if (con->is_top()) {
519-
return nullptr;
520-
}
521-
522-
lhs_multiplier = (jlong) 1 << con->get_int();
523-
}
524-
525-
// AddNode(LShiftNode(a, CON), a)?
526-
if (lhs->in(1) == rhs) {
527-
if (multiplier != nullptr) {
528-
*multiplier = lhs_multiplier + 1;
529-
}
530-
531-
return rhs;
532-
}
533-
534-
// AddNode(LShiftNode(a, CON), LShiftNode(a, CON2))?
535-
if (rhs->Opcode() == Op_LShift(bt) && lhs->in(1) == rhs->in(1) && rhs->in(2)->is_Con()) {
536-
if (multiplier != nullptr) {
537-
Node* con = rhs->in(2);
538-
if (con->is_top()) {
539-
return nullptr;
540-
}
541-
542-
*multiplier = lhs_multiplier + ((jlong) 1 << con->get_int());
543-
}
544-
545-
return lhs->in(1);
546-
}
547-
return nullptr;
548-
}
549-
return nullptr;
550-
}
551401

552402
Node* AddINode::Ideal(PhaseGVN* phase, bool can_reshape) {
553403
Node* in1 = in(1);

src/hotspot/share/opto/addnode.hpp

-7
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ typedef const Pair<Node*, jint> ConstAddOperands;
4242
// by virtual functions.
4343
class AddNode : public Node {
4444
virtual uint hash() const;
45-
46-
Node* convert_serial_additions(PhaseGVN* phase, BasicType bt);
47-
static Node* find_simple_addition_pattern(Node* n, BasicType bt, jlong* multiplier);
48-
static Node* find_simple_lshift_pattern(Node* n, BasicType bt, jlong* multiplier);
49-
static Node* find_simple_multiplication_pattern(Node* n, BasicType bt, jlong* multiplier);
50-
static Node* find_power_of_two_addition_pattern(Node* n, BasicType bt, jlong* multiplier);
51-
5245
public:
5346
AddNode( Node *in1, Node *in2 ) : Node(nullptr,in1,in2) {
5447
init_class_id(Class_Add);

0 commit comments

Comments
 (0)