提交 abac9621 编写于 作者: L lana

Merge

......@@ -109,3 +109,5 @@ bdc069d3f9101f89ec3f81c2950ee2d68fa846d3 jdk7-b130
6bbc7a4734952ae7604578f270e1566639fa8752 jdk7-b132
5e5f68a01d12a4432172f384d5201f3a05254493 jdk7-b133
554adcfb615e63e62af530b1c10fcf7813a75b26 jdk7-b134
d8ced728159fbb2caa8b6adb477fd8efdbbdf179 jdk7-b135
aa13e7702cd9d8aca9aa38f1227f966990866944 jdk7-b136
#
# 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.
......
#
# 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
......@@ -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
......
#
# 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
......@@ -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)
......@@ -488,6 +519,10 @@ else
COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
endif
ifndef OPENJDK
include $(JDK_TOPDIR)/make/closed/common/Defs.gmk
endif
# Install of imported file (JDK_IMPORT_PATH, or some other external location)
define install-importonly-file
@$(ECHO) "ASSEMBLY_IMPORT: $@"
......
......@@ -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
......
#
# 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
......@@ -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
......@@ -86,14 +83,7 @@ ifdef OPENJDK
IMAGE_DOCLIST_JDK = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
IMAGE_DOCLIST_JRE = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
else
# Where to find these files
ifeq ($(J4B), true)
SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdkfb
SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jrefb
else
SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdk
SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jre
endif
# make/closed/common/Defs.gmk for closed location of SHARE_JDK_DOC_SRC
IMAGE_DOCLIST_JDK = COPYRIGHT README.html THIRDPARTYLICENSEREADME.txt
IMAGE_DOCLIST_JRE = COPYRIGHT Welcome.html THIRDPARTYLICENSEREADME.txt
......@@ -918,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/
......
#
# 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
......@@ -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)
......
#
# 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
\ No newline at end of file
#
# 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
\ No newline at end of file
#
# 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
......
#
# 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
......
......@@ -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
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
ifneq ($(VS2010_EXISTS),true)
x:=$(error ERROR: No VS2010 found on system.)
endif
# 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
#
# 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
......
#
# 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
......
#
# 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" \
......
#
# 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 \
......
#
# 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)
......
#
# 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
......
#
# 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
......@@ -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)
......
#
# 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
......
#
# 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)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
......
......@@ -136,6 +136,7 @@ FILES_java = \
sun/text/resources/CollationData_sl.java \
sun/text/resources/CollationData_sq.java \
sun/text/resources/CollationData_sr.java \
sun/text/resources/CollationData_sr_Latn.java \
sun/text/resources/CollationData_sv.java \
sun/text/resources/CollationData_tr.java \
sun/text/resources/CollationData_uk.java \
......@@ -251,6 +252,10 @@ FILES_java = \
sun/text/resources/FormatData_sr_CS.java \
sun/text/resources/FormatData_sr_ME.java \
sun/text/resources/FormatData_sr_RS.java \
sun/text/resources/FormatData_sr_Latn.java \
sun/text/resources/FormatData_sr_Latn_BA.java \
sun/text/resources/FormatData_sr_Latn_ME.java \
sun/text/resources/FormatData_sr_Latn_RS.java \
sun/text/resources/FormatData_sv.java \
sun/text/resources/FormatData_sv_SE.java \
sun/text/resources/FormatData_tr.java \
......
......@@ -65,6 +65,7 @@ FILES_compiled_properties = \
sun/util/resources/LocaleNames_sl.properties \
sun/util/resources/LocaleNames_sq.properties \
sun/util/resources/LocaleNames_sr.properties \
sun/util/resources/LocaleNames_sr_Latn.properties \
sun/util/resources/LocaleNames_sv.properties \
sun/util/resources/LocaleNames_tr.properties \
sun/util/resources/LocaleNames_uk.properties \
......@@ -111,6 +112,9 @@ FILES_compiled_properties = \
sun/util/resources/CalendarData_sl.properties \
sun/util/resources/CalendarData_sq.properties \
sun/util/resources/CalendarData_sr.properties \
sun/util/resources/CalendarData_sr_Latn_BA.properties \
sun/util/resources/CalendarData_sr_Latn_ME.properties \
sun/util/resources/CalendarData_sr_Latn_RS.properties \
sun/util/resources/CalendarData_sv.properties \
sun/util/resources/CalendarData_tr.properties \
sun/util/resources/CalendarData_uk.properties \
......@@ -186,6 +190,7 @@ FILES_compiled_properties = \
sun/util/resources/CurrencyNames_nl_NL.properties \
sun/util/resources/CurrencyNames_no_NO.properties \
sun/util/resources/CurrencyNames_pl_PL.properties \
sun/util/resources/CurrencyNames_pt.properties \
sun/util/resources/CurrencyNames_pt_BR.properties \
sun/util/resources/CurrencyNames_pt_PT.properties \
sun/util/resources/CurrencyNames_ro_RO.properties \
......@@ -196,6 +201,10 @@ FILES_compiled_properties = \
sun/util/resources/CurrencyNames_sr_BA.properties \
sun/util/resources/CurrencyNames_sr_CS.properties \
sun/util/resources/CurrencyNames_sr_ME.properties \
sun/util/resources/CurrencyNames_sr_RS.properties \
sun/util/resources/CurrencyNames_sr_Latn_BA.properties \
sun/util/resources/CurrencyNames_sr_Latn_ME.properties \
sun/util/resources/CurrencyNames_sr_Latn_RS.properties \
sun/util/resources/CurrencyNames_sv.properties \
sun/util/resources/CurrencyNames_sv_SE.properties \
sun/util/resources/CurrencyNames_tr_TR.properties \
......
#
# 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
......
#
# 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
......@@ -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
......
......@@ -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
......
......@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2011b
tzdata2011d
......@@ -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
......
......@@ -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)
......
......@@ -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.
......
......@@ -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
......@@ -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
......
......@@ -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]
......
......@@ -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
......
......@@ -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
......
#
# 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 \
......
......@@ -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 \
......
#
# 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
此差异已折叠。
......@@ -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
......
#
# 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 \
......
......@@ -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);
}
}
return platformEncoding;
}
static jclass helperClass = NULL;
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);
static jclass
GetLauncherHelperClass(JNIEnv *env) {
if (helperClass == NULL) {
NULL_CHECK0(helperClass = FindBootStrapClass(env,
"sun/launcher/LauncherHelper"));
}
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;
}
......
......@@ -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 {
......
......@@ -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();
}
}
......
......@@ -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.
}
......
......@@ -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();
......
......@@ -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 {
......
......@@ -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
......
......@@ -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();
}
......
......@@ -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
......
......@@ -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
......
......@@ -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();
......
......@@ -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 {
......
......@@ -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();
}
});
}
......
......@@ -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();
......
......@@ -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);
......
......@@ -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.
......
......@@ -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();
......
......@@ -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() {
......
......@@ -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
*/
......
......@@ -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()) {
......
......@@ -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
......
......@@ -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,
......
......@@ -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>
......
......@@ -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;
}
......
......@@ -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),
......
......@@ -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
......
/*
* 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();
}
}
......@@ -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
*/
......
/*
* 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);
......
/*
* 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;
}
/**
......
......@@ -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();
......
/*
* 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. */
......
......@@ -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]);
}
}
}
......@@ -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.
......
/*
* Copyright (c) 2008, 2009, 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,10 +23,9 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import java.dyn.*;
import static sun.dyn.MethodHandleNatives.Constants.*;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
/**
* The flavor of method handle which emulates invokespecial or invokestatic.
......@@ -39,7 +38,7 @@ class DirectMethodHandle extends MethodHandle {
// Constructors in this class *must* be package scoped or private.
DirectMethodHandle(MethodType mtype, MemberName m, boolean doDispatch, Class<?> lookupClass) {
super(Access.TOKEN, mtype);
super(mtype);
assert(m.isMethod() || !doDispatch && m.isConstructor());
if (!m.isResolved())
......
/*
* 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,11 +23,11 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import java.dyn.*;
import java.lang.reflect.*;
import static sun.dyn.MemberName.newIllegalArgumentException;
import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
/**
* These adapters apply arbitrary conversions to arguments
......@@ -123,7 +123,7 @@ class FilterGeneric {
MethodType entryType = entryType(kind, pos, filterType, targetType);
if (entryType.generic() != entryType)
throw newIllegalArgumentException("must be generic: "+entryType);
MethodTypeImpl form = MethodTypeImpl.of(entryType);
MethodTypeForm form = entryType.form();
FilterGeneric filterGen = form.filterGeneric;
if (filterGen == null)
form.filterGeneric = filterGen = new FilterGeneric(entryType);
......@@ -186,7 +186,7 @@ class FilterGeneric {
// see if it has the required invoke method
MethodHandle entryPoint = null;
try {
entryPoint = MethodHandleImpl.IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
} catch (ReflectiveOperationException ex) {
}
if (entryPoint == null) continue;
......@@ -231,7 +231,7 @@ class FilterGeneric {
@Override
public String toString() {
return MethodHandleImpl.addTypeString(target, this);
return addTypeString(target, this);
}
protected boolean isPrototype() { return target == null; }
......@@ -246,7 +246,7 @@ class FilterGeneric {
protected Adapter(MethodHandle entryPoint,
MethodHandle filter, MethodHandle target) {
super(Access.TOKEN, entryPoint);
super(entryPoint);
this.filter = filter;
this.target = target;
}
......@@ -256,7 +256,7 @@ class FilterGeneric {
MethodHandle filter, MethodHandle target);
// { return new ThisType(entryPoint, filter, target); }
static private final String CLASS_PREFIX; // "sun.dyn.FilterGeneric$"
static private final String CLASS_PREFIX; // "java.lang.invoke.FilterGeneric$"
static {
String aname = Adapter.class.getName();
String sname = Adapter.class.getSimpleName();
......
/*
* 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,10 +23,10 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import java.dyn.*;
import static sun.dyn.MemberName.uncaughtException;
import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
/**
* Unary function composition, useful for many small plumbing jobs.
......@@ -36,7 +36,7 @@ import static sun.dyn.MemberName.uncaughtException;
* final method type is the responsibility of a JVM-level adapter.
* @author jrose
*/
public class FilterOneArgument extends BoundMethodHandle {
class FilterOneArgument extends BoundMethodHandle {
protected final MethodHandle filter; // Object -> Object
protected final MethodHandle target; // Object -> Object
......@@ -54,15 +54,15 @@ public class FilterOneArgument extends BoundMethodHandle {
static {
try {
INVOKE =
MethodHandleImpl.IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke",
MethodType.genericMethodType(1));
IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke",
MethodType.genericMethodType(1));
} catch (ReflectiveOperationException ex) {
throw uncaughtException(ex);
}
}
protected FilterOneArgument(MethodHandle filter, MethodHandle target) {
super(Access.TOKEN, INVOKE);
super(INVOKE);
this.filter = filter;
this.target = target;
}
......
......@@ -23,12 +23,13 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import java.dyn.*;
import sun.invoke.util.ValueConversions;
import sun.invoke.util.Wrapper;
import java.lang.reflect.*;
import sun.dyn.util.*;
import static sun.dyn.MethodTypeImpl.invokers;
import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
/**
* Adapters which mediate between incoming calls which are generic
......@@ -82,8 +83,8 @@ class FromGeneric {
}
// outgoing primitive arguments will be wrapped; unwrap them
MethodType primsAsObj = MethodTypeImpl.of(targetType).primArgsAsBoxes();
MethodType objArgsRawRet = MethodTypeImpl.of(primsAsObj).primsAsInts();
MethodType primsAsObj = targetType.form().primArgsAsBoxes();
MethodType objArgsRawRet = primsAsObj.form().primsAsInts();
if (objArgsRawRet != targetType)
ad = findAdapter(internalType0 = objArgsRawRet);
if (ad == null) {
......@@ -129,16 +130,16 @@ class FromGeneric {
MethodType targetType, MethodType internalType) {
// All the adapters we have here have reference-untyped internal calls.
assert(internalType == internalType.erase());
MethodHandle invoker = invokers(targetType).exactInvoker();
MethodHandle invoker = targetType.invokers().exactInvoker();
// cast all narrow reference types, unbox all primitive arguments:
MethodType fixArgsType = internalType.changeReturnType(targetType.returnType());
MethodHandle fixArgs = AdapterMethodHandle.convertArguments(Access.TOKEN,
MethodHandle fixArgs = MethodHandleImpl.convertArguments(
invoker, Invokers.invokerType(fixArgsType),
invoker.type(), null);
if (fixArgs == null)
throw new InternalError("bad fixArgs");
// reinterpret the calling sequence as raw:
MethodHandle retyper = AdapterMethodHandle.makeRetypeRaw(Access.TOKEN,
MethodHandle retyper = AdapterMethodHandle.makeRetypeRaw(
Invokers.invokerType(internalType), fixArgs);
if (retyper == null)
throw new InternalError("bad retyper");
......@@ -171,7 +172,7 @@ class FromGeneric {
/** Return the adapter information for this type's erasure. */
static FromGeneric of(MethodType type) {
MethodTypeImpl form = MethodTypeImpl.of(type);
MethodTypeForm form = type.form();
FromGeneric fromGen = form.fromGeneric;
if (fromGen == null)
form.fromGeneric = fromGen = new FromGeneric(form.erasedType());
......@@ -185,7 +186,7 @@ class FromGeneric {
/* Create an adapter that handles spreading calls for the given type. */
static Adapter findAdapter(MethodType internalType) {
MethodType entryType = internalType.generic();
MethodTypeImpl form = MethodTypeImpl.of(internalType);
MethodTypeForm form = internalType.form();
Class<?> rtype = internalType.returnType();
int argc = form.parameterCount();
int lac = form.longPrimitiveParameterCount();
......@@ -203,7 +204,7 @@ class FromGeneric {
// see if it has the required invoke method
MethodHandle entryPoint = null;
try {
entryPoint = MethodHandleImpl.IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
} catch (ReflectiveOperationException ex) {
}
if (entryPoint == null) continue;
......@@ -257,7 +258,7 @@ class FromGeneric {
@Override
public String toString() {
return MethodHandleImpl.addTypeString(target, this);
return addTypeString(target, this);
}
protected boolean isPrototype() { return target == null; }
......@@ -272,7 +273,7 @@ class FromGeneric {
protected Adapter(MethodHandle entryPoint,
MethodHandle invoker, MethodHandle convert, MethodHandle target) {
super(Access.TOKEN, entryPoint);
super(entryPoint);
this.invoker = invoker;
this.convert = convert;
this.target = target;
......@@ -290,7 +291,7 @@ class FromGeneric {
protected Object convert_F(float result) throws Throwable { return convert.invokeExact(result); }
protected Object convert_D(double result) throws Throwable { return convert.invokeExact(result); }
static private final String CLASS_PREFIX; // "sun.dyn.FromGeneric$"
static private final String CLASS_PREFIX; // "java.lang.invoke.FromGeneric$"
static {
String aname = Adapter.class.getName();
String sname = Adapter.class.getSimpleName();
......
/*
* 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,7 +23,7 @@
* questions.
*/
package java.dyn;
package java.lang.invoke;
/**
* This is a place-holder class. Some HotSpot implementations need to see it.
......
......@@ -23,15 +23,13 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import java.dyn.*;
import java.lang.reflect.*;
import sun.dyn.util.*;
import static sun.dyn.MethodTypeImpl.invokers;
import sun.invoke.util.*;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
/**
* Adapters which manage MethodHanndle.invokeGeneric calls.
* Adapters which manage MethodHandle.invokeGeneric calls.
* The JVM calls one of these when the exact type match fails.
* @author jrose
*/
......@@ -44,7 +42,8 @@ class InvokeGeneric {
/** Compute and cache information for this adapter, so that it can
* call out to targets of the erasure-family of the given erased type.
*/
private InvokeGeneric(MethodType erasedCallerType) throws ReflectiveOperationException {
/*non-public*/ InvokeGeneric(MethodType erasedCallerType) throws ReflectiveOperationException {
assert(erasedCallerType.equals(erasedCallerType.erase()));
this.erasedCallerType = erasedCallerType;
this.initialInvoker = makeInitialInvoker();
assert initialInvoker.type().equals(erasedCallerType
......@@ -53,22 +52,13 @@ class InvokeGeneric {
}
private static MethodHandles.Lookup lookup() {
return MethodHandleImpl.IMPL_LOOKUP;
return IMPL_LOOKUP;
}
/** Return the adapter information for this type's erasure. */
static MethodHandle genericInvokerOf(MethodType type) {
MethodTypeImpl form = MethodTypeImpl.of(type);
MethodHandle genericInvoker = form.genericInvoker;
if (genericInvoker == null) {
try {
InvokeGeneric gen = new InvokeGeneric(form.erasedType());
form.genericInvoker = genericInvoker = gen.initialInvoker;
} catch (ReflectiveOperationException ex) {
throw new RuntimeException(ex);
}
}
return genericInvoker;
/*non-public*/ static MethodHandle genericInvokerOf(MethodType erasedCallerType) throws ReflectiveOperationException {
InvokeGeneric gen = new InvokeGeneric(erasedCallerType);
return gen.initialInvoker;
}
private MethodHandle makeInitialInvoker() throws ReflectiveOperationException {
......@@ -88,7 +78,7 @@ class InvokeGeneric {
private MethodHandle makePostDispatchInvoker() {
// Take (MH'; MT, MH; A...) and run MH'(MT, MH; A...).
MethodType invokerType = erasedCallerType.insertParameterTypes(0, EXTRA_ARGS);
return invokers(invokerType).exactInvoker();
return invokerType.invokers().exactInvoker();
}
private MethodHandle dropDispatchArguments(MethodHandle targetInvoker) {
assert(targetInvoker.type().parameterType(0) == MethodHandle.class);
......@@ -112,7 +102,7 @@ class InvokeGeneric {
if (USE_AS_TYPE_PATH || target.isVarargsCollector()) {
MethodHandle newTarget = target.asType(callerType);
targetType = callerType;
Invokers invokers = MethodTypeImpl.invokers(Access.TOKEN, targetType);
Invokers invokers = targetType.invokers();
MethodHandle invoker = invokers.erasedInvokerWithDrops;
if (invoker == null) {
invokers.erasedInvokerWithDrops = invoker =
......
......@@ -23,16 +23,16 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import java.dyn.*;
import sun.dyn.empty.Empty;
import sun.invoke.empty.Empty;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
/**
* Construction and caching of often-used invokers.
* @author jrose
*/
public class Invokers {
class Invokers {
// exact type (sans leading taget MH) for the outgoing call
private final MethodType targetType;
......@@ -60,15 +60,15 @@ public class Invokers {
this.spreadInvokers = new MethodHandle[targetType.parameterCount()+1];
}
public static MethodType invokerType(MethodType targetType) {
/*non-public*/ static MethodType invokerType(MethodType targetType) {
return targetType.insertParameterTypes(0, MethodHandle.class);
}
public MethodHandle exactInvoker() {
/*non-public*/ MethodHandle exactInvoker() {
MethodHandle invoker = exactInvoker;
if (invoker != null) return invoker;
try {
invoker = MethodHandleImpl.IMPL_LOOKUP.findVirtual(MethodHandle.class, "invokeExact", targetType);
invoker = IMPL_LOOKUP.findVirtual(MethodHandle.class, "invokeExact", targetType);
} catch (ReflectiveOperationException ex) {
throw new InternalError("JVM cannot find invoker for "+targetType);
}
......@@ -77,7 +77,7 @@ public class Invokers {
return invoker;
}
public MethodHandle genericInvoker() {
/*non-public*/ MethodHandle genericInvoker() {
MethodHandle invoker1 = exactInvoker();
MethodHandle invoker = genericInvoker;
if (invoker != null) return invoker;
......@@ -87,7 +87,7 @@ public class Invokers {
return invoker;
}
public MethodHandle erasedInvoker() {
/*non-public*/ MethodHandle erasedInvoker() {
MethodHandle invoker1 = exactInvoker();
MethodHandle invoker = erasedInvoker;
if (invoker != null) return invoker;
......@@ -100,7 +100,7 @@ public class Invokers {
return invoker;
}
public MethodHandle spreadInvoker(int objectArgCount) {
/*non-public*/ MethodHandle spreadInvoker(int objectArgCount) {
MethodHandle vaInvoker = spreadInvokers[objectArgCount];
if (vaInvoker != null) return vaInvoker;
MethodHandle gInvoker = genericInvoker();
......@@ -111,12 +111,12 @@ public class Invokers {
private static MethodHandle THROW_UCS = null;
public MethodHandle uninitializedCallSite() {
/*non-public*/ MethodHandle uninitializedCallSite() {
MethodHandle invoker = uninitializedCallSite;
if (invoker != null) return invoker;
if (targetType.parameterCount() > 0) {
MethodType type0 = targetType.dropParameterTypes(0, targetType.parameterCount());
Invokers invokers0 = MethodTypeImpl.invokers(type0);
Invokers invokers0 = type0.invokers();
invoker = MethodHandles.dropArguments(invokers0.uninitializedCallSite(),
0, targetType.parameterList());
assert(invoker.type().equals(targetType));
......@@ -125,14 +125,14 @@ public class Invokers {
}
if (THROW_UCS == null) {
try {
THROW_UCS = MethodHandleImpl.IMPL_LOOKUP
THROW_UCS = IMPL_LOOKUP
.findStatic(CallSite.class, "uninitializedCallSite",
MethodType.methodType(Empty.class));
} catch (ReflectiveOperationException ex) {
throw new RuntimeException(ex);
}
}
invoker = AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, targetType, THROW_UCS);
invoker = AdapterMethodHandle.makeRetypeRaw(targetType, THROW_UCS);
assert(invoker.type().equals(targetType));
uninitializedCallSite = invoker;
return invoker;
......
......@@ -23,10 +23,9 @@
* questions.
*/
package sun.dyn;
package java.lang.invoke;
import sun.dyn.util.BytecodeDescriptor;
import java.dyn.*;
import sun.invoke.util.BytecodeDescriptor;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
......@@ -37,7 +36,8 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import static sun.dyn.MethodHandleNatives.Constants.*;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import static java.lang.invoke.MethodHandleStatics.*;
/**
* A {@code MemberName} is a compact symbolic datum which fully characterizes
......@@ -66,7 +66,7 @@ import static sun.dyn.MethodHandleNatives.Constants.*;
* and those seven fields omit much of the information in Method.
* @author jrose
*/
public final class MemberName implements Member, Cloneable {
/*non-public*/ final class MemberName implements Member, Cloneable {
private Class<?> clazz; // class in which the method is defined
private String name; // may be null if not yet materialized
private Object type; // may be null if not yet materialized
......@@ -435,7 +435,7 @@ public final class MemberName implements Member, Cloneable {
/** Query whether this member name is resolved to a non-static, non-final method.
*/
public boolean hasReceiverTypeDispatch() {
return (isMethod() && getVMIndex(Access.TOKEN) >= 0);
return (isMethod() && getVMIndex() >= 0);
}
/** Produce a string form of this member name.
......@@ -490,59 +490,38 @@ public final class MemberName implements Member, Cloneable {
// Queries to the JVM:
/** Document? */
public int getVMIndex(Access token) {
Access.check(token);
/*non-public*/ int getVMIndex() {
if (!isResolved())
throw newIllegalStateException("not resolved");
throw newIllegalStateException("not resolved", this);
return vmindex;
}
// public Object getVMTarget(Access token) {
// Access.check(token);
// /*non-public*/ Object getVMTarget() {
// if (!isResolved())
// throw newIllegalStateException("not resolved");
// throw newIllegalStateException("not resolved", this);
// return vmtarget;
// }
private RuntimeException newIllegalStateException(String message) {
return new IllegalStateException(message+": "+this);
}
// handy shared exception makers (they simplify the common case code)
public static RuntimeException newIllegalArgumentException(String message) {
return new IllegalArgumentException(message);
}
public static IllegalAccessException newNoAccessException(MemberName name, Object from) {
return newNoAccessException("cannot access", name, from);
}
public static IllegalAccessException newNoAccessException(String message,
MemberName name, Object from) {
message += ": " + name;
public IllegalAccessException makeAccessException(String message, Object from) {
message = message + ": "+ toString();
if (from != null) message += ", from " + from;
return new IllegalAccessException(message);
}
public static ReflectiveOperationException newNoAccessException(MemberName name) {
if (name.isResolved())
return new IllegalAccessException(name.toString());
else if (name.isConstructor())
return new NoSuchMethodException(name.toString());
else if (name.isMethod())
return new NoSuchMethodException(name.toString());
public ReflectiveOperationException makeAccessException(String message) {
message = message + ": "+ toString();
if (isResolved())
return new IllegalAccessException(message);
else if (isConstructor())
return new NoSuchMethodException(message);
else if (isMethod())
return new NoSuchMethodException(message);
else
return new NoSuchFieldException(name.toString());
}
public static Error uncaughtException(Exception ex) {
Error err = new InternalError("uncaught exception");
err.initCause(ex);
return err;
return new NoSuchFieldException(message);
}
/** Actually making a query requires an access check. */
public static Factory getFactory(Access token) {
Access.check(token);
/*non-public*/ static Factory getFactory() {
return Factory.INSTANCE;
}
public static Factory getFactory() {
return getFactory(Access.getToken());
}
/** A factory type for resolving member names with the help of the VM.
* TBD: Define access-safe public constructors for this factory.
*/
......@@ -662,7 +641,7 @@ public final class MemberName implements Member, Cloneable {
MemberName result = resolveOrNull(m, searchSupers, lookupClass);
if (result != null)
return result;
ReflectiveOperationException ex = newNoAccessException(m);
ReflectiveOperationException ex = m.makeAccessException("no access");
if (ex instanceof IllegalAccessException) throw (IllegalAccessException) ex;
throw nsmClass.cast(ex);
}
......
/*
* 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
* 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.lang.invoke;
/**
* This class consists exclusively of static names internal to the
* method handle implementation.
* Usage: {@code import static java.lang.invoke.MethodHandleStatics.*}
* @author John Rose, JSR 292 EG
*/
/*non-public*/ class MethodHandleStatics {
private MethodHandleStatics() { } // do not instantiate
/*non-public*/ static String getNameString(MethodHandle target, MethodType type) {
if (type == null)
type = target.type();
MemberName name = null;
if (target != null)
name = MethodHandleNatives.getMethodName(target);
if (name == null)
return "invoke" + type;
return name.getName() + type;
}
/*non-public*/ static String getNameString(MethodHandle target, MethodHandle typeHolder) {
return getNameString(target, typeHolder == null ? (MethodType) null : typeHolder.type());
}
/*non-public*/ static String getNameString(MethodHandle target) {
return getNameString(target, (MethodType) null);
}
/*non-public*/ static String addTypeString(Object obj, MethodHandle target) {
String str = String.valueOf(obj);
if (target == null) return str;
int paren = str.indexOf('(');
if (paren >= 0) str = str.substring(0, paren);
return str + target.type();
}
static void checkSpreadArgument(Object av, int n) {
if (av == null ? n != 0 : ((Object[])av).length != n)
throw newIllegalArgumentException("Array is not of length "+n);
}
// handy shared exception makers (they simplify the common case code)
/*non-public*/ static RuntimeException newIllegalStateException(String message) {
return new IllegalStateException(message);
}
/*non-public*/ static RuntimeException newIllegalStateException(String message, Object obj) {
return new IllegalStateException(message(message, obj));
}
/*non-public*/ static RuntimeException newIllegalArgumentException(String message) {
return new IllegalArgumentException(message);
}
/*non-public*/ static RuntimeException newIllegalArgumentException(String message, Object obj) {
return new IllegalArgumentException(message(message, obj));
}
/*non-public*/ static Error uncaughtException(Exception ex) {
Error err = new InternalError("uncaught exception");
err.initCause(ex);
return err;
}
private static String message(String message, Object obj) {
if (obj != null) message = message + ": " + obj;
return message;
}
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册