Merge
This commit is contained in:
commit
a5477b8630
1
.hgtags
1
.hgtags
@ -211,3 +211,4 @@ da9a4c9312816451884aa6db6f18be51a07bff13 jdk8-b86
|
|||||||
5ebf6c63714de2c9dcf831074086d31daec819df jdk8-b87
|
5ebf6c63714de2c9dcf831074086d31daec819df jdk8-b87
|
||||||
e517701a4d0e25ae9c7945bca6e1762a8c5d8aa6 jdk8-b88
|
e517701a4d0e25ae9c7945bca6e1762a8c5d8aa6 jdk8-b88
|
||||||
4dec41b3c5e3bb616f0c6f15830d940905aa5d16 jdk8-b89
|
4dec41b3c5e3bb616f0c6f15830d940905aa5d16 jdk8-b89
|
||||||
|
f09ab0c416185e3cba371e81bcb6a16060c90f44 jdk8-b90
|
||||||
|
@ -211,3 +211,4 @@ df9b5240f0a76c91cfe1a5b39da4d08df56e05be jdk8-b86
|
|||||||
b9415faa7066a4d3b16d466556d5428446918d95 jdk8-b87
|
b9415faa7066a4d3b16d466556d5428446918d95 jdk8-b87
|
||||||
e1a929afcfc492470d50be0b6b0e8dc77d3760b9 jdk8-b88
|
e1a929afcfc492470d50be0b6b0e8dc77d3760b9 jdk8-b88
|
||||||
892a0196d10c67f3a12f0eefb0bb536e423d8868 jdk8-b89
|
892a0196d10c67f3a12f0eefb0bb536e423d8868 jdk8-b89
|
||||||
|
69b773a221b956a3386933ecdbfeccee0edeac47 jdk8-b90
|
||||||
|
@ -73,7 +73,7 @@ else
|
|||||||
grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
|
grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
|
||||||
|
|
||||||
$(all_phony_targets):
|
$(all_phony_targets):
|
||||||
@$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@) &&) true
|
@$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -54,9 +54,9 @@ MAKE_ARGS="SPEC=$(SPEC)"
|
|||||||
|
|
||||||
MAKE:=@MAKE@
|
MAKE:=@MAKE@
|
||||||
|
|
||||||
# Pass along the verbosity setting.
|
# Pass along the verbosity and log level settings.
|
||||||
ifeq (,$(findstring VERBOSE=,$(MAKE)))
|
ifeq (,$(findstring VERBOSE=,$(MAKE)))
|
||||||
MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)"
|
MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)" LOG_LEVEL="$(LOG_LEVEL)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# No implicit variables or rules!
|
# No implicit variables or rules!
|
||||||
|
@ -240,10 +240,10 @@ clean-docs:
|
|||||||
clean-test:
|
clean-test:
|
||||||
$(call CleanComponent,testoutput)
|
$(call CleanComponent,testoutput)
|
||||||
|
|
||||||
.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install
|
.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs
|
||||||
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only
|
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only
|
||||||
.PHONY: all test clean dist-clean bootcycle-images start-make
|
.PHONY: all clean dist-clean bootcycle-images start-make
|
||||||
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build
|
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-test clean-overlay-images clean-bootcycle-build
|
||||||
.PHONY: profiles profiles-only profiles-oscheck
|
.PHONY: profiles profiles-only profiles-oscheck
|
||||||
|
|
||||||
FRC: # Force target
|
FRC: # Force target
|
||||||
|
@ -321,11 +321,17 @@ define SetupNativeCompilation
|
|||||||
|
|
||||||
ifneq (,$$($1_DEBUG_SYMBOLS))
|
ifneq (,$$($1_DEBUG_SYMBOLS))
|
||||||
ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
|
ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
|
||||||
# Programs don't get the debug symbols added in the old build. It's not clear if
|
ifdef OPENJDK
|
||||||
# this is intentional.
|
# Always add debug symbols
|
||||||
ifeq ($$($1_PROGRAM),)
|
|
||||||
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
|
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
|
||||||
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
|
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
|
||||||
|
else
|
||||||
|
# Programs don't get the debug symbols added in the old build. It's not clear if
|
||||||
|
# this is intentional.
|
||||||
|
ifeq ($$($1_PROGRAM),)
|
||||||
|
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
|
||||||
|
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -211,3 +211,4 @@ a45bb25a67c7517b45f00c9682e317f46fecbba9 jdk8-b83
|
|||||||
f1709874d55a06bc3d5dfa02dbcdfbc59f4cba34 jdk8-b87
|
f1709874d55a06bc3d5dfa02dbcdfbc59f4cba34 jdk8-b87
|
||||||
4e3a881ebb1ee96ce0872508b0066d74f310dbfa jdk8-b88
|
4e3a881ebb1ee96ce0872508b0066d74f310dbfa jdk8-b88
|
||||||
fe4150590ee597f4e125fea950aa3b352622cc2d jdk8-b89
|
fe4150590ee597f4e125fea950aa3b352622cc2d jdk8-b89
|
||||||
|
c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90
|
||||||
|
@ -341,3 +341,5 @@ c4af77d2045476c56fbf3f914b336bb1b7cd18af hs25-b30
|
|||||||
4ec91349972255650f97bedfd07e6423e02428cf hs25-b31
|
4ec91349972255650f97bedfd07e6423e02428cf hs25-b31
|
||||||
9c1fe0b419b40a9ecdd1653cc9af1b6d67a12c46 jdk8-b89
|
9c1fe0b419b40a9ecdd1653cc9af1b6d67a12c46 jdk8-b89
|
||||||
69494caf57908ba2c8efa9eaaa472b4d1875588a hs25-b32
|
69494caf57908ba2c8efa9eaaa472b4d1875588a hs25-b32
|
||||||
|
1ae0472ff3a0117b5b019d380ad59fface2fde14 jdk8-b90
|
||||||
|
b19517cecc2e91636d7c16ba2f35e3d3dc628099 hs25-b33
|
||||||
|
@ -97,8 +97,8 @@ public class ciMethod extends ciMetadata {
|
|||||||
holder.getName().asString() + " " +
|
holder.getName().asString() + " " +
|
||||||
OopUtilities.escapeString(method.getName().asString()) + " " +
|
OopUtilities.escapeString(method.getName().asString()) + " " +
|
||||||
method.getSignature().asString() + " " +
|
method.getSignature().asString() + " " +
|
||||||
method.getInvocationCounter() + " " +
|
method.getInvocationCount() + " " +
|
||||||
method.getBackedgeCounter() + " " +
|
method.getBackedgeCount() + " " +
|
||||||
interpreterInvocationCount() + " " +
|
interpreterInvocationCount() + " " +
|
||||||
interpreterThrowoutCount() + " " +
|
interpreterThrowoutCount() + " " +
|
||||||
instructionsSize());
|
instructionsSize());
|
||||||
|
@ -24,15 +24,21 @@
|
|||||||
|
|
||||||
package sun.jvm.hotspot.oops;
|
package sun.jvm.hotspot.oops;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.PrintStream;
|
||||||
import java.util.*;
|
import java.util.Observable;
|
||||||
import sun.jvm.hotspot.code.*;
|
import java.util.Observer;
|
||||||
import sun.jvm.hotspot.debugger.*;
|
|
||||||
import sun.jvm.hotspot.interpreter.*;
|
import sun.jvm.hotspot.code.NMethod;
|
||||||
import sun.jvm.hotspot.memory.*;
|
import sun.jvm.hotspot.debugger.Address;
|
||||||
import sun.jvm.hotspot.runtime.*;
|
import sun.jvm.hotspot.interpreter.OopMapCacheEntry;
|
||||||
import sun.jvm.hotspot.types.*;
|
import sun.jvm.hotspot.runtime.SignatureConverter;
|
||||||
import sun.jvm.hotspot.utilities.*;
|
import sun.jvm.hotspot.runtime.VM;
|
||||||
|
import sun.jvm.hotspot.runtime.VMObjectFactory;
|
||||||
|
import sun.jvm.hotspot.types.AddressField;
|
||||||
|
import sun.jvm.hotspot.types.Type;
|
||||||
|
import sun.jvm.hotspot.types.TypeDataBase;
|
||||||
|
import sun.jvm.hotspot.types.WrongTypeException;
|
||||||
|
import sun.jvm.hotspot.utilities.Assert;
|
||||||
|
|
||||||
// A Method represents a Java method
|
// A Method represents a Java method
|
||||||
|
|
||||||
@ -132,11 +138,13 @@ public class Method extends Metadata {
|
|||||||
public long getAccessFlags() { return accessFlags.getValue(this); }
|
public long getAccessFlags() { return accessFlags.getValue(this); }
|
||||||
public long getCodeSize() { return getConstMethod().getCodeSize(); }
|
public long getCodeSize() { return getConstMethod().getCodeSize(); }
|
||||||
public long getVtableIndex() { return vtableIndex.getValue(this); }
|
public long getVtableIndex() { return vtableIndex.getValue(this); }
|
||||||
public long getInvocationCounter() {
|
public long getInvocationCount() {
|
||||||
return getMethodCounters().getInvocationCounter();
|
MethodCounters mc = getMethodCounters();
|
||||||
|
return mc == null ? 0 : mc.getInvocationCounter();
|
||||||
}
|
}
|
||||||
public long getBackedgeCounter() {
|
public long getBackedgeCount() {
|
||||||
return getMethodCounters().getBackedgeCounter();
|
MethodCounters mc = getMethodCounters();
|
||||||
|
return mc == null ? 0 : mc.getBackedgeCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get associated compiled native method, if available, else return null.
|
// get associated compiled native method, if available, else return null.
|
||||||
@ -349,8 +357,8 @@ public class Method extends Metadata {
|
|||||||
holder.getName().asString() + " " +
|
holder.getName().asString() + " " +
|
||||||
OopUtilities.escapeString(getName().asString()) + " " +
|
OopUtilities.escapeString(getName().asString()) + " " +
|
||||||
getSignature().asString() + " " +
|
getSignature().asString() + " " +
|
||||||
getInvocationCounter() + " " +
|
getInvocationCount() + " " +
|
||||||
getBackedgeCounter() + " " +
|
getBackedgeCount() + " " +
|
||||||
interpreterInvocationCount() + " " +
|
interpreterInvocationCount() + " " +
|
||||||
interpreterThrowoutCount() + " " +
|
interpreterThrowoutCount() + " " +
|
||||||
code_size);
|
code_size);
|
||||||
|
@ -316,8 +316,8 @@ public class MethodData extends Metadata {
|
|||||||
int iic = method.interpreterInvocationCount();
|
int iic = method.interpreterInvocationCount();
|
||||||
if (mileage < iic) mileage = iic;
|
if (mileage < iic) mileage = iic;
|
||||||
|
|
||||||
long ic = method.getInvocationCounter();
|
long ic = method.getInvocationCount();
|
||||||
long bc = method.getBackedgeCounter();
|
long bc = method.getBackedgeCount();
|
||||||
|
|
||||||
long icval = ic >> 3;
|
long icval = ic >> 3;
|
||||||
if ((ic & 4) != 0) icval += CompileThreshold;
|
if ((ic & 4) != 0) icval += CompileThreshold;
|
||||||
|
@ -151,32 +151,43 @@ else
|
|||||||
$(MAKE_ARGS) BUILD_FLAVOR=product docs
|
$(MAKE_ARGS) BUILD_FLAVOR=product docs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Output directories
|
||||||
|
C1_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
|
||||||
|
C2_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
|
||||||
|
MINIMAL1_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1
|
||||||
|
ZERO_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_zero
|
||||||
|
SHARK_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_shark
|
||||||
|
|
||||||
# Build variation of hotspot
|
# Build variation of hotspot
|
||||||
$(C1_VM_TARGETS):
|
$(C1_VM_TARGETS):
|
||||||
$(CD) $(GAMMADIR)/make; \
|
$(CD) $(GAMMADIR)/make; \
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT)
|
$(MAKE) BUILD_DIR=$(C1_DIR) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT)
|
||||||
|
|
||||||
$(C2_VM_TARGETS):
|
$(C2_VM_TARGETS):
|
||||||
$(CD) $(GAMMADIR)/make; \
|
$(CD) $(GAMMADIR)/make; \
|
||||||
$(MAKE) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT)
|
$(MAKE) BUILD_DIR=$(C2_DIR) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT)
|
||||||
|
|
||||||
$(ZERO_VM_TARGETS):
|
$(ZERO_VM_TARGETS):
|
||||||
$(CD) $(GAMMADIR)/make; \
|
$(CD) $(GAMMADIR)/make; \
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ \
|
$(MAKE) BUILD_DIR=$(ZERO_DIR) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
|
||||||
generic_buildzero $(ALT_OUT)
|
|
||||||
|
|
||||||
$(SHARK_VM_TARGETS):
|
$(SHARK_VM_TARGETS):
|
||||||
$(CD) $(GAMMADIR)/make; \
|
$(CD) $(GAMMADIR)/make; \
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ \
|
$(MAKE) BUILD_DIR=$(SHARK_DIR) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
|
||||||
generic_buildshark $(ALT_OUT)
|
|
||||||
|
|
||||||
$(MINIMAL1_VM_TARGETS):
|
$(MINIMAL1_VM_TARGETS):
|
||||||
$(CD) $(GAMMADIR)/make; \
|
$(CD) $(GAMMADIR)/make; \
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ \
|
$(MAKE) BUILD_DIR=$(MINIMAL1_DIR) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ generic_buildminimal1 $(ALT_OUT)
|
||||||
generic_buildminimal1 $(ALT_OUT)
|
|
||||||
|
# Install hotspot script in build directory
|
||||||
|
HOTSPOT_SCRIPT=$(BUILD_DIR)/$(BUILD_FLAVOR)/hotspot
|
||||||
|
$(HOTSPOT_SCRIPT): $(GAMMADIR)/make/hotspot.script
|
||||||
|
$(QUIETLY) $(MKDIR) -p $(BUILD_DIR)/$(BUILD_FLAVOR)
|
||||||
|
$(QUIETLY) cat $< | sed -e 's|@@LIBARCH@@|$(LIBARCH)|g' | sed -e 's|@@JDK_IMPORT_PATH@@|$(JDK_IMPORT_PATH)|g' > $@
|
||||||
|
$(QUIETLY) chmod +x $@
|
||||||
|
|
||||||
# Build compiler1 (client) rule, different for platforms
|
# Build compiler1 (client) rule, different for platforms
|
||||||
generic_build1:
|
generic_build1: $(HOTSPOT_SCRIPT)
|
||||||
$(MKDIR) -p $(OUTPUTDIR)
|
$(MKDIR) -p $(OUTPUTDIR)
|
||||||
ifeq ($(OSNAME),windows)
|
ifeq ($(OSNAME),windows)
|
||||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||||
@ -201,7 +212,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Build compiler2 (server) rule, different for platforms
|
# Build compiler2 (server) rule, different for platforms
|
||||||
generic_build2:
|
generic_build2: $(HOTSPOT_SCRIPT)
|
||||||
$(MKDIR) -p $(OUTPUTDIR)
|
$(MKDIR) -p $(OUTPUTDIR)
|
||||||
ifeq ($(OSNAME),windows)
|
ifeq ($(OSNAME),windows)
|
||||||
$(CD) $(OUTPUTDIR); \
|
$(CD) $(OUTPUTDIR); \
|
||||||
@ -217,19 +228,19 @@ else
|
|||||||
$(MAKE_ARGS) $(VM_TARGET)
|
$(MAKE_ARGS) $(VM_TARGET)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
generic_buildzero:
|
generic_buildzero: $(HOTSPOT_SCRIPT)
|
||||||
$(MKDIR) -p $(OUTPUTDIR)
|
$(MKDIR) -p $(OUTPUTDIR)
|
||||||
$(CD) $(OUTPUTDIR); \
|
$(CD) $(OUTPUTDIR); \
|
||||||
$(MAKE) -f $(ABS_OS_MAKEFILE) \
|
$(MAKE) -f $(ABS_OS_MAKEFILE) \
|
||||||
$(MAKE_ARGS) $(VM_TARGET)
|
$(MAKE_ARGS) $(VM_TARGET)
|
||||||
|
|
||||||
generic_buildshark:
|
generic_buildshark: $(HOTSPOT_SCRIPT)
|
||||||
$(MKDIR) -p $(OUTPUTDIR)
|
$(MKDIR) -p $(OUTPUTDIR)
|
||||||
$(CD) $(OUTPUTDIR); \
|
$(CD) $(OUTPUTDIR); \
|
||||||
$(MAKE) -f $(ABS_OS_MAKEFILE) \
|
$(MAKE) -f $(ABS_OS_MAKEFILE) \
|
||||||
$(MAKE_ARGS) $(VM_TARGET)
|
$(MAKE_ARGS) $(VM_TARGET)
|
||||||
|
|
||||||
generic_buildminimal1:
|
generic_buildminimal1: $(HOTSPOT_SCRIPT)
|
||||||
ifeq ($(JVM_VARIANT_MINIMAL1),true)
|
ifeq ($(JVM_VARIANT_MINIMAL1),true)
|
||||||
$(MKDIR) -p $(OUTPUTDIR)
|
$(MKDIR) -p $(OUTPUTDIR)
|
||||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||||
@ -252,224 +263,210 @@ endif
|
|||||||
|
|
||||||
# Export file rule
|
# Export file rule
|
||||||
generic_export: $(EXPORT_LIST)
|
generic_export: $(EXPORT_LIST)
|
||||||
|
|
||||||
export_product:
|
export_product:
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) generic_export
|
||||||
generic_export
|
|
||||||
export_fastdebug:
|
export_fastdebug:
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
|
||||||
EXPORT_SUBDIR=/$(@:export_%=%) \
|
|
||||||
generic_export
|
|
||||||
export_debug:
|
export_debug:
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
|
||||||
EXPORT_SUBDIR=/$(@:export_%=%) \
|
|
||||||
generic_export
|
|
||||||
export_optimized:
|
export_optimized:
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
|
||||||
EXPORT_SUBDIR=/$(@:export_%=%) \
|
|
||||||
generic_export
|
|
||||||
export_product_jdk::
|
export_product_jdk::
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) generic_export
|
||||||
VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
|
|
||||||
generic_export
|
|
||||||
export_optimized_jdk::
|
export_optimized_jdk::
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) generic_export
|
||||||
VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
|
|
||||||
generic_export
|
|
||||||
export_fastdebug_jdk::
|
export_fastdebug_jdk::
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export
|
||||||
VM_SUBDIR=$(@:export_%_jdk=%) \
|
|
||||||
ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
|
|
||||||
generic_export
|
|
||||||
export_debug_jdk::
|
export_debug_jdk::
|
||||||
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) VM_SUBDIR=$(@:export_%_jdk=%) \
|
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export
|
||||||
ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
|
|
||||||
generic_export
|
|
||||||
|
|
||||||
# Export file copy rules
|
# Export file copy rules
|
||||||
XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
|
XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
|
||||||
DOCS_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_docs
|
DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
|
||||||
C1_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1/$(VM_SUBDIR)
|
C1_BUILD_DIR =$(C1_DIR)/$(BUILD_FLAVOR)
|
||||||
C2_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2/$(VM_SUBDIR)
|
C2_BUILD_DIR =$(C2_DIR)/$(BUILD_FLAVOR)
|
||||||
MINIMAL1_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1/$(VM_SUBDIR)
|
MINIMAL1_BUILD_DIR=$(MINIMAL1_DIR)/$(BUILD_FLAVOR)
|
||||||
ZERO_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_zero/$(VM_SUBDIR)
|
ZERO_BUILD_DIR =$(ZERO_DIR)/$(BUILD_FLAVOR)
|
||||||
SHARK_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_shark/$(VM_SUBDIR)
|
SHARK_BUILD_DIR =$(SHARK_DIR)/$(BUILD_FLAVOR)
|
||||||
|
|
||||||
# Server (C2)
|
# Server (C2)
|
||||||
ifeq ($(JVM_VARIANT_SERVER), true)
|
ifeq ($(JVM_VARIANT_SERVER), true)
|
||||||
# Common
|
# Common
|
||||||
$(EXPORT_SERVER_DIR)/%.diz: $(C2_DIR)/%.diz
|
$(EXPORT_SERVER_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_LIB_DIR)/%.jar: $(C2_DIR)/../generated/%.jar
|
$(EXPORT_LIB_DIR)/%.jar: $(C2_BUILD_DIR)/../generated/%.jar
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_INCLUDE_DIR)/%: $(C2_DIR)/../generated/jvmtifiles/%
|
$(EXPORT_INCLUDE_DIR)/%: $(C2_BUILD_DIR)/../generated/jvmtifiles/%
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Windows
|
# Windows
|
||||||
$(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll
|
$(EXPORT_SERVER_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.pdb: $(C2_DIR)/%.pdb
|
$(EXPORT_SERVER_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map
|
$(EXPORT_SERVER_DIR)/%.map: $(C2_BUILD_DIR)/%.map
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_LIB_DIR)/%.lib: $(C2_DIR)/%.lib
|
$(EXPORT_LIB_DIR)/%.lib: $(C2_BUILD_DIR)/%.lib
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.diz: $(C2_DIR)/%.diz
|
$(EXPORT_JRE_BIN_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.dll: $(C2_DIR)/%.dll
|
$(EXPORT_JRE_BIN_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C2_DIR)/%.pdb
|
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.map: $(C2_DIR)/%.map
|
$(EXPORT_JRE_BIN_DIR)/%.map: $(C2_BUILD_DIR)/%.map
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Unix
|
# Unix
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo
|
$(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_DIR)/%.debuginfo
|
$(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_DIR)/%.diz
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/64/%.diz: $(C2_DIR)/%.diz
|
$(EXPORT_SERVER_DIR)/64/%.diz: $(C2_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Client (C1)
|
# Client (C1)
|
||||||
ifeq ($(JVM_VARIANT_CLIENT), true)
|
ifeq ($(JVM_VARIANT_CLIENT), true)
|
||||||
# Common
|
# Common
|
||||||
$(EXPORT_CLIENT_DIR)/%.diz: $(C1_DIR)/%.diz
|
$(EXPORT_CLIENT_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_LIB_DIR)/%.jar: $(C1_DIR)/../generated/%.jar
|
$(EXPORT_LIB_DIR)/%.jar: $(C1_BUILD_DIR)/../generated/%.jar
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_INCLUDE_DIR)/%: $(C1_DIR)/../generated/jvmtifiles/%
|
$(EXPORT_INCLUDE_DIR)/%: $(C1_BUILD_DIR)/../generated/jvmtifiles/%
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Windows
|
# Windows
|
||||||
$(EXPORT_CLIENT_DIR)/%.dll: $(C1_DIR)/%.dll
|
$(EXPORT_CLIENT_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb
|
$(EXPORT_CLIENT_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_CLIENT_DIR)/%.map: $(C1_DIR)/%.map
|
$(EXPORT_CLIENT_DIR)/%.map: $(C1_BUILD_DIR)/%.map
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_LIB_DIR)/%.lib: $(C1_DIR)/%.lib
|
$(EXPORT_LIB_DIR)/%.lib: $(C1_BUILD_DIR)/%.lib
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.diz: $(C1_DIR)/%.diz
|
$(EXPORT_JRE_BIN_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.dll: $(C1_DIR)/%.dll
|
$(EXPORT_JRE_BIN_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C1_DIR)/%.pdb
|
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.map: $(C1_DIR)/%.map
|
$(EXPORT_JRE_BIN_DIR)/%.map: $(C1_BUILD_DIR)/%.map
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Unix
|
# Unix
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_CLIENT_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo
|
$(EXPORT_CLIENT_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_CLIENT_DIR)/64/%.debuginfo: $(C1_DIR)/%.debuginfo
|
$(EXPORT_CLIENT_DIR)/64/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_DIR)/%.diz
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_DIR)/%.diz
|
$(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Minimal1
|
# Minimal1
|
||||||
ifeq ($(JVM_VARIANT_MINIMAL1), true)
|
ifeq ($(JVM_VARIANT_MINIMAL1), true)
|
||||||
# Common
|
# Common
|
||||||
$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
|
$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_LIB_DIR)/%.jar: $(MINIMAL1_DIR)/../generated/%.jar
|
$(EXPORT_LIB_DIR)/%.jar: $(MINIMAL1_BUILD_DIR)/../generated/%.jar
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_INCLUDE_DIR)/%: $(MINIMAL1_DIR)/../generated/jvmtifiles/%
|
$(EXPORT_INCLUDE_DIR)/%: $(MINIMAL1_BUILD_DIR)/../generated/jvmtifiles/%
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Windows
|
# Windows
|
||||||
$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll
|
$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb
|
$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_DIR)/%.map
|
$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_LIB_DIR)/%.lib: $(MINIMAL1_DIR)/%.lib
|
$(EXPORT_LIB_DIR)/%.lib: $(MINIMAL1_BUILD_DIR)/%.lib
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
|
$(EXPORT_JRE_BIN_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll
|
$(EXPORT_JRE_BIN_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb
|
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_BIN_DIR)/%.map: $(MINIMAL1_DIR)/%.map
|
$(EXPORT_JRE_BIN_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Unix
|
# Unix
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
|
$(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
|
$(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_DIR)/%.diz
|
$(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Zero
|
# Zero
|
||||||
ifeq ($(JVM_VARIANT_ZERO), true)
|
ifeq ($(JVM_VARIANT_ZERO), true)
|
||||||
# Common
|
# Common
|
||||||
$(EXPORT_LIB_DIR)/%.jar: $(ZERO_DIR)/../generated/%.jar
|
$(EXPORT_LIB_DIR)/%.jar: $(ZERO_BUILD_DIR)/../generated/%.jar
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_INCLUDE_DIR)/%: $(ZERO_DIR)/../generated/jvmtifiles/%
|
$(EXPORT_INCLUDE_DIR)/%: $(ZERO_BUILD_DIR)/../generated/jvmtifiles/%
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Unix
|
# Unix
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_DIR)/%.diz
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo
|
$(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.diz: $(ZERO_DIR)/%.diz
|
$(EXPORT_SERVER_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Shark
|
# Shark
|
||||||
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
|
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
|
||||||
# Common
|
# Common
|
||||||
$(EXPORT_LIB_DIR)/%.jar: $(SHARK_DIR)/../generated/%.jar
|
$(EXPORT_LIB_DIR)/%.jar: $(SHARK_BUILD_DIR)/../generated/%.jar
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_INCLUDE_DIR)/%: $(SHARK_DIR)/../generated/jvmtifiles/%
|
$(EXPORT_INCLUDE_DIR)/%: $(SHARK_BUILD_DIR)/../generated/jvmtifiles/%
|
||||||
$(install-file)
|
$(install-file)
|
||||||
# Unix
|
# Unix
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_DIR)/%.debuginfo
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_DIR)/%.diz
|
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
|
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_DIR)/%.debuginfo
|
$(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_BUILD_DIR)/%.debuginfo
|
||||||
$(install-file)
|
$(install-file)
|
||||||
$(EXPORT_SERVER_DIR)/%.diz: $(SHARK_DIR)/%.diz
|
$(EXPORT_SERVER_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz
|
||||||
$(install-file)
|
$(install-file)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
# adlc.make -
|
# adlc.make -
|
||||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||||
# sa.make - generate SA jar file and natives
|
# sa.make - generate SA jar file and natives
|
||||||
# env.[ck]sh - environment settings
|
|
||||||
#
|
#
|
||||||
# The makefiles are split this way so that "make foo" will run faster by not
|
# The makefiles are split this way so that "make foo" will run faster by not
|
||||||
# having to read the dependency files for the vm.
|
# having to read the dependency files for the vm.
|
||||||
@ -129,9 +128,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
|
|||||||
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
||||||
|
|
||||||
# dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
|
# dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
|
||||||
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make \
|
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make dtrace.make
|
||||||
jvmti.make sa.make dtrace.make \
|
|
||||||
env.sh env.csh jdkpath.sh
|
|
||||||
|
|
||||||
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||||
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||||
@ -354,33 +351,6 @@ dtrace.make: $(BUILDTREE_MAKE)
|
|||||||
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
|
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
|
||||||
) > $@
|
) > $@
|
||||||
|
|
||||||
env.sh: $(BUILDTREE_MAKE)
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
{ echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
|
|
||||||
{ \
|
|
||||||
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
|
||||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
|
||||||
echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
|
|
||||||
echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
env.csh: env.sh
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
|
||||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
jdkpath.sh: $(BUILDTREE_MAKE)
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
echo "JDK=${JAVA_HOME}"; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: all FORCE
|
.PHONY: all FORCE
|
||||||
|
@ -58,6 +58,6 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
|
|||||||
# Linker mapfile
|
# Linker mapfile
|
||||||
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
|
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
|
||||||
|
|
||||||
VERSION = optimized
|
VERSION = fastdebug
|
||||||
SYSDEFS += -DASSERT
|
SYSDEFS += -DASSERT
|
||||||
PICFLAGS = DEFAULT
|
PICFLAGS = DEFAULT
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
#
|
|
||||||
# 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
|
|
||||||
# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
# or visit www.oracle.com if you need additional information or have any
|
|
||||||
# questions.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# Rules to build gamma launcher, used by vm.make
|
|
||||||
|
|
||||||
|
|
||||||
LAUNCHER_SCRIPT = hotspot
|
|
||||||
LAUNCHER = gamma
|
|
||||||
|
|
||||||
LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher
|
|
||||||
LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
|
|
||||||
LAUNCHERFLAGS := $(ARCHFLAG) \
|
|
||||||
-I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
|
|
||||||
-I$(LAUNCHERDIR_SHARE) \
|
|
||||||
-DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
|
|
||||||
-DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
|
|
||||||
-DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
|
|
||||||
-DARCH=\"$(LIBARCH)\" \
|
|
||||||
-DGAMMA \
|
|
||||||
-DLAUNCHER_TYPE=\"gamma\" \
|
|
||||||
-DLINK_INTO_$(LINK_INTO) \
|
|
||||||
$(TARGET_DEFINES)
|
|
||||||
# Give the launcher task_for_pid() privileges so that it can be used to run JStack, JInfo, et al.
|
|
||||||
LFLAGS_LAUNCHER += -sectcreate __TEXT __info_plist $(GAMMADIR)/src/os/bsd/launcher/Info-privileged.plist
|
|
||||||
|
|
||||||
ifeq ($(LINK_INTO),AOUT)
|
|
||||||
LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
|
|
||||||
LAUNCHER_MAPFILE = mapfile_reorder
|
|
||||||
LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE))
|
|
||||||
LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC)
|
|
||||||
LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS)
|
|
||||||
else
|
|
||||||
LAUNCHER.o = launcher.o
|
|
||||||
LFLAGS_LAUNCHER += -L`pwd`
|
|
||||||
|
|
||||||
# The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a
|
|
||||||
# freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting
|
|
||||||
# the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM
|
|
||||||
# first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is
|
|
||||||
# statically linked with CoreFoundation framework libs. Unfortunately, gamma's
|
|
||||||
# unique searchpath results in some unresolved symbols in the framework
|
|
||||||
# libraries, because JDK libraries are inadvertently discovered first on the
|
|
||||||
# searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*.
|
|
||||||
# So, the actual filename collision is libjpeg.dylib and libJPEG.dylib.
|
|
||||||
# To resolve this, gamma needs to also statically link with the CoreFoundation
|
|
||||||
# framework libraries.
|
|
||||||
|
|
||||||
ifeq ($(OS_VENDOR),Darwin)
|
|
||||||
LFLAGS_LAUNCHER += -framework CoreFoundation
|
|
||||||
endif
|
|
||||||
|
|
||||||
LIBS_LAUNCHER += -l$(JVM) $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK_LAUNCHER = $(LINK.CC)
|
|
||||||
|
|
||||||
LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK)
|
|
||||||
LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK)
|
|
||||||
|
|
||||||
LAUNCHER_OUT = launcher
|
|
||||||
|
|
||||||
SUFFIXES += .d
|
|
||||||
|
|
||||||
SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
|
|
||||||
SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
|
|
||||||
|
|
||||||
OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
|
|
||||||
|
|
||||||
DEPFILES := $(patsubst %.o,%.d,$(OBJS))
|
|
||||||
-include $(DEPFILES)
|
|
||||||
|
|
||||||
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
|
|
||||||
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
|
|
||||||
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
|
|
||||||
|
|
||||||
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
|
|
||||||
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
|
|
||||||
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
|
|
||||||
|
|
||||||
$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
|
|
||||||
$(QUIETLY) echo Linking launcher...
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER)
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
|
|
||||||
# Sign the launcher with the development certificate (if present) so that it can be used
|
|
||||||
# to run JStack, JInfo, et al.
|
|
||||||
$(QUIETLY) -codesign -s openjdk_codesign $@
|
|
||||||
|
|
||||||
$(LAUNCHER): $(LAUNCHER_SCRIPT)
|
|
||||||
|
|
||||||
$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
|
|
||||||
$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
|
|
||||||
$(QUIETLY) chmod +x $@
|
|
||||||
|
|
@ -144,6 +144,9 @@ JVM = jvm
|
|||||||
ifeq ($(OS_VENDOR), Darwin)
|
ifeq ($(OS_VENDOR), Darwin)
|
||||||
LIBJVM = lib$(JVM).dylib
|
LIBJVM = lib$(JVM).dylib
|
||||||
CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
|
CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
|
||||||
|
ifeq (${VERSION}, $(filter ${VERSION}, debug fastdebug))
|
||||||
|
CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
LIBJVM = lib$(JVM).so
|
LIBJVM = lib$(JVM).so
|
||||||
endif
|
endif
|
||||||
@ -328,9 +331,6 @@ install_jvm: $(LIBJVM)
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Other files
|
# Other files
|
||||||
|
|
||||||
# Gamma launcher
|
|
||||||
include $(MAKEFILES_DIR)/launcher.make
|
|
||||||
|
|
||||||
# Signal interposition library
|
# Signal interposition library
|
||||||
include $(MAKEFILES_DIR)/jsig.make
|
include $(MAKEFILES_DIR)/jsig.make
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ EMACS=emacs
|
|||||||
REL_MYDIR=`dirname $0`
|
REL_MYDIR=`dirname $0`
|
||||||
MYDIR=`cd $REL_MYDIR && pwd`
|
MYDIR=`cd $REL_MYDIR && pwd`
|
||||||
|
|
||||||
|
#
|
||||||
# Look whether the user wants to run inside gdb
|
# Look whether the user wants to run inside gdb
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-gdb)
|
-gdb)
|
||||||
@ -95,16 +96,14 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
JDK=
|
if [ "${ALT_JAVA_HOME}" != "" ]; then
|
||||||
if [ "${ALT_JAVA_HOME}" = "" ]; then
|
JDK=${ALT_JAVA_HOME%%/jre}
|
||||||
. ${MYDIR}/jdkpath.sh
|
|
||||||
else
|
else
|
||||||
JDK=${ALT_JAVA_HOME%%/jre};
|
JDK=@@JDK_IMPORT_PATH@@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${JDK}" = "" ]; then
|
if [ "${JDK}" = "" ]; then
|
||||||
echo Failed to find JDK. ALT_JAVA_HOME is not set or ./jdkpath.sh is empty or not found.
|
echo "Failed to find JDK. Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We will set the LD_LIBRARY_PATH as follows:
|
# We will set the LD_LIBRARY_PATH as follows:
|
||||||
@ -142,12 +141,12 @@ else
|
|||||||
export LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
JPARMS="$@ $JAVA_ARGS";
|
JPARMS="-Dsun.java.launcher=gamma -XXaltjvm=$MYDIR $@ $JAVA_ARGS";
|
||||||
|
|
||||||
# Locate the gamma development launcher
|
# Locate the java launcher
|
||||||
LAUNCHER=${MYDIR}/gamma
|
LAUNCHER=$JDK/bin/java
|
||||||
if [ ! -x $LAUNCHER ] ; then
|
if [ ! -x $LAUNCHER ] ; then
|
||||||
echo Error: Cannot find the gamma development launcher \"$LAUNCHER\"
|
echo Error: Cannot find the java launcher \"$LAUNCHER\"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -166,9 +165,10 @@ set args $JPARMS
|
|||||||
file $LAUNCHER
|
file $LAUNCHER
|
||||||
directory $GDBSRCDIR
|
directory $GDBSRCDIR
|
||||||
# Get us to a point where we can set breakpoints in libjvm.so
|
# Get us to a point where we can set breakpoints in libjvm.so
|
||||||
break InitializeJVM
|
set breakpoint pending on
|
||||||
|
break JNI_CreateJavaVM
|
||||||
run
|
run
|
||||||
# Stop in InitializeJVM
|
# Stop in JNI_CreateJavaVM
|
||||||
delete 1
|
delete 1
|
||||||
# We can now set breakpoints wherever we like
|
# We can now set breakpoints wherever we like
|
||||||
EOF
|
EOF
|
||||||
@ -199,7 +199,7 @@ case "$MODE" in
|
|||||||
rm -f $GDBSCR
|
rm -f $GDBSCR
|
||||||
;;
|
;;
|
||||||
dbx)
|
dbx)
|
||||||
$DBX -s $HOME/.dbxrc $LAUNCHER $JPARMS
|
$DBX -s $HOME/.dbxrc -c "loadobject -load libjvm.so; stop in JNI_CreateJavaVM; run $JPARMS; delete all" $LAUNCHER
|
||||||
;;
|
;;
|
||||||
valgrind)
|
valgrind)
|
||||||
echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap
|
echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap
|
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
|
|||||||
|
|
||||||
HS_MAJOR_VER=25
|
HS_MAJOR_VER=25
|
||||||
HS_MINOR_VER=0
|
HS_MINOR_VER=0
|
||||||
HS_BUILD_NUMBER=32
|
HS_BUILD_NUMBER=33
|
||||||
|
|
||||||
JDK_MAJOR_VER=1
|
JDK_MAJOR_VER=1
|
||||||
JDK_MINOR_VER=8
|
JDK_MINOR_VER=8
|
||||||
|
@ -134,14 +134,14 @@ jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}}
|
|||||||
|
|
||||||
jprt.build.targets.standard= \
|
jprt.build.targets.standard= \
|
||||||
${jprt.my.solaris.sparc}-{product|fastdebug}, \
|
${jprt.my.solaris.sparc}-{product|fastdebug}, \
|
||||||
${jprt.my.solaris.sparcv9}-{product|fastdebug}, \
|
${jprt.my.solaris.sparcv9}-{product|fastdebug|optimized}, \
|
||||||
${jprt.my.solaris.i586}-{product|fastdebug}, \
|
${jprt.my.solaris.i586}-{product|fastdebug}, \
|
||||||
${jprt.my.solaris.x64}-{product|fastdebug}, \
|
${jprt.my.solaris.x64}-{product|fastdebug}, \
|
||||||
${jprt.my.linux.i586}-{product|fastdebug}, \
|
${jprt.my.linux.i586}-{product|fastdebug}, \
|
||||||
${jprt.my.linux.x64}-{product|fastdebug}, \
|
${jprt.my.linux.x64}-{product|fastdebug|optimized}, \
|
||||||
${jprt.my.macosx.x64}-{product|fastdebug}, \
|
${jprt.my.macosx.x64}-{product|fastdebug}, \
|
||||||
${jprt.my.windows.i586}-{product|fastdebug}, \
|
${jprt.my.windows.i586}-{product|fastdebug}, \
|
||||||
${jprt.my.windows.x64}-{product|fastdebug}, \
|
${jprt.my.windows.x64}-{product|fastdebug|optimized}, \
|
||||||
${jprt.my.linux.armvh}-{product|fastdebug}
|
${jprt.my.linux.armvh}-{product|fastdebug}
|
||||||
|
|
||||||
jprt.build.targets.open= \
|
jprt.build.targets.open= \
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
# adlc.make -
|
# adlc.make -
|
||||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||||
# sa.make - generate SA jar file and natives
|
# sa.make - generate SA jar file and natives
|
||||||
# env.[ck]sh - environment settings
|
|
||||||
#
|
#
|
||||||
# The makefiles are split this way so that "make foo" will run faster by not
|
# The makefiles are split this way so that "make foo" will run faster by not
|
||||||
# having to read the dependency files for the vm.
|
# having to read the dependency files for the vm.
|
||||||
@ -123,8 +122,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
|
|||||||
# For dependencies and recursive makes.
|
# For dependencies and recursive makes.
|
||||||
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
||||||
|
|
||||||
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
|
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make
|
||||||
env.sh env.csh jdkpath.sh
|
|
||||||
|
|
||||||
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||||
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||||
@ -349,33 +347,6 @@ sa.make: $(BUILDTREE_MAKE)
|
|||||||
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
|
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
|
||||||
) > $@
|
) > $@
|
||||||
|
|
||||||
env.sh: $(BUILDTREE_MAKE)
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
{ echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
|
|
||||||
{ \
|
|
||||||
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
|
||||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
|
||||||
echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
|
|
||||||
echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
env.csh: env.sh
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
|
||||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
jdkpath.sh: $(BUILDTREE_MAKE)
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
echo "JDK=${JAVA_HOME}"; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: all FORCE
|
.PHONY: all FORCE
|
||||||
|
@ -1,93 +0,0 @@
|
|||||||
#
|
|
||||||
# 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
|
|
||||||
# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
# or visit www.oracle.com if you need additional information or have any
|
|
||||||
# questions.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# Rules to build gamma launcher, used by vm.make
|
|
||||||
|
|
||||||
|
|
||||||
LAUNCHER_SCRIPT = hotspot
|
|
||||||
LAUNCHER = gamma
|
|
||||||
|
|
||||||
LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher
|
|
||||||
LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
|
|
||||||
LAUNCHERFLAGS := $(ARCHFLAG) \
|
|
||||||
-I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
|
|
||||||
-I$(LAUNCHERDIR_SHARE) \
|
|
||||||
-DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
|
|
||||||
-DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
|
|
||||||
-DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
|
|
||||||
-DARCH=\"$(LIBARCH)\" \
|
|
||||||
-DGAMMA \
|
|
||||||
-DLAUNCHER_TYPE=\"gamma\" \
|
|
||||||
-DLINK_INTO_$(LINK_INTO) \
|
|
||||||
$(TARGET_DEFINES)
|
|
||||||
|
|
||||||
ifeq ($(LINK_INTO),AOUT)
|
|
||||||
LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
|
|
||||||
LAUNCHER_MAPFILE = mapfile_reorder
|
|
||||||
LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE))
|
|
||||||
LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC)
|
|
||||||
LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS)
|
|
||||||
else
|
|
||||||
LAUNCHER.o = launcher.o
|
|
||||||
LFLAGS_LAUNCHER += -L `pwd`
|
|
||||||
LIBS_LAUNCHER += -l$(JVM) $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK_LAUNCHER = $(LINK.CC)
|
|
||||||
|
|
||||||
LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK)
|
|
||||||
LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK)
|
|
||||||
|
|
||||||
LAUNCHER_OUT = launcher
|
|
||||||
|
|
||||||
SUFFIXES += .d
|
|
||||||
|
|
||||||
SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
|
|
||||||
SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
|
|
||||||
|
|
||||||
OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
|
|
||||||
|
|
||||||
DEPFILES := $(patsubst %.o,%.d,$(OBJS))
|
|
||||||
-include $(DEPFILES)
|
|
||||||
|
|
||||||
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
|
|
||||||
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
|
|
||||||
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
|
|
||||||
|
|
||||||
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
|
|
||||||
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
|
|
||||||
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
|
|
||||||
|
|
||||||
$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
|
|
||||||
$(QUIETLY) echo Linking launcher...
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER)
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
|
|
||||||
|
|
||||||
$(LAUNCHER): $(LAUNCHER_SCRIPT)
|
|
||||||
|
|
||||||
$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
|
|
||||||
$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
|
|
||||||
$(QUIETLY) chmod +x $@
|
|
||||||
|
|
@ -372,9 +372,6 @@ install_jvm: $(LIBJVM)
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Other files
|
# Other files
|
||||||
|
|
||||||
# Gamma launcher
|
|
||||||
include $(MAKEFILES_DIR)/launcher.make
|
|
||||||
|
|
||||||
# Signal interposition library
|
# Signal interposition library
|
||||||
include $(MAKEFILES_DIR)/jsig.make
|
include $(MAKEFILES_DIR)/jsig.make
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
# adlc.make -
|
# adlc.make -
|
||||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||||
# sa.make - generate SA jar file and natives
|
# sa.make - generate SA jar file and natives
|
||||||
# env.[ck]sh - environment settings
|
|
||||||
#
|
#
|
||||||
# The makefiles are split this way so that "make foo" will run faster by not
|
# The makefiles are split this way so that "make foo" will run faster by not
|
||||||
# having to read the dependency files for the vm.
|
# having to read the dependency files for the vm.
|
||||||
@ -116,8 +115,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
|
|||||||
# For dependencies and recursive makes.
|
# For dependencies and recursive makes.
|
||||||
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
||||||
|
|
||||||
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
|
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make
|
||||||
env.sh env.csh jdkpath.sh
|
|
||||||
|
|
||||||
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||||
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||||
@ -339,33 +337,6 @@ sa.make: $(BUILDTREE_MAKE)
|
|||||||
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
|
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
|
||||||
) > $@
|
) > $@
|
||||||
|
|
||||||
env.sh: $(BUILDTREE_MAKE)
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
{ echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
|
|
||||||
{ \
|
|
||||||
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
|
||||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
|
||||||
echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
|
|
||||||
echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
env.csh: env.sh
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
|
||||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
jdkpath.sh: $(BUILDTREE_MAKE)
|
|
||||||
@echo Creating $@ ...
|
|
||||||
$(QUIETLY) ( \
|
|
||||||
$(BUILDTREE_COMMENT); \
|
|
||||||
echo "JDK=${JAVA_HOME}"; \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: all FORCE
|
.PHONY: all FORCE
|
||||||
|
@ -1,108 +0,0 @@
|
|||||||
#
|
|
||||||
# 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
|
|
||||||
# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
# or visit www.oracle.com if you need additional information or have any
|
|
||||||
# questions.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# Rules to build gamma launcher, used by vm.make
|
|
||||||
|
|
||||||
LAUNCHER_SCRIPT = hotspot
|
|
||||||
LAUNCHER = gamma
|
|
||||||
|
|
||||||
LAUNCHERDIR = $(GAMMADIR)/src/os/posix/launcher
|
|
||||||
LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
|
|
||||||
LAUNCHERFLAGS = $(ARCHFLAG) \
|
|
||||||
-I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
|
|
||||||
-I$(LAUNCHERDIR_SHARE) \
|
|
||||||
-DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
|
|
||||||
-DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
|
|
||||||
-DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
|
|
||||||
-DARCH=\"$(LIBARCH)\" \
|
|
||||||
-DGAMMA \
|
|
||||||
-DLAUNCHER_TYPE=\"gamma\" \
|
|
||||||
-DLINK_INTO_$(LINK_INTO) \
|
|
||||||
$(TARGET_DEFINES)
|
|
||||||
|
|
||||||
ifeq ($(LINK_INTO),AOUT)
|
|
||||||
LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
|
|
||||||
LAUNCHER_MAPFILE = mapfile_extended
|
|
||||||
LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE))
|
|
||||||
LIBS_LAUNCHER += $(LIBS)
|
|
||||||
else
|
|
||||||
LAUNCHER.o = launcher.o
|
|
||||||
LFLAGS_LAUNCHER += -L `pwd`
|
|
||||||
LIBS_LAUNCHER += -l$(JVM) $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK_LAUNCHER = $(LINK.CXX)
|
|
||||||
|
|
||||||
LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK)
|
|
||||||
LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK)
|
|
||||||
|
|
||||||
ifeq ("${Platform_compiler}", "sparcWorks")
|
|
||||||
# Enable the following LAUNCHERFLAGS addition if you need to compare the
|
|
||||||
# built ELF objects.
|
|
||||||
#
|
|
||||||
# The -g option makes static data global and the "-W0,-noglobal"
|
|
||||||
# option tells the compiler to not globalize static data using a unique
|
|
||||||
# globalization prefix. Instead force the use of a static globalization
|
|
||||||
# prefix based on the source filepath so the objects from two identical
|
|
||||||
# compilations are the same.
|
|
||||||
#
|
|
||||||
# Note: The blog says to use "-W0,-xglobalstatic", but that doesn't
|
|
||||||
# seem to work. I got "-W0,-noglobal" from Kelly and that works.
|
|
||||||
#LAUNCHERFLAGS += -W0,-noglobal
|
|
||||||
endif # Platform_compiler == sparcWorks
|
|
||||||
|
|
||||||
LAUNCHER_OUT = launcher
|
|
||||||
|
|
||||||
SUFFIXES += .d
|
|
||||||
|
|
||||||
SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
|
|
||||||
SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
|
|
||||||
|
|
||||||
OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
|
|
||||||
|
|
||||||
DEPFILES := $(patsubst %.o,%.d,$(OBJS))
|
|
||||||
-include $(DEPFILES)
|
|
||||||
|
|
||||||
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
|
|
||||||
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
|
|
||||||
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
|
|
||||||
|
|
||||||
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
|
|
||||||
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
|
|
||||||
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
|
|
||||||
|
|
||||||
$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
|
|
||||||
ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
|
|
||||||
$(QUIETLY) echo Linking launcher...
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER)
|
|
||||||
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
|
|
||||||
endif # filter -sbfast -xsbfast
|
|
||||||
|
|
||||||
$(LAUNCHER): $(LAUNCHER_SCRIPT)
|
|
||||||
|
|
||||||
$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
|
|
||||||
$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
|
|
||||||
$(QUIETLY) chmod +x $@
|
|
||||||
|
|
@ -338,9 +338,6 @@ install_jvm: $(LIBJVM)
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Other files
|
# Other files
|
||||||
|
|
||||||
# Gamma launcher
|
|
||||||
include $(MAKEFILES_DIR)/launcher.make
|
|
||||||
|
|
||||||
# Signal interposition library
|
# Signal interposition library
|
||||||
include $(MAKEFILES_DIR)/jsig.make
|
include $(MAKEFILES_DIR)/jsig.make
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ GENERATED=../generated
|
|||||||
BUILD_PCH_FILE=_build_pch_file.obj
|
BUILD_PCH_FILE=_build_pch_file.obj
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
|
default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
|
||||||
|
|
||||||
!include ../local.make
|
!include ../local.make
|
||||||
!include compile.make
|
!include compile.make
|
||||||
@ -71,4 +71,3 @@ $(AOUT): $(Res_Files) $(Obj_Files) vm.def
|
|||||||
|
|
||||||
!include $(WorkSpace)/make/windows/makefiles/shared.make
|
!include $(WorkSpace)/make/windows/makefiles/shared.make
|
||||||
!include $(WorkSpace)/make/windows/makefiles/sa.make
|
!include $(WorkSpace)/make/windows/makefiles/sa.make
|
||||||
!include $(WorkSpace)/make/windows/makefiles/launcher.make
|
|
||||||
|
@ -33,7 +33,7 @@ GENERATED=../generated
|
|||||||
BUILD_PCH_FILE=_build_pch_file.obj
|
BUILD_PCH_FILE=_build_pch_file.obj
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
|
default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
|
||||||
|
|
||||||
!include ../local.make
|
!include ../local.make
|
||||||
!include compile.make
|
!include compile.make
|
||||||
@ -70,4 +70,3 @@ $(AOUT): $(Res_Files) $(Obj_Files) vm.def
|
|||||||
|
|
||||||
!include $(WorkSpace)/make/windows/makefiles/shared.make
|
!include $(WorkSpace)/make/windows/makefiles/shared.make
|
||||||
!include $(WorkSpace)/make/windows/makefiles/sa.make
|
!include $(WorkSpace)/make/windows/makefiles/sa.make
|
||||||
!include $(WorkSpace)/make/windows/makefiles/launcher.make
|
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2010, 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
|
|
||||||
# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
# or visit www.oracle.com if you need additional information or have any
|
|
||||||
# questions.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
LAUNCHER_FLAGS=$(CXX_FLAGS) $(ARCHFLAG) \
|
|
||||||
/D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
|
|
||||||
/D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
|
|
||||||
/D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
|
|
||||||
/D GAMMA \
|
|
||||||
/D LAUNCHER_TYPE=\"gamma\" \
|
|
||||||
/D _CRT_SECURE_NO_WARNINGS \
|
|
||||||
/D _CRT_SECURE_NO_DEPRECATE \
|
|
||||||
/D LINK_INTO_LIBJVM \
|
|
||||||
/I $(WorkSpace)\src\os\windows\launcher \
|
|
||||||
/I $(WorkSpace)\src\share\tools\launcher \
|
|
||||||
/I $(WorkSpace)\src\share\vm\prims \
|
|
||||||
/I $(WorkSpace)\src\share\vm \
|
|
||||||
/I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \
|
|
||||||
/I $(WorkSpace)\src\os\windows\vm
|
|
||||||
|
|
||||||
LD_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console
|
|
||||||
|
|
||||||
!if "$(COMPILER_NAME)" == "VS2005"
|
|
||||||
# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
|
|
||||||
# on the link command line, otherwise we get missing __security_check_cookie
|
|
||||||
# externals at link time. Even with /GS-, you need bufferoverflowU.lib.
|
|
||||||
BUFFEROVERFLOWLIB = bufferoverflowU.lib
|
|
||||||
LD_FLAGS = $(LD_FLAGS) $(BUFFEROVERFLOWLIB)
|
|
||||||
!endif
|
|
||||||
|
|
||||||
!if "$(COMPILER_NAME)" == "VS2010" && "$(BUILDARCH)" == "i486"
|
|
||||||
LD_FLAGS = /SAFESEH $(LD_FLAGS)
|
|
||||||
!endif
|
|
||||||
|
|
||||||
LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher
|
|
||||||
LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher
|
|
||||||
|
|
||||||
OUTDIR = launcher
|
|
||||||
|
|
||||||
{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj:
|
|
||||||
-mkdir $(OUTDIR) 2>NUL >NUL
|
|
||||||
$(CXX) $(LAUNCHER_FLAGS) /c /Fo$@ $<
|
|
||||||
|
|
||||||
{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj:
|
|
||||||
-mkdir $(OUTDIR) 2>NUL >NUL
|
|
||||||
$(CXX) $(LAUNCHER_FLAGS) /c /Fo$@ $<
|
|
||||||
|
|
||||||
$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h
|
|
||||||
|
|
||||||
launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj
|
|
||||||
echo $(JAVA_HOME) > jdkpath.txt
|
|
||||||
$(LD) $(LD_FLAGS) /out:hotspot.exe $**
|
|
@ -32,7 +32,7 @@ GENERATED=../generated
|
|||||||
BUILD_PCH_FILE=_build_pch_file.obj
|
BUILD_PCH_FILE=_build_pch_file.obj
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
|
default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
|
||||||
|
|
||||||
!include ../local.make
|
!include ../local.make
|
||||||
!include compile.make
|
!include compile.make
|
||||||
@ -73,4 +73,3 @@ $(AOUT): $(Res_Files) $(Obj_Files) vm.def
|
|||||||
|
|
||||||
!include $(WorkSpace)/make/windows/makefiles/shared.make
|
!include $(WorkSpace)/make/windows/makefiles/shared.make
|
||||||
!include $(WorkSpace)/make/windows/makefiles/sa.make
|
!include $(WorkSpace)/make/windows/makefiles/sa.make
|
||||||
!include $(WorkSpace)/make/windows/makefiles/launcher.make
|
|
||||||
|
@ -59,7 +59,6 @@ ProjectCreatorIncludesPRIVATE=\
|
|||||||
-relativeSrcInclude src \
|
-relativeSrcInclude src \
|
||||||
-absoluteSrcInclude $(HOTSPOTBUILDSPACE) \
|
-absoluteSrcInclude $(HOTSPOTBUILDSPACE) \
|
||||||
-ignorePath $(HOTSPOTBUILDSPACE) \
|
-ignorePath $(HOTSPOTBUILDSPACE) \
|
||||||
-ignorePath launcher \
|
|
||||||
-ignorePath share\vm\adlc \
|
-ignorePath share\vm\adlc \
|
||||||
-ignorePath share\vm\shark \
|
-ignorePath share\vm\shark \
|
||||||
-ignorePath share\tools \
|
-ignorePath share\tools \
|
||||||
@ -105,7 +104,6 @@ ProjectCreatorIDEOptions=\
|
|||||||
-define ALIGN_STACK_FRAMES \
|
-define ALIGN_STACK_FRAMES \
|
||||||
-define VM_LITTLE_ENDIAN \
|
-define VM_LITTLE_ENDIAN \
|
||||||
-prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LD_VER)" \
|
-prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LD_VER)" \
|
||||||
-postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \
|
|
||||||
-ignoreFile jsig.c \
|
-ignoreFile jsig.c \
|
||||||
-ignoreFile jvmtiEnvRecommended.cpp \
|
-ignoreFile jvmtiEnvRecommended.cpp \
|
||||||
-ignoreFile jvmtiEnvStub.cpp \
|
-ignoreFile jvmtiEnvStub.cpp \
|
||||||
|
@ -65,7 +65,6 @@ JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles
|
|||||||
!endif
|
!endif
|
||||||
|
|
||||||
HS_INTERNAL_NAME=jvm
|
HS_INTERNAL_NAME=jvm
|
||||||
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/launcher.make
|
|
||||||
|
|
||||||
default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
|
default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ define_pd_global(bool, RewriteFrequentPairs, true);
|
|||||||
define_pd_global(bool, UseMembar, false);
|
define_pd_global(bool, UseMembar, false);
|
||||||
|
|
||||||
// GC Ergo Flags
|
// GC Ergo Flags
|
||||||
define_pd_global(intx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
||||||
|
|
||||||
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
|
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
|
||||||
\
|
\
|
||||||
|
@ -77,7 +77,7 @@ define_pd_global(bool, UseMembar, false);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GC Ergo Flags
|
// GC Ergo Flags
|
||||||
define_pd_global(intx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread
|
define_pd_global(uintx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread
|
||||||
|
|
||||||
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
|
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
|
||||||
\
|
\
|
||||||
|
@ -55,7 +55,7 @@ define_pd_global(bool, RewriteFrequentPairs, true);
|
|||||||
define_pd_global(bool, UseMembar, true);
|
define_pd_global(bool, UseMembar, true);
|
||||||
|
|
||||||
// GC Ergo Flags
|
// GC Ergo Flags
|
||||||
define_pd_global(intx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
||||||
|
|
||||||
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct)
|
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct)
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1999, 2013, 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
|
|
||||||
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JAVA_MD_H
|
|
||||||
#define JAVA_MD_H
|
|
||||||
|
|
||||||
#include <limits.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/param.h>
|
|
||||||
#ifndef GAMMA
|
|
||||||
#include "manifest_info.h"
|
|
||||||
#endif
|
|
||||||
#include "jli_util.h"
|
|
||||||
|
|
||||||
#define PATH_SEPARATOR ':'
|
|
||||||
#define FILESEP "/"
|
|
||||||
#define FILE_SEPARATOR '/'
|
|
||||||
#define IS_FILE_SEPARATOR(c) ((c) == '/')
|
|
||||||
#ifndef MAXNAMELEN
|
|
||||||
#define MAXNAMELEN PATH_MAX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef JAVA_ARGS
|
|
||||||
/*
|
|
||||||
* ApplicationHome is prepended to each of these entries; the resulting
|
|
||||||
* strings are concatenated (separated by PATH_SEPARATOR) and used as the
|
|
||||||
* value of -cp option to the launcher.
|
|
||||||
*/
|
|
||||||
#ifndef APP_CLASSPATH
|
|
||||||
#define APP_CLASSPATH { "/lib/tools.jar", "/classes" }
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GETHRTIME
|
|
||||||
/*
|
|
||||||
* Support for doing cheap, accurate interval timing.
|
|
||||||
*/
|
|
||||||
#include <sys/time.h>
|
|
||||||
#define CounterGet() (gethrtime()/1000)
|
|
||||||
#define Counter2Micros(counts) (counts)
|
|
||||||
#else
|
|
||||||
#define CounterGet() (0)
|
|
||||||
#define Counter2Micros(counts) (1)
|
|
||||||
#endif /* HAVE_GETHRTIME */
|
|
||||||
|
|
||||||
#ifdef _LP64
|
|
||||||
#define JLONG_FORMAT "%ld"
|
|
||||||
#else
|
|
||||||
#define JLONG_FORMAT "%lld"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function prototypes.
|
|
||||||
*/
|
|
||||||
#ifndef GAMMA
|
|
||||||
char *LocateJRE(manifest_info *info);
|
|
||||||
void ExecJRE(char *jre, char **argv);
|
|
||||||
#endif
|
|
||||||
int UnsetEnv(char *name);
|
|
||||||
|
|
||||||
#endif
|
|
File diff suppressed because it is too large
Load Diff
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1999, 2013, 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
|
|
||||||
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JAVA_MD_H
|
|
||||||
#define JAVA_MD_H
|
|
||||||
|
|
||||||
#include <jni.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <io.h>
|
|
||||||
#ifndef GAMMA
|
|
||||||
#include "manifest_info.h"
|
|
||||||
#endif
|
|
||||||
#include "jli_util.h"
|
|
||||||
|
|
||||||
#ifdef GAMMA
|
|
||||||
#define stricmp _stricmp
|
|
||||||
#define strnicmp _strnicmp
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#define strdup _strdup
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PATH_SEPARATOR ';'
|
|
||||||
#define FILESEP "\\"
|
|
||||||
#define FILE_SEPARATOR '\\'
|
|
||||||
#define IS_FILE_SEPARATOR(c) ((c) == '\\' || (c) == '/')
|
|
||||||
#define MAXPATHLEN MAX_PATH
|
|
||||||
#define MAXNAMELEN MAX_PATH
|
|
||||||
|
|
||||||
#ifdef JAVA_ARGS
|
|
||||||
/*
|
|
||||||
* ApplicationHome is prepended to each of these entries; the resulting
|
|
||||||
* strings are concatenated (separated by PATH_SEPARATOR) and used as the
|
|
||||||
* value of -cp option to the launcher.
|
|
||||||
*/
|
|
||||||
#ifndef APP_CLASSPATH
|
|
||||||
#define APP_CLASSPATH { "\\lib\\tools.jar", "\\classes" }
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Support for doing cheap, accurate interval timing.
|
|
||||||
*/
|
|
||||||
extern jlong CounterGet(void);
|
|
||||||
extern jlong Counter2Micros(jlong counts);
|
|
||||||
|
|
||||||
#ifdef JAVAW
|
|
||||||
#define main _main
|
|
||||||
extern int _main(int argc, char **argv);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define JLONG_FORMAT "%I64d"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function prototypes.
|
|
||||||
*/
|
|
||||||
#ifndef GAMMA
|
|
||||||
char *LocateJRE(manifest_info *info);
|
|
||||||
void ExecJRE(char *jre, char **argv);
|
|
||||||
#endif
|
|
||||||
int UnsetEnv(char *name);
|
|
||||||
|
|
||||||
#endif
|
|
@ -3307,7 +3307,7 @@ void os::pd_start_thread(Thread* thread) {
|
|||||||
assert(ret != SYS_THREAD_ERROR, "StartThread failed"); // should propagate back
|
assert(ret != SYS_THREAD_ERROR, "StartThread failed"); // should propagate back
|
||||||
}
|
}
|
||||||
|
|
||||||
class HighResolutionInterval {
|
class HighResolutionInterval : public CHeapObj<mtThread> {
|
||||||
// The default timer resolution seems to be 10 milliseconds.
|
// The default timer resolution seems to be 10 milliseconds.
|
||||||
// (Where is this written down?)
|
// (Where is this written down?)
|
||||||
// If someone wants to sleep for only a fraction of the default,
|
// If someone wants to sleep for only a fraction of the default,
|
||||||
|
@ -65,6 +65,7 @@ class BuildConfig {
|
|||||||
String sourceBase = getFieldString(null, "SourceBase");
|
String sourceBase = getFieldString(null, "SourceBase");
|
||||||
String buildSpace = getFieldString(null, "BuildSpace");
|
String buildSpace = getFieldString(null, "BuildSpace");
|
||||||
String outDir = buildBase;
|
String outDir = buildBase;
|
||||||
|
String jdkTargetRoot = getFieldString(null, "JdkTargetRoot");
|
||||||
|
|
||||||
put("Id", flavourBuild);
|
put("Id", flavourBuild);
|
||||||
put("OutputDir", outDir);
|
put("OutputDir", outDir);
|
||||||
@ -72,6 +73,7 @@ class BuildConfig {
|
|||||||
put("BuildBase", buildBase);
|
put("BuildBase", buildBase);
|
||||||
put("BuildSpace", buildSpace);
|
put("BuildSpace", buildSpace);
|
||||||
put("OutputDll", outDir + Util.sep + outDll);
|
put("OutputDll", outDir + Util.sep + outDll);
|
||||||
|
put("JdkTargetRoot", jdkTargetRoot);
|
||||||
|
|
||||||
context = new String [] {flavourBuild, flavour, build, null};
|
context = new String [] {flavourBuild, flavour, build, null};
|
||||||
}
|
}
|
||||||
|
@ -98,11 +98,6 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
|
|||||||
tagV(cfg.getV("LinkerFlags"));
|
tagV(cfg.getV("LinkerFlags"));
|
||||||
endTag();
|
endTag();
|
||||||
|
|
||||||
startTag("PostBuildEvent");
|
|
||||||
tagData("Message", BuildConfig.getFieldString(null, "PostbuildDescription"));
|
|
||||||
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace("\t", "\r\n")));
|
|
||||||
endTag();
|
|
||||||
|
|
||||||
startTag("PreLinkEvent");
|
startTag("PreLinkEvent");
|
||||||
tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription"));
|
tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription"));
|
||||||
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n")));
|
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n")));
|
||||||
@ -141,7 +136,9 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
|
|||||||
|
|
||||||
for (BuildConfig cfg : allConfigs) {
|
for (BuildConfig cfg : allConfigs) {
|
||||||
startTag(cfg, "PropertyGroup");
|
startTag(cfg, "PropertyGroup");
|
||||||
tagData("LocalDebuggerCommand", "$(TargetDir)/hotspot.exe");
|
tagData("LocalDebuggerCommand", cfg.get("JdkTargetRoot") + "\\bin\\java.exe");
|
||||||
|
tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) -Dsun.java.launcher=gamma");
|
||||||
|
tagData("LocalDebuggerEnvironment", "JAVA_HOME=" + cfg.get("JdkTargetRoot"));
|
||||||
endTag();
|
endTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,110 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1999, 2013, 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
|
|
||||||
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _JAVA_H_
|
|
||||||
#define _JAVA_H_
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get system specific defines.
|
|
||||||
*/
|
|
||||||
#include "jni.h"
|
|
||||||
#include "java_md.h"
|
|
||||||
#include "jli_util.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
|
|
||||||
*/
|
|
||||||
typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
|
|
||||||
typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
CreateJavaVM_t CreateJavaVM;
|
|
||||||
GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs;
|
|
||||||
} InvocationFunctions;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Prototypes for launcher functions in the system specific java_md.c.
|
|
||||||
*/
|
|
||||||
|
|
||||||
jboolean
|
|
||||||
LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn);
|
|
||||||
|
|
||||||
void
|
|
||||||
GetXUsagePath(char *buf, jint bufsize);
|
|
||||||
|
|
||||||
jboolean
|
|
||||||
GetApplicationHome(char *buf, jint bufsize);
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetArch();
|
|
||||||
|
|
||||||
void CreateExecutionEnvironment(int *_argc,
|
|
||||||
char ***_argv,
|
|
||||||
char jrepath[],
|
|
||||||
jint so_jrepath,
|
|
||||||
char jvmpath[],
|
|
||||||
jint so_jvmpath,
|
|
||||||
char **original_argv);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Report an error message to stderr or a window as appropriate. The
|
|
||||||
* flag always is set to JNI_TRUE if message is to be reported to both
|
|
||||||
* strerr and windows and set to JNI_FALSE if the message should only
|
|
||||||
* be sent to a window.
|
|
||||||
*/
|
|
||||||
void ReportErrorMessage(char * message, jboolean always);
|
|
||||||
void ReportErrorMessage2(char * format, char * string, jboolean always);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Report an exception which terminates the vm to stderr or a window
|
|
||||||
* as appropriate.
|
|
||||||
*/
|
|
||||||
void ReportExceptionDescription(JNIEnv * env);
|
|
||||||
|
|
||||||
jboolean RemovableMachineDependentOption(char * option);
|
|
||||||
void PrintMachineDependentOptions();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Block current thread and continue execution in new thread
|
|
||||||
*/
|
|
||||||
int ContinueInNewThread(int (JNICALL *continuation)(void *),
|
|
||||||
jlong stack_size, void * args);
|
|
||||||
|
|
||||||
/* sun.java.launcher.* platform properties. */
|
|
||||||
void SetJavaLauncherPlatformProps(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Functions defined in java.c and used in java_md.c.
|
|
||||||
*/
|
|
||||||
jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative);
|
|
||||||
char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
|
|
||||||
void AddOption(char *str, void *info);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make launcher spit debug output.
|
|
||||||
*/
|
|
||||||
extern jboolean _launcher_debug;
|
|
||||||
|
|
||||||
#endif /* _JAVA_H_ */
|
|
@ -1,89 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1999, 2010, 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
|
|
||||||
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "jli_util.h"
|
|
||||||
|
|
||||||
#ifdef GAMMA
|
|
||||||
#ifdef TARGET_OS_FAMILY_windows
|
|
||||||
#define strdup _strdup
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns a pointer to a block of at least 'size' bytes of memory.
|
|
||||||
* Prints error message and exits if the memory could not be allocated.
|
|
||||||
*/
|
|
||||||
void *
|
|
||||||
JLI_MemAlloc(size_t size)
|
|
||||||
{
|
|
||||||
void *p = malloc(size);
|
|
||||||
if (p == 0) {
|
|
||||||
perror("malloc");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Equivalent to realloc(size).
|
|
||||||
* Prints error message and exits if the memory could not be reallocated.
|
|
||||||
*/
|
|
||||||
void *
|
|
||||||
JLI_MemRealloc(void *ptr, size_t size)
|
|
||||||
{
|
|
||||||
void *p = realloc(ptr, size);
|
|
||||||
if (p == 0) {
|
|
||||||
perror("realloc");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Wrapper over strdup(3C) which prints an error message and exits if memory
|
|
||||||
* could not be allocated.
|
|
||||||
*/
|
|
||||||
char *
|
|
||||||
JLI_StringDup(const char *s1)
|
|
||||||
{
|
|
||||||
char *s = strdup(s1);
|
|
||||||
if (s == NULL) {
|
|
||||||
perror("strdup");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Very equivalent to free(ptr).
|
|
||||||
* Here to maintain pairing with the above routines.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
JLI_MemFree(void *ptr)
|
|
||||||
{
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
@ -1,496 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1999, 2010, 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
|
|
||||||
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Class-Path Wildcards
|
|
||||||
*
|
|
||||||
* The syntax for wildcards is a single asterisk. The class path
|
|
||||||
* foo/"*", e.g., loads all jar files in the directory named foo.
|
|
||||||
* (This requires careful quotation when used in shell scripts.)
|
|
||||||
*
|
|
||||||
* Only files whose names end in .jar or .JAR are matched.
|
|
||||||
* Files whose names end in .zip, or which have a particular
|
|
||||||
* magic number, regardless of filename extension, are not
|
|
||||||
* matched.
|
|
||||||
*
|
|
||||||
* Files are considered regardless of whether or not they are
|
|
||||||
* "hidden" in the UNIX sense, i.e., have names beginning with '.'.
|
|
||||||
*
|
|
||||||
* A wildcard only matches jar files, not class files in the same
|
|
||||||
* directory. If you want to load both class files and jar files from
|
|
||||||
* a single directory foo then you can say foo:foo/"*", or foo/"*":foo
|
|
||||||
* if you want the jar files to take precedence.
|
|
||||||
*
|
|
||||||
* Subdirectories are not searched recursively, i.e., foo/"*" only
|
|
||||||
* looks for jar files in foo, not in foo/bar, foo/baz, etc.
|
|
||||||
*
|
|
||||||
* Expansion of wildcards is done early, prior to the invocation of a
|
|
||||||
* program's main method, rather than late, during the class-loading
|
|
||||||
* process itself. Each element of the input class path containing a
|
|
||||||
* wildcard is replaced by the (possibly empty) sequence of elements
|
|
||||||
* generated by enumerating the jar files in the named directory. If
|
|
||||||
* the directory foo contains a.jar, b.jar, and c.jar,
|
|
||||||
* e.g., then the class path foo/"*" is expanded into
|
|
||||||
* foo/a.jar:foo/b.jar:foo/c.jar, and that string would be the value
|
|
||||||
* of the system property java.class.path.
|
|
||||||
*
|
|
||||||
* The order in which the jar files in a directory are enumerated in
|
|
||||||
* the expanded class path is not specified and may vary from platform
|
|
||||||
* to platform and even from moment to moment on the same machine. A
|
|
||||||
* well-constructed application should not depend upon any particular
|
|
||||||
* order. If a specific order is required then the jar files can be
|
|
||||||
* enumerated explicitly in the class path.
|
|
||||||
*
|
|
||||||
* The CLASSPATH environment variable is not treated any differently
|
|
||||||
* from the -classpath (equiv. -cp) command-line option,
|
|
||||||
* i.e. wildcards are honored in all these cases.
|
|
||||||
*
|
|
||||||
* Class-path wildcards are not honored in the Class-Path jar-manifest
|
|
||||||
* header.
|
|
||||||
*
|
|
||||||
* Class-path wildcards are honored not only by the Java launcher but
|
|
||||||
* also by most other command-line tools that accept class paths, and
|
|
||||||
* in particular by javac and javadoc.
|
|
||||||
*
|
|
||||||
* Class-path wildcards are not honored in any other kind of path, and
|
|
||||||
* especially not in the bootstrap class path, which is a mere
|
|
||||||
* artifact of our implementation and not something that developers
|
|
||||||
* should use.
|
|
||||||
*
|
|
||||||
* Classpath wildcards are only expanded in the Java launcher code,
|
|
||||||
* supporting the use of wildcards on the command line and in the
|
|
||||||
* CLASSPATH environment variable. We do not support the use of
|
|
||||||
* wildcards by applications that embed the JVM.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include "java.h" /* Strictly for PATH_SEPARATOR/FILE_SEPARATOR */
|
|
||||||
#include "jli_util.h"
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <windows.h>
|
|
||||||
#else /* Unix */
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#endif /* Unix */
|
|
||||||
|
|
||||||
static int
|
|
||||||
exists(const char* filename)
|
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
|
||||||
return _access(filename, 0) == 0;
|
|
||||||
#else
|
|
||||||
return access(filename, F_OK) == 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#define NEW_(TYPE) ((TYPE) JLI_MemAlloc(sizeof(struct TYPE##_)))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Wildcard directory iteration.
|
|
||||||
* WildcardIterator_for(wildcard) returns an iterator.
|
|
||||||
* Each call to that iterator's next() method returns the basename
|
|
||||||
* of an entry in the wildcard's directory. The basename's memory
|
|
||||||
* belongs to the iterator. The caller is responsible for prepending
|
|
||||||
* the directory name and file separator, if necessary.
|
|
||||||
* When done with the iterator, call the close method to clean up.
|
|
||||||
*/
|
|
||||||
typedef struct WildcardIterator_* WildcardIterator;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
struct WildcardIterator_
|
|
||||||
{
|
|
||||||
HANDLE handle;
|
|
||||||
char *firstFile; /* Stupid FindFirstFile...FindNextFile */
|
|
||||||
};
|
|
||||||
|
|
||||||
static WildcardIterator
|
|
||||||
WildcardIterator_for(const char *wildcard)
|
|
||||||
{
|
|
||||||
WIN32_FIND_DATA find_data;
|
|
||||||
WildcardIterator it = NEW_(WildcardIterator);
|
|
||||||
HANDLE handle = FindFirstFile(wildcard, &find_data);
|
|
||||||
if (handle == INVALID_HANDLE_VALUE)
|
|
||||||
return NULL;
|
|
||||||
it->handle = handle;
|
|
||||||
it->firstFile = find_data.cFileName;
|
|
||||||
return it;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
|
||||||
WildcardIterator_next(WildcardIterator it)
|
|
||||||
{
|
|
||||||
WIN32_FIND_DATA find_data;
|
|
||||||
if (it->firstFile != NULL) {
|
|
||||||
char *firstFile = it->firstFile;
|
|
||||||
it->firstFile = NULL;
|
|
||||||
return firstFile;
|
|
||||||
}
|
|
||||||
return FindNextFile(it->handle, &find_data)
|
|
||||||
? find_data.cFileName : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WildcardIterator_close(WildcardIterator it)
|
|
||||||
{
|
|
||||||
if (it) {
|
|
||||||
FindClose(it->handle);
|
|
||||||
JLI_MemFree(it->firstFile);
|
|
||||||
JLI_MemFree(it);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* Unix */
|
|
||||||
struct WildcardIterator_
|
|
||||||
{
|
|
||||||
DIR *dir;
|
|
||||||
};
|
|
||||||
|
|
||||||
static WildcardIterator
|
|
||||||
WildcardIterator_for(const char *wildcard)
|
|
||||||
{
|
|
||||||
DIR *dir;
|
|
||||||
int wildlen = strlen(wildcard);
|
|
||||||
if (wildlen < 2) {
|
|
||||||
dir = opendir(".");
|
|
||||||
} else {
|
|
||||||
char *dirname = JLI_StringDup(wildcard);
|
|
||||||
dirname[wildlen - 1] = '\0';
|
|
||||||
dir = opendir(dirname);
|
|
||||||
JLI_MemFree(dirname);
|
|
||||||
}
|
|
||||||
if (dir == NULL)
|
|
||||||
return NULL;
|
|
||||||
else {
|
|
||||||
WildcardIterator it = NEW_(WildcardIterator);
|
|
||||||
it->dir = dir;
|
|
||||||
return it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
|
||||||
WildcardIterator_next(WildcardIterator it)
|
|
||||||
{
|
|
||||||
struct dirent* dirp = readdir(it->dir);
|
|
||||||
return dirp ? dirp->d_name : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WildcardIterator_close(WildcardIterator it)
|
|
||||||
{
|
|
||||||
if (it) {
|
|
||||||
closedir(it->dir);
|
|
||||||
JLI_MemFree(it);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* Unix */
|
|
||||||
|
|
||||||
static int
|
|
||||||
equal(const char *s1, const char *s2)
|
|
||||||
{
|
|
||||||
return strcmp(s1, s2) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FileList ADT - a dynamic list of C filenames
|
|
||||||
*/
|
|
||||||
struct FileList_
|
|
||||||
{
|
|
||||||
char **files;
|
|
||||||
int size;
|
|
||||||
int capacity;
|
|
||||||
};
|
|
||||||
typedef struct FileList_ *FileList;
|
|
||||||
|
|
||||||
static FileList
|
|
||||||
FileList_new(int capacity)
|
|
||||||
{
|
|
||||||
FileList fl = NEW_(FileList);
|
|
||||||
fl->capacity = capacity;
|
|
||||||
fl->files = (char **) JLI_MemAlloc(capacity * sizeof(fl->files[0]));
|
|
||||||
fl->size = 0;
|
|
||||||
return fl;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_WILDCARD
|
|
||||||
static void
|
|
||||||
FileList_print(FileList fl)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
putchar('[');
|
|
||||||
for (i = 0; i < fl->size; i++) {
|
|
||||||
if (i > 0) printf(", ");
|
|
||||||
printf("\"%s\"",fl->files[i]);
|
|
||||||
}
|
|
||||||
putchar(']');
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
|
||||||
FileList_free(FileList fl)
|
|
||||||
{
|
|
||||||
if (fl) {
|
|
||||||
if (fl->files) {
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < fl->size; i++)
|
|
||||||
JLI_MemFree(fl->files[i]);
|
|
||||||
JLI_MemFree(fl->files);
|
|
||||||
}
|
|
||||||
JLI_MemFree(fl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
FileList_ensureCapacity(FileList fl, int capacity)
|
|
||||||
{
|
|
||||||
if (fl->capacity < capacity) {
|
|
||||||
while (fl->capacity < capacity)
|
|
||||||
fl->capacity *= 2;
|
|
||||||
fl->files = JLI_MemRealloc(fl->files,
|
|
||||||
fl->capacity * sizeof(fl->files[0]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
FileList_add(FileList fl, char *file)
|
|
||||||
{
|
|
||||||
FileList_ensureCapacity(fl, fl->size+1);
|
|
||||||
fl->files[fl->size++] = file;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
FileList_addSubstring(FileList fl, const char *beg, int len)
|
|
||||||
{
|
|
||||||
char *filename = (char *) JLI_MemAlloc(len+1);
|
|
||||||
memcpy(filename, beg, len);
|
|
||||||
filename[len] = '\0';
|
|
||||||
FileList_ensureCapacity(fl, fl->size+1);
|
|
||||||
fl->files[fl->size++] = filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
|
||||||
FileList_join(FileList fl, char sep)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int size;
|
|
||||||
char *path;
|
|
||||||
char *p;
|
|
||||||
for (i = 0, size = 1; i < fl->size; i++)
|
|
||||||
size += strlen(fl->files[i]) + 1;
|
|
||||||
|
|
||||||
path = JLI_MemAlloc(size);
|
|
||||||
|
|
||||||
for (i = 0, p = path; i < fl->size; i++) {
|
|
||||||
int len = strlen(fl->files[i]);
|
|
||||||
if (i > 0) *p++ = sep;
|
|
||||||
memcpy(p, fl->files[i], len);
|
|
||||||
p += len;
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
static FileList
|
|
||||||
FileList_split(const char *path, char sep)
|
|
||||||
{
|
|
||||||
const char *p, *q;
|
|
||||||
int len = strlen(path);
|
|
||||||
int count;
|
|
||||||
FileList fl;
|
|
||||||
for (count = 1, p = path; p < path + len; p++)
|
|
||||||
count += (*p == sep);
|
|
||||||
fl = FileList_new(count);
|
|
||||||
for (p = path;;) {
|
|
||||||
for (q = p; q <= path + len; q++) {
|
|
||||||
if (*q == sep || *q == '\0') {
|
|
||||||
FileList_addSubstring(fl, p, q - p);
|
|
||||||
if (*q == '\0')
|
|
||||||
return fl;
|
|
||||||
p = q + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
isJarFileName(const char *filename)
|
|
||||||
{
|
|
||||||
int len = strlen(filename);
|
|
||||||
return (len >= 4) &&
|
|
||||||
(filename[len - 4] == '.') &&
|
|
||||||
(equal(filename + len - 3, "jar") ||
|
|
||||||
equal(filename + len - 3, "JAR")) &&
|
|
||||||
/* Paranoia: Maybe filename is "DIR:foo.jar" */
|
|
||||||
(strchr(filename, PATH_SEPARATOR) == NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
|
||||||
wildcardConcat(const char *wildcard, const char *basename)
|
|
||||||
{
|
|
||||||
int wildlen = strlen(wildcard);
|
|
||||||
int baselen = strlen(basename);
|
|
||||||
char *filename = (char *) JLI_MemAlloc(wildlen + baselen);
|
|
||||||
/* Replace the trailing '*' with basename */
|
|
||||||
memcpy(filename, wildcard, wildlen-1);
|
|
||||||
memcpy(filename+wildlen-1, basename, baselen+1);
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
static FileList
|
|
||||||
wildcardFileList(const char *wildcard)
|
|
||||||
{
|
|
||||||
const char *basename;
|
|
||||||
FileList fl = FileList_new(16);
|
|
||||||
WildcardIterator it = WildcardIterator_for(wildcard);
|
|
||||||
if (it == NULL) {
|
|
||||||
FileList_free(fl);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
while ((basename = WildcardIterator_next(it)) != NULL)
|
|
||||||
if (isJarFileName(basename))
|
|
||||||
FileList_add(fl, wildcardConcat(wildcard, basename));
|
|
||||||
WildcardIterator_close(it);
|
|
||||||
return fl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
isWildcard(const char *filename)
|
|
||||||
{
|
|
||||||
int len = strlen(filename);
|
|
||||||
return (len > 0) &&
|
|
||||||
(filename[len - 1] == '*') &&
|
|
||||||
(len == 1 || IS_FILE_SEPARATOR(filename[len - 2])) &&
|
|
||||||
(! exists(filename));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
FileList_expandWildcards(FileList fl)
|
|
||||||
{
|
|
||||||
int i, j;
|
|
||||||
for (i = 0; i < fl->size; i++) {
|
|
||||||
if (isWildcard(fl->files[i])) {
|
|
||||||
FileList expanded = wildcardFileList(fl->files[i]);
|
|
||||||
if (expanded != NULL && expanded->size > 0) {
|
|
||||||
JLI_MemFree(fl->files[i]);
|
|
||||||
FileList_ensureCapacity(fl, fl->size + expanded->size);
|
|
||||||
for (j = fl->size - 1; j >= i+1; j--)
|
|
||||||
fl->files[j+expanded->size-1] = fl->files[j];
|
|
||||||
for (j = 0; j < expanded->size; j++)
|
|
||||||
fl->files[i+j] = expanded->files[j];
|
|
||||||
i += expanded->size - 1;
|
|
||||||
fl->size += expanded->size - 1;
|
|
||||||
/* fl expropriates expanded's elements. */
|
|
||||||
expanded->size = 0;
|
|
||||||
}
|
|
||||||
FileList_free(expanded);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
|
||||||
JLI_WildcardExpandClasspath(const char *classpath)
|
|
||||||
{
|
|
||||||
char *expanded;
|
|
||||||
FileList fl;
|
|
||||||
|
|
||||||
if (strchr(classpath, '*') == NULL)
|
|
||||||
return classpath;
|
|
||||||
fl = FileList_split(classpath, PATH_SEPARATOR);
|
|
||||||
FileList_expandWildcards(fl);
|
|
||||||
expanded = FileList_join(fl, PATH_SEPARATOR);
|
|
||||||
FileList_free(fl);
|
|
||||||
if (getenv("_JAVA_LAUNCHER_DEBUG") != 0)
|
|
||||||
printf("Expanded wildcards:\n"
|
|
||||||
" before: \"%s\"\n"
|
|
||||||
" after : \"%s\"\n",
|
|
||||||
classpath, expanded);
|
|
||||||
return expanded;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_WILDCARD
|
|
||||||
static void
|
|
||||||
wildcardExpandArgv(const char ***argv)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i = 0; (*argv)[i]; i++) {
|
|
||||||
if (equal((*argv)[i], "-cp") ||
|
|
||||||
equal((*argv)[i], "-classpath")) {
|
|
||||||
i++;
|
|
||||||
(*argv)[i] = wildcardExpandClasspath((*argv)[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
debugPrintArgv(char *argv[])
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
putchar('[');
|
|
||||||
for (i = 0; argv[i]; i++) {
|
|
||||||
if (i > 0) printf(", ");
|
|
||||||
printf("\"%s\"", argv[i]);
|
|
||||||
}
|
|
||||||
printf("]\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
argv[0] = "java";
|
|
||||||
wildcardExpandArgv((const char***)&argv);
|
|
||||||
debugPrintArgv(argv);
|
|
||||||
/* execvp("java", argv); */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* DEBUG_WILDCARD */
|
|
||||||
|
|
||||||
/* Cute little perl prototype implementation....
|
|
||||||
|
|
||||||
my $sep = ($^O =~ /^(Windows|cygwin)/) ? ";" : ":";
|
|
||||||
|
|
||||||
sub expand($) {
|
|
||||||
opendir DIR, $_[0] or return $_[0];
|
|
||||||
join $sep, map {"$_[0]/$_"} grep {/\.(jar|JAR)$/} readdir DIR;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub munge($) {
|
|
||||||
join $sep,
|
|
||||||
map {(! -r $_ and s/[\/\\]+\*$//) ? expand $_ : $_} split $sep, $_[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (my $i = 0; $i < @ARGV - 1; $i++) {
|
|
||||||
$ARGV[$i+1] = munge $ARGV[$i+1] if $ARGV[$i] =~ /^-c(p|lasspath)$/;
|
|
||||||
}
|
|
||||||
|
|
||||||
$ENV{CLASSPATH} = munge $ENV{CLASSPATH} if exists $ENV{CLASSPATH};
|
|
||||||
@ARGV = ("java", @ARGV);
|
|
||||||
print "@ARGV\n";
|
|
||||||
exec @ARGV;
|
|
||||||
|
|
||||||
*/
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -1261,7 +1261,7 @@ JRT_LEAF(int, Runtime1::arraycopy(oopDesc* src, int src_pos, oopDesc* dst, int d
|
|||||||
|
|
||||||
if (length == 0) return ac_ok;
|
if (length == 0) return ac_ok;
|
||||||
if (src->is_typeArray()) {
|
if (src->is_typeArray()) {
|
||||||
Klass* const klass_oop = src->klass();
|
Klass* klass_oop = src->klass();
|
||||||
if (klass_oop != dst->klass()) return ac_failed;
|
if (klass_oop != dst->klass()) return ac_failed;
|
||||||
TypeArrayKlass* klass = TypeArrayKlass::cast(klass_oop);
|
TypeArrayKlass* klass = TypeArrayKlass::cast(klass_oop);
|
||||||
const int l2es = klass->log2_element_size();
|
const int l2es = klass->log2_element_size();
|
||||||
|
@ -211,12 +211,41 @@ bool ciInstanceKlass::is_java_lang_Object() const {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// ciInstanceKlass::uses_default_loader
|
// ciInstanceKlass::uses_default_loader
|
||||||
bool ciInstanceKlass::uses_default_loader() {
|
bool ciInstanceKlass::uses_default_loader() const {
|
||||||
// Note: We do not need to resolve the handle or enter the VM
|
// Note: We do not need to resolve the handle or enter the VM
|
||||||
// in order to test null-ness.
|
// in order to test null-ness.
|
||||||
return _loader == NULL;
|
return _loader == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return basic type of boxed value for box klass or T_OBJECT if not.
|
||||||
|
*/
|
||||||
|
BasicType ciInstanceKlass::box_klass_type() const {
|
||||||
|
if (uses_default_loader() && is_loaded()) {
|
||||||
|
return SystemDictionary::box_klass_type(get_Klass());
|
||||||
|
} else {
|
||||||
|
return T_OBJECT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this boxing klass?
|
||||||
|
*/
|
||||||
|
bool ciInstanceKlass::is_box_klass() const {
|
||||||
|
return is_java_primitive(box_klass_type());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this boxed value offset?
|
||||||
|
*/
|
||||||
|
bool ciInstanceKlass::is_boxed_value_offset(int offset) const {
|
||||||
|
BasicType bt = box_klass_type();
|
||||||
|
return is_java_primitive(bt) &&
|
||||||
|
(offset == java_lang_boxing_object::value_offset_in_bytes(bt));
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// ciInstanceKlass::is_in_package
|
// ciInstanceKlass::is_in_package
|
||||||
//
|
//
|
||||||
|
@ -217,10 +217,14 @@ public:
|
|||||||
ciInstanceKlass* implementor();
|
ciInstanceKlass* implementor();
|
||||||
|
|
||||||
// Is the defining class loader of this class the default loader?
|
// Is the defining class loader of this class the default loader?
|
||||||
bool uses_default_loader();
|
bool uses_default_loader() const;
|
||||||
|
|
||||||
bool is_java_lang_Object() const;
|
bool is_java_lang_Object() const;
|
||||||
|
|
||||||
|
BasicType box_klass_type() const;
|
||||||
|
bool is_box_klass() const;
|
||||||
|
bool is_boxed_value_offset(int offset) const;
|
||||||
|
|
||||||
// Is this klass in the given package?
|
// Is this klass in the given package?
|
||||||
bool is_in_package(const char* packagename) {
|
bool is_in_package(const char* packagename) {
|
||||||
return is_in_package(packagename, (int) strlen(packagename));
|
return is_in_package(packagename, (int) strlen(packagename));
|
||||||
|
@ -1179,6 +1179,44 @@ bool ciMethod::has_jsrs () const { FETCH_FLAG_FROM_VM(has_jsrs);
|
|||||||
bool ciMethod::is_accessor () const { FETCH_FLAG_FROM_VM(is_accessor); }
|
bool ciMethod::is_accessor () const { FETCH_FLAG_FROM_VM(is_accessor); }
|
||||||
bool ciMethod::is_initializer () const { FETCH_FLAG_FROM_VM(is_initializer); }
|
bool ciMethod::is_initializer () const { FETCH_FLAG_FROM_VM(is_initializer); }
|
||||||
|
|
||||||
|
bool ciMethod::is_boxing_method() const {
|
||||||
|
if (holder()->is_box_klass()) {
|
||||||
|
switch (intrinsic_id()) {
|
||||||
|
case vmIntrinsics::_Boolean_valueOf:
|
||||||
|
case vmIntrinsics::_Byte_valueOf:
|
||||||
|
case vmIntrinsics::_Character_valueOf:
|
||||||
|
case vmIntrinsics::_Short_valueOf:
|
||||||
|
case vmIntrinsics::_Integer_valueOf:
|
||||||
|
case vmIntrinsics::_Long_valueOf:
|
||||||
|
case vmIntrinsics::_Float_valueOf:
|
||||||
|
case vmIntrinsics::_Double_valueOf:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ciMethod::is_unboxing_method() const {
|
||||||
|
if (holder()->is_box_klass()) {
|
||||||
|
switch (intrinsic_id()) {
|
||||||
|
case vmIntrinsics::_booleanValue:
|
||||||
|
case vmIntrinsics::_byteValue:
|
||||||
|
case vmIntrinsics::_charValue:
|
||||||
|
case vmIntrinsics::_shortValue:
|
||||||
|
case vmIntrinsics::_intValue:
|
||||||
|
case vmIntrinsics::_longValue:
|
||||||
|
case vmIntrinsics::_floatValue:
|
||||||
|
case vmIntrinsics::_doubleValue:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
BCEscapeAnalyzer *ciMethod::get_bcea() {
|
BCEscapeAnalyzer *ciMethod::get_bcea() {
|
||||||
#ifdef COMPILER2
|
#ifdef COMPILER2
|
||||||
if (_bcea == NULL) {
|
if (_bcea == NULL) {
|
||||||
|
@ -298,6 +298,8 @@ class ciMethod : public ciMetadata {
|
|||||||
bool is_initializer () const;
|
bool is_initializer () const;
|
||||||
bool can_be_statically_bound() const { return _can_be_statically_bound; }
|
bool can_be_statically_bound() const { return _can_be_statically_bound; }
|
||||||
void dump_replay_data(outputStream* st);
|
void dump_replay_data(outputStream* st);
|
||||||
|
bool is_boxing_method() const;
|
||||||
|
bool is_unboxing_method() const;
|
||||||
|
|
||||||
// Print the bytecodes of this method.
|
// Print the bytecodes of this method.
|
||||||
void print_codes_on(outputStream* st);
|
void print_codes_on(outputStream* st);
|
||||||
|
@ -492,7 +492,9 @@ class CompileReplay : public StackObj {
|
|||||||
}
|
}
|
||||||
Klass* k = parse_klass(CHECK);
|
Klass* k = parse_klass(CHECK);
|
||||||
rec->oops_offsets[i] = offset;
|
rec->oops_offsets[i] = offset;
|
||||||
rec->oops_handles[i] = (jobject)(new KlassHandle(THREAD, k));
|
KlassHandle *kh = NEW_C_HEAP_OBJ(KlassHandle, mtCompiler);
|
||||||
|
::new ((void*)kh) KlassHandle(THREAD, k);
|
||||||
|
rec->oops_handles[i] = (jobject)kh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -242,8 +242,8 @@ static const juint MURMUR3_32_X86_CHECK_VALUE = 0xB0F57EE3;
|
|||||||
void AltHashing::testMurmur3_32_ByteArray() {
|
void AltHashing::testMurmur3_32_ByteArray() {
|
||||||
// printf("testMurmur3_32_ByteArray\n");
|
// printf("testMurmur3_32_ByteArray\n");
|
||||||
|
|
||||||
jbyte* vector = new jbyte[256];
|
jbyte vector[256];
|
||||||
jbyte* hashes = new jbyte[4 * 256];
|
jbyte hashes[4 * 256];
|
||||||
|
|
||||||
for (int i = 0; i < 256; i++) {
|
for (int i = 0; i < 256; i++) {
|
||||||
vector[i] = (jbyte) i;
|
vector[i] = (jbyte) i;
|
||||||
|
@ -3028,7 +3028,7 @@ AnnotationArray* ClassFileParser::assemble_annotations(u1* runtime_visible_annot
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifdef ASSERT
|
||||||
static void parseAndPrintGenericSignatures(
|
static void parseAndPrintGenericSignatures(
|
||||||
instanceKlassHandle this_klass, TRAPS) {
|
instanceKlassHandle this_klass, TRAPS) {
|
||||||
assert(ParseAllGenericSignatures == true, "Shouldn't call otherwise");
|
assert(ParseAllGenericSignatures == true, "Shouldn't call otherwise");
|
||||||
@ -3053,7 +3053,7 @@ static void parseAndPrintGenericSignatures(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ndef PRODUCT
|
#endif // def ASSERT
|
||||||
|
|
||||||
|
|
||||||
instanceKlassHandle ClassFileParser::parse_super_class(int super_class_index,
|
instanceKlassHandle ClassFileParser::parse_super_class(int super_class_index,
|
||||||
@ -3114,9 +3114,6 @@ void ClassFileParser::layout_fields(Handle class_loader,
|
|||||||
|
|
||||||
// Field size and offset computation
|
// Field size and offset computation
|
||||||
int nonstatic_field_size = _super_klass() == NULL ? 0 : _super_klass()->nonstatic_field_size();
|
int nonstatic_field_size = _super_klass() == NULL ? 0 : _super_klass()->nonstatic_field_size();
|
||||||
#ifndef PRODUCT
|
|
||||||
int orig_nonstatic_field_size = 0;
|
|
||||||
#endif
|
|
||||||
int next_static_oop_offset;
|
int next_static_oop_offset;
|
||||||
int next_static_double_offset;
|
int next_static_double_offset;
|
||||||
int next_static_word_offset;
|
int next_static_word_offset;
|
||||||
@ -3201,25 +3198,6 @@ void ClassFileParser::layout_fields(Handle class_loader,
|
|||||||
|
|
||||||
first_nonstatic_oop_offset = 0; // will be set for first oop field
|
first_nonstatic_oop_offset = 0; // will be set for first oop field
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
if( PrintCompactFieldsSavings ) {
|
|
||||||
next_nonstatic_double_offset = next_nonstatic_field_offset +
|
|
||||||
(nonstatic_oop_count * heapOopSize);
|
|
||||||
if ( nonstatic_double_count > 0 ) {
|
|
||||||
next_nonstatic_double_offset = align_size_up(next_nonstatic_double_offset, BytesPerLong);
|
|
||||||
}
|
|
||||||
next_nonstatic_word_offset = next_nonstatic_double_offset +
|
|
||||||
(nonstatic_double_count * BytesPerLong);
|
|
||||||
next_nonstatic_short_offset = next_nonstatic_word_offset +
|
|
||||||
(nonstatic_word_count * BytesPerInt);
|
|
||||||
next_nonstatic_byte_offset = next_nonstatic_short_offset +
|
|
||||||
(nonstatic_short_count * BytesPerShort);
|
|
||||||
next_nonstatic_type_offset = align_size_up((next_nonstatic_byte_offset +
|
|
||||||
nonstatic_byte_count ), heapOopSize );
|
|
||||||
orig_nonstatic_field_size = nonstatic_field_size +
|
|
||||||
((next_nonstatic_type_offset - first_nonstatic_field_offset)/heapOopSize);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
bool compact_fields = CompactFields;
|
bool compact_fields = CompactFields;
|
||||||
int allocation_style = FieldsAllocationStyle;
|
int allocation_style = FieldsAllocationStyle;
|
||||||
if( allocation_style < 0 || allocation_style > 2 ) { // Out of range?
|
if( allocation_style < 0 || allocation_style > 2 ) { // Out of range?
|
||||||
@ -3593,21 +3571,6 @@ void ClassFileParser::layout_fields(Handle class_loader,
|
|||||||
first_nonstatic_oop_offset);
|
first_nonstatic_oop_offset);
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if( PrintCompactFieldsSavings ) {
|
|
||||||
ResourceMark rm;
|
|
||||||
if( nonstatic_field_size < orig_nonstatic_field_size ) {
|
|
||||||
tty->print("[Saved %d of %d bytes in %s]\n",
|
|
||||||
(orig_nonstatic_field_size - nonstatic_field_size)*heapOopSize,
|
|
||||||
orig_nonstatic_field_size*heapOopSize,
|
|
||||||
_class_name);
|
|
||||||
} else if( nonstatic_field_size > orig_nonstatic_field_size ) {
|
|
||||||
tty->print("[Wasted %d over %d bytes in %s]\n",
|
|
||||||
(nonstatic_field_size - orig_nonstatic_field_size)*heapOopSize,
|
|
||||||
orig_nonstatic_field_size*heapOopSize,
|
|
||||||
_class_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PrintFieldLayout) {
|
if (PrintFieldLayout) {
|
||||||
print_field_layout(_class_name,
|
print_field_layout(_class_name,
|
||||||
_fields,
|
_fields,
|
||||||
|
@ -253,22 +253,6 @@ void Dictionary::classes_do(void f(Klass*, TRAPS), TRAPS) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// All classes, and their class loaders
|
|
||||||
// (added for helpers that use HandleMarks and ResourceMarks)
|
|
||||||
// Don't iterate over placeholders
|
|
||||||
void Dictionary::classes_do(void f(Klass*, ClassLoaderData*, TRAPS), TRAPS) {
|
|
||||||
for (int index = 0; index < table_size(); index++) {
|
|
||||||
for (DictionaryEntry* probe = bucket(index);
|
|
||||||
probe != NULL;
|
|
||||||
probe = probe->next()) {
|
|
||||||
Klass* k = probe->klass();
|
|
||||||
f(k, probe->loader_data(), CHECK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// All classes, and their class loaders
|
// All classes, and their class loaders
|
||||||
// Don't iterate over placeholders
|
// Don't iterate over placeholders
|
||||||
void Dictionary::classes_do(void f(Klass*, ClassLoaderData*)) {
|
void Dictionary::classes_do(void f(Klass*, ClassLoaderData*)) {
|
||||||
|
@ -90,7 +90,6 @@ public:
|
|||||||
void classes_do(void f(Klass*));
|
void classes_do(void f(Klass*));
|
||||||
void classes_do(void f(Klass*, TRAPS), TRAPS);
|
void classes_do(void f(Klass*, TRAPS), TRAPS);
|
||||||
void classes_do(void f(Klass*, ClassLoaderData*));
|
void classes_do(void f(Klass*, ClassLoaderData*));
|
||||||
void classes_do(void f(Klass*, ClassLoaderData*, TRAPS), TRAPS);
|
|
||||||
|
|
||||||
void methods_do(void f(Method*));
|
void methods_do(void f(Method*));
|
||||||
|
|
||||||
|
@ -1747,13 +1747,6 @@ void SystemDictionary::classes_do(void f(Klass*, ClassLoaderData*)) {
|
|||||||
dictionary()->classes_do(f);
|
dictionary()->classes_do(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// All classes, and their class loaders
|
|
||||||
// (added for helpers that use HandleMarks and ResourceMarks)
|
|
||||||
// Don't iterate over placeholders
|
|
||||||
void SystemDictionary::classes_do(void f(Klass*, ClassLoaderData*, TRAPS), TRAPS) {
|
|
||||||
dictionary()->classes_do(f, CHECK);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SystemDictionary::placeholders_do(void f(Symbol*)) {
|
void SystemDictionary::placeholders_do(void f(Symbol*)) {
|
||||||
placeholders()->entries_do(f);
|
placeholders()->entries_do(f);
|
||||||
}
|
}
|
||||||
|
@ -313,10 +313,7 @@ public:
|
|||||||
static void classes_do(void f(Klass*, TRAPS), TRAPS);
|
static void classes_do(void f(Klass*, TRAPS), TRAPS);
|
||||||
// All classes, and their class loaders
|
// All classes, and their class loaders
|
||||||
static void classes_do(void f(Klass*, ClassLoaderData*));
|
static void classes_do(void f(Klass*, ClassLoaderData*));
|
||||||
// All classes, and their class loaders
|
|
||||||
// (added for helpers that use HandleMarks and ResourceMarks)
|
|
||||||
static void classes_do(void f(Klass*, ClassLoaderData*, TRAPS), TRAPS);
|
|
||||||
// All entries in the placeholder table and their class loaders
|
|
||||||
static void placeholders_do(void f(Symbol*));
|
static void placeholders_do(void f(Symbol*));
|
||||||
|
|
||||||
// Iterate over all methods in all klasses in dictionary
|
// Iterate over all methods in all klasses in dictionary
|
||||||
|
@ -362,7 +362,7 @@ void TypeOrigin::print_on(outputStream* str) const {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ErrorContext::details(outputStream* ss, Method* method) const {
|
void ErrorContext::details(outputStream* ss, const Method* method) const {
|
||||||
if (is_valid()) {
|
if (is_valid()) {
|
||||||
ss->print_cr("");
|
ss->print_cr("");
|
||||||
ss->print_cr("Exception Details:");
|
ss->print_cr("Exception Details:");
|
||||||
@ -435,7 +435,7 @@ void ErrorContext::reason_details(outputStream* ss) const {
|
|||||||
ss->print_cr("");
|
ss->print_cr("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ErrorContext::location_details(outputStream* ss, Method* method) const {
|
void ErrorContext::location_details(outputStream* ss, const Method* method) const {
|
||||||
if (_bci != -1 && method != NULL) {
|
if (_bci != -1 && method != NULL) {
|
||||||
streamIndentor si(ss);
|
streamIndentor si(ss);
|
||||||
const char* bytecode_name = "<invalid>";
|
const char* bytecode_name = "<invalid>";
|
||||||
@ -470,7 +470,7 @@ void ErrorContext::frame_details(outputStream* ss) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ErrorContext::bytecode_details(outputStream* ss, Method* method) const {
|
void ErrorContext::bytecode_details(outputStream* ss, const Method* method) const {
|
||||||
if (method != NULL) {
|
if (method != NULL) {
|
||||||
streamIndentor si(ss);
|
streamIndentor si(ss);
|
||||||
ss->indent().print_cr("Bytecode:");
|
ss->indent().print_cr("Bytecode:");
|
||||||
@ -479,7 +479,7 @@ void ErrorContext::bytecode_details(outputStream* ss, Method* method) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ErrorContext::handler_details(outputStream* ss, Method* method) const {
|
void ErrorContext::handler_details(outputStream* ss, const Method* method) const {
|
||||||
if (method != NULL) {
|
if (method != NULL) {
|
||||||
streamIndentor si(ss);
|
streamIndentor si(ss);
|
||||||
ExceptionTable table(method);
|
ExceptionTable table(method);
|
||||||
@ -494,7 +494,7 @@ void ErrorContext::handler_details(outputStream* ss, Method* method) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ErrorContext::stackmap_details(outputStream* ss, Method* method) const {
|
void ErrorContext::stackmap_details(outputStream* ss, const Method* method) const {
|
||||||
if (method != NULL && method->has_stackmap_table()) {
|
if (method != NULL && method->has_stackmap_table()) {
|
||||||
streamIndentor si(ss);
|
streamIndentor si(ss);
|
||||||
ss->indent().print_cr("Stackmap Table:");
|
ss->indent().print_cr("Stackmap Table:");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -224,7 +224,7 @@ class ErrorContext VALUE_OBJ_CLASS_SPEC {
|
|||||||
_expected.reset_frame();
|
_expected.reset_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void details(outputStream* ss, Method* method) const;
|
void details(outputStream* ss, const Method* method) const;
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
void print_on(outputStream* str) const {
|
void print_on(outputStream* str) const {
|
||||||
@ -237,12 +237,12 @@ class ErrorContext VALUE_OBJ_CLASS_SPEC {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void location_details(outputStream* ss, Method* method) const;
|
void location_details(outputStream* ss, const Method* method) const;
|
||||||
void reason_details(outputStream* ss) const;
|
void reason_details(outputStream* ss) const;
|
||||||
void frame_details(outputStream* ss) const;
|
void frame_details(outputStream* ss) const;
|
||||||
void bytecode_details(outputStream* ss, Method* method) const;
|
void bytecode_details(outputStream* ss, const Method* method) const;
|
||||||
void handler_details(outputStream* ss, Method* method) const;
|
void handler_details(outputStream* ss, const Method* method) const;
|
||||||
void stackmap_details(outputStream* ss, Method* method) const;
|
void stackmap_details(outputStream* ss, const Method* method) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// A new instance of this class is created for each class being verified
|
// A new instance of this class is created for each class being verified
|
||||||
|
@ -49,7 +49,7 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifdef ASSERT
|
||||||
#define VM_SYMBOL_ENUM_NAME_BODY(name, string) #name "\0"
|
#define VM_SYMBOL_ENUM_NAME_BODY(name, string) #name "\0"
|
||||||
static const char* vm_symbol_enum_names =
|
static const char* vm_symbol_enum_names =
|
||||||
VM_SYMBOLS_DO(VM_SYMBOL_ENUM_NAME_BODY, VM_ALIAS_IGNORE)
|
VM_SYMBOLS_DO(VM_SYMBOL_ENUM_NAME_BODY, VM_ALIAS_IGNORE)
|
||||||
@ -64,7 +64,7 @@ static const char* vm_symbol_enum_name(vmSymbols::SID sid) {
|
|||||||
}
|
}
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
#endif //PRODUCT
|
#endif //ASSERT
|
||||||
|
|
||||||
// Put all the VM symbol strings in one place.
|
// Put all the VM symbol strings in one place.
|
||||||
// Makes for a more compact libjvm.
|
// Makes for a more compact libjvm.
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
template(java_lang_Float, "java/lang/Float") \
|
template(java_lang_Float, "java/lang/Float") \
|
||||||
template(java_lang_Double, "java/lang/Double") \
|
template(java_lang_Double, "java/lang/Double") \
|
||||||
template(java_lang_Byte, "java/lang/Byte") \
|
template(java_lang_Byte, "java/lang/Byte") \
|
||||||
template(java_lang_Byte_Cache, "java/lang/Byte$ByteCache") \
|
template(java_lang_Byte_ByteCache, "java/lang/Byte$ByteCache") \
|
||||||
template(java_lang_Short, "java/lang/Short") \
|
template(java_lang_Short, "java/lang/Short") \
|
||||||
template(java_lang_Short_ShortCache, "java/lang/Short$ShortCache") \
|
template(java_lang_Short_ShortCache, "java/lang/Short$ShortCache") \
|
||||||
template(java_lang_Integer, "java/lang/Integer") \
|
template(java_lang_Integer, "java/lang/Integer") \
|
||||||
|
@ -1794,6 +1794,19 @@ void nmethod::metadata_do(void f(Metadata*)) {
|
|||||||
Metadata* md = r->metadata_value();
|
Metadata* md = r->metadata_value();
|
||||||
f(md);
|
f(md);
|
||||||
}
|
}
|
||||||
|
} else if (iter.type() == relocInfo::virtual_call_type) {
|
||||||
|
// Check compiledIC holders associated with this nmethod
|
||||||
|
CompiledIC *ic = CompiledIC_at(iter.reloc());
|
||||||
|
if (ic->is_icholder_call()) {
|
||||||
|
CompiledICHolder* cichk = ic->cached_icholder();
|
||||||
|
f(cichk->holder_method());
|
||||||
|
f(cichk->holder_klass());
|
||||||
|
} else {
|
||||||
|
Metadata* ic_oop = ic->cached_metadata();
|
||||||
|
if (ic_oop != NULL) {
|
||||||
|
f(ic_oop);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1804,6 +1817,7 @@ void nmethod::metadata_do(void f(Metadata*)) {
|
|||||||
Metadata* md = *p;
|
Metadata* md = *p;
|
||||||
f(md);
|
f(md);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call function Method*, not embedded in these other places.
|
// Call function Method*, not embedded in these other places.
|
||||||
if (_method != NULL) f(_method);
|
if (_method != NULL) f(_method);
|
||||||
}
|
}
|
||||||
|
@ -1854,8 +1854,10 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||||||
tty->print("%7d ", (int) tty->time_stamp().milliseconds()); // print timestamp
|
tty->print("%7d ", (int) tty->time_stamp().milliseconds()); // print timestamp
|
||||||
tty->print("%4d ", compile_id); // print compilation number
|
tty->print("%4d ", compile_id); // print compilation number
|
||||||
tty->print("%s ", (is_osr ? "%" : " "));
|
tty->print("%s ", (is_osr ? "%" : " "));
|
||||||
int code_size = (task->code() == NULL) ? 0 : task->code()->total_size();
|
if (task->code() != NULL) {
|
||||||
tty->print_cr("size: %d time: %d inlined: %d bytes", code_size, (int)time.milliseconds(), task->num_inlined_bytecodes());
|
tty->print("size: %d(%d) ", task->code()->total_size(), task->code()->insts_size());
|
||||||
|
}
|
||||||
|
tty->print_cr("time: %d inlined: %d bytes", (int)time.milliseconds(), task->num_inlined_bytecodes());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrintCodeCacheOnCompilation)
|
if (PrintCodeCacheOnCompilation)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -52,7 +52,7 @@ ConcurrentMarkSweepPolicy::ConcurrentMarkSweepPolicy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentMarkSweepPolicy::initialize_generations() {
|
void ConcurrentMarkSweepPolicy::initialize_generations() {
|
||||||
_generations = new GenerationSpecPtr[number_of_generations()];
|
_generations = NEW_C_HEAP_ARRAY3(GenerationSpecPtr, number_of_generations(), mtGC, 0, AllocFailStrategy::RETURN_NULL);
|
||||||
if (_generations == NULL)
|
if (_generations == NULL)
|
||||||
vm_exit_during_initialization("Unable to allocate gen spec");
|
vm_exit_during_initialization("Unable to allocate gen spec");
|
||||||
|
|
||||||
|
@ -692,8 +692,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
|||||||
_cmsGen ->init_initiating_occupancy(CMSInitiatingOccupancyFraction, CMSTriggerRatio);
|
_cmsGen ->init_initiating_occupancy(CMSInitiatingOccupancyFraction, CMSTriggerRatio);
|
||||||
|
|
||||||
// Clip CMSBootstrapOccupancy between 0 and 100.
|
// Clip CMSBootstrapOccupancy between 0 and 100.
|
||||||
_bootstrap_occupancy = ((double)MIN2((uintx)100, MAX2((uintx)0, CMSBootstrapOccupancy)))
|
_bootstrap_occupancy = ((double)CMSBootstrapOccupancy)/(double)100;
|
||||||
/(double)100;
|
|
||||||
|
|
||||||
_full_gcs_since_conc_gc = 0;
|
_full_gcs_since_conc_gc = 0;
|
||||||
|
|
||||||
|
@ -4515,7 +4515,8 @@ G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name)
|
|||||||
_total_used_bytes(0), _total_capacity_bytes(0),
|
_total_used_bytes(0), _total_capacity_bytes(0),
|
||||||
_total_prev_live_bytes(0), _total_next_live_bytes(0),
|
_total_prev_live_bytes(0), _total_next_live_bytes(0),
|
||||||
_hum_used_bytes(0), _hum_capacity_bytes(0),
|
_hum_used_bytes(0), _hum_capacity_bytes(0),
|
||||||
_hum_prev_live_bytes(0), _hum_next_live_bytes(0) {
|
_hum_prev_live_bytes(0), _hum_next_live_bytes(0),
|
||||||
|
_total_remset_bytes(0) {
|
||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
MemRegion g1_committed = g1h->g1_committed();
|
MemRegion g1_committed = g1h->g1_committed();
|
||||||
MemRegion g1_reserved = g1h->g1_reserved();
|
MemRegion g1_reserved = g1h->g1_reserved();
|
||||||
@ -4533,23 +4534,25 @@ G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name)
|
|||||||
HeapRegion::GrainBytes);
|
HeapRegion::GrainBytes);
|
||||||
_out->print_cr(G1PPRL_LINE_PREFIX);
|
_out->print_cr(G1PPRL_LINE_PREFIX);
|
||||||
_out->print_cr(G1PPRL_LINE_PREFIX
|
_out->print_cr(G1PPRL_LINE_PREFIX
|
||||||
G1PPRL_TYPE_H_FORMAT
|
G1PPRL_TYPE_H_FORMAT
|
||||||
G1PPRL_ADDR_BASE_H_FORMAT
|
G1PPRL_ADDR_BASE_H_FORMAT
|
||||||
G1PPRL_BYTE_H_FORMAT
|
G1PPRL_BYTE_H_FORMAT
|
||||||
G1PPRL_BYTE_H_FORMAT
|
G1PPRL_BYTE_H_FORMAT
|
||||||
G1PPRL_BYTE_H_FORMAT
|
G1PPRL_BYTE_H_FORMAT
|
||||||
G1PPRL_DOUBLE_H_FORMAT,
|
G1PPRL_DOUBLE_H_FORMAT
|
||||||
"type", "address-range",
|
G1PPRL_BYTE_H_FORMAT,
|
||||||
"used", "prev-live", "next-live", "gc-eff");
|
"type", "address-range",
|
||||||
|
"used", "prev-live", "next-live", "gc-eff", "remset");
|
||||||
_out->print_cr(G1PPRL_LINE_PREFIX
|
_out->print_cr(G1PPRL_LINE_PREFIX
|
||||||
G1PPRL_TYPE_H_FORMAT
|
G1PPRL_TYPE_H_FORMAT
|
||||||
G1PPRL_ADDR_BASE_H_FORMAT
|
G1PPRL_ADDR_BASE_H_FORMAT
|
||||||
G1PPRL_BYTE_H_FORMAT
|
G1PPRL_BYTE_H_FORMAT
|
||||||
G1PPRL_BYTE_H_FORMAT
|
G1PPRL_BYTE_H_FORMAT
|
||||||
G1PPRL_BYTE_H_FORMAT
|
G1PPRL_BYTE_H_FORMAT
|
||||||
G1PPRL_DOUBLE_H_FORMAT,
|
G1PPRL_DOUBLE_H_FORMAT
|
||||||
"", "",
|
G1PPRL_BYTE_H_FORMAT,
|
||||||
"(bytes)", "(bytes)", "(bytes)", "(bytes/ms)");
|
"", "",
|
||||||
|
"(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", "(bytes)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// It takes as a parameter a reference to one of the _hum_* fields, it
|
// It takes as a parameter a reference to one of the _hum_* fields, it
|
||||||
@ -4591,6 +4594,7 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
|
|||||||
size_t prev_live_bytes = r->live_bytes();
|
size_t prev_live_bytes = r->live_bytes();
|
||||||
size_t next_live_bytes = r->next_live_bytes();
|
size_t next_live_bytes = r->next_live_bytes();
|
||||||
double gc_eff = r->gc_efficiency();
|
double gc_eff = r->gc_efficiency();
|
||||||
|
size_t remset_bytes = r->rem_set()->mem_size();
|
||||||
if (r->used() == 0) {
|
if (r->used() == 0) {
|
||||||
type = "FREE";
|
type = "FREE";
|
||||||
} else if (r->is_survivor()) {
|
} else if (r->is_survivor()) {
|
||||||
@ -4624,6 +4628,7 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
|
|||||||
_total_capacity_bytes += capacity_bytes;
|
_total_capacity_bytes += capacity_bytes;
|
||||||
_total_prev_live_bytes += prev_live_bytes;
|
_total_prev_live_bytes += prev_live_bytes;
|
||||||
_total_next_live_bytes += next_live_bytes;
|
_total_next_live_bytes += next_live_bytes;
|
||||||
|
_total_remset_bytes += remset_bytes;
|
||||||
|
|
||||||
// Print a line for this particular region.
|
// Print a line for this particular region.
|
||||||
_out->print_cr(G1PPRL_LINE_PREFIX
|
_out->print_cr(G1PPRL_LINE_PREFIX
|
||||||
@ -4632,14 +4637,17 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
|
|||||||
G1PPRL_BYTE_FORMAT
|
G1PPRL_BYTE_FORMAT
|
||||||
G1PPRL_BYTE_FORMAT
|
G1PPRL_BYTE_FORMAT
|
||||||
G1PPRL_BYTE_FORMAT
|
G1PPRL_BYTE_FORMAT
|
||||||
G1PPRL_DOUBLE_FORMAT,
|
G1PPRL_DOUBLE_FORMAT
|
||||||
|
G1PPRL_BYTE_FORMAT,
|
||||||
type, bottom, end,
|
type, bottom, end,
|
||||||
used_bytes, prev_live_bytes, next_live_bytes, gc_eff);
|
used_bytes, prev_live_bytes, next_live_bytes, gc_eff , remset_bytes);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {
|
G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {
|
||||||
|
// add static memory usages to remembered set sizes
|
||||||
|
_total_remset_bytes += HeapRegionRemSet::fl_mem_size() + HeapRegionRemSet::static_mem_size();
|
||||||
// Print the footer of the output.
|
// Print the footer of the output.
|
||||||
_out->print_cr(G1PPRL_LINE_PREFIX);
|
_out->print_cr(G1PPRL_LINE_PREFIX);
|
||||||
_out->print_cr(G1PPRL_LINE_PREFIX
|
_out->print_cr(G1PPRL_LINE_PREFIX
|
||||||
@ -4647,13 +4655,15 @@ G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {
|
|||||||
G1PPRL_SUM_MB_FORMAT("capacity")
|
G1PPRL_SUM_MB_FORMAT("capacity")
|
||||||
G1PPRL_SUM_MB_PERC_FORMAT("used")
|
G1PPRL_SUM_MB_PERC_FORMAT("used")
|
||||||
G1PPRL_SUM_MB_PERC_FORMAT("prev-live")
|
G1PPRL_SUM_MB_PERC_FORMAT("prev-live")
|
||||||
G1PPRL_SUM_MB_PERC_FORMAT("next-live"),
|
G1PPRL_SUM_MB_PERC_FORMAT("next-live")
|
||||||
|
G1PPRL_SUM_MB_FORMAT("remset"),
|
||||||
bytes_to_mb(_total_capacity_bytes),
|
bytes_to_mb(_total_capacity_bytes),
|
||||||
bytes_to_mb(_total_used_bytes),
|
bytes_to_mb(_total_used_bytes),
|
||||||
perc(_total_used_bytes, _total_capacity_bytes),
|
perc(_total_used_bytes, _total_capacity_bytes),
|
||||||
bytes_to_mb(_total_prev_live_bytes),
|
bytes_to_mb(_total_prev_live_bytes),
|
||||||
perc(_total_prev_live_bytes, _total_capacity_bytes),
|
perc(_total_prev_live_bytes, _total_capacity_bytes),
|
||||||
bytes_to_mb(_total_next_live_bytes),
|
bytes_to_mb(_total_next_live_bytes),
|
||||||
perc(_total_next_live_bytes, _total_capacity_bytes));
|
perc(_total_next_live_bytes, _total_capacity_bytes),
|
||||||
|
bytes_to_mb(_total_remset_bytes));
|
||||||
_out->cr();
|
_out->cr();
|
||||||
}
|
}
|
||||||
|
@ -1257,6 +1257,9 @@ private:
|
|||||||
size_t _hum_prev_live_bytes;
|
size_t _hum_prev_live_bytes;
|
||||||
size_t _hum_next_live_bytes;
|
size_t _hum_next_live_bytes;
|
||||||
|
|
||||||
|
// Accumulator for the remembered set size
|
||||||
|
size_t _total_remset_bytes;
|
||||||
|
|
||||||
static double perc(size_t val, size_t total) {
|
static double perc(size_t val, size_t total) {
|
||||||
if (total == 0) {
|
if (total == 0) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
@ -101,20 +101,23 @@ void G1CardCounts::resize(size_t heap_capacity) {
|
|||||||
ReservedSpace::allocation_align_size_up(_committed_size),
|
ReservedSpace::allocation_align_size_up(_committed_size),
|
||||||
err_msg("Unaligned? committed_size: " SIZE_FORMAT, _committed_size));
|
err_msg("Unaligned? committed_size: " SIZE_FORMAT, _committed_size));
|
||||||
|
|
||||||
// Verify that the committed space for the card counts
|
// Verify that the committed space for the card counts matches our
|
||||||
// matches our committed max card num.
|
// committed max card num. Note for some allocation alignments, the
|
||||||
|
// amount of space actually committed for the counts table will be able
|
||||||
|
// to span more cards than the number spanned by the maximum heap.
|
||||||
size_t prev_committed_size = _committed_size;
|
size_t prev_committed_size = _committed_size;
|
||||||
size_t prev_committed_card_num = prev_committed_size / sizeof(jbyte);
|
size_t prev_committed_card_num = committed_to_card_num(prev_committed_size);
|
||||||
|
|
||||||
assert(prev_committed_card_num == _committed_max_card_num,
|
assert(prev_committed_card_num == _committed_max_card_num,
|
||||||
err_msg("Card mismatch: "
|
err_msg("Card mismatch: "
|
||||||
"prev: " SIZE_FORMAT ", "
|
"prev: " SIZE_FORMAT ", "
|
||||||
"committed: "SIZE_FORMAT,
|
"committed: "SIZE_FORMAT", "
|
||||||
prev_committed_card_num, _committed_max_card_num));
|
"reserved: "SIZE_FORMAT,
|
||||||
|
prev_committed_card_num, _committed_max_card_num, _reserved_max_card_num));
|
||||||
|
|
||||||
size_t new_size = (heap_capacity >> CardTableModRefBS::card_shift) * sizeof(jbyte);
|
size_t new_size = (heap_capacity >> CardTableModRefBS::card_shift) * sizeof(jbyte);
|
||||||
size_t new_committed_size = ReservedSpace::allocation_align_size_up(new_size);
|
size_t new_committed_size = ReservedSpace::allocation_align_size_up(new_size);
|
||||||
size_t new_committed_card_num =
|
size_t new_committed_card_num = committed_to_card_num(new_committed_size);
|
||||||
MIN2(_reserved_max_card_num, new_committed_size / sizeof(jbyte));
|
|
||||||
|
|
||||||
if (_committed_max_card_num < new_committed_card_num) {
|
if (_committed_max_card_num < new_committed_card_num) {
|
||||||
// we need to expand the backing store for the card counts
|
// we need to expand the backing store for the card counts
|
||||||
|
@ -94,6 +94,14 @@ class G1CardCounts: public CHeapObj<mtGC> {
|
|||||||
return (jbyte*) (_ct_bot + card_num);
|
return (jbyte*) (_ct_bot + card_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper routine.
|
||||||
|
// Returns the number of cards that can be counted by the given committed
|
||||||
|
// table size, with a maximum of the number of cards spanned by the max
|
||||||
|
// capacity of the heap.
|
||||||
|
size_t committed_to_card_num(size_t committed_size) {
|
||||||
|
return MIN2(_reserved_max_card_num, committed_size / sizeof(jbyte));
|
||||||
|
}
|
||||||
|
|
||||||
// Clear the counts table for the given (exclusive) index range.
|
// Clear the counts table for the given (exclusive) index range.
|
||||||
void clear_range(size_t from_card_num, size_t to_card_num);
|
void clear_range(size_t from_card_num, size_t to_card_num);
|
||||||
|
|
||||||
|
@ -1549,7 +1549,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (G1Log::finer()) {
|
if (G1Log::finer()) {
|
||||||
g1_policy()->print_detailed_heap_transition();
|
g1_policy()->print_detailed_heap_transition(true /* full */);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_heap_after_gc();
|
print_heap_after_gc();
|
||||||
|
@ -124,9 +124,12 @@ G1CollectorPolicy::G1CollectorPolicy() :
|
|||||||
_last_young_gc(false),
|
_last_young_gc(false),
|
||||||
_last_gc_was_young(false),
|
_last_gc_was_young(false),
|
||||||
|
|
||||||
_eden_bytes_before_gc(0),
|
_eden_used_bytes_before_gc(0),
|
||||||
_survivor_bytes_before_gc(0),
|
_survivor_used_bytes_before_gc(0),
|
||||||
_capacity_before_gc(0),
|
_heap_used_bytes_before_gc(0),
|
||||||
|
_metaspace_used_bytes_before_gc(0),
|
||||||
|
_eden_capacity_bytes_before_gc(0),
|
||||||
|
_heap_capacity_bytes_before_gc(0),
|
||||||
|
|
||||||
_eden_cset_region_length(0),
|
_eden_cset_region_length(0),
|
||||||
_survivor_cset_region_length(0),
|
_survivor_cset_region_length(0),
|
||||||
@ -746,7 +749,7 @@ G1CollectorPolicy::verify_young_ages(HeapRegion* head,
|
|||||||
|
|
||||||
void G1CollectorPolicy::record_full_collection_start() {
|
void G1CollectorPolicy::record_full_collection_start() {
|
||||||
_full_collection_start_sec = os::elapsedTime();
|
_full_collection_start_sec = os::elapsedTime();
|
||||||
record_heap_size_info_at_start();
|
record_heap_size_info_at_start(true /* full */);
|
||||||
// Release the future to-space so that it is available for compaction into.
|
// Release the future to-space so that it is available for compaction into.
|
||||||
_g1->set_full_collection();
|
_g1->set_full_collection();
|
||||||
}
|
}
|
||||||
@ -803,7 +806,7 @@ void G1CollectorPolicy::record_collection_pause_start(double start_time_sec) {
|
|||||||
_trace_gen0_time_data.record_start_collection(s_w_t_ms);
|
_trace_gen0_time_data.record_start_collection(s_w_t_ms);
|
||||||
_stop_world_start = 0.0;
|
_stop_world_start = 0.0;
|
||||||
|
|
||||||
record_heap_size_info_at_start();
|
record_heap_size_info_at_start(false /* full */);
|
||||||
|
|
||||||
phase_times()->record_cur_collection_start_sec(start_time_sec);
|
phase_times()->record_cur_collection_start_sec(start_time_sec);
|
||||||
_pending_cards = _g1->pending_card_num();
|
_pending_cards = _g1->pending_card_num();
|
||||||
@ -938,14 +941,6 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms) {
|
|||||||
_mmu_tracker->add_pause(end_time_sec - pause_time_ms/1000.0,
|
_mmu_tracker->add_pause(end_time_sec - pause_time_ms/1000.0,
|
||||||
end_time_sec, false);
|
end_time_sec, false);
|
||||||
|
|
||||||
size_t freed_bytes =
|
|
||||||
_cur_collection_pause_used_at_start_bytes - cur_used_bytes;
|
|
||||||
size_t surviving_bytes = _collection_set_bytes_used_before - freed_bytes;
|
|
||||||
|
|
||||||
double survival_fraction =
|
|
||||||
(double)surviving_bytes/
|
|
||||||
(double)_collection_set_bytes_used_before;
|
|
||||||
|
|
||||||
if (update_stats) {
|
if (update_stats) {
|
||||||
_trace_gen0_time_data.record_end_collection(pause_time_ms, phase_times());
|
_trace_gen0_time_data.record_end_collection(pause_time_ms, phase_times());
|
||||||
// this is where we update the allocation rate of the application
|
// this is where we update the allocation rate of the application
|
||||||
@ -998,6 +993,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool new_in_marking_window = _in_marking_window;
|
bool new_in_marking_window = _in_marking_window;
|
||||||
bool new_in_marking_window_im = false;
|
bool new_in_marking_window_im = false;
|
||||||
if (during_initial_mark_pause()) {
|
if (during_initial_mark_pause()) {
|
||||||
@ -1083,8 +1079,10 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms) {
|
|||||||
}
|
}
|
||||||
_rs_length_diff_seq->add((double) rs_length_diff);
|
_rs_length_diff_seq->add((double) rs_length_diff);
|
||||||
|
|
||||||
size_t copied_bytes = surviving_bytes;
|
size_t freed_bytes = _heap_used_bytes_before_gc - cur_used_bytes;
|
||||||
|
size_t copied_bytes = _collection_set_bytes_used_before - freed_bytes;
|
||||||
double cost_per_byte_ms = 0.0;
|
double cost_per_byte_ms = 0.0;
|
||||||
|
|
||||||
if (copied_bytes > 0) {
|
if (copied_bytes > 0) {
|
||||||
cost_per_byte_ms = phase_times()->average_last_obj_copy_time() / (double) copied_bytes;
|
cost_per_byte_ms = phase_times()->average_last_obj_copy_time() / (double) copied_bytes;
|
||||||
if (_in_marking_window) {
|
if (_in_marking_window) {
|
||||||
@ -1148,51 +1146,61 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms) {
|
|||||||
byte_size_in_proper_unit((double)(bytes)), \
|
byte_size_in_proper_unit((double)(bytes)), \
|
||||||
proper_unit_for_byte_size((bytes))
|
proper_unit_for_byte_size((bytes))
|
||||||
|
|
||||||
void G1CollectorPolicy::record_heap_size_info_at_start() {
|
void G1CollectorPolicy::record_heap_size_info_at_start(bool full) {
|
||||||
YoungList* young_list = _g1->young_list();
|
YoungList* young_list = _g1->young_list();
|
||||||
_eden_bytes_before_gc = young_list->eden_used_bytes();
|
_eden_used_bytes_before_gc = young_list->eden_used_bytes();
|
||||||
_survivor_bytes_before_gc = young_list->survivor_used_bytes();
|
_survivor_used_bytes_before_gc = young_list->survivor_used_bytes();
|
||||||
_capacity_before_gc = _g1->capacity();
|
_heap_capacity_bytes_before_gc = _g1->capacity();
|
||||||
|
_heap_used_bytes_before_gc = _g1->used();
|
||||||
_cur_collection_pause_used_at_start_bytes = _g1->used();
|
|
||||||
_cur_collection_pause_used_regions_at_start = _g1->used_regions();
|
_cur_collection_pause_used_regions_at_start = _g1->used_regions();
|
||||||
|
|
||||||
size_t eden_capacity_before_gc =
|
_eden_capacity_bytes_before_gc =
|
||||||
(_young_list_target_length * HeapRegion::GrainBytes) - _survivor_bytes_before_gc;
|
(_young_list_target_length * HeapRegion::GrainBytes) - _survivor_used_bytes_before_gc;
|
||||||
|
|
||||||
_prev_eden_capacity = eden_capacity_before_gc;
|
if (full) {
|
||||||
|
_metaspace_used_bytes_before_gc = MetaspaceAux::allocated_used_bytes();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1CollectorPolicy::print_heap_transition() {
|
void G1CollectorPolicy::print_heap_transition() {
|
||||||
_g1->print_size_transition(gclog_or_tty,
|
_g1->print_size_transition(gclog_or_tty,
|
||||||
_cur_collection_pause_used_at_start_bytes, _g1->used(), _g1->capacity());
|
_heap_used_bytes_before_gc,
|
||||||
|
_g1->used(),
|
||||||
|
_g1->capacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1CollectorPolicy::print_detailed_heap_transition() {
|
void G1CollectorPolicy::print_detailed_heap_transition(bool full) {
|
||||||
YoungList* young_list = _g1->young_list();
|
YoungList* young_list = _g1->young_list();
|
||||||
size_t eden_bytes = young_list->eden_used_bytes();
|
|
||||||
size_t survivor_bytes = young_list->survivor_used_bytes();
|
|
||||||
size_t used_before_gc = _cur_collection_pause_used_at_start_bytes;
|
|
||||||
size_t used = _g1->used();
|
|
||||||
size_t capacity = _g1->capacity();
|
|
||||||
size_t eden_capacity =
|
|
||||||
(_young_list_target_length * HeapRegion::GrainBytes) - survivor_bytes;
|
|
||||||
|
|
||||||
gclog_or_tty->print_cr(
|
size_t eden_used_bytes_after_gc = young_list->eden_used_bytes();
|
||||||
" [Eden: "EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT")->"EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT") "
|
size_t survivor_used_bytes_after_gc = young_list->survivor_used_bytes();
|
||||||
"Survivors: "EXT_SIZE_FORMAT"->"EXT_SIZE_FORMAT" "
|
size_t heap_used_bytes_after_gc = _g1->used();
|
||||||
"Heap: "EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT")->"
|
|
||||||
EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT")]",
|
size_t heap_capacity_bytes_after_gc = _g1->capacity();
|
||||||
EXT_SIZE_PARAMS(_eden_bytes_before_gc),
|
size_t eden_capacity_bytes_after_gc =
|
||||||
EXT_SIZE_PARAMS(_prev_eden_capacity),
|
(_young_list_target_length * HeapRegion::GrainBytes) - survivor_used_bytes_after_gc;
|
||||||
EXT_SIZE_PARAMS(eden_bytes),
|
|
||||||
EXT_SIZE_PARAMS(eden_capacity),
|
gclog_or_tty->print(
|
||||||
EXT_SIZE_PARAMS(_survivor_bytes_before_gc),
|
" [Eden: "EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT")->"EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT") "
|
||||||
EXT_SIZE_PARAMS(survivor_bytes),
|
"Survivors: "EXT_SIZE_FORMAT"->"EXT_SIZE_FORMAT" "
|
||||||
EXT_SIZE_PARAMS(used_before_gc),
|
"Heap: "EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT")->"
|
||||||
EXT_SIZE_PARAMS(_capacity_before_gc),
|
EXT_SIZE_FORMAT"("EXT_SIZE_FORMAT")]",
|
||||||
EXT_SIZE_PARAMS(used),
|
EXT_SIZE_PARAMS(_eden_used_bytes_before_gc),
|
||||||
EXT_SIZE_PARAMS(capacity));
|
EXT_SIZE_PARAMS(_eden_capacity_bytes_before_gc),
|
||||||
|
EXT_SIZE_PARAMS(eden_used_bytes_after_gc),
|
||||||
|
EXT_SIZE_PARAMS(eden_capacity_bytes_after_gc),
|
||||||
|
EXT_SIZE_PARAMS(_survivor_used_bytes_before_gc),
|
||||||
|
EXT_SIZE_PARAMS(survivor_used_bytes_after_gc),
|
||||||
|
EXT_SIZE_PARAMS(_heap_used_bytes_before_gc),
|
||||||
|
EXT_SIZE_PARAMS(_heap_capacity_bytes_before_gc),
|
||||||
|
EXT_SIZE_PARAMS(heap_used_bytes_after_gc),
|
||||||
|
EXT_SIZE_PARAMS(heap_capacity_bytes_after_gc));
|
||||||
|
|
||||||
|
if (full) {
|
||||||
|
MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
gclog_or_tty->cr();
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,
|
void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,
|
||||||
|
@ -175,7 +175,6 @@ private:
|
|||||||
CollectionSetChooser* _collectionSetChooser;
|
CollectionSetChooser* _collectionSetChooser;
|
||||||
|
|
||||||
double _full_collection_start_sec;
|
double _full_collection_start_sec;
|
||||||
size_t _cur_collection_pause_used_at_start_bytes;
|
|
||||||
uint _cur_collection_pause_used_regions_at_start;
|
uint _cur_collection_pause_used_regions_at_start;
|
||||||
|
|
||||||
// These exclude marking times.
|
// These exclude marking times.
|
||||||
@ -194,7 +193,6 @@ private:
|
|||||||
|
|
||||||
uint _young_list_target_length;
|
uint _young_list_target_length;
|
||||||
uint _young_list_fixed_length;
|
uint _young_list_fixed_length;
|
||||||
size_t _prev_eden_capacity; // used for logging
|
|
||||||
|
|
||||||
// The max number of regions we can extend the eden by while the GC
|
// The max number of regions we can extend the eden by while the GC
|
||||||
// locker is active. This should be >= _young_list_target_length;
|
// locker is active. This should be >= _young_list_target_length;
|
||||||
@ -693,11 +691,11 @@ public:
|
|||||||
|
|
||||||
// Records the information about the heap size for reporting in
|
// Records the information about the heap size for reporting in
|
||||||
// print_detailed_heap_transition
|
// print_detailed_heap_transition
|
||||||
void record_heap_size_info_at_start();
|
void record_heap_size_info_at_start(bool full);
|
||||||
|
|
||||||
// Print heap sizing transition (with less and more detail).
|
// Print heap sizing transition (with less and more detail).
|
||||||
void print_heap_transition();
|
void print_heap_transition();
|
||||||
void print_detailed_heap_transition();
|
void print_detailed_heap_transition(bool full = false);
|
||||||
|
|
||||||
void record_stop_world_start();
|
void record_stop_world_start();
|
||||||
void record_concurrent_pause();
|
void record_concurrent_pause();
|
||||||
@ -861,9 +859,16 @@ private:
|
|||||||
uint _max_survivor_regions;
|
uint _max_survivor_regions;
|
||||||
|
|
||||||
// For reporting purposes.
|
// For reporting purposes.
|
||||||
size_t _eden_bytes_before_gc;
|
// The value of _heap_bytes_before_gc is also used to calculate
|
||||||
size_t _survivor_bytes_before_gc;
|
// the cost of copying.
|
||||||
size_t _capacity_before_gc;
|
|
||||||
|
size_t _eden_used_bytes_before_gc; // Eden occupancy before GC
|
||||||
|
size_t _survivor_used_bytes_before_gc; // Survivor occupancy before GC
|
||||||
|
size_t _heap_used_bytes_before_gc; // Heap occupancy before GC
|
||||||
|
size_t _metaspace_used_bytes_before_gc; // Metaspace occupancy before GC
|
||||||
|
|
||||||
|
size_t _eden_capacity_bytes_before_gc; // Eden capacity before GC
|
||||||
|
size_t _heap_capacity_bytes_before_gc; // Heap capacity before GC
|
||||||
|
|
||||||
// The amount of survivor regions after a collection.
|
// The amount of survivor regions after a collection.
|
||||||
uint _recorded_survivor_regions;
|
uint _recorded_survivor_regions;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -282,7 +282,8 @@ OtherRegionsTable::OtherRegionsTable(HeapRegion* hr) :
|
|||||||
_fine_eviction_stride = _max_fine_entries / _fine_eviction_sample_size;
|
_fine_eviction_stride = _max_fine_entries / _fine_eviction_sample_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
_fine_grain_regions = new PerRegionTablePtr[_max_fine_entries];
|
_fine_grain_regions = NEW_C_HEAP_ARRAY3(PerRegionTablePtr, _max_fine_entries,
|
||||||
|
mtGC, 0, AllocFailStrategy::RETURN_NULL);
|
||||||
|
|
||||||
if (_fine_grain_regions == NULL) {
|
if (_fine_grain_regions == NULL) {
|
||||||
vm_exit_out_of_memory(sizeof(void*)*_max_fine_entries, OOM_MALLOC_ERROR,
|
vm_exit_out_of_memory(sizeof(void*)*_max_fine_entries, OOM_MALLOC_ERROR,
|
||||||
@ -706,10 +707,11 @@ size_t OtherRegionsTable::mem_size() const {
|
|||||||
// Cast away const in this case.
|
// Cast away const in this case.
|
||||||
MutexLockerEx x((Mutex*)&_m, Mutex::_no_safepoint_check_flag);
|
MutexLockerEx x((Mutex*)&_m, Mutex::_no_safepoint_check_flag);
|
||||||
size_t sum = 0;
|
size_t sum = 0;
|
||||||
PerRegionTable * cur = _first_all_fine_prts;
|
// all PRTs are of the same size so it is sufficient to query only one of them.
|
||||||
while (cur != NULL) {
|
if (_first_all_fine_prts != NULL) {
|
||||||
sum += cur->mem_size();
|
assert(_last_all_fine_prts != NULL &&
|
||||||
cur = cur->next();
|
_first_all_fine_prts->mem_size() == _last_all_fine_prts->mem_size(), "check that mem_size() is constant");
|
||||||
|
sum += _first_all_fine_prts->mem_size() * _n_fine_entries;
|
||||||
}
|
}
|
||||||
sum += (sizeof(PerRegionTable*) * _max_fine_entries);
|
sum += (sizeof(PerRegionTable*) * _max_fine_entries);
|
||||||
sum += (_coarse_map.size_in_words() * HeapWordSize);
|
sum += (_coarse_map.size_in_words() * HeapWordSize);
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
|
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
|
||||||
#include "gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp"
|
|
||||||
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
|
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
@ -108,31 +107,6 @@ ParMarkBitMap::mark_obj(HeapWord* addr, size_t size)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
|
||||||
ParMarkBitMap::live_words_in_range(HeapWord* beg_addr, HeapWord* end_addr) const
|
|
||||||
{
|
|
||||||
assert(beg_addr <= end_addr, "bad range");
|
|
||||||
|
|
||||||
idx_t live_bits = 0;
|
|
||||||
|
|
||||||
// The bitmap routines require the right boundary to be word-aligned.
|
|
||||||
const idx_t end_bit = addr_to_bit(end_addr);
|
|
||||||
const idx_t range_end = BitMap::word_align_up(end_bit);
|
|
||||||
|
|
||||||
idx_t beg_bit = find_obj_beg(addr_to_bit(beg_addr), range_end);
|
|
||||||
while (beg_bit < end_bit) {
|
|
||||||
idx_t tmp_end = find_obj_end(beg_bit, range_end);
|
|
||||||
if (tmp_end < end_bit) {
|
|
||||||
live_bits += tmp_end - beg_bit + 1;
|
|
||||||
beg_bit = find_obj_beg(tmp_end + 1, range_end);
|
|
||||||
} else {
|
|
||||||
live_bits += end_bit - beg_bit; // No + 1 here; end_bit is not counted.
|
|
||||||
return bits_to_words(live_bits);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bits_to_words(live_bits);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t ParMarkBitMap::live_words_in_range(HeapWord* beg_addr, oop end_obj) const
|
size_t ParMarkBitMap::live_words_in_range(HeapWord* beg_addr, oop end_obj) const
|
||||||
{
|
{
|
||||||
assert(beg_addr <= (HeapWord*)end_obj, "bad range");
|
assert(beg_addr <= (HeapWord*)end_obj, "bad range");
|
||||||
@ -244,13 +218,6 @@ ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure,
|
|||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
void ParMarkBitMap::reset_counters()
|
|
||||||
{
|
|
||||||
_cas_tries = _cas_retries = _cas_by_another = 0;
|
|
||||||
}
|
|
||||||
#endif // #ifndef PRODUCT
|
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
void ParMarkBitMap::verify_clear() const
|
void ParMarkBitMap::verify_clear() const
|
||||||
{
|
{
|
||||||
|
@ -26,11 +26,11 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
|
||||||
|
|
||||||
#include "memory/memRegion.hpp"
|
#include "memory/memRegion.hpp"
|
||||||
#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
|
#include "oops/oop.hpp"
|
||||||
#include "utilities/bitMap.inline.hpp"
|
#include "utilities/bitMap.hpp"
|
||||||
|
|
||||||
class oopDesc;
|
|
||||||
class ParMarkBitMapClosure;
|
class ParMarkBitMapClosure;
|
||||||
|
class PSVirtualSpace;
|
||||||
|
|
||||||
class ParMarkBitMap: public CHeapObj<mtGC>
|
class ParMarkBitMap: public CHeapObj<mtGC>
|
||||||
{
|
{
|
||||||
@ -41,13 +41,11 @@ public:
|
|||||||
enum IterationStatus { incomplete, complete, full, would_overflow };
|
enum IterationStatus { incomplete, complete, full, would_overflow };
|
||||||
|
|
||||||
inline ParMarkBitMap();
|
inline ParMarkBitMap();
|
||||||
inline ParMarkBitMap(MemRegion covered_region);
|
|
||||||
bool initialize(MemRegion covered_region);
|
bool initialize(MemRegion covered_region);
|
||||||
|
|
||||||
// Atomically mark an object as live.
|
// Atomically mark an object as live.
|
||||||
bool mark_obj(HeapWord* addr, size_t size);
|
bool mark_obj(HeapWord* addr, size_t size);
|
||||||
inline bool mark_obj(oop obj, int size);
|
inline bool mark_obj(oop obj, int size);
|
||||||
inline bool mark_obj(oop obj);
|
|
||||||
|
|
||||||
// Return whether the specified begin or end bit is set.
|
// Return whether the specified begin or end bit is set.
|
||||||
inline bool is_obj_beg(idx_t bit) const;
|
inline bool is_obj_beg(idx_t bit) const;
|
||||||
@ -77,11 +75,6 @@ public:
|
|||||||
// Return the size in words of the object (a search is done for the end bit).
|
// Return the size in words of the object (a search is done for the end bit).
|
||||||
inline size_t obj_size(idx_t beg_bit) const;
|
inline size_t obj_size(idx_t beg_bit) const;
|
||||||
inline size_t obj_size(HeapWord* addr) const;
|
inline size_t obj_size(HeapWord* addr) const;
|
||||||
inline size_t obj_size(oop obj) const;
|
|
||||||
|
|
||||||
// Synonyms for the above.
|
|
||||||
size_t obj_size_in_words(oop obj) const { return obj_size((HeapWord*)obj); }
|
|
||||||
size_t obj_size_in_words(HeapWord* addr) const { return obj_size(addr); }
|
|
||||||
|
|
||||||
// Apply live_closure to each live object that lies completely within the
|
// Apply live_closure to each live object that lies completely within the
|
||||||
// range [live_range_beg, live_range_end). This is used to iterate over the
|
// range [live_range_beg, live_range_end). This is used to iterate over the
|
||||||
@ -124,15 +117,12 @@ public:
|
|||||||
HeapWord* range_end,
|
HeapWord* range_end,
|
||||||
HeapWord* dead_range_end) const;
|
HeapWord* dead_range_end) const;
|
||||||
|
|
||||||
// Return the number of live words in the range [beg_addr, end_addr) due to
|
// Return the number of live words in the range [beg_addr, end_obj) due to
|
||||||
// objects that start in the range. If a live object extends onto the range,
|
// objects that start in the range. If a live object extends onto the range,
|
||||||
// the caller must detect and account for any live words due to that object.
|
// the caller must detect and account for any live words due to that object.
|
||||||
// If a live object extends beyond the end of the range, only the words within
|
// If a live object extends beyond the end of the range, only the words within
|
||||||
// the range are included in the result.
|
// the range are included in the result. The end of the range must be a live object,
|
||||||
size_t live_words_in_range(HeapWord* beg_addr, HeapWord* end_addr) const;
|
// which is the case when updating pointers. This allows a branch to be removed
|
||||||
|
|
||||||
// Same as the above, except the end of the range must be a live object, which
|
|
||||||
// is the case when updating pointers. This allows a branch to be removed
|
|
||||||
// from inside the loop.
|
// from inside the loop.
|
||||||
size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const;
|
size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const;
|
||||||
|
|
||||||
@ -156,22 +146,11 @@ public:
|
|||||||
// Clear a range of bits or the entire bitmap (both begin and end bits are
|
// Clear a range of bits or the entire bitmap (both begin and end bits are
|
||||||
// cleared).
|
// cleared).
|
||||||
inline void clear_range(idx_t beg, idx_t end);
|
inline void clear_range(idx_t beg, idx_t end);
|
||||||
inline void clear() { clear_range(0, size()); }
|
|
||||||
|
|
||||||
// Return the number of bits required to represent the specified number of
|
// Return the number of bits required to represent the specified number of
|
||||||
// HeapWords, or the specified region.
|
// HeapWords, or the specified region.
|
||||||
static inline idx_t bits_required(size_t words);
|
static inline idx_t bits_required(size_t words);
|
||||||
static inline idx_t bits_required(MemRegion covered_region);
|
static inline idx_t bits_required(MemRegion covered_region);
|
||||||
static inline idx_t words_required(MemRegion covered_region);
|
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
// CAS statistics.
|
|
||||||
size_t cas_tries() { return _cas_tries; }
|
|
||||||
size_t cas_retries() { return _cas_retries; }
|
|
||||||
size_t cas_by_another() { return _cas_by_another; }
|
|
||||||
|
|
||||||
void reset_counters();
|
|
||||||
#endif // #ifndef PRODUCT
|
|
||||||
|
|
||||||
void print_on_error(outputStream* st) const {
|
void print_on_error(outputStream* st) const {
|
||||||
st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this);
|
st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this);
|
||||||
@ -197,28 +176,11 @@ private:
|
|||||||
BitMap _beg_bits;
|
BitMap _beg_bits;
|
||||||
BitMap _end_bits;
|
BitMap _end_bits;
|
||||||
PSVirtualSpace* _virtual_space;
|
PSVirtualSpace* _virtual_space;
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
size_t _cas_tries;
|
|
||||||
size_t _cas_retries;
|
|
||||||
size_t _cas_by_another;
|
|
||||||
#endif // #ifndef PRODUCT
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ParMarkBitMap::ParMarkBitMap():
|
inline ParMarkBitMap::ParMarkBitMap():
|
||||||
_beg_bits(),
|
_beg_bits(), _end_bits(), _region_start(NULL), _region_size(0), _virtual_space(NULL)
|
||||||
_end_bits()
|
{ }
|
||||||
{
|
|
||||||
_region_start = 0;
|
|
||||||
_virtual_space = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline ParMarkBitMap::ParMarkBitMap(MemRegion covered_region):
|
|
||||||
_beg_bits(),
|
|
||||||
_end_bits()
|
|
||||||
{
|
|
||||||
initialize(covered_region);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end)
|
inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end)
|
||||||
{
|
{
|
||||||
@ -240,12 +202,6 @@ ParMarkBitMap::bits_required(MemRegion covered_region)
|
|||||||
return bits_required(covered_region.word_size());
|
return bits_required(covered_region.word_size());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ParMarkBitMap::idx_t
|
|
||||||
ParMarkBitMap::words_required(MemRegion covered_region)
|
|
||||||
{
|
|
||||||
return bits_required(covered_region) / BitsPerWord;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline HeapWord*
|
inline HeapWord*
|
||||||
ParMarkBitMap::region_start() const
|
ParMarkBitMap::region_start() const
|
||||||
{
|
{
|
||||||
@ -350,11 +306,6 @@ inline size_t ParMarkBitMap::obj_size(HeapWord* addr) const
|
|||||||
return obj_size(addr_to_bit(addr));
|
return obj_size(addr_to_bit(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline size_t ParMarkBitMap::obj_size(oop obj) const
|
|
||||||
{
|
|
||||||
return obj_size((HeapWord*)obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline ParMarkBitMap::IterationStatus
|
inline ParMarkBitMap::IterationStatus
|
||||||
ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure,
|
ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure,
|
||||||
HeapWord* range_beg,
|
HeapWord* range_beg,
|
||||||
@ -435,8 +386,10 @@ inline void ParMarkBitMap::verify_bit(idx_t bit) const {
|
|||||||
|
|
||||||
inline void ParMarkBitMap::verify_addr(HeapWord* addr) const {
|
inline void ParMarkBitMap::verify_addr(HeapWord* addr) const {
|
||||||
// Allow one past the last valid address; useful for loop bounds.
|
// Allow one past the last valid address; useful for loop bounds.
|
||||||
assert(addr >= region_start(), "addr too small");
|
assert(addr >= region_start(),
|
||||||
assert(addr <= region_start() + region_size(), "addr too big");
|
err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, addr, region_start()));
|
||||||
|
assert(addr <= region_end(),
|
||||||
|
err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, addr, region_end()));
|
||||||
}
|
}
|
||||||
#endif // #ifdef ASSERT
|
#endif // #ifdef ASSERT
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -213,7 +213,7 @@ void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
|
|||||||
int random_seed = 17;
|
int random_seed = 17;
|
||||||
do {
|
do {
|
||||||
while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
|
while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
|
||||||
ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
|
ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass();
|
||||||
k->oop_follow_contents(cm, task.obj(), task.index());
|
k->oop_follow_contents(cm, task.obj(), task.index());
|
||||||
cm->follow_marking_stacks();
|
cm->follow_marking_stacks();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -201,15 +201,232 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
size_t cur_eden,
|
size_t cur_eden,
|
||||||
size_t max_old_gen_size,
|
size_t max_old_gen_size,
|
||||||
size_t max_eden_size,
|
size_t max_eden_size,
|
||||||
bool is_full_gc,
|
bool is_full_gc) {
|
||||||
GCCause::Cause gc_cause,
|
compute_eden_space_size(young_live,
|
||||||
CollectorPolicy* collector_policy) {
|
eden_live,
|
||||||
|
cur_eden,
|
||||||
|
max_eden_size,
|
||||||
|
is_full_gc);
|
||||||
|
|
||||||
|
compute_old_gen_free_space(old_live,
|
||||||
|
cur_eden,
|
||||||
|
max_old_gen_size,
|
||||||
|
is_full_gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PSAdaptiveSizePolicy::compute_eden_space_size(
|
||||||
|
size_t young_live,
|
||||||
|
size_t eden_live,
|
||||||
|
size_t cur_eden,
|
||||||
|
size_t max_eden_size,
|
||||||
|
bool is_full_gc) {
|
||||||
|
|
||||||
// Update statistics
|
// Update statistics
|
||||||
// Time statistics are updated as we go, update footprint stats here
|
// Time statistics are updated as we go, update footprint stats here
|
||||||
_avg_base_footprint->sample(BaseFootPrintEstimate);
|
_avg_base_footprint->sample(BaseFootPrintEstimate);
|
||||||
avg_young_live()->sample(young_live);
|
avg_young_live()->sample(young_live);
|
||||||
avg_eden_live()->sample(eden_live);
|
avg_eden_live()->sample(eden_live);
|
||||||
|
|
||||||
|
// This code used to return if the policy was not ready , i.e.,
|
||||||
|
// policy_is_ready() returning false. The intent was that
|
||||||
|
// decisions below needed major collection times and so could
|
||||||
|
// not be made before two major collections. A consequence was
|
||||||
|
// adjustments to the young generation were not done until after
|
||||||
|
// two major collections even if the minor collections times
|
||||||
|
// exceeded the requested goals. Now let the young generation
|
||||||
|
// adjust for the minor collection times. Major collection times
|
||||||
|
// will be zero for the first collection and will naturally be
|
||||||
|
// ignored. Tenured generation adjustments are only made at the
|
||||||
|
// full collections so until the second major collection has
|
||||||
|
// been reached, no tenured generation adjustments will be made.
|
||||||
|
|
||||||
|
// Until we know better, desired promotion size uses the last calculation
|
||||||
|
size_t desired_promo_size = _promo_size;
|
||||||
|
|
||||||
|
// Start eden at the current value. The desired value that is stored
|
||||||
|
// in _eden_size is not bounded by constraints of the heap and can
|
||||||
|
// run away.
|
||||||
|
//
|
||||||
|
// As expected setting desired_eden_size to the current
|
||||||
|
// value of desired_eden_size as a starting point
|
||||||
|
// caused desired_eden_size to grow way too large and caused
|
||||||
|
// an overflow down stream. It may have improved performance in
|
||||||
|
// some case but is dangerous.
|
||||||
|
size_t desired_eden_size = cur_eden;
|
||||||
|
|
||||||
|
// Cache some values. There's a bit of work getting these, so
|
||||||
|
// we might save a little time.
|
||||||
|
const double major_cost = major_gc_cost();
|
||||||
|
const double minor_cost = minor_gc_cost();
|
||||||
|
|
||||||
|
// This method sets the desired eden size. That plus the
|
||||||
|
// desired survivor space sizes sets the desired young generation
|
||||||
|
// size. This methods does not know what the desired survivor
|
||||||
|
// size is but expects that other policy will attempt to make
|
||||||
|
// the survivor sizes compatible with the live data in the
|
||||||
|
// young generation. This limit is an estimate of the space left
|
||||||
|
// in the young generation after the survivor spaces have been
|
||||||
|
// subtracted out.
|
||||||
|
size_t eden_limit = max_eden_size;
|
||||||
|
|
||||||
|
const double gc_cost_limit = GCTimeLimit/100.0;
|
||||||
|
|
||||||
|
// Which way should we go?
|
||||||
|
// if pause requirement is not met
|
||||||
|
// adjust size of any generation with average paus exceeding
|
||||||
|
// the pause limit. Adjust one pause at a time (the larger)
|
||||||
|
// and only make adjustments for the major pause at full collections.
|
||||||
|
// else if throughput requirement not met
|
||||||
|
// adjust the size of the generation with larger gc time. Only
|
||||||
|
// adjust one generation at a time.
|
||||||
|
// else
|
||||||
|
// adjust down the total heap size. Adjust down the larger of the
|
||||||
|
// generations.
|
||||||
|
|
||||||
|
// Add some checks for a threshold for a change. For example,
|
||||||
|
// a change less than the necessary alignment is probably not worth
|
||||||
|
// attempting.
|
||||||
|
|
||||||
|
|
||||||
|
if ((_avg_minor_pause->padded_average() > gc_pause_goal_sec()) ||
|
||||||
|
(_avg_major_pause->padded_average() > gc_pause_goal_sec())) {
|
||||||
|
//
|
||||||
|
// Check pauses
|
||||||
|
//
|
||||||
|
// Make changes only to affect one of the pauses (the larger)
|
||||||
|
// at a time.
|
||||||
|
adjust_eden_for_pause_time(is_full_gc, &desired_promo_size, &desired_eden_size);
|
||||||
|
|
||||||
|
} else if (_avg_minor_pause->padded_average() > gc_minor_pause_goal_sec()) {
|
||||||
|
// Adjust only for the minor pause time goal
|
||||||
|
adjust_eden_for_minor_pause_time(is_full_gc, &desired_eden_size);
|
||||||
|
|
||||||
|
} else if(adjusted_mutator_cost() < _throughput_goal) {
|
||||||
|
// This branch used to require that (mutator_cost() > 0.0 in 1.4.2.
|
||||||
|
// This sometimes resulted in skipping to the minimize footprint
|
||||||
|
// code. Change this to try and reduce GC time if mutator time is
|
||||||
|
// negative for whatever reason. Or for future consideration,
|
||||||
|
// bail out of the code if mutator time is negative.
|
||||||
|
//
|
||||||
|
// Throughput
|
||||||
|
//
|
||||||
|
assert(major_cost >= 0.0, "major cost is < 0.0");
|
||||||
|
assert(minor_cost >= 0.0, "minor cost is < 0.0");
|
||||||
|
// Try to reduce the GC times.
|
||||||
|
adjust_eden_for_throughput(is_full_gc, &desired_eden_size);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Be conservative about reducing the footprint.
|
||||||
|
// Do a minimum number of major collections first.
|
||||||
|
// Have reasonable averages for major and minor collections costs.
|
||||||
|
if (UseAdaptiveSizePolicyFootprintGoal &&
|
||||||
|
young_gen_policy_is_ready() &&
|
||||||
|
avg_major_gc_cost()->average() >= 0.0 &&
|
||||||
|
avg_minor_gc_cost()->average() >= 0.0) {
|
||||||
|
size_t desired_sum = desired_eden_size + desired_promo_size;
|
||||||
|
desired_eden_size = adjust_eden_for_footprint(desired_eden_size, desired_sum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note we make the same tests as in the code block below; the code
|
||||||
|
// seems a little easier to read with the printing in another block.
|
||||||
|
if (PrintAdaptiveSizePolicy) {
|
||||||
|
if (desired_eden_size > eden_limit) {
|
||||||
|
gclog_or_tty->print_cr(
|
||||||
|
"PSAdaptiveSizePolicy::compute_eden_space_size limits:"
|
||||||
|
" desired_eden_size: " SIZE_FORMAT
|
||||||
|
" old_eden_size: " SIZE_FORMAT
|
||||||
|
" eden_limit: " SIZE_FORMAT
|
||||||
|
" cur_eden: " SIZE_FORMAT
|
||||||
|
" max_eden_size: " SIZE_FORMAT
|
||||||
|
" avg_young_live: " SIZE_FORMAT,
|
||||||
|
desired_eden_size, _eden_size, eden_limit, cur_eden,
|
||||||
|
max_eden_size, (size_t)avg_young_live()->average());
|
||||||
|
}
|
||||||
|
if (gc_cost() > gc_cost_limit) {
|
||||||
|
gclog_or_tty->print_cr(
|
||||||
|
"PSAdaptiveSizePolicy::compute_eden_space_size: gc time limit"
|
||||||
|
" gc_cost: %f "
|
||||||
|
" GCTimeLimit: %d",
|
||||||
|
gc_cost(), GCTimeLimit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Align everything and make a final limit check
|
||||||
|
const size_t alignment = _intra_generation_alignment;
|
||||||
|
desired_eden_size = align_size_up(desired_eden_size, alignment);
|
||||||
|
desired_eden_size = MAX2(desired_eden_size, alignment);
|
||||||
|
|
||||||
|
eden_limit = align_size_down(eden_limit, alignment);
|
||||||
|
|
||||||
|
// And one last limit check, now that we've aligned things.
|
||||||
|
if (desired_eden_size > eden_limit) {
|
||||||
|
// If the policy says to get a larger eden but
|
||||||
|
// is hitting the limit, don't decrease eden.
|
||||||
|
// This can lead to a general drifting down of the
|
||||||
|
// eden size. Let the tenuring calculation push more
|
||||||
|
// into the old gen.
|
||||||
|
desired_eden_size = MAX2(eden_limit, cur_eden);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PrintAdaptiveSizePolicy) {
|
||||||
|
// Timing stats
|
||||||
|
gclog_or_tty->print(
|
||||||
|
"PSAdaptiveSizePolicy::compute_eden_space_size: costs"
|
||||||
|
" minor_time: %f"
|
||||||
|
" major_cost: %f"
|
||||||
|
" mutator_cost: %f"
|
||||||
|
" throughput_goal: %f",
|
||||||
|
minor_gc_cost(), major_gc_cost(), mutator_cost(),
|
||||||
|
_throughput_goal);
|
||||||
|
|
||||||
|
// We give more details if Verbose is set
|
||||||
|
if (Verbose) {
|
||||||
|
gclog_or_tty->print( " minor_pause: %f"
|
||||||
|
" major_pause: %f"
|
||||||
|
" minor_interval: %f"
|
||||||
|
" major_interval: %f"
|
||||||
|
" pause_goal: %f",
|
||||||
|
_avg_minor_pause->padded_average(),
|
||||||
|
_avg_major_pause->padded_average(),
|
||||||
|
_avg_minor_interval->average(),
|
||||||
|
_avg_major_interval->average(),
|
||||||
|
gc_pause_goal_sec());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Footprint stats
|
||||||
|
gclog_or_tty->print( " live_space: " SIZE_FORMAT
|
||||||
|
" free_space: " SIZE_FORMAT,
|
||||||
|
live_space(), free_space());
|
||||||
|
// More detail
|
||||||
|
if (Verbose) {
|
||||||
|
gclog_or_tty->print( " base_footprint: " SIZE_FORMAT
|
||||||
|
" avg_young_live: " SIZE_FORMAT
|
||||||
|
" avg_old_live: " SIZE_FORMAT,
|
||||||
|
(size_t)_avg_base_footprint->average(),
|
||||||
|
(size_t)avg_young_live()->average(),
|
||||||
|
(size_t)avg_old_live()->average());
|
||||||
|
}
|
||||||
|
|
||||||
|
// And finally, our old and new sizes.
|
||||||
|
gclog_or_tty->print(" old_eden_size: " SIZE_FORMAT
|
||||||
|
" desired_eden_size: " SIZE_FORMAT,
|
||||||
|
_eden_size, desired_eden_size);
|
||||||
|
gclog_or_tty->cr();
|
||||||
|
}
|
||||||
|
|
||||||
|
set_eden_size(desired_eden_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PSAdaptiveSizePolicy::compute_old_gen_free_space(
|
||||||
|
size_t old_live,
|
||||||
|
size_t cur_eden,
|
||||||
|
size_t max_old_gen_size,
|
||||||
|
bool is_full_gc) {
|
||||||
|
|
||||||
|
// Update statistics
|
||||||
|
// Time statistics are updated as we go, update footprint stats here
|
||||||
if (is_full_gc) {
|
if (is_full_gc) {
|
||||||
// old_live is only accurate after a full gc
|
// old_live is only accurate after a full gc
|
||||||
avg_old_live()->sample(old_live);
|
avg_old_live()->sample(old_live);
|
||||||
@ -242,32 +459,14 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
// some case but is dangerous.
|
// some case but is dangerous.
|
||||||
size_t desired_eden_size = cur_eden;
|
size_t desired_eden_size = cur_eden;
|
||||||
|
|
||||||
#ifdef ASSERT
|
|
||||||
size_t original_promo_size = desired_promo_size;
|
|
||||||
size_t original_eden_size = desired_eden_size;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Cache some values. There's a bit of work getting these, so
|
// Cache some values. There's a bit of work getting these, so
|
||||||
// we might save a little time.
|
// we might save a little time.
|
||||||
const double major_cost = major_gc_cost();
|
const double major_cost = major_gc_cost();
|
||||||
const double minor_cost = minor_gc_cost();
|
const double minor_cost = minor_gc_cost();
|
||||||
|
|
||||||
// Used for diagnostics
|
|
||||||
clear_generation_free_space_flags();
|
|
||||||
|
|
||||||
// Limits on our growth
|
// Limits on our growth
|
||||||
size_t promo_limit = (size_t)(max_old_gen_size - avg_old_live()->average());
|
size_t promo_limit = (size_t)(max_old_gen_size - avg_old_live()->average());
|
||||||
|
|
||||||
// This method sets the desired eden size. That plus the
|
|
||||||
// desired survivor space sizes sets the desired young generation
|
|
||||||
// size. This methods does not know what the desired survivor
|
|
||||||
// size is but expects that other policy will attempt to make
|
|
||||||
// the survivor sizes compatible with the live data in the
|
|
||||||
// young generation. This limit is an estimate of the space left
|
|
||||||
// in the young generation after the survivor spaces have been
|
|
||||||
// subtracted out.
|
|
||||||
size_t eden_limit = max_eden_size;
|
|
||||||
|
|
||||||
// But don't force a promo size below the current promo size. Otherwise,
|
// But don't force a promo size below the current promo size. Otherwise,
|
||||||
// the promo size will shrink for no good reason.
|
// the promo size will shrink for no good reason.
|
||||||
promo_limit = MAX2(promo_limit, _promo_size);
|
promo_limit = MAX2(promo_limit, _promo_size);
|
||||||
@ -290,7 +489,6 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
// a change less than the necessary alignment is probably not worth
|
// a change less than the necessary alignment is probably not worth
|
||||||
// attempting.
|
// attempting.
|
||||||
|
|
||||||
|
|
||||||
if ((_avg_minor_pause->padded_average() > gc_pause_goal_sec()) ||
|
if ((_avg_minor_pause->padded_average() > gc_pause_goal_sec()) ||
|
||||||
(_avg_major_pause->padded_average() > gc_pause_goal_sec())) {
|
(_avg_major_pause->padded_average() > gc_pause_goal_sec())) {
|
||||||
//
|
//
|
||||||
@ -298,12 +496,13 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
//
|
//
|
||||||
// Make changes only to affect one of the pauses (the larger)
|
// Make changes only to affect one of the pauses (the larger)
|
||||||
// at a time.
|
// at a time.
|
||||||
adjust_for_pause_time(is_full_gc, &desired_promo_size, &desired_eden_size);
|
if (is_full_gc) {
|
||||||
|
set_decide_at_full_gc(decide_at_full_gc_true);
|
||||||
|
adjust_promo_for_pause_time(is_full_gc, &desired_promo_size, &desired_eden_size);
|
||||||
|
}
|
||||||
} else if (_avg_minor_pause->padded_average() > gc_minor_pause_goal_sec()) {
|
} else if (_avg_minor_pause->padded_average() > gc_minor_pause_goal_sec()) {
|
||||||
// Adjust only for the minor pause time goal
|
// Adjust only for the minor pause time goal
|
||||||
adjust_for_minor_pause_time(is_full_gc, &desired_promo_size, &desired_eden_size);
|
adjust_promo_for_minor_pause_time(is_full_gc, &desired_promo_size, &desired_eden_size);
|
||||||
|
|
||||||
} else if(adjusted_mutator_cost() < _throughput_goal) {
|
} else if(adjusted_mutator_cost() < _throughput_goal) {
|
||||||
// This branch used to require that (mutator_cost() > 0.0 in 1.4.2.
|
// This branch used to require that (mutator_cost() > 0.0 in 1.4.2.
|
||||||
// This sometimes resulted in skipping to the minimize footprint
|
// This sometimes resulted in skipping to the minimize footprint
|
||||||
@ -316,8 +515,10 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
assert(major_cost >= 0.0, "major cost is < 0.0");
|
assert(major_cost >= 0.0, "major cost is < 0.0");
|
||||||
assert(minor_cost >= 0.0, "minor cost is < 0.0");
|
assert(minor_cost >= 0.0, "minor cost is < 0.0");
|
||||||
// Try to reduce the GC times.
|
// Try to reduce the GC times.
|
||||||
adjust_for_throughput(is_full_gc, &desired_promo_size, &desired_eden_size);
|
if (is_full_gc) {
|
||||||
|
set_decide_at_full_gc(decide_at_full_gc_true);
|
||||||
|
adjust_promo_for_throughput(is_full_gc, &desired_promo_size);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Be conservative about reducing the footprint.
|
// Be conservative about reducing the footprint.
|
||||||
@ -327,13 +528,10 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
young_gen_policy_is_ready() &&
|
young_gen_policy_is_ready() &&
|
||||||
avg_major_gc_cost()->average() >= 0.0 &&
|
avg_major_gc_cost()->average() >= 0.0 &&
|
||||||
avg_minor_gc_cost()->average() >= 0.0) {
|
avg_minor_gc_cost()->average() >= 0.0) {
|
||||||
size_t desired_sum = desired_eden_size + desired_promo_size;
|
|
||||||
desired_eden_size = adjust_eden_for_footprint(desired_eden_size,
|
|
||||||
desired_sum);
|
|
||||||
if (is_full_gc) {
|
if (is_full_gc) {
|
||||||
set_decide_at_full_gc(decide_at_full_gc_true);
|
set_decide_at_full_gc(decide_at_full_gc_true);
|
||||||
desired_promo_size = adjust_promo_for_footprint(desired_promo_size,
|
size_t desired_sum = desired_eden_size + desired_promo_size;
|
||||||
desired_sum);
|
desired_promo_size = adjust_promo_for_footprint(desired_promo_size, desired_sum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,7 +543,7 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
// "free_in_old_gen" was the original value for used for promo_limit
|
// "free_in_old_gen" was the original value for used for promo_limit
|
||||||
size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average());
|
size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average());
|
||||||
gclog_or_tty->print_cr(
|
gclog_or_tty->print_cr(
|
||||||
"PSAdaptiveSizePolicy::compute_generation_free_space limits:"
|
"PSAdaptiveSizePolicy::compute_old_gen_free_space limits:"
|
||||||
" desired_promo_size: " SIZE_FORMAT
|
" desired_promo_size: " SIZE_FORMAT
|
||||||
" promo_limit: " SIZE_FORMAT
|
" promo_limit: " SIZE_FORMAT
|
||||||
" free_in_old_gen: " SIZE_FORMAT
|
" free_in_old_gen: " SIZE_FORMAT
|
||||||
@ -354,21 +552,9 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
desired_promo_size, promo_limit, free_in_old_gen,
|
desired_promo_size, promo_limit, free_in_old_gen,
|
||||||
max_old_gen_size, (size_t) avg_old_live()->average());
|
max_old_gen_size, (size_t) avg_old_live()->average());
|
||||||
}
|
}
|
||||||
if (desired_eden_size > eden_limit) {
|
|
||||||
gclog_or_tty->print_cr(
|
|
||||||
"AdaptiveSizePolicy::compute_generation_free_space limits:"
|
|
||||||
" desired_eden_size: " SIZE_FORMAT
|
|
||||||
" old_eden_size: " SIZE_FORMAT
|
|
||||||
" eden_limit: " SIZE_FORMAT
|
|
||||||
" cur_eden: " SIZE_FORMAT
|
|
||||||
" max_eden_size: " SIZE_FORMAT
|
|
||||||
" avg_young_live: " SIZE_FORMAT,
|
|
||||||
desired_eden_size, _eden_size, eden_limit, cur_eden,
|
|
||||||
max_eden_size, (size_t)avg_young_live()->average());
|
|
||||||
}
|
|
||||||
if (gc_cost() > gc_cost_limit) {
|
if (gc_cost() > gc_cost_limit) {
|
||||||
gclog_or_tty->print_cr(
|
gclog_or_tty->print_cr(
|
||||||
"AdaptiveSizePolicy::compute_generation_free_space: gc time limit"
|
"PSAdaptiveSizePolicy::compute_old_gen_free_space: gc time limit"
|
||||||
" gc_cost: %f "
|
" gc_cost: %f "
|
||||||
" GCTimeLimit: %d",
|
" GCTimeLimit: %d",
|
||||||
gc_cost(), GCTimeLimit);
|
gc_cost(), GCTimeLimit);
|
||||||
@ -377,46 +563,18 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
|
|
||||||
// Align everything and make a final limit check
|
// Align everything and make a final limit check
|
||||||
const size_t alignment = _intra_generation_alignment;
|
const size_t alignment = _intra_generation_alignment;
|
||||||
desired_eden_size = align_size_up(desired_eden_size, alignment);
|
|
||||||
desired_eden_size = MAX2(desired_eden_size, alignment);
|
|
||||||
desired_promo_size = align_size_up(desired_promo_size, alignment);
|
desired_promo_size = align_size_up(desired_promo_size, alignment);
|
||||||
desired_promo_size = MAX2(desired_promo_size, alignment);
|
desired_promo_size = MAX2(desired_promo_size, alignment);
|
||||||
|
|
||||||
eden_limit = align_size_down(eden_limit, alignment);
|
|
||||||
promo_limit = align_size_down(promo_limit, alignment);
|
promo_limit = align_size_down(promo_limit, alignment);
|
||||||
|
|
||||||
// Is too much time being spent in GC?
|
|
||||||
// Is the heap trying to grow beyond it's limits?
|
|
||||||
|
|
||||||
const size_t free_in_old_gen =
|
|
||||||
(size_t)(max_old_gen_size - avg_old_live()->average());
|
|
||||||
if (desired_promo_size > free_in_old_gen && desired_eden_size > eden_limit) {
|
|
||||||
check_gc_overhead_limit(young_live,
|
|
||||||
eden_live,
|
|
||||||
max_old_gen_size,
|
|
||||||
max_eden_size,
|
|
||||||
is_full_gc,
|
|
||||||
gc_cause,
|
|
||||||
collector_policy);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// And one last limit check, now that we've aligned things.
|
// And one last limit check, now that we've aligned things.
|
||||||
if (desired_eden_size > eden_limit) {
|
|
||||||
// If the policy says to get a larger eden but
|
|
||||||
// is hitting the limit, don't decrease eden.
|
|
||||||
// This can lead to a general drifting down of the
|
|
||||||
// eden size. Let the tenuring calculation push more
|
|
||||||
// into the old gen.
|
|
||||||
desired_eden_size = MAX2(eden_limit, cur_eden);
|
|
||||||
}
|
|
||||||
desired_promo_size = MIN2(desired_promo_size, promo_limit);
|
desired_promo_size = MIN2(desired_promo_size, promo_limit);
|
||||||
|
|
||||||
|
|
||||||
if (PrintAdaptiveSizePolicy) {
|
if (PrintAdaptiveSizePolicy) {
|
||||||
// Timing stats
|
// Timing stats
|
||||||
gclog_or_tty->print(
|
gclog_or_tty->print(
|
||||||
"PSAdaptiveSizePolicy::compute_generation_free_space: costs"
|
"PSAdaptiveSizePolicy::compute_old_gen_free_space: costs"
|
||||||
" minor_time: %f"
|
" minor_time: %f"
|
||||||
" major_cost: %f"
|
" major_cost: %f"
|
||||||
" mutator_cost: %f"
|
" mutator_cost: %f"
|
||||||
@ -454,19 +612,13 @@ void PSAdaptiveSizePolicy::compute_generation_free_space(
|
|||||||
|
|
||||||
// And finally, our old and new sizes.
|
// And finally, our old and new sizes.
|
||||||
gclog_or_tty->print(" old_promo_size: " SIZE_FORMAT
|
gclog_or_tty->print(" old_promo_size: " SIZE_FORMAT
|
||||||
" old_eden_size: " SIZE_FORMAT
|
" desired_promo_size: " SIZE_FORMAT,
|
||||||
" desired_promo_size: " SIZE_FORMAT
|
_promo_size, desired_promo_size);
|
||||||
" desired_eden_size: " SIZE_FORMAT,
|
|
||||||
_promo_size, _eden_size,
|
|
||||||
desired_promo_size, desired_eden_size);
|
|
||||||
gclog_or_tty->cr();
|
gclog_or_tty->cr();
|
||||||
}
|
}
|
||||||
|
|
||||||
decay_supplemental_growth(is_full_gc);
|
|
||||||
|
|
||||||
set_promo_size(desired_promo_size);
|
set_promo_size(desired_promo_size);
|
||||||
set_eden_size(desired_eden_size);
|
}
|
||||||
};
|
|
||||||
|
|
||||||
void PSAdaptiveSizePolicy::decay_supplemental_growth(bool is_full_gc) {
|
void PSAdaptiveSizePolicy::decay_supplemental_growth(bool is_full_gc) {
|
||||||
// Decay the supplemental increment? Decay the supplement growth
|
// Decay the supplemental increment? Decay the supplement growth
|
||||||
@ -490,9 +642,39 @@ void PSAdaptiveSizePolicy::decay_supplemental_growth(bool is_full_gc) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSAdaptiveSizePolicy::adjust_for_minor_pause_time(bool is_full_gc,
|
void PSAdaptiveSizePolicy::adjust_promo_for_minor_pause_time(bool is_full_gc,
|
||||||
size_t* desired_promo_size_ptr, size_t* desired_eden_size_ptr) {
|
size_t* desired_promo_size_ptr, size_t* desired_eden_size_ptr) {
|
||||||
|
|
||||||
|
if (PSAdjustTenuredGenForMinorPause) {
|
||||||
|
if (is_full_gc) {
|
||||||
|
set_decide_at_full_gc(decide_at_full_gc_true);
|
||||||
|
}
|
||||||
|
// If the desired eden size is as small as it will get,
|
||||||
|
// try to adjust the old gen size.
|
||||||
|
if (*desired_eden_size_ptr <= _intra_generation_alignment) {
|
||||||
|
// Vary the old gen size to reduce the young gen pause. This
|
||||||
|
// may not be a good idea. This is just a test.
|
||||||
|
if (minor_pause_old_estimator()->decrement_will_decrease()) {
|
||||||
|
set_change_old_gen_for_min_pauses(decrease_old_gen_for_min_pauses_true);
|
||||||
|
*desired_promo_size_ptr =
|
||||||
|
_promo_size - promo_decrement_aligned_down(*desired_promo_size_ptr);
|
||||||
|
} else {
|
||||||
|
set_change_old_gen_for_min_pauses(increase_old_gen_for_min_pauses_true);
|
||||||
|
size_t promo_heap_delta =
|
||||||
|
promo_increment_with_supplement_aligned_up(*desired_promo_size_ptr);
|
||||||
|
if ((*desired_promo_size_ptr + promo_heap_delta) >
|
||||||
|
*desired_promo_size_ptr) {
|
||||||
|
*desired_promo_size_ptr =
|
||||||
|
_promo_size + promo_heap_delta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PSAdaptiveSizePolicy::adjust_eden_for_minor_pause_time(bool is_full_gc,
|
||||||
|
size_t* desired_eden_size_ptr) {
|
||||||
|
|
||||||
// Adjust the young generation size to reduce pause time of
|
// Adjust the young generation size to reduce pause time of
|
||||||
// of collections.
|
// of collections.
|
||||||
//
|
//
|
||||||
@ -512,49 +694,19 @@ void PSAdaptiveSizePolicy::adjust_for_minor_pause_time(bool is_full_gc,
|
|||||||
set_change_young_gen_for_min_pauses(
|
set_change_young_gen_for_min_pauses(
|
||||||
increase_young_gen_for_min_pauses_true);
|
increase_young_gen_for_min_pauses_true);
|
||||||
}
|
}
|
||||||
if (PSAdjustTenuredGenForMinorPause) {
|
|
||||||
// If the desired eden size is as small as it will get,
|
|
||||||
// try to adjust the old gen size.
|
|
||||||
if (*desired_eden_size_ptr <= _intra_generation_alignment) {
|
|
||||||
// Vary the old gen size to reduce the young gen pause. This
|
|
||||||
// may not be a good idea. This is just a test.
|
|
||||||
if (minor_pause_old_estimator()->decrement_will_decrease()) {
|
|
||||||
set_change_old_gen_for_min_pauses(
|
|
||||||
decrease_old_gen_for_min_pauses_true);
|
|
||||||
*desired_promo_size_ptr =
|
|
||||||
_promo_size - promo_decrement_aligned_down(*desired_promo_size_ptr);
|
|
||||||
} else {
|
|
||||||
set_change_old_gen_for_min_pauses(
|
|
||||||
increase_old_gen_for_min_pauses_true);
|
|
||||||
size_t promo_heap_delta =
|
|
||||||
promo_increment_with_supplement_aligned_up(*desired_promo_size_ptr);
|
|
||||||
if ((*desired_promo_size_ptr + promo_heap_delta) >
|
|
||||||
*desired_promo_size_ptr) {
|
|
||||||
*desired_promo_size_ptr =
|
|
||||||
_promo_size + promo_heap_delta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSAdaptiveSizePolicy::adjust_for_pause_time(bool is_full_gc,
|
void PSAdaptiveSizePolicy::adjust_promo_for_pause_time(bool is_full_gc,
|
||||||
size_t* desired_promo_size_ptr,
|
size_t* desired_promo_size_ptr,
|
||||||
size_t* desired_eden_size_ptr) {
|
size_t* desired_eden_size_ptr) {
|
||||||
|
|
||||||
size_t promo_heap_delta = 0;
|
size_t promo_heap_delta = 0;
|
||||||
size_t eden_heap_delta = 0;
|
// Add some checks for a threshold for a change. For example,
|
||||||
// Add some checks for a threshhold for a change. For example,
|
|
||||||
// a change less than the required alignment is probably not worth
|
// a change less than the required alignment is probably not worth
|
||||||
// attempting.
|
// attempting.
|
||||||
if (is_full_gc) {
|
|
||||||
set_decide_at_full_gc(decide_at_full_gc_true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_avg_minor_pause->padded_average() > _avg_major_pause->padded_average()) {
|
if (_avg_minor_pause->padded_average() > _avg_major_pause->padded_average()) {
|
||||||
adjust_for_minor_pause_time(is_full_gc,
|
adjust_promo_for_minor_pause_time(is_full_gc, desired_promo_size_ptr, desired_eden_size_ptr);
|
||||||
desired_promo_size_ptr,
|
|
||||||
desired_eden_size_ptr);
|
|
||||||
// major pause adjustments
|
// major pause adjustments
|
||||||
} else if (is_full_gc) {
|
} else if (is_full_gc) {
|
||||||
// Adjust for the major pause time only at full gc's because the
|
// Adjust for the major pause time only at full gc's because the
|
||||||
@ -573,6 +725,33 @@ void PSAdaptiveSizePolicy::adjust_for_pause_time(bool is_full_gc,
|
|||||||
// promo_increment_aligned_up(*desired_promo_size_ptr);
|
// promo_increment_aligned_up(*desired_promo_size_ptr);
|
||||||
set_change_old_gen_for_maj_pauses(increase_old_gen_for_maj_pauses_true);
|
set_change_old_gen_for_maj_pauses(increase_old_gen_for_maj_pauses_true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PrintAdaptiveSizePolicy && Verbose) {
|
||||||
|
gclog_or_tty->print_cr(
|
||||||
|
"PSAdaptiveSizePolicy::compute_old_gen_free_space "
|
||||||
|
"adjusting gen sizes for major pause (avg %f goal %f). "
|
||||||
|
"desired_promo_size " SIZE_FORMAT " promo delta " SIZE_FORMAT,
|
||||||
|
_avg_major_pause->average(), gc_pause_goal_sec(),
|
||||||
|
*desired_promo_size_ptr, promo_heap_delta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PSAdaptiveSizePolicy::adjust_eden_for_pause_time(bool is_full_gc,
|
||||||
|
size_t* desired_promo_size_ptr,
|
||||||
|
size_t* desired_eden_size_ptr) {
|
||||||
|
|
||||||
|
size_t eden_heap_delta = 0;
|
||||||
|
// Add some checks for a threshold for a change. For example,
|
||||||
|
// a change less than the required alignment is probably not worth
|
||||||
|
// attempting.
|
||||||
|
if (_avg_minor_pause->padded_average() > _avg_major_pause->padded_average()) {
|
||||||
|
adjust_eden_for_minor_pause_time(is_full_gc,
|
||||||
|
desired_eden_size_ptr);
|
||||||
|
// major pause adjustments
|
||||||
|
} else if (is_full_gc) {
|
||||||
|
// Adjust for the major pause time only at full gc's because the
|
||||||
|
// affects of a change can only be seen at full gc's.
|
||||||
if (PSAdjustYoungGenForMajorPause) {
|
if (PSAdjustYoungGenForMajorPause) {
|
||||||
// If the promo size is at the minimum (i.e., the old gen
|
// If the promo size is at the minimum (i.e., the old gen
|
||||||
// size will not actually decrease), consider changing the
|
// size will not actually decrease), consider changing the
|
||||||
@ -607,43 +786,35 @@ void PSAdaptiveSizePolicy::adjust_for_pause_time(bool is_full_gc,
|
|||||||
|
|
||||||
if (PrintAdaptiveSizePolicy && Verbose) {
|
if (PrintAdaptiveSizePolicy && Verbose) {
|
||||||
gclog_or_tty->print_cr(
|
gclog_or_tty->print_cr(
|
||||||
"AdaptiveSizePolicy::compute_generation_free_space "
|
"PSAdaptiveSizePolicy::compute_eden_space_size "
|
||||||
"adjusting gen sizes for major pause (avg %f goal %f). "
|
"adjusting gen sizes for major pause (avg %f goal %f). "
|
||||||
"desired_promo_size " SIZE_FORMAT "desired_eden_size "
|
"desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT,
|
||||||
SIZE_FORMAT
|
|
||||||
" promo delta " SIZE_FORMAT " eden delta " SIZE_FORMAT,
|
|
||||||
_avg_major_pause->average(), gc_pause_goal_sec(),
|
_avg_major_pause->average(), gc_pause_goal_sec(),
|
||||||
*desired_promo_size_ptr, *desired_eden_size_ptr,
|
*desired_eden_size_ptr, eden_heap_delta);
|
||||||
promo_heap_delta, eden_heap_delta);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSAdaptiveSizePolicy::adjust_for_throughput(bool is_full_gc,
|
void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc,
|
||||||
size_t* desired_promo_size_ptr,
|
size_t* desired_promo_size_ptr) {
|
||||||
size_t* desired_eden_size_ptr) {
|
|
||||||
|
|
||||||
// Add some checks for a threshhold for a change. For example,
|
// Add some checks for a threshold for a change. For example,
|
||||||
// a change less than the required alignment is probably not worth
|
// a change less than the required alignment is probably not worth
|
||||||
// attempting.
|
// attempting.
|
||||||
if (is_full_gc) {
|
|
||||||
set_decide_at_full_gc(decide_at_full_gc_true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((gc_cost() + mutator_cost()) == 0.0) {
|
if ((gc_cost() + mutator_cost()) == 0.0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrintAdaptiveSizePolicy && Verbose) {
|
if (PrintAdaptiveSizePolicy && Verbose) {
|
||||||
gclog_or_tty->print("\nPSAdaptiveSizePolicy::adjust_for_throughput("
|
gclog_or_tty->print("\nPSAdaptiveSizePolicy::adjust_promo_for_throughput("
|
||||||
"is_full: %d, promo: " SIZE_FORMAT ", cur_eden: " SIZE_FORMAT "): ",
|
"is_full: %d, promo: " SIZE_FORMAT "): ",
|
||||||
is_full_gc, *desired_promo_size_ptr, *desired_eden_size_ptr);
|
is_full_gc, *desired_promo_size_ptr);
|
||||||
gclog_or_tty->print_cr("mutator_cost %f major_gc_cost %f "
|
gclog_or_tty->print_cr("mutator_cost %f major_gc_cost %f "
|
||||||
"minor_gc_cost %f", mutator_cost(), major_gc_cost(), minor_gc_cost());
|
"minor_gc_cost %f", mutator_cost(), major_gc_cost(), minor_gc_cost());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tenured generation
|
// Tenured generation
|
||||||
if (is_full_gc) {
|
if (is_full_gc) {
|
||||||
|
|
||||||
// Calculate the change to use for the tenured gen.
|
// Calculate the change to use for the tenured gen.
|
||||||
size_t scaled_promo_heap_delta = 0;
|
size_t scaled_promo_heap_delta = 0;
|
||||||
// Can the increment to the generation be scaled?
|
// Can the increment to the generation be scaled?
|
||||||
@ -720,6 +891,26 @@ void PSAdaptiveSizePolicy::adjust_for_throughput(bool is_full_gc,
|
|||||||
*desired_promo_size_ptr, scaled_promo_heap_delta);
|
*desired_promo_size_ptr, scaled_promo_heap_delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc,
|
||||||
|
size_t* desired_eden_size_ptr) {
|
||||||
|
|
||||||
|
// Add some checks for a threshold for a change. For example,
|
||||||
|
// a change less than the required alignment is probably not worth
|
||||||
|
// attempting.
|
||||||
|
|
||||||
|
if ((gc_cost() + mutator_cost()) == 0.0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PrintAdaptiveSizePolicy && Verbose) {
|
||||||
|
gclog_or_tty->print("\nPSAdaptiveSizePolicy::adjust_eden_for_throughput("
|
||||||
|
"is_full: %d, cur_eden: " SIZE_FORMAT "): ",
|
||||||
|
is_full_gc, *desired_eden_size_ptr);
|
||||||
|
gclog_or_tty->print_cr("mutator_cost %f major_gc_cost %f "
|
||||||
|
"minor_gc_cost %f", mutator_cost(), major_gc_cost(), minor_gc_cost());
|
||||||
|
}
|
||||||
|
|
||||||
// Young generation
|
// Young generation
|
||||||
size_t scaled_eden_heap_delta = 0;
|
size_t scaled_eden_heap_delta = 0;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -136,18 +136,24 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
|
|||||||
double gc_minor_pause_goal_sec() const { return _gc_minor_pause_goal_sec; }
|
double gc_minor_pause_goal_sec() const { return _gc_minor_pause_goal_sec; }
|
||||||
|
|
||||||
// Change the young generation size to achieve a minor GC pause time goal
|
// Change the young generation size to achieve a minor GC pause time goal
|
||||||
void adjust_for_minor_pause_time(bool is_full_gc,
|
void adjust_promo_for_minor_pause_time(bool is_full_gc,
|
||||||
size_t* desired_promo_size_ptr,
|
size_t* desired_promo_size_ptr,
|
||||||
size_t* desired_eden_size_ptr);
|
size_t* desired_eden_size_ptr);
|
||||||
|
void adjust_eden_for_minor_pause_time(bool is_full_gc,
|
||||||
|
size_t* desired_eden_size_ptr);
|
||||||
// Change the generation sizes to achieve a GC pause time goal
|
// Change the generation sizes to achieve a GC pause time goal
|
||||||
// Returned sizes are not necessarily aligned.
|
// Returned sizes are not necessarily aligned.
|
||||||
void adjust_for_pause_time(bool is_full_gc,
|
void adjust_promo_for_pause_time(bool is_full_gc,
|
||||||
|
size_t* desired_promo_size_ptr,
|
||||||
|
size_t* desired_eden_size_ptr);
|
||||||
|
void adjust_eden_for_pause_time(bool is_full_gc,
|
||||||
size_t* desired_promo_size_ptr,
|
size_t* desired_promo_size_ptr,
|
||||||
size_t* desired_eden_size_ptr);
|
size_t* desired_eden_size_ptr);
|
||||||
// Change the generation sizes to achieve an application throughput goal
|
// Change the generation sizes to achieve an application throughput goal
|
||||||
// Returned sizes are not necessarily aligned.
|
// Returned sizes are not necessarily aligned.
|
||||||
void adjust_for_throughput(bool is_full_gc,
|
void adjust_promo_for_throughput(bool is_full_gc,
|
||||||
size_t* desired_promo_size_ptr,
|
size_t* desired_promo_size_ptr);
|
||||||
|
void adjust_eden_for_throughput(bool is_full_gc,
|
||||||
size_t* desired_eden_size_ptr);
|
size_t* desired_eden_size_ptr);
|
||||||
// Change the generation sizes to achieve minimum footprint
|
// Change the generation sizes to achieve minimum footprint
|
||||||
// Returned sizes are not aligned.
|
// Returned sizes are not aligned.
|
||||||
@ -168,9 +174,6 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
|
|||||||
size_t promo_decrement_aligned_down(size_t cur_promo);
|
size_t promo_decrement_aligned_down(size_t cur_promo);
|
||||||
size_t promo_increment_with_supplement_aligned_up(size_t cur_promo);
|
size_t promo_increment_with_supplement_aligned_up(size_t cur_promo);
|
||||||
|
|
||||||
// Decay the supplemental growth additive.
|
|
||||||
void decay_supplemental_growth(bool is_full_gc);
|
|
||||||
|
|
||||||
// Returns a change that has been scaled down. Result
|
// Returns a change that has been scaled down. Result
|
||||||
// is not aligned. (If useful, move to some shared
|
// is not aligned. (If useful, move to some shared
|
||||||
// location.)
|
// location.)
|
||||||
@ -336,7 +339,7 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
|
|||||||
// perform a Full GC?
|
// perform a Full GC?
|
||||||
bool should_full_GC(size_t live_in_old_gen);
|
bool should_full_GC(size_t live_in_old_gen);
|
||||||
|
|
||||||
// Calculates optimial free space sizes for both the old and young
|
// Calculates optimal (free) space sizes for both the young and old
|
||||||
// generations. Stores results in _eden_size and _promo_size.
|
// generations. Stores results in _eden_size and _promo_size.
|
||||||
// Takes current used space in all generations as input, as well
|
// Takes current used space in all generations as input, as well
|
||||||
// as an indication if a full gc has just been performed, for use
|
// as an indication if a full gc has just been performed, for use
|
||||||
@ -347,9 +350,18 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
|
|||||||
size_t cur_eden, // current eden in bytes
|
size_t cur_eden, // current eden in bytes
|
||||||
size_t max_old_gen_size,
|
size_t max_old_gen_size,
|
||||||
size_t max_eden_size,
|
size_t max_eden_size,
|
||||||
bool is_full_gc,
|
bool is_full_gc);
|
||||||
GCCause::Cause gc_cause,
|
|
||||||
CollectorPolicy* collector_policy);
|
void compute_eden_space_size(size_t young_live,
|
||||||
|
size_t eden_live,
|
||||||
|
size_t cur_eden, // current eden in bytes
|
||||||
|
size_t max_eden_size,
|
||||||
|
bool is_full_gc);
|
||||||
|
|
||||||
|
void compute_old_gen_free_space(size_t old_live,
|
||||||
|
size_t cur_eden, // current eden in bytes
|
||||||
|
size_t max_old_gen_size,
|
||||||
|
bool is_full_gc);
|
||||||
|
|
||||||
// Calculates new survivor space size; returns a new tenuring threshold
|
// Calculates new survivor space size; returns a new tenuring threshold
|
||||||
// value. Stores new survivor size in _survivor_size.
|
// value. Stores new survivor size in _survivor_size.
|
||||||
@ -390,6 +402,9 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
|
|||||||
|
|
||||||
// Printing support
|
// Printing support
|
||||||
virtual bool print_adaptive_size_policy_on(outputStream* st) const;
|
virtual bool print_adaptive_size_policy_on(outputStream* st) const;
|
||||||
|
|
||||||
|
// Decay the supplemental growth additive.
|
||||||
|
void decay_supplemental_growth(bool is_full_gc);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP
|
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -187,11 +187,8 @@ void ParCompactionManager::follow_marking_stacks() {
|
|||||||
|
|
||||||
// Process ObjArrays one at a time to avoid marking stack bloat.
|
// Process ObjArrays one at a time to avoid marking stack bloat.
|
||||||
ObjArrayTask task;
|
ObjArrayTask task;
|
||||||
if (_objarray_stack.pop_overflow(task)) {
|
if (_objarray_stack.pop_overflow(task) || _objarray_stack.pop_local(task)) {
|
||||||
ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
|
ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass();
|
||||||
k->oop_follow_contents(this, task.obj(), task.index());
|
|
||||||
} else if (_objarray_stack.pop_local(task)) {
|
|
||||||
ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
|
|
||||||
k->oop_follow_contents(this, task.obj(), task.index());
|
k->oop_follow_contents(this, task.obj(), task.index());
|
||||||
}
|
}
|
||||||
} while (!marking_stacks_empty());
|
} while (!marking_stacks_empty());
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -92,8 +92,8 @@ void PSMarkSweep::invoke(bool maximum_heap_compaction) {
|
|||||||
const bool clear_all_soft_refs =
|
const bool clear_all_soft_refs =
|
||||||
heap->collector_policy()->should_clear_all_soft_refs();
|
heap->collector_policy()->should_clear_all_soft_refs();
|
||||||
|
|
||||||
int count = (maximum_heap_compaction)?1:MarkSweepAlwaysCompactCount;
|
uint count = maximum_heap_compaction ? 1 : MarkSweepAlwaysCompactCount;
|
||||||
IntFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count);
|
UIntFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count);
|
||||||
PSMarkSweep::invoke_no_policy(clear_all_soft_refs || maximum_heap_compaction);
|
PSMarkSweep::invoke_no_policy(clear_all_soft_refs || maximum_heap_compaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,18 +277,36 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
|
|||||||
young_gen->from_space()->capacity_in_bytes() +
|
young_gen->from_space()->capacity_in_bytes() +
|
||||||
young_gen->to_space()->capacity_in_bytes(),
|
young_gen->to_space()->capacity_in_bytes(),
|
||||||
"Sizes of space in young gen are out-of-bounds");
|
"Sizes of space in young gen are out-of-bounds");
|
||||||
|
|
||||||
|
size_t young_live = young_gen->used_in_bytes();
|
||||||
|
size_t eden_live = young_gen->eden_space()->used_in_bytes();
|
||||||
|
size_t old_live = old_gen->used_in_bytes();
|
||||||
|
size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
|
||||||
|
size_t max_old_gen_size = old_gen->max_gen_size();
|
||||||
size_t max_eden_size = young_gen->max_size() -
|
size_t max_eden_size = young_gen->max_size() -
|
||||||
young_gen->from_space()->capacity_in_bytes() -
|
young_gen->from_space()->capacity_in_bytes() -
|
||||||
young_gen->to_space()->capacity_in_bytes();
|
young_gen->to_space()->capacity_in_bytes();
|
||||||
size_policy->compute_generation_free_space(young_gen->used_in_bytes(),
|
|
||||||
young_gen->eden_space()->used_in_bytes(),
|
// Used for diagnostics
|
||||||
old_gen->used_in_bytes(),
|
size_policy->clear_generation_free_space_flags();
|
||||||
young_gen->eden_space()->capacity_in_bytes(),
|
|
||||||
old_gen->max_gen_size(),
|
size_policy->compute_generation_free_space(young_live,
|
||||||
max_eden_size,
|
eden_live,
|
||||||
true /* full gc*/,
|
old_live,
|
||||||
gc_cause,
|
cur_eden,
|
||||||
heap->collector_policy());
|
max_old_gen_size,
|
||||||
|
max_eden_size,
|
||||||
|
true /* full gc*/);
|
||||||
|
|
||||||
|
size_policy->check_gc_overhead_limit(young_live,
|
||||||
|
eden_live,
|
||||||
|
max_old_gen_size,
|
||||||
|
max_eden_size,
|
||||||
|
true /* full gc*/,
|
||||||
|
gc_cause,
|
||||||
|
heap->collector_policy());
|
||||||
|
|
||||||
|
size_policy->decay_supplemental_growth(true /* full gc*/);
|
||||||
|
|
||||||
heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
|
heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
|
||||||
|
|
||||||
|
@ -88,8 +88,7 @@ void PSMarkSweepDecorator::precompact() {
|
|||||||
* by the MarkSweepAlwaysCompactCount parameter. This is a significant
|
* by the MarkSweepAlwaysCompactCount parameter. This is a significant
|
||||||
* performance improvement!
|
* performance improvement!
|
||||||
*/
|
*/
|
||||||
bool skip_dead = (MarkSweepAlwaysCompactCount < 1)
|
bool skip_dead = ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0);
|
||||||
|| ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0);
|
|
||||||
|
|
||||||
size_t allowed_deadspace = 0;
|
size_t allowed_deadspace = 0;
|
||||||
if (skip_dead) {
|
if (skip_dead) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -948,7 +948,6 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values)
|
|||||||
|
|
||||||
pre_gc_values->fill(heap);
|
pre_gc_values->fill(heap);
|
||||||
|
|
||||||
NOT_PRODUCT(_mark_bitmap.reset_counters());
|
|
||||||
DEBUG_ONLY(add_obj_count = add_obj_size = 0;)
|
DEBUG_ONLY(add_obj_count = add_obj_size = 0;)
|
||||||
DEBUG_ONLY(mark_bitmap_count = mark_bitmap_size = 0;)
|
DEBUG_ONLY(mark_bitmap_count = mark_bitmap_size = 0;)
|
||||||
|
|
||||||
@ -2042,15 +2041,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
|
|||||||
marking_start.update();
|
marking_start.update();
|
||||||
marking_phase(vmthread_cm, maximum_heap_compaction);
|
marking_phase(vmthread_cm, maximum_heap_compaction);
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
if (TraceParallelOldGCMarkingPhase) {
|
|
||||||
gclog_or_tty->print_cr("marking_phase: cas_tries %d cas_retries %d "
|
|
||||||
"cas_by_another %d",
|
|
||||||
mark_bitmap()->cas_tries(), mark_bitmap()->cas_retries(),
|
|
||||||
mark_bitmap()->cas_by_another());
|
|
||||||
}
|
|
||||||
#endif // #ifndef PRODUCT
|
|
||||||
|
|
||||||
bool max_on_system_gc = UseMaximumCompactionOnSystemGC
|
bool max_on_system_gc = UseMaximumCompactionOnSystemGC
|
||||||
&& gc_cause == GCCause::_java_lang_system_gc;
|
&& gc_cause == GCCause::_java_lang_system_gc;
|
||||||
summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);
|
summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);
|
||||||
@ -2094,19 +2084,36 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
|
|||||||
young_gen->from_space()->capacity_in_bytes() +
|
young_gen->from_space()->capacity_in_bytes() +
|
||||||
young_gen->to_space()->capacity_in_bytes(),
|
young_gen->to_space()->capacity_in_bytes(),
|
||||||
"Sizes of space in young gen are out-of-bounds");
|
"Sizes of space in young gen are out-of-bounds");
|
||||||
|
|
||||||
|
size_t young_live = young_gen->used_in_bytes();
|
||||||
|
size_t eden_live = young_gen->eden_space()->used_in_bytes();
|
||||||
|
size_t old_live = old_gen->used_in_bytes();
|
||||||
|
size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
|
||||||
|
size_t max_old_gen_size = old_gen->max_gen_size();
|
||||||
size_t max_eden_size = young_gen->max_size() -
|
size_t max_eden_size = young_gen->max_size() -
|
||||||
young_gen->from_space()->capacity_in_bytes() -
|
young_gen->from_space()->capacity_in_bytes() -
|
||||||
young_gen->to_space()->capacity_in_bytes();
|
young_gen->to_space()->capacity_in_bytes();
|
||||||
size_policy->compute_generation_free_space(
|
|
||||||
young_gen->used_in_bytes(),
|
// Used for diagnostics
|
||||||
young_gen->eden_space()->used_in_bytes(),
|
size_policy->clear_generation_free_space_flags();
|
||||||
old_gen->used_in_bytes(),
|
|
||||||
young_gen->eden_space()->capacity_in_bytes(),
|
size_policy->compute_generation_free_space(young_live,
|
||||||
old_gen->max_gen_size(),
|
eden_live,
|
||||||
max_eden_size,
|
old_live,
|
||||||
true /* full gc*/,
|
cur_eden,
|
||||||
gc_cause,
|
max_old_gen_size,
|
||||||
heap->collector_policy());
|
max_eden_size,
|
||||||
|
true /* full gc*/);
|
||||||
|
|
||||||
|
size_policy->check_gc_overhead_limit(young_live,
|
||||||
|
eden_live,
|
||||||
|
max_old_gen_size,
|
||||||
|
max_eden_size,
|
||||||
|
true /* full gc*/,
|
||||||
|
gc_cause,
|
||||||
|
heap->collector_policy());
|
||||||
|
|
||||||
|
size_policy->decay_supplemental_growth(true /* full gc*/);
|
||||||
|
|
||||||
heap->resize_old_gen(
|
heap->resize_old_gen(
|
||||||
size_policy->calculated_old_free_size_in_bytes());
|
size_policy->calculated_old_free_size_in_bytes());
|
||||||
|
@ -552,19 +552,33 @@ bool PSScavenge::invoke_no_policy() {
|
|||||||
young_gen->from_space()->capacity_in_bytes() +
|
young_gen->from_space()->capacity_in_bytes() +
|
||||||
young_gen->to_space()->capacity_in_bytes(),
|
young_gen->to_space()->capacity_in_bytes(),
|
||||||
"Sizes of space in young gen are out-of-bounds");
|
"Sizes of space in young gen are out-of-bounds");
|
||||||
|
|
||||||
|
size_t young_live = young_gen->used_in_bytes();
|
||||||
|
size_t eden_live = young_gen->eden_space()->used_in_bytes();
|
||||||
|
size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
|
||||||
|
size_t max_old_gen_size = old_gen->max_gen_size();
|
||||||
size_t max_eden_size = young_gen->max_size() -
|
size_t max_eden_size = young_gen->max_size() -
|
||||||
young_gen->from_space()->capacity_in_bytes() -
|
young_gen->from_space()->capacity_in_bytes() -
|
||||||
young_gen->to_space()->capacity_in_bytes();
|
young_gen->to_space()->capacity_in_bytes();
|
||||||
size_policy->compute_generation_free_space(young_gen->used_in_bytes(),
|
|
||||||
young_gen->eden_space()->used_in_bytes(),
|
|
||||||
old_gen->used_in_bytes(),
|
|
||||||
young_gen->eden_space()->capacity_in_bytes(),
|
|
||||||
old_gen->max_gen_size(),
|
|
||||||
max_eden_size,
|
|
||||||
false /* full gc*/,
|
|
||||||
gc_cause,
|
|
||||||
heap->collector_policy());
|
|
||||||
|
|
||||||
|
// Used for diagnostics
|
||||||
|
size_policy->clear_generation_free_space_flags();
|
||||||
|
|
||||||
|
size_policy->compute_eden_space_size(young_live,
|
||||||
|
eden_live,
|
||||||
|
cur_eden,
|
||||||
|
max_eden_size,
|
||||||
|
false /* not full gc*/);
|
||||||
|
|
||||||
|
size_policy->check_gc_overhead_limit(young_live,
|
||||||
|
eden_live,
|
||||||
|
max_old_gen_size,
|
||||||
|
max_eden_size,
|
||||||
|
false /* not full gc*/,
|
||||||
|
gc_cause,
|
||||||
|
heap->collector_policy());
|
||||||
|
|
||||||
|
size_policy->decay_supplemental_growth(false /* not full gc*/);
|
||||||
}
|
}
|
||||||
// Resize the young generation at every collection
|
// Resize the young generation at every collection
|
||||||
// even if new sizes have not been calculated. This is
|
// even if new sizes have not been calculated. This is
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,7 +30,7 @@
|
|||||||
#include "oops/objArrayKlass.inline.hpp"
|
#include "oops/objArrayKlass.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
|
||||||
unsigned int MarkSweep::_total_invocations = 0;
|
uint MarkSweep::_total_invocations = 0;
|
||||||
|
|
||||||
Stack<oop, mtGC> MarkSweep::_marking_stack;
|
Stack<oop, mtGC> MarkSweep::_marking_stack;
|
||||||
Stack<ObjArrayTask, mtGC> MarkSweep::_objarray_stack;
|
Stack<ObjArrayTask, mtGC> MarkSweep::_objarray_stack;
|
||||||
@ -95,7 +95,7 @@ void MarkSweep::follow_stack() {
|
|||||||
// Process ObjArrays one at a time to avoid marking stack bloat.
|
// Process ObjArrays one at a time to avoid marking stack bloat.
|
||||||
if (!_objarray_stack.is_empty()) {
|
if (!_objarray_stack.is_empty()) {
|
||||||
ObjArrayTask task = _objarray_stack.pop();
|
ObjArrayTask task = _objarray_stack.pop();
|
||||||
ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
|
ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass();
|
||||||
k->oop_follow_contents(task.obj(), task.index());
|
k->oop_follow_contents(task.obj(), task.index());
|
||||||
}
|
}
|
||||||
} while (!_marking_stack.is_empty() || !_objarray_stack.is_empty());
|
} while (!_marking_stack.is_empty() || !_objarray_stack.is_empty());
|
||||||
|
@ -113,7 +113,7 @@ class MarkSweep : AllStatic {
|
|||||||
//
|
//
|
||||||
protected:
|
protected:
|
||||||
// Total invocations of a MarkSweep collection
|
// Total invocations of a MarkSweep collection
|
||||||
static unsigned int _total_invocations;
|
static uint _total_invocations;
|
||||||
|
|
||||||
// Traversal stacks used during phase1
|
// Traversal stacks used during phase1
|
||||||
static Stack<oop, mtGC> _marking_stack;
|
static Stack<oop, mtGC> _marking_stack;
|
||||||
@ -147,7 +147,7 @@ class MarkSweep : AllStatic {
|
|||||||
static AdjustKlassClosure adjust_klass_closure;
|
static AdjustKlassClosure adjust_klass_closure;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
static unsigned int total_invocations() { return _total_invocations; }
|
static uint total_invocations() { return _total_invocations; }
|
||||||
|
|
||||||
// Reference Processing
|
// Reference Processing
|
||||||
static ReferenceProcessor* const ref_processor() { return _ref_processor; }
|
static ReferenceProcessor* const ref_processor() { return _ref_processor; }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -49,10 +49,15 @@
|
|||||||
# include "os_bsd.inline.hpp"
|
# include "os_bsd.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void* StackObj::operator new(size_t size) { ShouldNotCallThis(); return 0; };
|
void* StackObj::operator new(size_t size) { ShouldNotCallThis(); return 0; }
|
||||||
void StackObj::operator delete(void* p) { ShouldNotCallThis(); };
|
void StackObj::operator delete(void* p) { ShouldNotCallThis(); }
|
||||||
void* _ValueObj::operator new(size_t size) { ShouldNotCallThis(); return 0; };
|
void* StackObj::operator new [](size_t size) { ShouldNotCallThis(); return 0; }
|
||||||
void _ValueObj::operator delete(void* p) { ShouldNotCallThis(); };
|
void StackObj::operator delete [](void* p) { ShouldNotCallThis(); }
|
||||||
|
|
||||||
|
void* _ValueObj::operator new(size_t size) { ShouldNotCallThis(); return 0; }
|
||||||
|
void _ValueObj::operator delete(void* p) { ShouldNotCallThis(); }
|
||||||
|
void* _ValueObj::operator new [](size_t size) { ShouldNotCallThis(); return 0; }
|
||||||
|
void _ValueObj::operator delete [](void* p) { ShouldNotCallThis(); }
|
||||||
|
|
||||||
void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data,
|
void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data,
|
||||||
size_t word_size, bool read_only, TRAPS) {
|
size_t word_size, bool read_only, TRAPS) {
|
||||||
@ -81,7 +86,6 @@ void MetaspaceObj::print_address_on(outputStream* st) const {
|
|||||||
st->print(" {"INTPTR_FORMAT"}", this);
|
st->print(" {"INTPTR_FORMAT"}", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) {
|
void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) {
|
||||||
address res;
|
address res;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -99,6 +103,10 @@ void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flag
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS flags) {
|
||||||
|
return (address) operator new(size, type, flags);
|
||||||
|
}
|
||||||
|
|
||||||
void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant,
|
void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant,
|
||||||
allocation_type type, MEMFLAGS flags) {
|
allocation_type type, MEMFLAGS flags) {
|
||||||
//should only call this with std::nothrow, use other operator new() otherwise
|
//should only call this with std::nothrow, use other operator new() otherwise
|
||||||
@ -118,6 +126,10 @@ void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_cons
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* ResourceObj::operator new [](size_t size, const std::nothrow_t& nothrow_constant,
|
||||||
|
allocation_type type, MEMFLAGS flags) {
|
||||||
|
return (address)operator new(size, nothrow_constant, type, flags);
|
||||||
|
}
|
||||||
|
|
||||||
void ResourceObj::operator delete(void* p) {
|
void ResourceObj::operator delete(void* p) {
|
||||||
assert(((ResourceObj *)p)->allocated_on_C_heap(),
|
assert(((ResourceObj *)p)->allocated_on_C_heap(),
|
||||||
@ -126,6 +138,10 @@ void ResourceObj::operator delete(void* p) {
|
|||||||
FreeHeap(p);
|
FreeHeap(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResourceObj::operator delete [](void* p) {
|
||||||
|
operator delete(p);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
void ResourceObj::set_allocation_type(address res, allocation_type type) {
|
void ResourceObj::set_allocation_type(address res, allocation_type type) {
|
||||||
// Set allocation type in the resource object
|
// Set allocation type in the resource object
|
||||||
@ -215,8 +231,6 @@ void trace_heap_free(void* p) {
|
|||||||
tty->print_cr("Heap free " INTPTR_FORMAT, p);
|
tty->print_cr("Heap free " INTPTR_FORMAT, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool warn_new_operator = false; // see vm_main
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// ChunkPool implementation
|
// ChunkPool implementation
|
||||||
|
|
||||||
@ -360,7 +374,7 @@ class ChunkPoolCleaner : public PeriodicTask {
|
|||||||
void* Chunk::operator new(size_t requested_size, size_t length) {
|
void* Chunk::operator new(size_t requested_size, size_t length) {
|
||||||
// requested_size is equal to sizeof(Chunk) but in order for the arena
|
// requested_size is equal to sizeof(Chunk) but in order for the arena
|
||||||
// allocations to come out aligned as expected the size must be aligned
|
// allocations to come out aligned as expected the size must be aligned
|
||||||
// to expected arean alignment.
|
// to expected arena alignment.
|
||||||
// expect requested_size but if sizeof(Chunk) doesn't match isn't proper size we must align it.
|
// expect requested_size but if sizeof(Chunk) doesn't match isn't proper size we must align it.
|
||||||
assert(ARENA_ALIGN(requested_size) == aligned_overhead_size(), "Bad alignment");
|
assert(ARENA_ALIGN(requested_size) == aligned_overhead_size(), "Bad alignment");
|
||||||
size_t bytes = ARENA_ALIGN(requested_size) + length;
|
size_t bytes = ARENA_ALIGN(requested_size) + length;
|
||||||
@ -669,19 +683,40 @@ void* Arena::internal_malloc_4(size_t x) {
|
|||||||
// a memory leak. Use CHeapObj as the base class of such objects to make it explicit
|
// a memory leak. Use CHeapObj as the base class of such objects to make it explicit
|
||||||
// that they're allocated on the C heap.
|
// that they're allocated on the C heap.
|
||||||
// Commented out in product version to avoid conflicts with third-party C++ native code.
|
// Commented out in product version to avoid conflicts with third-party C++ native code.
|
||||||
// %% note this is causing a problem on solaris debug build. the global
|
// On certain platforms, such as Mac OS X (Darwin), in debug version, new is being called
|
||||||
// new is being called from jdk source and causing data corruption.
|
// from jdk source and causing data corruption. Such as
|
||||||
// src/share/native/sun/awt/font/fontmanager/textcache/hsMemory.cpp::hsSoftNew
|
// Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair
|
||||||
// define CATCH_OPERATOR_NEW_USAGE if you want to use this.
|
// define ALLOW_OPERATOR_NEW_USAGE for platform on which global operator new allowed.
|
||||||
#ifdef CATCH_OPERATOR_NEW_USAGE
|
//
|
||||||
|
#ifndef ALLOW_OPERATOR_NEW_USAGE
|
||||||
void* operator new(size_t size){
|
void* operator new(size_t size){
|
||||||
static bool warned = false;
|
assert(false, "Should not call global operator new");
|
||||||
if (!warned && warn_new_operator)
|
return 0;
|
||||||
warning("should not call global (default) operator new");
|
|
||||||
warned = true;
|
|
||||||
return (void *) AllocateHeap(size, "global operator new");
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
void* operator new [](size_t size){
|
||||||
|
assert(false, "Should not call global operator new[]");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* operator new(size_t size, const std::nothrow_t& nothrow_constant){
|
||||||
|
assert(false, "Should not call global operator new");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* operator new [](size_t size, std::nothrow_t& nothrow_constant){
|
||||||
|
assert(false, "Should not call global operator new[]");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete(void* p) {
|
||||||
|
assert(false, "Should not call global delete");
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete [](void* p) {
|
||||||
|
assert(false, "Should not call global delete []");
|
||||||
|
}
|
||||||
|
#endif // ALLOW_OPERATOR_NEW_USAGE
|
||||||
|
|
||||||
void AllocatedObj::print() const { print_on(tty); }
|
void AllocatedObj::print() const { print_on(tty); }
|
||||||
void AllocatedObj::print_value() const { print_value_on(tty); }
|
void AllocatedObj::print_value() const { print_value_on(tty); }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -86,12 +86,23 @@ typedef AllocFailStrategy::AllocFailEnum AllocFailType;
|
|||||||
// subclasses.
|
// subclasses.
|
||||||
//
|
//
|
||||||
// The following macros and function should be used to allocate memory
|
// The following macros and function should be used to allocate memory
|
||||||
// directly in the resource area or in the C-heap:
|
// directly in the resource area or in the C-heap, The _OBJ variants
|
||||||
|
// of the NEW/FREE_C_HEAP macros are used for alloc/dealloc simple
|
||||||
|
// objects which are not inherited from CHeapObj, note constructor and
|
||||||
|
// destructor are not called. The preferable way to allocate objects
|
||||||
|
// is using the new operator.
|
||||||
//
|
//
|
||||||
// NEW_RESOURCE_ARRAY(type,size)
|
// WARNING: The array variant must only be used for a homogenous array
|
||||||
|
// where all objects are of the exact type specified. If subtypes are
|
||||||
|
// stored in the array then must pay attention to calling destructors
|
||||||
|
// at needed.
|
||||||
|
//
|
||||||
|
// NEW_RESOURCE_ARRAY(type, size)
|
||||||
// NEW_RESOURCE_OBJ(type)
|
// NEW_RESOURCE_OBJ(type)
|
||||||
// NEW_C_HEAP_ARRAY(type,size)
|
// NEW_C_HEAP_ARRAY(type, size)
|
||||||
// NEW_C_HEAP_OBJ(type)
|
// NEW_C_HEAP_OBJ(type, memflags)
|
||||||
|
// FREE_C_HEAP_ARRAY(type, old, memflags)
|
||||||
|
// FREE_C_HEAP_OBJ(objname, type, memflags)
|
||||||
// char* AllocateHeap(size_t size, const char* name);
|
// char* AllocateHeap(size_t size, const char* name);
|
||||||
// void FreeHeap(void* p);
|
// void FreeHeap(void* p);
|
||||||
//
|
//
|
||||||
@ -195,8 +206,11 @@ template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC {
|
|||||||
_NOINLINE_ void* operator new(size_t size, address caller_pc = 0);
|
_NOINLINE_ void* operator new(size_t size, address caller_pc = 0);
|
||||||
_NOINLINE_ void* operator new (size_t size, const std::nothrow_t& nothrow_constant,
|
_NOINLINE_ void* operator new (size_t size, const std::nothrow_t& nothrow_constant,
|
||||||
address caller_pc = 0);
|
address caller_pc = 0);
|
||||||
|
_NOINLINE_ void* operator new [](size_t size, address caller_pc = 0);
|
||||||
|
_NOINLINE_ void* operator new [](size_t size, const std::nothrow_t& nothrow_constant,
|
||||||
|
address caller_pc = 0);
|
||||||
void operator delete(void* p);
|
void operator delete(void* p);
|
||||||
|
void operator delete [] (void* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Base class for objects allocated on the stack only.
|
// Base class for objects allocated on the stack only.
|
||||||
@ -206,6 +220,8 @@ class StackObj ALLOCATION_SUPER_CLASS_SPEC {
|
|||||||
private:
|
private:
|
||||||
void* operator new(size_t size);
|
void* operator new(size_t size);
|
||||||
void operator delete(void* p);
|
void operator delete(void* p);
|
||||||
|
void* operator new [](size_t size);
|
||||||
|
void operator delete [](void* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Base class for objects used as value objects.
|
// Base class for objects used as value objects.
|
||||||
@ -229,7 +245,9 @@ class StackObj ALLOCATION_SUPER_CLASS_SPEC {
|
|||||||
class _ValueObj {
|
class _ValueObj {
|
||||||
private:
|
private:
|
||||||
void* operator new(size_t size);
|
void* operator new(size_t size);
|
||||||
void operator delete(void* p);
|
void operator delete(void* p);
|
||||||
|
void* operator new [](size_t size);
|
||||||
|
void operator delete [](void* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -510,13 +528,24 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void* operator new(size_t size, allocation_type type, MEMFLAGS flags);
|
void* operator new(size_t size, allocation_type type, MEMFLAGS flags);
|
||||||
|
void* operator new [](size_t size, allocation_type type, MEMFLAGS flags);
|
||||||
void* operator new(size_t size, const std::nothrow_t& nothrow_constant,
|
void* operator new(size_t size, const std::nothrow_t& nothrow_constant,
|
||||||
allocation_type type, MEMFLAGS flags);
|
allocation_type type, MEMFLAGS flags);
|
||||||
|
void* operator new [](size_t size, const std::nothrow_t& nothrow_constant,
|
||||||
|
allocation_type type, MEMFLAGS flags);
|
||||||
|
|
||||||
void* operator new(size_t size, Arena *arena) {
|
void* operator new(size_t size, Arena *arena) {
|
||||||
address res = (address)arena->Amalloc(size);
|
address res = (address)arena->Amalloc(size);
|
||||||
DEBUG_ONLY(set_allocation_type(res, ARENA);)
|
DEBUG_ONLY(set_allocation_type(res, ARENA);)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* operator new [](size_t size, Arena *arena) {
|
||||||
|
address res = (address)arena->Amalloc(size);
|
||||||
|
DEBUG_ONLY(set_allocation_type(res, ARENA);)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void* operator new(size_t size) {
|
void* operator new(size_t size) {
|
||||||
address res = (address)resource_allocate_bytes(size);
|
address res = (address)resource_allocate_bytes(size);
|
||||||
DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);)
|
DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);)
|
||||||
@ -529,7 +558,20 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* operator new [](size_t size) {
|
||||||
|
address res = (address)resource_allocate_bytes(size);
|
||||||
|
DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* operator new [](size_t size, const std::nothrow_t& nothrow_constant) {
|
||||||
|
address res = (address)resource_allocate_bytes(size, AllocFailStrategy::RETURN_NULL);
|
||||||
|
DEBUG_ONLY(if (res != NULL) set_allocation_type(res, RESOURCE_AREA);)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void operator delete(void* p);
|
void operator delete(void* p);
|
||||||
|
void operator delete [](void* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
// One of the following macros must be used when allocating an array
|
// One of the following macros must be used when allocating an array
|
||||||
@ -563,24 +605,25 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC {
|
|||||||
#define REALLOC_C_HEAP_ARRAY(type, old, size, memflags)\
|
#define REALLOC_C_HEAP_ARRAY(type, old, size, memflags)\
|
||||||
(type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags))
|
(type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags))
|
||||||
|
|
||||||
#define FREE_C_HEAP_ARRAY(type,old,memflags) \
|
#define FREE_C_HEAP_ARRAY(type, old, memflags) \
|
||||||
FreeHeap((char*)(old), memflags)
|
FreeHeap((char*)(old), memflags)
|
||||||
|
|
||||||
#define NEW_C_HEAP_OBJ(type, memflags)\
|
|
||||||
NEW_C_HEAP_ARRAY(type, 1, memflags)
|
|
||||||
|
|
||||||
|
|
||||||
#define NEW_C_HEAP_ARRAY2(type, size, memflags, pc)\
|
#define NEW_C_HEAP_ARRAY2(type, size, memflags, pc)\
|
||||||
(type*) (AllocateHeap((size) * sizeof(type), memflags, pc))
|
(type*) (AllocateHeap((size) * sizeof(type), memflags, pc))
|
||||||
|
|
||||||
#define REALLOC_C_HEAP_ARRAY2(type, old, size, memflags, pc)\
|
#define REALLOC_C_HEAP_ARRAY2(type, old, size, memflags, pc)\
|
||||||
(type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags, pc))
|
(type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags, pc))
|
||||||
|
|
||||||
#define NEW_C_HEAP_OBJ2(type, memflags, pc)\
|
#define NEW_C_HEAP_ARRAY3(type, size, memflags, pc, allocfail) \
|
||||||
NEW_C_HEAP_ARRAY2(type, 1, memflags, pc)
|
(type*) AllocateHeap(size * sizeof(type), memflags, pc, allocfail)
|
||||||
|
|
||||||
|
// allocate type in heap without calling ctor
|
||||||
|
#define NEW_C_HEAP_OBJ(type, memflags)\
|
||||||
|
NEW_C_HEAP_ARRAY(type, 1, memflags)
|
||||||
|
|
||||||
extern bool warn_new_operator;
|
// deallocate obj of type in heap without calling dtor
|
||||||
|
#define FREE_C_HEAP_OBJ(objname, memflags)\
|
||||||
|
FreeHeap((char*)objname, memflags);
|
||||||
|
|
||||||
// for statistics
|
// for statistics
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
@ -86,30 +86,39 @@ inline void FreeHeap(void* p, MEMFLAGS memflags = mtInternal) {
|
|||||||
|
|
||||||
template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size,
|
template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size,
|
||||||
address caller_pc){
|
address caller_pc){
|
||||||
#ifdef ASSERT
|
|
||||||
void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
|
void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
|
||||||
|
#ifdef ASSERT
|
||||||
if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
|
if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
|
||||||
return p;
|
|
||||||
#else
|
|
||||||
return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
|
|
||||||
#endif
|
#endif
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size,
|
template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size,
|
||||||
const std::nothrow_t& nothrow_constant, address caller_pc) {
|
const std::nothrow_t& nothrow_constant, address caller_pc) {
|
||||||
#ifdef ASSERT
|
|
||||||
void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
|
void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
|
||||||
AllocFailStrategy::RETURN_NULL);
|
AllocFailStrategy::RETURN_NULL);
|
||||||
|
#ifdef ASSERT
|
||||||
if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
|
if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
|
||||||
return p;
|
|
||||||
#else
|
|
||||||
return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
|
|
||||||
AllocFailStrategy::RETURN_NULL);
|
|
||||||
#endif
|
#endif
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
|
||||||
|
address caller_pc){
|
||||||
|
return CHeapObj<F>::operator new(size, caller_pc);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
|
||||||
|
const std::nothrow_t& nothrow_constant, address caller_pc) {
|
||||||
|
return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <MEMFLAGS F> void CHeapObj<F>::operator delete(void* p){
|
template <MEMFLAGS F> void CHeapObj<F>::operator delete(void* p){
|
||||||
FreeHeap(p, F);
|
FreeHeap(p, F);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <MEMFLAGS F> void CHeapObj<F>::operator delete [](void* p){
|
||||||
|
FreeHeap(p, F);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class E, MEMFLAGS F>
|
template <class E, MEMFLAGS F>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -80,15 +80,11 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap,
|
|||||||
|
|
||||||
_covered = new MemRegion[max_covered_regions];
|
_covered = new MemRegion[max_covered_regions];
|
||||||
_committed = new MemRegion[max_covered_regions];
|
_committed = new MemRegion[max_covered_regions];
|
||||||
if (_covered == NULL || _committed == NULL)
|
if (_covered == NULL || _committed == NULL) {
|
||||||
vm_exit_during_initialization("couldn't alloc card table covered region set.");
|
vm_exit_during_initialization("couldn't alloc card table covered region set.");
|
||||||
int i;
|
|
||||||
for (i = 0; i < max_covered_regions; i++) {
|
|
||||||
_covered[i].set_word_size(0);
|
|
||||||
_committed[i].set_word_size(0);
|
|
||||||
}
|
}
|
||||||
_cur_covered_regions = 0;
|
|
||||||
|
|
||||||
|
_cur_covered_regions = 0;
|
||||||
const size_t rs_align = _page_size == (size_t) os::vm_page_size() ? 0 :
|
const size_t rs_align = _page_size == (size_t) os::vm_page_size() ? 0 :
|
||||||
MAX2(_page_size, (size_t) os::vm_allocation_granularity());
|
MAX2(_page_size, (size_t) os::vm_allocation_granularity());
|
||||||
ReservedSpace heap_rs(_byte_map_size, rs_align, false);
|
ReservedSpace heap_rs(_byte_map_size, rs_align, false);
|
||||||
@ -134,7 +130,7 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap,
|
|||||||
|| _lowest_non_clean_base_chunk_index == NULL
|
|| _lowest_non_clean_base_chunk_index == NULL
|
||||||
|| _last_LNC_resizing_collection == NULL)
|
|| _last_LNC_resizing_collection == NULL)
|
||||||
vm_exit_during_initialization("couldn't allocate an LNC array.");
|
vm_exit_during_initialization("couldn't allocate an LNC array.");
|
||||||
for (i = 0; i < max_covered_regions; i++) {
|
for (int i = 0; i < max_covered_regions; i++) {
|
||||||
_lowest_non_clean[i] = NULL;
|
_lowest_non_clean[i] = NULL;
|
||||||
_lowest_non_clean_chunk_size[i] = 0;
|
_lowest_non_clean_chunk_size[i] = 0;
|
||||||
_last_LNC_resizing_collection[i] = -1;
|
_last_LNC_resizing_collection[i] = -1;
|
||||||
@ -153,6 +149,33 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CardTableModRefBS::~CardTableModRefBS() {
|
||||||
|
if (_covered) {
|
||||||
|
delete[] _covered;
|
||||||
|
_covered = NULL;
|
||||||
|
}
|
||||||
|
if (_committed) {
|
||||||
|
delete[] _committed;
|
||||||
|
_committed = NULL;
|
||||||
|
}
|
||||||
|
if (_lowest_non_clean) {
|
||||||
|
FREE_C_HEAP_ARRAY(CardArr, _lowest_non_clean, mtGC);
|
||||||
|
_lowest_non_clean = NULL;
|
||||||
|
}
|
||||||
|
if (_lowest_non_clean_chunk_size) {
|
||||||
|
FREE_C_HEAP_ARRAY(size_t, _lowest_non_clean_chunk_size, mtGC);
|
||||||
|
_lowest_non_clean_chunk_size = NULL;
|
||||||
|
}
|
||||||
|
if (_lowest_non_clean_base_chunk_index) {
|
||||||
|
FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index, mtGC);
|
||||||
|
_lowest_non_clean_base_chunk_index = NULL;
|
||||||
|
}
|
||||||
|
if (_last_LNC_resizing_collection) {
|
||||||
|
FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection, mtGC);
|
||||||
|
_last_LNC_resizing_collection = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int CardTableModRefBS::find_covering_region_by_base(HeapWord* base) {
|
int CardTableModRefBS::find_covering_region_by_base(HeapWord* base) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < _cur_covered_regions; i++) {
|
for (i = 0; i < _cur_covered_regions; i++) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -280,6 +280,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
CardTableModRefBS(MemRegion whole_heap, int max_covered_regions);
|
CardTableModRefBS(MemRegion whole_heap, int max_covered_regions);
|
||||||
|
~CardTableModRefBS();
|
||||||
|
|
||||||
// *** Barrier set functions.
|
// *** Barrier set functions.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -54,9 +54,10 @@ CardTableRS::CardTableRS(MemRegion whole_heap,
|
|||||||
_ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions);
|
_ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions);
|
||||||
#endif
|
#endif
|
||||||
set_bs(_ct_bs);
|
set_bs(_ct_bs);
|
||||||
_last_cur_val_in_gen = new jbyte[GenCollectedHeap::max_gens + 1];
|
_last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, GenCollectedHeap::max_gens + 1,
|
||||||
|
mtGC, 0, AllocFailStrategy::RETURN_NULL);
|
||||||
if (_last_cur_val_in_gen == NULL) {
|
if (_last_cur_val_in_gen == NULL) {
|
||||||
vm_exit_during_initialization("Could not last_cur_val_in_gen array.");
|
vm_exit_during_initialization("Could not create last_cur_val_in_gen array.");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) {
|
for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) {
|
||||||
_last_cur_val_in_gen[i] = clean_card_val();
|
_last_cur_val_in_gen[i] = clean_card_val();
|
||||||
@ -64,6 +65,16 @@ CardTableRS::CardTableRS(MemRegion whole_heap,
|
|||||||
_ct_bs->set_CTRS(this);
|
_ct_bs->set_CTRS(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CardTableRS::~CardTableRS() {
|
||||||
|
if (_ct_bs) {
|
||||||
|
delete _ct_bs;
|
||||||
|
_ct_bs = NULL;
|
||||||
|
}
|
||||||
|
if (_last_cur_val_in_gen) {
|
||||||
|
FREE_C_HEAP_ARRAY(jbyte, _last_cur_val_in_gen, mtInternal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CardTableRS::resize_covered_region(MemRegion new_region) {
|
void CardTableRS::resize_covered_region(MemRegion new_region) {
|
||||||
_ct_bs->resize_covered_region(new_region);
|
_ct_bs->resize_covered_region(new_region);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -102,6 +102,7 @@ class CardTableRS: public GenRemSet {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CardTableRS(MemRegion whole_heap, int max_covered_regions);
|
CardTableRS(MemRegion whole_heap, int max_covered_regions);
|
||||||
|
~CardTableRS();
|
||||||
|
|
||||||
// *** GenRemSet functions.
|
// *** GenRemSet functions.
|
||||||
GenRemSet::Name rs_kind() { return GenRemSet::CardTable; }
|
GenRemSet::Name rs_kind() { return GenRemSet::CardTable; }
|
||||||
|
@ -264,6 +264,27 @@ void TwoGenerationCollectorPolicy::initialize_flags() {
|
|||||||
// need to do this again
|
// need to do this again
|
||||||
MaxHeapSize = align_size_up(MaxHeapSize, max_alignment());
|
MaxHeapSize = align_size_up(MaxHeapSize, max_alignment());
|
||||||
|
|
||||||
|
// adjust max heap size if necessary
|
||||||
|
if (NewSize + OldSize > MaxHeapSize) {
|
||||||
|
if (FLAG_IS_CMDLINE(MaxHeapSize)) {
|
||||||
|
// somebody set a maximum heap size with the intention that we should not
|
||||||
|
// exceed it. Adjust New/OldSize as necessary.
|
||||||
|
uintx calculated_size = NewSize + OldSize;
|
||||||
|
double shrink_factor = (double) MaxHeapSize / calculated_size;
|
||||||
|
// align
|
||||||
|
NewSize = align_size_down((uintx) (NewSize * shrink_factor), min_alignment());
|
||||||
|
// OldSize is already aligned because above we aligned MaxHeapSize to
|
||||||
|
// max_alignment(), and we just made sure that NewSize is aligned to
|
||||||
|
// min_alignment(). In initialize_flags() we verified that max_alignment()
|
||||||
|
// is a multiple of min_alignment().
|
||||||
|
OldSize = MaxHeapSize - NewSize;
|
||||||
|
} else {
|
||||||
|
MaxHeapSize = NewSize + OldSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// need to do this again
|
||||||
|
MaxHeapSize = align_size_up(MaxHeapSize, max_alignment());
|
||||||
|
|
||||||
always_do_update_barrier = UseConcMarkSweepGC;
|
always_do_update_barrier = UseConcMarkSweepGC;
|
||||||
|
|
||||||
// Check validity of heap flags
|
// Check validity of heap flags
|
||||||
@ -731,7 +752,7 @@ HeapWord* GenCollectorPolicy::satisfy_failed_allocation(size_t size,
|
|||||||
// free memory should be here, especially if they are expensive. If this
|
// free memory should be here, especially if they are expensive. If this
|
||||||
// attempt fails, an OOM exception will be thrown.
|
// attempt fails, an OOM exception will be thrown.
|
||||||
{
|
{
|
||||||
IntFlagSetting flag_change(MarkSweepAlwaysCompactCount, 1); // Make sure the heap is fully compacted
|
UIntFlagSetting flag_change(MarkSweepAlwaysCompactCount, 1); // Make sure the heap is fully compacted
|
||||||
|
|
||||||
gch->do_collection(true /* full */,
|
gch->do_collection(true /* full */,
|
||||||
true /* clear_all_soft_refs */,
|
true /* clear_all_soft_refs */,
|
||||||
@ -856,7 +877,7 @@ MarkSweepPolicy::MarkSweepPolicy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MarkSweepPolicy::initialize_generations() {
|
void MarkSweepPolicy::initialize_generations() {
|
||||||
_generations = new GenerationSpecPtr[number_of_generations()];
|
_generations = NEW_C_HEAP_ARRAY3(GenerationSpecPtr, number_of_generations(), mtGC, 0, AllocFailStrategy::RETURN_NULL);
|
||||||
if (_generations == NULL)
|
if (_generations == NULL)
|
||||||
vm_exit_during_initialization("Unable to allocate gen spec");
|
vm_exit_during_initialization("Unable to allocate gen spec");
|
||||||
|
|
||||||
|
@ -154,12 +154,12 @@ KlassInfoTable::~KlassInfoTable() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint KlassInfoTable::hash(Klass* p) {
|
uint KlassInfoTable::hash(const Klass* p) {
|
||||||
assert(p->is_metadata(), "all klasses are metadata");
|
assert(p->is_metadata(), "all klasses are metadata");
|
||||||
return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2);
|
return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
KlassInfoEntry* KlassInfoTable::lookup(Klass* const k) {
|
KlassInfoEntry* KlassInfoTable::lookup(Klass* k) {
|
||||||
uint idx = hash(k) % _size;
|
uint idx = hash(k) % _size;
|
||||||
assert(_buckets != NULL, "Allocation failure should have been caught");
|
assert(_buckets != NULL, "Allocation failure should have been caught");
|
||||||
KlassInfoEntry* e = _buckets[idx].lookup(k);
|
KlassInfoEntry* e = _buckets[idx].lookup(k);
|
||||||
|
@ -189,15 +189,15 @@ class KlassInfoEntry: public CHeapObj<mtInternal> {
|
|||||||
KlassInfoEntry(Klass* k, KlassInfoEntry* next) :
|
KlassInfoEntry(Klass* k, KlassInfoEntry* next) :
|
||||||
_klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1)
|
_klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1)
|
||||||
{}
|
{}
|
||||||
KlassInfoEntry* next() { return _next; }
|
KlassInfoEntry* next() const { return _next; }
|
||||||
bool is_equal(Klass* k) { return k == _klass; }
|
bool is_equal(const Klass* k) { return k == _klass; }
|
||||||
Klass* klass() { return _klass; }
|
Klass* klass() const { return _klass; }
|
||||||
long count() { return _instance_count; }
|
long count() const { return _instance_count; }
|
||||||
void set_count(long ct) { _instance_count = ct; }
|
void set_count(long ct) { _instance_count = ct; }
|
||||||
size_t words() { return _instance_words; }
|
size_t words() const { return _instance_words; }
|
||||||
void set_words(size_t wds) { _instance_words = wds; }
|
void set_words(size_t wds) { _instance_words = wds; }
|
||||||
void set_index(long index) { _index = index; }
|
void set_index(long index) { _index = index; }
|
||||||
long index() { return _index; }
|
long index() const { return _index; }
|
||||||
int compare(KlassInfoEntry* e1, KlassInfoEntry* e2);
|
int compare(KlassInfoEntry* e1, KlassInfoEntry* e2);
|
||||||
void print_on(outputStream* st) const;
|
void print_on(outputStream* st) const;
|
||||||
const char* name() const;
|
const char* name() const;
|
||||||
@ -215,7 +215,7 @@ class KlassInfoBucket: public CHeapObj<mtInternal> {
|
|||||||
KlassInfoEntry* list() { return _list; }
|
KlassInfoEntry* list() { return _list; }
|
||||||
void set_list(KlassInfoEntry* l) { _list = l; }
|
void set_list(KlassInfoEntry* l) { _list = l; }
|
||||||
public:
|
public:
|
||||||
KlassInfoEntry* lookup(Klass* const k);
|
KlassInfoEntry* lookup(Klass* k);
|
||||||
void initialize() { _list = NULL; }
|
void initialize() { _list = NULL; }
|
||||||
void empty();
|
void empty();
|
||||||
void iterate(KlassInfoClosure* cic);
|
void iterate(KlassInfoClosure* cic);
|
||||||
@ -231,8 +231,8 @@ class KlassInfoTable: public StackObj {
|
|||||||
HeapWord* _ref;
|
HeapWord* _ref;
|
||||||
|
|
||||||
KlassInfoBucket* _buckets;
|
KlassInfoBucket* _buckets;
|
||||||
uint hash(Klass* p);
|
uint hash(const Klass* p);
|
||||||
KlassInfoEntry* lookup(Klass* const k); // allocates if not found!
|
KlassInfoEntry* lookup(Klass* k); // allocates if not found!
|
||||||
|
|
||||||
class AllClassesFinder : public KlassClosure {
|
class AllClassesFinder : public KlassClosure {
|
||||||
KlassInfoTable *_table;
|
KlassInfoTable *_table;
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
|
#include "memory/allocation.hpp"
|
||||||
|
#include "memory/allocation.inline.hpp"
|
||||||
#include "memory/memRegion.hpp"
|
#include "memory/memRegion.hpp"
|
||||||
#include "runtime/globals.hpp"
|
#include "runtime/globals.hpp"
|
||||||
|
|
||||||
@ -99,3 +101,19 @@ MemRegion MemRegion::minus(const MemRegion mr2) const {
|
|||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
return MemRegion();
|
return MemRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* MemRegion::operator new(size_t size) {
|
||||||
|
return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* MemRegion::operator new [](size_t size) {
|
||||||
|
return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
|
||||||
|
}
|
||||||
|
void MemRegion::operator delete(void* p) {
|
||||||
|
FreeHeap(p, mtGC);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MemRegion::operator delete [](void* p) {
|
||||||
|
FreeHeap(p, mtGC);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,9 @@
|
|||||||
|
|
||||||
// Note that MemRegions are passed by value, not by reference.
|
// Note that MemRegions are passed by value, not by reference.
|
||||||
// The intent is that they remain very small and contain no
|
// The intent is that they remain very small and contain no
|
||||||
// objects.
|
// objects. _ValueObj should never be allocated in heap but we do
|
||||||
|
// create MemRegions (in CardTableModRefBS) in heap so operator
|
||||||
|
// new and operator new [] added for this special case.
|
||||||
|
|
||||||
class MetaWord;
|
class MetaWord;
|
||||||
|
|
||||||
@ -92,6 +94,10 @@ public:
|
|||||||
size_t word_size() const { return _word_size; }
|
size_t word_size() const { return _word_size; }
|
||||||
|
|
||||||
bool is_empty() const { return word_size() == 0; }
|
bool is_empty() const { return word_size() == 0; }
|
||||||
|
void* operator new(size_t size);
|
||||||
|
void* operator new [](size_t size);
|
||||||
|
void operator delete(void* p);
|
||||||
|
void operator delete [](void* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
// For iteration over MemRegion's.
|
// For iteration over MemRegion's.
|
||||||
|
@ -537,9 +537,8 @@ protected:
|
|||||||
* Occasionally, we want to ensure a full compaction, which is determined \
|
* Occasionally, we want to ensure a full compaction, which is determined \
|
||||||
* by the MarkSweepAlwaysCompactCount parameter. \
|
* by the MarkSweepAlwaysCompactCount parameter. \
|
||||||
*/ \
|
*/ \
|
||||||
int invocations = MarkSweep::total_invocations(); \
|
uint invocations = MarkSweep::total_invocations(); \
|
||||||
bool skip_dead = (MarkSweepAlwaysCompactCount < 1) \
|
bool skip_dead = ((invocations % MarkSweepAlwaysCompactCount) != 0); \
|
||||||
||((invocations % MarkSweepAlwaysCompactCount) != 0); \
|
|
||||||
\
|
\
|
||||||
size_t allowed_deadspace = 0; \
|
size_t allowed_deadspace = 0; \
|
||||||
if (skip_dead) { \
|
if (skip_dead) { \
|
||||||
|
@ -1425,25 +1425,25 @@ ActiveMethodOopsCache::~ActiveMethodOopsCache() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ActiveMethodOopsCache::add_previous_version(Method* const method) {
|
void ActiveMethodOopsCache::add_previous_version(Method* method) {
|
||||||
assert(Thread::current()->is_VM_thread(),
|
assert(Thread::current()->is_VM_thread(),
|
||||||
"only VMThread can add previous versions");
|
"only VMThread can add previous versions");
|
||||||
|
|
||||||
// Only append the previous method if it is executing on the stack.
|
// Only append the previous method if it is executing on the stack.
|
||||||
if (method->on_stack()) {
|
if (method->on_stack()) {
|
||||||
|
|
||||||
if (_prev_methods == NULL) {
|
if (_prev_methods == NULL) {
|
||||||
// This is the first previous version so make some space.
|
// This is the first previous version so make some space.
|
||||||
// Start with 2 elements under the assumption that the class
|
// Start with 2 elements under the assumption that the class
|
||||||
// won't be redefined much.
|
// won't be redefined much.
|
||||||
_prev_methods = new (ResourceObj::C_HEAP, mtClass) GrowableArray<Method*>(2, true);
|
_prev_methods = new (ResourceObj::C_HEAP, mtClass) GrowableArray<Method*>(2, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// RC_TRACE macro has an embedded ResourceMark
|
// RC_TRACE macro has an embedded ResourceMark
|
||||||
RC_TRACE(0x00000100,
|
RC_TRACE(0x00000100,
|
||||||
("add: %s(%s): adding prev version ref for cached method @%d",
|
("add: %s(%s): adding prev version ref for cached method @%d",
|
||||||
method->name()->as_C_string(), method->signature()->as_C_string(),
|
method->name()->as_C_string(), method->signature()->as_C_string(),
|
||||||
_prev_methods->length()));
|
_prev_methods->length()));
|
||||||
|
|
||||||
_prev_methods->append(method);
|
_prev_methods->append(method);
|
||||||
}
|
}
|
||||||
@ -1464,16 +1464,17 @@ void ActiveMethodOopsCache::add_previous_version(Method* const method) {
|
|||||||
MetadataFactory::free_metadata(method->method_holder()->class_loader_data(), method);
|
MetadataFactory::free_metadata(method->method_holder()->class_loader_data(), method);
|
||||||
} else {
|
} else {
|
||||||
// RC_TRACE macro has an embedded ResourceMark
|
// RC_TRACE macro has an embedded ResourceMark
|
||||||
RC_TRACE(0x00000400, ("add: %s(%s): previous cached method @%d is alive",
|
RC_TRACE(0x00000400,
|
||||||
method->name()->as_C_string(), method->signature()->as_C_string(), i));
|
("add: %s(%s): previous cached method @%d is alive",
|
||||||
|
method->name()->as_C_string(), method->signature()->as_C_string(), i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end add_previous_version()
|
} // end add_previous_version()
|
||||||
|
|
||||||
|
|
||||||
bool ActiveMethodOopsCache::is_same_method(Method* const method) const {
|
bool ActiveMethodOopsCache::is_same_method(const Method* method) const {
|
||||||
InstanceKlass* ik = InstanceKlass::cast(klass());
|
InstanceKlass* ik = InstanceKlass::cast(klass());
|
||||||
Method* check_method = ik->method_with_idnum(method_idnum());
|
const Method* check_method = ik->method_with_idnum(method_idnum());
|
||||||
assert(check_method != NULL, "sanity check");
|
assert(check_method != NULL, "sanity check");
|
||||||
if (check_method == method) {
|
if (check_method == method) {
|
||||||
// done with the easy case
|
// done with the easy case
|
||||||
|
@ -90,8 +90,8 @@ class ActiveMethodOopsCache : public CommonMethodOopCache {
|
|||||||
ActiveMethodOopsCache() { _prev_methods = NULL; }
|
ActiveMethodOopsCache() { _prev_methods = NULL; }
|
||||||
~ActiveMethodOopsCache();
|
~ActiveMethodOopsCache();
|
||||||
|
|
||||||
void add_previous_version(Method* const method);
|
void add_previous_version(Method* method);
|
||||||
bool is_same_method(Method* const method) const;
|
bool is_same_method(const Method* method) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user