This commit is contained in:
Y. Srinivas Ramakrishna 2008-06-24 13:20:34 -07:00
commit f521ab4f1a
65 changed files with 783 additions and 426 deletions

View File

@ -2,3 +2,4 @@
bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25
5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26
67052ac87fc927d048e62ec54ff42adb230d3f7c jdk7-b27
18dc4ba4739a537fd146f77da51db16efce28da2 jdk7-b28

View File

@ -2,3 +2,4 @@ cfeea66a3fa8ca3686a7cfa2d0ce8ab0169f168d jdk7-b24
cbc8ad9dd0e085a607427ea35411990982f19a36 jdk7-b25
9410f77cc30c604d1caf7c9fe3a57fa19e1acbe8 jdk7-b26
11b4dc9f2be3523ef989a0db8459eb56b3045c3a jdk7-b27
56652b46f328937f6b9b5130f1e4cd80f48868ef jdk7-b28

View File

@ -2,3 +2,4 @@
5e61d5df62586474414d1058e9186441aa908f51 jdk7-b25
0043eb3d4e628f049ff80a8c223b5657136085e7 jdk7-b26
e84e9018bebbf3e5bafc5706e7882a15cb1c7d99 jdk7-b27
27509b7d21ed783b3f6eb7b7612781c675a30c2f jdk7-b28

View File

@ -31,6 +31,9 @@ COMPILER_NAME=Sun Studio
# Sun Studio Compiler settings specific to Solaris
ifeq ($(PLATFORM), solaris)
# FIXUP: Change to SS12 when validated
#COMPILER_VERSION=SS12
#REQUIRED_CC_VER=5.9
COMPILER_VERSION=SS11
REQUIRED_CC_VER=5.8
CC = $(COMPILER_PATH)cc
@ -51,8 +54,8 @@ endif
# Sun Studio Compiler settings specific to Linux
ifeq ($(PLATFORM), linux)
# This has not been tested
COMPILER_VERSION=SS11
REQUIRED_CC_VER=5.8
COMPILER_VERSION=SS12
REQUIRED_CC_VER=5.9
CC = $(COMPILER_PATH)cc
CPP = $(COMPILER_PATH)cc -E
CXX = $(COMPILER_PATH)CC

View File

@ -123,9 +123,15 @@ if [ "${osname}" = SunOS ] ; then
solaris_arch=i386
fi
# Get the SS11 compilers into path (make sure it matches ALT setting)
compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/SS11/bin
compiler_name=SS11
# Get the compilers into path (make sure it matches ALT setting)
if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
else
# FIXUP: Change to SS12 when validated
#compiler_name=SS12
compiler_name=SS11
fi
compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
ALT_COMPILER_PATH="${compiler_path}"
export ALT_COMPILER_PATH
dirMustExist "${compiler_path}" ALT_COMPILER_PATH

View File

@ -2,3 +2,4 @@ a61af66fc99eb5ec9d50c05b0c599757b1289ceb jdk7-b24
7836be3e92d0a4f9ee7566f602c91f5609534e66 jdk7-b25
ad0b851458ff9d1d490ed2d79bb84f75a9fdb753 jdk7-b26
e3d2692f8442e2d951166dc9bd9a330684754438 jdk7-b27
c14dab40ed9bf45ad21150bd70c9c80cdf655415 jdk7-b28

View File

@ -261,3 +261,21 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
# A list of object files built without the platform specific PIC flags, e.g.
# -fPIC on linux. Performance measurements show that by compiling GC related
# code, we could significantly reduce the GC pause time on 32 bit Linux/Unix
# platforms. See 6454213 for more details.
include $(GAMMADIR)/make/scm.make
ifneq ($(OSNAME), windows)
ifndef LP64
NONPIC_DIRS = memory oops gc_implementation gc_interface
NONPIC_DIRS := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir))
# Look for source files under NONPIC_DIRS
NONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\
$(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \
-name '*.cpp' -print))
NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES)))
endif
endif

View File

@ -33,9 +33,9 @@
# Don't put quotes (fail windows build).
HOTSPOT_VM_COPYRIGHT=Copyright 2008
HS_MAJOR_VER=13
HS_MAJOR_VER=14
HS_MINOR_VER=0
HS_BUILD_NUMBER=02
HS_BUILD_NUMBER=01
JDK_MAJOR_VER=1
JDK_MINOR_VER=7

View File

@ -50,14 +50,7 @@ PICFLAG = -fPIC
VM_PICFLAG/LIBJVM = $(PICFLAG)
VM_PICFLAG/AOUT =
ifneq ($(BUILDARCH), i486)
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
else
# PIC has significant overhead on x86, build nonpic VM for now.
# Link JVM at a "good" base location to avoid unnecessary .text patching.
JVM_BASE_ADDR = 0x06000000
endif
CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti

View File

@ -133,10 +133,22 @@ ifeq ($(findstring j,$(MFLAGS)),j)
COMPILE_DONE = && { echo Done with $<; }
endif
include $(GAMMADIR)/make/defs.make
# The non-PIC object files are only generated for 32 bit platforms.
ifdef LP64
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
else
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
$(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
$(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
endif
%.o: %.s
@echo Assembling $<

View File

@ -30,7 +30,7 @@ DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@)
ifeq ("${Platform_compiler}", "sparcWorks")
ifeq ($(COMPILER_REV),5.8))
ifeq ($(COMPILER_REV),5.8)
# SS11 SEGV when compiling with -g and -xarch=v8, using different backend
DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0
DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0

View File

@ -133,19 +133,7 @@ ifeq ($(findstring j,$(MFLAGS)),j)
COMPILE_DONE = && { echo Done with $<; }
endif
# A list of directories under which all source code are built without -KPIC/-Kpic
# flag. Performance measurements show that compiling GC related code will
# dramatically reduce the gc pause time. See bug 6454213 for more details.
include $(GAMMADIR)/make/scm.make
NONPIC_DIRS = memory oops gc_implementation gc_interface
NONPIC_DIRS := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir))
# Look for source code under NONPIC_DIRS
NONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\
$(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \
-name '*.cpp' -print))
NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES)))
include $(GAMMADIR)/make/defs.make
# Sun compiler for 64 bit Solaris does not support building non-PIC object files.
ifdef LP64

View File

@ -132,7 +132,7 @@ JVM_END
*/
struct siglabel {
char *name;
const char *name;
int number;
};

View File

@ -75,8 +75,8 @@ int os::Linux::_page_size = -1;
bool os::Linux::_is_floating_stack = false;
bool os::Linux::_is_NPTL = false;
bool os::Linux::_supports_fast_thread_cpu_time = false;
char * os::Linux::_glibc_version = NULL;
char * os::Linux::_libpthread_version = NULL;
const char * os::Linux::_glibc_version = NULL;
const char * os::Linux::_libpthread_version = NULL;
static jlong initial_time_count=0;
@ -213,9 +213,9 @@ pid_t os::Linux::gettid() {
// the system call returns 1. This causes the VM to act as if it is
// a single processor and elide locking (see is_MP() call).
static bool unsafe_chroot_detected = false;
static char *unstable_chroot_error = "/proc file system not found.\n"
"Java may be unstable running multithreaded in a chroot "
"environment on Linux when /proc filesystem is not mounted.";
static const char *unstable_chroot_error = "/proc file system not found.\n"
"Java may be unstable running multithreaded in a chroot "
"environment on Linux when /proc filesystem is not mounted.";
void os::Linux::initialize_system_info() {
_processor_count = sysconf(_SC_NPROCESSORS_CONF);
@ -544,26 +544,23 @@ void os::Linux::libpthread_init() {
if (n > 0) {
char *str = (char *)malloc(n);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
// Vanilla RH-9 (glibc 2.3.2) has a bug that confstr() always tells
// us "NPTL-0.29" even we are running with LinuxThreads. Check if this
// is the case:
// is the case. LinuxThreads has a hard limit on max number of threads.
// So sysconf(_SC_THREAD_THREADS_MAX) will return a positive value.
// On the other hand, NPTL does not have such a limit, sysconf()
// will return -1 and errno is not changed. Check if it is really NPTL.
if (strcmp(os::Linux::glibc_version(), "glibc 2.3.2") == 0 &&
strstr(str, "NPTL")) {
// LinuxThreads has a hard limit on max number of threads. So
// sysconf(_SC_THREAD_THREADS_MAX) will return a positive value.
// On the other hand, NPTL does not have such a limit, sysconf()
// will return -1 and errno is not changed. Check if it is really
// NPTL:
if (sysconf(_SC_THREAD_THREADS_MAX) > 0) {
free(str);
str = "linuxthreads";
}
strstr(str, "NPTL") &&
sysconf(_SC_THREAD_THREADS_MAX) > 0) {
free(str);
os::Linux::set_libpthread_version("linuxthreads");
} else {
os::Linux::set_libpthread_version(str);
}
os::Linux::set_libpthread_version(str);
} else {
// glibc before 2.3.2 only has LinuxThreads.
os::Linux::set_libpthread_version("linuxthreads");
// glibc before 2.3.2 only has LinuxThreads.
os::Linux::set_libpthread_version("linuxthreads");
}
if (strstr(libpthread_version(), "NPTL")) {
@ -4643,11 +4640,7 @@ extern char** environ;
// Unlike system(), this function can be called from signal handler. It
// doesn't block SIGINT et al.
int os::fork_and_exec(char* cmd) {
char * argv[4];
argv[0] = "sh";
argv[1] = "-c";
argv[2] = cmd;
argv[3] = NULL;
const char * argv[4] = {"sh", "-c", cmd, NULL};
// fork() in LinuxThreads/NPTL is not async-safe. It needs to run
// pthread_atfork handlers and reset pthread library. All we need is a
@ -4672,7 +4665,7 @@ int os::fork_and_exec(char* cmd) {
// IA64 should use normal execve() from glibc to match the glibc fork()
// above.
NOT_IA64(syscall(__NR_execve, "/bin/sh", argv, environ);)
IA64_ONLY(execve("/bin/sh", argv, environ);)
IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);)
// execve failed
_exit(-1);

View File

@ -52,8 +52,8 @@ class Linux {
static address _initial_thread_stack_bottom;
static uintptr_t _initial_thread_stack_size;
static char *_glibc_version;
static char *_libpthread_version;
static const char *_glibc_version;
static const char *_libpthread_version;
static bool _is_floating_stack;
static bool _is_NPTL;
@ -72,8 +72,8 @@ class Linux {
static julong physical_memory() { return _physical_memory; }
static void initialize_system_info();
static void set_glibc_version(char *s) { _glibc_version = s; }
static void set_libpthread_version(char *s) { _libpthread_version = s; }
static void set_glibc_version(const char *s) { _glibc_version = s; }
static void set_libpthread_version(const char *s) { _libpthread_version = s; }
static bool supports_variable_stack_size();
@ -134,8 +134,8 @@ class Linux {
static bool chained_handler(int sig, siginfo_t* siginfo, void* context);
// GNU libc and libpthread version strings
static char *glibc_version() { return _glibc_version; }
static char *libpthread_version() { return _libpthread_version; }
static const char *glibc_version() { return _glibc_version; }
static const char *libpthread_version() { return _libpthread_version; }
// NPTL or LinuxThreads?
static bool is_LinuxThreads() { return !_is_NPTL; }

View File

@ -283,6 +283,7 @@
template(cache_field_name, "cache") \
template(value_name, "value") \
template(frontCacheEnabled_name, "frontCacheEnabled") \
template(stringCacheEnabled_name, "stringCacheEnabled") \
\
/* non-intrinsic name/signature pairs: */ \
template(register_method_name, "register") \

View File

@ -1004,6 +1004,9 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values)
DEBUG_ONLY(mark_bitmap()->verify_clear();)
DEBUG_ONLY(summary_data().verify_clear();)
// Have worker threads release resources the next time they run a task.
gc_task_manager()->release_all_resources();
}
void PSParallelCompact::post_compact()
@ -1949,12 +1952,6 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
TimeStamp compaction_start;
TimeStamp collection_exit;
// "serial_CM" is needed until the parallel implementation
// of the move and update is done.
ParCompactionManager* serial_CM = new ParCompactionManager();
// Don't initialize more than once.
// serial_CM->initialize(&summary_data(), mark_bitmap());
ParallelScavengeHeap* heap = gc_heap();
GCCause::Cause gc_cause = heap->gc_cause();
PSYoungGen* young_gen = heap->young_gen();
@ -1969,6 +1966,10 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
PreGCValues pre_gc_values;
pre_compact(&pre_gc_values);
// Get the compaction manager reserved for the VM thread.
ParCompactionManager* const vmthread_cm =
ParCompactionManager::manager_array(gc_task_manager()->workers());
// Place after pre_compact() where the number of invocations is incremented.
AdaptiveSizePolicyOutput(size_policy, heap->total_collections());
@ -2008,7 +2009,7 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
bool marked_for_unloading = false;
marking_start.update();
marking_phase(serial_CM, maximum_heap_compaction);
marking_phase(vmthread_cm, maximum_heap_compaction);
#ifndef PRODUCT
if (TraceParallelOldGCMarkingPhase) {
@ -2039,7 +2040,7 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
#endif
bool max_on_system_gc = UseMaximumCompactionOnSystemGC && is_system_gc;
summary_phase(serial_CM, maximum_heap_compaction || max_on_system_gc);
summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);
#ifdef ASSERT
if (VerifyParallelOldWithMarkSweep &&
@ -2067,13 +2068,13 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
// code can use the the forwarding pointers to
// check the new pointer calculation. The restore_marks()
// has to be done before the real compact.
serial_CM->set_action(ParCompactionManager::VerifyUpdate);
compact_perm(serial_CM);
compact_serial(serial_CM);
serial_CM->set_action(ParCompactionManager::ResetObjects);
compact_perm(serial_CM);
compact_serial(serial_CM);
serial_CM->set_action(ParCompactionManager::UpdateAndCopy);
vmthread_cm->set_action(ParCompactionManager::VerifyUpdate);
compact_perm(vmthread_cm);
compact_serial(vmthread_cm);
vmthread_cm->set_action(ParCompactionManager::ResetObjects);
compact_perm(vmthread_cm);
compact_serial(vmthread_cm);
vmthread_cm->set_action(ParCompactionManager::UpdateAndCopy);
// For debugging only
PSMarkSweep::restore_marks();
@ -2084,16 +2085,14 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
compaction_start.update();
// Does the perm gen always have to be done serially because
// klasses are used in the update of an object?
compact_perm(serial_CM);
compact_perm(vmthread_cm);
if (UseParallelOldGCCompacting) {
compact();
} else {
compact_serial(serial_CM);
compact_serial(vmthread_cm);
}
delete serial_CM;
// Reset the mark bitmap, summary data, and do other bookkeeping. Must be
// done before resizing.
post_compact();

View File

@ -253,11 +253,17 @@ bool MemNode::all_controls_dominate(Node* dom, Node* sub) {
if (dom == NULL || dom->is_top() || sub == NULL || sub->is_top())
return false; // Conservative answer for dead code
// Check 'dom'.
// Check 'dom'. Skip Proj and CatchProj nodes.
dom = dom->find_exact_control(dom);
if (dom == NULL || dom->is_top())
return false; // Conservative answer for dead code
if (dom == sub) {
// For the case when, for example, 'sub' is Initialize and the original
// 'dom' is Proj node of the 'sub'.
return false;
}
if (dom->is_Con() || dom->is_Start() || dom->is_Root() || dom == sub)
return true;
@ -271,6 +277,7 @@ bool MemNode::all_controls_dominate(Node* dom, Node* sub) {
sub->is_Region(), "expecting only these nodes");
// Get control edge of 'sub'.
Node* orig_sub = sub;
sub = sub->find_exact_control(sub->in(0));
if (sub == NULL || sub->is_top())
return false; // Conservative answer for dead code
@ -296,14 +303,16 @@ bool MemNode::all_controls_dominate(Node* dom, Node* sub) {
for (uint next = 0; next < dom_list.size(); next++) {
Node* n = dom_list.at(next);
if (n == orig_sub)
return false; // One of dom's inputs dominated by sub.
if (!n->is_CFG() && n->pinned()) {
// Check only own control edge for pinned non-control nodes.
n = n->find_exact_control(n->in(0));
if (n == NULL || n->is_top())
return false; // Conservative answer for dead code
assert(n->is_CFG(), "expecting control");
}
if (n->is_Con() || n->is_Start() || n->is_Root()) {
dom_list.push(n);
} else if (n->is_Con() || n->is_Start() || n->is_Root()) {
only_dominating_controls = true;
} else if (n->is_CFG()) {
if (n->dominates(sub, nlist))

View File

@ -1039,6 +1039,9 @@ Node* Node::find_exact_control(Node* ctrl) {
//--------------------------dominates------------------------------------------
// Helper function for MemNode::all_controls_dominate().
// Check if 'this' control node dominates or equal to 'sub' control node.
// We already know that if any path back to Root or Start reaches 'this',
// then all paths so, so this is a simple search for one example,
// not an exhaustive search for a counterexample.
bool Node::dominates(Node* sub, Node_List &nlist) {
assert(this->is_CFG(), "expecting control");
assert(sub != NULL && sub->is_CFG(), "expecting control");
@ -1047,110 +1050,115 @@ bool Node::dominates(Node* sub, Node_List &nlist) {
int iterations_without_region_limit = DominatorSearchLimit;
Node* orig_sub = sub;
Node* dom = this;
bool met_dom = false;
nlist.clear();
bool this_dominates = false;
bool result = false; // Conservative answer
while (sub != NULL) { // walk 'sub' up the chain to 'this'
if (sub == this) {
// Walk 'sub' backward up the chain to 'dom', watching for regions.
// After seeing 'dom', continue up to Root or Start.
// If we hit a region (backward split point), it may be a loop head.
// Keep going through one of the region's inputs. If we reach the
// same region again, go through a different input. Eventually we
// will either exit through the loop head, or give up.
// (If we get confused, break out and return a conservative 'false'.)
while (sub != NULL) {
if (sub->is_top()) break; // Conservative answer for dead code.
if (sub == dom) {
if (nlist.size() == 0) {
// No Region nodes except loops were visited before and the EntryControl
// path was taken for loops: it did not walk in a cycle.
result = true;
break;
} else if (this_dominates) {
result = false; // already met before: walk in a cycle
break;
return true;
} else if (met_dom) {
break; // already met before: walk in a cycle
} else {
// Region nodes were visited. Continue walk up to Start or Root
// to make sure that it did not walk in a cycle.
this_dominates = true; // first time meet
met_dom = true; // first time meet
iterations_without_region_limit = DominatorSearchLimit; // Reset
}
}
if (sub->is_Start() || sub->is_Root()) {
result = this_dominates;
break;
// Success if we met 'dom' along a path to Start or Root.
// We assume there are no alternative paths that avoid 'dom'.
// (This assumption is up to the caller to ensure!)
return met_dom;
}
Node* up = sub->find_exact_control(sub->in(0));
if (up == NULL || up->is_top()) {
result = false; // Conservative answer for dead code
break;
}
if (sub == up && (sub->is_Loop() || sub->is_Region() && sub->req() != 3)) {
// Take first valid path on the way up to 'this'.
Node* up = sub->in(0);
// Normalize simple pass-through regions and projections:
up = sub->find_exact_control(up);
// If sub == up, we found a self-loop. Try to push past it.
if (sub == up && sub->is_Loop()) {
// Take loop entry path on the way up to 'dom'.
up = sub->in(1); // in(LoopNode::EntryControl);
} else if (sub == up && sub->is_Region() && sub->req() != 3) {
// Always take in(1) path on the way up to 'dom' for clone regions
// (with only one input) or regions which merge > 2 paths
// (usually used to merge fast/slow paths).
up = sub->in(1);
} else if (sub == up && sub->is_Region()) {
assert(sub->req() == 3, "sanity");
// Try both paths for Regions with 2 input paths (it may be a loop head).
// It could give conservative 'false' answer without information
// which region's input is the entry path.
iterations_without_region_limit = DominatorSearchLimit; // Reset
// Try both paths for such Regions.
// It is not accurate without regions dominating information.
// With such information the other path should be checked for
// the most dominating Region which was visited before.
bool region_was_visited_before = false;
uint i = 1;
uint size = nlist.size();
if (size == 0) {
// No such Region nodes were visited before.
// Take first valid path on the way up to 'this'.
} else {
// Was this Region node visited before?
intptr_t ni;
int j = size - 1;
for (; j >= 0; j--) {
ni = (intptr_t)nlist.at(j);
if ((Node*)(ni & ~1) == sub) {
if ((ni & 1) != 0) {
break; // Visited 2 paths. Give up.
} else {
// The Region node was visited before only once.
nlist.remove(j);
region_was_visited_before = true;
for (; i < sub->req(); i++) {
Node* in = sub->in(i);
if (in != NULL && !in->is_top() && in != sub) {
break;
}
}
i++; // Take other path.
break;
}
// Was this Region node visited before?
// If so, we have reached it because we accidentally took a
// loop-back edge from 'sub' back into the body of the loop,
// and worked our way up again to the loop header 'sub'.
// So, take the first unexplored path on the way up to 'dom'.
for (int j = nlist.size() - 1; j >= 0; j--) {
intptr_t ni = (intptr_t)nlist.at(j);
Node* visited = (Node*)(ni & ~1);
bool visited_twice_already = ((ni & 1) != 0);
if (visited == sub) {
if (visited_twice_already) {
// Visited 2 paths, but still stuck in loop body. Give up.
return false;
}
}
if (j >= 0 && (ni & 1) != 0) {
result = false; // Visited 2 paths. Give up.
// The Region node was visited before only once.
// (We will repush with the low bit set, below.)
nlist.remove(j);
// We will find a new edge and re-insert.
region_was_visited_before = true;
break;
}
// The Region node was not visited before.
}
for (; i < sub->req(); i++) {
// Find an incoming edge which has not been seen yet; walk through it.
assert(up == sub, "");
uint skip = region_was_visited_before ? 1 : 0;
for (uint i = 1; i < sub->req(); i++) {
Node* in = sub->in(i);
if (in != NULL && !in->is_top() && in != sub) {
break;
}
}
if (i < sub->req()) {
up = sub->in(i);
if (region_was_visited_before && sub != up) {
// Set 0 bit to indicate that both paths were taken.
nlist.push((Node*)((intptr_t)sub + 1));
} else {
nlist.push(sub);
if (skip == 0) {
up = in;
break;
}
--skip; // skip this nontrivial input
}
}
// Set 0 bit to indicate that both paths were taken.
nlist.push((Node*)((intptr_t)sub + (region_was_visited_before ? 1 : 0)));
}
if (sub == up) {
result = false; // some kind of tight cycle
break;
if (up == sub) {
break; // some kind of tight cycle
}
if (up == orig_sub && met_dom) {
// returned back after visiting 'dom'
break; // some kind of cycle
}
if (--iterations_without_region_limit < 0) {
result = false; // dead cycle
break;
break; // dead cycle
}
sub = up;
}
return result;
// Did not meet Root or Start node in pred. chain.
// Conservative answer for dead code.
return false;
}
//------------------------------remove_dead_region-----------------------------

View File

@ -2261,6 +2261,9 @@ class CommandLineFlags {
product(bool, AggressiveOpts, false, \
"Enable aggressive optimizations - see arguments.cpp") \
\
product(bool, UseStringCache, false, \
"Enable String cache capabilities on String.java") \
\
/* statistics */ \
develop(bool, UseVTune, false, \
"enable support for Intel's VTune profiler") \

View File

@ -2947,21 +2947,42 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
}
if (AggressiveOpts) {
// Forcibly initialize java/util/HashMap and mutate the private
// static final "frontCacheEnabled" field before we start creating instances
{
// Forcibly initialize java/util/HashMap and mutate the private
// static final "frontCacheEnabled" field before we start creating instances
#ifdef ASSERT
klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
#endif
klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
KlassHandle k = KlassHandle(THREAD, k_o);
guarantee(k.not_null(), "Must find java/util/HashMap");
instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
ik->initialize(CHECK_0);
fieldDescriptor fd;
// Possible we might not find this field; if so, don't break
if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
k()->bool_field_put(fd.offset(), true);
klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
KlassHandle k = KlassHandle(THREAD, k_o);
guarantee(k.not_null(), "Must find java/util/HashMap");
instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
ik->initialize(CHECK_0);
fieldDescriptor fd;
// Possible we might not find this field; if so, don't break
if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
k()->bool_field_put(fd.offset(), true);
}
}
if (UseStringCache) {
// Forcibly initialize java/lang/String and mutate the private
// static final "stringCacheEnabled" field before we start creating instances
#ifdef ASSERT
klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0);
assert(tmp_k == NULL, "java/lang/String should not be loaded yet");
#endif
klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0);
KlassHandle k = KlassHandle(THREAD, k_o);
guarantee(k.not_null(), "Must find java/lang/String");
instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
ik->initialize(CHECK_0);
fieldDescriptor fd;
// Possible we might not find this field; if so, don't break
if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
k()->bool_field_put(fd.offset(), true);
}
}
}

View File

@ -2,3 +2,4 @@
a3b3ba7d6034dc754b51ddc3d281399ac1cae5f1 jdk7-b25
da43cb85fac1646d6f97e4a35e510bbfdff97bdb jdk7-b26
bafed478d67c3acf7744aaad88b9404261ea6739 jdk7-b27
b996318955c0ad8e9fa0ffb56c74f626786e863f jdk7-b28

View File

@ -2,3 +2,4 @@
59fd8224ba2da5c2d8d4c68e33cf33ab41ce8de0 jdk7-b25
debd37e1a422e580edb086c95d6e89199133a39c jdk7-b26
27d8f42862c11b4ddc4af2dd2d2a3cd86cda04c2 jdk7-b27
eefcd5204500a11d6aa802dca9f961cf10ab64c2 jdk7-b28

View File

@ -2,3 +2,4 @@
75fca0b0ab83ab1392e615910cea020f66535390 jdk7-b25
fb57027902e04ecafceae31a605e69b436c23d57 jdk7-b26
3e599d98875ddf919c8ea11cff9b3a99ba631a9b jdk7-b27
02e4c5348592a8d7fc2cba28bc5f8e35c0e17277 jdk7-b28

View File

@ -197,7 +197,6 @@ endif
# Lint Flags:
# -Xa ANSI C plus K&R, favor ANSI rules
# -Xarch=XXX Same as 'cc -xarch=XXX'
# -fd report on old style func defs
# -errchk=structarg report on 64bit struct args by value
# -errchk=longptr64 report on 64bit to 32bit issues (ignores casts)
@ -206,6 +205,7 @@ endif
# -x suppress unused externs
# -u suppress extern func/vars used/defined
# -errfmt=simple use one line errors with position info
# $(LINT_XARCH_OPTION) See Compiler-sun.gwk
LINTFLAGS_COMMON = -Xa
LINTFLAGS_COMMON += -fd
@ -224,42 +224,12 @@ LINTFLAGS_DBG =
# Tell the compilers to never generate globalized names, all the time.
CFLAGS_COMMON += -W0,-noglobal
# Arch specific settings (determines type of .o files and instruction set)
ifeq ($(ARCH_FAMILY), sparc)
ifdef VIS_NEEDED
XARCH_VALUE/32=v8plusa
XARCH_VALUE/64=v9a
else
# Someday this should change to improve optimization on UltraSPARC
# and abandon the old v8-only machines like the SPARCstation 10.
# Indications with Mustang is that alacrity runs do not show a
# big improvement using v8plus over v8, but other benchmarks might.
XARCH_VALUE/32=v8
XARCH_VALUE/64=v9
endif
endif
ifeq ($(ARCH_FAMILY), i586)
XARCH_VALUE/64=amd64
XARCH_VALUE/32=
endif
# Arch value based on current data model being built
XARCH_VALUE=$(XARCH_VALUE/$(ARCH_DATA_MODEL))
ifneq ($(XARCH_VALUE), )
# The actual compiler -xarch options to use
XARCH_OPTION/32 = -xarch=$(XARCH_VALUE/32)
XARCH_OPTION/64 = -xarch=$(XARCH_VALUE/64)
XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL))
endif
# If we have a specific -xarch value to use, add it
ifdef XARCH_OPTION
CFLAGS_COMMON += $(XARCH_OPTION)
CXXFLAGS_COMMON += $(XARCH_OPTION)
ASFLAGS_COMMON += $(XARCH_OPTION)
EXTRA_LIBS += $(XARCH_OPTION)
LINTFLAGS_COMMON += -Xarch=$(XARCH_VALUE)
endif
# If we have a specific arch value to use, add it
CFLAGS_COMMON += $(XARCH_OPTION)
CXXFLAGS_COMMON += $(XARCH_OPTION)
ASFLAGS_COMMON += $(AS_XARCH_OPTION)
EXTRA_LIBS += $(XARCH_OPTION)
LINTFLAGS_COMMON += $(LINT_XARCH_OPTION)
#
# uncomment the following to build with PERTURBALOT set

View File

@ -1236,7 +1236,6 @@ ifeq ($(PLATFORM), windows)
$(RM) $(TEMPDIR)/rebase.input
endif
$(RM) -r $(JDK_IMAGE_DIR)
$(RM) -r $(JDK_DEBUG_IMAGE_DIR)
$(RM) -r $(JRE_IMAGE_DIR)
images images-clobber::

View File

@ -31,6 +31,9 @@ COMPILER_NAME=Sun Studio
# Sun Studio Compiler settings specific to Solaris
ifeq ($(PLATFORM), solaris)
# FIXUP: Change to SS12 when validated
#COMPILER_VERSION=SS12
#REQUIRED_CC_VER=5.9
COMPILER_VERSION=SS11
REQUIRED_CC_VER=5.8
CC = $(COMPILER_PATH)cc
@ -51,8 +54,8 @@ endif
# Sun Studio Compiler settings specific to Linux
ifeq ($(PLATFORM), linux)
# This has not been tested
COMPILER_VERSION=SS11
REQUIRED_CC_VER=5.8
COMPILER_VERSION=SS12
REQUIRED_CC_VER=5.9
CC = $(COMPILER_PATH)cc
CPP = $(COMPILER_PATH)cc -E
CXX = $(COMPILER_PATH)CC
@ -74,3 +77,58 @@ endif
_CC_VER :=$(shell $(CC) -V 2>&1 | $(HEAD) -n 1)
CC_VER :=$(call GetVersion,"$(_CC_VER)")
# Arch specific settings (determines type of .o files and instruction set)
# Starting in SS12 (5.9), the arch options changed.
# The assembler /usr/ccs/bin/as wants older SS11 (5.8) style options.
# Note: We need to have both 32 and 64 values at all times for awt Makefiles.
#
XARCH_OPTION_OLD/32 =
XARCH_OPTION_OLD/64 =
XARCH_OPTION_NEW/32 = -m32
XARCH_OPTION_NEW/64 = -m64
# Lint options are slightly different
LINT_XARCH_OPTION_OLD/32 =
LINT_XARCH_OPTION_OLD/64 =
LINT_XARCH_OPTION_NEW/32 = -m32
LINT_XARCH_OPTION_NEW/64 = -m64
ifeq ($(ARCH_FAMILY), sparc)
ifdef VIS_NEEDED
XARCH_OPTION_OLD/32 += -xarch=v8plusa
XARCH_OPTION_OLD/64 += -xarch=v9a
XARCH_OPTION_NEW/32 += -xarch=sparcvis
XARCH_OPTION_NEW/64 += -xarch=sparcvis
else
# Someday this should change to improve optimization on UltraSPARC
# and abandon v8, even change to sparcvis or sparcvis2, this
# abandons machines like the SPARCstation 10.
# Indications with jdk6 is that alacrity runs do not show a
# big improvement using v8plus over v8, but other benchmarks might.
XARCH_OPTION_OLD/32 += -xarch=v8
XARCH_OPTION_OLD/64 += -xarch=v9
# Note that this new option (SS12+) effectively means v8plus
XARCH_OPTION_NEW/32 += -xarch=sparc
XARCH_OPTION_NEW/64 += -xarch=sparc
endif
LINT_XARCH_OPTION_OLD/64 += -Xarch=v9
endif
ifeq ($(ARCH_FAMILY), i586)
XARCH_OPTION_OLD/64 += -xarch=amd64
LINT_XARCH_OPTION_OLD/64 += -Xarch=amd64
endif
# Pick the options we want based on the compiler being used.
ifeq ($(shell expr $(CC_VER) \>= 5.9), 1)
XARCH_OPTION/32 = $(XARCH_OPTION_NEW/32)
XARCH_OPTION/64 = $(XARCH_OPTION_NEW/64)
LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_NEW/32)
LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_NEW/64)
else
XARCH_OPTION/32 = $(XARCH_OPTION_OLD/32)
XARCH_OPTION/64 = $(XARCH_OPTION_OLD/64)
LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_OLD/32)
LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_OLD/64)
endif
XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL))
LINT_XARCH_OPTION = $(LINT_XARCH_OPTION/$(ARCH_DATA_MODEL))
# The /usr/ccs/bin/as assembler always wants the older SS11 (5.8) options.
AS_XARCH_OPTION = $(XARCH_OPTION_OLD/$(ARCH_DATA_MODEL))

View File

@ -119,7 +119,7 @@ if [ "${osname}" = SunOS ] ; then
# System place where JDK installed images are stored?
jdk_instances=/usr/jdk/instances
# Get the SS11 compilers (and latest patches for them too)
# Get the Sun Studio compilers (and latest patches for them too)
if [ "${ALT_COMPILER_PATH}" = "" ] ; then
ALT_COMPILER_PATH=/opt/SUNWspro/bin
export ALT_COMPILER_PATH

View File

@ -133,9 +133,15 @@ if [ "${osname}" = SunOS ] ; then
solaris_arch=i386
fi
# Get the SS11 compilers into path (make sure it matches ALT setting)
compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/SS11/bin
compiler_name=SS11
# Get the compilers into path (make sure it matches ALT setting)
if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
else
# FIXUP: Change to SS12 when validated
#compiler_name=SS12
compiler_name=SS11
fi
compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
ALT_COMPILER_PATH="${compiler_path}"
export ALT_COMPILER_PATH
dirMustExist "${compiler_path}" ALT_COMPILER_PATH

View File

@ -93,7 +93,6 @@ else # PLATFORM
# Other extra flags needed for compiling.
#
CPPFLAGS += -I$(OPENWIN_HOME)/include \
-I$(MOTIF_DIR)/include \
-I$(SHARE_SRC)/native/$(PKGDIR)/debug \
-I$(SHARE_SRC)/native/$(PKGDIR)/image \
-I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \

View File

@ -3057,10 +3057,24 @@ public abstract class Component implements ImageObserver, MenuContainer,
// services. Additionally, the request is restricted to
// the bounds of the component.
if (parent != null) {
int px = this.x + ((x < 0) ? 0 : x);
int py = this.y + ((y < 0) ? 0 : y);
if (x < 0) {
width += x;
x = 0;
}
if (y < 0) {
height += y;
y = 0;
}
int pwidth = (width > this.width) ? this.width : width;
int pheight = (height > this.height) ? this.height : height;
if (pwidth <= 0 || pheight <= 0) {
return;
}
int px = this.x + x;
int py = this.y + y;
parent.repaint(tm, px, py, pwidth, pheight);
}
} else {

View File

@ -1,5 +1,5 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2008 Sun Microsystems, Inc. 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
@ -485,7 +485,6 @@ public class DragSourceContext
Cursor c = null;
targetAct = DnDConstants.ACTION_NONE;
switch (status) {
case ENTER:
case OVER:
@ -507,6 +506,10 @@ public class DragSourceContext
else
c = DragSource.DefaultCopyDrop;
}
break;
default:
targetAct = DnDConstants.ACTION_NONE;
}
setCursorImpl(c);

View File

@ -1696,8 +1696,8 @@ public class RequiredModelMBean
} catch (Exception e) {
// eat exceptions because interface doesn't have an
// exception on it
if (MODELMBEAN_LOGGER.isLoggable(Level.WARNING)) {
MODELMBEAN_LOGGER.logp(Level.WARNING,
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
RequiredModelMBean.class.getName(),
"getAttributes(String[])",
"Failed to get \"" + attrNames[i] + "\": ", e);
@ -1857,8 +1857,8 @@ public class RequiredModelMBean
attrValue.getClass().getName() +
" received.");
} catch (ClassNotFoundException x) {
if (MODELMBEAN_LOGGER.isLoggable(Level.WARNING)) {
MODELMBEAN_LOGGER.logp(Level.WARNING,
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
RequiredModelMBean.class.getName(),
"setAttribute(Attribute)","Class " +
attrType + " for attribute "
@ -2224,8 +2224,8 @@ public class RequiredModelMBean
ntfyObj.getMessage() + " Severity = " +
(String)ntfyDesc.getFieldValue("severity"));
} catch (Exception e) {
if (MODELMBEAN_LOGGER.isLoggable(Level.WARNING)) {
MODELMBEAN_LOGGER.logp(Level.WARNING,
if (MODELMBEAN_LOGGER.isLoggable(Level.FINE)) {
MODELMBEAN_LOGGER.logp(Level.FINE,
RequiredModelMBean.class.getName(),
"sendNotification(Notification)",
"Failed to log " +
@ -2618,8 +2618,8 @@ public class RequiredModelMBean
" Old value = " + oldv +
" New value = " + newv);
} catch (Exception e) {
if (MODELMBEAN_LOGGER.isLoggable(Level.WARNING)) {
MODELMBEAN_LOGGER.logp(Level.WARNING,
if (MODELMBEAN_LOGGER.isLoggable(Level.FINE)) {
MODELMBEAN_LOGGER.logp(Level.FINE,
RequiredModelMBean.class.getName(),mth,
"Failed to log " + ntfyObj.getType() +
" notification: ", e);
@ -2644,8 +2644,8 @@ public class RequiredModelMBean
" Old value = " + oldv +
" New value = " + newv);
} catch (Exception e) {
if (MODELMBEAN_LOGGER.isLoggable(Level.WARNING)) {
MODELMBEAN_LOGGER.logp(Level.WARNING,
if (MODELMBEAN_LOGGER.isLoggable(Level.FINE)) {
MODELMBEAN_LOGGER.logp(Level.FINE,
RequiredModelMBean.class.getName(),mth,
"Failed to log " + ntfyObj.getType() +
" notification: ", e);

View File

@ -102,7 +102,7 @@ class OCSPChecker extends PKIXCertPathChecker {
*/
public void init(boolean forward) throws CertPathValidatorException {
if (!forward) {
remainingCerts = certs.length;
remainingCerts = certs.length + 1;
} else {
throw new CertPathValidatorException(
"Forward checking not supported");
@ -131,14 +131,22 @@ class OCSPChecker extends PKIXCertPathChecker {
InputStream in = null;
OutputStream out = null;
// Decrement the certificate counter
remainingCerts--;
try {
// Examine OCSP properties
X509Certificate responderCert = null;
boolean seekResponderCert = false;
X500Principal responderSubjectName = null;
X500Principal responderIssuerName = null;
BigInteger responderSerialNumber = null;
boolean seekIssuerCert = true;
X509CertImpl issuerCertImpl = null;
X509CertImpl currCertImpl =
X509CertImpl.toImpl((X509Certificate)cert);
/*
* OCSP security property values, in the following order:
* 1. ocsp.responderURL
@ -148,6 +156,9 @@ class OCSPChecker extends PKIXCertPathChecker {
*/
String[] properties = getOCSPProperties();
// Check whether OCSP is feasible before seeking cert information
URL url = getOCSPServerURL(currCertImpl, properties);
// When responder's subject name is set then the issuer/serial
// properties are ignored
if (properties[1] != null) {
@ -172,14 +183,9 @@ class OCSPChecker extends PKIXCertPathChecker {
seekResponderCert = true;
}
boolean seekIssuerCert = true;
X509CertImpl issuerCertImpl = null;
X509CertImpl currCertImpl =
X509CertImpl.toImpl((X509Certificate)cert);
remainingCerts--;
// Set the issuer certificate
if (remainingCerts != 0) {
// Set the issuer certificate to the next cert in the chain
// (unless we're processing the final cert).
if (remainingCerts < certs.length) {
issuerCertImpl = X509CertImpl.toImpl(certs[remainingCerts]);
seekIssuerCert = false; // done
@ -312,7 +318,8 @@ class OCSPChecker extends PKIXCertPathChecker {
// Construct an OCSP Request
OCSPRequest ocspRequest =
new OCSPRequest(currCertImpl, issuerCertImpl);
URL url = getOCSPServerURL(currCertImpl, properties);
// Use the URL to the OCSP service that was created earlier
HttpURLConnection con = (HttpURLConnection)url.openConnection();
if (DEBUG != null) {
DEBUG.println("connecting to OCSP service at: " + url);

View File

@ -358,15 +358,28 @@ Java_java_net_PlainSocketImpl_socketConnect(JNIEnv *env, jobject this,
* See 6343810.
*/
while (1) {
fd_set wr, ex;
#ifndef USE_SELECT
{
fprintf(stdout,"\nNATIVE: fd = %d] ", fd);
struct pollfd pfd;
pfd.fd = fd;
pfd.events = POLLOUT;
FD_ZERO(&wr);
FD_SET(fd, &wr);
FD_ZERO(&ex);
FD_SET(fd, &ex);
connect_rv = NET_Poll(&pfd, 1, -1);
}
#else
{
fd_set wr, ex;
FD_ZERO(&wr);
FD_SET(fd, &wr);
FD_ZERO(&ex);
FD_SET(fd, &ex);
connect_rv = NET_Select(fd+1, 0, &wr, &ex, 0);
}
#endif
errno = 0;
connect_rv = NET_Select(fd+1, 0, &wr, &ex, 0);
if (connect_rv == JVM_IO_ERR) {
if (errno == EINTR) {
continue;

View File

@ -3464,6 +3464,21 @@ UINT AwtComponent::WindowsKeyToJavaKey(UINT windowsKey, UINT modifiers)
return java_awt_event_KeyEvent_VK_UNDEFINED;
}
BOOL AwtComponent::IsNavigationKey(UINT wkey) {
switch (wkey) {
case VK_END:
case VK_PRIOR: // PageUp
case VK_NEXT: // PageDown
case VK_HOME:
case VK_LEFT:
case VK_UP:
case VK_RIGHT:
case VK_DOWN:
return TRUE;
}
return FALSE;
}
// determine if a key is a numpad key (distinguishes the numpad
// arrow keys from the non-numpad arrow keys, for example).
BOOL AwtComponent::IsNumPadKey(UINT vkey, BOOL extended)
@ -3563,7 +3578,10 @@ UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops)
// fix for 4623376,4737679,4501485,4740906,4708221 (4173679/4122715)
// Here we try to resolve a conflict with ::ToAsciiEx's translating
// ALT+number key combinations. kdm@sarc.spb.su
keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
// yan: Do it for navigation keys only, otherwise some AltGr deadkeys fail.
if( IsNavigationKey(wkey) ) {
keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
}
if (ctrlIsDown)
{

View File

@ -823,6 +823,7 @@ public:
private:
AwtComponent* SearchChild(UINT id);
void RemoveChild(UINT id) ;
static BOOL IsNavigationKey(UINT wkey);
ChildListItem* m_childList;

View File

@ -1,75 +0,0 @@
/*
* Copyright 2005 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6316460
* @summary Test that the legacy com.sun.management.jmx.Introspector
* methods work.
* @author Eamonn McManus
* @run clean LegacyIntrospectorTest
* @run build LegacyIntrospectorTest
* @run main LegacyIntrospectorTest
*/
import javax.management.*;
import com.sun.management.jmx.*;
public class LegacyIntrospectorTest {
public static interface TestMBean {
public int getWhatever();
}
public static class Test implements TestMBean {
public int getWhatever() {return 0;}
}
@SuppressWarnings("deprecation")
public static void main(String[] args) throws Exception {
MBeanInfo mbi = Introspector.testCompliance(Test.class);
MBeanAttributeInfo mbai = mbi.getAttributes()[0];
if (!mbai.getName().equals("Whatever"))
throw new Exception("Wrong attribute name: " + mbai.getName());
Class c = Introspector.getMBeanInterface(Test.class);
if (c != TestMBean.class)
throw new Exception("Wrong interface: " + c);
MBeanServer mbs1 = new MBeanServerImpl();
if (!mbs1.getDefaultDomain().equals("DefaultDomain"))
throw new Exception("Wrong default domain: " + mbs1.getDefaultDomain());
MBeanServer mbs2 = new MBeanServerImpl("Foo");
if (!mbs2.getDefaultDomain().equals("Foo"))
throw new Exception("Wrong default domain: " + mbs2.getDefaultDomain());
ObjectName delegateName =
new ObjectName("JMImplementation:type=MBeanServerDelegate");
MBeanInfo delegateInfo = mbs2.getMBeanInfo(delegateName);
MBeanInfo refDelegateInfo =
MBeanServerFactory.newMBeanServer().getMBeanInfo(delegateName);
if (!delegateInfo.equals(refDelegateInfo))
throw new Exception("Wrong delegate info from MBeanServerImpl: " +
delegateInfo);
System.out.println("TEST PASSED");
}
}

View File

@ -2,32 +2,22 @@
* Copyright 2008 Sun Microsystems, Inc. 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 modi
fy it
* under the terms of the GNU General Public License version 2 onl
y, as
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, bu
t WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABIL
ITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public L
icense
* version 2 for more details (a copy is included in the LICENSE f
ile that
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public Licen
se version
* 2 along with this work; if not, write to the Free Software Foun
dation,
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, San
ta Clara,
* CA 95054 USA or visit www.sun.com if you need additional inform
ation or
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/

View File

@ -1,5 +1,5 @@
#
# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2006-2008 Sun Microsystems, Inc. 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
@ -90,7 +90,8 @@ chmod u+w cert8.db
echo | ${TESTJAVA}${FS}bin${FS}java -Dfile -Dnss \
-Dnss.lib=${NSS}${FS}lib${FS}${PF}${FS}${LIBNAME} \
KeyToolTest || exit 12
KeyToolTest
status=$?
rm -f p11-nss.txt
rm -f cert8.db
@ -101,4 +102,5 @@ rm HumanInputStream*.class
rm KeyToolTest.class
rm TestException.class
exit $?
exit $status

View File

@ -2,3 +2,4 @@
58039502942e52f4144a33f36290a2bd2f3581e6 jdk7-b25
c46d25a2350ac147d0121d9c9725af6fcb1b4dbe jdk7-b26
a17265993253d61becd04fe7d96d1fe8b4bd6dff jdk7-b27
4ef4bd31856949554967fbf22783babb21a62a0e jdk7-b28

View File

@ -301,7 +301,11 @@ public class Types {
: isSubtypeUnchecked(elemtype(t), elemtype(s), warn);
} else if (isSubtype(t, s)) {
return true;
} else if (!s.isRaw()) {
}
else if (t.tag == TYPEVAR) {
return isSubtypeUnchecked(t.getUpperBound(), s, warn);
}
else if (!s.isRaw()) {
Type t2 = asSuper(t, s.tsym);
if (t2 != null && t2.isRaw()) {
if (isReifiable(s))

View File

@ -454,6 +454,8 @@ public class Attr extends JCTree.Visitor {
void attribTypeVariables(List<JCTypeParameter> typarams, Env<AttrContext> env) {
for (JCTypeParameter tvar : typarams) {
TypeVar a = (TypeVar)tvar.type;
a.tsym.flags_field |= UNATTRIBUTED;
a.bound = Type.noType;
if (!tvar.bounds.isEmpty()) {
List<Type> bounds = List.of(attribType(tvar.bounds.head, env));
for (JCExpression bound : tvar.bounds.tail)
@ -464,13 +466,14 @@ public class Attr extends JCTree.Visitor {
// java.lang.Object.
types.setBounds(a, List.of(syms.objectType));
}
a.tsym.flags_field &= ~UNATTRIBUTED;
}
}
void attribBounds(List<JCTypeParameter> typarams, Env<AttrContext> env) {
for (JCTypeParameter tvar : typarams)
chk.checkNonCyclic(tvar.pos(), (TypeVar)tvar.type);
attribStats(typarams, env);
}
void attribBounds(List<JCTypeParameter> typarams) {
for (JCTypeParameter typaram : typarams) {
Type bound = typaram.type.getUpperBound();
if (bound != null && bound.tsym instanceof ClassSymbol) {
@ -581,7 +584,7 @@ public class Attr extends JCTree.Visitor {
try {
chk.checkDeprecatedAnnotation(tree.pos(), m);
attribBounds(tree.typarams, env);
attribBounds(tree.typarams);
// If we override any other methods, check that we do so properly.
// JLS ???
@ -2689,7 +2692,7 @@ public class Attr extends JCTree.Visitor {
chk.validateAnnotations(tree.mods.annotations, c);
// Validate type parameters, supertype and interfaces.
attribBounds(tree.typarams, env);
attribBounds(tree.typarams);
chk.validateTypeParams(tree.typarams);
chk.validate(tree.extending);
chk.validate(tree.implementing);

View File

@ -1486,6 +1486,8 @@ public class Check {
private void checkNonCyclic1(DiagnosticPosition pos, Type t, Set<TypeVar> seen) {
final TypeVar tv;
if (t.tag == TYPEVAR && (t.tsym.flags() & UNATTRIBUTED) != 0)
return;
if (seen.contains(t)) {
tv = (TypeVar)t;
tv.bound = new ErrorType();

View File

@ -228,7 +228,7 @@ public class Resolve {
// another symbol which is a member of `site'
// (because, if it is overridden, `sym' is not strictly
// speaking a member of `site'.)
(sym.kind != MTH || sym.isConstructor() ||
(sym.kind != MTH || sym.isConstructor() || sym.isStatic() ||
((MethodSymbol)sym).implementation(site.tsym, types, true) == sym);
default: // this case includes erroneous combinations as well
return isAccessible(env, site);

View File

@ -1606,7 +1606,7 @@ public class JavacFileManager implements StandardJavaFileManager {
/** @deprecated see bug 6410637 */
@Deprecated
public String getPath() {
return entry.getName() + "(" + entry + ")";
return zipName + "(" + entry.getName() + ")";
}
public long getLastModified() {

View File

@ -1,3 +1,28 @@
/*
* Copyright 2007-2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.tools.javac.zip;
import java.io.*;

View File

@ -1,3 +1,28 @@
/*
* Copyright 2007-2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.tools.javac.zip;
import java.io.File;

View File

@ -58,7 +58,7 @@ public class ClassData implements RuntimeConstants {
private String superclassname;
private int source_cpx=0;
private byte tags[];
private Hashtable indexHashAscii = new Hashtable();
private Hashtable<Object,Integer> indexHashAscii = new Hashtable<Object,Integer>();
private String pkgPrefix="";
private int pkgPrefixLen=0;
@ -167,19 +167,19 @@ public class ClassData implements RuntimeConstants {
switch(tags[i] = tag) {
case CONSTANT_UTF8:
String str=in.readUTF();
indexHashAscii.put(cpool[i] = str, new Integer(i));
indexHashAscii.put(cpool[i] = str, i);
break;
case CONSTANT_INTEGER:
cpool[i] = new Integer(in.readInt());
cpool[i] = Integer.valueOf(in.readInt());
break;
case CONSTANT_FLOAT:
cpool[i] = new Float(in.readFloat());
cpool[i] = Float.valueOf(in.readFloat());
break;
case CONSTANT_LONG:
cpool[i++] = new Long(in.readLong());
cpool[i++] = Long.valueOf(in.readLong());
break;
case CONSTANT_DOUBLE:
cpool[i++] = new Double(in.readDouble());
cpool[i++] = Double.valueOf(in.readDouble());
break;
case CONSTANT_CLASS:
case CONSTANT_STRING:
@ -365,7 +365,7 @@ public class ClassData implements RuntimeConstants {
* Returns the access of this class or interface.
*/
public String[] getAccess(){
Vector v = new Vector();
Vector<String> v = new Vector<String>();
if ((access & ACC_PUBLIC) !=0) v.addElement("public");
if ((access & ACC_FINAL) !=0) v.addElement("final");
if ((access & ACC_ABSTRACT) !=0) v.addElement("abstract");

View File

@ -45,7 +45,7 @@ public class FieldData implements RuntimeConstants {
int value_cpx=0;
boolean isSynthetic=false;
boolean isDeprecated=false;
Vector attrs;
Vector<AttrData> attrs;
public FieldData(ClassData cls){
this.cls=cls;
@ -60,7 +60,7 @@ public class FieldData implements RuntimeConstants {
descriptor_index = in.readUnsignedShort();
// Read the attributes
int attributes_count = in.readUnsignedShort();
attrs=new Vector(attributes_count);
attrs=new Vector<AttrData>(attributes_count);
for (int i = 0; i < attributes_count; i++) {
int attr_name_index=in.readUnsignedShort();
if (cls.getTag(attr_name_index)!=CONSTANT_UTF8) continue;
@ -99,7 +99,7 @@ public class FieldData implements RuntimeConstants {
* Returns access of a field.
*/
public String[] getAccess(){
Vector v = new Vector();
Vector<String> v = new Vector<String>();
if ((access & ACC_PUBLIC) !=0) v.addElement("public");
if ((access & ACC_PRIVATE) !=0) v.addElement("private");
if ((access & ACC_PROTECTED) !=0) v.addElement("protected");

View File

@ -63,7 +63,7 @@ class InnerClassData implements RuntimeConstants {
* Returns the access of this class or interface.
*/
public String[] getAccess(){
Vector v = new Vector();
Vector<String> v = new Vector<String>();
if ((access & ACC_PUBLIC) !=0) v.addElement("public");
if ((access & ACC_FINAL) !=0) v.addElement("final");
if ((access & ACC_ABSTRACT) !=0) v.addElement("abstract");

View File

@ -653,7 +653,7 @@ public class JavapPrinter {
case CONSTANT_METHOD:
case CONSTANT_INTERFACEMETHOD:
case CONSTANT_FIELD: {
CPX2 x = (CPX2)(cls.getCpoolEntry(cpx));
CPX2 x = cls.getCpoolEntry(cpx);
if (x.cpx1 == cls.getthis_cpx()) {
// don't print class part for local references
cpx=x.cpx2;
@ -851,7 +851,7 @@ public class JavapPrinter {
case CONSTANT_INTERFACEMETHOD:
case CONSTANT_FIELD: {
// CPX2 x=(CPX2)(cpool[cpx]);
CPX2 x = (CPX2)(cls.getCpoolEntry(cpx));
CPX2 x = cls.getCpoolEntry(cpx);
if (x.cpx1 == cls.getthis_cpx()) {
// don't print class part for local references
cpx=x.cpx2;

View File

@ -35,9 +35,9 @@ import java.io.*;
*
* @author Sucheta Dambalkar (Adopted code from old javap)
*/
public class Main{
public class Main {
private Vector classList = new Vector();
private Vector<String> classList = new Vector<String>();
private PrintWriter out;
JavapEnvironment env = new JavapEnvironment();
private static boolean errorOccurred = false;
@ -201,7 +201,7 @@ public class Main{
*/
private void displayResults() {
for (int i = 0; i < classList.size() ; i++ ) {
String Name = (String)classList.elementAt(i);
String Name = classList.elementAt(i);
InputStream classin = env.getFileInputStream(Name);
try {

View File

@ -43,14 +43,14 @@ public class MethodData {
int descriptor_index;
int attributes_count;
byte[] code;
Vector exception_table = new Vector(0);
Vector lin_num_tb = new Vector(0);
Vector loc_var_tb = new Vector(0);
Vector<TrapData> exception_table = new Vector<TrapData>(0);
Vector<LineNumData> lin_num_tb = new Vector<LineNumData>(0);
Vector<LocVarData> loc_var_tb = new Vector<LocVarData>(0);
StackMapTableData[] stackMapTable;
StackMapData[] stackMap;
int[] exc_index_table=null;
Vector attrs=new Vector(0);
Vector code_attrs=new Vector(0);
Vector<AttrData> attrs=new Vector<AttrData>(0);
Vector<AttrData> code_attrs=new Vector<AttrData>(0);
int max_stack, max_locals;
boolean isSynthetic=false;
boolean isDeprecated=false;
@ -165,7 +165,7 @@ public class MethodData {
*/
void readExceptionTable (DataInputStream in) throws IOException {
int exception_table_len=in.readUnsignedShort();
exception_table=new Vector(exception_table_len);
exception_table=new Vector<TrapData>(exception_table_len);
for (int l = 0; l < exception_table_len; l++) {
exception_table.addElement(new TrapData(in, l));
}
@ -177,7 +177,7 @@ public class MethodData {
void readLineNumTable (DataInputStream in) throws IOException {
int attr_len = in.readInt(); // attr_length
int lin_num_tb_len = in.readUnsignedShort();
lin_num_tb=new Vector(lin_num_tb_len);
lin_num_tb=new Vector<LineNumData>(lin_num_tb_len);
for (int l = 0; l < lin_num_tb_len; l++) {
lin_num_tb.addElement(new LineNumData(in));
}
@ -189,7 +189,7 @@ public class MethodData {
void readLocVarTable (DataInputStream in) throws IOException {
int attr_len=in.readInt(); // attr_length
int loc_var_tb_len = in.readUnsignedShort();
loc_var_tb = new Vector(loc_var_tb_len);
loc_var_tb = new Vector<LocVarData>(loc_var_tb_len);
for (int l = 0; l < loc_var_tb_len; l++) {
loc_var_tb.addElement(new LocVarData(in));
}
@ -237,7 +237,7 @@ public class MethodData {
*/
public String[] getAccess(){
Vector v = new Vector();
Vector<String> v = new Vector<String>();
if ((access & ACC_PUBLIC) !=0) v.addElement("public");
if ((access & ACC_PRIVATE) !=0) v.addElement("private");
if ((access & ACC_PROTECTED) !=0) v.addElement("protected");

View File

@ -26,8 +26,6 @@
package sun.tools.javap;
import java.io.IOException;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.Vector;
@ -36,14 +34,14 @@ public class Tables implements Constants {
/**
* Define mnemocodes table.
*/
static Hashtable mnemocodes = new Hashtable(301, 0.5f);
static Hashtable<String,Integer> mnemocodes = new Hashtable<String,Integer>(301, 0.5f);
static String opcExtNamesTab[]=new String[128];
static String opcPrivExtNamesTab[]=new String[128];
static void defineNonPriv(int opc, String mnem) {
mnemocodes.put(opcExtNamesTab[opc]=mnem, new Integer(opc_nonpriv*256+opc));
mnemocodes.put(opcExtNamesTab[opc]=mnem, opc_nonpriv*256+opc);
}
static void definePriv(int opc, String mnem) {
mnemocodes.put(opcPrivExtNamesTab[opc]="priv_"+mnem, new Integer(opc_priv*256+opc));
mnemocodes.put(opcPrivExtNamesTab[opc]="priv_"+mnem, opc_priv*256+opc);
}
static void defineExt(int opc, String mnem) {
defineNonPriv(opc, mnem);
@ -51,28 +49,28 @@ public class Tables implements Constants {
}
static { int k;
for (k=0; k<opc_wide; k++) {
mnemocodes.put(opcNamesTab[k], new Integer(k));
mnemocodes.put(opcNamesTab[k], k);
}
for (k=opc_wide+1; k<opcNamesTab.length; k++) {
mnemocodes.put(opcNamesTab[k], new Integer(k));
mnemocodes.put(opcNamesTab[k], k);
}
mnemocodes.put("invokenonvirtual", new Integer(opc_invokespecial));
mnemocodes.put("invokenonvirtual", opc_invokespecial);
mnemocodes.put("iload_w", new Integer(opc_iload_w));
mnemocodes.put("lload_w", new Integer(opc_lload_w));
mnemocodes.put("fload_w", new Integer(opc_fload_w));
mnemocodes.put("dload_w", new Integer(opc_dload_w));
mnemocodes.put("aload_w", new Integer(opc_aload_w));
mnemocodes.put("istore_w", new Integer(opc_istore_w));
mnemocodes.put("lstore_w", new Integer(opc_lstore_w));
mnemocodes.put("fstore_w", new Integer(opc_fstore_w));
mnemocodes.put("dstore_w", new Integer(opc_dstore_w));
mnemocodes.put("astore_w", new Integer(opc_astore_w));
mnemocodes.put("ret_w", new Integer(opc_ret_w));
mnemocodes.put("iinc_w", new Integer(opc_iinc_w));
mnemocodes.put("iload_w", opc_iload_w);
mnemocodes.put("lload_w", opc_lload_w);
mnemocodes.put("fload_w", opc_fload_w);
mnemocodes.put("dload_w", opc_dload_w);
mnemocodes.put("aload_w", opc_aload_w);
mnemocodes.put("istore_w", opc_istore_w);
mnemocodes.put("lstore_w", opc_lstore_w);
mnemocodes.put("fstore_w", opc_fstore_w);
mnemocodes.put("dstore_w", opc_dstore_w);
mnemocodes.put("astore_w", opc_astore_w);
mnemocodes.put("ret_w", opc_ret_w);
mnemocodes.put("iinc_w", opc_iinc_w);
mnemocodes.put("nonpriv", new Integer(opc_nonpriv));
mnemocodes.put("priv", new Integer(opc_priv));
mnemocodes.put("nonpriv", opc_nonpriv);
mnemocodes.put("priv", opc_priv);
defineExt(0, "load_ubyte");
defineExt(1, "load_byte");
@ -183,7 +181,7 @@ public class Tables implements Constants {
}
public static int opcode(String mnem) {
Integer Val=(Integer)(mnemocodes.get(mnem));
Integer Val=mnemocodes.get(mnem);
if (Val == null) return -1;
return Val.intValue();
}
@ -191,7 +189,7 @@ public class Tables implements Constants {
/**
* Initialized keyword and token Hashtables
*/
static Vector keywordNames = new Vector(40);
static Vector<String> keywordNames = new Vector<String>(40);
private static void defineKeywordName(String id, int token) {
if (token>=keywordNames.size()) {
@ -202,7 +200,7 @@ public class Tables implements Constants {
public static String keywordName(int token) {
if (token==-1) return "EOF";
if (token>=keywordNames.size()) return null;
return (String)keywordNames.elementAt(token);
return keywordNames.elementAt(token);
}
static {
defineKeywordName("ident", IDENT);
@ -217,15 +215,15 @@ public class Tables implements Constants {
defineKeywordName("RBRACE", RBRACE);
}
static Hashtable keywords = new Hashtable(40);
static Hashtable<String,Integer> keywords = new Hashtable<String,Integer>(40);
public static int keyword(String idValue) {
Integer Val=(Integer)(keywords.get(idValue));
if (Val == null) return IDENT;
return Val.intValue();
Integer val=keywords.get(idValue);
if (val == null) return IDENT;
return val.intValue();
}
private static void defineKeyword(String id, int token) {
keywords.put(id, new Integer(token));
keywords.put(id, token);
defineKeywordName(id, token);
}
static {
@ -275,8 +273,8 @@ public class Tables implements Constants {
/**
* Define tag table.
*/
private static Vector tagNames = new Vector(10);
private static Hashtable Tags = new Hashtable(10);
private static Vector<String> tagNames = new Vector<String>(10);
private static Hashtable<String,Integer> Tags = new Hashtable<String,Integer>(10);
static {
defineTag("Asciz",CONSTANT_UTF8);
defineTag("int",CONSTANT_INTEGER);
@ -291,7 +289,7 @@ public class Tables implements Constants {
defineTag("NameAndType",CONSTANT_NAMEANDTYPE);
}
private static void defineTag(String id, int val) {
Tags.put(id, new Integer(val));
Tags.put(id, val);
if (val>=tagNames.size()) {
tagNames.setSize(val+1);
}
@ -299,10 +297,10 @@ public class Tables implements Constants {
}
public static String tagName(int tag) {
if (tag>=tagNames.size()) return null;
return (String)tagNames.elementAt(tag);
return tagNames.elementAt(tag);
}
public static int tagValue(String idValue) {
Integer Val=(Integer)(Tags.get(idValue));
Integer Val=Tags.get(idValue);
if (Val == null) return 0;
return Val.intValue();
}
@ -310,8 +308,8 @@ public class Tables implements Constants {
/**
* Define type table. These types used in "newarray" instruction only.
*/
private static Vector typeNames = new Vector(10);
private static Hashtable Types = new Hashtable(10);
private static Vector<String> typeNames = new Vector<String>(10);
private static Hashtable<String,Integer> Types = new Hashtable<String,Integer>(10);
static {
defineType("int",T_INT);
defineType("long",T_LONG);
@ -324,28 +322,28 @@ public class Tables implements Constants {
defineType("short",T_SHORT);
}
private static void defineType(String id, int val) {
Types.put(id, new Integer(val));
Types.put(id, val);
if (val>=typeNames.size()) {
typeNames.setSize(val+1);
}
typeNames.setElementAt(id, val);
}
public static int typeValue(String idValue) {
Integer Val=(Integer)(Types.get(idValue));
Integer Val=Types.get(idValue);
if (Val == null) return -1;
return Val.intValue();
}
public static String typeName(int type) {
if (type>=typeNames.size()) return null;
return (String)typeNames.elementAt(type);
return typeNames.elementAt(type);
}
/**
* Define MapTypes table.
* These constants used in stackmap tables only.
*/
private static Vector mapTypeNames = new Vector(10);
private static Hashtable MapTypes = new Hashtable(10);
private static Vector<String> mapTypeNames = new Vector<String>(10);
private static Hashtable<String,Integer> MapTypes = new Hashtable<String,Integer>(10);
static {
defineMapType("bogus", ITEM_Bogus);
defineMapType("int", ITEM_Integer);
@ -358,20 +356,20 @@ public class Tables implements Constants {
defineMapType("uninitialized", ITEM_NewObject);
}
private static void defineMapType(String id, int val) {
MapTypes.put(id, new Integer(val));
MapTypes.put(id, val);
if (val>=mapTypeNames.size()) {
mapTypeNames.setSize(val+1);
}
mapTypeNames.setElementAt(id, val);
}
public static int mapTypeValue(String idValue) {
Integer Val=(Integer)(MapTypes.get(idValue));
Integer Val=MapTypes.get(idValue);
if (Val == null) return -1;
return Val.intValue();
}
public static String mapTypeName(int type) {
if (type>=mapTypeNames.size()) return null;
return (String)mapTypeNames.elementAt(type);
return mapTypeNames.elementAt(type);
}
}

View File

@ -79,7 +79,7 @@ public class TypeSignature {
* Returns java type signature of a parameter.
*/
public String getParametersHelper(String parameterdes){
Vector parameters = new Vector();
Vector<String> parameters = new Vector<String>();
int startindex = -1;
int endindex = -1;
String param = "";
@ -187,7 +187,7 @@ public class TypeSignature {
int i;
for(i = 0; i < parameters.size(); i++){
parametersignature += (String)parameters.elementAt(i);
parametersignature += parameters.elementAt(i);
if(i != parameters.size()-1){
parametersignature += ", ";
}

View File

@ -24,7 +24,7 @@ public class T6589361 {
Iterable<JavaFileObject> files = fm.list(StandardLocation.PLATFORM_CLASS_PATH, "java.lang", set, false);
for (JavaFileObject file : files) {
if (file.toString().startsWith("java" + File.separator + "lang" + File.separator + "Object.class")) {
if (file.toString().contains("java" + File.separator + "lang" + File.separator + "Object.class")) {
String str = fm.inferBinaryName(StandardLocation.CLASS_PATH, file);
if (!str.equals("java.lang.Object")) {
throw new AssertionError("Error in JavacFileManager.inferBinaryName method!");

View File

@ -0,0 +1,65 @@
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6705935
* @summary javac reports path name of entry in ZipFileIndex incorectly
*/
import java.io.*;
import java.util.*;
import javax.tools.*;
import com.sun.tools.javac.util.*;
public class T6705935 {
public static void main(String... args) throws Exception {
new T6705935().run();
}
public void run() throws Exception {
File java_home = new File(System.getProperty("java.home"));
if (java_home.getName().equals("jre"))
java_home = java_home.getParentFile();
JavaCompiler c = ToolProvider.getSystemJavaCompiler();
JavaFileManager fm = c.getStandardFileManager(null, null, null);
for (JavaFileObject fo: fm.list(StandardLocation.PLATFORM_CLASS_PATH,
"java.lang",
Collections.singleton(JavaFileObject.Kind.CLASS),
false)) {
String p = ((BaseFileObject)fo).getPath();
int bra = p.indexOf("(");
int ket = p.indexOf(")");
//System.err.println(bra + "," + ket + "," + p.length());
if (bra == -1 || ket != p.length() -1)
throw new Exception("unexpected path: " + p + "[" + bra + "," + ket + "," + p.length());
String part1 = p.substring(0, bra);
String part2 = p.substring(bra + 1, ket);
//System.err.println("[" + part1 + "|" + part2 + "]" + " " + java_home);
if (part1.equals(part2) || !part1.startsWith(java_home.getPath()))
throw new Exception("bad path: " + p);
}
}
}

View File

@ -0,0 +1,35 @@
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6677785
* @summary REGRESSION: StackOverFlowError with Cyclic Class level Type Parameters when used in constructors
* @author Maurizio Cimadamore
* @compile/fail/ref=T6677785.out -XDstdout -XDrawDiagnostics T6677785.java
*/
public class T6677785<E extends T, T extends E> {
T6677785() {}
T6677785(E e) {}
T6677785(E e, T t) {}
}

View File

@ -0,0 +1,2 @@
T6677785.java:31:23: compiler.err.cyclic.inheritance: E
1 error

View File

@ -0,0 +1,37 @@
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6507024
* @summary unchecked conversion between arrays fails after capture conversion
* @author Maurizio Cimadamore
*
* @compile T6507024.java
*/
public class T6507024<T> {
<Z> void m(T6507024<Z>[] results) {
T6507024<Z>[] r = results.getClass().cast(null);
}
}

View File

@ -0,0 +1,31 @@
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6665223
* @summary Static import of inherited protected method causes compiler exception
* @author Maurizio Cimadamore
*
* @compile pkg/A.java
*/

View File

@ -0,0 +1,31 @@
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package pkg;
import static pkg.B.b;
class A {
public static void main(String[] args) {
b();
}
}

View File

@ -0,0 +1,29 @@
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package pkg;
class B extends B2 {}
abstract class B2 {
protected static void b() {}
}

View File

@ -225,7 +225,10 @@ COMMON_BUILD_ARGUMENTS = \
JDK_MKTG_VERSION=$(JDK_MKTG_VERSION) \
JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) \
JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) \
JDK_MICRO_VERSION=$(JDK_MICRO_VERSION)
JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) \
PREVIOUS_MAJOR_VERSION=$(PREVIOUS_MAJOR_VERSION) \
PREVIOUS_MINOR_VERSION=$(PREVIOUS_MINOR_VERSION) \
PREVIOUS_MICRO_VERSION=$(PREVIOUS_MICRO_VERSION)
ifdef ARCH_DATA_MODEL
COMMON_BUILD_ARGUMENTS += ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)