Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/methodHandles_x86.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

// Adapters
enum /* platform_dependent_constants */ {
adapter_code_size = 6000 DEBUG_ONLY(+ 6000)
adapter_code_size = 8000 DEBUG_ONLY(+ 6000)
};

// Additional helper methods for MethodHandles code generation:
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,7 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
};

const char* name = SharedRuntime::stub_name(SharedStubId::jfr_write_checkpoint_id);
CodeBuffer code(name, 1024, 64);
CodeBuffer code(name, 1024 + (UseAPX ? 1024 : 0), 64);
MacroAssembler* masm = new MacroAssembler(&code);
address start = __ pc();

Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/compiler/compilerDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ void CompilerConfig::ergo_initialize() {
}

#ifdef COMPILER2
// Xcomp has no reasonable profiling information, enable inlining cold methods
if (Arguments::is_compiler_only() && FLAG_IS_DEFAULT(InlineColdMethods)) {
FLAG_SET_DEFAULT(InlineColdMethods, true);
}
if (!EliminateLocks) {
EliminateNestedLocks = false;
}
Expand Down
56 changes: 29 additions & 27 deletions src/hotspot/share/opto/bytecodeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,41 +295,43 @@ bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_met
return false;
}

// don't use counts with -Xcomp
if (UseInterpreter) {
if (!callee_method->has_compiled_code() &&
!callee_method->was_executed_more_than(0)) {
set_msg("never executed");
return true;
}
// accept cold methods in CTW or -Xcomp
if (InlineColdMethods) {
return false;
}

if (is_init_with_ea(callee_method, caller_method, C)) {
// Escape Analysis: inline all executed constructors
return false;
}
if (!callee_method->has_compiled_code() &&
!callee_method->was_executed_more_than(0)) {
set_msg("never executed");
return true;
}

if (MinInlineFrequencyRatio > 0) {
int call_site_count = caller_method->scale_count(profile.count());
int invoke_count = caller_method->interpreter_invocation_count();
assert(invoke_count != 0, "require invocation count greater than zero");
double freq = (double)call_site_count / (double)invoke_count;
// avoid division by 0, set divisor to at least 1
int cp_min_inv = MAX2(1, CompilationPolicy::min_invocations());
double min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / cp_min_inv);

if (freq < min_freq) {
set_msg("low call site frequency");
return true;
}
if (is_init_with_ea(callee_method, caller_method, C)) {
// Escape Analysis: inline all executed constructors
return false;
}

if (MinInlineFrequencyRatio > 0) {
int call_site_count = caller_method->scale_count(profile.count());
int invoke_count = caller_method->interpreter_invocation_count();
assert(invoke_count != 0, "require invocation count greater than zero");
double freq = (double)call_site_count / (double)invoke_count;
// avoid division by 0, set divisor to at least 1
int cp_min_inv = MAX2(1, CompilationPolicy::min_invocations());
double min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / cp_min_inv);

if (freq < min_freq) {
set_msg("low call site frequency");
return true;
}
}

return false;
}

bool InlineTree::is_not_reached(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile) {
if (!UseInterpreter) {
return false; // -Xcomp
if (InlineColdMethods) {
return false; // CTW or -Xcomp
}
if (profile.count() > 0) {
return false; // reachable according to profile
Expand Down Expand Up @@ -403,7 +405,7 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method,
}
}

if (!UseInterpreter &&
if (InlineColdMethods &&
is_init_with_ea(callee_method, caller_method, C)) {
// Escape Analysis stress testing when running Xcomp:
// inline constructors even if they are not reached.
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/opto/c2_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,11 @@
"high tier compiler") \
range(0, max_jint) \
\
product(bool, InlineColdMethods, false, DIAGNOSTIC, \
"Inline cold methods that would otherwise be rejected due to " \
"cold profile counters. Useful for compiler testing to expose " \
"more code to compilers.") \
\
product(bool, IncrementalInline, true, \
"do post parse inlining") \
\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ private boolean issueCommand(String cmd) throws IOException,
if (cmd.indexOf('\n') != -1 || cmd.indexOf('\r') != -1) {
sun.net.ftp.FtpProtocolException ex
= new sun.net.ftp.FtpProtocolException("Illegal FTP command");
ex.initCause(new IllegalArgumentException("Illegal carriage return"));
ex.initCause(new IllegalArgumentException("Illegal carriage return or line feed"));
throw ex;
}
sendServer(cmd + "\r\n");
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/sun/net/smtp/SmtpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void toCanonical(String s) throws IOException {
public void to(String s) throws IOException {
if (s.indexOf('\n') != -1 || s.indexOf('\r') != -1) {
throw new IOException("Illegal SMTP command",
new IllegalArgumentException("Illegal carriage return"));
new IllegalArgumentException("Illegal carriage return or line feed"));
}
int st = 0;
int limit = s.length();
Expand Down Expand Up @@ -122,7 +122,7 @@ else if (st == pos)
public void from(String s) throws IOException {
if (s.indexOf('\n') != -1 || s.indexOf('\r') != -1) {
throw new IOException("Illegal SMTP command",
new IllegalArgumentException("Illegal carriage return"));
new IllegalArgumentException("Illegal carriage return or line feed"));
}
if (s.startsWith("<")) {
issueCommand("mail from: " + s + "\r\n", 250);
Expand Down
21 changes: 8 additions & 13 deletions src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1723,17 +1723,6 @@ jboolean ProcessPath(ProcessHandler* hnd,
return JNI_TRUE;
}

/* TODO Add checking of the result of the malloc/realloc functions to handle
* out of memory error and don't leak earlier allocated data
*/


#define ALLOC(ptr, type, n) \
ptr = (type *)malloc((n)*sizeof(type))
#define REALLOC(ptr, type, n) \
ptr = (type *)realloc(ptr, (n)*sizeof(type))


struct _Edge;

typedef struct _Point {
Expand Down Expand Up @@ -1980,12 +1969,18 @@ void FillPolygon(ProcessHandler* hnd,

if (n <=1) return;

ALLOC(yHash, Point*, hashSize);
yHash = (Point**) malloc(hashSize * sizeof(Point*));
if (yHash == NULL) return;

for (k = 0; k < hashSize; k++) {
yHash[k] = NULL;
}

ALLOC(active, Edge, n);
active = (Edge*) malloc(n * sizeof(Edge));
if (active == NULL) {
free(yHash);
return;
}

/* Creating double linked list (prev, next links) describing path order and
* hash table with points which fall between scanlines. nextByY link is
Expand Down
6 changes: 5 additions & 1 deletion src/jdk.jdwp.agent/share/native/libjdwp/util.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -718,6 +718,10 @@ methodSignature(jmethodID method,
error = JVMTI_FUNC_PTR(gdata->jvmti,GetMethodName)
(gdata->jvmti, method, &name, &signature, &generic_signature);

if (error != JVMTI_ERROR_NONE) {
EXIT_ERROR(error, "GetMethodName failed");
}

if ( pname != NULL ) {
*pname = name;
} else if ( name != NULL ) {
Expand Down
Loading