Merge
This commit is contained in:
commit
53ac035768
6
.hgtags
6
.hgtags
@ -70,3 +70,9 @@ ff9031a745d9cc52318f2148e43ca3b07ee08098 jdk7-b92
|
||||
b5dab6a313fdff4c043250e4d9c8f66fd624d27e jdk7-b93
|
||||
8bb281f0f91582104d65d032be22522bfd2d8110 jdk7-b94
|
||||
654298d26561b76dfe3cfcffbbd7078080837300 jdk7-b95
|
||||
d260f892491e040ae385a8e6df59557a7d721abf jdk7-b96
|
||||
7e406ebed9a5968b584f3c3e6b60893b5d6d9741 jdk7-b97
|
||||
db6e660120446c407e2d908d52ec046592b21726 jdk7-b98
|
||||
c4c8a5bc54f66abc68cd185d9294042121922154 jdk7-b99
|
||||
2d6ba7a221915bdf0311acc5641c7f3875cb793e jdk7-b100
|
||||
2548ac036b8fca3326d058d758e6df8355a42469 jdk7-b101
|
||||
|
@ -70,3 +70,9 @@ cf26288a114be67c39f2758959ce50b60f5ae330 jdk7-b85
|
||||
5fc102ff48f0e787ce9cc77249841d5ff0941b75 jdk7-b93
|
||||
d7f35c61afa092b6357c2c4bce3f298f16620f71 jdk7-b94
|
||||
fd3663286e77b9f13c39eee124db2beb079b3ca6 jdk7-b95
|
||||
cf71cb5151166f35433afebaf67dbf34a704a170 jdk7-b96
|
||||
5e197c942c6ebd8b92f324a31049c5f1d26d40ef jdk7-b97
|
||||
6cea9984d73d74de0cd01f30d07ac0a1ed196117 jdk7-b98
|
||||
e7f18db469a3e947b7096bfd12e87380e5a042cd jdk7-b99
|
||||
b218a53ec7d3d42be61d31d6917a6c5c037b6f56 jdk7-b100
|
||||
4193eaf5f1b82794c6a0fb1a8d11af43d1b1d611 jdk7-b101
|
||||
|
76
Makefile
76
Makefile
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1995, 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
|
||||
@ -29,10 +29,6 @@ ifndef TOPDIR
|
||||
TOPDIR:=.
|
||||
endif
|
||||
|
||||
ifndef CONTROL_TOPDIR
|
||||
CONTROL_TOPDIR=$(TOPDIR)
|
||||
endif
|
||||
|
||||
# Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
|
||||
OPENJDK_SOURCETREE=$(TOPDIR)/openjdk
|
||||
OPENJDK_BUILDDIR:=$(shell \
|
||||
@ -120,7 +116,7 @@ endif
|
||||
all_product_build::
|
||||
@$(FINISH_ECHO)
|
||||
|
||||
# Generis build of basic repo series
|
||||
# Generic build of basic repo series
|
||||
generic_build_repo_series::
|
||||
$(MKDIR) -p $(OUTPUTDIR)
|
||||
$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
|
||||
@ -179,11 +175,15 @@ endif
|
||||
# The install process needs to know what the DEBUG_NAME is, so
|
||||
# look for INSTALL_DEBUG_NAME in the install rules.
|
||||
#
|
||||
# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
|
||||
# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
|
||||
# not be the same location.
|
||||
#
|
||||
|
||||
# Location of fresh bootdir output
|
||||
ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
|
||||
FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
|
||||
FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image
|
||||
FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
|
||||
|
||||
create_fresh_product_bootdir: FRC
|
||||
@$(START_ECHO)
|
||||
@ -248,10 +248,14 @@ build_product_image:
|
||||
generic_build_repo_series
|
||||
@$(FINISH_ECHO)
|
||||
|
||||
# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
|
||||
# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
|
||||
# not be the same location.
|
||||
|
||||
generic_debug_build:
|
||||
@$(START_ECHO)
|
||||
$(MAKE) \
|
||||
ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
|
||||
ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
|
||||
DEBUG_NAME=$(DEBUG_NAME) \
|
||||
GENERATE_DOCS=false \
|
||||
$(BOOT_CYCLE_DEBUG_SETTINGS) \
|
||||
@ -348,8 +352,8 @@ endif
|
||||
|
||||
clobber::
|
||||
$(RM) -r $(OUTPUTDIR)/*
|
||||
$(RM) -r $(OUTPUTDIR)-debug/*
|
||||
$(RM) -r $(OUTPUTDIR)-fastdebug/*
|
||||
$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
|
||||
$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
|
||||
-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
|
||||
|
||||
clean: clobber
|
||||
@ -550,6 +554,56 @@ ifeq ($(BUNDLE_RULES_AVAILABLE), true)
|
||||
include $(BUNDLE_RULES)
|
||||
endif
|
||||
|
||||
################################################################
|
||||
# rule to test
|
||||
################################################################
|
||||
|
||||
.NOTPARALLEL: test
|
||||
|
||||
test: test_clean test_start test_summary
|
||||
|
||||
test_start:
|
||||
@$(ECHO) "Tests started at `$(DATE)`"
|
||||
|
||||
test_clean:
|
||||
$(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
|
||||
|
||||
test_summary: $(OUTPUTDIR)/test_failures.txt
|
||||
@$(ECHO) "#################################################"
|
||||
@$(ECHO) "Tests completed at `$(DATE)`"
|
||||
@( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
|
||||
|| $(ECHO) "No TEST STATS seen in log" )
|
||||
@$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
|
||||
@$(ECHO) "#################################################"
|
||||
@if [ -s $< ] ; then \
|
||||
$(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
|
||||
$(CAT) $<; \
|
||||
exit 1; \
|
||||
else \
|
||||
$(ECHO) "Success! No failures detected"; \
|
||||
fi
|
||||
|
||||
# Get failure list from log
|
||||
$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
|
||||
@$(RM) $@
|
||||
@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) > $@
|
||||
|
||||
# Get log file of all tests run
|
||||
JDK_TO_TEST := $(shell \
|
||||
if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
|
||||
$(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \
|
||||
elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
|
||||
$(ECHO) "$(ABS_OUTPUTDIR)"; \
|
||||
elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
|
||||
$(ECHO) "$(PRODUCT_HOME)"; \
|
||||
fi \
|
||||
)
|
||||
$(OUTPUTDIR)/test_log.txt:
|
||||
$(RM) $@
|
||||
( $(CD) test && \
|
||||
$(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) \
|
||||
) | tee $@
|
||||
|
||||
################################################################
|
||||
# JPRT rule to build
|
||||
################################################################
|
||||
@ -560,7 +614,7 @@ include ./make/jprt.gmk
|
||||
# PHONY
|
||||
################################################################
|
||||
|
||||
.PHONY: all \
|
||||
.PHONY: all test test_start test_summary test_clean \
|
||||
generic_build_repo_series \
|
||||
what clobber insane \
|
||||
dev dev-build dev-sanity dev-clobber \
|
||||
|
@ -65,8 +65,9 @@
|
||||
<li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
|
||||
<li><a href="#compilers">Compilers</a>
|
||||
<ul>
|
||||
<li><a href="#msvc">Microsoft Visual Studio</a> </li>
|
||||
<li><a href="#mssdk">Microsoft Platform SDK</a> </li>
|
||||
<li><a href="#msvc32">Microsoft Visual Studio Professional/Express for 32 bit</a> </li>
|
||||
<li><a href="#msvc64">Microsoft Visual Studio Professional for 64 bit</a> </li>
|
||||
<li><a href="#mssdk64">Microsoft Windows SDK for 64 bit</a> </li>
|
||||
<li><a href="#gcc">Linux gcc/binutils</a> </li>
|
||||
<li><a href="#studio">Sun Studio</a> </li>
|
||||
</ul>
|
||||
@ -789,11 +790,11 @@
|
||||
</li>
|
||||
<li>
|
||||
Install the
|
||||
<a href="#msvc">Microsoft Visual Studio Compilers</a>).
|
||||
<a href="#msvc32">Microsoft Visual Studio Compilers</a>).
|
||||
</li>
|
||||
<li>
|
||||
Setup all environment variables for compilers
|
||||
(see <a href="#msvc">compilers</a>).
|
||||
(see <a href="#msvc32">compilers</a>).
|
||||
</li>
|
||||
<li>
|
||||
Install
|
||||
@ -958,7 +959,7 @@
|
||||
are also an option, although these compilers have not
|
||||
been extensively used yet.
|
||||
</blockquote>
|
||||
<strong><a name="msvc">Windows i586: Microsoft Visual Studio Compilers</a></strong>
|
||||
<strong><a name="msvc32">Windows i586: Microsoft Visual Studio 2010 Compilers</a></strong>
|
||||
<blockquote>
|
||||
<p>
|
||||
<b>BEGIN WARNING</b>: At this time (Spring/Summer 2010) JDK 7 is starting a transition to
|
||||
@ -971,14 +972,13 @@ So for now you should be able to build with either VS2003 or VS2010.
|
||||
We do not guarantee that VS2008 will work, although there is sufficient
|
||||
makefile support to make at least basic JDK builds plausible.
|
||||
Visual Studio 2010 Express compilers are now able to build all the
|
||||
open source repositories, but this is 32 bit only, since
|
||||
we have not yet seen the 7.1 Windows SDK with the 64 bit
|
||||
compilers. <b>END WARNING.</b>
|
||||
open source repositories, but this is 32 bit only. To build 64 bit
|
||||
Windows binaries use the the 7.1 Windows SDK.<b>END WARNING.</b>
|
||||
<p>
|
||||
The 32-bit OpenJDK Windows build
|
||||
requires
|
||||
Microsoft Visual Studio C++ 2010 (VS2010) Professional
|
||||
Edition compiler.
|
||||
Edition or Express compiler.
|
||||
The compiler and other tools are expected to reside
|
||||
in the location defined by the variable
|
||||
<tt>VS100COMNTOOLS</tt> which
|
||||
@ -1001,14 +1001,33 @@ compilers. <b>END WARNING.</b>
|
||||
The path <tt>/usr/bin</tt> must be after the path to the
|
||||
Visual Studio product.
|
||||
</blockquote>
|
||||
<strong><a name="mssdk">Windows x64: Microsoft Visual Studio Compilers</a></strong>
|
||||
<strong><a name="msvc64">Windows x64: Microsoft Visual Studio 2010 Professional Compiler</a></strong>
|
||||
<blockquote>
|
||||
On <b>X64</b>, the set up is much the same in VS2010
|
||||
For <b>X64</b>, builds, when using the VS2010 Professional
|
||||
compiler, the 64 bit build set up is much the same as 32 bit
|
||||
except that you run <tt>amd64\VCVARS64.BAT</tt>
|
||||
to set the compiler environment variables.
|
||||
Previously 64 builds had used the 64 bit compiler in
|
||||
an unbundled Windows SDK but this is no longer necessary.
|
||||
Previously 64 bit builds had used the 64 bit compiler in
|
||||
an unbundled Windows SDK but this is no longer necessary if
|
||||
you have VS2010 Professional.
|
||||
</blockquote>
|
||||
<strong><a name="mssdk64">Windows x64: Microsoft Windows 7.1 SDK 64 bit compilers.</a></strong>
|
||||
For a free alternative for 64 bit builds, use the 7.1 SDK.
|
||||
Microsoft say that to set up your paths for this run
|
||||
<pre>
|
||||
c:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv.cmd /x64.
|
||||
</pre>
|
||||
What was tested is just directly setting up LIB, INCLUDE,
|
||||
PATH and based on the installation directories using the
|
||||
DOS short name appropriate for the system, (you will
|
||||
need to set them for yours, not just blindly copy this) eg :
|
||||
<pre>
|
||||
set VSINSTALLDIR=c:\PROGRA~2\MICROS~1.0
|
||||
set WindowsSdkDir=c:\PROGRA~1\MICROS~1\Windows\v7.1
|
||||
set PATH=%VSINSTALLDIR%\vc\bin\amd64;%VSINSTALLDIR%\Common7\IDE;%WindowsSdkDir%\bin;%PATH%
|
||||
set INCLUDE=%VSINSTALLDIR%\vc\include;%WindowsSdkDir%\include
|
||||
set LIB=%VSINSTALLDIR%\vc\lib\amd64;%WindowsSdkDir%\lib\x64
|
||||
</pre>
|
||||
</blockquote>
|
||||
<!-- ------------------------------------------------------ -->
|
||||
<h4><a name="zip">Zip and Unzip</a></h4>
|
||||
|
@ -70,3 +70,9 @@ bcd2fc089227559ac5be927923609fac29f067fa jdk7-b91
|
||||
9718d624864c29dca44373d541e93cdd309a994f jdk7-b93
|
||||
533c11186b44e3a02d6c5fe69a73260505fcfe5e jdk7-b94
|
||||
06dbf406818c789bb586c1de4c002024cd26ecd2 jdk7-b95
|
||||
edc2a2659c77dabc55cb55bb617bad89e3a05bb3 jdk7-b96
|
||||
4ec9d59374caa1e5d72fa802291b4d66955a4936 jdk7-b97
|
||||
3b99409057e4c255da946f9f540d051a5ef4ab23 jdk7-b98
|
||||
95db968660e7d87c345d5cf3dc2e3db037fb7220 jdk7-b99
|
||||
a56d734a1e970e1a21a8f4feb13053e9a33674c7 jdk7-b100
|
||||
86a239832646a74811695428984b6947c0bd6dc8 jdk7-b101
|
||||
|
@ -176,7 +176,16 @@ ifeq ($(FASTDEBUG), true)
|
||||
CXXFLAGS_DBG += $(CC_LOWER_OPT)
|
||||
endif
|
||||
|
||||
CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
|
||||
CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
|
||||
|
||||
# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
|
||||
ifneq ($(ARCH),alpha)
|
||||
CPP_ARCH_FLAGS += -D$(ARCH)
|
||||
else
|
||||
CPP_ARCH_FLAGS += -D_$(ARCH)_
|
||||
endif
|
||||
|
||||
CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
|
||||
-D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
|
||||
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
|
@ -30,7 +30,7 @@
|
||||
BUILDDIR = ../..
|
||||
include $(BUILDDIR)/common/Defs.gmk
|
||||
|
||||
SUBDIRS = org
|
||||
SUBDIRS = org core
|
||||
all build clean clobber::
|
||||
$(SUBDIRS-loop)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 2005, 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
|
||||
@ -24,16 +24,49 @@
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile for building Java input methods
|
||||
# Makefile for building RMI/IIOP
|
||||
#
|
||||
|
||||
BUILDDIR = ../../..
|
||||
PRODUCT = sun
|
||||
include $(BUILDDIR)/common/Defs.gmk
|
||||
|
||||
SUBDIRS = indicim thaiim
|
||||
include $(BUILDDIR)/common/Subdirs.gmk
|
||||
#
|
||||
# Files to compile.
|
||||
#
|
||||
CORBA_JMK_DIRECTORY=$(TOPDIR)/make/com/sun/corba/minclude/
|
||||
include $(CORBA_JMK_DIRECTORY)javax_rmi.jmk
|
||||
include $(CORBA_JMK_DIRECTORY)javax_rmi_CORBA.jmk
|
||||
include $(CORBA_JMK_DIRECTORY)javax_transaction.jmk
|
||||
include $(CORBA_JMK_DIRECTORY)javax_activity.jmk
|
||||
include $(CORBA_JMK_DIRECTORY)sun_corba.jmk
|
||||
|
||||
all build clean clobber::
|
||||
$(SUBDIRS-loop)
|
||||
FILES_java = \
|
||||
$(javax_rmi_java) \
|
||||
$(javax_rmi_CORBA_java) \
|
||||
$(javax_transaction_java) \
|
||||
$(javax_activity_java) \
|
||||
$(sun_corba_java)
|
||||
|
||||
#
|
||||
# Resources
|
||||
#
|
||||
LOCALE_SET_DEFINITION = jre
|
||||
RESOURCE_BUNDLES_PROPERTIES = \
|
||||
com/sun/corba/se/impl/orbutil/resources/sunorb.properties
|
||||
|
||||
#
|
||||
# Rules
|
||||
#
|
||||
include $(BUILDDIR)/common/Classes.gmk
|
||||
|
||||
|
||||
#
|
||||
# Extra clean rules because we build more than one package.
|
||||
#
|
||||
clean:: classheaders.clean objects.clean
|
||||
$(RM) -r $(CLASSBINDIR)/javax/rmi
|
||||
$(RM) -r $(CLASSBINDIR)/javax/transaction
|
||||
$(RM) -r $(CLASSBINDIR)/javax/activity
|
||||
$(RM) -r $(CLASSBINDIR)/com/sun/corba/se/impl
|
||||
|
@ -70,7 +70,4 @@ REQUIRED_Group = \
|
||||
com/sun/corba/se/internal/util/IdentityHashtable.java \
|
||||
com/sun/corba/se/internal/util/Utility.java \
|
||||
com/sun/corba/se/internal/util/JDKBridge.java \
|
||||
com/sun/corba/se/internal/io/LibraryManager.java \
|
||||
com/sun/corba/se/internal/io/ObjectStreamClass.java \
|
||||
com/sun/corba/se/internal/io/TypeMismatchException.java \
|
||||
com/sun/corba/se/internal/util/RepositoryId.java
|
||||
|
@ -75,7 +75,7 @@ public class CorbaResourceUtil {
|
||||
args[1] = (arg1 != null ? arg1.toString() : "null");
|
||||
args[2] = (arg2 != null ? arg2.toString() : "null");
|
||||
|
||||
return java.text.MessageFormat.format(format, args);
|
||||
return java.text.MessageFormat.format(format, (Object[]) args);
|
||||
}
|
||||
|
||||
private static boolean resourcesInitialized = false;
|
||||
|
@ -350,7 +350,7 @@ public final class ObjectUtility {
|
||||
|
||||
if (useToString) {
|
||||
try {
|
||||
cls.getDeclaredMethod( "toString", null ) ;
|
||||
cls.getDeclaredMethod( "toString", (Class[])null ) ;
|
||||
return true ;
|
||||
} catch (Exception exc) {
|
||||
return false ;
|
||||
|
@ -108,8 +108,8 @@ public class ExceptionHandlerImpl implements ExceptionHandler
|
||||
|
||||
try {
|
||||
helperClass = Class.forName( helperName, true, loader ) ;
|
||||
Method idMethod = helperClass.getDeclaredMethod( "id", null ) ;
|
||||
setId( (String)idMethod.invoke( null, null ) ) ;
|
||||
Method idMethod = helperClass.getDeclaredMethod( "id", (Class[])null ) ;
|
||||
setId( (String)idMethod.invoke( null, (Object[])null ) ) ;
|
||||
} catch (Exception ex) {
|
||||
throw wrapper.badHelperIdMethod( ex, helperName ) ;
|
||||
}
|
||||
|
@ -589,7 +589,7 @@ abstract public class ORB {
|
||||
this.getClass().getMethod("create_operation_list", argc);
|
||||
|
||||
// OK, the method exists, so invoke it and be happy.
|
||||
Object[] argx = { oper };
|
||||
java.lang.Object[] argx = { oper };
|
||||
return (org.omg.CORBA.NVList)meth.invoke(this, argx);
|
||||
}
|
||||
catch( java.lang.reflect.InvocationTargetException exs ) {
|
||||
|
@ -187,7 +187,7 @@ public final class Bridge
|
||||
try {
|
||||
// Invoke the ObjectInputStream.latestUserDefinedLoader method
|
||||
return (ClassLoader)latestUserDefinedLoaderMethod.invoke(null,
|
||||
NO_ARGS);
|
||||
(Object[])NO_ARGS);
|
||||
} catch (InvocationTargetException ite) {
|
||||
Error err = new Error(
|
||||
"sun.corba.Bridge.latestUserDefinedLoader: " + ite ) ;
|
||||
|
@ -98,3 +98,11 @@ e0a1a502e402dbe7bf2d9102b4084a7e79a99a9b jdk7-b91
|
||||
d38f45079fe98792a7381dbb4b64f5b589ec8c58 jdk7-b94
|
||||
8bfe9058ca4661779ac1d0572329f3943e68362e hs19-b01
|
||||
91d861ba858daca645993a1ab6ba2fa06a8f4a5b jdk7-b95
|
||||
573e8ea5fd68e8e51eb6308d283ac3b3889d15e0 jdk7-b96
|
||||
573e8ea5fd68e8e51eb6308d283ac3b3889d15e0 hs19-b02
|
||||
5f42499e57adc16380780f40541e1a66cd601891 jdk7-b97
|
||||
8a045b3f5c13eaad92ff4baf15ca671845fcad1a jdk7-b98
|
||||
6a236384a379642b5a2398e2819db9ab4e711e9b jdk7-b99
|
||||
ad1977f08c4d69162a0775fe3f9576b9fd521d10 jdk7-b100
|
||||
6c3a919105b68c15b7db923ec9a00006e9560910 jdk7-b101
|
||||
ad1977f08c4d69162a0775fe3f9576b9fd521d10 hs19-b03
|
||||
|
@ -297,6 +297,7 @@ public class ConstantPool extends Oop implements ClassConstants {
|
||||
case JVM_CONSTANT_NameAndType: return "JVM_CONSTANT_NameAndType";
|
||||
case JVM_CONSTANT_MethodHandle: return "JVM_CONSTANT_MethodHandle";
|
||||
case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType";
|
||||
case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic";
|
||||
case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid";
|
||||
case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass";
|
||||
case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError";
|
||||
@ -355,6 +356,7 @@ public class ConstantPool extends Oop implements ClassConstants {
|
||||
case JVM_CONSTANT_NameAndType:
|
||||
case JVM_CONSTANT_MethodHandle:
|
||||
case JVM_CONSTANT_MethodType:
|
||||
case JVM_CONSTANT_InvokeDynamic:
|
||||
visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
|
||||
break;
|
||||
}
|
||||
@ -517,6 +519,18 @@ public class ConstantPool extends Oop implements ClassConstants {
|
||||
+ ", type = " + signatureIndex);
|
||||
break;
|
||||
}
|
||||
|
||||
case JVM_CONSTANT_InvokeDynamic: {
|
||||
dos.writeByte(cpConstType);
|
||||
int value = getIntAt(ci);
|
||||
short bootstrapMethodIndex = (short) extractLowShortFromInt(value);
|
||||
short nameAndTypeIndex = (short) extractHighShortFromInt(value);
|
||||
dos.writeShort(bootstrapMethodIndex);
|
||||
dos.writeShort(nameAndTypeIndex);
|
||||
if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bootstrapMethodIndex
|
||||
+ ", N&T = " + nameAndTypeIndex);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new InternalError("unknown tag: " + cpConstType);
|
||||
} // switch
|
||||
|
@ -42,6 +42,7 @@ public interface ClassConstants
|
||||
public static final int JVM_CONSTANT_NameAndType = 12;
|
||||
public static final int JVM_CONSTANT_MethodHandle = 15;
|
||||
public static final int JVM_CONSTANT_MethodType = 16;
|
||||
public static final int JVM_CONSTANT_InvokeDynamic = 17;
|
||||
|
||||
// JVM_CONSTANT_MethodHandle subtypes
|
||||
public static final int JVM_REF_getField = 1;
|
||||
|
@ -303,12 +303,12 @@ public class ClassWriter implements /* imports */ ClassConstants
|
||||
case JVM_CONSTANT_MethodHandle: {
|
||||
dos.writeByte(cpConstType);
|
||||
int value = cpool.getIntAt(ci);
|
||||
short refIndex = (short) extractHighShortFromInt(value);
|
||||
byte refKind = (byte) extractLowShortFromInt(value);
|
||||
dos.writeByte(refKind);
|
||||
dos.writeShort(refIndex);
|
||||
if (DEBUG) debugMessage("CP[" + ci + "] = MH index = " + refIndex
|
||||
+ ", kind = " + refKind);
|
||||
short bootstrapMethodIndex = (short) extractLowShortFromInt(value);
|
||||
short nameAndTypeIndex = (short) extractHighShortFromInt(value);
|
||||
dos.writeShort(bootstrapMethodIndex);
|
||||
dos.writeShort(nameAndTypeIndex);
|
||||
if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " +
|
||||
bootstrapMethodIndex + ", N&T = " + nameAndTypeIndex);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -321,6 +321,15 @@ public class ClassWriter implements /* imports */ ClassConstants
|
||||
break;
|
||||
}
|
||||
|
||||
case JVM_CONSTANT_InvokeDynamic: {
|
||||
dos.writeByte(cpConstType);
|
||||
int value = cpool.getIntAt(ci);
|
||||
short refIndex = (short) value;
|
||||
dos.writeShort(refIndex);
|
||||
if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new InternalError("Unknown tag: " + cpConstType);
|
||||
} // switch
|
||||
|
@ -582,6 +582,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
|
||||
buf.cell(Integer.toString(cpool.getIntAt(index)));
|
||||
break;
|
||||
|
||||
case JVM_CONSTANT_InvokeDynamic:
|
||||
buf.cell("JVM_CONSTANT_InvokeDynamic");
|
||||
buf.cell(genLowHighShort(cpool.getIntAt(index)));
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new InternalError("unknown tag: " + ctag);
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public class ConstantTag {
|
||||
private static int JVM_CONSTANT_NameAndType = 12;
|
||||
private static int JVM_CONSTANT_MethodHandle = 15; // JSR 292
|
||||
private static int JVM_CONSTANT_MethodType = 16; // JSR 292
|
||||
private static int JVM_CONSTANT_InvokeDynamic = 17; // JSR 292
|
||||
private static int JVM_CONSTANT_Invalid = 0; // For bad value initialization
|
||||
private static int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use
|
||||
private static int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool
|
||||
@ -78,6 +79,7 @@ public class ConstantTag {
|
||||
public boolean isUtf8() { return tag == JVM_CONSTANT_Utf8; }
|
||||
public boolean isMethodHandle() { return tag == JVM_CONSTANT_MethodHandle; }
|
||||
public boolean isMethodType() { return tag == JVM_CONSTANT_MethodType; }
|
||||
public boolean isInvokeDynamic() { return tag == JVM_CONSTANT_InvokeDynamic; }
|
||||
|
||||
public boolean isInvalid() { return tag == JVM_CONSTANT_Invalid; }
|
||||
|
||||
|
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2010
|
||||
|
||||
HS_MAJOR_VER=19
|
||||
HS_MINOR_VER=0
|
||||
HS_BUILD_NUMBER=02
|
||||
HS_BUILD_NUMBER=04
|
||||
|
||||
JDK_MAJOR_VER=1
|
||||
JDK_MINOR_VER=7
|
||||
|
@ -32,6 +32,17 @@ SLASH_JAVA ?= J:
|
||||
PATH_SEP = ;
|
||||
|
||||
# Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
|
||||
ifeq ($(ARCH_DATA_MODEL),32)
|
||||
ARCH_DATA_MODEL=32
|
||||
PLATFORM=windows-i586
|
||||
VM_PLATFORM=windows_i486
|
||||
HS_ARCH=x86
|
||||
MAKE_ARGS += ARCH=x86
|
||||
MAKE_ARGS += BUILDARCH=i486
|
||||
MAKE_ARGS += Platform_arch=x86
|
||||
MAKE_ARGS += Platform_arch_model=x86_32
|
||||
endif
|
||||
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) x86),)
|
||||
ARCH_DATA_MODEL=32
|
||||
PLATFORM=windows-i586
|
||||
@ -43,43 +54,57 @@ ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) x86),)
|
||||
MAKE_ARGS += Platform_arch_model=x86_32
|
||||
endif
|
||||
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) ia64),)
|
||||
ARCH_DATA_MODEL=64
|
||||
PLATFORM=windows-ia64
|
||||
VM_PLATFORM=windows_ia64
|
||||
HS_ARCH=ia64
|
||||
MAKE_ARGS += LP64=1
|
||||
MAKE_ARGS += ARCH=ia64
|
||||
MAKE_ARGS += BUILDARCH=ia64
|
||||
MAKE_ARGS += Platform_arch=ia64
|
||||
MAKE_ARGS += Platform_arch_model=ia64
|
||||
endif
|
||||
ifneq ($(ARCH_DATA_MODEL),32)
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) ia64),)
|
||||
ARCH_DATA_MODEL=64
|
||||
PLATFORM=windows-ia64
|
||||
VM_PLATFORM=windows_ia64
|
||||
HS_ARCH=ia64
|
||||
MAKE_ARGS += LP64=1
|
||||
MAKE_ARGS += ARCH=ia64
|
||||
MAKE_ARGS += BUILDARCH=ia64
|
||||
MAKE_ARGS += Platform_arch=ia64
|
||||
MAKE_ARGS += Platform_arch_model=ia64
|
||||
endif
|
||||
|
||||
# http://support.microsoft.com/kb/888731 : this can be either
|
||||
# AMD64 for AMD, or EM64T for Intel chips.
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
|
||||
ARCH_DATA_MODEL=64
|
||||
PLATFORM=windows-amd64
|
||||
VM_PLATFORM=windows_amd64
|
||||
HS_ARCH=x86
|
||||
MAKE_ARGS += LP64=1
|
||||
MAKE_ARGS += ARCH=x86
|
||||
MAKE_ARGS += BUILDARCH=amd64
|
||||
MAKE_ARGS += Platform_arch=x86
|
||||
MAKE_ARGS += Platform_arch_model=x86_64
|
||||
endif
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
|
||||
ARCH_DATA_MODEL=64
|
||||
PLATFORM=windows-amd64
|
||||
VM_PLATFORM=windows_amd64
|
||||
HS_ARCH=x86
|
||||
MAKE_ARGS += LP64=1
|
||||
MAKE_ARGS += ARCH=x86
|
||||
MAKE_ARGS += BUILDARCH=amd64
|
||||
MAKE_ARGS += Platform_arch=x86
|
||||
MAKE_ARGS += Platform_arch_model=x86_64
|
||||
endif
|
||||
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) EM64T),)
|
||||
ARCH_DATA_MODEL=64
|
||||
PLATFORM=windows-amd64
|
||||
VM_PLATFORM=windows_amd64
|
||||
HS_ARCH=x86
|
||||
MAKE_ARGS += LP64=1
|
||||
MAKE_ARGS += ARCH=x86
|
||||
MAKE_ARGS += BUILDARCH=amd64
|
||||
MAKE_ARGS += Platform_arch=x86
|
||||
MAKE_ARGS += Platform_arch_model=x86_64
|
||||
endif
|
||||
|
||||
# NB later OS versions than 2003 may report "Intel64"
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) "EM64T\|Intel64"),)
|
||||
ARCH_DATA_MODEL=64
|
||||
PLATFORM=windows-amd64
|
||||
VM_PLATFORM=windows_amd64
|
||||
HS_ARCH=x86
|
||||
MAKE_ARGS += LP64=1
|
||||
MAKE_ARGS += ARCH=x86
|
||||
MAKE_ARGS += BUILDARCH=amd64
|
||||
MAKE_ARGS += Platform_arch=x86
|
||||
MAKE_ARGS += Platform_arch_model=x86_64
|
||||
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) Intel64),)
|
||||
ARCH_DATA_MODEL=64
|
||||
PLATFORM=windows-amd64
|
||||
VM_PLATFORM=windows_amd64
|
||||
HS_ARCH=x86
|
||||
MAKE_ARGS += LP64=1
|
||||
MAKE_ARGS += ARCH=x86
|
||||
MAKE_ARGS += BUILDARCH=amd64
|
||||
MAKE_ARGS += Platform_arch=x86
|
||||
MAKE_ARGS += Platform_arch_model=x86_64
|
||||
endif
|
||||
endif
|
||||
|
||||
JDK_INCLUDE_SUBDIR=win32
|
||||
|
@ -1007,9 +1007,9 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ brx(Assembler::lessEqualUnsigned, false, Assembler::pt, (*NOLp));
|
||||
__ delayed()->cmp(to_from, byte_count);
|
||||
if (NOLp == NULL)
|
||||
__ brx(Assembler::greaterEqual, false, Assembler::pt, no_overlap_target);
|
||||
__ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, no_overlap_target);
|
||||
else
|
||||
__ brx(Assembler::greaterEqual, false, Assembler::pt, (*NOLp));
|
||||
__ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, (*NOLp));
|
||||
__ delayed()->nop();
|
||||
}
|
||||
|
||||
|
@ -728,8 +728,8 @@ ciMethod* ciEnv::get_fake_invokedynamic_method_impl(constantPoolHandle cpool,
|
||||
}
|
||||
|
||||
// Get the invoker methodOop from the constant pool.
|
||||
intptr_t f2_value = cpool->cache()->main_entry_at(index)->f2();
|
||||
methodOop signature_invoker = methodOop(f2_value);
|
||||
oop f1_value = cpool->cache()->main_entry_at(index)->f1();
|
||||
methodOop signature_invoker = methodOop(f1_value);
|
||||
assert(signature_invoker != NULL && signature_invoker->is_method() && signature_invoker->is_method_handle_invoke(),
|
||||
"correct result from LinkResolver::resolve_invokedynamic");
|
||||
|
||||
|
@ -694,30 +694,21 @@ int ciMethod::scale_count(int count, float prof_factor) {
|
||||
// ------------------------------------------------------------------
|
||||
// ciMethod::is_method_handle_invoke
|
||||
//
|
||||
// Return true if the method is a MethodHandle target.
|
||||
// Return true if the method is an instance of one of the two
|
||||
// signature-polymorphic MethodHandle methods, invokeExact or invokeGeneric.
|
||||
bool ciMethod::is_method_handle_invoke() const {
|
||||
bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() &&
|
||||
methodOopDesc::is_method_handle_invoke_name(name()->sid()));
|
||||
#ifdef ASSERT
|
||||
if (is_loaded()) {
|
||||
bool flag2 = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS);
|
||||
{
|
||||
VM_ENTRY_MARK;
|
||||
bool flag3 = get_methodOop()->is_method_handle_invoke();
|
||||
assert(flag2 == flag3, "consistent");
|
||||
assert(flag == flag3, "consistent");
|
||||
}
|
||||
}
|
||||
#endif //ASSERT
|
||||
return flag;
|
||||
if (!is_loaded()) return false;
|
||||
VM_ENTRY_MARK;
|
||||
return get_methodOop()->is_method_handle_invoke();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciMethod::is_method_handle_adapter
|
||||
//
|
||||
// Return true if the method is a generated MethodHandle adapter.
|
||||
// These are built by MethodHandleCompiler.
|
||||
bool ciMethod::is_method_handle_adapter() const {
|
||||
check_is_loaded();
|
||||
if (!is_loaded()) return false;
|
||||
VM_ENTRY_MARK;
|
||||
return get_methodOop()->is_method_handle_adapter();
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len
|
||||
if (!EnableMethodHandles ||
|
||||
_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
|
||||
classfile_parse_error(
|
||||
(!EnableInvokeDynamic ?
|
||||
(!EnableMethodHandles ?
|
||||
"This JVM does not support constant tag %u in class file %s" :
|
||||
"Class file version does not support constant tag %u in class file %s"),
|
||||
tag, CHECK);
|
||||
@ -140,6 +140,22 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
break;
|
||||
case JVM_CONSTANT_InvokeDynamic :
|
||||
{
|
||||
if (!EnableInvokeDynamic ||
|
||||
_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
|
||||
classfile_parse_error(
|
||||
(!EnableInvokeDynamic ?
|
||||
"This JVM does not support constant tag %u in class file %s" :
|
||||
"Class file version does not support constant tag %u in class file %s"),
|
||||
tag, CHECK);
|
||||
}
|
||||
cfs->guarantee_more(5, CHECK); // bsm_index, name_and_type_index, tag/access_flags
|
||||
u2 bootstrap_method_index = cfs->get_u2_fast();
|
||||
u2 name_and_type_index = cfs->get_u2_fast();
|
||||
cp->invoke_dynamic_at_put(index, bootstrap_method_index, name_and_type_index);
|
||||
}
|
||||
break;
|
||||
case JVM_CONSTANT_Integer :
|
||||
{
|
||||
cfs->guarantee_more(5, CHECK); // bytes, tag/access_flags
|
||||
@ -414,6 +430,24 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
||||
ref_index, CHECK_(nullHandle));
|
||||
}
|
||||
break;
|
||||
case JVM_CONSTANT_InvokeDynamic :
|
||||
{
|
||||
int bootstrap_method_ref_index = cp->invoke_dynamic_bootstrap_method_ref_index_at(index);
|
||||
int name_and_type_ref_index = cp->invoke_dynamic_name_and_type_ref_index_at(index);
|
||||
check_property((bootstrap_method_ref_index == 0 && AllowTransitionalJSR292)
|
||||
||
|
||||
(valid_cp_range(bootstrap_method_ref_index, length) &&
|
||||
cp->tag_at(bootstrap_method_ref_index).is_method_handle()),
|
||||
"Invalid constant pool index %u in class file %s",
|
||||
bootstrap_method_ref_index,
|
||||
CHECK_(nullHandle));
|
||||
check_property(valid_cp_range(name_and_type_ref_index, length) &&
|
||||
cp->tag_at(name_and_type_ref_index).is_name_and_type(),
|
||||
"Invalid constant pool index %u in class file %s",
|
||||
name_and_type_ref_index,
|
||||
CHECK_(nullHandle));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
fatal(err_msg("bad constant pool tag value %u",
|
||||
cp->tag_at(index).value()));
|
||||
|
@ -2507,6 +2507,10 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
|
||||
int caller_bci,
|
||||
TRAPS) {
|
||||
Handle empty;
|
||||
guarantee(bootstrap_method.not_null() &&
|
||||
java_dyn_MethodHandle::is_instance(bootstrap_method()),
|
||||
"caller must supply a valid BSM");
|
||||
|
||||
Handle caller_mname = MethodHandles::new_MemberName(CHECK_(empty));
|
||||
MethodHandles::init_MemberName(caller_mname(), caller_method());
|
||||
|
||||
@ -2537,20 +2541,61 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
|
||||
return call_site_oop;
|
||||
}
|
||||
|
||||
Handle SystemDictionary::find_bootstrap_method(KlassHandle caller, TRAPS) {
|
||||
Handle SystemDictionary::find_bootstrap_method(methodHandle caller_method, int caller_bci,
|
||||
int cache_index, TRAPS) {
|
||||
Handle empty;
|
||||
if (!caller->oop_is_instance()) return empty;
|
||||
|
||||
instanceKlassHandle ik(THREAD, caller());
|
||||
constantPoolHandle pool;
|
||||
{
|
||||
klassOop caller = caller_method->method_holder();
|
||||
if (!Klass::cast(caller)->oop_is_instance()) return empty;
|
||||
pool = constantPoolHandle(THREAD, instanceKlass::cast(caller)->constants());
|
||||
}
|
||||
|
||||
oop boot_method_oop = ik->bootstrap_method();
|
||||
if (boot_method_oop != NULL) {
|
||||
if (TraceMethodHandles) {
|
||||
tty->print_cr("bootstrap method for "PTR_FORMAT" cached as "PTR_FORMAT":", ik(), boot_method_oop);
|
||||
int constant_pool_index = pool->cache()->entry_at(cache_index)->constant_pool_index();
|
||||
constantTag tag = pool->tag_at(constant_pool_index);
|
||||
|
||||
if (tag.is_invoke_dynamic()) {
|
||||
// JVM_CONSTANT_InvokeDynamic is an ordered pair of [bootm, name&type]
|
||||
// The bootm, being a JVM_CONSTANT_MethodHandle, has its own cache entry.
|
||||
int bsm_index = pool->invoke_dynamic_bootstrap_method_ref_index_at(constant_pool_index);
|
||||
if (bsm_index != 0) {
|
||||
int bsm_index_in_cache = pool->cache()->entry_at(cache_index)->bootstrap_method_index_in_cache();
|
||||
DEBUG_ONLY(int bsm_index_2 = pool->cache()->entry_at(bsm_index_in_cache)->constant_pool_index());
|
||||
assert(bsm_index == bsm_index_2, "BSM constant lifted to cache");
|
||||
if (TraceMethodHandles) {
|
||||
tty->print_cr("resolving bootstrap method for "PTR_FORMAT" at %d at cache[%d]CP[%d]...",
|
||||
(intptr_t) caller_method(), caller_bci, cache_index, constant_pool_index);
|
||||
}
|
||||
oop bsm_oop = pool->resolve_cached_constant_at(bsm_index_in_cache, CHECK_(empty));
|
||||
if (TraceMethodHandles) {
|
||||
tty->print_cr("bootstrap method for "PTR_FORMAT" at %d retrieved as "PTR_FORMAT":",
|
||||
(intptr_t) caller_method(), caller_bci, (intptr_t) bsm_oop);
|
||||
}
|
||||
assert(bsm_oop->is_oop()
|
||||
&& java_dyn_MethodHandle::is_instance(bsm_oop), "must be sane");
|
||||
return Handle(THREAD, bsm_oop);
|
||||
}
|
||||
assert(boot_method_oop->is_oop()
|
||||
&& java_dyn_MethodHandle::is_instance(boot_method_oop), "must be sane");
|
||||
return Handle(THREAD, boot_method_oop);
|
||||
// else null BSM; fall through
|
||||
} else if (tag.is_name_and_type()) {
|
||||
// JSR 292 EDR does not have JVM_CONSTANT_InvokeDynamic
|
||||
// a bare name&type defaults its BSM to null, so fall through...
|
||||
} else {
|
||||
ShouldNotReachHere(); // verifier does not allow this
|
||||
}
|
||||
|
||||
// Fall through to pick up the per-class bootstrap method.
|
||||
// This mechanism may go away in the PFD.
|
||||
assert(AllowTransitionalJSR292, "else the verifier should have stopped us already");
|
||||
oop bsm_oop = instanceKlass::cast(caller_method->method_holder())->bootstrap_method();
|
||||
if (bsm_oop != NULL) {
|
||||
if (TraceMethodHandles) {
|
||||
tty->print_cr("bootstrap method for "PTR_FORMAT" registered as "PTR_FORMAT":",
|
||||
(intptr_t) caller_method(), (intptr_t) bsm_oop);
|
||||
}
|
||||
assert(bsm_oop->is_oop()
|
||||
&& java_dyn_MethodHandle::is_instance(bsm_oop), "must be sane");
|
||||
return Handle(THREAD, bsm_oop);
|
||||
}
|
||||
|
||||
return empty;
|
||||
|
@ -492,7 +492,10 @@ public:
|
||||
TRAPS);
|
||||
|
||||
// coordinate with Java about bootstrap methods
|
||||
static Handle find_bootstrap_method(KlassHandle caller, TRAPS);
|
||||
static Handle find_bootstrap_method(methodHandle caller_method,
|
||||
int caller_bci, // N.B. must be an invokedynamic
|
||||
int cache_index, // must be corresponding main_entry
|
||||
TRAPS);
|
||||
|
||||
// Utility for printing loader "name" as part of tracing constraints
|
||||
static const char* loader_name(oop loader) {
|
||||
|
@ -1909,7 +1909,8 @@ void ClassVerifier::verify_invoke_instructions(
|
||||
unsigned int types = (opcode == Bytecodes::_invokeinterface
|
||||
? 1 << JVM_CONSTANT_InterfaceMethodref
|
||||
: opcode == Bytecodes::_invokedynamic
|
||||
? 1 << JVM_CONSTANT_NameAndType
|
||||
? (1 << JVM_CONSTANT_NameAndType
|
||||
|1 << JVM_CONSTANT_InvokeDynamic)
|
||||
: 1 << JVM_CONSTANT_Methodref);
|
||||
verify_cp_type(index, cp, types, CHECK_VERIFY(this));
|
||||
|
||||
|
@ -202,6 +202,11 @@ void BufferBlob::free( BufferBlob *blob ) {
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Implementation of AdapterBlob
|
||||
|
||||
AdapterBlob::AdapterBlob(int size, CodeBuffer* cb) :
|
||||
BufferBlob("I2C/C2I adapters", size, cb) {
|
||||
CodeCache::commit(this);
|
||||
}
|
||||
|
||||
AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
|
||||
@ -210,7 +215,6 @@ AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
|
||||
{
|
||||
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
blob = new (size) AdapterBlob(size, cb);
|
||||
CodeCache::commit(blob);
|
||||
}
|
||||
// Track memory usage statistic after releasing CodeCache_lock
|
||||
MemoryService::track_code_cache_memory_usage();
|
||||
|
@ -219,8 +219,7 @@ class BufferBlob: public CodeBlob {
|
||||
|
||||
class AdapterBlob: public BufferBlob {
|
||||
private:
|
||||
AdapterBlob(int size) : BufferBlob("I2C/C2I adapters", size) {}
|
||||
AdapterBlob(int size, CodeBuffer* cb) : BufferBlob("I2C/C2I adapters", size, cb) {}
|
||||
AdapterBlob(int size, CodeBuffer* cb);
|
||||
|
||||
public:
|
||||
// Creation
|
||||
|
@ -664,19 +664,14 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
||||
return;
|
||||
}
|
||||
|
||||
// XXX use a global constant instead of 64!
|
||||
typedef struct OopTaskQueuePadded {
|
||||
OopTaskQueue work_queue;
|
||||
char pad[64 - sizeof(OopTaskQueue)]; // prevent false sharing
|
||||
} OopTaskQueuePadded;
|
||||
|
||||
typedef Padded<OopTaskQueue> PaddedOopTaskQueue;
|
||||
for (i = 0; i < num_queues; i++) {
|
||||
OopTaskQueuePadded *q_padded = new OopTaskQueuePadded();
|
||||
if (q_padded == NULL) {
|
||||
PaddedOopTaskQueue *q = new PaddedOopTaskQueue();
|
||||
if (q == NULL) {
|
||||
warning("work_queue allocation failure.");
|
||||
return;
|
||||
}
|
||||
_task_queues->register_queue(i, &q_padded->work_queue);
|
||||
_task_queues->register_queue(i, q);
|
||||
}
|
||||
for (i = 0; i < num_queues; i++) {
|
||||
_task_queues->queue(i)->initialize();
|
||||
|
@ -234,6 +234,11 @@ void VM_GenCollectFullConcurrent::doit_epilogue() {
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
if (_gc_cause != GCCause::_gc_locker &&
|
||||
gch->total_full_collections_completed() <= _full_gc_count_before) {
|
||||
// maybe we should change the condition to test _gc_cause ==
|
||||
// GCCause::_java_lang_system_gc, instead of
|
||||
// _gc_cause != GCCause::_gc_locker
|
||||
assert(_gc_cause == GCCause::_java_lang_system_gc,
|
||||
"the only way to get here if this was a System.gc()-induced GC");
|
||||
assert(ExplicitGCInvokesConcurrent, "Error");
|
||||
// Now, wait for witnessing concurrent gc cycle to complete,
|
||||
// but do so in native mode, because we want to lock the
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -271,21 +271,16 @@ jbyte* ConcurrentG1Refine::add_card_count(jbyte* card_ptr, int* count, bool* def
|
||||
if (cas_res == prev_epoch_entry) {
|
||||
// We successfully updated the card num value in the epoch entry
|
||||
count_ptr->_count = 0; // initialize counter for new card num
|
||||
jbyte* old_card_ptr = card_num_2_ptr(old_card_num);
|
||||
|
||||
// Even though the region containg the card at old_card_num was not
|
||||
// in the young list when old_card_num was recorded in the epoch
|
||||
// cache it could have been added to the free list and subsequently
|
||||
// added to the young list in the intervening time. If the evicted
|
||||
// card is in a young region just return the card_ptr and the evicted
|
||||
// card will not be cleaned. See CR 6817995.
|
||||
|
||||
jbyte* old_card_ptr = card_num_2_ptr(old_card_num);
|
||||
if (is_young_card(old_card_ptr)) {
|
||||
*count = 0;
|
||||
// We can defer the processing of card_ptr
|
||||
*defer = true;
|
||||
return card_ptr;
|
||||
}
|
||||
// added to the young list in the intervening time. See CR 6817995.
|
||||
// We do not deal with this case here - it will be handled in
|
||||
// HeapRegion::oops_on_card_seq_iterate_careful after it has been
|
||||
// determined that the region containing the card has been allocated
|
||||
// to, and it's safe to check the young type of the region.
|
||||
|
||||
// We do not want to defer processing of card_ptr in this case
|
||||
// (we need to refine old_card_ptr and card_ptr)
|
||||
@ -301,22 +296,22 @@ jbyte* ConcurrentG1Refine::cache_insert(jbyte* card_ptr, bool* defer) {
|
||||
jbyte* cached_ptr = add_card_count(card_ptr, &count, defer);
|
||||
assert(cached_ptr != NULL, "bad cached card ptr");
|
||||
|
||||
if (is_young_card(cached_ptr)) {
|
||||
// The region containing cached_ptr has been freed during a clean up
|
||||
// pause, reallocated, and tagged as young.
|
||||
assert(cached_ptr != card_ptr, "shouldn't be");
|
||||
// We've just inserted a card pointer into the card count cache
|
||||
// and got back the card that we just inserted or (evicted) the
|
||||
// previous contents of that count slot.
|
||||
|
||||
// We've just inserted a new old-gen card pointer into the card count
|
||||
// cache and evicted the previous contents of that count slot.
|
||||
// The evicted card pointer has been determined to be in a young region
|
||||
// and so cannot be the newly inserted card pointer (that will be
|
||||
// in an old region).
|
||||
// The count for newly inserted card will be set to zero during the
|
||||
// insertion, so we don't want to defer the cleaning of the newly
|
||||
// inserted card pointer.
|
||||
assert(*defer == false, "deferring non-hot card");
|
||||
return NULL;
|
||||
}
|
||||
// The card we got back could be in a young region. When the
|
||||
// returned card (if evicted) was originally inserted, we had
|
||||
// determined that its containing region was not young. However
|
||||
// it is possible for the region to be freed during a cleanup
|
||||
// pause, then reallocated and tagged as young which will result
|
||||
// in the returned card residing in a young region.
|
||||
//
|
||||
// We do not deal with this case here - the change from non-young
|
||||
// to young could be observed at any time - it will be handled in
|
||||
// HeapRegion::oops_on_card_seq_iterate_careful after it has been
|
||||
// determined that the region containing the card has been allocated
|
||||
// to.
|
||||
|
||||
// The card pointer we obtained from card count cache is not hot
|
||||
// so do not store it in the cache; return it for immediate
|
||||
@ -325,7 +320,7 @@ jbyte* ConcurrentG1Refine::cache_insert(jbyte* card_ptr, bool* defer) {
|
||||
return cached_ptr;
|
||||
}
|
||||
|
||||
// Otherwise, the pointer we got from the _card_counts is hot.
|
||||
// Otherwise, the pointer we got from the _card_counts cache is hot.
|
||||
jbyte* res = NULL;
|
||||
MutexLockerEx x(HotCardCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
if (_n_hot == _hot_cache_size) {
|
||||
@ -338,17 +333,8 @@ jbyte* ConcurrentG1Refine::cache_insert(jbyte* card_ptr, bool* defer) {
|
||||
if (_hot_cache_idx == _hot_cache_size) _hot_cache_idx = 0;
|
||||
_n_hot++;
|
||||
|
||||
if (res != NULL) {
|
||||
// Even though the region containg res was not in the young list
|
||||
// when it was recorded in the hot cache it could have been added
|
||||
// to the free list and subsequently added to the young list in
|
||||
// the intervening time. If res is in a young region, return NULL
|
||||
// so that res is not cleaned. See CR 6817995.
|
||||
|
||||
if (is_young_card(res)) {
|
||||
res = NULL;
|
||||
}
|
||||
}
|
||||
// The card obtained from the hot card cache could be in a young
|
||||
// region. See above on how this can happen.
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -266,6 +266,12 @@ void ConcurrentMarkThread::run() {
|
||||
_cm->clearNextBitmap();
|
||||
_sts.leave();
|
||||
}
|
||||
|
||||
// Update the number of full collections that have been
|
||||
// completed. This will also notify the FullGCCount_lock in case a
|
||||
// Java thread is waiting for a full GC to happen (e.g., it
|
||||
// called System.gc() with +ExplicitGCInvokesConcurrent).
|
||||
g1->increment_full_collections_completed(true /* outer */);
|
||||
}
|
||||
assert(_should_terminate, "just checking");
|
||||
|
||||
|
@ -638,6 +638,11 @@ G1CollectedHeap::attempt_allocation_slow(size_t word_size,
|
||||
|
||||
// Now retry the allocation.
|
||||
if (_cur_alloc_region != NULL) {
|
||||
if (allocated_young_region != NULL) {
|
||||
// We need to ensure that the store to top does not
|
||||
// float above the setting of the young type.
|
||||
OrderAccess::storestore();
|
||||
}
|
||||
res = _cur_alloc_region->allocate(word_size);
|
||||
}
|
||||
}
|
||||
@ -809,7 +814,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs,
|
||||
void G1CollectedHeap::do_collection(bool explicit_gc,
|
||||
bool clear_all_soft_refs,
|
||||
size_t word_size) {
|
||||
if (GC_locker::check_active_before_gc()) {
|
||||
return; // GC is disabled (e.g. JNI GetXXXCritical operation)
|
||||
@ -821,10 +827,6 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs,
|
||||
Universe::print_heap_before_gc();
|
||||
}
|
||||
|
||||
if (full && DisableExplicitGC) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint");
|
||||
assert(Thread::current() == VMThread::vm_thread(), "should be in vm thread");
|
||||
|
||||
@ -837,9 +839,11 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs,
|
||||
IsGCActiveMark x;
|
||||
|
||||
// Timing
|
||||
bool system_gc = (gc_cause() == GCCause::_java_lang_system_gc);
|
||||
assert(!system_gc || explicit_gc, "invariant");
|
||||
gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
|
||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||
TraceTime t(full ? "Full GC (System.gc())" : "Full GC",
|
||||
TraceTime t(system_gc ? "Full GC (System.gc())" : "Full GC",
|
||||
PrintGC, true, gclog_or_tty);
|
||||
|
||||
TraceMemoryManagerStats tms(true /* fullGC */);
|
||||
@ -944,7 +948,7 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs,
|
||||
heap_region_iterate(&rs_clear);
|
||||
|
||||
// Resize the heap if necessary.
|
||||
resize_if_necessary_after_full_collection(full ? 0 : word_size);
|
||||
resize_if_necessary_after_full_collection(explicit_gc ? 0 : word_size);
|
||||
|
||||
if (_cg1r->use_cache()) {
|
||||
_cg1r->clear_and_record_card_counts();
|
||||
@ -1009,13 +1013,18 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs,
|
||||
"young list should be empty at this point");
|
||||
}
|
||||
|
||||
// Update the number of full collections that have been completed.
|
||||
increment_full_collections_completed(false /* outer */);
|
||||
|
||||
if (PrintHeapAtGC) {
|
||||
Universe::print_heap_after_gc();
|
||||
}
|
||||
}
|
||||
|
||||
void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) {
|
||||
do_collection(true, clear_all_soft_refs, 0);
|
||||
do_collection(true, /* explicit_gc */
|
||||
clear_all_soft_refs,
|
||||
0 /* word_size */);
|
||||
}
|
||||
|
||||
// This code is mostly copied from TenuredGeneration.
|
||||
@ -1331,6 +1340,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
|
||||
_young_list(new YoungList(this)),
|
||||
_gc_time_stamp(0),
|
||||
_surviving_young_words(NULL),
|
||||
_full_collections_completed(0),
|
||||
_in_cset_fast_test(NULL),
|
||||
_in_cset_fast_test_base(NULL),
|
||||
_dirty_cards_region_list(NULL) {
|
||||
@ -1689,6 +1699,51 @@ size_t G1CollectedHeap::unsafe_max_alloc() {
|
||||
return car->free();
|
||||
}
|
||||
|
||||
bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
|
||||
return
|
||||
((cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) ||
|
||||
(cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent));
|
||||
}
|
||||
|
||||
void G1CollectedHeap::increment_full_collections_completed(bool outer) {
|
||||
MonitorLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
|
||||
|
||||
// We have already incremented _total_full_collections at the start
|
||||
// of the GC, so total_full_collections() represents how many full
|
||||
// collections have been started.
|
||||
unsigned int full_collections_started = total_full_collections();
|
||||
|
||||
// Given that this method is called at the end of a Full GC or of a
|
||||
// concurrent cycle, and those can be nested (i.e., a Full GC can
|
||||
// interrupt a concurrent cycle), the number of full collections
|
||||
// completed should be either one (in the case where there was no
|
||||
// nesting) or two (when a Full GC interrupted a concurrent cycle)
|
||||
// behind the number of full collections started.
|
||||
|
||||
// This is the case for the inner caller, i.e. a Full GC.
|
||||
assert(outer ||
|
||||
(full_collections_started == _full_collections_completed + 1) ||
|
||||
(full_collections_started == _full_collections_completed + 2),
|
||||
err_msg("for inner caller: full_collections_started = %u "
|
||||
"is inconsistent with _full_collections_completed = %u",
|
||||
full_collections_started, _full_collections_completed));
|
||||
|
||||
// This is the case for the outer caller, i.e. the concurrent cycle.
|
||||
assert(!outer ||
|
||||
(full_collections_started == _full_collections_completed + 1),
|
||||
err_msg("for outer caller: full_collections_started = %u "
|
||||
"is inconsistent with _full_collections_completed = %u",
|
||||
full_collections_started, _full_collections_completed));
|
||||
|
||||
_full_collections_completed += 1;
|
||||
|
||||
// This notify_all() will ensure that a thread that called
|
||||
// System.gc() with (with ExplicitGCInvokesConcurrent set or not)
|
||||
// and it's waiting for a full GC to finish will be woken up. It is
|
||||
// waiting in VM_G1IncCollectionPause::doit_epilogue().
|
||||
FullGCCount_lock->notify_all();
|
||||
}
|
||||
|
||||
void G1CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) {
|
||||
assert(Thread::current()->is_VM_thread(), "Precondition#1");
|
||||
assert(Heap_lock->is_locked(), "Precondition#2");
|
||||
@ -1709,25 +1764,41 @@ void G1CollectedHeap::collect(GCCause::Cause cause) {
|
||||
// The caller doesn't have the Heap_lock
|
||||
assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock");
|
||||
|
||||
int gc_count_before;
|
||||
unsigned int gc_count_before;
|
||||
unsigned int full_gc_count_before;
|
||||
{
|
||||
MutexLocker ml(Heap_lock);
|
||||
// Read the GC count while holding the Heap_lock
|
||||
gc_count_before = SharedHeap::heap()->total_collections();
|
||||
full_gc_count_before = SharedHeap::heap()->total_full_collections();
|
||||
|
||||
// Don't want to do a GC until cleanup is completed.
|
||||
wait_for_cleanup_complete();
|
||||
} // We give up heap lock; VMThread::execute gets it back below
|
||||
switch (cause) {
|
||||
case GCCause::_scavenge_alot: {
|
||||
// Do an incremental pause, which might sometimes be abandoned.
|
||||
VM_G1IncCollectionPause op(gc_count_before, cause);
|
||||
|
||||
// We give up heap lock; VMThread::execute gets it back below
|
||||
}
|
||||
|
||||
if (should_do_concurrent_full_gc(cause)) {
|
||||
// Schedule an initial-mark evacuation pause that will start a
|
||||
// concurrent cycle.
|
||||
VM_G1IncCollectionPause op(gc_count_before,
|
||||
true, /* should_initiate_conc_mark */
|
||||
g1_policy()->max_pause_time_ms(),
|
||||
cause);
|
||||
VMThread::execute(&op);
|
||||
} else {
|
||||
if (cause == GCCause::_gc_locker
|
||||
DEBUG_ONLY(|| cause == GCCause::_scavenge_alot)) {
|
||||
|
||||
// Schedule a standard evacuation pause.
|
||||
VM_G1IncCollectionPause op(gc_count_before,
|
||||
false, /* should_initiate_conc_mark */
|
||||
g1_policy()->max_pause_time_ms(),
|
||||
cause);
|
||||
VMThread::execute(&op);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// In all other cases, we currently do a full gc.
|
||||
VM_G1CollectFull op(gc_count_before, cause);
|
||||
} else {
|
||||
// Schedule a Full GC.
|
||||
VM_G1CollectFull op(gc_count_before, full_gc_count_before, cause);
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
}
|
||||
@ -1989,6 +2060,11 @@ void G1CollectedHeap::collection_set_iterate(HeapRegionClosure* cl) {
|
||||
|
||||
void G1CollectedHeap::collection_set_iterate_from(HeapRegion* r,
|
||||
HeapRegionClosure *cl) {
|
||||
if (r == NULL) {
|
||||
// The CSet is empty so there's nothing to do.
|
||||
return;
|
||||
}
|
||||
|
||||
assert(r->in_collection_set(),
|
||||
"Start region must be a member of the collection set.");
|
||||
HeapRegion* cur = r;
|
||||
@ -2481,11 +2557,13 @@ void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) {
|
||||
}
|
||||
|
||||
void G1CollectedHeap::do_collection_pause() {
|
||||
assert(Heap_lock->owned_by_self(), "we assume we'reholding the Heap_lock");
|
||||
|
||||
// Read the GC count while holding the Heap_lock
|
||||
// we need to do this _before_ wait_for_cleanup_complete(), to
|
||||
// ensure that we do not give up the heap lock and potentially
|
||||
// pick up the wrong count
|
||||
int gc_count_before = SharedHeap::heap()->total_collections();
|
||||
unsigned int gc_count_before = SharedHeap::heap()->total_collections();
|
||||
|
||||
// Don't want to do a GC pause while cleanup is being completed!
|
||||
wait_for_cleanup_complete();
|
||||
@ -2493,7 +2571,10 @@ void G1CollectedHeap::do_collection_pause() {
|
||||
g1_policy()->record_stop_world_start();
|
||||
{
|
||||
MutexUnlocker mu(Heap_lock); // give up heap lock, execute gets it back
|
||||
VM_G1IncCollectionPause op(gc_count_before);
|
||||
VM_G1IncCollectionPause op(gc_count_before,
|
||||
false, /* should_initiate_conc_mark */
|
||||
g1_policy()->max_pause_time_ms(),
|
||||
GCCause::_g1_inc_collection_pause);
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
}
|
||||
@ -2612,7 +2693,7 @@ struct PrepareForRSScanningClosure : public HeapRegionClosure {
|
||||
};
|
||||
|
||||
void
|
||||
G1CollectedHeap::do_collection_pause_at_safepoint() {
|
||||
G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
||||
if (GC_locker::check_active_before_gc()) {
|
||||
return; // GC is disabled (e.g. JNI GetXXXCritical operation)
|
||||
}
|
||||
@ -2637,8 +2718,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint() {
|
||||
else
|
||||
strcat(verbose_str, "(partial)");
|
||||
}
|
||||
if (g1_policy()->during_initial_mark_pause())
|
||||
if (g1_policy()->during_initial_mark_pause()) {
|
||||
strcat(verbose_str, " (initial-mark)");
|
||||
// We are about to start a marking cycle, so we increment the
|
||||
// full collection counter.
|
||||
increment_total_full_collections();
|
||||
}
|
||||
|
||||
// if PrintGCDetails is on, we'll print long statistics information
|
||||
// in the collector policy code, so let's not print this as the output
|
||||
@ -2661,7 +2746,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint() {
|
||||
"young list should be well formed");
|
||||
}
|
||||
|
||||
bool abandoned = false;
|
||||
{ // Call to jvmpi::post_class_unload_events must occur outside of active GC
|
||||
IsGCActiveMark x;
|
||||
|
||||
@ -2743,7 +2827,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint() {
|
||||
|
||||
// Now choose the CS. We may abandon a pause if we find no
|
||||
// region that will fit in the MMU pause.
|
||||
bool abandoned = g1_policy()->choose_collection_set();
|
||||
bool abandoned = g1_policy()->choose_collection_set(target_pause_time_ms);
|
||||
|
||||
// Nothing to do if we were unable to choose a collection set.
|
||||
if (!abandoned) {
|
||||
|
@ -277,6 +277,18 @@ private:
|
||||
void update_surviving_young_words(size_t* surv_young_words);
|
||||
void cleanup_surviving_young_words();
|
||||
|
||||
// It decides whether an explicit GC should start a concurrent cycle
|
||||
// instead of doing a STW GC. Currently, a concurrent cycle is
|
||||
// explicitly started if:
|
||||
// (a) cause == _gc_locker and +GCLockerInvokesConcurrent, or
|
||||
// (b) cause == _java_lang_system_gc and +ExplicitGCInvokesConcurrent.
|
||||
bool should_do_concurrent_full_gc(GCCause::Cause cause);
|
||||
|
||||
// Keeps track of how many "full collections" (i.e., Full GCs or
|
||||
// concurrent cycles) we have completed. The number of them we have
|
||||
// started is maintained in _total_full_collections in CollectedHeap.
|
||||
volatile unsigned int _full_collections_completed;
|
||||
|
||||
protected:
|
||||
|
||||
// Returns "true" iff none of the gc alloc regions have any allocations
|
||||
@ -356,13 +368,14 @@ protected:
|
||||
// GC pause.
|
||||
void retire_alloc_region(HeapRegion* alloc_region, bool par);
|
||||
|
||||
// Helper function for two callbacks below.
|
||||
// "full", if true, indicates that the GC is for a System.gc() request,
|
||||
// and should collect the entire heap. If "clear_all_soft_refs" is true,
|
||||
// all soft references are cleared during the GC. If "full" is false,
|
||||
// "word_size" describes the allocation that the GC should
|
||||
// attempt (at least) to satisfy.
|
||||
void do_collection(bool full, bool clear_all_soft_refs,
|
||||
// - if explicit_gc is true, the GC is for a System.gc() or a heap
|
||||
// inspection request and should collect the entire heap
|
||||
// - if clear_all_soft_refs is true, all soft references are cleared
|
||||
// during the GC
|
||||
// - if explicit_gc is false, word_size describes the allocation that
|
||||
// the GC should attempt (at least) to satisfy
|
||||
void do_collection(bool explicit_gc,
|
||||
bool clear_all_soft_refs,
|
||||
size_t word_size);
|
||||
|
||||
// Callback from VM_G1CollectFull operation.
|
||||
@ -431,6 +444,26 @@ public:
|
||||
_in_cset_fast_test_length * sizeof(bool));
|
||||
}
|
||||
|
||||
// This is called at the end of either a concurrent cycle or a Full
|
||||
// GC to update the number of full collections completed. Those two
|
||||
// can happen in a nested fashion, i.e., we start a concurrent
|
||||
// cycle, a Full GC happens half-way through it which ends first,
|
||||
// and then the cycle notices that a Full GC happened and ends
|
||||
// too. The outer parameter is a boolean to help us do a bit tighter
|
||||
// consistency checking in the method. If outer is false, the caller
|
||||
// is the inner caller in the nesting (i.e., the Full GC). If outer
|
||||
// is true, the caller is the outer caller in this nesting (i.e.,
|
||||
// the concurrent cycle). Further nesting is not currently
|
||||
// supported. The end of the this call also notifies the
|
||||
// FullGCCount_lock in case a Java thread is waiting for a full GC
|
||||
// to happen (e.g., it called System.gc() with
|
||||
// +ExplicitGCInvokesConcurrent).
|
||||
void increment_full_collections_completed(bool outer);
|
||||
|
||||
unsigned int full_collections_completed() {
|
||||
return _full_collections_completed;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// Shrink the garbage-first heap by at most the given size (in bytes!).
|
||||
@ -444,7 +477,7 @@ protected:
|
||||
|
||||
// The guts of the incremental collection pause, executed by the vm
|
||||
// thread.
|
||||
virtual void do_collection_pause_at_safepoint();
|
||||
virtual void do_collection_pause_at_safepoint(double target_pause_time_ms);
|
||||
|
||||
// Actually do the work of evacuating the collection set.
|
||||
virtual void evacuate_collection_set();
|
||||
|
@ -154,7 +154,6 @@ G1CollectorPolicy::G1CollectorPolicy() :
|
||||
_known_garbage_bytes(0),
|
||||
|
||||
_young_gc_eff_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_target_pause_time_ms(-1.0),
|
||||
|
||||
_recent_prev_end_times_for_all_gcs_sec(new TruncatedSeq(NumPrevPausesForHeuristics)),
|
||||
|
||||
@ -1635,8 +1634,6 @@ void G1CollectorPolicy::record_collection_pause_end(bool abandoned) {
|
||||
double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
|
||||
adjust_concurrent_refinement(update_rs_time, update_rs_processed_buffers, update_rs_time_goal_ms);
|
||||
// </NEW PREDICTION>
|
||||
|
||||
_target_pause_time_ms = -1.0;
|
||||
}
|
||||
|
||||
// <NEW PREDICTION>
|
||||
@ -2366,7 +2363,6 @@ G1CollectorPolicy_BestRegionsFirst::should_do_collection_pause(size_t
|
||||
if (reached_target_length) {
|
||||
assert( young_list_length > 0 && _g1->young_list()->length() > 0,
|
||||
"invariant" );
|
||||
_target_pause_time_ms = max_pause_time_ms;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@ -2398,6 +2394,17 @@ bool G1CollectorPolicy_BestRegionsFirst::assertMarkedBytesDataOK() {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
G1CollectorPolicy::force_initial_mark_if_outside_cycle() {
|
||||
bool during_cycle = _g1->concurrent_mark()->cmThread()->during_cycle();
|
||||
if (!during_cycle) {
|
||||
set_initiate_conc_mark_if_possible();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G1CollectorPolicy::decide_on_conc_mark_initiation() {
|
||||
// We are about to decide on whether this pause will be an
|
||||
@ -2864,7 +2871,8 @@ void G1CollectorPolicy::print_collection_set(HeapRegion* list_head, outputStream
|
||||
#endif // !PRODUCT
|
||||
|
||||
bool
|
||||
G1CollectorPolicy_BestRegionsFirst::choose_collection_set() {
|
||||
G1CollectorPolicy_BestRegionsFirst::choose_collection_set(
|
||||
double target_pause_time_ms) {
|
||||
// Set this here - in case we're not doing young collections.
|
||||
double non_young_start_time_sec = os::elapsedTime();
|
||||
|
||||
@ -2877,26 +2885,19 @@ G1CollectorPolicy_BestRegionsFirst::choose_collection_set() {
|
||||
|
||||
start_recording_regions();
|
||||
|
||||
guarantee(_target_pause_time_ms > -1.0
|
||||
NOT_PRODUCT(|| Universe::heap()->gc_cause() == GCCause::_scavenge_alot),
|
||||
"_target_pause_time_ms should have been set!");
|
||||
#ifndef PRODUCT
|
||||
if (_target_pause_time_ms <= -1.0) {
|
||||
assert(ScavengeALot && Universe::heap()->gc_cause() == GCCause::_scavenge_alot, "Error");
|
||||
_target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
|
||||
}
|
||||
#endif
|
||||
assert(_collection_set == NULL, "Precondition");
|
||||
guarantee(target_pause_time_ms > 0.0,
|
||||
err_msg("target_pause_time_ms = %1.6lf should be positive",
|
||||
target_pause_time_ms));
|
||||
guarantee(_collection_set == NULL, "Precondition");
|
||||
|
||||
double base_time_ms = predict_base_elapsed_time_ms(_pending_cards);
|
||||
double predicted_pause_time_ms = base_time_ms;
|
||||
|
||||
double target_time_ms = _target_pause_time_ms;
|
||||
double time_remaining_ms = target_time_ms - base_time_ms;
|
||||
double time_remaining_ms = target_pause_time_ms - base_time_ms;
|
||||
|
||||
// the 10% and 50% values are arbitrary...
|
||||
if (time_remaining_ms < 0.10*target_time_ms) {
|
||||
time_remaining_ms = 0.50 * target_time_ms;
|
||||
if (time_remaining_ms < 0.10 * target_pause_time_ms) {
|
||||
time_remaining_ms = 0.50 * target_pause_time_ms;
|
||||
_within_target = false;
|
||||
} else {
|
||||
_within_target = true;
|
||||
@ -3059,7 +3060,18 @@ choose_collection_set_end:
|
||||
_recorded_non_young_cset_choice_time_ms =
|
||||
(non_young_end_time_sec - non_young_start_time_sec) * 1000.0;
|
||||
|
||||
return abandon_collection;
|
||||
// Here we are supposed to return whether the pause should be
|
||||
// abandoned or not (i.e., whether the collection set is empty or
|
||||
// not). However, this introduces a subtle issue when a pause is
|
||||
// initiated explicitly with System.gc() and
|
||||
// +ExplicitGCInvokesConcurrent (see Comment #2 in CR 6944166), it's
|
||||
// supposed to start a marking cycle, and it's abandoned. So, by
|
||||
// returning false here we are telling the caller never to consider
|
||||
// a pause to be abandoned. We'll actually remove all the code
|
||||
// associated with abandoned pauses as part of CR 6963209, but we are
|
||||
// just disabling them this way for the moment to avoid increasing
|
||||
// further the amount of changes for CR 6944166.
|
||||
return false;
|
||||
}
|
||||
|
||||
void G1CollectorPolicy_BestRegionsFirst::record_full_collection_end() {
|
||||
|
@ -199,8 +199,6 @@ protected:
|
||||
size_t _young_cset_length;
|
||||
bool _last_young_gc_full;
|
||||
|
||||
double _target_pause_time_ms;
|
||||
|
||||
unsigned _full_young_pause_num;
|
||||
unsigned _partial_young_pause_num;
|
||||
|
||||
@ -526,6 +524,10 @@ public:
|
||||
return _mmu_tracker;
|
||||
}
|
||||
|
||||
double max_pause_time_ms() {
|
||||
return _mmu_tracker->max_gc_time() * 1000.0;
|
||||
}
|
||||
|
||||
double predict_init_time_ms() {
|
||||
return get_new_prediction(_concurrent_mark_init_times_ms);
|
||||
}
|
||||
@ -1008,7 +1010,7 @@ public:
|
||||
// Choose a new collection set. Marks the chosen regions as being
|
||||
// "in_collection_set", and links them together. The head and number of
|
||||
// the collection set are available via access methods.
|
||||
virtual bool choose_collection_set() = 0;
|
||||
virtual bool choose_collection_set(double target_pause_time_ms) = 0;
|
||||
|
||||
// The head of the list (via "next_in_collection_set()") representing the
|
||||
// current collection set.
|
||||
@ -1077,6 +1079,12 @@ public:
|
||||
void set_during_initial_mark_pause() { _during_initial_mark_pause = true; }
|
||||
void clear_during_initial_mark_pause(){ _during_initial_mark_pause = false; }
|
||||
|
||||
// This sets the initiate_conc_mark_if_possible() flag to start a
|
||||
// new cycle, as long as we are not already in one. It's best if it
|
||||
// is called during a safepoint when the test whether a cycle is in
|
||||
// progress or not is stable.
|
||||
bool force_initial_mark_if_outside_cycle();
|
||||
|
||||
// This is called at the very beginning of an evacuation pause (it
|
||||
// has to be the first thing that the pause does). If
|
||||
// initiate_conc_mark_if_possible() is true, and the concurrent
|
||||
@ -1259,7 +1267,7 @@ class G1CollectorPolicy_BestRegionsFirst: public G1CollectorPolicy {
|
||||
// If the estimated is less then desirable, resize if possible.
|
||||
void expand_if_possible(size_t numRegions);
|
||||
|
||||
virtual bool choose_collection_set();
|
||||
virtual bool choose_collection_set(double target_pause_time_ms);
|
||||
virtual void record_collection_pause_start(double start_time_sec,
|
||||
size_t start_used);
|
||||
virtual void record_concurrent_mark_cleanup_end(size_t freed_bytes,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -676,9 +676,27 @@ void HRInto_G1RemSet::concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i
|
||||
// We must complete this write before we do any of the reads below.
|
||||
OrderAccess::storeload();
|
||||
// And process it, being careful of unallocated portions of TLAB's.
|
||||
|
||||
// The region for the current card may be a young region. The
|
||||
// current card may have been a card that was evicted from the
|
||||
// card cache. When the card was inserted into the cache, we had
|
||||
// determined that its region was non-young. While in the cache,
|
||||
// the region may have been freed during a cleanup pause, reallocated
|
||||
// and tagged as young.
|
||||
//
|
||||
// We wish to filter out cards for such a region but the current
|
||||
// thread, if we're running conucrrently, may "see" the young type
|
||||
// change at any time (so an earlier "is_young" check may pass or
|
||||
// fail arbitrarily). We tell the iteration code to perform this
|
||||
// filtering when it has been determined that there has been an actual
|
||||
// allocation in this region and making it safe to check the young type.
|
||||
bool filter_young = true;
|
||||
|
||||
HeapWord* stop_point =
|
||||
r->oops_on_card_seq_iterate_careful(dirtyRegion,
|
||||
&filter_then_update_rs_oop_cl);
|
||||
&filter_then_update_rs_oop_cl,
|
||||
filter_young);
|
||||
|
||||
// If stop_point is non-null, then we encountered an unallocated region
|
||||
// (perhaps the unfilled portion of a TLAB.) For now, we'll dirty the
|
||||
// card and re-enqueue: if we put off the card until a GC pause, then the
|
||||
@ -789,8 +807,14 @@ void HRInto_G1RemSet::concurrentRefineOneCard(jbyte* card_ptr, int worker_i) {
|
||||
if (r == NULL) {
|
||||
assert(_g1->is_in_permanent(start), "Or else where?");
|
||||
} else {
|
||||
guarantee(!r->is_young(), "It was evicted in the current minor cycle.");
|
||||
// Process card pointer we get back from the hot card cache
|
||||
// Checking whether the region we got back from the cache
|
||||
// is young here is inappropriate. The region could have been
|
||||
// freed, reallocated and tagged as young while in the cache.
|
||||
// Hence we could see its young type change at any time.
|
||||
//
|
||||
// Process card pointer we get back from the hot card cache. This
|
||||
// will check whether the region containing the card is young
|
||||
// _after_ checking that the region has been allocated from.
|
||||
concurrentRefineOneCard_impl(res, worker_i);
|
||||
}
|
||||
}
|
||||
|
@ -658,7 +658,8 @@ HeapRegion::object_iterate_mem_careful(MemRegion mr,
|
||||
HeapWord*
|
||||
HeapRegion::
|
||||
oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
FilterOutOfRegionClosure* cl) {
|
||||
FilterOutOfRegionClosure* cl,
|
||||
bool filter_young) {
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
|
||||
// If we're within a stop-world GC, then we might look at a card in a
|
||||
@ -672,6 +673,16 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
if (mr.is_empty()) return NULL;
|
||||
// Otherwise, find the obj that extends onto mr.start().
|
||||
|
||||
// The intersection of the incoming mr (for the card) and the
|
||||
// allocated part of the region is non-empty. This implies that
|
||||
// we have actually allocated into this region. The code in
|
||||
// G1CollectedHeap.cpp that allocates a new region sets the
|
||||
// is_young tag on the region before allocating. Thus we
|
||||
// safely know if this region is young.
|
||||
if (is_young() && filter_young) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// We used to use "block_start_careful" here. But we're actually happy
|
||||
// to update the BOT while we do this...
|
||||
HeapWord* cur = block_start(mr.start());
|
||||
|
@ -252,7 +252,7 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
||||
// survivor
|
||||
};
|
||||
|
||||
YoungType _young_type;
|
||||
volatile YoungType _young_type;
|
||||
int _young_index_in_cset;
|
||||
SurvRateGroup* _surv_rate_group;
|
||||
int _age_index;
|
||||
@ -726,9 +726,12 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
||||
HeapWord*
|
||||
object_iterate_mem_careful(MemRegion mr, ObjectClosure* cl);
|
||||
|
||||
// In this version - if filter_young is true and the region
|
||||
// is a young region then we skip the iteration.
|
||||
HeapWord*
|
||||
oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
FilterOutOfRegionClosure* cl);
|
||||
FilterOutOfRegionClosure* cl,
|
||||
bool filter_young);
|
||||
|
||||
// The region "mr" is entirely in "this", and starts and ends at block
|
||||
// boundaries. The caller declares that all the contained blocks are
|
||||
|
@ -42,8 +42,65 @@ void VM_G1CollectFull::doit() {
|
||||
void VM_G1IncCollectionPause::doit() {
|
||||
JvmtiGCForAllocationMarker jgcm;
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
assert(!_should_initiate_conc_mark ||
|
||||
((_gc_cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) ||
|
||||
(_gc_cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent)),
|
||||
"only a GC locker or a System.gc() induced GC should start a cycle");
|
||||
|
||||
GCCauseSetter x(g1h, _gc_cause);
|
||||
g1h->do_collection_pause_at_safepoint();
|
||||
if (_should_initiate_conc_mark) {
|
||||
// It's safer to read full_collections_completed() here, given
|
||||
// that noone else will be updating it concurrently. Since we'll
|
||||
// only need it if we're initiating a marking cycle, no point in
|
||||
// setting it earlier.
|
||||
_full_collections_completed_before = g1h->full_collections_completed();
|
||||
|
||||
// At this point we are supposed to start a concurrent cycle. We
|
||||
// will do so if one is not already in progress.
|
||||
bool res = g1h->g1_policy()->force_initial_mark_if_outside_cycle();
|
||||
}
|
||||
g1h->do_collection_pause_at_safepoint(_target_pause_time_ms);
|
||||
}
|
||||
|
||||
void VM_G1IncCollectionPause::doit_epilogue() {
|
||||
VM_GC_Operation::doit_epilogue();
|
||||
|
||||
// If the pause was initiated by a System.gc() and
|
||||
// +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
|
||||
// that just started (or maybe one that was already in progress) to
|
||||
// finish.
|
||||
if (_gc_cause == GCCause::_java_lang_system_gc &&
|
||||
_should_initiate_conc_mark) {
|
||||
assert(ExplicitGCInvokesConcurrent,
|
||||
"the only way to be here is if ExplicitGCInvokesConcurrent is set");
|
||||
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
|
||||
// In the doit() method we saved g1h->full_collections_completed()
|
||||
// in the _full_collections_completed_before field. We have to
|
||||
// wait until we observe that g1h->full_collections_completed()
|
||||
// has increased by at least one. This can happen if a) we started
|
||||
// a cycle and it completes, b) a cycle already in progress
|
||||
// completes, or c) a Full GC happens.
|
||||
|
||||
// If the condition has already been reached, there's no point in
|
||||
// actually taking the lock and doing the wait.
|
||||
if (g1h->full_collections_completed() <=
|
||||
_full_collections_completed_before) {
|
||||
// The following is largely copied from CMS
|
||||
|
||||
Thread* thr = Thread::current();
|
||||
assert(thr->is_Java_thread(), "invariant");
|
||||
JavaThread* jt = (JavaThread*)thr;
|
||||
ThreadToNativeFromVM native(jt);
|
||||
|
||||
MutexLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
|
||||
while (g1h->full_collections_completed() <=
|
||||
_full_collections_completed_before) {
|
||||
FullGCCount_lock->wait(Mutex::_no_safepoint_check_flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VM_CGC_Operation::doit() {
|
||||
|
@ -31,13 +31,12 @@
|
||||
// - VM_G1PopRegionCollectionPause
|
||||
|
||||
class VM_G1CollectFull: public VM_GC_Operation {
|
||||
private:
|
||||
public:
|
||||
VM_G1CollectFull(int gc_count_before,
|
||||
GCCause::Cause gc_cause)
|
||||
: VM_GC_Operation(gc_count_before)
|
||||
{
|
||||
_gc_cause = gc_cause;
|
||||
VM_G1CollectFull(unsigned int gc_count_before,
|
||||
unsigned int full_gc_count_before,
|
||||
GCCause::Cause cause)
|
||||
: VM_GC_Operation(gc_count_before, full_gc_count_before) {
|
||||
_gc_cause = cause;
|
||||
}
|
||||
~VM_G1CollectFull() {}
|
||||
virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
|
||||
@ -67,12 +66,28 @@ class VM_G1CollectForAllocation: public VM_GC_Operation {
|
||||
};
|
||||
|
||||
class VM_G1IncCollectionPause: public VM_GC_Operation {
|
||||
public:
|
||||
VM_G1IncCollectionPause(int gc_count_before,
|
||||
GCCause::Cause gc_cause = GCCause::_g1_inc_collection_pause) :
|
||||
VM_GC_Operation(gc_count_before) { _gc_cause = gc_cause; }
|
||||
private:
|
||||
bool _should_initiate_conc_mark;
|
||||
double _target_pause_time_ms;
|
||||
unsigned int _full_collections_completed_before;
|
||||
public:
|
||||
VM_G1IncCollectionPause(unsigned int gc_count_before,
|
||||
bool should_initiate_conc_mark,
|
||||
double target_pause_time_ms,
|
||||
GCCause::Cause cause)
|
||||
: VM_GC_Operation(gc_count_before),
|
||||
_full_collections_completed_before(0),
|
||||
_should_initiate_conc_mark(should_initiate_conc_mark),
|
||||
_target_pause_time_ms(target_pause_time_ms) {
|
||||
guarantee(target_pause_time_ms > 0.0,
|
||||
err_msg("target_pause_time_ms = %1.6lf should be positive",
|
||||
target_pause_time_ms));
|
||||
|
||||
_gc_cause = cause;
|
||||
}
|
||||
virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; }
|
||||
virtual void doit();
|
||||
virtual void doit_epilogue();
|
||||
virtual const char* name() const {
|
||||
return "garbage-first incremental collection pause";
|
||||
}
|
||||
|
@ -367,4 +367,6 @@ vm_operations_g1.hpp vmGCOperations.hpp
|
||||
|
||||
vm_operations_g1.cpp vm_operations_g1.hpp
|
||||
vm_operations_g1.cpp g1CollectedHeap.inline.hpp
|
||||
vm_operations_g1.cpp g1CollectorPolicy.hpp
|
||||
vm_operations_g1.cpp interfaceSupport.hpp
|
||||
vm_operations_g1.cpp isGCActiveMark.hpp
|
||||
|
@ -539,10 +539,9 @@ ParNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level)
|
||||
guarantee(_task_queues != NULL, "task_queues allocation failure.");
|
||||
|
||||
for (uint i1 = 0; i1 < ParallelGCThreads; i1++) {
|
||||
ObjToScanQueuePadded *q_padded = new ObjToScanQueuePadded();
|
||||
guarantee(q_padded != NULL, "work_queue Allocation failure.");
|
||||
|
||||
_task_queues->register_queue(i1, &q_padded->work_queue);
|
||||
ObjToScanQueue *q = new ObjToScanQueue();
|
||||
guarantee(q != NULL, "work_queue Allocation failure.");
|
||||
_task_queues->register_queue(i1, q);
|
||||
}
|
||||
|
||||
for (uint i2 = 0; i2 < ParallelGCThreads; i2++)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -33,8 +33,8 @@ class ParEvacuateFollowersClosure;
|
||||
// but they must be here to allow ParScanClosure::do_oop_work to be defined
|
||||
// in genOopClosures.inline.hpp.
|
||||
|
||||
typedef OopTaskQueue ObjToScanQueue;
|
||||
typedef OopTaskQueueSet ObjToScanQueueSet;
|
||||
typedef Padded<OopTaskQueue> ObjToScanQueue;
|
||||
typedef GenericTaskQueueSet<ObjToScanQueue> ObjToScanQueueSet;
|
||||
|
||||
// Enable this to get push/pop/steal stats.
|
||||
const int PAR_STATS_ENABLED = 0;
|
||||
@ -304,12 +304,6 @@ class ParNewGeneration: public DefNewGeneration {
|
||||
friend class ParEvacuateFollowersClosure;
|
||||
|
||||
private:
|
||||
// XXX use a global constant instead of 64!
|
||||
struct ObjToScanQueuePadded {
|
||||
ObjToScanQueue work_queue;
|
||||
char pad[64 - sizeof(ObjToScanQueue)]; // prevent false sharing
|
||||
};
|
||||
|
||||
// The per-worker-thread work queues
|
||||
ObjToScanQueueSet* _task_queues;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 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
|
||||
@ -26,7 +26,8 @@
|
||||
|
||||
class ParScanThreadState;
|
||||
class ParNewGeneration;
|
||||
typedef OopTaskQueueSet ObjToScanQueueSet;
|
||||
typedef Padded<OopTaskQueue> ObjToScanQueue;
|
||||
typedef GenericTaskQueueSet<ObjToScanQueue> ObjToScanQueueSet;
|
||||
class ParallelTaskTerminator;
|
||||
|
||||
class ParScanClosure: public OopsInGenClosure {
|
||||
|
@ -90,10 +90,7 @@ void PSPromotionManager::pre_scavenge() {
|
||||
}
|
||||
|
||||
void PSPromotionManager::post_scavenge() {
|
||||
#if PS_PM_STATS
|
||||
print_stats();
|
||||
#endif // PS_PM_STATS
|
||||
|
||||
TASKQUEUE_STATS_ONLY(if (PrintGCDetails && ParallelGCVerbose) print_stats());
|
||||
for (uint i = 0; i < ParallelGCThreads + 1; i++) {
|
||||
PSPromotionManager* manager = manager_array(i);
|
||||
if (UseDepthFirstScavengeOrder) {
|
||||
@ -105,37 +102,58 @@ void PSPromotionManager::post_scavenge() {
|
||||
}
|
||||
}
|
||||
|
||||
#if PS_PM_STATS
|
||||
#if TASKQUEUE_STATS
|
||||
void
|
||||
PSPromotionManager::print_taskqueue_stats(uint i) const {
|
||||
const TaskQueueStats& stats = depth_first() ?
|
||||
_claimed_stack_depth.stats : _claimed_stack_breadth.stats;
|
||||
tty->print("%3u ", i);
|
||||
stats.print();
|
||||
tty->cr();
|
||||
}
|
||||
|
||||
void
|
||||
PSPromotionManager::print_stats(uint i) {
|
||||
tty->print_cr("---- GC Worker %2d Stats", i);
|
||||
tty->print_cr(" total pushes %8d", _total_pushes);
|
||||
tty->print_cr(" masked pushes %8d", _masked_pushes);
|
||||
tty->print_cr(" overflow pushes %8d", _overflow_pushes);
|
||||
tty->print_cr(" max overflow length %8d", _max_overflow_length);
|
||||
tty->print_cr("");
|
||||
tty->print_cr(" arrays chunked %8d", _arrays_chunked);
|
||||
tty->print_cr(" array chunks processed %8d", _array_chunks_processed);
|
||||
tty->print_cr("");
|
||||
tty->print_cr(" total steals %8d", _total_steals);
|
||||
tty->print_cr(" masked steals %8d", _masked_steals);
|
||||
tty->print_cr("");
|
||||
PSPromotionManager::print_local_stats(uint i) const {
|
||||
#define FMT " " SIZE_FORMAT_W(10)
|
||||
tty->print_cr("%3u" FMT FMT FMT FMT, i, _masked_pushes, _masked_steals,
|
||||
_arrays_chunked, _array_chunks_processed);
|
||||
#undef FMT
|
||||
}
|
||||
|
||||
static const char* const pm_stats_hdr[] = {
|
||||
" --------masked------- arrays array",
|
||||
"thr push steal chunked chunks",
|
||||
"--- ---------- ---------- ---------- ----------"
|
||||
};
|
||||
|
||||
void
|
||||
PSPromotionManager::print_stats() {
|
||||
tty->print_cr("== GC Tasks Stats (%s), GC %3d",
|
||||
(UseDepthFirstScavengeOrder) ? "Depth-First" : "Breadth-First",
|
||||
const bool df = UseDepthFirstScavengeOrder;
|
||||
tty->print_cr("== GC Task Stats (%s-First), GC %3d", df ? "Depth" : "Breadth",
|
||||
Universe::heap()->total_collections());
|
||||
|
||||
for (uint i = 0; i < ParallelGCThreads+1; ++i) {
|
||||
PSPromotionManager* manager = manager_array(i);
|
||||
manager->print_stats(i);
|
||||
tty->print("thr "); TaskQueueStats::print_header(1); tty->cr();
|
||||
tty->print("--- "); TaskQueueStats::print_header(2); tty->cr();
|
||||
for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
|
||||
manager_array(i)->print_taskqueue_stats(i);
|
||||
}
|
||||
|
||||
const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
|
||||
for (uint i = 0; i < hlines; ++i) tty->print_cr(pm_stats_hdr[i]);
|
||||
for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
|
||||
manager_array(i)->print_local_stats(i);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PS_PM_STATS
|
||||
void
|
||||
PSPromotionManager::reset_stats() {
|
||||
TaskQueueStats& stats = depth_first() ?
|
||||
claimed_stack_depth()->stats : claimed_stack_breadth()->stats;
|
||||
stats.reset();
|
||||
_masked_pushes = _masked_steals = 0;
|
||||
_arrays_chunked = _array_chunks_processed = 0;
|
||||
}
|
||||
#endif // TASKQUEUE_STATS
|
||||
|
||||
PSPromotionManager::PSPromotionManager() {
|
||||
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
|
||||
@ -189,16 +207,7 @@ void PSPromotionManager::reset() {
|
||||
|
||||
_prefetch_queue.clear();
|
||||
|
||||
#if PS_PM_STATS
|
||||
_total_pushes = 0;
|
||||
_masked_pushes = 0;
|
||||
_overflow_pushes = 0;
|
||||
_max_overflow_length = 0;
|
||||
_arrays_chunked = 0;
|
||||
_array_chunks_processed = 0;
|
||||
_total_steals = 0;
|
||||
_masked_steals = 0;
|
||||
#endif // PS_PM_STATS
|
||||
TASKQUEUE_STATS_ONLY(reset_stats());
|
||||
}
|
||||
|
||||
|
||||
@ -423,14 +432,9 @@ oop PSPromotionManager::copy_to_survivor_space(oop o, bool depth_first) {
|
||||
new_obj->is_objArray() &&
|
||||
PSChunkLargeArrays) {
|
||||
// we'll chunk it
|
||||
#if PS_PM_STATS
|
||||
++_arrays_chunked;
|
||||
#endif // PS_PM_STATS
|
||||
oop* const masked_o = mask_chunked_array_oop(o);
|
||||
push_depth(masked_o);
|
||||
#if PS_PM_STATS
|
||||
++_masked_pushes;
|
||||
#endif // PS_PM_STATS
|
||||
TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes);
|
||||
} else {
|
||||
// we'll just push its contents
|
||||
new_obj->push_contents(this);
|
||||
@ -494,9 +498,7 @@ void PSPromotionManager::process_array_chunk(oop old) {
|
||||
assert(old->is_objArray(), "invariant");
|
||||
assert(old->is_forwarded(), "invariant");
|
||||
|
||||
#if PS_PM_STATS
|
||||
++_array_chunks_processed;
|
||||
#endif // PS_PM_STATS
|
||||
TASKQUEUE_STATS_ONLY(++_array_chunks_processed);
|
||||
|
||||
oop const obj = old->forwardee();
|
||||
|
||||
@ -508,9 +510,7 @@ void PSPromotionManager::process_array_chunk(oop old) {
|
||||
assert(start > 0, "invariant");
|
||||
arrayOop(old)->set_length(start);
|
||||
push_depth(mask_chunked_array_oop(old));
|
||||
#if PS_PM_STATS
|
||||
++_masked_pushes;
|
||||
#endif // PS_PM_STATS
|
||||
TASKQUEUE_STATS_ONLY(++_masked_pushes);
|
||||
} else {
|
||||
// this is the final chunk for this array
|
||||
start = 0;
|
||||
|
@ -42,8 +42,6 @@ class MutableSpace;
|
||||
class PSOldGen;
|
||||
class ParCompactionManager;
|
||||
|
||||
#define PS_PM_STATS 0
|
||||
|
||||
class PSPromotionManager : public CHeapObj {
|
||||
friend class PSScavenge;
|
||||
friend class PSRefProcTaskExecutor;
|
||||
@ -54,22 +52,18 @@ class PSPromotionManager : public CHeapObj {
|
||||
static PSOldGen* _old_gen;
|
||||
static MutableSpace* _young_space;
|
||||
|
||||
#if PS_PM_STATS
|
||||
uint _total_pushes;
|
||||
uint _masked_pushes;
|
||||
#if TASKQUEUE_STATS
|
||||
size_t _masked_pushes;
|
||||
size_t _masked_steals;
|
||||
size_t _arrays_chunked;
|
||||
size_t _array_chunks_processed;
|
||||
|
||||
uint _overflow_pushes;
|
||||
uint _max_overflow_length;
|
||||
|
||||
uint _arrays_chunked;
|
||||
uint _array_chunks_processed;
|
||||
|
||||
uint _total_steals;
|
||||
uint _masked_steals;
|
||||
|
||||
void print_stats(uint i);
|
||||
void print_taskqueue_stats(uint i) const;
|
||||
void print_local_stats(uint i) const;
|
||||
static void print_stats();
|
||||
#endif // PS_PM_STATS
|
||||
|
||||
void reset_stats();
|
||||
#endif // TASKQUEUE_STATS
|
||||
|
||||
PSYoungPromotionLAB _young_lab;
|
||||
PSOldPromotionLAB _old_lab;
|
||||
@ -143,42 +137,12 @@ class PSPromotionManager : public CHeapObj {
|
||||
|
||||
template <class T> void push_depth(T* p) {
|
||||
assert(depth_first(), "pre-condition");
|
||||
|
||||
#if PS_PM_STATS
|
||||
++_total_pushes;
|
||||
int stack_length = claimed_stack_depth()->overflow_stack()->length();
|
||||
#endif // PS_PM_STATS
|
||||
|
||||
claimed_stack_depth()->push(p);
|
||||
|
||||
#if PS_PM_STATS
|
||||
if (claimed_stack_depth()->overflow_stack()->length() != stack_length) {
|
||||
++_overflow_pushes;
|
||||
if ((uint)stack_length + 1 > _max_overflow_length) {
|
||||
_max_overflow_length = (uint)stack_length + 1;
|
||||
}
|
||||
}
|
||||
#endif // PS_PM_STATS
|
||||
}
|
||||
|
||||
void push_breadth(oop o) {
|
||||
assert(!depth_first(), "pre-condition");
|
||||
|
||||
#if PS_PM_STATS
|
||||
++_total_pushes;
|
||||
int stack_length = claimed_stack_breadth()->overflow_stack()->length();
|
||||
#endif // PS_PM_STATS
|
||||
|
||||
claimed_stack_breadth()->push(o);
|
||||
|
||||
#if PS_PM_STATS
|
||||
if (claimed_stack_breadth()->overflow_stack()->length() != stack_length) {
|
||||
++_overflow_pushes;
|
||||
if ((uint)stack_length + 1 > _max_overflow_length) {
|
||||
_max_overflow_length = (uint)stack_length + 1;
|
||||
}
|
||||
}
|
||||
#endif // PS_PM_STATS
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -256,12 +220,5 @@ class PSPromotionManager : public CHeapObj {
|
||||
template <class T> inline void claim_or_forward_depth(T* p);
|
||||
template <class T> inline void claim_or_forward_breadth(T* p);
|
||||
|
||||
#if PS_PM_STATS
|
||||
void increment_steals(oop* p = NULL) {
|
||||
_total_steals += 1;
|
||||
if (p != NULL && is_oop_masked(p)) {
|
||||
_masked_steals += 1;
|
||||
}
|
||||
}
|
||||
#endif // PS_PM_STATS
|
||||
TASKQUEUE_STATS_ONLY(inline void record_steal(StarTask& p);)
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -124,3 +124,11 @@ inline void PSPromotionManager::process_popped_location_depth(StarTask p) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if TASKQUEUE_STATS
|
||||
void PSPromotionManager::record_steal(StarTask& p) {
|
||||
if (is_oop_masked(p)) {
|
||||
++_masked_steals;
|
||||
}
|
||||
}
|
||||
#endif // TASKQUEUE_STATS
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -148,9 +148,7 @@ void StealTask::do_it(GCTaskManager* manager, uint which) {
|
||||
while(true) {
|
||||
StarTask p;
|
||||
if (PSPromotionManager::steal_depth(which, &random_seed, p)) {
|
||||
#if PS_PM_STATS
|
||||
pm->increment_steals(p);
|
||||
#endif // PS_PM_STATS
|
||||
TASKQUEUE_STATS_ONLY(pm->record_steal(p));
|
||||
pm->process_popped_location_depth(p);
|
||||
pm->drain_stacks_depth(true);
|
||||
} else {
|
||||
@ -163,9 +161,6 @@ void StealTask::do_it(GCTaskManager* manager, uint which) {
|
||||
while(true) {
|
||||
oop obj;
|
||||
if (PSPromotionManager::steal_breadth(which, &random_seed, obj)) {
|
||||
#if PS_PM_STATS
|
||||
pm->increment_steals();
|
||||
#endif // PS_PM_STATS
|
||||
obj->copy_contents(pm);
|
||||
pm->drain_stacks_breadth(true);
|
||||
} else {
|
||||
|
@ -86,9 +86,7 @@ class VM_GC_Operation: public VM_Operation {
|
||||
|
||||
_gc_locked = false;
|
||||
|
||||
if (full) {
|
||||
_full_gc_count_before = full_gc_count_before;
|
||||
}
|
||||
_full_gc_count_before = full_gc_count_before;
|
||||
// In ParallelScavengeHeap::mem_allocate() collections can be
|
||||
// executed within a loop and _all_soft_refs_clear can be set
|
||||
// true after they have been cleared by a collection and another
|
||||
|
@ -78,6 +78,9 @@ const char* GCCause::to_string(GCCause::Cause cause) {
|
||||
case _old_generation_too_full_to_scavenge:
|
||||
return "Old Generation Too Full To Scavenge";
|
||||
|
||||
case _g1_inc_collection_pause:
|
||||
return "G1 Evacuation Pause";
|
||||
|
||||
case _last_ditch_collection:
|
||||
return "Last ditch collection";
|
||||
|
||||
|
@ -328,24 +328,35 @@ void BytecodePrinter::print_field_or_method(int orig_i, int i, outputStream* st)
|
||||
constantPoolOop constants = method()->constants();
|
||||
constantTag tag = constants->tag_at(i);
|
||||
|
||||
int nt_index = -1;
|
||||
bool has_klass = true;
|
||||
|
||||
switch (tag.value()) {
|
||||
case JVM_CONSTANT_InterfaceMethodref:
|
||||
case JVM_CONSTANT_Methodref:
|
||||
case JVM_CONSTANT_Fieldref:
|
||||
break;
|
||||
case JVM_CONSTANT_NameAndType:
|
||||
case JVM_CONSTANT_InvokeDynamic:
|
||||
has_klass = false;
|
||||
break;
|
||||
default:
|
||||
st->print_cr(" bad tag=%d at %d", tag.value(), i);
|
||||
return;
|
||||
}
|
||||
|
||||
symbolOop klass = constants->klass_name_at(constants->uncached_klass_ref_index_at(i));
|
||||
symbolOop name = constants->uncached_name_ref_at(i);
|
||||
symbolOop signature = constants->uncached_signature_ref_at(i);
|
||||
const char* sep = (tag.is_field() ? "/" : "");
|
||||
st->print_cr(" %d <%s.%s%s%s> ", i, klass->as_C_string(), name->as_C_string(), sep, signature->as_C_string());
|
||||
if (has_klass) {
|
||||
symbolOop klass = constants->klass_name_at(constants->uncached_klass_ref_index_at(i));
|
||||
st->print_cr(" %d <%s.%s%s%s> ", i, klass->as_C_string(), name->as_C_string(), sep, signature->as_C_string());
|
||||
} else {
|
||||
if (tag.is_invoke_dynamic()) {
|
||||
int bsm = constants->invoke_dynamic_bootstrap_method_ref_index_at(i);
|
||||
st->print(" bsm=%d", bsm);
|
||||
}
|
||||
st->print_cr(" %d <%s%s%s>", i, name->as_C_string(), sep, signature->as_C_string());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -702,10 +702,6 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
|
||||
|
||||
methodHandle caller_method(thread, method(thread));
|
||||
|
||||
// first find the bootstrap method
|
||||
KlassHandle caller_klass(thread, caller_method->method_holder());
|
||||
Handle bootm = SystemDictionary::find_bootstrap_method(caller_klass, CHECK);
|
||||
|
||||
constantPoolHandle pool(thread, caller_method->constants());
|
||||
pool->set_invokedynamic(); // mark header to flag active call sites
|
||||
|
||||
@ -726,7 +722,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
|
||||
CallInfo info;
|
||||
LinkResolver::resolve_invoke(info, Handle(), pool,
|
||||
site_index, bytecode, CHECK);
|
||||
// The main entry corresponds to a JVM_CONSTANT_NameAndType, and serves
|
||||
// The main entry corresponds to a JVM_CONSTANT_InvokeDynamic, and serves
|
||||
// as a common reference point for all invokedynamic call sites with
|
||||
// that exact call descriptor. We will link it in the CP cache exactly
|
||||
// as if it were an invokevirtual of MethodHandle.invoke.
|
||||
@ -734,23 +730,30 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
|
||||
bytecode,
|
||||
info.resolved_method(),
|
||||
info.vtable_index());
|
||||
assert(pool->cache()->entry_at(main_index)->is_vfinal(), "f2 must be a methodOop");
|
||||
}
|
||||
|
||||
// The method (f2 entry) of the main entry is the MH.invoke for the
|
||||
// invokedynamic target call signature.
|
||||
intptr_t f2_value = pool->cache()->entry_at(main_index)->f2();
|
||||
methodHandle signature_invoker(THREAD, (methodOop) f2_value);
|
||||
oop f1_value = pool->cache()->entry_at(main_index)->f1();
|
||||
methodHandle signature_invoker(THREAD, (methodOop) f1_value);
|
||||
assert(signature_invoker.not_null() && signature_invoker->is_method() && signature_invoker->is_method_handle_invoke(),
|
||||
"correct result from LinkResolver::resolve_invokedynamic");
|
||||
|
||||
Handle bootm = SystemDictionary::find_bootstrap_method(caller_method, caller_bci,
|
||||
main_index, CHECK);
|
||||
if (bootm.is_null()) {
|
||||
THROW_MSG(vmSymbols::java_lang_IllegalStateException(),
|
||||
"no bootstrap method found for invokedynamic");
|
||||
}
|
||||
|
||||
// Short circuit if CallSite has been bound already:
|
||||
if (!pool->cache()->secondary_entry_at(site_index)->is_f1_null())
|
||||
return;
|
||||
|
||||
symbolHandle call_site_name(THREAD, pool->name_ref_at(site_index));
|
||||
|
||||
Handle info; // NYI: Other metadata from a new kind of CP entry. (Annotations?)
|
||||
|
||||
// this is the index which gets stored on the CallSite object (as "callerPosition"):
|
||||
int call_site_position = constantPoolCacheOopDesc::decode_secondary_index(site_index);
|
||||
|
||||
Handle call_site
|
||||
= SystemDictionary::make_dynamic_call_site(bootm,
|
||||
// Callee information:
|
||||
|
@ -67,6 +67,15 @@ void CallInfo::set_virtual(KlassHandle resolved_klass, KlassHandle selected_klas
|
||||
set_common(resolved_klass, selected_klass, resolved_method, selected_method, vtable_index, CHECK);
|
||||
}
|
||||
|
||||
void CallInfo::set_dynamic(methodHandle resolved_method, TRAPS) {
|
||||
assert(resolved_method->is_method_handle_invoke(), "");
|
||||
KlassHandle resolved_klass = SystemDictionaryHandles::MethodHandle_klass();
|
||||
assert(resolved_klass == resolved_method->method_holder(), "");
|
||||
int vtable_index = methodOopDesc::nonvirtual_vtable_index;
|
||||
assert(resolved_method->vtable_index() == vtable_index, "");
|
||||
set_common(resolved_klass, KlassHandle(), resolved_method, resolved_method, vtable_index, CHECK);
|
||||
}
|
||||
|
||||
void CallInfo::set_common(KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index, TRAPS) {
|
||||
assert(resolved_method->signature() == selected_method->signature(), "signatures must correspond");
|
||||
_resolved_klass = resolved_klass;
|
||||
@ -176,9 +185,20 @@ void LinkResolver::lookup_implicit_method(methodHandle& result,
|
||||
KlassHandle klass, symbolHandle name, symbolHandle signature,
|
||||
KlassHandle current_klass,
|
||||
TRAPS) {
|
||||
if (EnableMethodHandles && MethodHandles::enabled() &&
|
||||
if (EnableMethodHandles &&
|
||||
klass() == SystemDictionary::MethodHandle_klass() &&
|
||||
methodOopDesc::is_method_handle_invoke_name(name())) {
|
||||
if (!MethodHandles::enabled()) {
|
||||
// Make sure the Java part of the runtime has been booted up.
|
||||
klassOop natives = SystemDictionary::MethodHandleNatives_klass();
|
||||
if (natives == NULL || instanceKlass::cast(natives)->is_not_initialized()) {
|
||||
SystemDictionary::resolve_or_fail(vmSymbolHandles::sun_dyn_MethodHandleNatives(),
|
||||
Handle(),
|
||||
Handle(),
|
||||
true,
|
||||
CHECK);
|
||||
}
|
||||
}
|
||||
methodOop result_oop = SystemDictionary::find_method_handle_invoke(name,
|
||||
signature,
|
||||
current_klass,
|
||||
@ -1065,7 +1085,7 @@ void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle po
|
||||
if (resolved_method.is_null()) {
|
||||
THROW(vmSymbols::java_lang_InternalError());
|
||||
}
|
||||
result.set_virtual(resolved_klass, KlassHandle(), resolved_method, resolved_method, resolved_method->vtable_index(), CHECK);
|
||||
result.set_dynamic(resolved_method, CHECK);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -73,6 +73,7 @@ class CallInfo: public LinkInfo {
|
||||
void set_static( KlassHandle resolved_klass, methodHandle resolved_method , TRAPS);
|
||||
void set_interface(KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method , TRAPS);
|
||||
void set_virtual( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index, TRAPS);
|
||||
void set_dynamic( methodHandle resolved_method, TRAPS);
|
||||
void set_common( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index, TRAPS);
|
||||
|
||||
friend class LinkResolver;
|
||||
|
@ -32,14 +32,17 @@
|
||||
void Rewriter::compute_index_maps() {
|
||||
const int length = _pool->length();
|
||||
init_cp_map(length);
|
||||
jint tag_mask = 0;
|
||||
for (int i = 0; i < length; i++) {
|
||||
int tag = _pool->tag_at(i).value();
|
||||
tag_mask |= (1 << tag);
|
||||
switch (tag) {
|
||||
case JVM_CONSTANT_InterfaceMethodref:
|
||||
case JVM_CONSTANT_Fieldref : // fall through
|
||||
case JVM_CONSTANT_Methodref : // fall through
|
||||
case JVM_CONSTANT_MethodHandle : // fall through
|
||||
case JVM_CONSTANT_MethodType : // fall through
|
||||
case JVM_CONSTANT_InvokeDynamic : // fall through
|
||||
add_cp_cache_entry(i);
|
||||
break;
|
||||
}
|
||||
@ -47,6 +50,8 @@ void Rewriter::compute_index_maps() {
|
||||
|
||||
guarantee((int)_cp_cache_map.length()-1 <= (int)((u2)-1),
|
||||
"all cp cache indexes fit in a u2");
|
||||
|
||||
_have_invoke_dynamic = ((tag_mask & (1 << JVM_CONSTANT_InvokeDynamic)) != 0);
|
||||
}
|
||||
|
||||
|
||||
@ -59,6 +64,28 @@ void Rewriter::make_constant_pool_cache(TRAPS) {
|
||||
constantPoolCacheOop cache =
|
||||
oopFactory::new_constantPoolCache(length, methodOopDesc::IsUnsafeConc, CHECK);
|
||||
cache->initialize(_cp_cache_map);
|
||||
|
||||
// Don't bother to the next pass if there is no JVM_CONSTANT_InvokeDynamic.
|
||||
if (_have_invoke_dynamic) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
int pool_index = cp_cache_entry_pool_index(i);
|
||||
if (pool_index >= 0 &&
|
||||
_pool->tag_at(pool_index).is_invoke_dynamic()) {
|
||||
int bsm_index = _pool->invoke_dynamic_bootstrap_method_ref_index_at(pool_index);
|
||||
if (bsm_index != 0) {
|
||||
assert(_pool->tag_at(bsm_index).is_method_handle(), "must be a MH constant");
|
||||
// There is a CP cache entry holding the BSM for these calls.
|
||||
int bsm_cache_index = cp_entry_to_cp_cache(bsm_index);
|
||||
cache->entry_at(i)->initialize_bootstrap_method_index_in_cache(bsm_cache_index);
|
||||
} else {
|
||||
// There is no CP cache entry holding the BSM for these calls.
|
||||
// We will need to look for a class-global BSM, later.
|
||||
guarantee(AllowTransitionalJSR292, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_pool->set_cache(cache);
|
||||
cache->set_constant_pool(_pool());
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ class Rewriter: public StackObj {
|
||||
objArrayHandle _methods;
|
||||
intArray _cp_map;
|
||||
intStack _cp_cache_map;
|
||||
bool _have_invoke_dynamic;
|
||||
|
||||
void init_cp_map(int length) {
|
||||
_cp_map.initialize(length, -1);
|
||||
@ -56,6 +57,22 @@ class Rewriter: public StackObj {
|
||||
return cache_index;
|
||||
}
|
||||
|
||||
// Access the contents of _cp_cache_map to determine CP cache layout.
|
||||
int cp_cache_entry_pool_index(int cache_index) {
|
||||
int cp_index = _cp_cache_map[cache_index];
|
||||
if ((cp_index & _secondary_entry_tag) != 0)
|
||||
return -1;
|
||||
else
|
||||
return cp_index;
|
||||
}
|
||||
int cp_cache_secondary_entry_main_index(int cache_index) {
|
||||
int cp_index = _cp_cache_map[cache_index];
|
||||
if ((cp_index & _secondary_entry_tag) == 0)
|
||||
return -1;
|
||||
else
|
||||
return (cp_index - _secondary_entry_tag);
|
||||
}
|
||||
|
||||
// All the work goes in here:
|
||||
Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS);
|
||||
|
||||
|
@ -379,6 +379,10 @@ void constantPoolKlass::oop_print_on(oop obj, outputStream* st) {
|
||||
case JVM_CONSTANT_MethodType :
|
||||
st->print("signature_index=%d", cp->method_type_index_at(index));
|
||||
break;
|
||||
case JVM_CONSTANT_InvokeDynamic :
|
||||
st->print("bootstrap_method_index=%d", cp->invoke_dynamic_bootstrap_method_ref_index_at(index));
|
||||
st->print(" name_and_type_index=%d", cp->invoke_dynamic_name_and_type_ref_index_at(index));
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
break;
|
||||
|
@ -264,10 +264,15 @@ symbolOop constantPoolOopDesc::impl_signature_ref_at(int which, bool uncached) {
|
||||
int constantPoolOopDesc::impl_name_and_type_ref_index_at(int which, bool uncached) {
|
||||
int i = which;
|
||||
if (!uncached && cache() != NULL) {
|
||||
if (constantPoolCacheOopDesc::is_secondary_index(which))
|
||||
if (constantPoolCacheOopDesc::is_secondary_index(which)) {
|
||||
// Invokedynamic indexes are always processed in native order
|
||||
// so there is no question of reading a native u2 in Java order here.
|
||||
return cache()->main_entry_at(which)->constant_pool_index();
|
||||
int pool_index = cache()->main_entry_at(which)->constant_pool_index();
|
||||
if (tag_at(pool_index).is_invoke_dynamic())
|
||||
pool_index = invoke_dynamic_name_and_type_ref_index_at(pool_index);
|
||||
assert(tag_at(pool_index).is_name_and_type(), "");
|
||||
return pool_index;
|
||||
}
|
||||
// change byte-ordering and go via cache
|
||||
i = remap_instruction_operand_from_cache(which);
|
||||
} else {
|
||||
@ -830,6 +835,19 @@ bool constantPoolOopDesc::compare_entry_to(int index1, constantPoolHandle cp2,
|
||||
}
|
||||
} break;
|
||||
|
||||
case JVM_CONSTANT_InvokeDynamic:
|
||||
{
|
||||
int k1 = invoke_dynamic_bootstrap_method_ref_index_at(index1);
|
||||
int k2 = cp2->invoke_dynamic_bootstrap_method_ref_index_at(index2);
|
||||
if (k1 == k2) {
|
||||
int i1 = invoke_dynamic_name_and_type_ref_index_at(index1);
|
||||
int i2 = cp2->invoke_dynamic_name_and_type_ref_index_at(index2);
|
||||
if (i1 == i2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case JVM_CONSTANT_UnresolvedString:
|
||||
{
|
||||
symbolOop s1 = unresolved_string_at(index1);
|
||||
@ -1016,6 +1034,13 @@ void constantPoolOopDesc::copy_entry_to(int from_i, constantPoolHandle to_cp,
|
||||
to_cp->method_handle_index_at_put(to_i, k1, k2);
|
||||
} break;
|
||||
|
||||
case JVM_CONSTANT_InvokeDynamic:
|
||||
{
|
||||
int k1 = invoke_dynamic_bootstrap_method_ref_index_at(from_i);
|
||||
int k2 = invoke_dynamic_name_and_type_ref_index_at(from_i);
|
||||
to_cp->invoke_dynamic_at_put(to_i, k1, k2);
|
||||
} break;
|
||||
|
||||
// Invalid is used as the tag for the second constant pool entry
|
||||
// occupied by JVM_CONSTANT_Double or JVM_CONSTANT_Long. It should
|
||||
// not be seen by itself.
|
||||
@ -1231,6 +1256,7 @@ jint constantPoolOopDesc::cpool_entry_size(jint idx) {
|
||||
case JVM_CONSTANT_Methodref:
|
||||
case JVM_CONSTANT_InterfaceMethodref:
|
||||
case JVM_CONSTANT_NameAndType:
|
||||
case JVM_CONSTANT_InvokeDynamic:
|
||||
return 5;
|
||||
|
||||
case JVM_CONSTANT_Long:
|
||||
@ -1444,6 +1470,15 @@ int constantPoolOopDesc::copy_cpool_bytes(int cpool_size,
|
||||
DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1));
|
||||
break;
|
||||
}
|
||||
case JVM_CONSTANT_InvokeDynamic: {
|
||||
*bytes = JVM_CONSTANT_InvokeDynamic;
|
||||
idx1 = invoke_dynamic_bootstrap_method_ref_index_at(idx);
|
||||
idx2 = invoke_dynamic_name_and_type_ref_index_at(idx);
|
||||
Bytes::put_Java_u2((address) (bytes+1), idx1);
|
||||
Bytes::put_Java_u2((address) (bytes+3), idx2);
|
||||
DBG(printf("JVM_CONSTANT_InvokeDynamic: %hd %hd", idx1, idx2));
|
||||
break;
|
||||
}
|
||||
}
|
||||
DBG(printf("\n"));
|
||||
bytes += ent_size;
|
||||
|
@ -156,6 +156,11 @@ class constantPoolOopDesc : public oopDesc {
|
||||
*int_at_addr(which) = ref_index;
|
||||
}
|
||||
|
||||
void invoke_dynamic_at_put(int which, int bootstrap_method_index, int name_and_type_index) {
|
||||
tag_at_put(which, JVM_CONSTANT_InvokeDynamic);
|
||||
*int_at_addr(which) = ((jint) name_and_type_index<<16) | bootstrap_method_index;
|
||||
}
|
||||
|
||||
// Temporary until actual use
|
||||
void unresolved_string_at_put(int which, symbolOop s) {
|
||||
*obj_at_addr(which) = NULL;
|
||||
@ -396,6 +401,16 @@ class constantPoolOopDesc : public oopDesc {
|
||||
int sym = method_type_index_at(which);
|
||||
return symbol_at(sym);
|
||||
}
|
||||
int invoke_dynamic_bootstrap_method_ref_index_at(int which) {
|
||||
assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
|
||||
jint ref_index = *int_at_addr(which);
|
||||
return extract_low_short_from_int(ref_index);
|
||||
}
|
||||
int invoke_dynamic_name_and_type_ref_index_at(int which) {
|
||||
assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
|
||||
jint ref_index = *int_at_addr(which);
|
||||
return extract_high_short_from_int(ref_index);
|
||||
}
|
||||
|
||||
// The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve,
|
||||
// name_and_type_ref_index_at) all expect to be passed indices obtained
|
||||
|
@ -134,7 +134,7 @@ int ConstantPoolCacheEntry::field_index() const {
|
||||
void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
|
||||
methodHandle method,
|
||||
int vtable_index) {
|
||||
|
||||
assert(!is_secondary_entry(), "");
|
||||
assert(method->interpreter_entry() != NULL, "should have been set at this point");
|
||||
assert(!method->is_obsolete(), "attempt to write obsolete method to cpCache");
|
||||
bool change_to_virtual = (invoke_code == Bytecodes::_invokeinterface);
|
||||
@ -142,7 +142,6 @@ void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
|
||||
int byte_no = -1;
|
||||
bool needs_vfinal_flag = false;
|
||||
switch (invoke_code) {
|
||||
case Bytecodes::_invokedynamic:
|
||||
case Bytecodes::_invokevirtual:
|
||||
case Bytecodes::_invokeinterface: {
|
||||
if (method->can_be_statically_bound()) {
|
||||
@ -155,6 +154,23 @@ void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
|
||||
byte_no = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
case Bytecodes::_invokedynamic: // similar to _invokevirtual
|
||||
if (TraceInvokeDynamic) {
|
||||
tty->print_cr("InvokeDynamic set_method%s method="PTR_FORMAT" index=%d",
|
||||
(is_secondary_entry() ? " secondary" : ""),
|
||||
(intptr_t)method(), vtable_index);
|
||||
method->print();
|
||||
this->print(tty, 0);
|
||||
}
|
||||
assert(method->can_be_statically_bound(), "must be a MH invoker method");
|
||||
assert(AllowTransitionalJSR292 || _f2 >= constantPoolOopDesc::CPCACHE_INDEX_TAG, "BSM index initialized");
|
||||
set_f1(method());
|
||||
needs_vfinal_flag = false; // _f2 is not an oop
|
||||
assert(!is_vfinal(), "f2 not an oop");
|
||||
byte_no = 1; // coordinate this with bytecode_number & is_resolved
|
||||
break;
|
||||
|
||||
case Bytecodes::_invokespecial:
|
||||
// Preserve the value of the vfinal flag on invokevirtual bytecode
|
||||
// which may be shared with this constant pool cache entry.
|
||||
@ -209,6 +225,7 @@ void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
|
||||
|
||||
|
||||
void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index) {
|
||||
assert(!is_secondary_entry(), "");
|
||||
klassOop interf = method->method_holder();
|
||||
assert(instanceKlass::cast(interf)->is_interface(), "must be an interface");
|
||||
set_f1(interf);
|
||||
@ -218,8 +235,23 @@ void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index)
|
||||
}
|
||||
|
||||
|
||||
void ConstantPoolCacheEntry::initialize_bootstrap_method_index_in_cache(int bsm_cache_index) {
|
||||
assert(!is_secondary_entry(), "only for JVM_CONSTANT_InvokeDynamic main entry");
|
||||
assert(_f2 == 0, "initialize once");
|
||||
assert(bsm_cache_index == (int)(u2)bsm_cache_index, "oob");
|
||||
set_f2(bsm_cache_index + constantPoolOopDesc::CPCACHE_INDEX_TAG);
|
||||
}
|
||||
|
||||
int ConstantPoolCacheEntry::bootstrap_method_index_in_cache() {
|
||||
assert(!is_secondary_entry(), "only for JVM_CONSTANT_InvokeDynamic main entry");
|
||||
intptr_t bsm_cache_index = (intptr_t) _f2 - constantPoolOopDesc::CPCACHE_INDEX_TAG;
|
||||
assert(bsm_cache_index == (intptr_t)(u2)bsm_cache_index, "oob");
|
||||
return (int) bsm_cache_index;
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site,
|
||||
methodHandle signature_invoker) {
|
||||
assert(is_secondary_entry(), "");
|
||||
int param_size = signature_invoker->size_of_parameters();
|
||||
assert(param_size >= 1, "method argument size must include MH.this");
|
||||
param_size -= 1; // do not count MH.this; it is not stacked for invokedynamic
|
||||
@ -227,7 +259,6 @@ void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site,
|
||||
// racing threads might be trying to install their own favorites
|
||||
set_f1(call_site());
|
||||
}
|
||||
//set_f2(0);
|
||||
bool is_final = true;
|
||||
assert(signature_invoker->is_final_method(), "is_final");
|
||||
set_flags(as_flags(as_TosState(signature_invoker->result_type()), is_final, false, false, false, true) | param_size);
|
||||
@ -417,14 +448,14 @@ void ConstantPoolCacheEntry::print(outputStream* st, int index) const {
|
||||
// print separator
|
||||
if (index == 0) tty->print_cr(" -------------");
|
||||
// print entry
|
||||
tty->print_cr("%3d (%08x) ", index, this);
|
||||
tty->print("%3d ("PTR_FORMAT") ", index, (intptr_t)this);
|
||||
if (is_secondary_entry())
|
||||
tty->print_cr("[%5d|secondary]", main_entry_index());
|
||||
else
|
||||
tty->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
|
||||
tty->print_cr(" [ %08x]", (address)(oop)_f1);
|
||||
tty->print_cr(" [ %08x]", _f2);
|
||||
tty->print_cr(" [ %08x]", _flags);
|
||||
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)(oop)_f1);
|
||||
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_f2);
|
||||
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_flags);
|
||||
tty->print_cr(" -------------");
|
||||
}
|
||||
|
||||
|
@ -185,6 +185,10 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
methodHandle signature_invoker // determines signature information
|
||||
);
|
||||
|
||||
// For JVM_CONSTANT_InvokeDynamic cache entries:
|
||||
void initialize_bootstrap_method_index_in_cache(int bsm_cache_index);
|
||||
int bootstrap_method_index_in_cache();
|
||||
|
||||
void set_parameter_size(int value) {
|
||||
assert(parameter_size() == 0 || parameter_size() == value,
|
||||
"size must not change");
|
||||
@ -207,6 +211,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
case Bytecodes::_getfield : // fall through
|
||||
case Bytecodes::_invokespecial : // fall through
|
||||
case Bytecodes::_invokestatic : // fall through
|
||||
case Bytecodes::_invokedynamic : // fall through
|
||||
case Bytecodes::_invokeinterface : return 1;
|
||||
case Bytecodes::_putstatic : // fall through
|
||||
case Bytecodes::_putfield : // fall through
|
||||
@ -234,6 +239,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
Bytecodes::Code bytecode_1() const { return Bytecodes::cast((_indices >> 16) & 0xFF); }
|
||||
Bytecodes::Code bytecode_2() const { return Bytecodes::cast((_indices >> 24) & 0xFF); }
|
||||
volatile oop f1() const { return _f1; }
|
||||
bool is_f1_null() const { return (oop)_f1 == NULL; } // classifies a CPC entry as unbound
|
||||
intx f2() const { return _f2; }
|
||||
int field_index() const;
|
||||
int parameter_size() const { return _flags & 0xFF; }
|
||||
|
@ -851,9 +851,15 @@ jint* methodOopDesc::method_type_offsets_chain() {
|
||||
// MethodHandleCompiler.
|
||||
// Must be consistent with MethodHandleCompiler::get_method_oop().
|
||||
bool methodOopDesc::is_method_handle_adapter() const {
|
||||
return (is_method_handle_invoke_name(name()) &&
|
||||
is_synthetic() &&
|
||||
MethodHandleCompiler::klass_is_method_handle_adapter_holder(method_holder()));
|
||||
if (is_synthetic() &&
|
||||
!is_native() && // has code from MethodHandleCompiler
|
||||
is_method_handle_invoke_name(name()) &&
|
||||
MethodHandleCompiler::klass_is_method_handle_adapter_holder(method_holder())) {
|
||||
assert(!is_method_handle_invoke(), "disjoint");
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
methodHandle methodOopDesc::make_invoke_method(KlassHandle holder,
|
||||
|
@ -1046,7 +1046,8 @@ enum {
|
||||
JVM_CONSTANT_InterfaceMethodref,
|
||||
JVM_CONSTANT_NameAndType,
|
||||
JVM_CONSTANT_MethodHandle = 15, // JSR 292
|
||||
JVM_CONSTANT_MethodType = 16 // JSR 292
|
||||
JVM_CONSTANT_MethodType = 16, // JSR 292
|
||||
JVM_CONSTANT_InvokeDynamic = 17 // JSR 292
|
||||
};
|
||||
|
||||
/* JVM_CONSTANT_MethodHandle subtypes */
|
||||
|
@ -738,6 +738,12 @@ void MethodHandleCompiler::emit_bc(Bytecodes::Code op, int index) {
|
||||
|
||||
// bi
|
||||
case Bytecodes::_ldc:
|
||||
assert(Bytecodes::format_bits(op, false) == (Bytecodes::_fmt_b|Bytecodes::_fmt_has_k), "wrong bytecode format");
|
||||
assert((char) index == index, "index does not fit in 8-bit");
|
||||
_bytecode.push(op);
|
||||
_bytecode.push(index);
|
||||
break;
|
||||
|
||||
case Bytecodes::_iload:
|
||||
case Bytecodes::_lload:
|
||||
case Bytecodes::_fload:
|
||||
@ -754,7 +760,8 @@ void MethodHandleCompiler::emit_bc(Bytecodes::Code op, int index) {
|
||||
_bytecode.push(index);
|
||||
break;
|
||||
|
||||
// bii
|
||||
// bkk
|
||||
case Bytecodes::_ldc_w:
|
||||
case Bytecodes::_ldc2_w:
|
||||
case Bytecodes::_checkcast:
|
||||
assert(Bytecodes::format_bits(op, false) == Bytecodes::_fmt_bkk, "wrong bytecode format");
|
||||
|
@ -2475,6 +2475,10 @@ JVM_END
|
||||
|
||||
JVM_ENTRY(void, MHI_registerBootstrap(JNIEnv *env, jobject igcls, jclass caller_jh, jobject bsm_jh)) {
|
||||
instanceKlassHandle ik = MethodHandles::resolve_instance_klass(caller_jh, THREAD);
|
||||
if (!AllowTransitionalJSR292) {
|
||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||
"registerBootstrapMethod is only supported in JSR 292 EDR");
|
||||
}
|
||||
ik->link_class(CHECK);
|
||||
if (!java_dyn_MethodHandle::is_instance(JNIHandles::resolve(bsm_jh))) {
|
||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "method handle");
|
||||
|
@ -3517,6 +3517,9 @@ class CommandLineFlags {
|
||||
experimental(bool, EnableInvokeDynamic, false, \
|
||||
"recognize the invokedynamic instruction") \
|
||||
\
|
||||
experimental(bool, AllowTransitionalJSR292, true, \
|
||||
"recognize pre-PFD formats of invokedynamic") \
|
||||
\
|
||||
develop(bool, TraceInvokeDynamic, false, \
|
||||
"trace internal invoke dynamic operations") \
|
||||
\
|
||||
|
@ -159,6 +159,8 @@ void mutex_init() {
|
||||
def(STS_init_lock , Mutex, leaf, true );
|
||||
if (UseConcMarkSweepGC) {
|
||||
def(iCMS_lock , Monitor, special, true ); // CMS incremental mode start/stop notification
|
||||
}
|
||||
if (UseConcMarkSweepGC || UseG1GC) {
|
||||
def(FullGCCount_lock , Monitor, leaf, true ); // in support of ExplicitGCInvokesConcurrent
|
||||
}
|
||||
if (UseG1GC) {
|
||||
|
@ -91,6 +91,8 @@ const char* constantTag::internal_name() const {
|
||||
return "MethodHandle";
|
||||
case JVM_CONSTANT_MethodType :
|
||||
return "MethodType";
|
||||
case JVM_CONSTANT_InvokeDynamic :
|
||||
return "InvokeDynamic";
|
||||
case JVM_CONSTANT_Object :
|
||||
return "Object";
|
||||
case JVM_CONSTANT_Utf8 :
|
||||
|
@ -80,13 +80,14 @@ class constantTag VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
bool is_method_type() const { return _tag == JVM_CONSTANT_MethodType; }
|
||||
bool is_method_handle() const { return _tag == JVM_CONSTANT_MethodHandle; }
|
||||
bool is_invoke_dynamic() const { return _tag == JVM_CONSTANT_InvokeDynamic; }
|
||||
|
||||
constantTag() {
|
||||
_tag = JVM_CONSTANT_Invalid;
|
||||
}
|
||||
constantTag(jbyte tag) {
|
||||
assert((tag >= 0 && tag <= JVM_CONSTANT_NameAndType) ||
|
||||
(tag >= JVM_CONSTANT_MethodHandle && tag <= JVM_CONSTANT_MethodType) ||
|
||||
(tag >= JVM_CONSTANT_MethodHandle && tag <= JVM_CONSTANT_InvokeDynamic) ||
|
||||
(tag >= JVM_CONSTANT_InternalMin && tag <= JVM_CONSTANT_InternalMax), "Invalid constant tag");
|
||||
_tag = tag;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -345,6 +345,35 @@ inline intptr_t align_object_offset(intptr_t offset) {
|
||||
return align_size_up(offset, HeapWordsPerLong);
|
||||
}
|
||||
|
||||
// The expected size in bytes of a cache line, used to pad data structures.
|
||||
#define DEFAULT_CACHE_LINE_SIZE 64
|
||||
|
||||
// Bytes needed to pad type to avoid cache-line sharing; alignment should be the
|
||||
// expected cache line size (a power of two). The first addend avoids sharing
|
||||
// when the start address is not a multiple of alignment; the second maintains
|
||||
// alignment of starting addresses that happen to be a multiple.
|
||||
#define PADDING_SIZE(type, alignment) \
|
||||
((alignment) + align_size_up_(sizeof(type), alignment))
|
||||
|
||||
// Templates to create a subclass padded to avoid cache line sharing. These are
|
||||
// effective only when applied to derived-most (leaf) classes.
|
||||
|
||||
// When no args are passed to the base ctor.
|
||||
template <class T, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
|
||||
class Padded: public T {
|
||||
private:
|
||||
char _pad_buf_[PADDING_SIZE(T, alignment)];
|
||||
};
|
||||
|
||||
// When either 0 or 1 args may be passed to the base ctor.
|
||||
template <class T, typename Arg1T, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
|
||||
class Padded01: public T {
|
||||
public:
|
||||
Padded01(): T() { }
|
||||
Padded01(Arg1T arg1): T(arg1) { }
|
||||
private:
|
||||
char _pad_buf_[PADDING_SIZE(T, alignment)];
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Utility macros for compilers
|
||||
|
@ -31,6 +31,48 @@ uint ParallelTaskTerminator::_total_spins = 0;
|
||||
uint ParallelTaskTerminator::_total_peeks = 0;
|
||||
#endif
|
||||
|
||||
#if TASKQUEUE_STATS
|
||||
const char * const TaskQueueStats::_names[last_stat_id] = {
|
||||
"qpush", "qpop", "qpop-s", "qattempt", "qsteal", "opush", "omax"
|
||||
};
|
||||
|
||||
void TaskQueueStats::print_header(unsigned int line, outputStream* const stream,
|
||||
unsigned int width)
|
||||
{
|
||||
// Use a width w: 1 <= w <= max_width
|
||||
const unsigned int max_width = 40;
|
||||
const unsigned int w = MAX2(MIN2(width, max_width), 1U);
|
||||
|
||||
if (line == 0) { // spaces equal in width to the header
|
||||
const unsigned int hdr_width = w * last_stat_id + last_stat_id - 1;
|
||||
stream->print("%*s", hdr_width, " ");
|
||||
} else if (line == 1) { // labels
|
||||
stream->print("%*s", w, _names[0]);
|
||||
for (unsigned int i = 1; i < last_stat_id; ++i) {
|
||||
stream->print(" %*s", w, _names[i]);
|
||||
}
|
||||
} else if (line == 2) { // dashed lines
|
||||
char dashes[max_width + 1];
|
||||
memset(dashes, '-', w);
|
||||
dashes[w] = '\0';
|
||||
stream->print("%s", dashes);
|
||||
for (unsigned int i = 1; i < last_stat_id; ++i) {
|
||||
stream->print(" %s", dashes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TaskQueueStats::print(outputStream* stream, unsigned int width) const
|
||||
{
|
||||
#define FMT SIZE_FORMAT_W(*)
|
||||
stream->print(FMT, width, _stats[0]);
|
||||
for (unsigned int i = 1; i < last_stat_id; ++i) {
|
||||
stream->print(" " FMT, width, _stats[i]);
|
||||
}
|
||||
#undef FMT
|
||||
}
|
||||
#endif // TASKQUEUE_STATS
|
||||
|
||||
int TaskQueueSetSuper::randomParkAndMiller(int *seed0) {
|
||||
const int a = 16807;
|
||||
const int m = 2147483647;
|
||||
|
@ -22,6 +22,72 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Simple TaskQueue stats that are collected by default in debug builds.
|
||||
|
||||
#if !defined(TASKQUEUE_STATS) && defined(ASSERT)
|
||||
#define TASKQUEUE_STATS 1
|
||||
#elif !defined(TASKQUEUE_STATS)
|
||||
#define TASKQUEUE_STATS 0
|
||||
#endif
|
||||
|
||||
#if TASKQUEUE_STATS
|
||||
#define TASKQUEUE_STATS_ONLY(code) code
|
||||
#else
|
||||
#define TASKQUEUE_STATS_ONLY(code)
|
||||
#endif // TASKQUEUE_STATS
|
||||
|
||||
#if TASKQUEUE_STATS
|
||||
class TaskQueueStats {
|
||||
public:
|
||||
enum StatId {
|
||||
push, // number of taskqueue pushes
|
||||
pop, // number of taskqueue pops
|
||||
pop_slow, // subset of taskqueue pops that were done slow-path
|
||||
steal_attempt, // number of taskqueue steal attempts
|
||||
steal, // number of taskqueue steals
|
||||
overflow, // number of overflow pushes
|
||||
overflow_max_len, // max length of overflow stack
|
||||
last_stat_id
|
||||
};
|
||||
|
||||
public:
|
||||
inline TaskQueueStats() { reset(); }
|
||||
|
||||
inline void record_push() { ++_stats[push]; }
|
||||
inline void record_pop() { ++_stats[pop]; }
|
||||
inline void record_pop_slow() { record_pop(); ++_stats[pop_slow]; }
|
||||
inline void record_steal(bool success);
|
||||
inline void record_overflow(size_t new_length);
|
||||
|
||||
inline size_t get(StatId id) const { return _stats[id]; }
|
||||
inline const size_t* get() const { return _stats; }
|
||||
|
||||
inline void reset();
|
||||
|
||||
static void print_header(unsigned int line, outputStream* const stream = tty,
|
||||
unsigned int width = 10);
|
||||
void print(outputStream* const stream = tty, unsigned int width = 10) const;
|
||||
|
||||
private:
|
||||
size_t _stats[last_stat_id];
|
||||
static const char * const _names[last_stat_id];
|
||||
};
|
||||
|
||||
void TaskQueueStats::record_steal(bool success) {
|
||||
++_stats[steal_attempt];
|
||||
if (success) ++_stats[steal];
|
||||
}
|
||||
|
||||
void TaskQueueStats::record_overflow(size_t new_len) {
|
||||
++_stats[overflow];
|
||||
if (new_len > _stats[overflow_max_len]) _stats[overflow_max_len] = new_len;
|
||||
}
|
||||
|
||||
void TaskQueueStats::reset() {
|
||||
memset(_stats, 0, sizeof(_stats));
|
||||
}
|
||||
#endif // TASKQUEUE_STATS
|
||||
|
||||
template <unsigned int N>
|
||||
class TaskQueueSuper: public CHeapObj {
|
||||
protected:
|
||||
@ -135,6 +201,8 @@ public:
|
||||
|
||||
// Total size of queue.
|
||||
static const uint total_size() { return N; }
|
||||
|
||||
TASKQUEUE_STATS_ONLY(TaskQueueStats stats;)
|
||||
};
|
||||
|
||||
template<class E, unsigned int N = TASKQUEUE_SIZE>
|
||||
@ -152,6 +220,7 @@ protected:
|
||||
public:
|
||||
using TaskQueueSuper<N>::max_elems;
|
||||
using TaskQueueSuper<N>::size;
|
||||
TASKQUEUE_STATS_ONLY(using TaskQueueSuper<N>::stats;)
|
||||
|
||||
private:
|
||||
// Slow paths for push, pop_local. (pop_global has no fast path.)
|
||||
@ -224,14 +293,14 @@ bool GenericTaskQueue<E, N>::push_slow(E t, uint dirty_n_elems) {
|
||||
// g++ complains if the volatile result of the assignment is unused.
|
||||
const_cast<E&>(_elems[localBot] = t);
|
||||
OrderAccess::release_store(&_bottom, increment_index(localBot));
|
||||
TASKQUEUE_STATS_ONLY(stats.record_push());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<class E, unsigned int N>
|
||||
bool GenericTaskQueue<E, N>::
|
||||
pop_local_slow(uint localBot, Age oldAge) {
|
||||
bool GenericTaskQueue<E, N>::pop_local_slow(uint localBot, Age oldAge) {
|
||||
// This queue was observed to contain exactly one element; either this
|
||||
// thread will claim it, or a competing "pop_global". In either case,
|
||||
// the queue will be logically empty afterwards. Create a new Age value
|
||||
@ -251,6 +320,7 @@ pop_local_slow(uint localBot, Age oldAge) {
|
||||
if (tempAge == oldAge) {
|
||||
// We win.
|
||||
assert(dirty_size(localBot, _age.top()) != N - 1, "sanity");
|
||||
TASKQUEUE_STATS_ONLY(stats.record_pop_slow());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -306,6 +376,8 @@ public:
|
||||
typedef GrowableArray<E> overflow_t;
|
||||
typedef GenericTaskQueue<E, N> taskqueue_t;
|
||||
|
||||
TASKQUEUE_STATS_ONLY(using taskqueue_t::stats;)
|
||||
|
||||
OverflowTaskQueue();
|
||||
~OverflowTaskQueue();
|
||||
void initialize();
|
||||
@ -356,6 +428,7 @@ bool OverflowTaskQueue<E, N>::push(E t)
|
||||
{
|
||||
if (!taskqueue_t::push(t)) {
|
||||
overflow_stack()->push(t);
|
||||
TASKQUEUE_STATS_ONLY(stats.record_overflow(overflow_stack()->length()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -424,9 +497,13 @@ GenericTaskQueueSet<T>::queue(uint i) {
|
||||
|
||||
template<class T> bool
|
||||
GenericTaskQueueSet<T>::steal(uint queue_num, int* seed, E& t) {
|
||||
for (uint i = 0; i < 2 * _n; i++)
|
||||
if (steal_best_of_2(queue_num, seed, t))
|
||||
for (uint i = 0; i < 2 * _n; i++) {
|
||||
if (steal_best_of_2(queue_num, seed, t)) {
|
||||
TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal(true));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal(false));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -574,6 +651,7 @@ GenericTaskQueue<E, N>::push(E t) {
|
||||
// g++ complains if the volatile result of the assignment is unused.
|
||||
const_cast<E&>(_elems[localBot] = t);
|
||||
OrderAccess::release_store(&_bottom, increment_index(localBot));
|
||||
TASKQUEUE_STATS_ONLY(stats.record_push());
|
||||
return true;
|
||||
} else {
|
||||
return push_slow(t, dirty_n_elems);
|
||||
@ -603,6 +681,7 @@ GenericTaskQueue<E, N>::pop_local(E& t) {
|
||||
idx_t tp = _age.top(); // XXX
|
||||
if (size(localBot, tp) > 0) {
|
||||
assert(dirty_size(localBot, tp) != N - 1, "sanity");
|
||||
TASKQUEUE_STATS_ONLY(stats.record_pop());
|
||||
return true;
|
||||
} else {
|
||||
// Otherwise, the queue contained exactly one element; we take the slow
|
||||
|
@ -70,3 +70,9 @@ e6a40e4bb10499fb6ee9db71ab5654e5a17ab75b jdk7-b92
|
||||
c725ca829c5aa4b50a8ed5728579ec8809fbfb1d jdk7-b93
|
||||
2de307cd3b4e71127e75dff70809c1b1fbc1a494 jdk7-b94
|
||||
07050840f98cda357aa6a8d416fdccbd03038d35 jdk7-b95
|
||||
9510ed0e1c7ab46a8b6659234e1dc7786407a72b jdk7-b96
|
||||
ca01ec32561fee1855630b68a2fcd0042257a8ef jdk7-b97
|
||||
d4adf4f2d14c7b79df0a81de884b6b57c6850802 jdk7-b98
|
||||
7ef8469021fbc824ac49d57c83a14b1bb08f1766 jdk7-b99
|
||||
d524be5ef62e8b8cb890c59a5d2c19ef0ab50d45 jdk7-b100
|
||||
17f62a566a2020fd908e77106ed885e0c4e7c14d jdk7-b101
|
||||
|
@ -55,9 +55,29 @@
|
||||
<drop-import name="jaxp_src"/>
|
||||
<!-- <drop-import name="jaxp_tests"/> -->
|
||||
|
||||
<!-- Fail and print helpful messages if source does not exist. -->
|
||||
<target name="-src-help">
|
||||
<fail message="${failed.url.src.message}">
|
||||
<condition>
|
||||
<and>
|
||||
<not>
|
||||
<available file="${jaxp_src.src.dir}" type="dir"/>
|
||||
</not>
|
||||
<istrue value="${allow.downloads}"/>
|
||||
</and>
|
||||
</condition>
|
||||
</fail>
|
||||
<fail message="${failed.nourl.src.message}">
|
||||
<condition>
|
||||
<not>
|
||||
<available file="${jaxp_src.src.dir}" type="dir"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</target>
|
||||
|
||||
<!-- Special build area preparation. -->
|
||||
<target name="-drop-build-prep" depends="init, -init-src-dirs">
|
||||
<!-- Special build area setup. -->
|
||||
<target name="-drop-build-setup" depends="init, -init-src-dirs">
|
||||
<mkdir dir="${build.classes.dir}"/>
|
||||
<copy todir="${build.classes.dir}">
|
||||
<fileset dir="${primary.src.dir}"
|
||||
@ -84,7 +104,7 @@
|
||||
|
||||
<!-- Source directory selection. -->
|
||||
<target name="-init-src-dirs"
|
||||
depends="init, -use-drop">
|
||||
depends="init, -use-drop,-src-help">
|
||||
<echo message="Using primary.src.dir=${primary.src.dir}"/>
|
||||
<pathconvert property="src.list.id" refid="src.dir.id"/>
|
||||
<echo message="Using src.dir.id=${src.list.id}"/>
|
||||
|
@ -75,6 +75,7 @@
|
||||
<target name="-@DROP@-url-should-be-used" unless="@DROP@.url.should.be.used">
|
||||
<condition property="@DROP@.url.should.be.used">
|
||||
<and>
|
||||
<istrue value="${allow.downloads}"/>
|
||||
<not>
|
||||
<isset property="@DROP@.master.bundle.copy.exists"/>
|
||||
</not>
|
||||
|
@ -104,4 +104,24 @@ sanity.info= Sanity Settings:${line.separator}\
|
||||
drops.dir=${drops.dir}${line.separator}\
|
||||
${line.separator}
|
||||
|
||||
# Failure messages when source cannot be found on the file system
|
||||
failed.nourl.src.message=\
|
||||
ERROR: Cannot find source for project ${ant.project.name}.\
|
||||
${line.separator}${line.separator}\
|
||||
HINT: Try setting drops.dir to indicate where the bundles can be found, \
|
||||
or try setting the ant property allow.downloads=true to download the bundle from the URL.\
|
||||
${line.separator}\
|
||||
e.g. ant -Dallow.downloads=true -OR- ant -Ddrops.dir=some_directory \
|
||||
${line.separator}
|
||||
|
||||
# Failure message when source cannot be downloaded
|
||||
failed.url.src.message=\
|
||||
ERROR: Cannot find source for project ${ant.project.name}.\
|
||||
${line.separator}${line.separator}\
|
||||
HINT: Try setting drops.dir to indicate where the bundles can be found, \
|
||||
or try checking the URL with your browser.\
|
||||
${line.separator}\
|
||||
e.g. ant -Ddrops.dir=some_directory \
|
||||
${line.separator}
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
@ -36,6 +36,11 @@
|
||||
javac.debug - true or false for debug classfiles
|
||||
javac.target - classfile version target
|
||||
javac.source - source version
|
||||
drops.dir - directory that holds source drop bundles
|
||||
allow.download - permit downloads from public url (default is false)
|
||||
(used if bundles not found in drops.dir)
|
||||
|
||||
Run 'make help' for help using the Makefile.
|
||||
</description>
|
||||
|
||||
<!-- Mac is special, need to downgrade these before build.properties. -->
|
||||
@ -106,16 +111,20 @@
|
||||
<jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="-build-prep"
|
||||
depends="init, -init-src-dirs, -drop-build-prep">
|
||||
<target name="-build-setup"
|
||||
depends="init, -init-src-dirs, -drop-build-setup">
|
||||
</target>
|
||||
|
||||
<!-- Build (compilation) of sources to class files. -->
|
||||
<target name="build"
|
||||
depends="init, -init-src-dirs, -build-prep">
|
||||
depends="compile, -build-setup">
|
||||
</target>
|
||||
<target name="compile"
|
||||
depends="init, -init-src-dirs">
|
||||
<mkdir dir="${build.classes.dir}"/>
|
||||
<javac
|
||||
includeAntRuntime="false"
|
||||
classpath="${build.classes.dir}"
|
||||
includeAntRuntime="false"
|
||||
classpath="${build.classes.dir}:${tools.jar}"
|
||||
fork="true"
|
||||
destdir="${build.classes.dir}"
|
||||
memoryInitialSize="${javac.memoryInitialSize}"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2007, 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
|
||||
@ -24,13 +24,13 @@
|
||||
#
|
||||
|
||||
drops.master.copy.base=${drops.dir}
|
||||
drops.master.url.base=https://jaxp.dev.java.net/files/documents/913/147490
|
||||
|
||||
jaxp_src.bundle.name=jdk7-jaxp-m6.zip
|
||||
jaxp_src.bundle.md5.checksum=080827d779c114365f8504bd79b34604
|
||||
jaxp_src.bundle.name=jdk7-jaxp-m7.zip
|
||||
jaxp_src.bundle.md5.checksum=22e95fbdb9fb7d8b6b6fc0a1d76d1fbd
|
||||
jaxp_src.master.bundle.dir=${drops.master.copy.base}
|
||||
jaxp_src.master.bundle.url.base=${drops.master.url.base}
|
||||
jaxp_src.master.bundle.url.base=https://jaxp.dev.java.net/files/documents/913/150785
|
||||
|
||||
#jaxp_tests.bundle.name=jdk7-jaxp-tests-2009_08_28.zip
|
||||
#jaxp_tests.master.bundle.dir=${drops.master.copy.base}
|
||||
#jaxp_tests.master.bundle.url.base=https://jaxp.dev.java.net/files/documents/913/147490
|
||||
|
||||
jaxp_tests.bundle.name=jdk7-jaxp-tests-2009_08_28.zip
|
||||
jaxp_tests.master.bundle.dir=${drops.master.copy.base}
|
||||
jaxp_tests.master.bundle.url.base=${drops.master.url.base}
|
||||
|
@ -65,6 +65,11 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
# If downloads are allowed
|
||||
ifeq ($(ALLOW_DOWNLOADS),true)
|
||||
ANT_OPTIONS += -Dallow.downloads=true
|
||||
endif
|
||||
|
||||
# Figure out the platform we are using
|
||||
_SYSTEM_UNAME := $(shell uname)
|
||||
_PLATFORM_KIND = unix
|
||||
@ -159,6 +164,8 @@ help:
|
||||
@echo " $(ANT_TARGETS)"
|
||||
@echo " "
|
||||
@echo " Environment or command line variables (all optional):"
|
||||
$(call helpenvline, ALT_DROPS_DIR,\
|
||||
"Directory that contains the drop source bundles i.e. drops.dir")
|
||||
$(call helpenvline, ALT_BOOTDIR,\
|
||||
"JAVA_HOME to use when running ant")
|
||||
$(call helpenvline, ALT_LANGTOOLS_DIST,\
|
||||
|
@ -70,3 +70,9 @@ df7c033f6a11c0973ab0e74701b1248aee9b659f jdk7-b92
|
||||
797bef19197566ffb056edaa1b34db43bd9bf7b0 jdk7-b93
|
||||
8515e093efd14ac054e941ef743f76561a393a70 jdk7-b94
|
||||
ee06cfb113d554b5c8a9a53383bae2b168533829 jdk7-b95
|
||||
208fd4451232f7a522ddb20334c598656844ccb7 jdk7-b96
|
||||
dac23846092ad4956ed41b5278f8686476ae46ef jdk7-b97
|
||||
4571098071094e705e680db5324bfa15a57b1290 jdk7-b98
|
||||
818366ce23d8919cafaa4db4c51605ee2a7c8eaf jdk7-b99
|
||||
bd26d0ce0c3cb43e58a8e2770cc03f26d96ffe5c jdk7-b100
|
||||
b55ce274490082712f5e002b38d2eed505ca863d jdk7-b101
|
||||
|
@ -55,9 +55,36 @@
|
||||
<drop-import name="jaxws_src"/>
|
||||
<drop-import name="jaf_src"/>
|
||||
<!-- <drop-import name="jaxws_tests"/> -->
|
||||
|
||||
<!-- Fail and print helpful messages if source does not exist. -->
|
||||
<target name="-src-help">
|
||||
<fail message="${failed.url.src.message}">
|
||||
<condition>
|
||||
<and>
|
||||
<not>
|
||||
<and>
|
||||
<available file="${jaxws_src.src.dir}" type="dir"/>
|
||||
<available file="${jaf_src.src.dir}" type="dir"/>
|
||||
</and>
|
||||
</not>
|
||||
<istrue value="${allow.downloads}"/>
|
||||
</and>
|
||||
</condition>
|
||||
</fail>
|
||||
<fail message="${failed.nourl.src.message}">
|
||||
<condition>
|
||||
<not>
|
||||
<and>
|
||||
<available file="${jaxws_src.src.dir}" type="dir"/>
|
||||
<available file="${jaf_src.src.dir}" type="dir"/>
|
||||
</and>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</target>
|
||||
|
||||
<!-- Special build area preparation. -->
|
||||
<target name="-drop-build-prep" depends="init, -init-src-dirs">
|
||||
<!-- Special build area setup. -->
|
||||
<target name="-drop-build-setup" depends="init, -init-src-dirs">
|
||||
<mkdir dir="${build.classes.dir}"/>
|
||||
<copy todir="${build.classes.dir}">
|
||||
<fileset dir="${primary.src.dir}"
|
||||
@ -99,7 +126,7 @@
|
||||
|
||||
<!-- Source directory selection. -->
|
||||
<target name="-init-src-dirs"
|
||||
depends="init, -use-drop">
|
||||
depends="init, -use-drop,-src-help">
|
||||
<echo message="Using primary.src.dir=${primary.src.dir}"/>
|
||||
<pathconvert property="src.list.id" refid="src.dir.id"/>
|
||||
<echo message="Using src.dir.id=${src.list.id}"/>
|
||||
|
@ -75,6 +75,7 @@
|
||||
<target name="-@DROP@-url-should-be-used" unless="@DROP@.url.should.be.used">
|
||||
<condition property="@DROP@.url.should.be.used">
|
||||
<and>
|
||||
<istrue value="${allow.downloads}"/>
|
||||
<not>
|
||||
<isset property="@DROP@.master.bundle.copy.exists"/>
|
||||
</not>
|
||||
|
@ -104,4 +104,24 @@ sanity.info= Sanity Settings:${line.separator}\
|
||||
drops.dir=${drops.dir}${line.separator}\
|
||||
${line.separator}
|
||||
|
||||
# Failure messages when source cannot be found on the file system
|
||||
failed.nourl.src.message=\
|
||||
ERROR: Cannot find source for project ${ant.project.name}.\
|
||||
${line.separator}${line.separator}\
|
||||
HINT: Try setting drops.dir to indicate where the bundles can be found, \
|
||||
or try setting the ant property allow.downloads=true to download the bundle from the URL.\
|
||||
${line.separator}\
|
||||
e.g. ant -Dallow.downloads=true -OR- ant -Ddrops.dir=some_directory \
|
||||
${line.separator}
|
||||
|
||||
# Failure message when source cannot be downloaded
|
||||
failed.url.src.message=\
|
||||
ERROR: Cannot find source for project ${ant.project.name}.\
|
||||
${line.separator}${line.separator}\
|
||||
HINT: Try setting drops.dir to indicate where the bundles can be found, \
|
||||
or try checking the URL with your browser.\
|
||||
${line.separator}\
|
||||
e.g. ant -Ddrops.dir=some_directory \
|
||||
${line.separator}
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
@ -36,6 +36,11 @@
|
||||
javac.debug - true or false for debug classfiles
|
||||
javac.target - classfile version target
|
||||
javac.source - source version
|
||||
drops.dir - directory that holds source drop bundles
|
||||
allow.download - permit downloads from public url (default is false)
|
||||
(used if bundles not found in drops.dir)
|
||||
|
||||
Run 'make help' for help using the Makefile.
|
||||
</description>
|
||||
|
||||
<!-- Mac is special, need to downgrade these before build.properties. -->
|
||||
@ -106,13 +111,17 @@
|
||||
<jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="-build-prep"
|
||||
depends="init, -init-src-dirs, -drop-build-prep">
|
||||
<target name="-build-setup"
|
||||
depends="init, -init-src-dirs, -drop-build-setup">
|
||||
</target>
|
||||
|
||||
<!-- Build (compilation) of sources to class files. -->
|
||||
<target name="build"
|
||||
depends="init, -init-src-dirs, -build-prep">
|
||||
depends="compile, -build-setup">
|
||||
</target>
|
||||
<target name="compile"
|
||||
depends="init, -init-src-dirs">
|
||||
<mkdir dir="${build.classes.dir}"/>
|
||||
<javac
|
||||
includeAntRuntime="false"
|
||||
classpath="${build.classes.dir}:${tools.jar}"
|
||||
|
@ -24,19 +24,18 @@
|
||||
#
|
||||
|
||||
drops.master.copy.base=${drops.dir}
|
||||
drops.master.url.base=http://kenai.com/projects/jdk7-drops/downloads/download
|
||||
|
||||
jaxws_src.bundle.name=jdk7-jaxws-2009_09_28.zip
|
||||
jaxws_src.bundle.md5.checksum=f5010ebf636db9f465a61a7a74944543
|
||||
jaxws_src.bundle.name=jdk7-jaxws-b100.zip
|
||||
jaxws_src.bundle.md5.checksum=e4fea255c6222b118bb1d0d3054d36e1
|
||||
jaxws_src.master.bundle.dir=${drops.master.copy.base}
|
||||
#jaxws_src.bundle.url.base=https://jaxws.dev.java.net/files/documents/913/142147
|
||||
jaxws_src.master.bundle.url.base=${drops.master.url.base}
|
||||
jaxws_src.master.bundle.url.base=https://jax-ws.dev.java.net/files/documents/4202/150896
|
||||
|
||||
jaf_src.bundle.name=jdk7-jaf-2009_08_28.zip
|
||||
jaf_src.bundle.md5.checksum=eb8cb7a4a7f14e211fbe2354878a2472
|
||||
jaf_src.master.bundle.dir=${drops.master.copy.base}
|
||||
jaf_src.master.bundle.url.base=${drops.master.url.base}
|
||||
jaf_src.master.bundle.url.base=http://kenai.com/projects/jdk7-drops/downloads/download
|
||||
|
||||
#jaxws_tests.bundle.name=jdk7-jaxws-tests-2009_08_28.zip
|
||||
#jaxws_tests.master.bundle.dir=${drops.master.copy.base}
|
||||
#jaxws_tests.master.bundle.url.base=http://kenai.com/projects/jdk7-drops/downloads/download
|
||||
|
||||
jaxws_tests.bundle.name=jdk7-jaxws-tests-2009_08_28.zip
|
||||
jaxws_tests.master.bundle.dir=${drops.master.copy.base}
|
||||
jaxws_tests.master.bundle.url.base=${drops.master.url.base}
|
||||
|
@ -65,6 +65,11 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
# If downloads are allowed
|
||||
ifeq ($(ALLOW_DOWNLOADS),true)
|
||||
ANT_OPTIONS += -Dallow.downloads=true
|
||||
endif
|
||||
|
||||
# Figure out the platform we are using
|
||||
_SYSTEM_UNAME := $(shell uname)
|
||||
_PLATFORM_KIND = unix
|
||||
@ -159,6 +164,8 @@ help:
|
||||
@echo " $(ANT_TARGETS)"
|
||||
@echo " "
|
||||
@echo " Environment or command line variables (all optional):"
|
||||
$(call helpenvline, ALT_DROPS_DIR,\
|
||||
"Directory that contains the drop source bundles i.e. drops.dir")
|
||||
$(call helpenvline, ALT_BOOTDIR,\
|
||||
"JAVA_HOME to use when running ant")
|
||||
$(call helpenvline, ALT_LANGTOOLS_DIST,\
|
||||
|
@ -70,3 +70,9 @@ f2dce7210cc00453c23e53edeec7156f112ca382 jdk7-b92
|
||||
219b84b9533ae4fe3c6c2083f8a8962cb579f1de jdk7-b93
|
||||
cf44386c8fe3fbdb9da14346be25d19fd1092f71 jdk7-b94
|
||||
db951e984ccf50756160fee3078c791300b0917e jdk7-b95
|
||||
51b9e5dbc2da0631414484b934ac3fb62e48a2c6 jdk7-b96
|
||||
b1903d7528d33b521df42bc9291bdcdd2f444a29 jdk7-b97
|
||||
82593186fa54ab12f17af31f86a7bf364efaf4df jdk7-b98
|
||||
2587c9f0b60dc3146b4247b8674ada456a643d6f jdk7-b99
|
||||
820b4e843d5168370a3bf166d19751a3271d8575 jdk7-b100
|
||||
d58354a69011f3d3354765fa3167567c4c4a9612 jdk7-b101
|
||||
|
@ -42,7 +42,7 @@ endif
|
||||
SUBDIRS = java security net/ssl jarsigner
|
||||
|
||||
SUBDIRS_management = jmx
|
||||
SUBDIRS_desktop = image inputmethods
|
||||
SUBDIRS_desktop = image
|
||||
SUBDIRS_enterprise = crypto/provider jndi \
|
||||
org xml rowset net/httpserver
|
||||
SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo
|
||||
|
@ -1,79 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2002, 2008, 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. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile for indic input method.
|
||||
#
|
||||
|
||||
BUILDDIR = ../../../..
|
||||
|
||||
PACKAGE = com.sun.inputmethods.internal.indicim
|
||||
PRODUCT = sun
|
||||
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
SERVICESDIR=META-INF/services
|
||||
IMJAR = $(IMJARDIR)/indicim.jar
|
||||
IMJARDIR=$(LIBDIR)/im
|
||||
include $(BUILDDIR)/common/Defs.gmk
|
||||
|
||||
#
|
||||
# Files
|
||||
#
|
||||
AUTO_FILES_JAVA_DIRS = com/sun/inputmethods/internal/indicim
|
||||
|
||||
FILES_copy = \
|
||||
$(CLASSDESTDIR)/com/sun/inputmethods/internal/indicim/resources/DisplayNames.properties
|
||||
|
||||
PROVIDER_CONF_FILE = \
|
||||
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor
|
||||
|
||||
#
|
||||
# Rules
|
||||
#
|
||||
include $(BUILDDIR)/common/Classes.gmk
|
||||
|
||||
build: $(IMJAR)
|
||||
|
||||
#
|
||||
# Extra rules to build im.
|
||||
#
|
||||
|
||||
$(CLASSDESTDIR)/com/sun/inputmethods/internal/indicim/resources/% : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/indicim/resources/%
|
||||
$(install-file)
|
||||
|
||||
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/indicim/java.awt.im.spi.InputMethodDescriptor
|
||||
$(install-file)
|
||||
|
||||
$(IMJAR): $(FILES_class) $(FILES_copy) $(PROVIDER_CONF_FILE)
|
||||
$(prep-target)
|
||||
$(BOOT_JAR_CMD) -cf $@ \
|
||||
-C $(CLASSDESTDIR) com \
|
||||
-C $(CLASSDESTDIR) $(SERVICESDIR) \
|
||||
$(BOOT_JAR_JFLAGS)
|
||||
@$(java-vm-cleanup)
|
||||
|
||||
clean::
|
||||
$(RM) -r $(CLASSDESTDIR)
|
||||
$(RM) $(IMJAR)
|
@ -1,79 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2002, 2008, 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. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile for thai input method.
|
||||
#
|
||||
|
||||
BUILDDIR = ../../../..
|
||||
|
||||
PACKAGE = com.sun.inputmethods.internal.thaiim
|
||||
PRODUCT = sun
|
||||
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
SERVICESDIR=META-INF/services
|
||||
IMJAR = $(IMJARDIR)/thaiim.jar
|
||||
IMJARDIR=$(LIBDIR)/im
|
||||
include $(BUILDDIR)/common/Defs.gmk
|
||||
|
||||
#
|
||||
# Files
|
||||
#
|
||||
AUTO_FILES_JAVA_DIRS = com/sun/inputmethods/internal/thaiim
|
||||
|
||||
FILES_copy = \
|
||||
$(CLASSDESTDIR)/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties
|
||||
|
||||
PROVIDER_CONF_FILE = \
|
||||
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor
|
||||
|
||||
#
|
||||
# Rules
|
||||
#
|
||||
include $(BUILDDIR)/common/Classes.gmk
|
||||
|
||||
build: $(IMJAR)
|
||||
|
||||
#
|
||||
# Extra rules to build im.
|
||||
#
|
||||
|
||||
$(CLASSDESTDIR)/com/sun/inputmethods/internal/thaiim/resources/% : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/thaiim/resources/%
|
||||
$(install-file)
|
||||
|
||||
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor
|
||||
$(install-file)
|
||||
|
||||
$(IMJAR): $(FILES_class) $(FILES_copy) $(PROVIDER_CONF_FILE)
|
||||
$(prep-target)
|
||||
$(BOOT_JAR_CMD) -cf $@ \
|
||||
-C $(CLASSDESTDIR) com \
|
||||
-C $(CLASSDESTDIR) $(SERVICESDIR) \
|
||||
$(BOOT_JAR_JFLAGS)
|
||||
@$(java-vm-cleanup)
|
||||
|
||||
clean::
|
||||
$(RM) -r $(CLASSDESTDIR)
|
||||
$(RM) $(IMJAR)
|
@ -194,7 +194,16 @@ ifeq ($(FASTDEBUG), true)
|
||||
CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
|
||||
endif
|
||||
|
||||
CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
|
||||
CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
|
||||
|
||||
# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
|
||||
ifneq ($(ARCH),alpha)
|
||||
CPP_ARCH_FLAGS += -D$(ARCH)
|
||||
else
|
||||
CPP_ARCH_FLAGS += -D_$(ARCH)_
|
||||
endif
|
||||
|
||||
CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
|
||||
-D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
|
||||
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
@ -311,6 +320,7 @@ override LIBCXX = -lstdc++
|
||||
endif
|
||||
override LIBPOSIX4 =
|
||||
override LIBSOCKET =
|
||||
override LIBNSL =
|
||||
override LIBTHREAD =
|
||||
override MOOT_PRIORITIES = true
|
||||
override NO_INTERRUPTIBLE_IO = true
|
||||
|
@ -639,25 +639,15 @@ AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB)
|
||||
# in general this is ok to continue to do.
|
||||
LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1
|
||||
|
||||
# Math Library (libm.so), do not use -lm.
|
||||
# There might be two versions of libm.so on the build system:
|
||||
# libm.so.1 and libm.so.2, and we want libm.so.1.
|
||||
# Depending on the Solaris release being used to build with,
|
||||
# /usr/lib/libm.so could point at a libm.so.2, so we are
|
||||
# explicit here so that the libjvm.so you have built will work on an
|
||||
# older Solaris release that might not have libm.so.2.
|
||||
# This is a critical factor in allowing builds on Solaris 10 or newer
|
||||
# to run on Solaris 8 or 9.
|
||||
#
|
||||
# Note: Historically there was also a problem picking up a static version
|
||||
# of libm.a from the compiler area, but that problem has gone away
|
||||
# with the newer compilers. Use of libm.a would cause .so bloat.
|
||||
#
|
||||
LIBM = /usr/lib$(ISA_DIR)/libm.so.1
|
||||
# JDK now requires Solaris 10, so pick up libm.so.2
|
||||
LIBM = /usr/lib$(ISA_DIR)/libm.so.2
|
||||
|
||||
# Socket library
|
||||
LIBSOCKET = -lsocket
|
||||
|
||||
# Network Services library
|
||||
LIBNSL = -lnsl
|
||||
|
||||
# GLOBAL_KPIC: If set means all libraries are PIC, position independent code
|
||||
# EXCEPT for select compiles
|
||||
# If a .o file is compiled non-PIC then it should be forced
|
||||
|
@ -47,14 +47,20 @@ IMAGE_BINDIR = bin
|
||||
# Swing has taken this approach only as a temporary measure to avoid
|
||||
# the compiler warnings until we can properly document these packages.
|
||||
# This is covered under 6491853.
|
||||
EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf \
|
||||
com.sun.java.swing.plaf.windows \
|
||||
EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows \
|
||||
com.sun.java.swing.plaf.motif \
|
||||
com.sun.java.swing.plaf.gtk
|
||||
|
||||
# This is a stopgap until 6839872 is fixed.
|
||||
EXCLUDE_PROPWARN_PKGS += sun.dyn
|
||||
|
||||
#
|
||||
# Include the exported private packages in ct.sym.
|
||||
# This is an interim solution until the ct.sym is replaced
|
||||
# with a new module system (being discussed for JDK 7).
|
||||
#
|
||||
EXPORTED_PRIVATE_PKGS = com.sun.servicetag
|
||||
|
||||
# 64-bit solaris has a few special cases. We define the variable
|
||||
# SOLARIS64 for use in this Makefile to easily test those cases
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
@ -983,7 +989,7 @@ initial-image-jdk:: initial-image-jdk-setup \
|
||||
-processor com.sun.tools.javac.sym.CreateSymbols \
|
||||
-Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
|
||||
-Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
|
||||
$(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
|
||||
$(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
|
||||
$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
|
||||
-C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
|
||||
@$(java-vm-cleanup)
|
||||
|
@ -35,9 +35,6 @@ ifndef JDK_MAKE_SHARED_DIR
|
||||
JDK_MAKE_SHARED_DIR = $(JDK_TOPDIR)/make/common/shared
|
||||
endif
|
||||
|
||||
ifndef CONTROL_TOPDIR
|
||||
CONTROL_TOPDIR=$(TOPDIR)
|
||||
endif
|
||||
ifndef HOTSPOT_TOPDIR
|
||||
HOTSPOT_TOPDIR=$(TOPDIR)/hotspot
|
||||
endif
|
||||
|
93
jdk/make/common/shared/Defs-javadoc.gmk
Normal file
93
jdk/make/common/shared/Defs-javadoc.gmk
Normal file
@ -0,0 +1,93 @@
|
||||
#
|
||||
# Copyright (c) 1997, 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. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Copyright year for beginning of Java and some of the apis
|
||||
# (Needed when creating the javadocs)
|
||||
FIRST_COPYRIGHT_YEAR = 1993
|
||||
DOMAPI_FIRST_COPYRIGHT_YEAR = 2005
|
||||
MIRROR_FIRST_COPYRIGHT_YEAR = 2004
|
||||
DOCLETAPI_FIRST_COPYRIGHT_YEAR = 1993
|
||||
TAGLETAPI_FIRST_COPYRIGHT_YEAR = 1993
|
||||
JDI_FIRST_COPYRIGHT_YEAR = 1999
|
||||
JAAS_FIRST_COPYRIGHT_YEAR = 1998
|
||||
JGSS_FIRST_COPYRIGHT_YEAR = 2000
|
||||
SMARTCARDIO_FIRST_COPYRIGHT_YEAR = 2005
|
||||
HTTPSERVER_FIRST_COPYRIGHT_YEAR = 2005
|
||||
MGMT_FIRST_COPYRIGHT_YEAR = 2003
|
||||
ATTACH_FIRST_COPYRIGHT_YEAR = 2005
|
||||
JCONSOLE_FIRST_COPYRIGHT_YEAR = 2006
|
||||
SCTPAPI_FIRST_COPYRIGHT_YEAR = 2009
|
||||
TRACING_FIRST_COPYRIGHT_YEAR = 2008
|
||||
TREEAPI_FIRST_COPYRIGHT_YEAR = 2005
|
||||
JNLP_FIRST_COPYRIGHT_YEAR = 1998
|
||||
PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007
|
||||
|
||||
# Oracle name
|
||||
COMPANY_NAME = Oracle and/or its affiliates
|
||||
|
||||
# Copyright address
|
||||
COMPANY_ADDRESS = 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA.
|
||||
|
||||
# The trademark symbol
|
||||
TRADEMARK = ™
|
||||
|
||||
# Common copyright lines used
|
||||
# The word "Copyright" might optionally be a link to the file cpyr.html.
|
||||
# The first year of copyright may vary or not be available.
|
||||
# The address to the company might be optional.
|
||||
COMMA:= ,
|
||||
EMPTY:=
|
||||
SPACE:=$(EMPTY) $(EMPTY)
|
||||
COPYRIGHT_SYMBOL = &\#x00a9;
|
||||
# Macros to handle the optional empty args.
|
||||
# (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81)
|
||||
define OptionalCopyrightUrl # url
|
||||
$(shell \
|
||||
if [ "$1" != "" ] ; then \
|
||||
printf "<a href=\"%s\">Copyright</a>" "$1"; \
|
||||
else \
|
||||
printf "Copyright"; \
|
||||
fi)
|
||||
endef
|
||||
define OptionalCopyrightFirstYear # year
|
||||
$(shell \
|
||||
if [ "$1" != "" ] ; then \
|
||||
printf "%s," "$1";\
|
||||
fi)
|
||||
endef
|
||||
define OptionalCompanyAddress # address
|
||||
$(shell \
|
||||
if [ "$1" != "" ] ; then \
|
||||
printf "%s" "$1";\
|
||||
fi)
|
||||
endef
|
||||
define CopyrightLine # optionalurl optionalfirstyear optionaladdress
|
||||
$(call OptionalCopyrightUrl,$1) $(COPYRIGHT_SYMBOL)\
|
||||
$(call OptionalCopyrightFirstYear,$2) $(COPYRIGHT_YEAR),\
|
||||
$(COMPANY_NAME).\
|
||||
$(call OptionalCompanyAddress,$3)\
|
||||
All rights reserved.
|
||||
endef
|
||||
|
@ -230,7 +230,8 @@ endif
|
||||
|
||||
# Compilers, SDK, and Visual Studio (MSDEV) [32bit is different from 64bit]
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
# Try looking in MSVCDIR or MSVCDir area first (set by vcvars32.bat)
|
||||
# Try looking in MSVCDIR or MSVCDir area first
|
||||
# (set by vcvars32.bat for VC .NET, not defined in the VC 2008/2010)
|
||||
ifdef MSVCDIR
|
||||
xMSVCDIR :="$(subst \,/,$(MSVCDIR))"
|
||||
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
|
||||
@ -238,11 +239,6 @@ ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
ifdef MSVCDir
|
||||
xMSVCDIR :="$(subst \,/,$(MSVCDir))"
|
||||
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
|
||||
else
|
||||
ifneq ($(_program_files),)
|
||||
xMSVCDIR :="$(_program_files)/Microsoft Visual Studio .NET 2003/Vc7"
|
||||
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
# If we still don't have it, look for VSnnCOMNTOOLS (newest first),
|
||||
@ -331,23 +327,50 @@ ifeq ($(_ms_sdk),)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Compilers for 64bit may be from SDK. For VS 2010 we use those.
|
||||
# The Express compilers don't contain 64 bit compilers, so in
|
||||
# that case, you additionally need the SDK. At this time,
|
||||
# there's no 64 bit SDK available that has VS 2010.
|
||||
# Presumably SDK v7.1 will provide that and we may want to update
|
||||
# the logic here to work with that.
|
||||
# However official builds will use the Professional version.
|
||||
# Compilers for 64bit may be from the free SDK, or Visual Studio Professional
|
||||
# The free Express compilers don't contain 64 bit compilers, which is why
|
||||
# you instead need the SDK.
|
||||
# So for VS2010 based builds, either VS2010 Pro with the 7.0a SDK, or
|
||||
# the Windows 7.1 standalone SDK with compilers may be used.
|
||||
# Release enginering will use VS2010 Pro, so the frequency of testing of
|
||||
# SDK based builds will depend entirely on individual usage.
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
ifdef VS100COMNTOOLS # /Common7/Tools directory, use ../../Vc
|
||||
# VS2010 default location is used when building 64 bit using the 7.1 SDK
|
||||
# This is safe to hardwire as the SDK installer won't let you change it
|
||||
# and the VS2010 variable is only used if the compilers are from the SDK
|
||||
xVS2010 :="$(_program_files32)/Microsoft Visual Studio 10.0/"
|
||||
VS2010 :=$(call FullPath,$(xVS2010))
|
||||
xVS100COMNTOOLS :="$(subst \,/,$(VS100COMNTOOLS))"
|
||||
_vs100tools :=$(call FullPath,$(xVS100COMNTOOLS))
|
||||
endif
|
||||
ifneq ($(_vs100tools),)
|
||||
_compiler_bin :=$(_vs100tools)/../../Vc/bin/amd64
|
||||
_redist_sdk :=$(_vs100tools)/../../Vc/redist/x64/Microsoft.VC100.CRT
|
||||
xMSSDK70 :="$(_program_files32)/Microsoft SDKs/Windows/v7.0a/"
|
||||
MSSDK70 :=$(call FullPath,$(xMSSDK70))
|
||||
x_redist_sdk :=$(_vs100tools)/../../Vc/redist/x64/Microsoft.VC100.CRT
|
||||
_redist_sdk :=$(call FullPath,$(x_redist_sdk))
|
||||
# The SDK doesn't have the redist directory, but the DLL is installed
|
||||
# into the windows directory.
|
||||
ifeq ($(_redist_sdk),)
|
||||
_redist_sdk :=c:/windows/system32
|
||||
endif
|
||||
# Not currently using MSSDK7n, but maybe we can make use of it for
|
||||
# doing default location lookup to find some SDK tools that presently
|
||||
# require the developer to explicitly set the path.
|
||||
# The 7.0a path is from VS2010 Pro, the 7.1 path is the standalone SDK.
|
||||
# Either will work for us.
|
||||
# If a developer chooses to install the standalone SDK in some other
|
||||
# location, then this will fail to find it, which won't matter so long as
|
||||
# we aren't using this variable. If we do they'd still need to set the
|
||||
# ALT_MSDEVTOOLS_PATH as now.
|
||||
# %WindowsSdkDir% could be referenced instead but the SDK installer
|
||||
# doesn't set it and in the case of the VS2010 compilers,
|
||||
# you can't change this location in the installer anyway.
|
||||
xMSSDK7n :="$(_program_files32)/Microsoft SDKs/Windows/v7.0a/"
|
||||
MSSDK7n :=$(call FullPath,$(xMSSDK7n))
|
||||
ifeq ($(MSSDK7n),)
|
||||
xMSSDK7n :="$(_program_files32)/Microsoft SDKs/Windows/v7.1/"
|
||||
MSSDK7n :=$(call FullPath,$(xMSSDK7n))
|
||||
endif
|
||||
else
|
||||
xVS2008 :="$(_program_files32)/Microsoft Visual Studio 9.0/"
|
||||
VS2008 :=$(call FullPath,$(xVS2008))
|
||||
@ -355,7 +378,7 @@ ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
_compiler_bin :=$(VS2008)/VC/Bin/$(ARCH)
|
||||
xMSSDK61 :="$(_program_files)/Microsoft SDKs/Windows/v6.1/"
|
||||
MSSDK61 :=$(call FullPath,$(xMSSDK61))
|
||||
_redist_sdk :=$(VS2008)/VC/redist/x86/Microsoft.VC90.CRT
|
||||
_redist_sdk :=$(VS2008)/VC/redist/x64/Microsoft.VC90.CRT
|
||||
else
|
||||
ifneq ($(_ms_sdk),)
|
||||
ifeq ($(ARCH), ia64)
|
||||
|
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