This commit is contained in:
Vladimir Kozlov 2011-04-01 15:16:04 -07:00
commit bcbdcf6f83
350 changed files with 30037 additions and 6583 deletions

View File

@ -109,3 +109,4 @@ d8af56da89bc0fc02a6b6ad78f51157a46d665ab jdk7-b131
d61280d36755d1941fb487f554e8b7a6d0bca6a1 jdk7-b132
fd444c61e7ed3d92b2a730da7c737b02191b682f jdk7-b133
def8e16dd237a47fc067d66d4c616d7baaec6001 jdk7-b134
f75a1efb141210901aabe00a834e0fc32bb8b337 jdk7-b135

View File

@ -109,3 +109,4 @@ cc58c11af15411042719e9c82707fdbef60a9e0f jdk7-b130
0f62a65fb666b337caa585015ab6ea2e60e709ca jdk7-b132
c6f380693342feadccc5fe2c5adf500e861361aa jdk7-b133
ddc2fcb3682ffd27f44354db666128827be7e3c3 jdk7-b134
783bd02b4ab4596059c74b10a1793d7bd2f1c157 jdk7-b135

View File

@ -1763,6 +1763,12 @@
Where each of these directories contain the import JDK image
for that platform.
</dd>
<dt><a name="ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a></dt>
<dd>
The top-level directory of the libraries and include files for the platform's
graphical programming environment. The default location is platform specific.
For example, on Linux it defaults to <tt>/usr/X11R6/</tt>.
</dd>
<dt><strong>Windows specific:</strong></dt>
<dd>
<dl>
@ -1791,6 +1797,81 @@
</dd>
</dl>
</dd>
<dt><strong>Cross-Compilation Support:</strong></dt>
<dd>
<dl>
<dt><a name="CROSS_COMPILE_ARCH"><tt>CROSS_COMPILE_ARCH</tt></a> </dt>
<dd>
Set to the target architecture of a cross-compilation build. If set, this
variable is used to signify that we are cross-compiling. The expectation
is that <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> is set
to point to the cross-compiler and that any cross-compilation specific flags
are passed using <a href="#EXTRA_CFLAGS"><tt>EXTRA_CFLAGS</tt></a>.
The <a href="#ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a> variable should
also be set to point to the graphical header files (e.g. X11) provided with
the cross-compiler.
When cross-compiling we skip execution of any demos etc that may be built, and
also skip binary-file verification.
</dd>
<dt><tt><a name="EXTRA_CFLAGS">EXTRA_CFLAGS</a></tt> </dt>
<dd>
Used to pass cross-compilation options to the cross-compiler.
These are added to the <tt>CFLAGS</tt> and <tt>CXXFLAGS</tt> variables.
</dd>
<dt><tt><a name="USE_ONLY_BOOTDIR_TOOLS">USE_ONLY_BOOTDIR_TOOLS</a></tt> </dt>
<dd>
Used primarily for cross-compilation builds (and always set in that case)
this variable indicates that tools from the boot JDK should be used during
the build process, not the tools (<tt>javac</tt>, <tt>javah</tt>, <tt>jar</tt>)
just built (which can't execute on the build host).
</dd>
<dt><tt><a name="HOST_CC">HOST_CC</a></tt> </dt>
<dd>
The location of the C compiler to generate programs to run on the build host.
Some parts of the build generate programs that are then compiled and executed
to produce other parts of the build. Normally the primary C compiler is used
to do this, but when cross-compiling that would be the cross-compiler and the
resulting program could not be executed.
On Linux this defaults to <tt>/usr/bin/gcc</tt>; on other platforms it must be
set explicitly.
</dd>
</dl>
<dt><strong>Specialized Build Options:</strong></dt>
<dd>
Some build variables exist to support specialized build environments and/or specialized
build products. Their use is only supported in those contexts:
<dl>
<dt><tt><a name="BUILD_CLIENT_ONLY">BUILD_CLIENT_ONLY</a></tt> </dt>
<dd>
Indicates this build will only contain the Hotspot client VM. In addition to
controlling the Hotspot build target, it ensures that we don't try to copy
any server VM files/directories, and defines a default <tt>jvm.cfg</tt> file
suitable for a client-only environment. Using this in a 64-bit build will
generate a sanity warning as 64-bit client builds are not directly supported.
</dd>
<dt><tt><a name="BUILD_HEADLESS_ONLY"></a>BUILD_HEADLESS_ONLY</tt> </dt>
<dd>
Used when the build environment has no graphical capabilities at all. This
excludes building anything that requires graphical libraries to be available.
</dd>
<dt><tt><a name="JAVASE_EMBEDDED"></a>JAVASE_EMBEDDED</tt> </dt>
<dd>
Used to indicate this is a build of the Oracle Java SE Embedded product.
This will enable the directives included in the SE-Embedded specific build
files.
</dd>
<dt><tt><a name="LIBZIP_CAN_USE_MMAP">LIBZIP_CAN_USE_MMAP</a></tt> </dt>
<dd>
If set to false, disables the use of mmap by the zip utility. Otherwise,
mmap will be used.
</dd>
<dt><tt><a name="COMPRESS_JARS"></a>COMPRESS_JARS</tt> </dt>
<dd>
If set to true, causes certain jar files that would otherwise be built without
compression, to use compression.
</dd>
</dl>
</dd>
</dl>
</blockquote>
<!-- ------------------------------------------------------ -->

View File

@ -109,3 +109,4 @@ d7532bcd3742f1576dd07ff9fbb535c9c9a276e9 jdk7-b126
1b1e75e8f476e5c07f0d2b035993895e2603e1f0 jdk7-b132
671fe2e623ffefb4b7c312be919fc71eb48c1df1 jdk7-b133
918003855fa0dba5acf4bf1fe36526d2fc4c1ba8 jdk7-b134
e0b72ae5dc5e824b342801c8d1d336a55eb54e2c jdk7-b135

View File

@ -156,3 +156,5 @@ a8d643a4db47c7b58e0bcb49c77b5c3610de86a8 hs21-b03
1b3a350709e4325d759bb453ff3fb6a463270488 jdk7-b133
447e6faab4a8755d4860c2366630729dbaec111c jdk7-b134
3c76374706ea8a77e15aec8310e831e5734f8775 hs21-b04
b898f0fc3cedc972d884d31a751afd75969531cf jdk7-b135
b898f0fc3cedc972d884d31a751afd75969531cf hs21-b05

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=21
HS_MINOR_VER=0
HS_BUILD_NUMBER=05
HS_BUILD_NUMBER=06
JDK_MAJOR_VER=1
JDK_MINOR_VER=7

View File

@ -93,16 +93,15 @@ if "%MSC_VER%" == "1500" (
echo Will generate VC9 {Visual Studio 2008}
) else (
if "%MSC_VER%" == "1600" (
echo Detected Visual Studio 2010, but
echo will generate VC9 {Visual Studio 2008}
echo Use conversion wizard in VS 2010.
echo Will generate VC10 {Visual Studio 2010}
set ProjectFile=%HotSpotBuildSpace%\jvm.vcxproj
) else (
echo Will generate VC7 project {Visual Studio 2003 .NET}
)
)
)
)
echo %ProjectFile%
echo %ProjectFile%
echo **************************************************************
REM Test all variables to see whether the directories they

View File

@ -27,10 +27,6 @@
# This is used externally by both batch and IDE builds, so can't
# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE,
# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables.
#
# NOTE: unfortunately the ProjectCreatorSources list must be kept
# synchronized between this and the Solaris version
# (make/solaris/makefiles/projectcreator.make).
ProjectCreatorSources=\
$(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \
@ -42,6 +38,7 @@ ProjectCreatorSources=\
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC7.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC8.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC9.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC10.java \
$(WorkSpace)\src\share\tools\ProjectCreator\Util.java \
$(WorkSpace)\src\share\tools\ProjectCreator\BuildConfig.java \
$(WorkSpace)\src\share\tools\ProjectCreator\ArgsParser.java

View File

@ -65,8 +65,8 @@ VcVersion=VC9
!elseif "$(MSC_VER)" == "1600"
# for compatibility - we don't yet have a ProjectCreator for VC10
VcVersion=VC9
VcVersion=VC10
ProjectFile=jvm.vcxproj
!else

View File

@ -47,18 +47,6 @@ public class Util {
return sb.toString();
}
static String join(String padder, String v[]) {
StringBuffer sb = new StringBuffer();
for (int i=0; i<v.length; i++) {
sb.append(v[i]);
if (i < (v.length - 1)) sb.append(padder);
}
return sb.toString();
}
static String prefixed_join(String padder, Vector v, boolean quoted) {
StringBuffer sb = new StringBuffer();

View File

@ -587,7 +587,6 @@ public abstract class WinGammaPlatform {
Vector allConfigs = new Vector();
allConfigs.add(new C1DebugConfig());
allConfigs.add(new C1FastDebugConfig());
allConfigs.add(new C1ProductConfig());
@ -655,6 +654,10 @@ public abstract class WinGammaPlatform {
boolean isHeader() {
return attr.shortName.endsWith(".h") || attr.shortName.endsWith(".hpp");
}
boolean isCpp() {
return attr.shortName.endsWith(".cpp");
}
}
@ -708,7 +711,7 @@ public abstract class WinGammaPlatform {
PrintWriter printWriter;
public void writeProjectFile(String projectFileName, String projectName,
Vector allConfigs) throws IOException {
Vector<BuildConfig> allConfigs) throws IOException {
throw new RuntimeException("use compiler version specific version");
}
}

View File

@ -0,0 +1,545 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.TreeSet;
import java.util.UUID;
import java.util.Vector;
public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
@Override
protected String getProjectExt() {
return ".vcxproj";
}
@Override
public void writeProjectFile(String projectFileName, String projectName,
Vector<BuildConfig> allConfigs) throws IOException {
System.out.println();
System.out.print(" Writing .vcxproj file: " + projectFileName);
String projDir = Util.normalize(new File(projectFileName).getParent());
printWriter = new PrintWriter(projectFileName, "UTF-8");
printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
startTag("Project",
"DefaultTargets", "Build",
"ToolsVersion", "4.0",
"xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
startTag("ItemGroup",
"Label", "ProjectConfigurations");
for (BuildConfig cfg : allConfigs) {
startTag("ProjectConfiguration",
"Include", cfg.get("Name"));
tagData("Configuration", cfg.get("Id"));
tagData("Platform", cfg.get("PlatformName"));
endTag("ProjectConfiguration");
}
endTag("ItemGroup");
startTag("PropertyGroup", "Label", "Globals");
tagData("ProjectGuid", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}");
tag("SccProjectName");
tag("SccLocalPath");
endTag("PropertyGroup");
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "PropertyGroup", "Label", "Configuration");
tagData("ConfigurationType", "DynamicLibrary");
tagData("UseOfMfc", "false");
endTag("PropertyGroup");
}
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
startTag("ImportGroup", "Label", "ExtensionSettings");
endTag("ImportGroup");
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "ImportGroup", "Label", "PropertySheets");
tag("Import",
"Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props",
"Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')",
"Label", "LocalAppDataPlatform");
endTag("ImportGroup");
}
tag("PropertyGroup", "Label", "UserMacros");
startTag("PropertyGroup");
tagData("_ProjectFileVersion", "10.0.30319.1");
for (BuildConfig cfg : allConfigs) {
tagData(cfg, "OutDir", cfg.get("OutputDir") + Util.sep);
tagData(cfg, "IntDir", cfg.get("OutputDir") + Util.sep);
tagData(cfg, "LinkIncremental", "false");
}
for (BuildConfig cfg : allConfigs) {
tagData(cfg, "CodeAnalysisRuleSet", "AllRules.ruleset");
tag(cfg, "CodeAnalysisRules");
tag(cfg, "CodeAnalysisRuleAssemblies");
}
endTag("PropertyGroup");
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "ItemDefinitionGroup");
startTag("ClCompile");
tagV(cfg.getV("CompilerFlags"));
endTag("ClCompile");
startTag("Link");
tagV(cfg.getV("LinkerFlags"));
endTag("Link");
startTag("PostBuildEvent");
tagData("Message", BuildConfig.getFieldString(null, "PostbuildDescription"));
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace("\t", "\r\n")));
endTag("PostBuildEvent");
startTag("PreLinkEvent");
tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription"));
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n")));
endTag("PreLinkEvent");
endTag("ItemDefinitionGroup");
}
writeFiles(allConfigs, projDir);
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets");
startTag("ImportGroup", "Label", "ExtensionTargets");
endTag("ImportGroup");
endTag("Project");
printWriter.close();
System.out.println(" Done.");
writeFilterFile(projectFileName, projectName, allConfigs, projDir);
writeUserFile(projectFileName, allConfigs);
}
private void writeUserFile(String projectFileName, Vector<BuildConfig> allConfigs) throws FileNotFoundException, UnsupportedEncodingException {
String userFileName = projectFileName + ".user";
if (new File(userFileName).exists()) {
return;
}
System.out.print(" Writing .vcxproj.user file: " + userFileName);
printWriter = new PrintWriter(userFileName, "UTF-8");
printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
startTag("Project",
"ToolsVersion", "4.0",
"xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "PropertyGroup");
tagData("LocalDebuggerCommand", "$(TargetDir)/hotspot.exe");
endTag("PropertyGroup");
}
endTag("Project");
printWriter.close();
System.out.println(" Done.");
}
private void writeFilterFile(String projectFileName, String projectName,
Vector<BuildConfig> allConfigs, String base) throws FileNotFoundException, UnsupportedEncodingException {
String filterFileName = projectFileName + ".filters";
System.out.print(" Writing .vcxproj.filters file: " + filterFileName);
printWriter = new PrintWriter(filterFileName, "UTF-8");
printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
startTag("Project",
"ToolsVersion", "4.0",
"xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
Hashtable<String, FileAttribute> allFiles = computeAttributedFiles(allConfigs);
TreeSet<FileInfo> sortedFiles = sortFiles(allFiles);
Vector<NameFilter> filters = makeFilters(sortedFiles);
// first all filters
startTag("ItemGroup");
for (NameFilter filter : filters) {
doWriteFilter(filter, "");
}
startTag("Filter", "Include", "Resource Files");
UUID uuid = UUID.randomUUID();
tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
tagData("Extensions", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe");
endTag("Filter");
endTag("ItemGroup");
// then all cpp files
startTag("ItemGroup");
for (NameFilter filter : filters) {
doWriteFiles(sortedFiles, filter, "", "ClCompile", new Evaluator() {
public boolean pick(FileInfo fi) {
return fi.isCpp();
}
}, base);
}
endTag("ItemGroup");
// then all header files
startTag("ItemGroup");
for (NameFilter filter : filters) {
doWriteFiles(sortedFiles, filter, "", "ClInclude", new Evaluator() {
public boolean pick(FileInfo fi) {
return fi.isHeader();
}
}, base);
}
endTag("ItemGroup");
// then all other files
startTag("ItemGroup");
for (NameFilter filter : filters) {
doWriteFiles(sortedFiles, filter, "", "None", new Evaluator() {
public boolean pick(FileInfo fi) {
return true;
}
}, base);
}
endTag("ItemGroup");
endTag("Project");
printWriter.close();
System.out.println(" Done.");
}
private void doWriteFilter(NameFilter filter, String start) {
startTag("Filter", "Include", start + filter.fname);
UUID uuid = UUID.randomUUID();
tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
endTag("Filter");
if (filter instanceof ContainerFilter) {
Iterator i = ((ContainerFilter)filter).babies();
while (i.hasNext()) {
doWriteFilter((NameFilter)i.next(), start + filter.fname + "\\");
}
}
}
interface Evaluator {
boolean pick(FileInfo fi);
}
private void doWriteFiles(TreeSet<FileInfo> allFiles, NameFilter filter, String start, String tool, Evaluator eval, String base) {
if (filter instanceof ContainerFilter) {
Iterator i = ((ContainerFilter)filter).babies();
while (i.hasNext()) {
doWriteFiles(allFiles, (NameFilter)i.next(), start + filter.fname + "\\", tool, eval, base);
}
}
else {
Iterator i = allFiles.iterator();
while (i.hasNext()) {
FileInfo fi = (FileInfo)i.next();
if (!filter.match(fi)) {
continue;
}
if (eval.pick(fi)) {
startTag(tool, "Include", rel(fi.full, base));
tagData("Filter", start + filter.fname);
endTag(tool);
// we not gonna look at this file anymore (sic!)
i.remove();
}
}
}
}
void writeFiles(Vector<BuildConfig> allConfigs, String projDir) {
Hashtable<String, FileAttribute> allFiles = computeAttributedFiles(allConfigs);
TreeSet<FileInfo> sortedFiles = sortFiles(allFiles);
// first cpp-files
startTag("ItemGroup");
for (FileInfo fi : sortedFiles) {
if (!fi.isCpp()) {
continue;
}
writeFile("ClCompile", allConfigs, fi, projDir);
}
endTag("ItemGroup");
// then header-files
startTag("ItemGroup");
for (FileInfo fi : sortedFiles) {
if (!fi.isHeader()) {
continue;
}
writeFile("ClInclude", allConfigs, fi, projDir);
}
endTag("ItemGroup");
// then others
startTag("ItemGroup");
for (FileInfo fi : sortedFiles) {
if (fi.isHeader() || fi.isCpp()) {
continue;
}
writeFile("None", allConfigs, fi, projDir);
}
endTag("ItemGroup");
}
/**
* Make "path" into a relative path using "base" as the base.
*
* path and base are assumed to be normalized with / as the file separator.
* returned path uses "\\" as file separator
*/
private String rel(String path, String base)
{
if(!base.endsWith("/")) {
base += "/";
}
String[] pathTok = path.split("/");
String[] baseTok = base.split("/");
int pi = 0;
int bi = 0;
StringBuilder newPath = new StringBuilder();
// first step past all path components that are the same
while (pi < pathTok.length &&
bi < baseTok.length &&
pathTok[pi].equals(baseTok[bi])) {
pi++;
bi++;
}
// for each path component left in base, add "../"
while (bi < baseTok.length) {
bi++;
newPath.append("..\\");
}
// now add everything left in path
while (pi < pathTok.length) {
newPath.append(pathTok[pi]);
pi++;
if (pi != pathTok.length) {
newPath.append("\\");
}
}
return newPath.toString();
}
private void writeFile(String tool, Vector<BuildConfig> allConfigs, FileInfo fi, String base) {
if (fi.attr.configs == null && fi.attr.pchRoot == false && fi.attr.noPch == false) {
tag(tool, "Include", rel(fi.full, base));
}
else {
startTag(tool, "Include", rel(fi.full, base));
for (BuildConfig cfg : allConfigs) {
if (fi.attr.configs != null && !fi.attr.configs.contains(cfg.get("Name"))) {
tagData(cfg, "ExcludedFromBuild", "true");
}
if (fi.attr.pchRoot) {
tagData(cfg, "PrecompiledHeader", "Create");
}
if (fi.attr.noPch) {
startTag(cfg, "PrecompiledHeader");
endTag("PrecompiledHeader");
}
}
endTag(tool);
}
}
String buildCond(BuildConfig cfg) {
return "'$(Configuration)|$(Platform)'=='"+cfg.get("Name")+"'";
}
void tagV(Vector<String> v) {
Iterator<String> i = v.iterator();
while(i.hasNext()) {
String name = i.next();
String data = i.next();
tagData(name, data);
}
}
void tagData(BuildConfig cfg, String name, String data) {
tagData(name, data, "Condition", buildCond(cfg));
}
void tag(BuildConfig cfg, String name, String... attrs) {
String[] ss = new String[attrs.length + 2];
ss[0] = "Condition";
ss[1] = buildCond(cfg);
System.arraycopy(attrs, 0, ss, 2, attrs.length);
tag(name, ss);
}
void startTag(BuildConfig cfg, String name, String... attrs) {
String[] ss = new String[attrs.length + 2];
ss[0] = "Condition";
ss[1] = buildCond(cfg);
System.arraycopy(attrs, 0, ss, 2, attrs.length);
startTag(name, ss);
}
}
class CompilerInterfaceVC10 extends CompilerInterface {
@Override
Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
Vector rv = new Vector();
addAttr(rv, "AdditionalIncludeDirectories", Util.join(";", includes));
addAttr(rv, "PreprocessorDefinitions",
Util.join(";", defines).replace("\\\"", "\""));
addAttr(rv, "PrecompiledHeaderFile", "precompiled.hpp");
addAttr(rv, "PrecompiledHeaderOutputFile", outDir+Util.sep+"vm.pch");
addAttr(rv, "AssemblerListingLocation", outDir);
addAttr(rv, "ObjectFileName", outDir+Util.sep);
addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb");
// Set /nologo option
addAttr(rv, "SuppressStartupBanner", "true");
// Surpass the default /Tc or /Tp.
addAttr(rv, "CompileAs", "Default");
// Set /W3 option.
addAttr(rv, "WarningLevel", "Level3");
// Set /WX option,
addAttr(rv, "TreatWarningAsError", "true");
// Set /GS option
addAttr(rv, "BufferSecurityCheck", "false");
// Set /Zi option.
addAttr(rv, "DebugInformationFormat", "ProgramDatabase");
// Set /Yu option.
addAttr(rv, "PrecompiledHeader", "Use");
// Set /EHsc- option
addAttr(rv, "ExceptionHandling", "");
addAttr(rv, "MultiProcessorCompilation", "true");
return rv;
}
@Override
Vector getDebugCompilerFlags(String opt) {
Vector rv = new Vector();
// Set /On option
addAttr(rv, "Optimization", opt);
// Set /FR option.
addAttr(rv, "BrowseInformation", "true");
addAttr(rv, "BrowseInformationFile", "$(IntDir)");
// Set /MD option.
addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL");
// Set /Oy- option
addAttr(rv, "OmitFramePointers", "false");
return rv;
}
@Override
Vector getProductCompilerFlags() {
Vector rv = new Vector();
// Set /O2 option.
addAttr(rv, "Optimization", "MaxSpeed");
// Set /Oy- option
addAttr(rv, "OmitFramePointers", "false");
// Set /Ob option. 1 is expandOnlyInline
addAttr(rv, "InlineFunctionExpansion", "OnlyExplicitInline");
// Set /GF option.
addAttr(rv, "StringPooling", "true");
// Set /MD option. 2 is rtMultiThreadedDLL
addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL");
// Set /Gy option
addAttr(rv, "FunctionLevelLinking", "true");
return rv;
}
@Override
Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
Vector rv = new Vector();
addAttr(rv, "AdditionalOptions",
"/export:JNI_GetDefaultJavaVMInitArgs " +
"/export:JNI_CreateJavaVM " +
"/export:JVM_FindClassFromBootLoader "+
"/export:JNI_GetCreatedJavaVMs "+
"/export:jio_snprintf /export:jio_printf "+
"/export:jio_fprintf /export:jio_vfprintf "+
"/export:jio_vsnprintf "+
"/export:JVM_GetVersionInfo "+
"/export:JVM_GetThreadStateNames "+
"/export:JVM_GetThreadStateValues "+
"/export:JVM_InitAgentProperties");
addAttr(rv, "AdditionalDependencies", "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib");
addAttr(rv, "OutputFile", outDll);
addAttr(rv, "SuppressStartupBanner", "true");
addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb");
addAttr(rv, "SubSystem", "Windows");
addAttr(rv, "BaseAddress", "0x8000000");
addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
if(platformName.equals("Win32")) {
addAttr(rv, "TargetMachine", "MachineX86");
} else {
addAttr(rv, "TargetMachine", "MachineX64");
}
return rv;
}
@Override
Vector getDebugLinkerFlags() {
Vector rv = new Vector();
// /DEBUG option
addAttr(rv, "GenerateDebugInformation", "true");
return rv;
}
@Override
Vector getProductLinkerFlags() {
Vector rv = new Vector();
// Set /OPT:REF option.
addAttr(rv, "OptimizeReferences", "true");
// Set /OPT:ICF option.
addAttr(rv, "EnableCOMDATFolding", "true");
return rv;
}
@Override
void getAdditionalNonKernelLinkerFlags(Vector rv) {
extAttr(rv, "AdditionalOptions", " /export:AsyncGetCallTrace");
}
@Override
String getOptFlag() {
return "MaxSpeed";
}
@Override
String getNoOptFlag() {
return "Disabled";
}
@Override
String makeCfgName(String flavourBuild, String platform) {
return flavourBuild + "|" + platform;
}
}

View File

@ -35,7 +35,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
String projectVersion() {return "7.10";};
public void writeProjectFile(String projectFileName, String projectName,
Vector allConfigs) throws IOException {
Vector<BuildConfig> allConfigs) throws IOException {
System.out.println();
System.out.println(" Writing .vcproj file: "+projectFileName);
// If we got this far without an error, we're safe to actually
@ -54,11 +54,11 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
"SccLocalPath", ""
}
);
startTag("Platforms", null);
startTag("Platforms");
tag("Platform", new String[] {"Name", (String) BuildConfig.getField(null, "PlatformName")});
endTag("Platforms");
startTag("Configurations", null);
startTag("Configurations");
for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
writeConfiguration((BuildConfig)i.next());
@ -66,11 +66,11 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
endTag("Configurations");
tag("References", null);
tag("References");
writeFiles(allConfigs);
tag("Globals", null);
tag("Globals");
endTag("VisualStudioProject");
printWriter.close();
@ -190,28 +190,6 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
}
}
class TypeFilter extends NameFilter {
String[] exts;
TypeFilter(String fname, String[] exts) {
this.fname = fname;
this.exts = exts;
}
boolean match(FileInfo fi) {
for (int i=0; i<exts.length; i++) {
if (fi.full.endsWith(exts[i])) {
return true;
}
}
return false;
}
String filterString() {
return Util.join(";", exts);
}
}
class TerminatorFilter extends NameFilter {
TerminatorFilter(String fname) {
this.fname = fname;
@ -299,8 +277,8 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
// - container filter just provides a container to group together real filters
// - real filter can select elements from the set according to some rule, put it into XML
// and remove from the list
Vector makeFilters(TreeSet<FileInfo> files) {
Vector rv = new Vector();
Vector<NameFilter> makeFilters(TreeSet<FileInfo> files) {
Vector<NameFilter> rv = new Vector<NameFilter>();
String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/");
String currentDir = "";
@ -370,13 +348,12 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
rv.add(new SpecificNameFilter("Precompiled Header", new String[] {"precompiled.hpp"}));
// this one is to catch files not caught by other filters
//rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"}));
rv.add(new TerminatorFilter("Source Files"));
return rv;
}
void writeFiles(Vector allConfigs) {
void writeFiles(Vector<BuildConfig> allConfigs) {
Hashtable allFiles = computeAttributedFiles(allConfigs);
@ -387,7 +364,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
TreeSet sortedFiles = sortFiles(allFiles);
startTag("Files", null);
startTag("Files");
for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) {
doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next());
@ -555,35 +532,40 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
int indent;
private void startTagPrim(String name,
String[] attrs,
boolean close) {
startTagPrim(name, attrs, close, true);
}
private void startTagPrim(String name,
String[] attrs,
boolean close) {
boolean close,
boolean newline) {
doIndent();
printWriter.print("<"+name);
indent++;
if (attrs != null) {
printWriter.println();
if (attrs != null && attrs.length > 0) {
for (int i=0; i<attrs.length; i+=2) {
doIndent();
printWriter.print(" " + attrs[i]+"=\""+attrs[i+1]+"\"");
if (i < attrs.length - 2) {
printWriter.println();
}
}
}
if (close) {
indent--;
//doIndent();
printWriter.println("/>");
printWriter.print(" />");
} else {
//doIndent();
printWriter.println(">");
printWriter.print(">");
}
if(newline) {
printWriter.println();
}
}
void startTag(String name, String[] attrs) {
void startTag(String name, String... attrs) {
startTagPrim(name, attrs, false);
}
@ -601,11 +583,25 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
printWriter.println("</"+name+">");
}
void tag(String name, String[] attrs) {
void tag(String name, String... attrs) {
startTagPrim(name, attrs, true);
}
void tagV(String name, Vector attrs) {
void tagData(String name, String data) {
doIndent();
printWriter.print("<"+name+">");
printWriter.print(data);
printWriter.println("</"+name+">");
}
void tagData(String name, String data, String... attrs) {
startTagPrim(name, attrs, false, false);
printWriter.print(data);
printWriter.println("</"+name+">");
indent--;
}
void tagV(String name, Vector attrs) {
String s[] = new String [attrs.size()];
for (int i=0; i<attrs.size(); i++) {
s[i] = (String)attrs.elementAt(i);
@ -616,7 +612,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
void doIndent() {
for (int i=0; i<indent; i++) {
printWriter.print(" ");
printWriter.print(" ");
}
}

View File

@ -109,3 +109,4 @@ eab6f27131e4e2f0af0016b35b18ae65cdd249d9 jdk7-b131
abe04c59a556a3821c30bd8839e3c74f5d4281d1 jdk7-b132
8e1148c7911b02e00a727461525f239da025cab7 jdk7-b133
d56b326ae0544fc16c3e0d0285876f3c82054db2 jdk7-b134
4aa9916693dc1078580c1865e6f2584046851e5a jdk7-b135

View File

@ -109,3 +109,4 @@ ba1fac1c2083196422a12130db174334179a4d44 jdk7-b130
0e57c3272d377eee04cc32c898e9a558051516b0 jdk7-b132
359d0c8c00a02d3a094c19f8a485b2217c99a4e0 jdk7-b133
545de8303fec939db3892f7c324dd7df197e8f09 jdk7-b134
d5fc61f18043765705ef22b57a68c924ab2f1a5b jdk7-b135

View File

@ -109,3 +109,4 @@ bdc069d3f9101f89ec3f81c2950ee2d68fa846d3 jdk7-b130
6bbc7a4734952ae7604578f270e1566639fa8752 jdk7-b132
5e5f68a01d12a4432172f384d5201f3a05254493 jdk7-b133
554adcfb615e63e62af530b1c10fcf7813a75b26 jdk7-b134
d8ced728159fbb2caa8b6adb477fd8efdbbdf179 jdk7-b135

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2011, 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
@ -44,7 +44,7 @@ SUBDIRS = java security net/ssl jarsigner
SUBDIRS_management = jmx
SUBDIRS_desktop = image
SUBDIRS_enterprise = crypto/provider jndi \
org xml rowset net/httpserver
org rowset net/httpserver
SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo
# Omit mirror since it's built with the apt tool.

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2011, 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
@ -107,6 +107,8 @@ CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN
CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN
ifeq ($(ZERO_BUILD), true)
CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
ifeq ($(ZERO_ENDIANNESS), little)
@ -143,11 +145,9 @@ endif
#
# Misc compiler options
#
ifeq ($(ARCH),ppc)
CFLAGS_COMMON = -fsigned-char
else # ARCH
ifneq ($(ARCH),ppc)
CFLAGS_COMMON = -fno-strict-aliasing
endif # ARCH
endif
PIC_CODE_LARGE = -fPIC
PIC_CODE_SMALL = -fpic
GLOBAL_KPIC = $(PIC_CODE_LARGE)
@ -219,8 +219,19 @@ ifdef LIBRARY
# The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
# Try: 'readelf -d lib*.so' to see these settings in a library.
#
LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%)
Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin
Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin
Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin
Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin
Z_ORIGIN_FLAG/arm =
Z_ORIGIN_FLAG/ppc =
Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin
LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY))
LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%)
endif
EXTRA_LIBS += -lc
@ -315,7 +326,6 @@ override LIBNSL =
override LIBTHREAD =
override MOOT_PRIORITIES = true
override NO_INTERRUPTIBLE_IO = true
override OPENWIN_HOME = /usr/X11R6
ifeq ($(ARCH), amd64)
override OPENWIN_LIB = $(OPENWIN_HOME)/lib64
else
@ -359,3 +369,9 @@ else
INCLUDE_SA = true
endif
ifdef CROSS_COMPILE_ARCH
# X11 headers are not under /usr/include
OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
endif

View File

@ -68,40 +68,10 @@ PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
# The following DLL's are considered MS runtime libraries and should
# not to be REBASEd, see deploy/make/common/Release.gmk.
# msvcr*.dll: Microsoft runtimes
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(COMPILER_VERSION), VS2003)
MSVCRNN_DLL = msvcr71.dll
MSVCPNN_DLL = msvcp71.dll
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2005)
MSVCRNN_DLL = msvcr80.dll
MSVCPNN_DLL = msvcp80.dll
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2008)
MSVCRNN_DLL = msvcr90.dll
MSVCPNN_DLL = msvcp90.dll
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2010)
MSVCRNN_DLL = msvcr100.dll
MSVCPNN_DLL = msvcp100.dll
MS_RUNTIME_LIBRARIES = $(MSVCRNN_DLL)
endif
endif
ifeq ($(ARCH_DATA_MODEL), 64)
ifeq ($(COMPILER_VERSION), VS2008)
MSVCRNN_DLL = msvcr90.dll
MSVCPNN_DLL = msvcp90.dll
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2010)
MSVCRNN_DLL = msvcr100.dll
MSVCPNN_DLL = msvcp100.dll
MS_RUNTIME_LIBRARIES = $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2010)
MSVCRNN_DLL = msvcr100.dll
MSVCPNN_DLL = msvcp100.dll
MS_RUNTIME_LIBRARIES = $(MSVCRNN_DLL)
endif
EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
@ -124,109 +94,31 @@ ifndef FASTDEBUG_OPTIMIZATION_LEVEL
endif
ifeq ($(CC_VERSION),msvc)
# Visual Studio .NET 2003 or VS2003 compiler option definitions:
# Visual Studio compiler option definitions:
# -O1 Favors reduced size over speed (-Og -Os -Oy -Ob2 -Gs -GF -Gy)
# -O2 Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy)
# -Ox Full optimization (use -O2) (-Og -Oi -Ot -Oy -Ob2)
# (Removed in Visual Studio 2005 or VS2005)
# -Ob2 More aggressive inlining
# -Og Global optimizations
# -Oi Replace some functions with intrinsic or special forms
# -Op Improve floating point calculations (disables some optimizations)
# (Replaced with -fp:precise in VS2005, /Op is default now)
# -fp:precise (should be the default)
# Improve floating point calculations (disables some optimizations)
# -Os Favor small code
# -Ot Favor faster code
# -Oy Frame pointer omission
# -GB Optimize for pentium (old VC6 option?)
# -G6 VS2003 version of -GB?
# -G6 Used to be -GB?
# -GF Pool strings in read-only memory
# -Gf Pool strings in read-write memory (the default)
# -Gs Controls stack probess
# -GS Adds buffer overflow checks on stacks
# (Default in VS2005)
# -GX Enables exception handling
# (Replaced with /EHsc in VS2005)
# -GS Adds buffer overflow checks on stacks (the default)
# -EHsc Enables exception handling
# -Gy Function level linking only
#
# NOTE: With VC6, -Ox included -Gs.
# NOTE: With VC6, -Ox, -O1, and -O2 used -Ob1, not -Ob2.
# NOTE: With VC6, -O1 and -O2 used -Gf, not -GF.
#
CC_OPT/NONE = -Od
CC_OPT/LOWER = -O2
CC_OPT/HIGHER = -O3
CC_OPT/HIGHEST = -O3
ifeq ($(COMPILER_VERSION), VC6)
# VC6 (6.2) msvc compiler (the way Tiger and early Mustang were built)
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
AUTOMATIC_PCH_OPTION =
GX_OPTION = -GX
GZ_OPTION = -GZ
ifeq ($(ARCH_DATA_MODEL), 32)
CC_OPT/HIGHEST = -Ox -Gy -Os -GB
CC_OPT/HIGHER = -Ox -Gy -Os -GB
CC_OPT/LOWER = -Ox -Gy -Os -GB
else
CC_OPT/HIGHEST = -Ox -Gy -Op
CC_OPT/HIGHER = -Ox -Gy -Op
CC_OPT/LOWER = -Ox -Gy -Op
endif
endif
ifeq ($(COMPILER_VERSION), VS2003)
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
AUTOMATIC_PCH_OPTION = -YX
# Also known as VC7 compiler
GX_OPTION = -GX
GZ_OPTION = -GZ
ifeq ($(ARCH_DATA_MODEL), 32)
# Lowered opt level to try and reduce footprint, dll size especially.
# Was: CC_OPT/HIGHEST = -O2 -G6
# Was: CC_OPT/HIGHER = -O2
CC_OPT/HIGHEST = -O2
CC_OPT/HIGHER = -O1
CC_OPT/LOWER = -O1
else
CC_OPT/HIGHEST = -O2 -Op
CC_OPT/HIGHER = -O2 -Op
CC_OPT/LOWER = -O1 -Op
endif
endif
ifeq ($(COMPILER_VERSION), VS2005)
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
AUTOMATIC_PCH_OPTION =
# VS2005 compiler, only with Platform SDK right now?
GX_OPTION = -EHsc
GZ_OPTION = -RTC1
ifeq ($(ARCH_DATA_MODEL), 32)
CC_OPT/HIGHEST = -O2
CC_OPT/HIGHER = -O1
CC_OPT/LOWER = -O1
else
CC_OPT/HIGHEST = -O2
CC_OPT/HIGHER = -O1
CC_OPT/LOWER = -O1
endif
endif
ifeq ($(COMPILER_VERSION), VS2008)
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
AUTOMATIC_PCH_OPTION =
GX_OPTION = -EHsc
GZ_OPTION = -RTC1
ifeq ($(ARCH_DATA_MODEL), 32)
CC_OPT/HIGHEST = -O2
CC_OPT/HIGHER = -O1
CC_OPT/LOWER = -O1
else
CC_OPT/HIGHEST = -O2
CC_OPT/HIGHER = -O1
CC_OPT/LOWER = -O1
endif
endif
ifeq ($(COMPILER_VERSION), VS2010)
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
AUTOMATIC_PCH_OPTION =
@ -256,7 +148,7 @@ CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
# Select the runtime support library carefully, need to be consistent
#
# VS2003 compiler option definitions:
# Visual Studio Runtime compiler option definitions:
# -MD Use dynamic multi-threaded runtime library
# -MDd Use debug version (don't use, doesn't mix with -MD DLL's)
# -MT Use static multi-threaded runtime library (-ML is going away)
@ -265,12 +157,9 @@ CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
#
# NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll
#
# If MS_RUNTIME_STATIC is requested, use -MT only with VS2003.
ifeq ($(MS_RUNTIME_STATIC),true)
ifeq ($(COMPILER_VERSION), VS2003)
MS_RUNTIME_OPTION=-MT
endif
else
# If MS_RUNTIME_STATIC is requested we may have a problem, it is no longer
# supported by VS2010
ifneq ($(MS_RUNTIME_STATIC),true)
MS_RUNTIME_OPTION=-MD
endif
# The _DEBUG macro option (changes things like malloc to use debug version)
@ -302,7 +191,7 @@ endif
MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
ifeq ($(CC_VERSION),msvc)
# VS2003 compiler option definitions:
# Visual Studio compiler option definitions:
# -Zi Cause *.pdb file to be created, full debug information
# -Z7 Full debug inside the .obj, no .pdb
# -Zd Basic debug, no local variables? In the .obj
@ -317,31 +206,10 @@ ifeq ($(CC_VERSION),msvc)
CFLAGS_OPT = $(CC_OPT)
CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION)
# REMIND: I don't see where CFLAGS_VS2005 is used. I suspect its
# pulled in as a combined "CFLAGS_$(COMPILER_VERSION)" string
# but the lack of this isn't causing any apparent build problems
# with VS 2010 but it could be causing compiler warnings.
# For now, I will add it for all cases :
CFLAGS_VS2010 += -Zc:wchar_t-
#
# Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type
# by default. However, we expect the wchar_t to be a typedef to the
# unsigned short data type. The -Zc:wchar_t- option restores the old
# behavior (as seen in VS2003) to avoid massive code modifications.
# When/if our code will be "C/C++ Standard"-compliant (at least in the area
# of handling the wchar_t type), the option won't be necessary.
ifeq ($(ARCH_DATA_MODEL), 32)
CFLAGS_VS2005 += -Zc:wchar_t-
else
# The 64bit Platform SDK we use (April 2005) doesn't like this option
ifneq ($(CC_VER), 14.00.40310.41)
CFLAGS_VS2005 += -Zc:wchar_t-
endif
endif
# All builds get the same runtime setting
CFLAGS_COMMON += $(MS_RUNTIME_OPTION) $(CFLAGS_$(COMPILER_VERSION))
LDEBUG = /debug
@ -350,21 +218,9 @@ ifeq ($(CC_VERSION),msvc)
LDEBUG += /pdb:NONE
endif
# The new Platform SDK and VS2005 has /GS as a default and requires
# bufferoverflowU.lib on the link command line, otherwise
# we get missing __security_check_cookie externals at link time.
BUFFEROVERFLOWLIB = bufferoverflowU.lib
# Always add bufferoverflowU.lib to VS2005 link commands (pack uses LDDFLAGS)
LFLAGS_VS2005 = $(BUFFEROVERFLOWLIB)
# VS2008 has bufferoverflow baked in:
LFLAGS_VS2008 =
# VS2010, always need safe exception handlers, not needed on 64bit
ifeq ($(ARCH_DATA_MODEL), 32)
LFLAGS_VS2010 = -SAFESEH
else
LFLAGS_VS2010 =
LFLAGS_VS2010 += -SAFESEH
endif
# LFLAGS are the flags given to $(LINK) and used to build the actual DLL file

View File

@ -115,6 +115,36 @@ endif
include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
#
# Cross-compilation Settings
#
ifdef CROSS_COMPILE_ARCH
# Can't run the tools we just built
USE_ONLY_BOOTDIR_TOOLS = true
# When cross-compiling CC generates code for the target, but
# some parts of the build generate C code that has to be compiled
# and executed on the build host - HOST_CC is the 'local' compiler.
# For linux the default is /usr/bin/gcc; other platforms need to
# set it explicitly
ifeq ($(PLATFORM), linux)
ifndef HOST_CC
HOST_CC = $(USRBIN_PATH)gcc
endif
endif
else
# Must set HOST_CC if not already set
ifndef HOST_CC
HOST_CC = $(CC)
endif
endif
# Reset the VM name for client-only builds
ifdef BUILD_CLIENT_ONLY
VM_NAME = client
endif
#
# Freetype logic is applicable to OpenJDK only
#
@ -334,8 +364,7 @@ endif
INCLUDES = -I. -I$(CLASSHDRDIR) \
$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
OTHER_CPPFLAGS = $(INCLUDES)
OTHER_CPPFLAGS += $(INCLUDES)
#
# vpaths. These are the default locations searched for source files.
@ -466,9 +495,11 @@ CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \
#
# Tool flags
#
# EXTRA_CFLAGS are used to define cross-compilation options
#
ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS)
CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS)
CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
$(DEFINES) $(OPTIONS:%=-D%)
LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)

View File

@ -83,7 +83,7 @@ ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems
endif
endif
ifeq ($(PLATFORM), linux)
LDFLAGS += -Wl,-z -Wl,origin
LDFLAGS += $(LDFLAG_Z_ORIGIN)
LDFLAGS += -Wl,--allow-shlib-undefined
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli

View File

@ -54,9 +54,6 @@ 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
@ -911,11 +908,6 @@ initial-image-jdk:: initial-image-jdk-setup \
ifeq ($(COMPILER_VERSION), VS2010)
$(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
endif
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(COMPILER_VERSION), VS2003)
$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
endif
endif
else # PLATFORM
@#
@# bin/

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2011, 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
@ -55,6 +55,7 @@ IMPORT_TOOLS_PACKAGES += \
com/sun/tools/internal/xjc \
com/sun/tools/internal/ws \
com/sun/tools/internal/jxc \
org/relaxng \
META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
META-INF/services/com.sun.tools.xjc.Plugin
META-INF/services/com.sun.tools.internal.xjc.Plugin

View File

@ -47,82 +47,8 @@ ifeq ($(PLATFORM), windows)
# Compiler version and type (Always get word after "Version")
CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(SED) 's/.*\(Version.*\)/\1/' | $(NAWK) '{print $$2}')
# The MSDEVTOOLS_PATH is for older compilers, place for rc, mt, etc.
_OTHER_TOOLS_PATH = $(MSDEVTOOLS_PATH)
# SDK-64 and MSVC6 put REBASE.EXE in a different places - go figure...
ifeq ($(ARCH_DATA_MODEL), 32)
LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
ifeq ($(CC_MAJORVER), 13)
# This should be: CC_VER=13.10.3077 LINK_VER=7.10.3077
COMPILER_NAME=Visual Studio .NET 2003 Professional C++
COMPILER_VERSION=VS2003
RC = $(_OTHER_TOOLS_PATH)rc
REBASE = $(COMPILER_PATH)../../Common7/Tools/Bin/rebase
MTL = $(COMPILER_PATH)../../Common7/Tools/Bin/midl
endif
ifeq ($(CC_MAJORVER), 14)
COMPILER_NAME=Visual Studio 8
COMPILER_VERSION=VS2005
RC = $(_OTHER_TOOLS_PATH)rc
REBASE = $(COMPILER_PATH)../../Common8/Tools/Bin/rebase
MTL = $(COMPILER_PATH)../../Common8/Tools/Bin/midl
MT = $(_OTHER_TOOLS_PATH)/mt
endif
ifeq ($(CC_MAJORVER), 15)
COMPILER_NAME=Visual Studio 9
COMPILER_VERSION=VS2008
RC = $(_OTHER_TOOLS_PATH)rc
#rebase and midl moved out of Visual Studio into the SDK:
REBASE = $(_OTHER_TOOLS_PATH)/rebase
MTL = $(_OTHER_TOOLS_PATH)/midl.exe
MT = $(_OTHER_TOOLS_PATH)mt
endif
else
# else ARCH_DATA_MODEL is 64
LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
CC_MINORVER :=$(call MinorVersion,$(CC_VER))
CC_MICROVER :=$(call MicroVersion,$(CC_VER))
ifeq ($(CC_MAJORVER), 13)
ifeq ($(ARCH), ia64)
# This should be: CC_VER=13.00.9337.7 LINK_VER=7.00.9337.7
COMPILER_NAME=Microsoft Platform SDK - November 2001 Edition
COMPILER_VERSION=VS2003
RC = $(_OTHER_TOOLS_PATH)rc
endif
endif
ifeq ($(CC_MAJORVER), 14)
ifeq ($(ARCH), amd64)
#rebase and midl moved out of Visual Studio into the SDK:
RC = $(_OTHER_TOOLS_PATH)/rc
REBASE = $(_OTHER_TOOLS_PATH)/rebase
MTL = $(_OTHER_TOOLS_PATH)/midl.exe
ifeq ($(CC_MICROVER), 30701)
# This should be: CC_VER=14.00.30701 LINK_VER=8.00.30701
# WARNING: it says 14, but it is such an early build it doesn't
# have all the VS2005 compiler option changes, so treat
# this like a VS2003 compiler.
COMPILER_NAME=Microsoft Platform SDK - February 2003 Edition
COMPILER_VERSION=VS2003
else
# This should be: CC_VER=14.00.40310.41 LINK_VER=8.00.40310.39
COMPILER_NAME=Microsoft Platform SDK - April 2005 Edition (3790.1830)
COMPILER_VERSION=VS2005
endif
else
REBASE = $(COMPILER_PATH)../rebase
endif
endif
ifeq ($(CC_MAJORVER), 15)
COMPILER_NAME=Microsoft Windows SDK with Visual Studio 9 (6001.18000.367)
COMPILER_VERSION=VS2008
RC = $(MSSDK61)/Bin/X64/rc.exe
MT = $(MSSDK61)/Bin/X64/mt.exe
MTL = $(MSSDK61)/Bin/X64/midl.exe
endif
endif
LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
# The VS2010 compiler is the same one used on both 32bit and 64bit
ifeq ($(CC_MAJORVER), 16)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2011, 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
@ -102,6 +102,14 @@ else
COMPILER_PATH =/usr/bin/
endif
# OPENWIN_HOME: path to where the X11 environment is installed.
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifneq ($(ALT_OPENWIN_HOME),)
OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME))
else
OPENWIN_HOME =/usr/X11R6/
endif
# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
@ -181,6 +189,7 @@ HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
# Macro to check it's input file for banned dependencies and verify the
# binary built properly. Relies on process exit code.
ifndef CROSS_COMPILE_ARCH
define binary_file_verification # binary_file
( \
$(ECHO) "Checking for mapfile use in: $1" && \
@ -193,4 +202,10 @@ define binary_file_verification # binary_file
( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
)
endef
else
define binary_file_verification
( \
$(ECHO) "Skipping binary file verification for cross-compile build" \
)
endef
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2011, 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
@ -190,6 +190,7 @@ HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
# Macro to check it's input file for banned dependencies and verify the
# binary built properly. Relies on process exit code.
ifndef CROSS_COMPILE_ARCH
define binary_file_verification # binary_file
( \
$(ECHO) "Checking for mapfile use in: $1" && \
@ -202,4 +203,10 @@ define binary_file_verification # binary_file
( $(DUMP) -L -v $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
)
endef
else
define binary_file_verification
( \
$(ECHO) "Skipping binary file verification for cross-compile build" \
)
endef
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -68,9 +68,23 @@ ifeq ($(PLATFORM),windows)
endif
# Utilities
ifdef CROSS_COMPILE_ARCH
AR = $(COMPILER_PATH)ar
AS = $(COMPILER_PATH)as
LD = $(COMPILER_PATH)ld
MCS = $(COMPILER_PATH)mcs
NM = $(COMPILER_PATH)nm
STRIP = $(COMPILER_PATH)strip
else
AR = $(UTILS_CCS_BIN_PATH)ar
AS = $(UTILS_CCS_BIN_PATH)as
LD = $(UTILS_CCS_BIN_PATH)ld
MCS = $(UTILS_CCS_BIN_PATH)mcs
NM = $(UTILS_CCS_BIN_PATH)nm
STRIP = $(UTILS_CCS_BIN_PATH)strip
endif
ADB = $(UTILS_COMMAND_PATH)adb
AR = $(UTILS_CCS_BIN_PATH)ar
AS = $(UTILS_CCS_BIN_PATH)as
BASENAME = $(UTILS_COMMAND_PATH)basename
BZIP2 = $(UTILS_COMMAND_PATH)bzip2
CAT = $(UTILS_COMMAND_PATH)cat
@ -99,19 +113,16 @@ HEAD = $(UTILS_USR_BIN_PATH)head
ID = $(UTILS_COMMAND_PATH)id
ISAINFO = $(UTILS_COMMAND_PATH)isainfo
KSH = $(UTILS_COMMAND_PATH)ksh
LD = $(UTILS_CCS_BIN_PATH)ld
LDD = $(UTILS_USR_BIN_PATH)ldd
LEX = $(UTILS_CCS_BIN_PATH)lex
LN = $(UTILS_COMMAND_PATH)ln
LS = $(UTILS_COMMAND_PATH)ls
MCS = $(UTILS_CCS_BIN_PATH)mcs
M4 = $(UTILS_CCS_BIN_PATH)m4
MKDIR = $(UTILS_COMMAND_PATH)mkdir
MKSINFO = $(UTILS_COMMAND_PATH)mksinfo
MSGFMT = $(UTILS_USR_BIN_PATH)msgfmt
MV = $(UTILS_COMMAND_PATH)mv
NAWK = $(UTILS_USR_BIN_PATH)nawk
NM = $(UTILS_CCS_BIN_PATH)nm
PKGMK = $(UTILS_COMMAND_PATH)pkgmk
PRINTF = $(UTILS_USR_BIN_PATH)printf
PWD = $(UTILS_COMMAND_PATH)pwd
@ -123,7 +134,6 @@ SED = $(UTILS_COMMAND_PATH)sed
SH = $(UTILS_COMMAND_PATH)sh
SHOWREV = $(UTILS_USR_BIN_PATH)showrev
SORT = $(UTILS_COMMAND_PATH)sort
STRIP = $(UTILS_CCS_BIN_PATH)strip
TAIL = $(UTILS_USR_BIN_PATH)tail
TAR = $(UTILS_COMMAND_PATH)tar
TEST = $(UTILS_USR_BIN_PATH)test
@ -186,14 +196,16 @@ ifeq ($(PLATFORM),linux)
# Intrinsic unix command, with backslash-escaped character interpretation
ECHO = /bin/echo -e
# These are really in UTILS_USR_BIN_PATH on Linux
AR = $(UTILS_USR_BIN_PATH)ar
AS = $(UTILS_USR_BIN_PATH)as
LD = $(UTILS_USR_BIN_PATH)ld
ifndef CROSS_COMPILE_ARCH
AR = $(UTILS_USR_BIN_PATH)ar
AS = $(UTILS_USR_BIN_PATH)as
LD = $(UTILS_USR_BIN_PATH)ld
MCS = $(UTILS_USR_BIN_PATH)mcs
NM = $(UTILS_USR_BIN_PATH)nm
STRIP = $(UTILS_USR_BIN_PATH)strip
endif
LEX = $(UTILS_USR_BIN_PATH)lex
MCS = $(UTILS_USR_BIN_PATH)mcs
M4 = $(UTILS_USR_BIN_PATH)m4
NM = $(UTILS_USR_BIN_PATH)nm
STRIP = $(UTILS_USR_BIN_PATH)strip
YACC = $(UTILS_USR_BIN_PATH)yacc
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2011, 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
@ -138,11 +138,15 @@ ifeq ($(PLATFORM), solaris)
endif
REQUIRED_COMPILER_NAME = Sun Studio 12 Update 1
REQUIRED_COMPILER_VERSION = SS12u1
ifeq ($(CC_VERSION),sun)
REQUIRED_CC_VER = 5.10
endif
ifeq ($(CC_VERSION),gcc)
REQUIRED_CC_VER = 3.4.3
# Cross-compilation compiler versions are target specific
# so don't set a required version if cross-compiling
ifndef CROSS_COMPILE_ARCH
ifeq ($(CC_VERSION),sun)
REQUIRED_CC_VER = 5.10
endif
ifeq ($(CC_VERSION),gcc)
REQUIRED_CC_VER = 3.4.3
endif
endif
REQUIRED_GCC_VER = 2.95.2
endif
@ -158,11 +162,15 @@ ifeq ($(PLATFORM), linux)
REQUIRED_COMPILER_NAME = GCC4
REQUIRED_COMPILER_VERSION = GCC4
REQUIRED_GCC_VER = 2.95
ifeq ($(CC_VERSION),gcc)
REQUIRED_CC_VER = 4.3.0
endif
ifeq ($(CC_VERSION),sun)
REQUIRED_CC_VER = 5.10
# Cross-compilation compiler versions are target specific
# so don't set a required version if cross-compiling
ifndef CROSS_COMPILE_ARCH
ifeq ($(CC_VERSION),gcc)
REQUIRED_CC_VER = 4.3.0
endif
ifeq ($(CC_VERSION),sun)
REQUIRED_CC_VER = 5.10
endif
endif
endif
@ -182,25 +190,10 @@ ifeq ($(PLATFORM), windows)
REQUIRED_FREE_SPACE = 500000
REQUIRED_DXSDK_VER = 0x0900
ifeq ($(CC_VERSION),msvc)
ifeq ($(ARCH_DATA_MODEL), 32)
REQUIRED_COMPILER_NAME = Visual Studio 10
REQUIRED_COMPILER_VERSION = VS2010
REQUIRED_CC_VER = 16.00.30319.01
REQUIRED_LINK_VER = 10.00.30319.01
else
ifeq ($(ARCH), ia64)
REQUIRED_COMPILER_NAME = Microsoft Platform SDK - November 2001 Edition
REQUIRED_COMPILER_VERSION = VS2003
REQUIRED_CC_VER = 13.00.9337.7
REQUIRED_LINK_VER = 7.00.9337.7
endif
ifeq ($(ARCH), amd64)
REQUIRED_COMPILER_NAME = Visual Studio 10
REQUIRED_COMPILER_VERSION = VS2010
REQUIRED_CC_VER = 16.00.30319.01
REQUIRED_LINK_VER = 10.00.30319.01
endif
endif
REQUIRED_COMPILER_NAME = Visual Studio 10
REQUIRED_COMPILER_VERSION = VS2010
REQUIRED_CC_VER = 16.00.30319.01
REQUIRED_LINK_VER = 10.00.30319.01
endif
ifeq ($(CC_VERSION),gcc)
REQUIRED_CC_VER = 3.4.3

View File

@ -333,136 +333,26 @@ ifndef VS2010_EXISTS
export WINDOWSSDKDIR
endif
# Setup for VS2010 is simple, others logic is historic
ifeq ($(VS2010_EXISTS),true)
# VS2010 Compiler root directory
_msvc_dir :=$(VS100COMNTOOLS)/../../Vc
# SDK root directory
_ms_sdk :=$(WINDOWSSDKDIR)
# Compiler bin directory and redist directory
ifeq ($(ARCH_DATA_MODEL), 32)
_compiler_bin :=$(_msvc_dir)/Bin
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC100.CRT)
endif
ifeq ($(ARCH_DATA_MODEL), 64)
_compiler_bin :=$(_msvc_dir)/bin/amd64
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x64/Microsoft.VC100.CRT)
endif
ifeq ($(_redist_sdk),)
_redist_sdk :=$(_system_root)/system32
endif
ifneq ($(VS2010_EXISTS),true)
x:=$(error ERROR: No VS2010 found on system.)
endif
else # Not VS2010
# 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 for VC .NET, not defined in the VC 2008/2010)
ifdef MSVCDIR
xMSVCDIR :="$(subst \,/,$(MSVCDIR))"
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
else
ifdef MSVCDir
xMSVCDIR :="$(subst \,/,$(MSVCDir))"
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
endif
endif
# If we still don't have it, look for VSnnCOMNTOOLS (newest first),
# set by installer?
ifeq ($(_msvc_dir),)
ifdef VS90COMNTOOLS # /Common/Tools directory, use ../../Vc
xVS90COMNTOOLS :="$(subst \,/,$(VS90COMNTOOLS))"
_vs90tools :=$(call FullPath,$(xVS90COMNTOOLS))
endif
ifneq ($(_vs90tools),)
_msvc_dir :=$(_vs90tools)/../../Vc
else
ifdef VS80COMNTOOLS # /Common/Tools directory, use ../../Vc
xVS80COMNTOOLS :="$(subst \,/,$(VS80COMNTOOLS))"
_vs80tools :=$(call FullPath,$(xVS80COMNTOOLS))
endif
ifneq ($(_vs80tools),)
_msvc_dir :=$(_vs80tools)/../../Vc
else
ifdef VS71COMNTOOLS # /Common/Tools directory, use ../../Vc7
xVS71COMNTOOLS :="$(subst \,/,$(VS71COMNTOOLS))"
_vs71tools :=$(call FullPath,$(xVS71COMNTOOLS))
endif
ifneq ($(_vs71tools),)
_msvc_dir :=$(_vs71tools)/../../Vc7
endif
endif
endif
endif
ifneq ($(_msvc_dir),)
_compiler_bin :=$(_msvc_dir)/Bin
# Assume PlatformSDK is in VS71 (will be empty if VS90)
_ms_sdk :=$(call FullPath,$(_msvc_dir)/PlatformSDK)
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC90.CRT)
ifeq ($(_redist_sdk),)
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC80.CRT)
ifeq ($(_redist_sdk),)
_redist_sdk :=$(call FullPath,$(_msvc_dir)/../SDK/v1.1/Bin)
endif
endif
endif
endif
# The Microsoft Platform SDK installed by itself
ifneq ($(_program_files),)
_PSDK :="$(_program_files)/Microsoft SDKs/Windows/v6.1/"
_psdk :=$(call FullPath,$(xMSSDK61))
ifeq ($(_psdk),)
xPSDK :="$(_program_files)/Microsoft Platform SDK"
_psdk :=$(call FullPath,$(xPSDK))
ifeq ($(_psdk),)
xPSDK :="$(_program_files)/Microsoft SDK"
_psdk :=$(call FullPath,$(xMSSDK))
endif
endif
endif
# If no SDK found yet, look in other places
ifeq ($(_ms_sdk),)
ifdef MSSDK
xMSSDK :="$(subst \,/,$(MSSDK))"
_ms_sdk :=$(call FullPath,$(xMSSDK))
else
ifdef MSSdk
xMSSDK :="$(subst \,/,$(MSSdk))"
_ms_sdk :=$(call FullPath,$(xMSSDK))
else
_ms_sdk :=$(_psdk)
endif
endif
endif
# Compilers for 64bit may be from the free SDK, or Visual Studio Professional.
ifeq ($(ARCH_DATA_MODEL), 64)
xVS2008 :="$(_program_files32)/Microsoft Visual Studio 9.0/"
VS2008 :=$(call FullPath,$(xVS2008))
ifneq ($(VS2008),)
_compiler_bin :=$(VS2008)/VC/Bin/$(ARCH)
xMSSDK61 :="$(_program_files)/Microsoft SDKs/Windows/v6.1/"
MSSDK61 :=$(call FullPath,$(xMSSDK61))
_redist_sdk :=$(VS2008)/VC/redist/x64/Microsoft.VC90.CRT
else
ifneq ($(_ms_sdk),)
ifeq ($(ARCH), ia64)
_compiler_bin :=$(_ms_sdk)/Bin/Win64
endif
ifeq ($(ARCH), amd64)
_compiler_bin :=$(_ms_sdk)/Bin/Win64/x86/$(ARCH)
_redist_sdk :=$(_ms_sdk)/redist/win64/AMD64
endif
endif
endif
endif
endif # VS2010_EXISTS
# VS2010 Compiler root directory
_msvc_dir :=$(VS100COMNTOOLS)/../../Vc
# SDK root directory
_ms_sdk :=$(WINDOWSSDKDIR)
# Compiler bin directory and redist directory
ifeq ($(ARCH_DATA_MODEL), 32)
_compiler_bin :=$(_msvc_dir)/Bin
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC100.CRT)
endif
ifeq ($(ARCH_DATA_MODEL), 64)
_compiler_bin :=$(_msvc_dir)/bin/amd64
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x64/Microsoft.VC100.CRT)
endif
ifeq ($(_redist_sdk),)
_redist_sdk :=$(_system_root)/system32
endif
# Location on system where jdk installs might be
ifneq ($(_program_files),)
@ -566,20 +456,8 @@ ifndef ALT_BOOTDIR
_BOOTDIR3 =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
endif
# 32bit always needs the MSVCRNN runtime, 64bit does when using VS2008
ifeq ($(ARCH_DATA_MODEL), 32)
_NEEDS_MSVCRNN = true
else
ifeq ($(VS2010_EXISTS),true)
_NEEDS_MSVCRNN = true
else
ifneq ($(VS2008),)
_NEEDS_MSVCRNN = true
else
_NEEDS_MSVCRNN = false
endif
endif
endif
# Everybody needs the MSVCRNN runtime starting with VS2010
_NEEDS_MSVCRNN = true
ifeq ($(_NEEDS_MSVCRNN), true)
# MSVCRNN_DLL_PATH: location of msvcrnn.dll that will be re-distributed
@ -758,8 +636,6 @@ HOTSPOT_LIB_PATH:=$(call AltCheckValue,HOTSPOT_LIB_PATH)
# Special define for checking the binaries
ifeq ($(VS2010_EXISTS),true)
# All windows dll and exe files should have been built with /NXCOMPAT
# and be setup for dynamic base addresses.
# In addition, we should not be dependent on certain dll files that
@ -841,12 +717,3 @@ define binary_file_verification # binary_file
endef
endif
else
# Macro to check it's input file for banned dependencies and verify the
# binary was built properly. Relies on process exit code.
define binary_file_verification # binary_file
endef
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 20010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2011, 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
@ -155,7 +155,11 @@ endif
ifeq ($(SYSTEM_UNAME), Linux)
PLATFORM = linux
# Arch and OS name/version
mach := $(shell uname -m)
ifdef CROSS_COMPILE_ARCH
mach := $(CROSS_COMPILE_ARCH)
else
mach := $(shell uname -m)
endif
archExpr = case "$(mach)" in \
i[3-9]86) \
echo i586 \
@ -192,11 +196,13 @@ ifeq ($(SYSTEM_UNAME), Linux)
ARCH=sparcv9
endif
else
# i586 is 32-bit, amd64 is 64-bit
# Most archs are 32-bit
ifndef ARCH_DATA_MODEL
ifeq ($(ARCH), i586)
ARCH_DATA_MODEL=32
else
ARCH_DATA_MODEL=32
ifeq ($(ARCH), amd64)
ARCH_DATA_MODEL=64
endif
ifeq ($(ARCH), ia64)
ARCH_DATA_MODEL=64
endif
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2011, 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
@ -104,7 +104,11 @@ ifeq ($(PLATFORM),windows)
endif
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_NAME)
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_VERSION)
ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
ifdef REQUIRED_CC_VER
ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
else
ALL_SETTINGS+=$(call addOptionalSetting,CC_VER)
endif
ifeq ($(PLATFORM),solaris)
ifeq ($(ARCH_DATA_MODEL), 32)
ifndef OPENJDK

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2011, 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
@ -220,7 +220,7 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk
sane-ant_version \
sane-zip_version \
sane-unzip_version \
sane-msvcrt_path \
sane-msvcrt_path \
sane-freetype
######################################################
@ -279,6 +279,12 @@ sane-arch_data_model:
" $(YOU_ARE_USING) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL). \n" \
"" >> $(ERROR_FILE) ; \
fi
ifdef BUILD_CLIENT_ONLY
@if [ "$(ARCH_DATA_MODEL)" != 32 ]; then \
$(ECHO) "WARNING: You have requested BUILD_CLIENT_ONLY in a 64-bit build.\n" \
"" >> $(WARNING_FILE) ; \
fi
endif
######################################################
# Check the OS version (windows and linux have release name checks)
@ -811,23 +817,26 @@ sane-cacerts:
######################################################
ifdef OPENJDK
# The freetypecheck Makefile prints out "Failed" if not good enough
$(TEMPDIR)/freetypeinfo: FRC
ifndef CROSS_COMPILE_ARCH
# The freetypecheck Makefile prints out "Failed" if not good enough
$(TEMPDIR)/freetypeinfo: FRC
@$(prep-target)
@(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
$(ECHO) "Failed to build freetypecheck." ) > $@
sane-freetype: $(TEMPDIR)/freetypeinfo
sane-freetype: $(TEMPDIR)/freetypeinfo
@if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
$(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
" or higher is required. \n" \
"`$(CAT) $<` \n" >> $(ERROR_FILE) ; \
fi
else
#do nothing (cross-compiling)
sane-freetype:
endif
else
#do nothing (not OpenJDK)
sane-freetype:
#do nothing (not OpenJDK)
sane-freetype:
endif
######################################################
@ -987,25 +996,15 @@ endif
######################################################
sane-msdevtools_path:
ifeq ($(PLATFORM), windows)
ifneq ($(COMPILER_VERSION), VS2010)
@if [ "$(MSDEVTOOLS_PATH)" != "" -a ! -r "$(MSDEVTOOLS_PATH)" ]; then \
$(ECHO) "ERROR: You do not have a valid MSDEVTOOLS_PATH setting. \n" \
" Please check your access to \n" \
" $(MSDEVTOOLS_PATH) \n" \
" and/or check your value of ALT_MSDEVTOOLS_PATH. \n" \
"" >> $(ERROR_FILE) ; \
fi
else
ifeq ($(wildcard $(RC)),)
ifeq ($(wildcard $(RC)),)
@$(ECHO) "ERROR: Cannot find the RC utility from path: $(RC)\n" \
" This is normally obtained from the WINDOWSSDKDIR." \
"" >> $(ERROR_FILE)
endif
ifeq ($(wildcard $(DUMPBIN)),)
endif
ifeq ($(wildcard $(DUMPBIN)),)
@$(ECHO) "ERROR: Cannot find the DUMPBIN utility from path: $(DUMPBIN)\n" \
" This is normally obtained from the COMPILER_PATH." \
"" >> $(ERROR_FILE)
endif
endif
endif
@ -1306,7 +1305,7 @@ ifeq ($(PLATFORM), windows)
" Microsoft DirectX 9 SDK can be downloaded from the following location:\n" \
" http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \
" Or http://www.microsoft.com/directx\n" \
"" >> $(WARNING_FILE) ; \
"" >> $(WARNING_FILE) ; \
fi \
fi \
fi \
@ -1337,13 +1336,16 @@ endif
######################################################
# Check the compiler version(s)
######################################################
CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
ifdef REQUIRED_CC_VER
CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
endif
sane-compiler: sane-link
ifdef REQUIRED_CC_VER
@if [ "$(CC_CHECK)" = "missing" ]; then \
$(ECHO) "ERROR: The Compiler version is undefined. \n" \
"" >> $(ERROR_FILE) ; \
fi
ifndef OPENJDK
ifndef OPENJDK
@if [ "$(CC_CHECK)" != "same" ]; then \
$(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(REQUIRED_COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \
" Specifically the $(REQUIRED_COMPILER_NAME) compiler. \n " \
@ -1352,6 +1354,7 @@ ifndef OPENJDK
" $(COMPILER_PATH) \n" \
"" >> $(WARNING_FILE) ; \
fi
endif
endif
######################################################
@ -1419,7 +1422,6 @@ endif
######################################################
sane-install-mssdk_path:
ifeq ($(PLATFORM), windows)
ifeq ($(COMPILER_VERSION), VS2010)
@if [ -z "$(WINDOWSSDKDIR)" ]; then \
$(ECHO) "WARNING: Your WINDOWSSDKDIR setting is empty.\n" \
" It is recommended to set ALT_WINDOWSSDKDIR.\n" \
@ -1432,7 +1434,6 @@ ifeq ($(PLATFORM), windows)
" and/or check your value of ALT_WINDOWSSDKDIR. \n" \
"" >> $(ERROR_FILE) ; \
fi
endif
@if [ -z "$(INSTALL_MSSDK)" ]; then \
$(ECHO) "WARNING: Your INSTALL_MSSDK setting is empty.\n" \
" It is recommended to set ALT_INSTALL_MSSDK.\n" \

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2001, 2011, 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
@ -55,7 +55,7 @@ EXCLUDE_PKGS = \
# This is a list of regular expressions. So foo.* matches "foo" and "foo.bar".
#
ACTIVE_JSR_PKGS= \
java.dyn \
java.lang.invoke \
java.sql \
javax.activation \
javax.annotation.* \
@ -97,11 +97,11 @@ CORE_PKGS = \
java.awt.print \
java.beans \
java.beans.beancontext \
java.dyn \
java.io \
java.lang \
java.lang.annotation \
java.lang.instrument \
java.lang.invoke \
java.lang.management \
java.lang.ref \
java.lang.reflect \

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1995, 2011, 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
@ -44,7 +44,7 @@ SUBDIRS += security math util text net nio jar
SUBDIRS_desktop = awt applet beans
SUBDIRS_management = management
SUBDIRS_misc = npt java_crw_demo java_hprof_demo \
logging instrument dyn sql rmi
logging instrument invoke sql rmi
ifeq ($(PLATFORM), solaris)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 2011, 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
@ -109,7 +109,7 @@ else
LDFLAGS += -R \$$ORIGIN/jli
endif
ifeq ($(PLATFORM), linux)
LDFLAGS += -Wl,-z -Wl,origin
LDFLAGS += $(LDFLAG_Z_ORIGIN)
LDFLAGS += -Wl,--allow-shlib-undefined
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2008, 2011, 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
@ -25,18 +25,18 @@
BUILDDIR = ../..
PACKAGE = java.dyn
PACKAGE = java.lang.invoke
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
AUTO_FILES_JAVA_DIRS = java/dyn sun/dyn
AUTO_FILES_JAVA_DIRS = java/lang/invoke sun/invoke
FILES_java = \
java/lang/ClassValue.java \
java/lang/BootstrapMethodError.java
# The sources built here use new language syntax to generate
# method handle calls. Let's be sure we are using that format.
LANGUAGE_VERSION = -source 7
CLASS_VERSION = -target 7
# Tell the compiler not to accept transitional forms.
OTHER_JAVACFLAGS = -XDallowTransitionalJSR292=no
include $(BUILDDIR)/common/Classes.gmk

View File

@ -78,13 +78,17 @@ FILES_c = \
zutil.c
ifneq ($(PLATFORM), windows)
FILES_c += \
$(CTARGDIR)ergo.c \
$(CTARGDIR)ergo_$(ERGO_FAMILY).c
FILES_c += ergo.c
ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
# if the architecture specific ergo file exists then
# use it, else use the generic definitions from ergo.c
ifneq ($(wildcard $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
FILES_c += $(ERGO_ARCH_FILE)
else
OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
endif
endif
# Names of arch directories
LIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
ifeq ($(PLATFORM), solaris)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1995, 2011, 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
@ -43,7 +43,8 @@ $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
$(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
$(install-file)
JVMCFG = $(LIBDIR)/$(LIBARCH)/jvm.cfg
JVMCFG_DIR = $(LIBDIR)/$(LIBARCH)
JVMCFG = $(JVMCFG_DIR)/jvm.cfg
#
# How to install jvm.cfg.
@ -54,8 +55,21 @@ else
JVMCFG_ARCH = $(ARCH)
endif
ifdef BUILD_CLIENT_ONLY
$(JVMCFG)::
$(MKDIR) -p $(JVMCFG_DIR)
@# Update jvm.cfg to use -client by default and alias -server to -client
$(RM) -f $(JVMCFG)
$(ECHO) "-client KNOWN">$(JVMCFG)
$(ECHO) "-server ALIASED_TO -client">>$(JVMCFG)
$(ECHO) "-hotspot ALIASED_TO -client">>$(JVMCFG)
$(ECHO) "-classic WARN">>$(JVMCFG)
$(ECHO) "-native ERROR">>$(JVMCFG)
$(ECHO) "-green ERROR">>$(JVMCFG)
else
$(JVMCFG): $(PLATFORM_SRC)/bin/$(JVMCFG_ARCH)/jvm.cfg
$(install-file)
endif
all: build

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2011, 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
@ -820,7 +820,7 @@ $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
$(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
$(prep-target)
($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \
($(CD) $(TEMPDIR); $(HOST_CC) $(CPPFLAGS) $(LDDFLAGS) \
-o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
$(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
@ -851,7 +851,7 @@ GENUC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENUC_SRC) | \
$(GENUC_EXE) : $(GENUC_SRC)
$(prep-target)
$(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
$(HOST_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
$(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
$(prep-target)
@ -867,7 +867,7 @@ GENSC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSC_SRC) | \
$(GENSC_EXE) : $(GENSC_SRC)
$(prep-target)
$(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
$(HOST_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
$(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
$(prep-target)

View File

@ -95,6 +95,8 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_NativeThread_current;
Java_sun_nio_ch_NativeThread_init;
Java_sun_nio_ch_NativeThread_signal;
Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0;
Java_sun_nio_ch_Net_canJoin6WithIPv4Group0;
Java_sun_nio_ch_Net_socket0;
Java_sun_nio_ch_Net_bind0;
Java_sun_nio_ch_Net_connect0;

View File

@ -82,6 +82,8 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_NativeThread_current;
Java_sun_nio_ch_NativeThread_init;
Java_sun_nio_ch_NativeThread_signal;
Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0;
Java_sun_nio_ch_Net_canJoin6WithIPv4Group0;
Java_sun_nio_ch_Net_socket0;
Java_sun_nio_ch_Net_bind0;
Java_sun_nio_ch_Net_connect0;

View File

@ -76,8 +76,12 @@ all:: build
INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist
# List of files coming from outside this workspace
IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
ifndef BUILD_CLIENT_ONLY
IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
else
IMPORT_LIST =
endif
# Hotspot client is only available on 32-bit non-Zero builds
ifneq ($(ZERO_BUILD), true)
@ -97,10 +101,12 @@ $(BINDIR)/$(MSVCRNN_DLL): $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL)
$(call chmod-file, a+x)
# Get the hotspot .map and .pdb files for client and server
ifndef BUILD_CLIENT_ONLY
IMPORT_LIST += \
$(LIBDIR)/$(JVMLIB_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
endif
# Add .map and .pdb files to the import path for client and kernel VMs.
# These are only available on 32-bit windows builds.
@ -126,9 +132,11 @@ $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME) $@
ifndef BUILD_CLIENT_ONLY
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
endif
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
@$(prep-target)
@ -138,27 +146,32 @@ $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME) $@
ifndef BUILD_CLIENT_ONLY
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
endif
# Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Windows
else # PLATFORM
# NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv NOT Windows
IMPORT_LIST += \
$(LIB_LOCATION)/$(LIBJSIG_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_NAME)
ifndef BUILD_CLIENT_ONLY
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
endif
ifeq ($(PLATFORM), solaris)
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
# The conditional can be removed when import JDKs contain these files.
ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),)
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME)
else
$(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!)
endif
endif
ifndef BUILD_CLIENT_ONLY
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
# The conditional can be removed when import JDKs contain these files.
ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),)
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME)
else
$(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!)
endif
endif
endif
ifneq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 32)
@ -179,18 +192,20 @@ else
$(warning WARNING: $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME) not found!)
endif
# The conditional can be removed when import JDKs contain these files.
ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),)
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
else
$(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!)
endif
ifndef BUILD_CLIENT_ONLY
# The conditional can be removed when import JDKs contain these files.
ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),)
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
else
$(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!)
endif
# The conditional can be removed when import JDKs contain these files.
ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),)
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME)
else
$(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!)
# The conditional can be removed when import JDKs contain these files.
ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),)
IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME)
else
$(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!)
endif
endif
# For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR)
@ -222,10 +237,16 @@ $(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJ
$(install-import-file)
@$(call binary_file_verification,$@)
ifndef BUILD_CLIENT_ONLY
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
@$(prep-target)
$(call install-sym-link, ../$(LIBJSIG_NAME))
else
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME):
@$(prep-target)
$(call install-sym-link, ../$(LIBJSIG_NAME))
endif
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
$(install-import-file)
@ -235,6 +256,7 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$
$(install-import-file)
@$(call binary_file_verification,$@)
ifndef BUILD_CLIENT_ONLY
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
$(install-import-file)
@$(call binary_file_verification,$@)
@ -242,6 +264,7 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB
$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
$(install-import-file)
@$(call binary_file_verification,$@)
endif
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)
$(install-import-file)
@ -251,6 +274,7 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/
$(install-import-file)
@$(call binary_file_verification,$@)
ifndef BUILD_CLIENT_ONLY
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)
$(install-import-file)
@$(call binary_file_verification,$@)
@ -265,6 +289,7 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAM
$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
$(install-import-file)
endif
$(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
$(install-import-file)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2011, 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
@ -73,6 +73,15 @@ else
ifeq ($(ARCH), amd64)
CPPFLAGS += -DX_ARCH=X_AMD64
endif # ARCH amd64
ifeq ($(ARCH), arm)
CPPFLAGS += -DX_ARCH=X_ARM
endif # ARCH arm
ifeq ($(ARCH), ppc)
CPPFLAGS += -DX_ARCH=X_PPC
endif # ARCH ppc
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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,21 +24,20 @@
#
#
# Makefile for building packages under javax.xml
# Makefile to build the Laffy demo.
#
BUILDDIR = ../../..
PACKAGE = com.sun.xml
PRODUCT = xml
PRODUCT = demo/jfc
DEMONAME = Laffy
include $(BUILDDIR)/common/Defs.gmk
#
# Files to compile
#
AUTO_FILES_JAVA_DIRS = com/sun/activation \
org/relaxng/datatype
DEMO_ROOT = $(CLOSED_SRC)/share/demo/jfc/$(DEMONAME)
DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
DEMO_TOPFILES = ./readme.html ./laffy.png
DEMO_SKIP_SRCZIP = true
#
# Rules
# Demo jar building rules.
#
include $(BUILDDIR)/common/Classes.gmk
include $(BUILDDIR)/common/Demo.gmk

View File

@ -43,7 +43,7 @@ SUBDIRS = \
# Some demos aren't currently included in OpenJDK
ifndef OPENJDK
SUBDIRS += Java2D SwingSet2 SwingSet3 Stylepad
SUBDIRS += Java2D Laffy SwingSet2 SwingSet3 Stylepad
endif
include $(BUILDDIR)/common/Subdirs.gmk

View File

@ -71,7 +71,8 @@ $(SERVICEDIR)/%: $(CLOSED_SRC)/share/classes/sun/java2d/cmm/kcms/META-INF/servic
# Extra rules
#
ifeq ($(PLATFORM), linux)
LDLIBS += -lpthread
LDLIBS += -lpthread
OTHER_CFLAGS += -Wno-missing-field-initializers
endif
clean clobber::
@ -103,6 +104,5 @@ CPPFLAGS += -I$(CLASSHDRDIR) \
endif # PLATFORM
#CFLAGS += -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST
CFLAGS += -DFUT_CALC_EX -DNO_FUT_GCONST
CFLAGS += -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST

View File

@ -81,10 +81,6 @@ vpath %.c $(SHARE_SRC)/native/sun/java2d
ifeq ($(PLATFORM), windows)
OTHER_CFLAGS += -DCMS_IS_WINDOWS_
ifeq ($(COMPILER_VERSION), VS2003)
OTHER_CFLAGS += -Dsqrtf=sqrt
endif
OTHER_LDLIBS = $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
OTHER_INCLUDES += -I$(SHARE_SRC)/native/sun/java2d \
-I$(SHARE_SRC)/native/sun/awt/debug

View File

@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2011b
tzdata2011d

View File

@ -531,11 +531,31 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
# to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
# backwards from 1:00am to 12:00am"
# From Raymond Hughes (2011-03-07)
# I believe this will be posted shortly on the website
# <a href="http://www.mcil.gov.ws">
# www.mcil.gov.ws
# </a>
#
# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
#
# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
# businesses and the general public are hereby advised that daylight
# saving time is on the first Saturday of April 2011 (02/04/11).
#
# The public is therefore advised that when the standard time strikes
# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
# then all instruments used to measure standard time are to be
# adjusted/changed to three oclock (3:00am or 0300Hrs).
#
# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
# INDUSTRY AND LABOUR 28th February 2011
Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
-11:26:56 - LMT 1911
-11:30 - SAMT 1950 # Samoa Time
-11:00 - WST 2010 Sep 26
-11:00 1:00 WSDT 2011 Apr 3 1:00
-11:00 1:00 WSDT 2011 Apr 2 4:00
-11:00 - WST
# Solomon Is

View File

@ -58,8 +58,7 @@ Link Etc/GMT Etc/GMT0
# (i.e. west of Greenwich) even though many people would expect it to
# mean 4 hours ahead of UTC (i.e. east of Greenwich).
#
# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
# (which is not yet supported by the tz code) allows for
# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
# TZ='<GMT-4>+4'; if you want time zone abbreviations conforming to
# ISO 8601 you can use TZ='<-0400>+4'. Thus the commonly-expected
# offset is kept within the angle bracket (and is used for display)

View File

@ -2505,25 +2505,18 @@ Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12
# (on a non-government server though) describing dates between 2002 and 2006:
# http://www.alomaliye.com/bkk_2002_3769.htm
# From Sue Williams (2008-08-11):
# I spotted this news article about a potential change in Turkey.
#
# <a href="http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1">
# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
# From G&ouml;kdeniz Karada&#x011f; (2011-03-10):
#
# According to the articles linked below, Turkey will change into summer
# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
# This change is due to a nationwide exam on 27th.
#
# <a href="http://www.worldbulletin.net/?aType=haber&ArticleID=70872">
# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
# </a>
# From Sue Williams (2008-08-20):
# This article says that around the end of March 2011, Turkey wants to
# adjust the clocks forward by 1/2 hour and stay that way permanently.
# The article indicates that this is a change in timezone offset in addition
# to stopping observance of DST.
# This proposal has not yet been approved.
#
# Read more here...
#
# Turkey to abandon daylight saving time in 2011
# <a href="http://www.turkishdailynews.com.tr/article.php?enewsid=112989">
# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
# Turkish:
# <a href="http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373">
# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
# </a>
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -2591,6 +2584,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880
2:00 Turkey EE%sT 1978 Oct 15
3:00 Turkey TR%sT 1985 Apr 20 # Turkey Time
2:00 Turkey EE%sT 2007
2:00 EU EE%sT 2011 Mar 27 1:00u
2:00 - EET 2011 Mar 28 1:00u
2:00 EU EE%sT
Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.

View File

@ -78,13 +78,13 @@ Leap 2008 Dec 31 23:59:60 + S
# SERVICE DE LA ROTATION TERRESTRE
# OBSERVATOIRE DE PARIS
# 61, Av. de l'Observatoire 75014 PARIS (France)
# Tel. : 33 (0) 1 40 51 22 26
# Tel. : 33 (0) 1 40 51 22 29
# FAX : 33 (0) 1 40 51 22 91
# Internet : services.iers@obspm.fr
#
# Paris, 14 July 2010
# Paris, 2 February 2011
#
# Bulletin C 40
# Bulletin C 41
#
# To authorities responsible
# for the measurement and
@ -92,9 +92,9 @@ Leap 2008 Dec 31 23:59:60 + S
#
# INFORMATION ON UTC - TAI
#
# NO positive leap second will be introduced at the end of December 2010.
# NO positive leap second will be introduced at the end of June 2011.
# The difference between Coordinated Universal Time UTC and the
# International Atomic Time TAI is :
# International Atomic Time TAI is :
#
# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
#
@ -104,6 +104,6 @@ Leap 2008 Dec 31 23:59:60 + S
# will be no time step at the next possible date.
#
# Daniel GAMBIS
# Director
# Earth Orientation Center of IERS
# Head
# Earth Orientation Center of the IERS
# Observatoire de Paris, France

View File

@ -448,15 +448,74 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
# were nearby inhabitants in some cases and for our purposes perhaps
# it's best to simply use the official transition.
#
# From Steve Ferguson (2011-01-31):
# The author lives in Alaska and many of the references listed are only
# available to Alaskan residents.
#
# <a href="http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98">
# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
# </a>
# From Arthur David Olson (2011-02-01):
# Here's database-relevant material from the 2001 "Alaska History" article:
#
# On September 20 [1979]...DOT...officials decreed that on April 27,
# 1980, Juneau and other nearby communities would move to Yukon Time.
# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
# Pacific Time.
#
# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
# Department's September 1979 decision. Juneau and other communities in
# northern Southeast reverted to Pacific Time on October 26.
#
# On October 28 [1983]...the Metlakatla Indian Community Council voted
# unanimously to keep the reservation on Pacific Time.
#
# According to DOT official Joanne Petrie, Indian reservations are not
# bound to follow time zones imposed by neighboring jurisdictions.
#
# (The last is consistent with how the database now handles the Navajo
# Nation.)
# From Arthur David Olson (2011-02-09):
# I just spoke by phone with a staff member at the Metlakatla Indian
# Community office (using contact information available at
# <a href="http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla">
# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
# </a>).
# It's shortly after 1:00 here on the east coast of the United States;
# the staffer said it was shortly after 10:00 there. When I asked whether
# that meant they were on Pacific time, they said no--they were on their
# own time. I asked about daylight saving; they said it wasn't used. I
# did not inquire about practices in the past.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
-8:57:41 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
-8:00 - PST 1969
-8:00 US P%sT 1980 Apr 27 2:00
-9:00 US Y%sT 1980 Oct 26 2:00
-8:00 US P%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Sitka -14:58:47 - LMT 1867 Oct 18
-9:01:13 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
-8:00 - PST 1969
-8:00 US P%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
-8:46:18 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
-8:00 - PST 1969
-8:00 US P%sT 1983 Oct 30 2:00
-8:00 US MeST
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18
-9:18:55 - LMT 1900 Aug 20 12:00
-9:00 - YST 1942
@ -2569,6 +2628,21 @@ Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
# the time was announced as "diez cinco"--the same time as here, indicating
# that has indeed switched to DST. Assume second Sunday from 2009 forward.
# From Steffen Thorsen (2011-03-08):
# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
# this year. Nothing about the end date known so far (if that has
# changed at all).
#
# Source:
# <a href="http://granma.co.cu/2011/03/08/nacional/artic01.html">
# http://granma.co.cu/2011/03/08/nacional/artic01.html
# </a>
#
# Our info:
# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html">
# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
# </a>
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cuba 1928 only - Jun 10 0:00 1:00 D
Rule Cuba 1928 only - Oct 10 0:00 0 S
@ -2602,7 +2676,9 @@ Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D
Rule Cuba 2006 max - Oct lastSun 0:00s 0 S
Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D
Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D
Rule Cuba 2009 max - Mar Sun>=8 0:00s 1:00 D
Rule Cuba 2009 2010 - Mar Sun>=8 0:00s 1:00 D
Rule Cuba 2011 only - Mar Sun>=15 0:00s 1:00 D
Rule Cuba 2012 max - Mar Sun>=8 0:00s 1:00 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Havana -5:29:28 - LMT 1890

View File

@ -1176,6 +1176,23 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# From Arthur Daivd Olson (2010-03-06):
# Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
# It appears that the Chilean government has decided to postpone the
# change from summer time to winter time again, by three weeks to April
# 2nd:
# <a href="http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651">
# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
# </a>
#
# This is not yet reflected in the offical "cambio de hora" site, but
# probably will be soon:
# <a href="http://www.horaoficial.cl/cambio.htm">
# http://www.horaoficial.cl/cambio.htm
# </a>
# From Arthur David Olson (2011-03-02):
# The emol.com article mentions a water shortage as the cause of the
# postponement, which may mean that it's not a permanent change.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Chile 1927 1932 - Sep 1 0:00 1:00 S
Rule Chile 1928 1932 - Apr 1 0:00 0 -
@ -1211,8 +1228,8 @@ Rule Chile 2000 2007 - Mar Sun>=9 3:00u 0 -
# which is used below in specifying the transition.
Rule Chile 2008 only - Mar 30 3:00u 0 -
Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr 4 3:00u 0 -
Rule Chile 2011 max - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 2011 - Apr Sun>=1 3:00u 0 -
Rule Chile 2012 max - Mar Sun>=9 3:00u 0 -
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]

View File

@ -434,9 +434,11 @@ US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona
US +340308-1181434 America/Los_Angeles Pacific Time
US +611305-1495401 America/Anchorage Alaska Time
US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle
US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck
US +643004-1652423 America/Nome Alaska Time - west Alaska
US +515248-1763929 America/Adak Aleutian Islands
US +550737-1313435 America/Metlakatla Metlakatla Time - Annette Island
US +211825-1575130 Pacific/Honolulu Hawaii
UY -3453-05611 America/Montevideo
UZ +3940+06648 Asia/Samarkand west Uzbekistan

View File

@ -61,7 +61,7 @@ ifneq ($(PLATFORM), windows)
# ODBC_LIBRARY_LOCATION, and delete the variable assignments below.
#
# Tell linker to ignore missing externals when building this shared library.
LDFLAGS_DEFS_OPTION = -z nodefs
LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker nodefs
# Define a place to create the fake libraries and their names.
ODBC_LIBRARY_LOCATION = $(TEMPDIR)
ODBC_FAKE_LIBRARIES = $(ODBC_LIBRARY_LOCATION)/libodbcinst.so $(ODBC_LIBRARY_LOCATION)/libodbc.so

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1996, 2011, 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
@ -34,6 +34,7 @@ FILES_java = \
sun/net/ProgressListener.java \
sun/net/ProgressMeteringPolicy.java \
sun/net/SocksProxy.java \
sun/net/ResourceManager.java \
sun/net/TelnetInputStream.java \
sun/net/TelnetOutputStream.java \
sun/net/TelnetProtocolException.java \
@ -100,6 +101,7 @@ FILES_java = \
sun/net/www/protocol/http/NegotiateAuthentication.java \
sun/net/www/protocol/http/Negotiator.java \
sun/net/www/protocol/http/ntlm/NTLMAuthentication.java \
sun/net/www/protocol/http/ntlm/NTLMAuthenticationCallback.java \
sun/net/www/protocol/http/spnego/NegotiatorImpl.java \
sun/net/www/protocol/http/spnego/NegotiateCallbackHandler.java \
sun/net/www/protocol/http/logging/HttpLogFormatter.java \

View File

@ -376,6 +376,7 @@ FILES_gen_extcs = \
sun/nio/cs/ext/HKSCSMapping.java \
sun/nio/cs/ext/HKSCS2001Mapping.java \
sun/nio/cs/ext/HKSCS_XPMapping.java \
sun/nio/cs/ext/IBM1364.java \
sun/nio/cs/ext/IBM1381.java \
sun/nio/cs/ext/IBM1383.java \
sun/nio/cs/ext/IBM930.java \

View File

@ -0,0 +1,22 @@
#
# Diff of
# b2c: cdctables.zip/Package2.zip/IBM-1364A.zip/055444B0.TPMAP110
# c2b: cdctables.zip/Package2.zip/IBM-1364A.zip/055444B0.UPMAP110
# shows there are 6 additional c->b entries in UPMAP110, they are
# listed below (in b->c form)
#
# UPMAP110 also defines
# <subchar> \xFE\xFE
# and commend out
# #<subchar1> \x3F
# with
#
# <UFFFD> \xFE\xFD # (SUB)
# <UFFFD> \xFE\xFE # (SUB)
#
4148 00AD
4143 00B7
4149 2015
42A1 223C
496F 2299
4954 FF5E

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@ MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x
MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
IBM1364 x-IBM1364 Cp1364 ebcdic sun.nio.cs.ext false 0x40 0xde 0x40 0xfe
IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1998, 2011, 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
@ -30,6 +30,7 @@
BUILDDIR = ..
include $(BUILDDIR)/common/Defs.gmk
# Note: freetypecheck is built by Sanity.gmk if needed
SUBDIRS = \
addjsum \
buildmetaindex \
@ -38,7 +39,6 @@ SUBDIRS = \
compile_properties \
dir_diff \
dtdbuilder \
freetypecheck \
generate_break_iterator \
GenerateCharacter \
generatecurrencydata \

View File

@ -61,6 +61,9 @@
* interfaces.
*/
/* we always print to stderr */
#define USE_STDERR JNI_TRUE
static jboolean printVersion = JNI_FALSE; /* print and exit */
static jboolean showVersion = JNI_FALSE; /* print but continue */
static jboolean printUsage = JNI_FALSE; /* print and exit*/
@ -1136,36 +1139,18 @@ InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn)
return; \
}
static jstring platformEncoding = NULL;
static jstring getPlatformEncoding(JNIEnv *env) {
if (platformEncoding == NULL) {
jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding");
if (propname) {
jclass cls;
jmethodID mid;
NULL_CHECK0 (cls = FindBootStrapClass(env, "java/lang/System"));
NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
env, cls,
"getProperty",
"(Ljava/lang/String;)Ljava/lang/String;"));
platformEncoding = (*env)->CallStaticObjectMethod (
env, cls, mid, propname);
}
static jclass helperClass = NULL;
static jclass
GetLauncherHelperClass(JNIEnv *env) {
if (helperClass == NULL) {
NULL_CHECK0(helperClass = FindBootStrapClass(env,
"sun/launcher/LauncherHelper"));
}
return platformEncoding;
}
static jboolean isEncodingSupported(JNIEnv *env, jstring enc) {
jclass cls;
jmethodID mid;
NULL_CHECK0 (cls = FindBootStrapClass(env, "java/nio/charset/Charset"));
NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
env, cls,
"isSupported",
"(Ljava/lang/String;)Z"));
return (*env)->CallStaticBooleanMethod(env, cls, mid, enc);
return helperClass;
}
static jmethodID makePlatformStringMID = NULL;
/*
* Returns a new Java string object for the specified platform string.
*/
@ -1173,36 +1158,23 @@ static jstring
NewPlatformString(JNIEnv *env, char *s)
{
int len = (int)JLI_StrLen(s);
jclass cls;
jmethodID mid;
jbyteArray ary;
jstring enc;
jclass cls = GetLauncherHelperClass(env);
NULL_CHECK0(cls);
if (s == NULL)
return 0;
enc = getPlatformEncoding(env);
ary = (*env)->NewByteArray(env, len);
if (ary != 0) {
jstring str = 0;
(*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s);
if (!(*env)->ExceptionOccurred(env)) {
NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
if (isEncodingSupported(env, enc) == JNI_TRUE) {
NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
"([BLjava/lang/String;)V"));
str = (*env)->NewObject(env, cls, mid, ary, enc);
} else {
/*If the encoding specified in sun.jnu.encoding is not
endorsed by "Charset.isSupported" we have to fall back
to use String(byte[]) explicitly here without specifying
the encoding name, in which the StringCoding class will
pickup the iso-8859-1 as the fallback converter for us.
*/
NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
"([B)V"));
str = (*env)->NewObject(env, cls, mid, ary);
if (makePlatformStringMID == NULL) {
NULL_CHECK0(makePlatformStringMID = (*env)->GetStaticMethodID(env,
cls, "makePlatformString", "(Z[B)Ljava/lang/String;"));
}
str = (*env)->CallStaticObjectMethod(env, cls,
makePlatformStringMID, USE_STDERR, ary);
(*env)->DeleteLocalRef(env, ary);
return str;
}
@ -1239,20 +1211,28 @@ NewPlatformStringArray(JNIEnv *env, char **strv, int strc)
static jclass
LoadMainClass(JNIEnv *env, int mode, char *name)
{
jclass cls;
jmethodID mid;
jstring str;
jobject result;
jlong start, end;
jclass cls = GetLauncherHelperClass(env);
NULL_CHECK0(cls);
if (JLI_IsTraceLauncher()) {
start = CounterGet();
}
NULL_CHECK0(cls = FindBootStrapClass(env, "sun/launcher/LauncherHelper"));
NULL_CHECK0(mid = (*env)->GetStaticMethodID(env, cls, "checkAndLoadMain",
"(ZILjava/lang/String;)Ljava/lang/Class;"));
str = (*env)->NewStringUTF(env, name);
result = (*env)->CallStaticObjectMethod(env, cls, mid, JNI_TRUE, mode, str);
NULL_CHECK0(mid = (*env)->GetStaticMethodID(env, cls,
"checkAndLoadMain",
"(ZILjava/lang/String;)Ljava/lang/Class;"));
switch (mode) {
case LM_CLASS:
str = NewPlatformString(env, name);
break;
default:
str = (*env)->NewStringUTF(env, name);
break;
}
result = (*env)->CallStaticObjectMethod(env, cls, mid, USE_STDERR, mode, str);
if (JLI_IsTraceLauncher()) {
end = CounterGet();
@ -1478,15 +1458,15 @@ PrintJavaVersion(JNIEnv *env, jboolean extraLF)
static void
ShowSettings(JNIEnv *env, char *optString)
{
jclass cls;
jmethodID showSettingsID;
jstring joptString;
NULL_CHECK(cls = FindBootStrapClass(env, "sun/launcher/LauncherHelper"));
jclass cls = GetLauncherHelperClass(env);
NULL_CHECK(cls);
NULL_CHECK(showSettingsID = (*env)->GetStaticMethodID(env, cls,
"showSettings", "(ZLjava/lang/String;JJJZ)V"));
joptString = (*env)->NewStringUTF(env, optString);
(*env)->CallStaticVoidMethod(env, cls, showSettingsID,
JNI_TRUE,
USE_STDERR,
joptString,
(jlong)initialHeapSize,
(jlong)maxHeapSize,
@ -1500,18 +1480,15 @@ ShowSettings(JNIEnv *env, char *optString)
static void
PrintUsage(JNIEnv* env, jboolean doXUsage)
{
jclass cls;
jmethodID initHelp, vmSelect, vmSynonym, vmErgo, printHelp, printXUsageMessage;
jstring jprogname, vm1, vm2;
int i;
NULL_CHECK(cls = FindBootStrapClass(env, "sun/launcher/LauncherHelper"));
jclass cls = GetLauncherHelperClass(env);
NULL_CHECK(cls);
if (doXUsage) {
NULL_CHECK(printXUsageMessage = (*env)->GetStaticMethodID(env, cls,
"printXUsageMessage", "(Z)V"));
(*env)->CallStaticVoidMethod(env, cls, printXUsageMessage, JNI_TRUE);
(*env)->CallStaticVoidMethod(env, cls, printXUsageMessage, USE_STDERR);
} else {
NULL_CHECK(initHelp = (*env)->GetStaticMethodID(env, cls,
"initHelpMessage", "(Ljava/lang/String;)V"));
@ -1570,7 +1547,7 @@ PrintUsage(JNIEnv* env, jboolean doXUsage)
}
/* Complete the usage message and print to stderr*/
(*env)->CallStaticVoidMethod(env, cls, printHelp, JNI_TRUE);
(*env)->CallStaticVoidMethod(env, cls, printHelp, USE_STDERR);
}
return;
}

View File

@ -743,24 +743,24 @@ class BandStructure {
private void dumpBand() throws IOException {
assert(optDumpBands);
PrintStream ps = new PrintStream(getDumpStream(this, ".txt"));
String irr = (bandCoding == regularCoding) ? "" : " irregular";
ps.print("# length="+length+
" size="+outputSize()+
irr+" coding="+bandCoding);
if (metaCoding != noMetaCoding) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < metaCoding.length; i++) {
if (i == 1) sb.append(" /");
sb.append(" ").append(metaCoding[i] & 0xFF);
try (PrintStream ps = new PrintStream(getDumpStream(this, ".txt"))) {
String irr = (bandCoding == regularCoding) ? "" : " irregular";
ps.print("# length="+length+
" size="+outputSize()+
irr+" coding="+bandCoding);
if (metaCoding != noMetaCoding) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < metaCoding.length; i++) {
if (i == 1) sb.append(" /");
sb.append(" ").append(metaCoding[i] & 0xFF);
}
ps.print(" //header: "+sb);
}
ps.print(" //header: "+sb);
printArrayTo(ps, values, 0, length);
}
try (OutputStream ds = getDumpStream(this, ".bnd")) {
bandCoding.writeArrayTo(ds, values, 0, length);
}
printArrayTo(ps, values, 0, length);
ps.close();
OutputStream ds = getDumpStream(this, ".bnd");
bandCoding.writeArrayTo(ds, values, 0, length);
ds.close();
}
/** Disburse one value. */
@ -829,12 +829,12 @@ class BandStructure {
private void dumpBand() throws IOException {
assert(optDumpBands);
OutputStream ds = getDumpStream(this, ".bnd");
if (bytesForDump != null)
bytesForDump.writeTo(ds);
else
bytes.writeTo(ds);
ds.close();
try (OutputStream ds = getDumpStream(this, ".bnd")) {
if (bytesForDump != null)
bytesForDump.writeTo(ds);
else
bytes.writeTo(ds);
}
}
public void readDataFrom(InputStream in) throws IOException {

View File

@ -150,12 +150,12 @@ class Driver {
// See if there is any other action to take.
if ("--config-file=".equals(state)) {
String propFile = av.remove(0);
InputStream propIn = new FileInputStream(propFile);
Properties fileProps = new Properties();
fileProps.load(new BufferedInputStream(propIn));
try (InputStream propIn = new FileInputStream(propFile)) {
fileProps.load(propIn);
}
if (engProps.get(verboseProp) != null)
fileProps.list(System.out);
propIn.close();
for (Map.Entry<Object,Object> me : fileProps.entrySet()) {
engProps.put((String) me.getKey(), (String) me.getValue());
}
@ -348,10 +348,10 @@ class Driver {
else
fileOut = new FileOutputStream(outfile);
fileOut = new BufferedOutputStream(fileOut);
JarOutputStream out = new JarOutputStream(fileOut);
junpack.unpack(in, out);
//in.close(); // p200 closes in but not out
out.close();
try (JarOutputStream out = new JarOutputStream(fileOut)) {
junpack.unpack(in, out);
// p200 closes in but not out
}
// At this point, we have a good jarfile (or newfile, if -r)
}
@ -411,8 +411,7 @@ class Driver {
long filelen = new File(jarfile).length();
if (filelen <= 0) return "";
long skiplen = Math.max(0, filelen - tail.length);
InputStream in = new FileInputStream(new File(jarfile));
try {
try (InputStream in = new FileInputStream(new File(jarfile))) {
in.skip(skiplen);
in.read(tail);
for (int i = tail.length-4; i >= 0; i--) {
@ -426,8 +425,6 @@ class Driver {
}
}
return "";
} finally {
in.close();
}
}

View File

@ -241,9 +241,9 @@ class NativeUnpack {
void run(File inFile, JarOutputStream jstream) throws IOException {
// %%% maybe memory-map the file, and pass it straight into unpacker
ByteBuffer mappedFile = null;
FileInputStream fis = new FileInputStream(inFile);
run(fis, jstream, mappedFile);
fis.close();
try (FileInputStream fis = new FileInputStream(inFile)) {
run(fis, jstream, mappedFile);
}
// Note: caller is responsible to finish with jstream.
}

View File

@ -540,9 +540,9 @@ class PackageReader extends BandStructure {
Index index = initCPIndex(tag, cpMap);
if (optDumpBands) {
PrintStream ps = new PrintStream(getDumpStream(index, ".idx"));
printArrayTo(ps, index.cpMap, 0, index.cpMap.length);
ps.close();
try (PrintStream ps = new PrintStream(getDumpStream(index, ".idx"))) {
printArrayTo(ps, index.cpMap, 0, index.cpMap.length);
}
}
}
@ -828,26 +828,27 @@ class PackageReader extends BandStructure {
attr_definition_headers.readFrom(in);
attr_definition_name.readFrom(in);
attr_definition_layout.readFrom(in);
PrintStream dump = !optDumpBands ? null
: new PrintStream(getDumpStream(attr_definition_headers, ".def"));
for (int i = 0; i < numAttrDefs; i++) {
int header = attr_definition_headers.getByte();
Utf8Entry name = (Utf8Entry) attr_definition_name.getRef();
Utf8Entry layout = (Utf8Entry) attr_definition_layout.getRef();
int ctype = (header & ADH_CONTEXT_MASK);
int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
Attribute.Layout def = new Attribute.Layout(ctype,
name.stringValue(),
layout.stringValue());
// Check layout string for Java 6 extensions.
String pvLayout = def.layoutForPackageMajver(getPackageMajver());
if (!pvLayout.equals(def.layout())) {
throw new IOException("Bad attribute layout in version 150 archive: "+def.layout());
try (PrintStream dump = !optDumpBands ? null
: new PrintStream(getDumpStream(attr_definition_headers, ".def")))
{
for (int i = 0; i < numAttrDefs; i++) {
int header = attr_definition_headers.getByte();
Utf8Entry name = (Utf8Entry) attr_definition_name.getRef();
Utf8Entry layout = (Utf8Entry) attr_definition_layout.getRef();
int ctype = (header & ADH_CONTEXT_MASK);
int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
Attribute.Layout def = new Attribute.Layout(ctype,
name.stringValue(),
layout.stringValue());
// Check layout string for Java 6 extensions.
String pvLayout = def.layoutForPackageMajver(getPackageMajver());
if (!pvLayout.equals(def.layout())) {
throw new IOException("Bad attribute layout in version 150 archive: "+def.layout());
}
this.setAttributeLayoutIndex(def, index);
if (dump != null) dump.println(index+" "+def);
}
this.setAttributeLayoutIndex(def, index);
if (dump != null) dump.println(index+" "+def);
}
if (dump != null) dump.close();
attr_definition_headers.doneDisbursing();
attr_definition_name.doneDisbursing();
attr_definition_layout.doneDisbursing();

View File

@ -458,9 +458,9 @@ class PackageWriter extends BandStructure {
Utils.log.info("Writing "+cpMap.length+" "+ConstantPool.tagName(tag)+" entries...");
if (optDumpBands) {
PrintStream ps = new PrintStream(getDumpStream(index, ".idx"));
printArrayTo(ps, cpMap, 0, cpMap.length);
ps.close();
try (PrintStream ps = new PrintStream(getDumpStream(index, ".idx"))) {
printArrayTo(ps, cpMap, 0, cpMap.length);
}
}
switch (tag) {
@ -923,33 +923,34 @@ class PackageWriter extends BandStructure {
}
});
attrDefsWritten = new Attribute.Layout[numAttrDefs];
PrintStream dump = !optDumpBands ? null
: new PrintStream(getDumpStream(attr_definition_headers, ".def"));
int[] indexForDebug = Arrays.copyOf(attrIndexLimit, ATTR_CONTEXT_LIMIT);
for (int i = 0; i < defs.length; i++) {
int header = ((Integer)defs[i][0]).intValue();
Attribute.Layout def = (Attribute.Layout) defs[i][1];
attrDefsWritten[i] = def;
assert((header & ADH_CONTEXT_MASK) == def.ctype());
attr_definition_headers.putByte(header);
attr_definition_name.putRef(ConstantPool.getUtf8Entry(def.name()));
String layout = def.layoutForPackageMajver(getPackageMajver());
attr_definition_layout.putRef(ConstantPool.getUtf8Entry(layout));
// Check that we are transmitting that correct attribute index:
boolean debug = false;
assert(debug = true);
if (debug) {
int hdrIndex = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
if (hdrIndex < 0) hdrIndex = indexForDebug[def.ctype()]++;
int realIndex = (attrIndexTable.get(def)).intValue();
assert(hdrIndex == realIndex);
}
if (dump != null) {
int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
dump.println(index+" "+def);
try (PrintStream dump = !optDumpBands ? null
: new PrintStream(getDumpStream(attr_definition_headers, ".def")))
{
int[] indexForDebug = Arrays.copyOf(attrIndexLimit, ATTR_CONTEXT_LIMIT);
for (int i = 0; i < defs.length; i++) {
int header = ((Integer)defs[i][0]).intValue();
Attribute.Layout def = (Attribute.Layout) defs[i][1];
attrDefsWritten[i] = def;
assert((header & ADH_CONTEXT_MASK) == def.ctype());
attr_definition_headers.putByte(header);
attr_definition_name.putRef(ConstantPool.getUtf8Entry(def.name()));
String layout = def.layoutForPackageMajver(getPackageMajver());
attr_definition_layout.putRef(ConstantPool.getUtf8Entry(layout));
// Check that we are transmitting that correct attribute index:
boolean debug = false;
assert(debug = true);
if (debug) {
int hdrIndex = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
if (hdrIndex < 0) hdrIndex = indexForDebug[def.ctype()]++;
int realIndex = (attrIndexTable.get(def)).intValue();
assert(hdrIndex == realIndex);
}
if (dump != null) {
int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
dump.println(index+" "+def);
}
}
}
if (dump != null) dump.close();
}
void writeAttrCounts() throws IOException {

View File

@ -122,26 +122,23 @@ final class PropMap implements SortedMap<Object, Object> {
// Define certain attribute layouts by default.
// Do this after the previous props are put in place,
// to allow override if necessary.
InputStream propStr = null;
try {
String propFile = "intrinsic.properties";
propStr = PackerImpl.class.getResourceAsStream(propFile);
props.load(new BufferedInputStream(propStr));
for (Map.Entry<Object, Object> e : props.entrySet()) {
String key = (String) e.getKey();
String val = (String) e.getValue();
if (key.startsWith("attribute.")) {
e.setValue(Attribute.normalizeLayoutString(val));
}
String propFile = "intrinsic.properties";
try (InputStream propStr = PackerImpl.class.getResourceAsStream(propFile)) {
if (propStr == null) {
throw new RuntimeException(propFile + " cannot be loaded");
}
props.load(propStr);
} catch (IOException ee) {
throw new RuntimeException(ee);
} finally {
try {
if (propStr != null) {
propStr.close();
}
} catch (IOException ignore) {}
}
for (Map.Entry<Object, Object> e : props.entrySet()) {
String key = (String) e.getKey();
String val = (String) e.getValue();
if (key.startsWith("attribute.")) {
e.setValue(Attribute.normalizeLayoutString(val));
}
}
defaultProps = (new HashMap<>(props)); // shrink to fit

View File

@ -161,8 +161,9 @@ public class UnpackerImpl extends TLGlobals implements Pack200.Unpacker {
}
// Use the stream-based implementation.
// %%% Reconsider if native unpacker learns to memory-map the file.
FileInputStream instr = new FileInputStream(in);
unpack(instr, out);
try (FileInputStream instr = new FileInputStream(in)) {
unpack(instr, out);
}
if (props.getBoolean(Utils.UNPACK_REMOVE_PACKFILE)) {
in.delete();
}

View File

@ -268,18 +268,18 @@ class Utils {
// 4947205 : Peformance is slow when using pack-effort=0
out = new BufferedOutputStream(out);
out = new NonCloser(out); // protect from JarOutputStream.close()
JarOutputStream jout = new JarOutputStream(out);
copyJarFile(in, jout);
jout.close();
try (JarOutputStream jout = new JarOutputStream(out)) {
copyJarFile(in, jout);
}
}
static void copyJarFile(JarFile in, OutputStream out) throws IOException {
// 4947205 : Peformance is slow when using pack-effort=0
out = new BufferedOutputStream(out);
out = new NonCloser(out); // protect from JarOutputStream.close()
JarOutputStream jout = new JarOutputStream(out);
copyJarFile(in, jout);
jout.close();
try (JarOutputStream jout = new JarOutputStream(out)) {
copyJarFile(in, jout);
}
}
// Wrapper to prevent closing of client-supplied stream.
static private

View File

@ -210,6 +210,8 @@ public final class Transform extends SignatureElementProxy {
public static void init() {
if (!alreadyInitialized) {
transformClassHash = new HashMap(10);
// make sure builtin algorithms are all registered first
com.sun.org.apache.xml.internal.security.Init.init();
alreadyInitialized = true;
}
}
@ -236,12 +238,7 @@ public final class Transform extends SignatureElementProxy {
"algorithm.alreadyRegistered", exArgs);
}
ClassLoader cl = (ClassLoader) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return Thread.currentThread().getContextClassLoader();
}
});
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
transformClassHash.put

View File

@ -115,6 +115,31 @@ public final class RhinoScriptEngine extends AbstractScriptEngine
//construct object used to implement getInterface
implementor = new InterfaceImplementor(this) {
protected boolean isImplemented(Object thiz, Class<?> iface) {
Context cx = enterContext();
try {
if (thiz != null && !(thiz instanceof Scriptable)) {
thiz = cx.toObject(thiz, topLevel);
}
Scriptable engineScope = getRuntimeScope(context);
Scriptable localScope = (thiz != null)? (Scriptable) thiz :
engineScope;
for (Method method : iface.getMethods()) {
// ignore methods of java.lang.Object class
if (method.getDeclaringClass() == Object.class) {
continue;
}
Object obj = ScriptableObject.getProperty(localScope, method.getName());
if (! (obj instanceof Function)) {
return false;
}
}
return true;
} finally {
cx.exit();
}
}
protected Object convertResult(Method method, Object res)
throws ScriptException {
Class desiredType = method.getReturnType();

View File

@ -82,12 +82,19 @@ public class InterfaceImplementor {
if (iface == null || !iface.isInterface()) {
throw new IllegalArgumentException("interface Class expected");
}
if (! isImplemented(thiz, iface)) {
return null;
}
AccessControlContext accCtxt = AccessController.getContext();
return iface.cast(Proxy.newProxyInstance(iface.getClassLoader(),
new Class[]{iface},
new InterfaceImplementorInvocationHandler(thiz, accCtxt)));
}
protected boolean isImplemented(Object thiz, Class<?> iface) {
return true;
}
// called to convert method result after invoke
protected Object convertResult(Method method, Object res)
throws ScriptException {

View File

@ -33,6 +33,11 @@ import java.lang.reflect.Field;
import sun.awt.AWTAccessor;
import sun.util.logging.PlatformLogger;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.io.ObjectInputStream;
import java.io.IOException;
/**
* The root event class for all AWT events.
* This class and its subclasses supercede the original
@ -97,6 +102,22 @@ public abstract class AWTEvent extends EventObject {
*/
protected boolean consumed = false;
/*
* The event's AccessControlContext.
*/
private transient volatile AccessControlContext acc =
AccessController.getContext();
/*
* Returns the acc this event was constructed with.
*/
final AccessControlContext getAccessControlContext() {
if (acc == null) {
throw new SecurityException("AWTEvent is missing AccessControlContext");
}
return acc;
}
transient boolean focusManagerIsDispatching = false;
transient boolean isPosted;
@ -247,6 +268,10 @@ public abstract class AWTEvent extends EventObject {
public boolean isSystemGenerated(AWTEvent ev) {
return ev.isSystemGenerated;
}
public AccessControlContext getAccessControlContext(AWTEvent ev) {
return ev.getAccessControlContext();
}
});
}

View File

@ -59,6 +59,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.AccessControlContext;
import javax.accessibility.*;
import java.applet.Applet;
@ -471,6 +472,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
static final Object LOCK = new AWTTreeLock();
static class AWTTreeLock {}
/*
* The component's AccessControlContext.
*/
private transient volatile AccessControlContext acc =
AccessController.getContext();
/**
* Minimum size.
* (This field perhaps should have been transient).
@ -671,6 +678,16 @@ public abstract class Component implements ImageObserver, MenuContainer,
return objectLock;
}
/*
* Returns the acc this component was constructed with.
*/
final AccessControlContext getAccessControlContext() {
if (acc == null) {
throw new SecurityException("Component is missing AccessControlContext");
}
return acc;
}
boolean isPacked = false;
/**
@ -950,6 +967,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
public void processEvent(Component comp, AWTEvent e) {
comp.processEvent(e);
}
public AccessControlContext getAccessControlContext(Component comp) {
return comp.getAccessControlContext();
}
});
}
@ -3873,6 +3894,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
* supported or met
* @exception ClassCastException if the component is not a canvas or
* window.
* @exception IllegalStateException if the component has no peer
* @exception IllegalArgumentException if {@code numBuffers} is less than two,
* or if {@code BufferCapabilities.isPageFlipping} is not
* {@code true}.
* @see #createBuffers(int, BufferCapabilities)
*/
protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
throws AWTException
@ -8608,6 +8634,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
{
objectLock = new Object();
acc = AccessController.getContext();
s.defaultReadObject();
appContext = AppContext.getAppContext();

View File

@ -48,6 +48,12 @@ import sun.awt.AWTAccessor;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.security.AccessControlContext;
import java.security.ProtectionDomain;
import sun.misc.SharedSecrets;
import sun.misc.JavaSecurityAccess;
/**
* <code>EventQueue</code> is a platform-independent class
* that queues events, both from the underlying peer classes
@ -612,6 +618,9 @@ public class EventQueue {
return null;
}
private static final JavaSecurityAccess javaSecurityAccess =
SharedSecrets.getJavaSecurityAccess();
/**
* Dispatches an event. The manner in which the event is
* dispatched depends upon the type of the event and the
@ -650,13 +659,49 @@ public class EventQueue {
* @throws NullPointerException if <code>event</code> is <code>null</code>
* @since 1.2
*/
protected void dispatchEvent(AWTEvent event) {
protected void dispatchEvent(final AWTEvent event) {
final Object src = event.getSource();
final PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
public Void run() {
dispatchEventImpl(event, src);
return null;
}
};
final AccessControlContext stack = AccessController.getContext();
final AccessControlContext srcAcc = getAccessControlContextFrom(src);
final AccessControlContext eventAcc = event.getAccessControlContext();
if (srcAcc == null) {
javaSecurityAccess.doIntersectionPrivilege(action, stack, eventAcc);
} else {
javaSecurityAccess.doIntersectionPrivilege(
new PrivilegedAction<Void>() {
public Void run() {
javaSecurityAccess.doIntersectionPrivilege(action, eventAcc);
return null;
}
}, stack, srcAcc);
}
}
private static AccessControlContext getAccessControlContextFrom(Object src) {
return src instanceof Component ?
((Component)src).getAccessControlContext() :
src instanceof MenuComponent ?
((MenuComponent)src).getAccessControlContext() :
src instanceof TrayIcon ?
((TrayIcon)src).getAccessControlContext() :
null;
}
/**
* Called from dispatchEvent() under a correct AccessControlContext
*/
private void dispatchEventImpl(final AWTEvent event, final Object src) {
event.isPosted = true;
Object src = event.getSource();
if (event instanceof ActiveEvent) {
// This could become the sole method of dispatching in time.
setCurrentEventAndMostRecentTimeImpl(event);
((ActiveEvent)event).dispatch();
} else if (src instanceof Component) {
((Component)src).dispatchEvent(event);

View File

@ -57,8 +57,14 @@ import java.beans.ConstructorProperties;
* </pre>
*
* <p>
* The user may also select what action the {@code LinearGradientPaint}
* should take when filling color outside the start and end points.
* The user may also select what action the {@code LinearGradientPaint} object
* takes when it is filling the space outside the start and end points by
* setting {@code CycleMethod} to either {@code REFLECTION} or {@code REPEAT}.
* The distances between any two colors in any of the reflected or repeated
* copies of the gradient are the same as the distance between those same two
* colors between the start and end points.
* Note that some minor variations in distances may occur due to sampling at
* the granularity of a pixel.
* If no cycle method is specified, {@code NO_CYCLE} will be chosen by
* default, which means the endpoint colors will be used to fill the
* remaining area.

View File

@ -33,6 +33,9 @@ import sun.awt.SunToolkit;
import sun.awt.AWTAccessor;
import javax.accessibility.*;
import java.security.AccessControlContext;
import java.security.AccessController;
/**
* The abstract class <code>MenuComponent</code> is the superclass
* of all menu-related components. In this respect, the class
@ -99,6 +102,23 @@ public abstract class MenuComponent implements java.io.Serializable {
*/
boolean newEventsOnly = false;
/*
* The menu's AccessControlContext.
*/
private transient volatile AccessControlContext acc =
AccessController.getContext();
/*
* Returns the acc this menu component was constructed with.
*/
final AccessControlContext getAccessControlContext() {
if (acc == null) {
throw new SecurityException(
"MenuComponent is missing AccessControlContext");
}
return acc;
}
/*
* Internal constants for serialization.
*/
@ -402,6 +422,9 @@ public abstract class MenuComponent implements java.io.Serializable {
throws ClassNotFoundException, IOException, HeadlessException
{
GraphicsEnvironment.checkHeadless();
acc = AccessController.getContext();
s.defaultReadObject();
appContext = AppContext.getAppContext();

View File

@ -286,6 +286,10 @@ public abstract class MultipleGradientPaint implements Paint {
/**
* Returns a copy of the transform applied to the gradient.
*
* <p>
* Note that if no transform is applied to the gradient
* when it is created, the identity transform is used.
*
* @return a copy of the transform applied to the gradient
*/
public final AffineTransform getTransform() {
@ -293,10 +297,12 @@ public abstract class MultipleGradientPaint implements Paint {
}
/**
* Returns the transparency mode for this Paint object.
* Returns the transparency mode for this {@code Paint} object.
*
* @return an integer value representing the transparency mode for
* this Paint object
* @return {@code OPAQUE} if all colors used by this
* {@code Paint} object are opaque,
* {@code TRANSLUCENT} if at least one of the
* colors used by this {@code Paint} object is not opaque.
* @see java.awt.Transparency
*/
public final int getTransparency() {

View File

@ -71,8 +71,24 @@ import java.beans.ConstructorProperties;
* </pre>
*
* <p>
* The user may also select what action the {@code RadialGradientPaint}
* should take when filling color outside the bounds of the circle's radius.
* The user may also select what action the {@code RadialGradientPaint} object
* takes when it is filling the space outside the circle's radius by
* setting {@code CycleMethod} to either {@code REFLECTION} or {@code REPEAT}.
* The gradient color proportions are equal for any particular line drawn
* from the focus point. The following figure shows that the distance AB
* is equal to the distance BC, and the distance AD is equal to the distance DE.
* <center>
* <img src = "doc-files/RadialGradientPaint-3.png">
* </center>
* If the gradient and graphics rendering transforms are uniformly scaled and
* the user sets the focus so that it coincides with the center of the circle,
* the gradient color proportions are equal for any line drawn from the center.
* The following figure shows the distances AB, BC, AD, and DE. They are all equal.
* <center>
* <img src = "doc-files/RadialGradientPaint-4.png">
* </center>
* Note that some minor variations in distances may occur due to sampling at
* the granularity of a pixel.
* If no cycle method is specified, {@code NO_CYCLE} will be chosen by
* default, which means the the last keyframe color will be used to fill the
* remaining area.
@ -604,7 +620,7 @@ public final class RadialGradientPaint extends MultipleGradientPaint {
}
/**
* Returns a copy of the end point of the gradient axis.
* Returns a copy of the focus point of the radial gradient.
*
* @return a {@code Point2D} object that is a copy of the focus point
*/

View File

@ -40,6 +40,8 @@ import sun.awt.AppContext;
import sun.awt.SunToolkit;
import sun.awt.HeadlessToolkit;
import java.util.EventObject;
import java.security.AccessControlContext;
import java.security.AccessController;
/**
* A <code>TrayIcon</code> object represents a tray icon that can be
@ -90,6 +92,7 @@ import java.util.EventObject;
* @author Anton Tarasov
*/
public class TrayIcon {
private Image image;
private String tooltip;
private PopupMenu popup;
@ -103,6 +106,24 @@ public class TrayIcon {
transient MouseMotionListener mouseMotionListener;
transient ActionListener actionListener;
/*
* The tray icon's AccessControlContext.
*
* Unlike the acc in Component, this field is made final
* because TrayIcon is not serializable.
*/
private final AccessControlContext acc = AccessController.getContext();
/*
* Returns the acc this tray icon was constructed with.
*/
final AccessControlContext getAccessControlContext() {
if (acc == null) {
throw new SecurityException("TrayIcon is missing AccessControlContext");
}
return acc;
}
static {
Toolkit.loadLibraries();
if (!GraphicsEnvironment.isHeadless()) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -343,8 +343,13 @@ public abstract class PackedColorModel extends ColorModel {
if (bitMasks.length != maskArray.length) {
return false;
}
/* compare 'effective' masks only, i.e. only part of the mask
* which fits the capacity of the transfer type.
*/
int maxMask = (int)((1L << DataBuffer.getDataTypeSize(transferType)) - 1);
for (int i=0; i < bitMasks.length; i++) {
if (bitMasks[i] != maskArray[i]) {
if ((maxMask & bitMasks[i]) != (maxMask & maskArray[i])) {
return false;
}
}

View File

@ -35,7 +35,7 @@ import sun.reflect.misc.*;
* is the delegate used by default for classes about
* which no information is available. The <code>DefaultPersistenceDelegate</code>
* provides, version resilient, public API-based persistence for
* classes that follow the JavaBeans conventions without any class specific
* classes that follow the JavaBeans&trade; conventions without any class specific
* configuration.
* <p>
* The key assumptions are that the class has a nullary constructor

View File

@ -31,7 +31,7 @@ package java.beans;
* of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy
* of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.
* <p>
* The JavaBeans specification defines the notion of design time as is a
* The JavaBeans&trade; specification defines the notion of design time as is a
* mode in which JavaBeans instances should function during their composition
* and customization in a interactive design, composition or construction tool,
* as opposed to runtime when the JavaBean is part of an applet, application,

View File

@ -26,7 +26,7 @@ package java.beans;
/**
* An "IndexedPropertyChange" event gets delivered whenever a component that
* conforms to the JavaBeans<TM> specification (a "bean") changes a bound
* conforms to the JavaBeans&trade; specification (a "bean") changes a bound
* indexed property. This class is an extension of <code>PropertyChangeEvent</code>
* but contains the index of the property that has changed.
* <P>

View File

@ -87,7 +87,7 @@ import sun.reflect.misc.ReflectUtil;
* <p>
* For more information about introspection and design patterns, please
* consult the
* <a href="http://java.sun.com/products/javabeans/docs/index.html">JavaBeans specification</a>.
* <a href="http://java.sun.com/products/javabeans/docs/index.html">JavaBeans&trade; specification</a>.
*/
public class Introspector {
@ -1245,7 +1245,7 @@ public class Introspector {
try {
type = ClassFinder.findClass(name, type.getClassLoader());
// Each customizer should inherit java.awt.Component and implement java.beans.Customizer
// according to the section 9.3 of JavaBeans specification
// according to the section 9.3 of JavaBeans&trade; specification
if (Component.class.isAssignableFrom(type) && Customizer.class.isAssignableFrom(type)) {
return type;
}

View File

@ -474,7 +474,7 @@ public class VetoableChangeSupport implements Serializable {
/**
* @serialField children Hashtable
* @serialField source Object
* @serialField propertyChangeSupportSerializedDataVersion int
* @serialField vetoableChangeSupportSerializedDataVersion int
*/
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("children", Hashtable.class),

View File

@ -29,7 +29,7 @@
Contains classes related to developing
<em>beans</em> -- components
based on the JavaBeans<sup><font size=-2>TM</font></sup> architecture.
based on the JavaBeans&trade; architecture.
A few of the
classes are used by beans while they run in an application.
For example, the event classes are

View File

@ -1,125 +0,0 @@
/*
* Copyright (c) 2008, 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.
*/
package java.dyn;
import java.dyn.MethodHandles.Lookup;
import java.util.WeakHashMap;
import sun.dyn.Access;
import sun.dyn.MethodHandleImpl;
import sun.dyn.util.VerifyAccess;
import sun.reflect.Reflection;
import static sun.dyn.MemberName.newIllegalArgumentException;
/**
* <em>CLASS WILL BE REMOVED FOR PFD:</em>
* Static routines for controlling invokedynamic behavior.
* Replaced by non-static APIs.
* @author John Rose, JSR 292 EG
* @deprecated This class will be removed in the Public Final Draft.
*/
public class Linkage {
private static final Access IMPL_TOKEN = Access.getToken();
private Linkage() {} // do not instantiate
/**
* <em>METHOD WILL BE REMOVED FOR PFD:</em>
* Register a <em>bootstrap method</em> to use when linking dynamic call sites within
* a given caller class.
* @deprecated Use @{@link BootstrapMethod} annotations instead.
*/
public static
void registerBootstrapMethod(Class callerClass, MethodHandle bootstrapMethod) {
Class callc = Reflection.getCallerClass(2);
if (callc != null && !VerifyAccess.isSamePackage(callerClass, callc))
throw new IllegalArgumentException("cannot set bootstrap method on "+callerClass);
MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod);
}
/**
* <em>METHOD WILL BE REMOVED FOR PFD:</em>
* Simplified version of {@code registerBootstrapMethod} for self-registration,
* to be called from a static initializer.
* @deprecated Use @{@link BootstrapMethod} annotations instead.
*/
public static
void registerBootstrapMethod(Class<?> runtime, String name) {
Class callerClass = Reflection.getCallerClass(2);
registerBootstrapMethodLookup(callerClass, runtime, name);
}
/**
* <em>METHOD WILL BE REMOVED FOR PFD:</em>
* Simplified version of {@code registerBootstrapMethod} for self-registration,
* @deprecated Use @{@link BootstrapMethod} annotations instead.
*/
public static
void registerBootstrapMethod(String name) {
Class callerClass = Reflection.getCallerClass(2);
registerBootstrapMethodLookup(callerClass, callerClass, name);
}
private static
void registerBootstrapMethodLookup(Class<?> callerClass, Class<?> runtime, String name) {
Lookup lookup = new Lookup(IMPL_TOKEN, callerClass);
MethodHandle bootstrapMethod;
try {
bootstrapMethod = lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE);
} catch (ReflectiveOperationException ex) {
throw new IllegalArgumentException("no such bootstrap method in "+runtime+": "+name, ex);
}
MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod);
}
private static final MethodType BOOTSTRAP_METHOD_TYPE
= MethodType.methodType(CallSite.class,
Class.class, String.class, MethodType.class);
/**
* <em>METHOD WILL BE REMOVED FOR PFD:</em>
* Invalidate all <code>invokedynamic</code> call sites everywhere.
* @deprecated Use {@linkplain MutableCallSite#setTarget call site target setting},
* {@link MutableCallSite#syncAll call site update pushing},
* and {@link SwitchPoint#guardWithTest target switching} instead.
*/
public static
Object invalidateAll() {
throw new UnsupportedOperationException();
}
/**
* <em>METHOD WILL BE REMOVED FOR PFD:</em>
* Invalidate all {@code invokedynamic} call sites in the bytecodes
* of any methods of the given class.
* @deprecated Use {@linkplain MutableCallSite#setTarget call site target setting},
* {@link MutableCallSite#syncAll call site update pushing},
* and {@link SwitchPoint#guardWithTest target switching} instead.
*/
public static
Object invalidateCallerClass(Class<?> callerClass) {
throw new UnsupportedOperationException();
}
}

View File

@ -34,12 +34,27 @@ package java.lang;
public interface AutoCloseable {
/**
* Closes this resource, relinquishing any underlying resources.
* This method is invoked automatically by the {@code
* try}-with-resources statement.
* This method is invoked automatically on objects managed by the
* {@code try}-with-resources statement.
*
* <p>Classes implementing this method are strongly encouraged to
* be declared to throw more specific exceptions (or no exception
* at all, if the close cannot fail).
* <p>While this interface method is declared to throw {@code
* Exception}, implementers are <em>strongly</em> encouraged to
* declare concrete implementations of the {@code close} method to
* throw more specific exceptions, or to throw no exception at all
* if the close operation cannot fail.
*
* <p><em>Implementers of this interface are also strongly advised
* to not have the {@code close} method throw {@link
* InterruptedException}.</em>
*
* This exception interacts with a thread's interrupted status,
* and runtime misbehavior is likely to occur if an {@code
* InterruptedException} is {@linkplain Throwable#addSuppressed
* suppressed}.
*
* More generally, if it would cause problems for an
* exception to be suppressed, the {@code AutoCloseable.close}
* method should not throw it.
*
* <p>Note that unlike the {@link java.io.Closeable#close close}
* method of {@link java.io.Closeable}, this {@code close} method
@ -48,9 +63,8 @@ public interface AutoCloseable {
* visible side effect, unlike {@code Closeable.close} which is
* required to have no effect if called more than once.
*
* However, while not required to be idempotent, implementers of
* this interface are strongly encouraged to make their {@code
* close} methods idempotent.
* However, implementers of this interface are strongly encouraged
* to make their {@code close} methods idempotent.
*
* @throws Exception if this resource cannot be closed
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2011, 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
@ -23,58 +23,56 @@
* questions.
*/
package java.dyn;
package java.lang;
/**
* Thrown to indicate that an {@code invokedynamic} instruction has
* failed to find its
* {@linkplain BootstrapMethod bootstrap method},
* or the bootstrap method has
* failed to provide a
* {@linkplain CallSite call site} with a {@linkplain CallSite#getTarget target}
* of the correct {@linkplain MethodHandle#type method type}.
* failed to find its bootstrap method,
* or the bootstrap method has failed to provide a
* {@linkplain java.lang.invoke.CallSite call site} with a {@linkplain java.lang.invoke.CallSite#getTarget target}
* of the correct {@linkplain java.lang.invoke.MethodHandle#type method type}.
*
* @author John Rose, JSR 292 EG
* @since 1.7
*/
public class InvokeDynamicBootstrapError extends LinkageError {
public class BootstrapMethodError extends LinkageError {
private static final long serialVersionUID = 292L;
/**
* Constructs an {@code InvokeDynamicBootstrapError} with no detail message.
* Constructs an {@code BootstrapMethodError} with no detail message.
*/
public InvokeDynamicBootstrapError() {
public BootstrapMethodError() {
super();
}
/**
* Constructs an {@code InvokeDynamicBootstrapError} with the specified
* Constructs an {@code BootstrapMethodError} with the specified
* detail message.
*
* @param s the detail message.
*/
public InvokeDynamicBootstrapError(String s) {
public BootstrapMethodError(String s) {
super(s);
}
/**
* Constructs a {@code InvokeDynamicBootstrapError} with the specified
* Constructs a {@code BootstrapMethodError} with the specified
* detail message and cause.
*
* @param s the detail message.
* @param cause the cause, may be {@code null}.
*/
public InvokeDynamicBootstrapError(String s, Throwable cause) {
public BootstrapMethodError(String s, Throwable cause) {
super(s, cause);
}
/**
* Constructs a {@code InvokeDynamicBootstrapError} with the specified
* Constructs a {@code BootstrapMethodError} with the specified
* cause.
*
* @param cause the cause, may be {@code null}.
*/
public InvokeDynamicBootstrapError(Throwable cause) {
public BootstrapMethodError(Throwable cause) {
// cf. Throwable(Throwable cause) constructor.
super(cause == null ? null : cause.toString());
initCause(cause);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2011, 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
@ -1626,20 +1626,28 @@ public abstract class ClassLoader {
* @since 1.2
*/
protected Package getPackage(String name) {
Package pkg;
synchronized (packages) {
Package pkg = packages.get(name);
if (pkg == null) {
if (parent != null) {
pkg = parent.getPackage(name);
} else {
pkg = Package.getSystemPackage(name);
}
if (pkg != null) {
packages.put(name, pkg);
pkg = packages.get(name);
}
if (pkg == null) {
if (parent != null) {
pkg = parent.getPackage(name);
} else {
pkg = Package.getSystemPackage(name);
}
if (pkg != null) {
synchronized (packages) {
Package pkg2 = packages.get(name);
if (pkg2 == null) {
packages.put(name, pkg);
} else {
pkg = pkg2;
}
}
}
return pkg;
}
return pkg;
}
/**

View File

@ -23,12 +23,10 @@
* questions.
*/
package java.dyn;
package java.lang;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.lang.reflect.UndeclaredThrowableException;
/**
* Lazily associate a computed value with (potentially) every type.
@ -37,10 +35,11 @@ import java.lang.reflect.UndeclaredThrowableException;
* it can use a {@code ClassValue} to cache information needed to
* perform the message send quickly, for each class encountered.
* @author John Rose, JSR 292 EG
* @since 1.7
*/
public abstract class ClassValue<T> {
/**
* Compute the given class's derived value for this {@code ClassValue}.
* Computes the given class's derived value for this {@code ClassValue}.
* <p>
* This method will be invoked within the first thread that accesses
* the value with the {@link #get get} method.
@ -159,13 +158,7 @@ public abstract class ClassValue<T> {
}
/// Implementation...
// The hash code for this type is based on the identity of the object,
// and is well-dispersed for power-of-two tables.
/** @deprecated This override, which is implementation-specific, will be removed for PFD. */
public final int hashCode() { return hashCode; }
private final int hashCode = HASH_CODES.getAndAdd(0x61c88647);
private static final AtomicInteger HASH_CODES = new AtomicInteger();
// FIXME: Use a data structure here similar that of ThreadLocal (7030453).
private static final AtomicInteger STORE_BARRIER = new AtomicInteger();

View File

@ -23,20 +23,19 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import sun.dyn.util.VerifyType;
import sun.dyn.util.Wrapper;
import java.dyn.*;
import sun.invoke.util.VerifyType;
import sun.invoke.util.Wrapper;
import java.util.Arrays;
import static sun.dyn.MethodHandleNatives.Constants.*;
import static sun.dyn.MemberName.newIllegalArgumentException;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import static java.lang.invoke.MethodHandleStatics.*;
/**
* This method handle performs simple conversion or checking of a single argument.
* @author jrose
*/
public class AdapterMethodHandle extends BoundMethodHandle {
class AdapterMethodHandle extends BoundMethodHandle {
//MethodHandle vmtarget; // next AMH or BMH in chain or final DMH
//Object argument; // parameter to the conversion if needed
@ -48,25 +47,21 @@ public class AdapterMethodHandle extends BoundMethodHandle {
long conv, Object convArg) {
super(newType, convArg, newType.parameterSlotDepth(1+convArgPos(conv)));
this.conversion = convCode(conv);
if (MethodHandleNatives.JVM_SUPPORT) {
// JVM might update VM-specific bits of conversion (ignore)
MethodHandleNatives.init(this, target, convArgPos(conv));
}
// JVM might update VM-specific bits of conversion (ignore)
MethodHandleNatives.init(this, target, convArgPos(conv));
}
private AdapterMethodHandle(MethodHandle target, MethodType newType,
long conv) {
this(target, newType, conv, null);
}
private static final Access IMPL_TOKEN = Access.getToken();
// TO DO: When adapting another MH with a null conversion, clone
// the target and change its type, instead of adding another layer.
/** Can a JVM-level adapter directly implement the proposed
* argument conversions, as if by MethodHandles.convertArguments?
*/
public static boolean canPairwiseConvert(MethodType newType, MethodType oldType) {
static boolean canPairwiseConvert(MethodType newType, MethodType oldType) {
// same number of args, of course
int len = newType.parameterCount();
if (len != oldType.parameterCount())
@ -92,7 +87,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/** Can a JVM-level adapter directly implement the proposed
* argument conversion, as if by MethodHandles.convertArguments?
*/
public static boolean canConvertArgument(Class<?> src, Class<?> dst) {
static boolean canConvertArgument(Class<?> src, Class<?> dst) {
// ? Retool this logic to use RETYPE_ONLY, CHECK_CAST, etc., as opcodes,
// so we don't need to repeat so much decision making.
if (VerifyType.isNullConversion(src, dst)) {
@ -118,16 +113,13 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* the JVM supports ricochet adapters).
* The argument conversions allowed are casting, unboxing,
* integral widening or narrowing, and floating point widening or narrowing.
* @param token access check
* @param newType required call type
* @param target original method handle
* @return an adapter to the original handle with the desired new type,
* or the original target if the types are already identical
* or null if the adaptation cannot be made
*/
public static MethodHandle makePairwiseConvert(Access token,
MethodType newType, MethodHandle target) {
Access.check(token);
static MethodHandle makePairwiseConvert(MethodType newType, MethodHandle target) {
MethodType oldType = target.type();
if (newType == oldType) return target;
@ -170,9 +162,9 @@ public class AdapterMethodHandle extends BoundMethodHandle {
// It parallels canConvertArgument() above.
if (src.isPrimitive()) {
if (dst.isPrimitive()) {
adapter = makePrimCast(token, midType, adapter, i, dst);
adapter = makePrimCast(midType, adapter, i, dst);
} else {
adapter = makeBoxArgument(token, midType, adapter, i, dst);
adapter = makeBoxArgument(midType, adapter, i, dst);
}
} else {
if (dst.isPrimitive()) {
@ -182,13 +174,13 @@ public class AdapterMethodHandle extends BoundMethodHandle {
// conversions supported by reflect.Method.invoke.
// Those conversions require a big nest of if/then/else logic,
// which we prefer to make a user responsibility.
adapter = makeUnboxArgument(token, midType, adapter, i, dst);
adapter = makeUnboxArgument(midType, adapter, i, dst);
} else {
// Simple reference conversion.
// Note: Do not check for a class hierarchy relation
// between src and dst. In all cases a 'null' argument
// will pass the cast conversion.
adapter = makeCheckCast(token, midType, adapter, i, dst);
adapter = makeCheckCast(midType, adapter, i, dst);
}
}
assert(adapter != null);
@ -196,7 +188,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
}
if (adapter.type() != newType) {
// Only trivial conversions remain.
adapter = makeRetypeOnly(IMPL_TOKEN, newType, adapter);
adapter = makeRetypeOnly(newType, adapter);
assert(adapter != null);
// Actually, that's because there were no non-trivial ones:
assert(lastConv == -1);
@ -208,7 +200,6 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/**
* Create a JVM-level adapter method handle to permute the arguments
* of the given method.
* @param token access check
* @param newType required call type
* @param target original method handle
* @param argumentMap for each target argument, position of its source in newType
@ -218,8 +209,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* @throws IllegalArgumentException if the adaptation cannot be made
* directly by a JVM-level adapter, without help from Java code
*/
public static MethodHandle makePermutation(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makePermutation(MethodType newType, MethodHandle target,
int[] argumentMap) {
MethodType oldType = target.type();
boolean nullPermutation = true;
@ -234,7 +224,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
if (argumentMap.length != oldType.parameterCount())
throw newIllegalArgumentException("bad permutation: "+Arrays.toString(argumentMap));
if (nullPermutation) {
MethodHandle res = makePairwiseConvert(token, newType, target);
MethodHandle res = makePairwiseConvert(newType, target);
// well, that was easy
if (res == null)
throw newIllegalArgumentException("cannot convert pairwise: "+newType);
@ -435,7 +425,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
}
/** Can a retyping adapter (alone) validly convert the target to newType? */
public static boolean canRetypeOnly(MethodType newType, MethodType targetType) {
static boolean canRetypeOnly(MethodType newType, MethodType targetType) {
return canRetype(newType, targetType, false);
}
/** Can a retyping adapter (alone) convert the target to newType?
@ -444,7 +434,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* reference conversions on return. This last feature requires that the
* caller be trusted, and perform explicit cast conversions on return values.
*/
public static boolean canRetypeRaw(MethodType newType, MethodType targetType) {
static boolean canRetypeRaw(MethodType newType, MethodType targetType) {
return canRetype(newType, targetType, true);
}
static boolean canRetype(MethodType newType, MethodType targetType, boolean raw) {
@ -459,17 +449,13 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* Allows unchecked argument conversions pairwise, if they are safe.
* Returns null if not possible.
*/
public static MethodHandle makeRetypeOnly(Access token,
MethodType newType, MethodHandle target) {
return makeRetype(token, newType, target, false);
static MethodHandle makeRetypeOnly(MethodType newType, MethodHandle target) {
return makeRetype(newType, target, false);
}
public static MethodHandle makeRetypeRaw(Access token,
MethodType newType, MethodHandle target) {
return makeRetype(token, newType, target, true);
static MethodHandle makeRetypeRaw(MethodType newType, MethodHandle target) {
return makeRetype(newType, target, true);
}
static MethodHandle makeRetype(Access token,
MethodType newType, MethodHandle target, boolean raw) {
Access.check(token);
static MethodHandle makeRetype(MethodType newType, MethodHandle target, boolean raw) {
MethodType oldType = target.type();
if (oldType == newType) return target;
if (!canRetype(newType, oldType, raw))
@ -478,9 +464,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
return new AdapterMethodHandle(target, newType, makeConv(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY));
}
static MethodHandle makeVarargsCollector(Access token,
MethodHandle target, Class<?> arrayType) {
Access.check(token);
static MethodHandle makeVarargsCollector(MethodHandle target, Class<?> arrayType) {
return new AsVarargsCollector(target, arrayType);
}
@ -526,6 +510,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
return collector.asType(newType);
}
@Override
public MethodHandle asVarargsCollector(Class<?> arrayType) {
MethodType type = this.type();
if (type.parameterType(type.parameterCount()-1) == arrayType)
@ -537,7 +522,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/** Can a checkcast adapter validly convert the target to newType?
* The JVM supports all kind of reference casts, even silly ones.
*/
public static boolean canCheckCast(MethodType newType, MethodType targetType,
static boolean canCheckCast(MethodType newType, MethodType targetType,
int arg, Class<?> castType) {
if (!convOpSupported(OP_CHECK_CAST)) return false;
Class<?> src = newType.parameterType(arg);
@ -549,7 +534,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
return (diff == arg+1); // arg is sole non-trivial diff
}
/** Can an primitive conversion adapter validly convert src to dst? */
public static boolean canCheckCast(Class<?> src, Class<?> dst) {
static boolean canCheckCast(Class<?> src, Class<?> dst) {
return (!src.isPrimitive() && !dst.isPrimitive());
}
@ -558,10 +543,8 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* with a null conversion to the corresponding target parameter.
* Return null if this cannot be done.
*/
public static MethodHandle makeCheckCast(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeCheckCast(MethodType newType, MethodHandle target,
int arg, Class<?> castType) {
Access.check(token);
if (!canCheckCast(newType, target.type(), arg, castType))
return null;
long conv = makeConv(OP_CHECK_CAST, arg, T_OBJECT, T_OBJECT);
@ -572,7 +555,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* The JVM currently supports all conversions except those between
* floating and integral types.
*/
public static boolean canPrimCast(MethodType newType, MethodType targetType,
static boolean canPrimCast(MethodType newType, MethodType targetType,
int arg, Class<?> convType) {
if (!convOpSupported(OP_PRIM_TO_PRIM)) return false;
Class<?> src = newType.parameterType(arg);
@ -584,7 +567,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
return (diff == arg+1); // arg is sole non-trivial diff
}
/** Can an primitive conversion adapter validly convert src to dst? */
public static boolean canPrimCast(Class<?> src, Class<?> dst) {
static boolean canPrimCast(Class<?> src, Class<?> dst) {
if (src == dst || !src.isPrimitive() || !dst.isPrimitive()) {
return false;
} else if (Wrapper.forPrimitiveType(dst).isFloating()) {
@ -604,10 +587,8 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* with a null conversion to the corresponding target parameter.
* Return null if this cannot be done.
*/
public static MethodHandle makePrimCast(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makePrimCast(MethodType newType, MethodHandle target,
int arg, Class<?> convType) {
Access.check(token);
MethodType oldType = target.type();
if (!canPrimCast(newType, oldType, arg, convType))
return null;
@ -620,7 +601,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* The JVM currently supports all kinds of casting and unboxing.
* The convType is the unboxed type; it can be either a primitive or wrapper.
*/
public static boolean canUnboxArgument(MethodType newType, MethodType targetType,
static boolean canUnboxArgument(MethodType newType, MethodType targetType,
int arg, Class<?> convType) {
if (!convOpSupported(OP_REF_TO_PRIM)) return false;
Class<?> src = newType.parameterType(arg);
@ -635,15 +616,14 @@ public class AdapterMethodHandle extends BoundMethodHandle {
return (diff == arg+1); // arg is sole non-trivial diff
}
/** Can an primitive unboxing adapter validly convert src to dst? */
public static boolean canUnboxArgument(Class<?> src, Class<?> dst) {
static boolean canUnboxArgument(Class<?> src, Class<?> dst) {
return (!src.isPrimitive() && Wrapper.asPrimitiveType(dst).isPrimitive());
}
/** Factory method: Unbox the given argument.
* Return null if this cannot be done.
*/
public static MethodHandle makeUnboxArgument(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeUnboxArgument(MethodType newType, MethodHandle target,
int arg, Class<?> convType) {
MethodType oldType = target.type();
Class<?> src = newType.parameterType(arg);
@ -659,11 +639,11 @@ public class AdapterMethodHandle extends BoundMethodHandle {
MethodHandle adapter = new AdapterMethodHandle(target, castDone, conv, boxType);
if (castDone == newType)
return adapter;
return makeCheckCast(token, newType, adapter, arg, boxType);
return makeCheckCast(newType, adapter, arg, boxType);
}
/** Can an primitive boxing adapter validly convert src to dst? */
public static boolean canBoxArgument(Class<?> src, Class<?> dst) {
static boolean canBoxArgument(Class<?> src, Class<?> dst) {
if (!convOpSupported(OP_PRIM_TO_REF)) return false;
throw new UnsupportedOperationException("NYI");
}
@ -671,15 +651,14 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/** Factory method: Unbox the given argument.
* Return null if this cannot be done.
*/
public static MethodHandle makeBoxArgument(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeBoxArgument(MethodType newType, MethodHandle target,
int arg, Class<?> convType) {
// this is difficult to do in the JVM because it must GC
return null;
}
/** Can an adapter simply drop arguments to convert the target to newType? */
public static boolean canDropArguments(MethodType newType, MethodType targetType,
static boolean canDropArguments(MethodType newType, MethodType targetType,
int dropArgPos, int dropArgCount) {
if (dropArgCount == 0)
return canRetypeOnly(newType, targetType);
@ -706,12 +685,10 @@ public class AdapterMethodHandle extends BoundMethodHandle {
* Allow unchecked retyping of remaining arguments, pairwise.
* Return null if this is not possible.
*/
public static MethodHandle makeDropArguments(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeDropArguments(MethodType newType, MethodHandle target,
int dropArgPos, int dropArgCount) {
Access.check(token);
if (dropArgCount == 0)
return makeRetypeOnly(IMPL_TOKEN, newType, target);
return makeRetypeOnly(newType, target);
if (!canDropArguments(newType, target.type(), dropArgPos, dropArgCount))
return null;
// in arglist: [0: ...keep1 | dpos: drop... | dpos+dcount: keep2... ]
@ -727,7 +704,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
}
/** Can an adapter duplicate an argument to convert the target to newType? */
public static boolean canDupArguments(MethodType newType, MethodType targetType,
static boolean canDupArguments(MethodType newType, MethodType targetType,
int dupArgPos, int dupArgCount) {
if (!convOpSupported(OP_DUP_ARGS)) return false;
if (diffReturnTypes(newType, targetType, false) != 0)
@ -749,10 +726,8 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/** Factory method: Duplicate the selected argument.
* Return null if this is not possible.
*/
public static MethodHandle makeDupArguments(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeDupArguments(MethodType newType, MethodHandle target,
int dupArgPos, int dupArgCount) {
Access.check(token);
if (!canDupArguments(newType, target.type(), dupArgPos, dupArgCount))
return null;
if (dupArgCount == 0)
@ -769,7 +744,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
}
/** Can an adapter swap two arguments to convert the target to newType? */
public static boolean canSwapArguments(MethodType newType, MethodType targetType,
static boolean canSwapArguments(MethodType newType, MethodType targetType,
int swapArg1, int swapArg2) {
if (!convOpSupported(OP_SWAP_ARGS)) return false;
if (diffReturnTypes(newType, targetType, false) != 0)
@ -796,10 +771,8 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/** Factory method: Swap the selected arguments.
* Return null if this is not possible.
*/
public static MethodHandle makeSwapArguments(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeSwapArguments(MethodType newType, MethodHandle target,
int swapArg1, int swapArg2) {
Access.check(token);
if (swapArg1 == swapArg2)
return target;
if (swapArg1 > swapArg2) { int t = swapArg1; swapArg1 = swapArg2; swapArg2 = t; }
@ -829,7 +802,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
final static int MAX_ARG_ROTATION = 1;
/** Can an adapter rotate arguments to convert the target to newType? */
public static boolean canRotateArguments(MethodType newType, MethodType targetType,
static boolean canRotateArguments(MethodType newType, MethodType targetType,
int firstArg, int argCount, int rotateBy) {
if (!convOpSupported(OP_ROT_ARGS)) return false;
if (argCount <= 2) return false; // must be a swap, not a rotate
@ -861,10 +834,8 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/** Factory method: Rotate the selected argument range.
* Return null if this is not possible.
*/
public static MethodHandle makeRotateArguments(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeRotateArguments(MethodType newType, MethodHandle target,
int firstArg, int argCount, int rotateBy) {
Access.check(token);
rotateBy = positiveRotation(argCount, rotateBy);
if (!canRotateArguments(newType, target.type(), firstArg, argCount, rotateBy))
return null;
@ -904,7 +875,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
}
/** Can an adapter spread an argument to convert the target to newType? */
public static boolean canSpreadArguments(MethodType newType, MethodType targetType,
static boolean canSpreadArguments(MethodType newType, MethodType targetType,
Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
if (!convOpSupported(OP_SPREAD_ARGS)) return false;
if (diffReturnTypes(newType, targetType, false) != 0)
@ -937,10 +908,8 @@ public class AdapterMethodHandle extends BoundMethodHandle {
/** Factory method: Spread selected argument. */
public static MethodHandle makeSpreadArguments(Access token,
MethodType newType, MethodHandle target,
static MethodHandle makeSpreadArguments(MethodType newType, MethodHandle target,
Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
Access.check(token);
MethodType targetType = target.type();
if (!canSpreadArguments(newType, targetType, spreadArgType, spreadArgPos, spreadArgCount))
return null;
@ -962,7 +931,7 @@ public class AdapterMethodHandle extends BoundMethodHandle {
@Override
public String toString() {
return MethodHandleImpl.getNameString(IMPL_TOKEN, nonAdapter((MethodHandle)vmtarget), this);
return getNameString(nonAdapter((MethodHandle)vmtarget), this);
}
private static MethodHandle nonAdapter(MethodHandle mh) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2011, 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
@ -23,15 +23,11 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import sun.dyn.util.VerifyType;
import sun.dyn.util.Wrapper;
import java.dyn.*;
import java.util.List;
import sun.dyn.MethodHandleNatives.Constants;
import static sun.dyn.MethodHandleImpl.IMPL_LOOKUP;
import static sun.dyn.MemberName.newIllegalArgumentException;
import sun.invoke.util.VerifyType;
import sun.invoke.util.Wrapper;
import static java.lang.invoke.MethodHandleStatics.*;
/**
* The flavor of method handle which emulates an invoke instruction
@ -39,37 +35,29 @@ import static sun.dyn.MemberName.newIllegalArgumentException;
* when the handle is created, not when it is invoked.
* @author jrose
*/
public class BoundMethodHandle extends MethodHandle {
class BoundMethodHandle extends MethodHandle {
//MethodHandle vmtarget; // next BMH or final DMH or methodOop
private final Object argument; // argument to insert
private final int vmargslot; // position at which it is inserted
private static final Access IMPL_TOKEN = Access.getToken();
private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory(IMPL_TOKEN);
// Constructors in this class *must* be package scoped or private.
/** Bind a direct MH to its receiver (or first ref. argument).
* The JVM will pre-dispatch the MH if it is not already static.
*/
BoundMethodHandle(DirectMethodHandle mh, Object argument) {
super(Access.TOKEN, mh.type().dropParameterTypes(0, 1));
/*non-public*/ BoundMethodHandle(DirectMethodHandle mh, Object argument) {
super(mh.type().dropParameterTypes(0, 1));
// check the type now, once for all:
this.argument = checkReferenceArgument(argument, mh, 0);
this.vmargslot = this.type().parameterSlotCount();
if (MethodHandleNatives.JVM_SUPPORT) {
this.vmtarget = null; // maybe updated by JVM
MethodHandleNatives.init(this, mh, 0);
} else {
this.vmtarget = mh;
}
initTarget(mh, 0);
}
/** Insert an argument into an arbitrary method handle.
* If argnum is zero, inserts the first argument, etc.
* The argument type must be a reference.
*/
BoundMethodHandle(MethodHandle mh, Object argument, int argnum) {
/*non-public*/ BoundMethodHandle(MethodHandle mh, Object argument, int argnum) {
this(mh.type().dropParameterTypes(argnum, argnum+1),
mh, argument, argnum);
}
@ -77,8 +65,8 @@ public class BoundMethodHandle extends MethodHandle {
/** Insert an argument into an arbitrary method handle.
* If argnum is zero, inserts the first argument, etc.
*/
BoundMethodHandle(MethodType type, MethodHandle mh, Object argument, int argnum) {
super(Access.TOKEN, type);
/*non-public*/ BoundMethodHandle(MethodType type, MethodHandle mh, Object argument, int argnum) {
super(type);
if (mh.type().parameterType(argnum).isPrimitive())
this.argument = bindPrimitiveArgument(argument, mh, argnum);
else {
@ -89,18 +77,14 @@ public class BoundMethodHandle extends MethodHandle {
}
private void initTarget(MethodHandle mh, int argnum) {
if (MethodHandleNatives.JVM_SUPPORT) {
this.vmtarget = null; // maybe updated by JVM
MethodHandleNatives.init(this, mh, argnum);
} else {
this.vmtarget = mh;
}
//this.vmtarget = mh; // maybe updated by JVM
MethodHandleNatives.init(this, mh, argnum);
}
/** For the AdapterMethodHandle subclass.
*/
BoundMethodHandle(MethodType type, Object argument, int vmargslot) {
super(Access.TOKEN, type);
/*non-public*/ BoundMethodHandle(MethodType type, Object argument, int vmargslot) {
super(type);
this.argument = argument;
this.vmargslot = vmargslot;
assert(this instanceof AdapterMethodHandle);
@ -112,8 +96,8 @@ public class BoundMethodHandle extends MethodHandle {
* same as {@code entryPoint}, except that the first argument
* type will be dropped.
*/
protected BoundMethodHandle(Access token, MethodHandle entryPoint) {
super(token, entryPoint.type().dropParameterTypes(0, 1));
/*non-public*/ BoundMethodHandle(MethodHandle entryPoint) {
super(entryPoint.type().dropParameterTypes(0, 1));
this.argument = this; // kludge; get rid of
this.vmargslot = this.type().parameterSlotDepth(0);
initTarget(entryPoint, 0);
@ -172,7 +156,7 @@ public class BoundMethodHandle extends MethodHandle {
@Override
public String toString() {
return MethodHandleImpl.addTypeString(baseName(), this);
return addTypeString(baseName(), this);
}
/** Component of toString() before the type string. */

View File

@ -23,12 +23,12 @@
* questions.
*/
package java.dyn;
package java.lang.invoke;
import sun.dyn.*;
import sun.dyn.empty.Empty;
import sun.invoke.empty.Empty;
import sun.misc.Unsafe;
import java.util.Collection;
import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
/**
* A {@code CallSite} is a holder for a variable {@link MethodHandle},
@ -85,7 +85,6 @@ private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String nam
*/
abstract
public class CallSite {
private static final Access IMPL_TOKEN = Access.getToken();
static { MethodHandleImpl.initStatics(); }
// Fields used only by the JVM. Do not use or change.
@ -96,9 +95,6 @@ public class CallSite {
/*package-private*/
MethodHandle target;
// Remove this field for PFD and delete deprecated methods:
private MemberName calleeNameRemoveForPFD;
/**
* Make a blank call site object with the given method type.
* An initial target method is supplied which will throw
@ -111,7 +107,7 @@ public class CallSite {
*/
/*package-private*/
CallSite(MethodType type) {
target = MethodHandles.invokers(type).uninitializedCallSite();
target = type.invokers().uninitializedCallSite();
}
/**
@ -145,7 +141,7 @@ public class CallSite {
int callerBCI) {
if (this.vmmethod != null) {
// FIXME
throw new InvokeDynamicBootstrapError("call site has already been linked to an invokedynamic instruction");
throw new BootstrapMethodError("call site has already been linked to an invokedynamic instruction");
}
if (!this.type().equals(type)) {
throw wrongTargetType(target, type);
@ -202,7 +198,7 @@ public class CallSite {
}
/**
* Produce a method handle equivalent to an invokedynamic instruction
* Produces a method handle equivalent to an invokedynamic instruction
* which has been linked to this call site.
* <p>
* This method is equivalent to the following code:
@ -218,7 +214,7 @@ public class CallSite {
public abstract MethodHandle dynamicInvoker();
/*non-public*/ MethodHandle makeDynamicInvoker() {
MethodHandle getTarget = MethodHandleImpl.bindReceiver(IMPL_TOKEN, GET_TARGET, this);
MethodHandle getTarget = MethodHandleImpl.bindReceiver(GET_TARGET, this);
MethodHandle invoker = MethodHandles.exactInvoker(this.type());
return MethodHandles.foldArguments(invoker, getTarget);
}
@ -226,7 +222,7 @@ public class CallSite {
private static final MethodHandle GET_TARGET;
static {
try {
GET_TARGET = MethodHandles.Lookup.IMPL_LOOKUP.
GET_TARGET = IMPL_LOOKUP.
findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class));
} catch (ReflectiveOperationException ignore) {
throw new InternalError();
@ -252,7 +248,6 @@ public class CallSite {
/*package-private*/
void setTargetNormal(MethodHandle newTarget) {
target = newTarget;
//CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget);
}
/*package-private*/
MethodHandle getTargetVolatile() {
@ -261,6 +256,68 @@ public class CallSite {
/*package-private*/
void setTargetVolatile(MethodHandle newTarget) {
unsafe.putObjectVolatile(this, TARGET_OFFSET, newTarget);
//CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget);
}
// this implements the upcall from the JVM, MethodHandleNatives.makeDynamicCallSite:
static CallSite makeSite(MethodHandle bootstrapMethod,
// Callee information:
String name, MethodType type,
// Extra arguments for BSM, if any:
Object info,
// Caller information:
MemberName callerMethod, int callerBCI) {
Class<?> callerClass = callerMethod.getDeclaringClass();
Object caller = IMPL_LOOKUP.in(callerClass);
CallSite site;
try {
Object binding;
info = maybeReBox(info);
if (info == null) {
binding = bootstrapMethod.invokeGeneric(caller, name, type);
} else if (!info.getClass().isArray()) {
binding = bootstrapMethod.invokeGeneric(caller, name, type, info);
} else {
Object[] argv = (Object[]) info;
maybeReBoxElements(argv);
if (3 + argv.length > 255)
throw new BootstrapMethodError("too many bootstrap method arguments");
MethodType bsmType = bootstrapMethod.type();
if (bsmType.parameterCount() == 4 && bsmType.parameterType(3) == Object[].class)
binding = bootstrapMethod.invokeGeneric(caller, name, type, argv);
else
binding = MethodHandles.spreadInvoker(bsmType, 3)
.invokeGeneric(bootstrapMethod, caller, name, type, argv);
}
//System.out.println("BSM for "+name+type+" => "+binding);
if (binding instanceof CallSite) {
site = (CallSite) binding;
} else {
throw new ClassCastException("bootstrap method failed to produce a CallSite");
}
assert(site.getTarget() != null);
assert(site.getTarget().type().equals(type));
} catch (Throwable ex) {
BootstrapMethodError bex;
if (ex instanceof BootstrapMethodError)
bex = (BootstrapMethodError) ex;
else
bex = new BootstrapMethodError("call site initialization exception", ex);
throw bex;
}
return site;
}
private static Object maybeReBox(Object x) {
if (x instanceof Integer) {
int xi = (int) x;
if (xi == (byte) xi)
x = xi; // must rebox; see JLS 5.1.7
}
return x;
}
private static void maybeReBoxElements(Object[] xa) {
for (int i = 0; i < xa.length; i++) {
xa[i] = maybeReBox(xa[i]);
}
}
}

View File

@ -23,7 +23,7 @@
* questions.
*/
package java.dyn;
package java.lang.invoke;
/**
* A {@code ConstantCallSite} is a {@link CallSite} whose target is permanent, and can never be changed.

Some files were not shown because too many files have changed in this diff Show More