This commit is contained in:
John Coomes 2012-03-23 21:31:14 -07:00
commit 258bd8a2ba
30 changed files with 2770 additions and 2425 deletions

View File

@ -271,23 +271,25 @@ KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
# Misc files and generated files need to come from C1 or C2 area
ifeq ($(ZERO_BUILD), true)
ifeq ($(SHARK_BUILD), true)
MISC_DIR=$(SHARK_DIR)
GEN_DIR=$(SHARK_BASE_DIR)/generated
else
MISC_DIR=$(ZERO_DIR)
GEN_DIR=$(ZERO_BASE_DIR)/generated
endif
else
ifeq ($(ARCH_DATA_MODEL), 32)
MISC_DIR=$(C1_DIR)
GEN_DIR=$(C1_BASE_DIR)/generated
else
ifeq ($(JVM_VARIANT_SERVER), true)
MISC_DIR=$(C2_DIR)
GEN_DIR=$(C2_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_CLIENT), true)
MISC_DIR=$(C1_DIR)
GEN_DIR=$(C1_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_KERNEL), true)
MISC_DIR=$(C2_DIR)
GEN_DIR=$(C2_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
MISC_DIR=$(SHARK_DIR)
GEN_DIR=$(SHARK_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_ZERO), true)
MISC_DIR=$(ZERO_DIR)
GEN_DIR=$(ZERO_BASE_DIR)/generated
endif
# Bin files (windows)
@ -332,44 +334,44 @@ endif
# Shared Library
ifneq ($(OSNAME),windows)
ifeq ($(ZERO_BUILD), true)
ifeq ($(SHARK_BUILD), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
else
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
endif
else
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
ifeq ($(JVM_VARIANT_SERVER), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
# Debug info for shared library
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_DIR)/%.debuginfo
$(install-file)
endif
ifeq ($(JVM_VARIANT_CLIENT), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo
$(install-file)
$(EXPORT_CLIENT_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo
$(install-file)
$(EXPORT_CLIENT_DIR)/64/%.debuginfo: $(C1_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo
endif
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_DIR)/%.debuginfo
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
endif
ifeq ($(JVM_VARIANT_ZERO), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
endif
endif
@ -450,17 +452,18 @@ $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
test_jdk:
ifeq ($(ARCH_DATA_MODEL), 32)
ifneq ($(ZERO_BUILD), true)
$(JDK_IMAGE_DIR)/bin/java -d32 -client -Xinternalversion
$(JDK_IMAGE_DIR)/bin/java -d32 -client -version
ifeq ($(JVM_VARIANT_CLIENT), true)
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -Xinternalversion
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -version
endif
$(JDK_IMAGE_DIR)/bin/java -d32 -server -Xinternalversion
$(JDK_IMAGE_DIR)/bin/java -d32 -server -version
ifeq ($(findstring true, $(JVM_VARIANT_SERVER)\
$(JVM_VARIANT_ZERO)$(JVM_VARIANT_ZEROSHARK)), true)
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -Xinternalversion
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -version
endif
ifeq ($(ARCH_DATA_MODEL), 64)
$(JDK_IMAGE_DIR)/bin/java -d64 -server -Xinternalversion
$(JDK_IMAGE_DIR)/bin/java -d64 -server -version
ifeq ($(JVM_VARIANT_KERNEL), true)
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -kernel -Xinternalversion
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -kernel -version
endif
copy_product_jdk::

View File

@ -188,7 +188,7 @@ VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# in the build.sh script:
TARGETS = debug jvmg fastdebug optimized profiled product
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
else
SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs

View File

@ -69,7 +69,7 @@ QUIETLY$(MAKE_VERBOSE) = @
# For now, until the compiler is less wobbly:
TESTFLAGS = -Xbatch -showversion
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
else
ifdef USE_SUNCC

View File

@ -38,7 +38,7 @@ else
endif
# zero
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
ifeq ($(ARCH_DATA_MODEL), 64)
MAKE_ARGS += LP64=1
endif
@ -124,6 +124,18 @@ ifeq ($(ARCH), ppc)
HS_ARCH = ppc
endif
# On 32 bit bsd we build server and client, on 64 bit just server.
ifeq ($(JVM_VARIANTS),)
ifeq ($(ARCH_DATA_MODEL), 32)
JVM_VARIANTS:=client,server
JVM_VARIANT_CLIENT:=true
JVM_VARIANT_SERVER:=true
else
JVM_VARIANTS:=server
JVM_VARIANT_SERVER:=true
endif
endif
JDK_INCLUDE_SUBDIR=bsd
# Library suffix
@ -146,17 +158,15 @@ EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
ifndef BUILD_CLIENT_ONLY
ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
endif
ifneq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(JVM_VARIANT_CLIENT),true)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
endif
endif
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero

View File

@ -105,10 +105,11 @@ VM_PICFLAG/LIBJVM = $(PICFLAG)
VM_PICFLAG/AOUT =
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
ifeq ($(ZERO_BUILD), true)
ifeq ($(JVM_VARIANT_ZERO), true)
CFLAGS += $(LIBFFI_CFLAGS)
endif
ifeq ($(SHARK_BUILD), true)
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
CFLAGS += $(LIBFFI_CFLAGS)
CFLAGS += $(LLVM_CFLAGS)
endif
CFLAGS += $(VM_PICFLAG)

View File

@ -42,7 +42,7 @@ DEP_DIR = $(GENERATED)/dependencies
-include $(DEP_DIR)/*.d
# read machine-specific adjustments (%%% should do this via buildtree.make?)
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
include $(MAKEFILES_DIR)/zeroshark.make
else
include $(MAKEFILES_DIR)/$(BUILDARCH).make
@ -271,12 +271,12 @@ else
LIBS_VM += $(LIBS)
endif
ifeq ($(ZERO_BUILD), true)
ifeq ($(JVM_VARIANT_ZERO), true)
LIBS_VM += $(LIBFFI_LIBS)
endif
ifeq ($(SHARK_BUILD), true)
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
LIBS_VM += $(LIBFFI_LIBS) $(LLVM_LIBS)
LFLAGS_VM += $(LLVM_LDFLAGS)
LIBS_VM += $(LLVM_LIBS)
endif

View File

@ -55,6 +55,27 @@ define prep-target
@$(RM) $@
endef
# Default values for JVM_VARIANT* variables if configure hasn't set
# it already.
ifeq ($(JVM_VARIANTS),)
ifeq ($(ZERO_BUILD), true)
ifeq ($(SHARK_BUILD), true)
JVM_VARIANTS:=zeroshark
JVM_VARIANT_ZEROSHARK:=true
else
JVM_VARIANTS:=zero
JVM_VARIANT_ZERO:=true
endif
else
# A default is needed
ifeq ($(BUILD_CLIENT_ONLY), true)
JVM_VARIANTS:=client
JVM_VARIANT_CLIENT:=true
endif
# Further defaults are platform and arch specific
endif
endif
# Directory paths and user name
# Unless GAMMADIR is set on the command line, search upward from
# the current directory for a parent directory containing "src/share/vm".

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=24
HS_MINOR_VER=0
HS_BUILD_NUMBER=04
HS_BUILD_NUMBER=05
JDK_MAJOR_VER=1
JDK_MINOR_VER=8

View File

@ -188,7 +188,7 @@ VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# in the build.sh script:
TARGETS = debug jvmg fastdebug optimized profiled product
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
else
SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs

View File

@ -66,7 +66,7 @@ QUIETLY$(MAKE_VERBOSE) = @
# For now, until the compiler is less wobbly:
TESTFLAGS = -Xbatch -showversion
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
else
ifdef USE_SUNCC

View File

@ -38,7 +38,7 @@ else
endif
# zero
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
ifeq ($(ARCH_DATA_MODEL), 64)
MAKE_ARGS += LP64=1
endif
@ -114,6 +114,18 @@ ifeq ($(ARCH), ppc)
HS_ARCH = ppc
endif
# On 32 bit linux we build server and client, on 64 bit just server.
ifeq ($(JVM_VARIANTS),)
ifeq ($(ARCH_DATA_MODEL), 32)
JVM_VARIANTS:=client,server
JVM_VARIANT_CLIENT:=true
JVM_VARIANT_SERVER:=true
else
JVM_VARIANTS:=server
JVM_VARIANT_SERVER:=true
endif
endif
# determine if HotSpot is being built in JDK6 or earlier version
JDK6_OR_EARLIER=0
ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
@ -195,7 +207,7 @@ EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
ifndef BUILD_CLIENT_ONLY
ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
ifneq ($(OBJCOPY),)
@ -203,15 +215,13 @@ EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
endif
endif
ifneq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(JVM_VARIANT_CLIENT),true)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
ifneq ($(OBJCOPY),)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
endif
endif
endif
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero

View File

@ -72,10 +72,11 @@ VM_PICFLAG/LIBJVM = $(PICFLAG)
VM_PICFLAG/AOUT =
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
ifeq ($(ZERO_BUILD), true)
ifeq ($(JVM_VARIANT_ZERO), true)
CFLAGS += $(LIBFFI_CFLAGS)
endif
ifeq ($(SHARK_BUILD), true)
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
CFLAGS += $(LIBFFI_CFLAGS)
CFLAGS += $(LLVM_CFLAGS)
endif
CFLAGS += $(VM_PICFLAG)

View File

@ -42,7 +42,7 @@ DEP_DIR = $(GENERATED)/dependencies
-include $(DEP_DIR)/*.d
# read machine-specific adjustments (%%% should do this via buildtree.make?)
ifeq ($(ZERO_BUILD), true)
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
include $(MAKEFILES_DIR)/zeroshark.make
else
include $(MAKEFILES_DIR)/$(BUILDARCH).make
@ -236,7 +236,7 @@ mapfile_reorder : mapfile $(REORDERFILE)
vm.def: $(Res_Files) $(Obj_Files)
sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
ifeq ($(SHARK_BUILD), true)
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
STATIC_CXX = false
else
ifeq ($(ZERO_LIBARCH), ppc64)
@ -268,12 +268,12 @@ else
LIBS_VM += $(LIBS)
endif
ifeq ($(ZERO_BUILD), true)
ifeq ($(JVM_VARIANT_ZERO), true)
LIBS_VM += $(LIBFFI_LIBS)
endif
ifeq ($(SHARK_BUILD), true)
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
LIBS_VM += $(LIBFFI_LIBS) $(LLVM_LIBS)
LFLAGS_VM += $(LLVM_LDFLAGS)
LIBS_VM += $(LLVM_LIBS)
endif
LINK_VM = $(LINK_LIB.CC)

View File

@ -59,6 +59,18 @@ else
endif
endif
# On 32 bit solaris we build server and client, on 64 bit just server.
ifeq ($(JVM_VARIANTS),)
ifeq ($(ARCH_DATA_MODEL), 32)
JVM_VARIANTS:=client,server
JVM_VARIANT_CLIENT:=true
JVM_VARIANT_SERVER:=true
else
JVM_VARIANTS:=server
JVM_VARIANT_SERVER:=true
endif
endif
# determine if HotSpot is being built in JDK6 or earlier version
JDK6_OR_EARLIER=0
ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
@ -153,38 +165,38 @@ EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
ifneq ($(BUILD_CLIENT_ONLY),true)
ifeq ($(JVM_VARIANT_SERVER),true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX)
ifeq ($(ARCH_DATA_MODEL),32)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX)
endif
ifneq ($(OBJCOPY),)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.debuginfo
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.debuginfo
endif
endif
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(JVM_VARIANT_CLIENT),true)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX)
ifeq ($(ARCH_DATA_MODEL),32)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX)
endif
ifneq ($(OBJCOPY),)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.debuginfo
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.debuginfo
ifeq ($(ARCH_DATA_MODEL),32)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.debuginfo
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.debuginfo
endif
ifneq ($(BUILD_CLIENT_ONLY), true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX)
ifneq ($(OBJCOPY),)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.debuginfo
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.debuginfo
endif
endif
endif

View File

@ -107,6 +107,19 @@ ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) EM64T),)
endif
endif
# On 32 bit windows we build server, client and kernel, on 64 bit just server.
ifeq ($(JVM_VARIANTS),)
ifeq ($(ARCH_DATA_MODEL), 32)
JVM_VARIANTS:=client,server,kernel
JVM_VARIANT_CLIENT:=true
JVM_VARIANT_SERVER:=true
JVM_VARIANT_KERNEL:=true
else
JVM_VARIANTS:=server
JVM_VARIANT_SERVER:=true
endif
endif
JDK_INCLUDE_SUBDIR=win32
# Library suffix
@ -177,17 +190,20 @@ EXPORT_SERVER_DIR = $(EXPORT_JRE_BIN_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_BIN_DIR)/client
EXPORT_KERNEL_DIR = $(EXPORT_JRE_BIN_DIR)/kernel
ifeq ($(JVM_VARIANT_SERVER),true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.pdb
EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map
EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib
ifeq ($(ARCH_DATA_MODEL), 32)
endif
ifeq ($(JVM_VARIANT_CLIENT),true)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.pdb
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map
# kernel vm
endif
ifeq ($(JVM_VARIANT_KERNEL),true)
EXPORT_LIST += $(EXPORT_KERNEL_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.pdb

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, 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
@ -207,10 +207,15 @@ int BsdAttachListener::init() {
res = ::listen(listener, 5);
if (res == 0) {
RESTARTABLE(::chmod(initial_path, S_IREAD|S_IWRITE), res);
if (res == 0) {
// make sure the file is owned by the effective user and effective group
// (this is the default on linux, but not on mac os)
RESTARTABLE(::chown(initial_path, geteuid(), getegid()), res);
if (res == 0) {
res = ::rename(initial_path, path);
}
}
}
if (res == -1) {
RESTARTABLE(::close(listener), res);
::unlink(initial_path);

View File

@ -257,6 +257,18 @@ const char* InlineTree::should_not_inline(ciMethod *callee_method, ciMethod* cal
return "exception method";
}
if (callee_method->should_not_inline()) {
return "disallowed by CompilerOracle";
}
if (UseStringCache) {
// Do not inline StringCache::profile() method used only at the beginning.
if (callee_method->name() == ciSymbol::profile_name() &&
callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
return "profiling method";
}
}
// use frequency-based objections only for non-trivial methods
if (callee_method->code_size_for_inlining() <= MaxTrivialSize) return NULL;
@ -278,18 +290,6 @@ const char* InlineTree::should_not_inline(ciMethod *callee_method, ciMethod* cal
}
}
if (callee_method->should_not_inline()) {
return "disallowed by CompilerOracle";
}
if (UseStringCache) {
// Do not inline StringCache::profile() method used only at the beginning.
if (callee_method->name() == ciSymbol::profile_name() &&
callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
return "profiling method";
}
}
return NULL;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, 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
@ -465,6 +465,9 @@
notproduct(bool, PrintOptimizePtrCompare, false, \
"Print information about optimized pointers compare") \
\
notproduct(bool, VerifyConnectionGraph , true, \
"Verify Connection Graph construction in Escape Analysis") \
\
product(bool, UseOptoBiasInlining, true, \
"Generate biased locking code in C2 ideal graph") \
\

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -1538,10 +1538,7 @@ Node *LockNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// If we are locking an unescaped object, the lock/unlock is unnecessary
//
ConnectionGraph *cgr = phase->C->congraph();
PointsToNode::EscapeState es = PointsToNode::GlobalEscape;
if (cgr != NULL)
es = cgr->escape_state(obj_node());
if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) {
if (cgr != NULL && cgr->not_global_escape(obj_node())) {
assert(!is_eliminated() || is_coarsened(), "sanity");
// The lock could be marked eliminated by lock coarsening
// code during first IGVN before EA. Replace coarsened flag
@ -1680,10 +1677,7 @@ Node *UnlockNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// If we are unlocking an unescaped object, the lock/unlock is unnecessary.
//
ConnectionGraph *cgr = phase->C->congraph();
PointsToNode::EscapeState es = PointsToNode::GlobalEscape;
if (cgr != NULL)
es = cgr->escape_state(obj_node());
if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) {
if (cgr != NULL && cgr->not_global_escape(obj_node())) {
assert(!is_eliminated() || is_coarsened(), "sanity");
// The lock could be marked eliminated by lock coarsening
// code during first IGVN before EA. Replace coarsened flag

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -546,6 +546,12 @@ public:
// or result projection is there are several CheckCastPP
// or returns NULL if there is no one.
Node *result_cast();
// Does this node returns pointer?
bool returns_pointer() const {
const TypeTuple *r = tf()->range();
return (r->cnt() > TypeFunc::Parms &&
r->field_at(TypeFunc::Parms)->isa_ptr());
}
// Collect all the interesting edges from a call for use in
// replacing the call by something else. Used by macro expansion

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -1707,7 +1707,6 @@ void Compile::Optimize() {
if (major_progress()) print_method("PhaseIdealLoop before EA", 2);
if (failing()) return;
}
TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true);
ConnectionGraph::do_analysis(this, &igvn);
if (failing()) return;
@ -1719,6 +1718,7 @@ void Compile::Optimize() {
if (failing()) return;
if (congraph() != NULL && macro_count() > 0) {
NOT_PRODUCT( TracePhase t2("macroEliminate", &_t_macroEliminate, TimeCompiler); )
PhaseMacroExpand mexp(igvn);
mexp.eliminate_macro_nodes();
igvn.set_delay_transform(false);
@ -1875,10 +1875,10 @@ void Compile::Code_Gen() {
cfg.Estimate_Block_Frequency();
cfg.GlobalCodeMotion(m,unique(),proj_list);
if (failing()) return;
print_method("Global code motion", 2);
if (failing()) return;
NOT_PRODUCT( verify_graph_edges(); )
debug_only( cfg.verify(); )

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, 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
@ -115,18 +115,36 @@ class Node;
class CallNode;
class PhiNode;
class PhaseTransform;
class PointsToNode;
class Type;
class TypePtr;
class VectorSet;
class PointsToNode {
friend class ConnectionGraph;
class JavaObjectNode;
class LocalVarNode;
class FieldNode;
class ArraycopyNode;
// ConnectionGraph nodes
class PointsToNode : public ResourceObj {
GrowableArray<PointsToNode*> _edges; // List of nodes this node points to
GrowableArray<PointsToNode*> _uses; // List of nodes which point to this node
const u1 _type; // NodeType
u1 _flags; // NodeFlags
u1 _escape; // EscapeState of object
u1 _fields_escape; // EscapeState of object's fields
Node* const _node; // Ideal node corresponding to this PointsTo node.
const int _idx; // Cached ideal node's _idx
public:
typedef enum {
UnknownType = 0,
JavaObject = 1,
LocalVar = 2,
Field = 3
Field = 3,
Arraycopy = 4
} NodeType;
typedef enum {
@ -140,178 +158,387 @@ public:
} EscapeState;
typedef enum {
UnknownEdge = 0,
PointsToEdge = 1,
DeferredEdge = 2,
FieldEdge = 3
} EdgeType;
private:
enum {
EdgeMask = 3,
EdgeShift = 2,
INITIAL_EDGE_COUNT = 4
};
NodeType _type;
EscapeState _escape;
GrowableArray<uint>* _edges; // outgoing edges
Node* _node; // Ideal node corresponding to this PointsTo node.
int _offset; // Object fields offsets.
bool _scalar_replaceable; // Not escaped object could be replaced with scalar
bool _has_unknown_ptr; // Has edge to phantom_object
public:
PointsToNode():
_type(UnknownType),
_escape(UnknownEscape),
_edges(NULL),
_node(NULL),
_offset(-1),
_has_unknown_ptr(false),
_scalar_replaceable(true) {}
ScalarReplaceable = 1, // Not escaped object could be replaced with scalar
PointsToUnknown = 2, // Has edge to phantom_object
ArraycopySrc = 4, // Has edge from Arraycopy node
ArraycopyDst = 8 // Has edge to Arraycopy node
} NodeFlags;
EscapeState escape_state() const { return _escape; }
NodeType node_type() const { return _type;}
int offset() { return _offset;}
bool scalar_replaceable() { return _scalar_replaceable;}
bool has_unknown_ptr() { return _has_unknown_ptr;}
void set_offset(int offs) { _offset = offs;}
void set_escape_state(EscapeState state) { _escape = state; }
void set_node_type(NodeType ntype) {
assert(_type == UnknownType || _type == ntype, "Can't change node type");
_type = ntype;
}
void set_scalar_replaceable(bool v) { _scalar_replaceable = v; }
void set_has_unknown_ptr() { _has_unknown_ptr = true; }
// count of outgoing edges
uint edge_count() const { return (_edges == NULL) ? 0 : _edges->length(); }
// node index of target of outgoing edge "e"
uint edge_target(uint e) const {
assert(_edges != NULL, "valid edge index");
return (_edges->at(e) >> EdgeShift);
}
// type of outgoing edge "e"
EdgeType edge_type(uint e) const {
assert(_edges != NULL, "valid edge index");
return (EdgeType) (_edges->at(e) & EdgeMask);
PointsToNode(Compile *C, Node* n, EscapeState es, NodeType type):
_edges(C->comp_arena(), 2, 0, NULL),
_uses (C->comp_arena(), 2, 0, NULL),
_node(n),
_idx(n->_idx),
_type((u1)type),
_escape((u1)es),
_fields_escape((u1)es),
_flags(ScalarReplaceable) {
assert(n != NULL && es != UnknownEscape, "sanity");
}
// add a edge of the specified type pointing to the specified target
void add_edge(uint targIdx, EdgeType et);
Node* ideal_node() const { return _node; }
int idx() const { return _idx; }
// remove an edge of the specified type pointing to the specified target
void remove_edge(uint targIdx, EdgeType et);
bool is_JavaObject() const { return _type == (u1)JavaObject; }
bool is_LocalVar() const { return _type == (u1)LocalVar; }
bool is_Field() const { return _type == (u1)Field; }
bool is_Arraycopy() const { return _type == (u1)Arraycopy; }
JavaObjectNode* as_JavaObject() { assert(is_JavaObject(),""); return (JavaObjectNode*)this; }
LocalVarNode* as_LocalVar() { assert(is_LocalVar(),""); return (LocalVarNode*)this; }
FieldNode* as_Field() { assert(is_Field(),""); return (FieldNode*)this; }
ArraycopyNode* as_Arraycopy() { assert(is_Arraycopy(),""); return (ArraycopyNode*)this; }
EscapeState escape_state() const { return (EscapeState)_escape; }
void set_escape_state(EscapeState state) { _escape = (u1)state; }
EscapeState fields_escape_state() const { return (EscapeState)_fields_escape; }
void set_fields_escape_state(EscapeState state) { _fields_escape = (u1)state; }
bool has_unknown_ptr() const { return (_flags & PointsToUnknown) != 0; }
void set_has_unknown_ptr() { _flags |= PointsToUnknown; }
bool arraycopy_src() const { return (_flags & ArraycopySrc) != 0; }
void set_arraycopy_src() { _flags |= ArraycopySrc; }
bool arraycopy_dst() const { return (_flags & ArraycopyDst) != 0; }
void set_arraycopy_dst() { _flags |= ArraycopyDst; }
bool scalar_replaceable() const { return (_flags & ScalarReplaceable) != 0;}
void set_scalar_replaceable(bool v) {
if (v)
_flags |= ScalarReplaceable;
else
_flags &= ~ScalarReplaceable;
}
int edge_count() const { return _edges.length(); }
PointsToNode* edge(int e) const { return _edges.at(e); }
bool add_edge(PointsToNode* edge) { return _edges.append_if_missing(edge); }
int use_count() const { return _uses.length(); }
PointsToNode* use(int e) const { return _uses.at(e); }
bool add_use(PointsToNode* use) { return _uses.append_if_missing(use); }
// Mark base edge use to distinguish from stored value edge.
bool add_base_use(FieldNode* use) { return _uses.append_if_missing((PointsToNode*)((intptr_t)use + 1)); }
static bool is_base_use(PointsToNode* use) { return (((intptr_t)use) & 1); }
static PointsToNode* get_use_node(PointsToNode* use) { return (PointsToNode*)(((intptr_t)use) & ~1); }
// Return true if this node points to specified node or nodes it points to.
bool points_to(JavaObjectNode* ptn) const;
// Return true if this node points only to non-escaping allocations.
bool non_escaping_allocation();
// Return true if one node points to an other.
bool meet(PointsToNode* ptn);
#ifndef PRODUCT
NodeType node_type() const { return (NodeType)_type;}
void dump(bool print_state=true) const;
#endif
};
class LocalVarNode: public PointsToNode {
public:
LocalVarNode(Compile *C, Node* n, EscapeState es):
PointsToNode(C, n, es, LocalVar) {}
};
class JavaObjectNode: public PointsToNode {
public:
JavaObjectNode(Compile *C, Node* n, EscapeState es):
PointsToNode(C, n, es, JavaObject) {
if (es > NoEscape)
set_scalar_replaceable(false);
}
};
class FieldNode: public PointsToNode {
GrowableArray<PointsToNode*> _bases; // List of JavaObject nodes which point to this node
const int _offset; // Field's offset.
const bool _is_oop; // Field points to object
bool _has_unknown_base; // Has phantom_object base
public:
FieldNode(Compile *C, Node* n, EscapeState es, int offs, bool is_oop):
PointsToNode(C, n, es, Field),
_offset(offs), _is_oop(is_oop),
_has_unknown_base(false) {}
int offset() const { return _offset;}
bool is_oop() const { return _is_oop;}
bool has_unknown_base() const { return _has_unknown_base; }
void set_has_unknown_base() { _has_unknown_base = true; }
int base_count() const { return _bases.length(); }
PointsToNode* base(int e) const { return _bases.at(e); }
bool add_base(PointsToNode* base) { return _bases.append_if_missing(base); }
#ifdef ASSERT
// Return true if bases points to this java object.
bool has_base(JavaObjectNode* ptn) const;
#endif
};
class ArraycopyNode: public PointsToNode {
public:
ArraycopyNode(Compile *C, Node* n, EscapeState es):
PointsToNode(C, n, es, Arraycopy) {}
};
// Iterators for PointsTo node's edges:
// for (EdgeIterator i(n); i.has_next(); i.next()) {
// PointsToNode* u = i.get();
class PointsToIterator: public StackObj {
protected:
const PointsToNode* node;
const int cnt;
int i;
public:
inline PointsToIterator(const PointsToNode* n, int cnt) : node(n), cnt(cnt), i(0) { }
inline bool has_next() const { return i < cnt; }
inline void next() { i++; }
PointsToNode* get() const { ShouldNotCallThis(); return NULL; }
};
class EdgeIterator: public PointsToIterator {
public:
inline EdgeIterator(const PointsToNode* n) : PointsToIterator(n, n->edge_count()) { }
inline PointsToNode* get() const { return node->edge(i); }
};
class UseIterator: public PointsToIterator {
public:
inline UseIterator(const PointsToNode* n) : PointsToIterator(n, n->use_count()) { }
inline PointsToNode* get() const { return node->use(i); }
};
class BaseIterator: public PointsToIterator {
public:
inline BaseIterator(const FieldNode* n) : PointsToIterator(n, n->base_count()) { }
inline PointsToNode* get() const { return ((PointsToNode*)node)->as_Field()->base(i); }
};
class ConnectionGraph: public ResourceObj {
private:
GrowableArray<PointsToNode> _nodes; // Connection graph nodes indexed
// by ideal node index.
GrowableArray<PointsToNode*> _nodes; // Map from ideal nodes to
// ConnectionGraph nodes.
Unique_Node_List _delayed_worklist; // Nodes to be processed before
// the call build_connection_graph().
GrowableArray<MergeMemNode *> _mergemem_worklist; // List of all MergeMem nodes
VectorSet _processed; // Records which nodes have been
// processed.
GrowableArray<PointsToNode*> _worklist; // Nodes to be processed
bool _collecting; // Indicates whether escape information
// is still being collected. If false,
// no new nodes will be processed.
bool _progress; // Indicates whether new Graph's edges
// were created.
bool _verify; // verify graph
uint _phantom_object; // Index of globally escaping object
// that pointer values loaded from
// a field which has not been set
// are assumed to point to.
uint _oop_null; // ConP(#NULL)->_idx
uint _noop_null; // ConN(#NULL)->_idx
JavaObjectNode* phantom_obj; // Unknown object
JavaObjectNode* null_obj;
Node* _pcmp_neq; // ConI(#CC_GT)
Node* _pcmp_eq; // ConI(#CC_EQ)
Compile* _compile; // Compile object for current compilation
PhaseIterGVN* _igvn; // Value numbering
Unique_Node_List ideal_nodes; // Used by CG construction and types splitting.
// Address of an element in _nodes. Used when the element is to be modified
PointsToNode *ptnode_adr(uint idx) const {
PointsToNode* ptnode_adr(int idx) const {
// There should be no new ideal nodes during ConnectionGraph build,
// growableArray::adr_at() will throw assert otherwise.
return _nodes.adr_at(idx);
// growableArray::at() will throw assert otherwise.
return _nodes.at(idx);
}
uint nodes_size() const { return _nodes.length(); }
bool is_null_ptr(uint idx) const { return (idx == _noop_null || idx == _oop_null); }
// Add nodes to ConnectionGraph.
void add_local_var(Node* n, PointsToNode::EscapeState es);
void add_java_object(Node* n, PointsToNode::EscapeState es);
void add_field(Node* n, PointsToNode::EscapeState es, int offset);
void add_arraycopy(Node* n, PointsToNode::EscapeState es, PointsToNode* src, PointsToNode* dst);
// Add node to ConnectionGraph.
void add_node(Node *n, PointsToNode::NodeType nt, PointsToNode::EscapeState es, bool done);
// Compute the escape state for arguments to a call.
void process_call_arguments(CallNode *call);
// Add PointsToNode node corresponding to a call
void add_call_node(CallNode* call);
// Map ideal node to existing PointsTo node (usually phantom_object).
void map_ideal_node(Node *n, PointsToNode* ptn) {
assert(ptn != NULL, "only existing PointsTo node");
_nodes.at_put(n->_idx, ptn);
}
// Create PointsToNode node and add it to Connection Graph.
void add_node_to_connection_graph(Node *n, Unique_Node_List *delayed_worklist);
// Add final simple edges to graph.
void add_final_edges(Node *n);
// Finish Graph construction.
bool complete_connection_graph(GrowableArray<PointsToNode*>& ptnodes_worklist,
GrowableArray<JavaObjectNode*>& non_escaped_worklist,
GrowableArray<JavaObjectNode*>& java_objects_worklist,
GrowableArray<FieldNode*>& oop_fields_worklist);
#ifdef ASSERT
void verify_connection_graph(GrowableArray<PointsToNode*>& ptnodes_worklist,
GrowableArray<JavaObjectNode*>& non_escaped_worklist,
GrowableArray<JavaObjectNode*>& java_objects_worklist,
GrowableArray<Node*>& addp_worklist);
#endif
// Add all references to this JavaObject node.
int add_java_object_edges(JavaObjectNode* jobj, bool populate_worklist);
// Put node on worklist if it is (or was) not there.
void add_to_worklist(PointsToNode* pt) {
_worklist.push(pt);
return;
}
// Put on worklist all uses of this node.
void add_uses_to_worklist(PointsToNode* pt) {
for (UseIterator i(pt); i.has_next(); i.next())
_worklist.push(i.get());
}
// Put on worklist all field's uses and related field nodes.
void add_field_uses_to_worklist(FieldNode* field);
// Put on worklist all related field nodes.
void add_fields_to_worklist(FieldNode* field, PointsToNode* base);
// Find fields which have unknown value.
int find_field_value(FieldNode* field);
// Find fields initializing values for allocations.
int find_init_values(JavaObjectNode* ptn, PointsToNode* init_val, PhaseTransform* phase);
// Set the escape state of an object and its fields.
void set_escape_state(PointsToNode* ptn, PointsToNode::EscapeState esc) {
// Don't change non-escaping state of NULL pointer.
if (ptn != null_obj) {
if (ptn->escape_state() < esc)
ptn->set_escape_state(esc);
if (ptn->fields_escape_state() < esc)
ptn->set_fields_escape_state(esc);
}
}
void set_fields_escape_state(PointsToNode* ptn, PointsToNode::EscapeState esc) {
// Don't change non-escaping state of NULL pointer.
if (ptn != null_obj) {
if (ptn->fields_escape_state() < esc)
ptn->set_fields_escape_state(esc);
}
}
// Propagate GlobalEscape and ArgEscape escape states to all nodes
// and check that we still have non-escaping java objects.
bool find_non_escaped_objects(GrowableArray<PointsToNode*>& ptnodes_worklist,
GrowableArray<JavaObjectNode*>& non_escaped_worklist);
// Adjust scalar_replaceable state after Connection Graph is built.
void adjust_scalar_replaceable_state(JavaObjectNode* jobj);
// Optimize ideal graph.
void optimize_ideal_graph(GrowableArray<Node*>& ptr_cmp_worklist,
GrowableArray<Node*>& storestore_worklist);
// Optimize objects compare.
Node* optimize_ptr_compare(Node* n);
// Returns unique corresponding java object or NULL.
JavaObjectNode* unique_java_object(Node *n);
// Add an edge of the specified type pointing to the specified target.
bool add_edge(PointsToNode* from, PointsToNode* to) {
assert(!from->is_Field() || from->as_Field()->is_oop(), "sanity");
if (to == phantom_obj) {
if (from->has_unknown_ptr()) {
return false; // already points to phantom_obj
}
from->set_has_unknown_ptr();
}
bool is_new = from->add_edge(to);
assert(to != phantom_obj || is_new, "sanity");
if (is_new) { // New edge?
assert(!_verify, "graph is incomplete");
is_new = to->add_use(from);
assert(is_new, "use should be also new");
}
return is_new;
}
// Add an edge from Field node to its base and back.
bool add_base(FieldNode* from, PointsToNode* to) {
assert(!to->is_Arraycopy(), "sanity");
if (to == phantom_obj) {
if (from->has_unknown_base()) {
return false; // already has phantom_obj base
}
from->set_has_unknown_base();
}
bool is_new = from->add_base(to);
assert(to != phantom_obj || is_new, "sanity");
if (is_new) { // New edge?
assert(!_verify, "graph is incomplete");
if (to == null_obj)
return is_new; // Don't add fields to NULL pointer.
if (to->is_JavaObject()) {
is_new = to->add_edge(from);
} else {
is_new = to->add_base_use(from);
}
assert(is_new, "use should be also new");
}
return is_new;
}
// Add LocalVar node and edge if possible
void add_local_var_and_edge(Node* n, PointsToNode::EscapeState es, Node* to,
Unique_Node_List *delayed_worklist) {
PointsToNode* ptn = ptnode_adr(to->_idx);
if (delayed_worklist != NULL) { // First iteration of CG construction
add_local_var(n, es);
if (ptn == NULL) {
delayed_worklist->push(n);
return; // Process it later.
}
} else {
assert(ptn != NULL, "node should be registered");
}
add_edge(ptnode_adr(n->_idx), ptn);
}
// Helper functions
bool is_oop_field(Node* n, int offset);
static Node* get_addp_base(Node *addp);
static Node* find_second_addp(Node* addp, Node* n);
// offset of a field reference
int address_offset(Node* adr, PhaseTransform *phase);
// compute the escape state for arguments to a call
void process_call_arguments(CallNode *call, PhaseTransform *phase);
// compute the escape state for the return value of a call
void process_call_result(ProjNode *resproj, PhaseTransform *phase);
// Propagate unique types created for unescaped allocated objects
// through the graph
void split_unique_types(GrowableArray<Node *> &alloc_worklist);
// Populate Connection Graph with Ideal nodes.
void record_for_escape_analysis(Node *n, PhaseTransform *phase);
// Helper methods for unique types split.
bool split_AddP(Node *addp, Node *base);
// Build Connection Graph and set nodes escape state.
void build_connection_graph(Node *n, PhaseTransform *phase);
PhiNode *create_split_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist, bool &new_created);
PhiNode *split_memory_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist);
// walk the connection graph starting at the node corresponding to "n" and
// add the index of everything it could point to, to "ptset". This may cause
// Phi's encountered to get (re)processed (which requires "phase".)
VectorSet* PointsTo(Node * n);
// Reused structures for PointsTo().
VectorSet pt_ptset;
VectorSet pt_visited;
GrowableArray<uint> pt_worklist;
// Edge manipulation. The "from_i" and "to_i" arguments are the
// node indices of the source and destination of the edge
void add_pointsto_edge(uint from_i, uint to_i);
void add_deferred_edge(uint from_i, uint to_i);
void add_field_edge(uint from_i, uint to_i, int offs);
// Add an edge of the specified type pointing to the specified target.
// Set _progress if new edge is added.
void add_edge(PointsToNode *f, uint to_i, PointsToNode::EdgeType et) {
uint e_cnt = f->edge_count();
f->add_edge(to_i, et);
_progress |= (f->edge_count() != e_cnt);
}
// Add an edge to node given by "to_i" from any field of adr_i whose offset
// matches "offset" A deferred edge is added if to_i is a LocalVar, and
// a pointsto edge is added if it is a JavaObject
void add_edge_from_fields(uint adr, uint to_i, int offs);
// Add a deferred edge from node given by "from_i" to any field
// of adr_i whose offset matches "offset"
void add_deferred_edge_to_fields(uint from_i, uint adr, int offs);
void move_inst_mem(Node* n, GrowableArray<PhiNode *> &orig_phis);
Node* find_inst_mem(Node* mem, int alias_idx,GrowableArray<PhiNode *> &orig_phi_worklist);
Node* step_through_mergemem(MergeMemNode *mmem, int alias_idx, const TypeOopPtr *toop);
// Remove outgoing deferred edges from the node referenced by "ni".
// Any outgoing edges from the target of the deferred edge are copied
// to "ni".
void remove_deferred(uint ni, GrowableArray<uint>* deferred_edges, VectorSet* visited);
GrowableArray<MergeMemNode*> _mergemem_worklist; // List of all MergeMem nodes
Node_Array _node_map; // used for bookeeping during type splitting
// Used for the following purposes:
@ -320,19 +547,16 @@ private:
// MemNode - new memory input for this node
// ChecCastPP - allocation that this is a cast of
// allocation - CheckCastPP of the allocation
bool split_AddP(Node *addp, Node *base, PhaseGVN *igvn);
PhiNode *create_split_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist, PhaseGVN *igvn, bool &new_created);
PhiNode *split_memory_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist, PhaseGVN *igvn);
void move_inst_mem(Node* n, GrowableArray<PhiNode *> &orig_phis, PhaseGVN *igvn);
Node *find_inst_mem(Node *mem, int alias_idx,GrowableArray<PhiNode *> &orig_phi_worklist, PhaseGVN *igvn);
// Propagate unique types created for unescaped allocated objects
// through the graph
void split_unique_types(GrowableArray<Node *> &alloc_worklist);
// manage entries in _node_map
void set_map(int idx, Node *n) { _node_map.map(idx, n); }
void set_map(Node* from, Node* to) {
ideal_nodes.push(from);
_node_map.map(from->_idx, to);
}
Node* get_map(int idx) { return _node_map[idx]; }
PhiNode* get_map_phi(int idx) {
Node* phi = _node_map[idx];
return (phi == NULL) ? NULL : phi->as_Phi();
@ -344,23 +568,6 @@ private:
_igvn->add_users_to_worklist(n);
}
// Set the escape state of a node
void set_escape_state(uint ni, PointsToNode::EscapeState es);
// Find fields initializing values for allocations.
void find_init_values(Node* n, VectorSet* visited, PhaseTransform* phase);
// Adjust escape state after Connection Graph is built.
void adjust_escape_state(Node* n);
// Propagate escape states to referenced nodes.
bool propagate_escape_state(GrowableArray<int>* cg_worklist,
GrowableArray<uint>* worklist,
PointsToNode::EscapeState esc_state);
// Optimize objects compare.
Node* optimize_ptr_compare(Node* n);
// Compute the escape information
bool compute_escape();
@ -373,11 +580,10 @@ public:
// Perform escape analysis
static void do_analysis(Compile *C, PhaseIterGVN *igvn);
// escape state of a node
PointsToNode::EscapeState escape_state(Node *n);
bool not_global_escape(Node *n);
#ifndef PRODUCT
void dump();
void dump(GrowableArray<PointsToNode*>& ptnodes_worklist);
#endif
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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,8 +39,9 @@ elapsedTimer Phase::_t_stubCompilation;
// The next timers used for LogCompilation
elapsedTimer Phase::_t_parser;
elapsedTimer Phase::_t_escapeAnalysis;
elapsedTimer Phase::_t_optimizer;
elapsedTimer Phase::_t_escapeAnalysis;
elapsedTimer Phase::_t_connectionGraph;
elapsedTimer Phase::_t_idealLoop;
elapsedTimer Phase::_t_ccp;
elapsedTimer Phase::_t_matcher;
@ -51,6 +52,7 @@ elapsedTimer Phase::_t_output;
elapsedTimer Phase::_t_graphReshaping;
elapsedTimer Phase::_t_scheduler;
elapsedTimer Phase::_t_blockOrdering;
elapsedTimer Phase::_t_macroEliminate;
elapsedTimer Phase::_t_macroExpand;
elapsedTimer Phase::_t_peephole;
elapsedTimer Phase::_t_codeGeneration;
@ -104,6 +106,8 @@ void Phase::print_timers() {
if (DoEscapeAnalysis) {
// EA is part of Optimizer.
tty->print_cr (" escape analysis: %3.3f sec", Phase::_t_escapeAnalysis.seconds());
tty->print_cr (" connection graph: %3.3f sec", Phase::_t_connectionGraph.seconds());
tty->print_cr (" macroEliminate : %3.3f sec", Phase::_t_macroEliminate.seconds());
}
tty->print_cr (" iterGVN : %3.3f sec", Phase::_t_iterGVN.seconds());
tty->print_cr (" idealLoop : %3.3f sec", Phase::_t_idealLoop.seconds());
@ -112,9 +116,10 @@ void Phase::print_timers() {
tty->print_cr (" iterGVN2 : %3.3f sec", Phase::_t_iterGVN2.seconds());
tty->print_cr (" macroExpand : %3.3f sec", Phase::_t_macroExpand.seconds());
tty->print_cr (" graphReshape : %3.3f sec", Phase::_t_graphReshaping.seconds());
double optimizer_subtotal = Phase::_t_iterGVN.seconds() +
double optimizer_subtotal = Phase::_t_iterGVN.seconds() + Phase::_t_iterGVN2.seconds() +
Phase::_t_escapeAnalysis.seconds() + Phase::_t_macroEliminate.seconds() +
Phase::_t_idealLoop.seconds() + Phase::_t_ccp.seconds() +
Phase::_t_graphReshaping.seconds();
Phase::_t_macroExpand.seconds() + Phase::_t_graphReshaping.seconds();
double percent_of_optimizer = ((optimizer_subtotal == 0.0) ? 0.0 : (optimizer_subtotal / Phase::_t_optimizer.seconds() * 100.0));
tty->print_cr (" subtotal : %3.3f sec, %3.2f %%", optimizer_subtotal, percent_of_optimizer);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -72,8 +72,12 @@ protected:
// The next timers used for LogCompilation
static elapsedTimer _t_parser;
static elapsedTimer _t_escapeAnalysis;
static elapsedTimer _t_optimizer;
public:
// ConnectionGraph can't be Phase since it is used after EA done.
static elapsedTimer _t_escapeAnalysis;
static elapsedTimer _t_connectionGraph;
protected:
static elapsedTimer _t_idealLoop;
static elapsedTimer _t_ccp;
static elapsedTimer _t_matcher;
@ -84,6 +88,7 @@ protected:
static elapsedTimer _t_graphReshaping;
static elapsedTimer _t_scheduler;
static elapsedTimer _t_blockOrdering;
static elapsedTimer _t_macroEliminate;
static elapsedTimer _t_macroExpand;
static elapsedTimer _t_peephole;
static elapsedTimer _t_codeGeneration;

View File

@ -816,8 +816,21 @@ bool Arguments::process_argument(const char* arg,
return true;
}
// For locked flags, report a custom error message if available.
// Otherwise, report the standard unrecognized VM option.
Flag* locked_flag = Flag::find_flag((char*)argname, strlen(argname), true);
if (locked_flag != NULL) {
char locked_message_buf[BUFLEN];
locked_flag->get_locked_message(locked_message_buf, BUFLEN);
if (strlen(locked_message_buf) == 0) {
jio_fprintf(defaultStream::error_stream(),
"Unrecognized VM option '%s'\n", argname);
} else {
jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf);
}
}
// allow for commandline "commenting out" options like -XX:#+Verbose
return arg[0] == '#';
}
@ -2523,15 +2536,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
// was arrived at by experimenting with specjbb.
FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K); // Note: this is in words
// CompilationPolicyChoice=0 causes the server compiler to adopt
// a more conservative which-method-do-I-compile policy when one
// of the counters maintained by the interpreter trips. The
// result is reduced startup time and improved specjbb and
// alacrity performance. Zero is the default, but we set it
// explicitly here in case the default changes.
// See runtime/compilationPolicy.*.
FLAG_SET_CMDLINE(intx, CompilationPolicyChoice, 0);
// Enable parallel GC and adaptive generation sizing
FLAG_SET_CMDLINE(bool, UseParallelGC, true);
FLAG_SET_DEFAULT(ParallelGCThreads,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -81,6 +81,12 @@ bool Flag::is_unlocked() const {
}
}
// Get custom message for this locked flag, or return NULL if
// none is available.
void Flag::get_locked_message(char* buf, int buflen) const {
get_locked_message_ext(buf, buflen);
}
bool Flag::is_writeable() const {
return strcmp(kind, "{manageable}") == 0 ||
strcmp(kind, "{product rw}") == 0 ||
@ -260,17 +266,22 @@ inline bool str_equal(const char* s, char* q, size_t len) {
return strncmp(s, q, len) == 0;
}
Flag* Flag::find_flag(char* name, size_t length) {
for (Flag* current = &flagTable[0]; current->name; current++) {
// Search the flag table for a named flag
Flag* Flag::find_flag(char* name, size_t length, bool allow_locked) {
for (Flag* current = &flagTable[0]; current->name != NULL; current++) {
if (str_equal(current->name, name, length)) {
// Found a matching entry. Report locked flags only if allowed.
if (!(current->is_unlocked() || current->is_unlocker())) {
// disable use of diagnostic or experimental flags until they
// are explicitly unlocked
if (!allow_locked) {
// disable use of locked flags, e.g. diagnostic, experimental,
// commercial... until they are explicitly unlocked
return NULL;
}
}
return current;
}
}
// Flag name is not in the flag table
return NULL;
}

View File

@ -222,7 +222,7 @@ struct Flag {
// number of flags
static size_t numFlags;
static Flag* find_flag(char* name, size_t length);
static Flag* find_flag(char* name, size_t length, bool allow_locked = false);
bool is_bool() const { return strcmp(type, "bool") == 0; }
bool get_bool() const { return *((bool*) addr); }
@ -259,6 +259,9 @@ struct Flag {
bool is_writeable_ext() const;
bool is_external_ext() const;
void get_locked_message(char*, int) const;
void get_locked_message_ext(char*, int) const;
void print_on(outputStream* st, bool withComments = false );
void print_as_flag(outputStream* st);
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2012, 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
@ -61,4 +61,9 @@ inline bool Flag::is_external_ext() const {
return false;
}
inline void Flag::get_locked_message_ext(char* buf, int buflen) const {
assert(buf != NULL, "Buffer cannot be NULL");
buf[0] = '\0';
}
#endif // SHARE_VM_RUNTIME_GLOBALS_EXT_HPP

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -198,8 +198,11 @@ template<class E> class GrowableArray : public GenericGrowableArray {
return idx;
}
void append_if_missing(const E& elem) {
if (!contains(elem)) append(elem);
bool append_if_missing(const E& elem) {
// Returns TRUE if elem is added.
bool missed = !contains(elem);
if (missed) append(elem);
return missed;
}
E at(int i) const {
@ -292,12 +295,22 @@ template<class E> class GrowableArray : public GenericGrowableArray {
ShouldNotReachHere();
}
// The order is preserved.
void remove_at(int index) {
assert(0 <= index && index < _len, "illegal index");
for (int j = index + 1; j < _len; j++) _data[j-1] = _data[j];
_len--;
}
// The order is changed.
void delete_at(int index) {
assert(0 <= index && index < _len, "illegal index");
if (index < --_len) {
// Replace removed element with last one.
_data[index] = _data[_len];
}
}
// inserts the given element before the element at index i
void insert_before(const int idx, const E& elem) {
check_nesting();