8140723: Remove source code conditionalized on JAVASE_EMBEDDED
Reviewed-by: psandoz, alanb, alexsch
This commit is contained in:
parent
19e317fe9c
commit
a7960979d9
jdk
make/lib
src
java.base
java.desktop/unix/native
test/lib/testlibrary/jdk/testlibrary
@ -350,8 +350,6 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
|
||||
BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w
|
||||
# initializing a declared 'extern'
|
||||
BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
|
||||
# decimal constant is unsigned only in ISO C90 (JAVASE_EMBEDDED)
|
||||
BUILD_LIBAWT_XAWT_XToolkit.c_CFLAGS := -w
|
||||
endif
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
|
||||
|
@ -166,10 +166,6 @@ class VersionProps {
|
||||
|
||||
ps.print(java_runtime_name + " (" + jdk_debug_level + "build " + java_runtime_version);
|
||||
|
||||
if (java_runtime_name.indexOf("Embedded") != -1 && isHeadless) {
|
||||
// embedded builds report headless state
|
||||
ps.print(", headless");
|
||||
}
|
||||
ps.println(')');
|
||||
|
||||
/* Third line: JVM information. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2016, 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
|
||||
@ -68,11 +68,6 @@
|
||||
#endif
|
||||
#endif /* !_ALLBSD_SOURCE */
|
||||
|
||||
#ifdef JAVASE_EMBEDDED
|
||||
#include <dlfcn.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
/* Take an array of string pairs (map of key->value) and a string (key).
|
||||
* Examine each pair in the map to see if the first string (key) matches the
|
||||
* string. If so, store the second string of the pair (value) in the value and
|
||||
@ -350,36 +345,6 @@ static int ParseLocale(JNIEnv* env, int cat, char ** std_language, char ** std_s
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef JAVASE_EMBEDDED
|
||||
/* Determine the default embedded toolkit based on whether libawt_xawt
|
||||
* exists in the JRE. This can still be overridden by -Dawt.toolkit=XXX
|
||||
*/
|
||||
static char* getEmbeddedToolkit() {
|
||||
Dl_info dlinfo;
|
||||
char buf[MAXPATHLEN];
|
||||
int32_t len;
|
||||
char *p;
|
||||
struct stat statbuf;
|
||||
|
||||
/* Get address of this library and the directory containing it. */
|
||||
dladdr((void *)getEmbeddedToolkit, &dlinfo);
|
||||
realpath((char *)dlinfo.dli_fname, buf);
|
||||
len = strlen(buf);
|
||||
p = strrchr(buf, '/');
|
||||
/* Default AWT Toolkit on Linux and Solaris is XAWT (libawt_xawt.so). */
|
||||
strncpy(p, "/libawt_xawt.so", MAXPATHLEN-len-1);
|
||||
/* Check if it exists */
|
||||
if (stat(buf, &statbuf) == -1 && errno == ENOENT) {
|
||||
/* No - this is a reduced-headless-jre so use special HToolkit */
|
||||
return "sun.awt.HToolkit";
|
||||
}
|
||||
else {
|
||||
/* Yes - this is a headful JRE so fallback to SE defaults */
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function gets called very early, before VM_CALLS are setup.
|
||||
* Do not use any of the VM_CALLS entries!!!
|
||||
*/
|
||||
@ -424,10 +389,6 @@ GetJavaProperties(JNIEnv *env)
|
||||
sprops.awt_headless = isInAquaSession() ? NULL : "true";
|
||||
#else
|
||||
sprops.graphics_env = "sun.awt.X11GraphicsEnvironment";
|
||||
#ifdef JAVASE_EMBEDDED
|
||||
sprops.awt_toolkit = getEmbeddedToolkit();
|
||||
if (sprops.awt_toolkit == NULL) // default as below
|
||||
#endif
|
||||
sprops.awt_toolkit = "sun.awt.X11.XToolkit";
|
||||
#endif
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2016, 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
|
||||
@ -122,11 +122,7 @@ Java_sun_awt_X11_XToolkit_initIDs
|
||||
JNIEXPORT jlong JNICALL Java_sun_awt_X11_XToolkit_getTrayIconDisplayTimeout
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
#ifndef JAVASE_EMBEDDED
|
||||
return (jlong) 2000;
|
||||
#else
|
||||
return (jlong) 10000;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -369,12 +365,7 @@ static uint32_t get_poll_timeout(jlong nextTaskTime);
|
||||
#define AWT_READPIPE (awt_pipe_fds[0])
|
||||
#define AWT_WRITEPIPE (awt_pipe_fds[1])
|
||||
|
||||
#ifdef JAVASE_EMBEDDED
|
||||
#define DEF_AWT_MAX_POLL_TIMEOUT ((uint32_t)4000000000) /* milliseconds */
|
||||
#else
|
||||
#define DEF_AWT_MAX_POLL_TIMEOUT ((uint32_t)500) /* milliseconds */
|
||||
#endif
|
||||
|
||||
#define DEF_AWT_MAX_POLL_TIMEOUT ((uint32_t)500) /* milliseconds */
|
||||
#define DEF_AWT_FLUSH_TIMEOUT ((uint32_t)100) /* milliseconds */
|
||||
#define AWT_MIN_POLL_TIMEOUT ((uint32_t)0) /* milliseconds */
|
||||
|
||||
@ -391,11 +382,7 @@ static uint32_t get_poll_timeout(jlong nextTaskTime);
|
||||
|
||||
// Static fields
|
||||
|
||||
#ifdef JAVASE_EMBEDDED
|
||||
static int awt_poll_alg = AWT_POLL_AGING_FAST;
|
||||
#else
|
||||
static int awt_poll_alg = AWT_POLL_AGING_SLOW;
|
||||
#endif
|
||||
static int awt_poll_alg = AWT_POLL_AGING_SLOW;
|
||||
|
||||
static uint32_t AWT_FLUSH_TIMEOUT = DEF_AWT_FLUSH_TIMEOUT; /* milliseconds */
|
||||
static uint32_t AWT_MAX_POLL_TIMEOUT = DEF_AWT_MAX_POLL_TIMEOUT; /* milliseconds */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, 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
|
||||
@ -39,10 +39,6 @@ DEF_STATIC_JNI_OnLoad
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
|
||||
{
|
||||
#if defined(JAVASE_EMBEDDED) && defined(HEADLESS)
|
||||
/* there are no AWT libs available at all */
|
||||
return JNI_FALSE;
|
||||
#else
|
||||
if (awt == NULL) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@ -62,5 +58,4 @@ JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
|
||||
}
|
||||
|
||||
return JNI_TRUE;
|
||||
#endif
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2016, 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
|
||||
@ -58,10 +58,6 @@ public class Platform {
|
||||
return vmName.endsWith(" Minimal VM");
|
||||
}
|
||||
|
||||
public static boolean isEmbedded() {
|
||||
return vmName.contains("Embedded");
|
||||
}
|
||||
|
||||
public static boolean isTieredSupported() {
|
||||
return compiler.contains("Tiered Compilers");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user