changeset 2343:a58071a38743

Bump to build 106. 2010-09-06 Andrew John Hughes <ahughes@redhat.com> Bump to b106. * ergo.c.in, * jvm.cfg.in: Removed. * patches/boot/icedtea-hotspot-default.patch: Split into test_gamma.patch and tools.jar.patch. * patches/hotspot/default/icedtea-shark-build.patch, * patches/hotspot/default/icedtea-shark.patch: Dropped, Shark now upstream. * patches/icedtea-doc-headers.patch: Dropped, documentation licensing has changed completely due to Sun->Oracle changes. * patches/icedtea-shark-build.patch: Dropped. * patches/xrender/icedtea-001.patch, * patches/xrender/icedtea-002.patch, * patches/xrender/icedtea-003.patch, * patches/xrender/icedtea-004.patch, * patches/xrender/icedtea-005.patch, * patches/xrender/icedtea-006.patch, * patches/xrender/icedtea-007.patch, * patches/xrender/icedtea-008.patch, * patches/xrender/icedtea-009.patch: Dropped, XRender extension now upstream. * ports/hotspot/make/linux/makefiles/shark.make, * ports/hotspot/make/linux/platform_zero.in, * ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp, * ports/hotspot/src/share/vm/includeDB_shark, * ports/hotspot/src/share/vm/shark/llvmHeaders.hpp, * ports/hotspot/src/share/vm/shark/llvmValue.hpp, * ports/hotspot/src/share/vm/shark/sharkBlock.cpp, * ports/hotspot/src/share/vm/shark/sharkBlock.hpp, * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp, * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp, * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp, * ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp, * ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp, * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp, * ports/hotspot/src/share/vm/shark/sharkCompiler.hpp, * ports/hotspot/src/share/vm/shark/sharkConstant.cpp, * ports/hotspot/src/share/vm/shark/sharkConstant.hpp, * ports/hotspot/src/share/vm/shark/sharkContext.cpp, * ports/hotspot/src/share/vm/shark/sharkContext.hpp, * ports/hotspot/src/share/vm/shark/sharkEntry.hpp, * ports/hotspot/src/share/vm/shark/sharkFunction.cpp, * ports/hotspot/src/share/vm/shark/sharkFunction.hpp, * ports/hotspot/src/share/vm/shark/sharkInliner.cpp, * ports/hotspot/src/share/vm/shark/sharkInliner.hpp, * ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp, * ports/hotspot/src/share/vm/shark/sharkIntrinsics.hpp, * ports/hotspot/src/share/vm/shark/sharkInvariants.cpp, * ports/hotspot/src/share/vm/shark/sharkInvariants.hpp, * ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp, * ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp, * ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp, * ports/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp, * ports/hotspot/src/share/vm/shark/sharkRuntime.cpp, * ports/hotspot/src/share/vm/shark/sharkRuntime.hpp, * ports/hotspot/src/share/vm/shark/sharkStack.cpp, * ports/hotspot/src/share/vm/shark/sharkStack.hpp, * ports/hotspot/src/share/vm/shark/sharkState.cpp, * ports/hotspot/src/share/vm/shark/sharkState.hpp, * ports/hotspot/src/share/vm/shark/sharkStateScanner.cpp, * ports/hotspot/src/share/vm/shark/sharkStateScanner.hpp, * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp, * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp, * ports/hotspot/src/share/vm/shark/sharkType.hpp, * ports/hotspot/src/share/vm/shark/sharkValue.cpp, * ports/hotspot/src/share/vm/shark/sharkValue.hpp, * ports/hotspot/src/share/vm/shark/shark_globals.cpp, * ports/hotspot/src/share/vm/shark/shark_globals.hpp: Dropped, Shark now upstream. * Makefile.am: Bump to b106 changesets and new JAXWS and JAXP drops. (JAF_DROP_URL): Added to make JAF independent of JAXWS. (ICEDTEA_BOOTSTRAP_CLASSES): Add additional classes needed to bootstrap; java.nio.file.SimpleFileVisitor and javax.management.modelmbean.ModelMBeanInfo. (ICEDTEA_PATCHES): Drop upstream patches. (XRENDER_PATCHES): Removed. (ICEDTEA_BOOT_PATCHES): Add new bootstrap patches. (ICEDTEA_SHARK_BUILD): Set to 'true' not 'yes' for upstream Shark. (ICEDTEA_ENV): Pass SHARK_BUILD not ICEDTEA_SHARK_BUILD for upstream Shark. (download-jaf-drop): Use JAF_DROP_URL instead of JAXWS_DROP_URL. (ports): Removed. (clean-ports): Likewise. (generated): Depend on extract, not ports. (clean-extract-openjdk): Don't call clean-ports. (bootstrap-directory-stage1): Create lib/modules directory. (hotspot-ports): Removed. * acinclude.m4: Don't generate jvm.cfg and ergo.c. * configure.ac: Drop --enable-xrender option. * generated/java/lang/UNIXProcess.java: Updated, including ProcessBuilder workaround. * patches/boot/break-processbuilder-dependency.patch: Prevent UNIXProcess having a dependency on package-private classes in java.lang.ProcessBuilder which only exist in Oracle's implementation. * patches/boot/ecj-diamond.patch: Add new cases of <> usage. * patches/boot/icedtea-jaxp-dependency.patch: Regenerated. * patches/boot/revert-6973616.patch: Revert 1.6 requirement introduced by 6973616. * patches/boot/symbols.patch: Regenerated. * patches/boot/test_gamma.patch: Split from icedtea-hotspot-default.patch. * patches/boot/tools.jar.patch: Likewise, and regenerated due to addition of module directory test. * patches/hotspot/default/icedtea-gcc-suffix.patch, * patches/icedtea-alpha-fixes.patch, * patches/icedtea-clean-crypto.patch, * patches/icedtea-demos.patch, * patches/icedtea-freetypeversion.patch, * patches/icedtea-javafiles.patch, * patches/icedtea-linker-libs-order.patch, * patches/icedtea-print-lsb-release.patch, * patches/icedtea-rhino.patch, * patches/icedtea-sunsrc.patch, * patches/icedtea-systemtap.patch, * patches/icedtea-testenv.patch: * patches/sh4-support.patch: Regenerated. * patches/systemtap-alloc-size-workaround.patch: Patch not added by previous commit.
author Andrew John Hughes <ahughes@redhat.com>
date Mon, 06 Sep 2010 23:52:04 +0100
parents 90b892525f1b
children 6ec76d7f5601
files ChangeLog Makefile.am acinclude.m4 configure.ac ergo.c.in generated/java/lang/UNIXProcess.java jvm.cfg.in patches/boot/break-processbuilder-dependency.patch patches/boot/ecj-diamond.patch patches/boot/icedtea-hotspot-default.patch patches/boot/icedtea-jaxp-dependency.patch patches/boot/revert-6973616.patch patches/boot/symbols.patch patches/boot/test_gamma.patch patches/boot/tools.jar.patch patches/hotspot/default/icedtea-gcc-suffix.patch patches/hotspot/default/icedtea-shark-build.patch patches/hotspot/default/icedtea-shark.patch patches/icedtea-alpha-fixes.patch patches/icedtea-clean-crypto.patch patches/icedtea-demos.patch patches/icedtea-doc-headers.patch patches/icedtea-freetypeversion.patch patches/icedtea-javafiles.patch patches/icedtea-linker-libs-order.patch patches/icedtea-print-lsb-release.patch patches/icedtea-rhino.patch patches/icedtea-shark-build.patch patches/icedtea-sunsrc.patch patches/icedtea-systemtap.patch patches/icedtea-testenv.patch patches/sh4-support.patch patches/systemtap-alloc-size-workaround.patch patches/xrender/icedtea-001.patch patches/xrender/icedtea-002.patch patches/xrender/icedtea-003.patch patches/xrender/icedtea-004.patch patches/xrender/icedtea-005.patch patches/xrender/icedtea-006.patch patches/xrender/icedtea-007.patch patches/xrender/icedtea-008.patch patches/xrender/icedtea-009.patch ports/hotspot/make/linux/makefiles/shark.make ports/hotspot/make/linux/platform_zero.in ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp ports/hotspot/src/share/vm/includeDB_shark ports/hotspot/src/share/vm/shark/llvmHeaders.hpp ports/hotspot/src/share/vm/shark/llvmValue.hpp ports/hotspot/src/share/vm/shark/sharkBlock.cpp ports/hotspot/src/share/vm/shark/sharkBlock.hpp ports/hotspot/src/share/vm/shark/sharkBuilder.cpp ports/hotspot/src/share/vm/shark/sharkBuilder.hpp ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp ports/hotspot/src/share/vm/shark/sharkCompiler.cpp ports/hotspot/src/share/vm/shark/sharkCompiler.hpp ports/hotspot/src/share/vm/shark/sharkConstant.cpp ports/hotspot/src/share/vm/shark/sharkConstant.hpp ports/hotspot/src/share/vm/shark/sharkContext.cpp ports/hotspot/src/share/vm/shark/sharkContext.hpp ports/hotspot/src/share/vm/shark/sharkEntry.hpp ports/hotspot/src/share/vm/shark/sharkFunction.cpp ports/hotspot/src/share/vm/shark/sharkFunction.hpp ports/hotspot/src/share/vm/shark/sharkInliner.cpp ports/hotspot/src/share/vm/shark/sharkInliner.hpp ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp ports/hotspot/src/share/vm/shark/sharkIntrinsics.hpp ports/hotspot/src/share/vm/shark/sharkInvariants.cpp ports/hotspot/src/share/vm/shark/sharkInvariants.hpp ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp ports/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp ports/hotspot/src/share/vm/shark/sharkRuntime.cpp ports/hotspot/src/share/vm/shark/sharkRuntime.hpp ports/hotspot/src/share/vm/shark/sharkStack.cpp ports/hotspot/src/share/vm/shark/sharkStack.hpp ports/hotspot/src/share/vm/shark/sharkState.cpp ports/hotspot/src/share/vm/shark/sharkState.hpp ports/hotspot/src/share/vm/shark/sharkStateScanner.cpp ports/hotspot/src/share/vm/shark/sharkStateScanner.hpp ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp ports/hotspot/src/share/vm/shark/sharkType.hpp ports/hotspot/src/share/vm/shark/sharkValue.cpp ports/hotspot/src/share/vm/shark/sharkValue.hpp ports/hotspot/src/share/vm/shark/shark_globals.cpp ports/hotspot/src/share/vm/shark/shark_globals.hpp
diffstat 89 files changed, 918 insertions(+), 25822 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Aug 05 14:12:08 2010 +0200
+++ b/ChangeLog	Mon Sep 06 23:52:04 2010 +0100
@@ -1,3 +1,127 @@
+2010-09-06  Andrew John Hughes  <ahughes@redhat.com>
+
+	Bump to b106.
+	* ergo.c.in,
+	* jvm.cfg.in: Removed.
+	* patches/boot/icedtea-hotspot-default.patch: Split
+	into test_gamma.patch and tools.jar.patch.
+	* patches/hotspot/default/icedtea-shark-build.patch,
+	* patches/hotspot/default/icedtea-shark.patch:
+	Dropped, Shark now upstream.
+	* patches/icedtea-doc-headers.patch: Dropped,
+	documentation licensing has changed completely due
+	to Sun->Oracle changes.
+	* patches/icedtea-shark-build.patch: Dropped.
+	* patches/xrender/icedtea-001.patch,
+	* patches/xrender/icedtea-002.patch,
+	* patches/xrender/icedtea-003.patch,
+	* patches/xrender/icedtea-004.patch,
+	* patches/xrender/icedtea-005.patch,
+	* patches/xrender/icedtea-006.patch,
+	* patches/xrender/icedtea-007.patch,
+	* patches/xrender/icedtea-008.patch,
+	* patches/xrender/icedtea-009.patch:
+	Dropped, XRender extension now upstream.
+	* ports/hotspot/make/linux/makefiles/shark.make,
+	* ports/hotspot/make/linux/platform_zero.in,
+	* ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp,
+	* ports/hotspot/src/share/vm/includeDB_shark,
+	* ports/hotspot/src/share/vm/shark/llvmHeaders.hpp,
+	* ports/hotspot/src/share/vm/shark/llvmValue.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkBlock.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkBlock.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkCompiler.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkCompiler.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkConstant.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkConstant.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkContext.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkContext.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkEntry.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkFunction.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkFunction.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkInliner.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkInliner.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkIntrinsics.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkInvariants.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkInvariants.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkRuntime.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkRuntime.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkStack.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkStack.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkState.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkState.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkStateScanner.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkStateScanner.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkType.hpp,
+	* ports/hotspot/src/share/vm/shark/sharkValue.cpp,
+	* ports/hotspot/src/share/vm/shark/sharkValue.hpp,
+	* ports/hotspot/src/share/vm/shark/shark_globals.cpp,
+	* ports/hotspot/src/share/vm/shark/shark_globals.hpp:
+	Dropped, Shark now upstream.
+	* Makefile.am:
+	Bump to b106 changesets and new JAXWS and JAXP drops.
+	(JAF_DROP_URL): Added to make JAF independent of JAXWS.
+	(ICEDTEA_BOOTSTRAP_CLASSES): Add additional classes
+	needed to bootstrap; java.nio.file.SimpleFileVisitor
+	and javax.management.modelmbean.ModelMBeanInfo.
+	(ICEDTEA_PATCHES): Drop upstream patches.
+	(XRENDER_PATCHES): Removed.
+	(ICEDTEA_BOOT_PATCHES): Add new bootstrap patches.
+	(ICEDTEA_SHARK_BUILD): Set to 'true' not 'yes' for
+	upstream Shark.
+	(ICEDTEA_ENV): Pass SHARK_BUILD not ICEDTEA_SHARK_BUILD
+	for upstream Shark.
+	(download-jaf-drop): Use JAF_DROP_URL instead of JAXWS_DROP_URL.
+	(ports): Removed.
+	(clean-ports): Likewise.
+	(generated): Depend on extract, not ports.
+	(clean-extract-openjdk): Don't call clean-ports.
+	(bootstrap-directory-stage1): Create lib/modules directory.
+	(hotspot-ports): Removed.
+	* acinclude.m4: Don't generate jvm.cfg and ergo.c.
+	* configure.ac: Drop --enable-xrender option.
+	* generated/java/lang/UNIXProcess.java: Updated, including
+	ProcessBuilder workaround.
+	* patches/boot/break-processbuilder-dependency.patch:
+	Prevent UNIXProcess having a dependency on package-private
+	classes in java.lang.ProcessBuilder which only exist in
+	Oracle's implementation.
+	* patches/boot/ecj-diamond.patch: Add new cases of <> usage.
+	* patches/boot/icedtea-jaxp-dependency.patch: Regenerated.
+	* patches/boot/revert-6973616.patch: Revert 1.6 requirement
+	introduced by 6973616.
+	* patches/boot/symbols.patch: Regenerated.
+	* patches/boot/test_gamma.patch: Split from icedtea-hotspot-default.patch.
+	* patches/boot/tools.jar.patch: Likewise, and regenerated
+	due to addition of module directory test.
+	* patches/hotspot/default/icedtea-gcc-suffix.patch,
+	* patches/icedtea-alpha-fixes.patch,
+	* patches/icedtea-clean-crypto.patch,
+	* patches/icedtea-demos.patch,
+	* patches/icedtea-freetypeversion.patch,
+	* patches/icedtea-javafiles.patch,
+	* patches/icedtea-linker-libs-order.patch,
+	* patches/icedtea-print-lsb-release.patch,
+	* patches/icedtea-rhino.patch,
+	* patches/icedtea-sunsrc.patch,
+	* patches/icedtea-systemtap.patch,
+	* patches/icedtea-testenv.patch:
+	* patches/sh4-support.patch: Regenerated.
+	* patches/systemtap-alloc-size-workaround.patch:
+	Patch not added by previous commit.
+
 2010-08-05  Xerxes Rånby  <xerxes@zafena.se>
 
 	* NEWS: Updated with correct suffix for the
@@ -22,7 +146,7 @@
 2010-08-05  Xerxes Rånby  <xerxes@zafena.se>
 
 	* NEWS: Updated for Shark OSR fix.
- 
+
 2010-08-05  Xerxes Rånby  <xerxes@zafena.se>
 
 	* ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp
--- a/Makefile.am	Thu Aug 05 14:12:08 2010 +0200
+++ b/Makefile.am	Mon Sep 06 23:52:04 2010 +0100
@@ -1,22 +1,22 @@
 # Dependencies
 
-OPENJDK_VERSION = b89
+OPENJDK_VERSION = b106
 
-CORBA_CHANGESET = e805b4155d76
-HOTSPOT_CHANGESET = a393ff93e7e5
-JAXP_CHANGESET  = 826bafcb6c4a
-JAXWS_CHANGESET = 1661166c82dc
-JDK_CHANGESET = 2017795af50a
-LANGTOOLS_CHANGESET = 681f1f51926f
-OPENJDK_CHANGESET = 195fcceefddc
+CORBA_CHANGESET = 00a2834117ff
+HOTSPOT_CHANGESET = a30c85eed5d5
+JAXP_CHANGESET  = 679653c22ae1
+JAXWS_CHANGESET = 191a3ec51d79
+JDK_CHANGESET = a094068f4c7b
+LANGTOOLS_CHANGESET = 68035813467d
+OPENJDK_CHANGESET = b79fce47b7c6
 
-CORBA_SHA256SUM = 870e2eac993a4eef48197ed7309cab176b56a994add1de215a026599052627cb
-HOTSPOT_SHA256SUM = 995d64e272ecde0e00b69e36371bc7f8a82638c1f598c956f98e10538e41d695
-JAXP_SHA256SUM = 42d004e51a1f01d146ad230ce48996ddf8da3719fe571a41653f431d6b2e8a7b
-JAXWS_SHA256SUM = 4523909cd46fd61b5c6670bf932099d5899236a37a4058e7b2bcb855e503a0e4
-JDK_SHA256SUM = 1efc1939a8fae211752369b710d2c549cbc8ec74de4724c2898e772bdba98a3c
-LANGTOOLS_SHA256SUM = 5ff6f2a6d15403ed8d948a07204904f6ce60e363bd0516e22f1cae830aba84f8
-OPENJDK_SHA256SUM = 93c536e6bc4e962050a00321e88e694fc4e0000e2ad887b8de22830bfda2649f
+CORBA_SHA256SUM = 5648b189c94df46bbec9bc7c8640957befffbde68ff7ef9f8f8de9bd7fbe8e7d
+HOTSPOT_SHA256SUM = 93f71928d061f86f6a18f224f92ac217ea4dcc324183b029ece9a862c445714d
+JAXP_SHA256SUM = c7d58a5dd2859ccb8b2d0897a26ce9b37895f530a94a5912179afc25cc1d14ea
+JAXWS_SHA256SUM = 6fd65fd23c085c9c89f904da1b6448460af32d97d76bb0ba49630ee61d70a4d6
+JDK_SHA256SUM = 8b20e0686667a03cf028d57695b4bc2196c51db2d9c0873db7694624c384c446
+LANGTOOLS_SHA256SUM = 81b48f5f5782e62b0555735be24e294d3274c48fa1e027a63eb005465a505385
+OPENJDK_SHA256SUM = edb332586e2442bdbd4eed19c059535ade56dba5b436257031a0e5e827b89f12
 
 CACAO_VERSION = 66e762d869dd
 CACAO_SHA256SUM = 9a558ffb69479f2d31995bdeb90cd2abc616050e76a6be7263c72e2e302ca4e6
@@ -24,14 +24,15 @@
 CACAO_URL = $(CACAO_BASE_URL)/$(CACAO_VERSION).tar.bz2
 CACAO_SRC_ZIP = cacao-$(CACAO_VERSION).tar.bz2
 
-JAXWS_DROP_URL = http://kenai.com/projects/jdk7-drops/downloads/download
-JAXWS_DROP_ZIP = jdk7-jaxws-2009_09_28.zip
-JAXWS_DROP_SHA256SUM = 272756b999e9ae2435da8d58e259562e61126e1c5b1f9421fe65423217cef8fd
+JAXWS_DROP_URL = https://jax-ws.dev.java.net/files/documents/4202/150896
+JAXWS_DROP_ZIP = jdk7-jaxws-b100.zip
+JAXWS_DROP_SHA256SUM = 06e5f564430954211322fca353b0b8d916ffa8ae051412b7d9b5a5398090d887
+JAF_DROP_URL = http://kenai.com/projects/jdk7-drops/downloads/download
 JAF_DROP_ZIP = jdk7-jaf-2009_08_28.zip
 JAF_DROP_SHA256SUM = 8c81940b3017c0058367d7e7453123442f2cdd77c2bfe74acd9035f97e4db8e8
-JAXP_DROP_URL = https://jaxp.dev.java.net/files/documents/913/147490
-JAXP_DROP_ZIP = jdk7-jaxp-m6.zip
-JAXP_DROP_SHA256SUM = 3d9eb7ae71f5365e2a786ba270413c6cb7dc8d1137f56995c087908b3df8446c
+JAXP_DROP_URL = https://jaxp.dev.java.net/files/documents/913/150785
+JAXP_DROP_ZIP = jdk7-jaxp-m7.zip
+JAXP_DROP_SHA256SUM = d097627d4059d488c5a09d4e33cec275a193d4d8bc0fea8ef4f1337170904156
 
 ICEDTEA_HG_URL = http://hg.openjdk.java.net/icedtea/jdk7
 OPENJDK_HG_URL = http://hg.openjdk.java.net/jdk7/jdk7
@@ -151,6 +152,8 @@
 ICEDTEA_BOOTSTRAP_CLASSES = \
 	$(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java \
 	$(SHARE)/javax/management/StandardMBean.java \
+	$(SHARE)/java/nio/file/SimpleFileVisitor.java \
+	$(SHARE)/javax/management/modelmbean/ModelMBeanInfo.java \
 	$(NETX_BOOTSTRAP_CLASSES)
 
 endif
@@ -303,8 +306,6 @@
 	patches/hotspot/$(HSBUILD)/icedtea-sparc-ptracefix.patch \
 	patches/hotspot/$(HSBUILD)/icedtea-sparc-trapsfix.patch \
 	patches/icedtea-override-redirect-metacity.patch \
-	patches/icedtea-shark-build.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-shark-build.patch \
 	patches/icedtea-security-updates.patch \
 	patches/icedtea-hotspot-gcc-pr36917.patch \
 	patches/icedtea-alpha-fixes.patch \
@@ -313,7 +314,6 @@
 	patches/hotspot/$(HSBUILD)/icedtea-use-idx_t.patch \
 	patches/hotspot/$(HSBUILD)/icedtea-params-cast-size_t.patch \
 	patches/icedtea-clean-crypto.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-shark.patch \
 	$(GCC_PATCH) \
 	patches/cacao/arch.patch \
 	patches/icedtea-signed-types.patch \
@@ -324,7 +324,6 @@
 	patches/icedtea-testenv.patch \
 	patches/icedtea-samejvm-safe.patch \
 	patches/icedtea-pr261.patch \
-	patches/icedtea-doc-headers.patch \
 	patches/hotspot/$(HSBUILD)/icedtea-parisc-opt.patch \
         patches/security/icedtea-6592792.patch \
         patches/security/icedtea-6733959.patch \
@@ -369,14 +368,6 @@
 	patches/icedtea-pulse-soundproperties.patch
 endif
 
-if ENABLE_XRENDER
-# match against $(abs_top_srcdir) and then remove it again,
-# because stamps/patch.stamp target will also add it
-XRENDER_PATCHES = patches/xrender/icedtea-???.patch
-XRENDER_PATCH_FILES = $(sort $(wildcard $(abs_top_srcdir)/$(XRENDER_PATCHES)))
-ICEDTEA_PATCHES += $(sort $(subst $(abs_top_srcdir)/,,$(XRENDER_PATCH_FILES)))
-endif
-
 if !USE_CVMI
 ICEDTEA_PATCHES += \
 	patches/icedtea-javafiles.patch
@@ -420,12 +411,15 @@
 	patches/boot/javah.patch \
 	patches/boot/symbols.patch \
 	patches/boot/tobin.patch \
-	patches/boot/icedtea-hotspot-$(HSBUILD).patch \
+	patches/boot/test_gamma.patch \
+	patches/boot/tools.jar.patch \
 	patches/boot/icedtea-jopt.patch \
 	patches/boot/icedtea-dyn.patch \
 	patches/boot/icedtea-jaxp-dependency.patch \
 	patches/boot/genstubs-nofork.patch \
-	patches/boot/getannotation-cast.patch
+	patches/boot/getannotation-cast.patch \
+	patches/boot/break-processbuilder-dependency.patch \
+	patches/boot/revert-6973616.patch
 
 if CP39408_JAVAH
 ICEDTEA_BOOT_PATCHES += patches/boot/icedtea-pr39408.patch
@@ -468,13 +462,9 @@
 # OpenJDK build environment.
 if ZERO_BUILD
   ICEDTEA_ZERO_BUILD = true
-else
-  ICEDTEA_ZERO_BUILD =
 endif
 if SHARK_BUILD
-  ICEDTEA_SHARK_BUILD = yes
-else
-  ICEDTEA_SHARK_BUILD =
+  ICEDTEA_SHARK_BUILD = true
 endif
 
 JDK_UPDATE_VERSION = $(shell echo $(OPENJDK_VERSION) | sed -e "s/^b//")
@@ -507,7 +497,7 @@
 	CLASSPATH="" \
 	LD_LIBRARY_PATH="" \
 	ZERO_BUILD="$(ICEDTEA_ZERO_BUILD)" \
-	ICEDTEA_SHARK_BUILD="$(ICEDTEA_SHARK_BUILD)" \
+	SHARK_BUILD="$(ICEDTEA_SHARK_BUILD)" \
 	ZERO_LIBARCH="$(ZERO_LIBARCH)" \
 	ARCH_DATA_MODEL="$(ZERO_BITSPERWORD)" \
 	ZERO_ENDIANNESS="$(ZERO_ENDIANNESS)" \
@@ -898,7 +888,7 @@
 	  then \
 	    mv drops/$(JAF_DROP_ZIP) drops/$(JAF_DROP_ZIP).old ; \
 	  fi ; \
-	  $(WGET) $(JAXWS_DROP_URL)/$(JAF_DROP_ZIP) -O drops/$(JAF_DROP_ZIP); \
+	  $(WGET) $(JAF_DROP_URL)/$(JAF_DROP_ZIP) -O drops/$(JAF_DROP_ZIP); \
 	  if ! echo "$(JAF_DROP_SHA256SUM)  drops/$(JAF_DROP_ZIP)" \
 	    | $(SHA256SUM) --check ; \
 	  then echo "ERROR: Bad download of jaf drop zip"; false; \
@@ -1269,7 +1259,7 @@
 	touch $@
 
 clean-extract-openjdk: clean-overlay clean-versioning \
- clean-ports clean-patch-fsg
+ clean-patch-fsg
 	rm -rf openjdk
 	rm -f stamps/extract-openjdk.stamp
 
@@ -1315,39 +1305,7 @@
 	mkdir -p stamps
 	rm -f stamps/extract-jaxws.stamp
 
-# Link ports sources into tree
-stamps/ports.stamp: stamps/extract.stamp
-	for target in $(abs_top_srcdir)/ports/hotspot/make/*/platform_zero.in \
-		      $(abs_top_srcdir)/ports/hotspot/make/*/makefiles/* \
-		      $(abs_top_srcdir)/ports/hotspot/src/cpu/zero/vm/* \
-		      $(abs_top_srcdir)/ports/hotspot/src/share/vm/*; do \
-	  link=$$(dirname $$target | sed 's/^.*ports/openjdk/'); \
-	  ln -sfv $$target $$link; \
-	done
-	if ! test "x$(WITH_CACAO)" = "xno" ; then \
-	  mkdir -p openjdk/jdk/src/solaris/bin/$(BUILD_ARCH_DIR) ; \
-	  ln -sf $(abs_top_builddir)/jvm.cfg \
-	    openjdk/jdk/src/solaris/bin/$(BUILD_ARCH_DIR)/jvm.cfg ; \
-	fi
-	if ! test "x$(WITH_CACAO)" = "xno"; then \
-	  ln -sf $(abs_top_builddir)/ergo.c \
-	    openjdk/jdk/src/solaris/bin/ergo_$(BUILD_ARCH_DIR).c; \
-	fi
-	mkdir -p stamps
-	touch $@
-
-clean-ports:
-	for target in $(abs_top_srcdir)/ports/hotspot/make/*/makefiles/* \
-		      $(abs_top_srcdir)/ports/hotspot/src/cpu/zero/vm/* \
-		      $(abs_top_srcdir)/ports/hotspot/src/share/vm/*; do \
-	  link=$$(echo $$target | sed 's/^.*ports/openjdk/'|sed "s#hotspot/build#hotspot/make#"); \
-	  rm -rf $$link; \
-	done
-	rm -f openjdk/jdk/src/solaris/bin/$(BUILD_ARCH_DIR)/jvm.cfg
-	rm -f openjdk/jdk/src/solaris/bin/ergo_$(BUILD_ARCH_DIR).c 
-	rm -f stamps/ports.stamp
-
-stamps/generated.stamp: stamps/ports.stamp
+stamps/generated.stamp: stamps/extract.stamp
 	set -e ; \
 	if [ ! -e $(abs_top_builddir)/generated.build ]; then \
 	  cp -pPR $(abs_top_srcdir)/generated $(abs_top_builddir)/generated.build; \
@@ -1696,6 +1654,7 @@
 	ln -sf $(XALAN2_SERIALIZER_JAR) \
 	  $(STAGE1_BOOT_DIR)/lib/endorsed/xalan-j2-serializer.jar && \
 	ln -sf $(XERCES2_JAR) $(STAGE1_BOOT_DIR)/lib/endorsed/xerces-j2.jar
+	mkdir -p $(STAGE1_BOOT_DIR)/lib/modules
 	mkdir -p $(STAGE1_BOOT_DIR)/jre/lib && \
 	cp $(SYSTEM_JDK_DIR)/jre/lib/rt.jar \
 	  $(STAGE1_BOOT_DIR)/jre/lib/rt.jar && \
@@ -2620,8 +2579,6 @@
 
 generated: stamps/generated.stamp
 
-hotspot-ports: stamps/ports.stamp
-
 icedtea: stamps/icedtea.stamp
 
 icedtea-boot: stamps/icedtea-boot.stamp
--- a/acinclude.m4	Thu Aug 05 14:12:08 2010 +0200
+++ b/acinclude.m4	Mon Sep 06 23:52:04 2010 +0100
@@ -760,8 +760,6 @@
   AC_SUBST(ZERO_BITSPERWORD)
   AC_SUBST(ZERO_ENDIANNESS)
   AC_SUBST(ZERO_ARCHDEF)
-  AC_CONFIG_FILES([jvm.cfg])
-  AC_CONFIG_FILES([ergo.c])
 ])
 
 AC_DEFUN([SET_SHARK_BUILD],
--- a/configure.ac	Thu Aug 05 14:12:08 2010 +0200
+++ b/configure.ac	Mon Sep 06 23:52:04 2010 +0100
@@ -79,14 +79,6 @@
 AM_CONDITIONAL([ENABLE_DOCS], [test x$ENABLE_DOCS = xyes])
 AC_MSG_RESULT(${ENABLE_DOCS})
 
-AC_MSG_CHECKING([whether to include the XRender pipeline])
-AC_ARG_ENABLE([xrender],
-	      [AS_HELP_STRING([--disable-xrender],
-	      		      [Disable inclusion of xrender pipeline])],
-	      [ENABLE_XRENDER="${enableval}"], [ENABLE_XRENDER='yes'])
-AM_CONDITIONAL([ENABLE_XRENDER], [test x$ENABLE_XRENDER = xyes])
-AC_MSG_RESULT(${ENABLE_XRENDER})
-
 AC_MSG_CHECKING([whether to include SystemTap tracing support])
 AC_ARG_ENABLE([systemtap],
 	      [AS_HELP_STRING([--enable-systemtap],
--- a/ergo.c.in	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright 1998-2007 Sun Microsystems, Inc.  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.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-#include "ergo.h"
-
-
-/* Methods for solaris-sparc and linux-sparc: these are easy. */
-
-/* Ask the OS how many processors there are. */
-static unsigned long 
-physical_processors(void) {
-  const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-
-  JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
-  return sys_processors;
-}
-
-/* The sparc version of the "server-class" predicate. */
-jboolean
-ServerClassMachineImpl(void) {
-  jboolean            result            = JNI_FALSE;
-  /* How big is a server class machine? */
-  const unsigned long server_processors = 2UL;
-  const uint64_t      server_memory     = 2UL * GB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= server_memory) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  JLI_TraceLauncher("unix_" LIBARCHNAME "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
-  return result;
-}
--- a/generated/java/lang/UNIXProcess.java	Thu Aug 05 14:12:08 2010 +0200
+++ b/generated/java/lang/UNIXProcess.java	Mon Sep 06 23:52:04 2010 +0100
@@ -1,12 +1,12 @@
 /*
- * Copyright 1995-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
+ * published by the Free Software Foundation.  Oracle designates this
  * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
+ * 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
@@ -18,32 +18,75 @@
  * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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;
 
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadFactory;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 
-/* java.lang.Process subclass in the UNIX environment.
+/**
+ * java.lang.Process subclass in the UNIX environment.
  *
  * @author Mario Wolczko and Ross Knippel.
  * @author Konstantin Kladko (ported to Linux)
+ * @author Martin Buchholz
  */
-
 final class UNIXProcess extends Process {
     private static final sun.misc.JavaIOFileDescriptorAccess fdAccess
         = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess();
 
-    private int pid;
+    private final int pid;
     private int exitcode;
     private boolean hasExited;
 
-    private OutputStream stdin_stream;
-    private InputStream  stdout_stream;
-    private InputStream  stderr_stream;
+    private /* final */ OutputStream stdin;
+    private /* final */ InputStream  stdout;
+    private /* final */ InputStream  stderr;
+
+    /**
+     * Required package-private classes taken from
+     * Oracle's java.lang.ProcessBuilder for bootstrapping.
+     */
+
+    /**
+     * Implements a <a href="#redirect-output">null input stream</a>.
+     */
+    static class NullInputStream extends InputStream {
+        static final NullInputStream INSTANCE = new NullInputStream();
+        private NullInputStream() {}
+        public int read()      { return -1; }
+        public int available() { return 0; }
+    }
+
+    /**
+     * Implements a <a href="#redirect-input">null output stream</a>.
+     */
+    static class NullOutputStream extends OutputStream {
+        static final NullOutputStream INSTANCE = new NullOutputStream();
+        private NullOutputStream() {}
+        public void write(int b) throws IOException {
+            throw new IOException("Stream closed");
+        }
+    }
 
     /* this is for the reaping thread */
     private native int waitForProcessExit(int pid);
@@ -51,155 +94,136 @@
     /**
      * Create a process using fork(2) and exec(2).
      *
-     * @param std_fds array of file descriptors.  Indexes 0, 1, and
-     *        2 correspond to standard input, standard output and
-     *        standard error, respectively.  On input, a value of -1
-     *        means to create a pipe to connect child and parent
-     *        processes.  On output, a value which is not -1 is the
-     *        parent pipe fd corresponding to the pipe which has
-     *        been created.  An element of this array is -1 on input
-     *        if and only if it is <em>not</em> -1 on output.
+     * @param fds an array of three file descriptors.
+     *        Indexes 0, 1, and 2 correspond to standard input,
+     *        standard output and standard error, respectively.  On
+     *        input, a value of -1 means to create a pipe to connect
+     *        child and parent processes.  On output, a value which
+     *        is not -1 is the parent pipe fd corresponding to the
+     *        pipe which has been created.  An element of this array
+     *        is -1 on input if and only if it is <em>not</em> -1 on
+     *        output.
      * @return the pid of the subprocess
      */
     private native int forkAndExec(byte[] prog,
                                    byte[] argBlock, int argc,
                                    byte[] envBlock, int envc,
                                    byte[] dir,
-                                   int[] std_fds,
+                                   int[] fds,
                                    boolean redirectErrorStream)
         throws IOException;
 
-    /* In the process constructor we wait on this gate until the process    */
-    /* has been created. Then we return from the constructor.               */
-    /* fork() is called by the same thread which later waits for the process */
-    /* to terminate */
-
-    private static class Gate {
+    /**
+     * The thread factory used to create "process reaper" daemon threads.
+     */
+    private static class ProcessReaperThreadFactory implements ThreadFactory {
+        private final static ThreadGroup group = getRootThreadGroup();
 
-        private boolean exited = false;
-        private IOException savedException;
-
-        synchronized void exit() { /* Opens the gate */
-           exited = true;
-           this.notify();
+        private static ThreadGroup getRootThreadGroup() {
+            return AccessController.doPrivileged
+            (new PrivilegedAction<ThreadGroup> () {
+            public ThreadGroup run() {
+                ThreadGroup root = Thread.currentThread().getThreadGroup();
+                while (root.getParent() != null)
+                    root = root.getParent();
+                return root;
+            }});
         }
 
-        synchronized void waitForExit() { /* wait until the gate is open */
-            boolean interrupted = false;
-            while (!exited) {
-                try {
-                    this.wait();
-                } catch (InterruptedException e) {
-                    interrupted = true;
-                }
-            }
-            if (interrupted) {
-                Thread.currentThread().interrupt();
-            }
-        }
-
-        void setException (IOException e) {
-            savedException = e;
-        }
-
-        IOException getException() {
-            return savedException;
+        public Thread newThread(Runnable grimReaper) {
+            // Our thread stack requirement is quite modest.
+            Thread t = new Thread(group, grimReaper, "process reaper", 32768);
+            t.setDaemon(true);
+            // A small attempt (probably futile) to avoid priority inversion
+            t.setPriority(Thread.MAX_PRIORITY);
+            return t;
         }
     }
 
+    /**
+     * The thread pool of "process reaper" daemon threads.
+     */
+    private static final Executor processReaperExecutor
+        = Executors.newCachedThreadPool(new ProcessReaperThreadFactory());
+
     UNIXProcess(final byte[] prog,
                 final byte[] argBlock, final int argc,
                 final byte[] envBlock, final int envc,
                 final byte[] dir,
-                final int[] std_fds,
+                final int[] fds,
                 final boolean redirectErrorStream)
-    throws IOException {
+            throws IOException {
+
+        pid = forkAndExec(prog,
+                          argBlock, argc,
+                          envBlock, envc,
+                          dir,
+                          fds,
+                          redirectErrorStream);
 
-        final Gate gate = new Gate();
-        /*
-         * For each subprocess forked a corresponding reaper thread
-         * is started.  That thread is the only thread which waits
-         * for the subprocess to terminate and it doesn't hold any
-         * locks while doing so.  This design allows waitFor() and
-         * exitStatus() to be safely executed in parallel (and they
-         * need no native code).
-         */
+        try {
+            AccessController.doPrivileged
+            (new PrivilegedExceptionAction<Void>() {
+                public Void run() throws IOException {
+                    initStreams(fds);
+                    return null;
+                }});
+        } catch (PrivilegedActionException ex) {
+            throw (IOException) ex.getException();
+        }
+    }
+
+    static FileDescriptor newFileDescriptor(int fd) {
+        FileDescriptor fileDescriptor = new FileDescriptor();
+        fdAccess.set(fileDescriptor, fd);
+        return fileDescriptor;
+    }
 
-        java.security.AccessController.doPrivileged(
-        new java.security.PrivilegedAction<Void>() {
-        public Void run() {
-            Thread t = new Thread("process reaper") {
-                    public void run() {
-                        try {
-                            pid = forkAndExec(prog,
-                                              argBlock, argc,
-                                              envBlock, envc,
-                                              dir,
-                                              std_fds,
-                                              redirectErrorStream);
-                        } catch (IOException e) {
-                            gate.setException(e); /*remember to rethrow later*/
-                            gate.exit();
-                            return;
-                        }
-                        java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction<Void>() {
-                    public Void run() {
-                        if (std_fds[0] == -1)
-                            stdin_stream = new ProcessBuilder.NullOutputStream();
-                        else {
-                            FileDescriptor stdin_fd = new FileDescriptor();
-                            fdAccess.set(stdin_fd, std_fds[0]);
-                            stdin_stream = new BufferedOutputStream(
-                                new FileOutputStream(stdin_fd));
-                        }
+    void initStreams(int[] fds) throws IOException {
+        stdin = (fds[0] == -1) ?
+            NullOutputStream.INSTANCE :
+            new ProcessPipeOutputStream(fds[0]);
+
+        stdout = (fds[1] == -1) ?
+            NullInputStream.INSTANCE :
+            new ProcessPipeInputStream(fds[1]);
+
+        stderr = (fds[2] == -1) ?
+            NullInputStream.INSTANCE :
+            new ProcessPipeInputStream(fds[2]);
 
-                        if (std_fds[1] == -1)
-                            stdout_stream = new ProcessBuilder.NullInputStream();
-                        else {
-                            FileDescriptor stdout_fd = new FileDescriptor();
-                            fdAccess.set(stdout_fd, std_fds[1]);
-                            stdout_stream = new BufferedInputStream(
-                                new FileInputStream(stdout_fd));
-                        }
-
-                        if (std_fds[2] == -1)
-                            stderr_stream = new ProcessBuilder.NullInputStream();
-                        else {
-                            FileDescriptor stderr_fd = new FileDescriptor();
-                            fdAccess.set(stderr_fd, std_fds[2]);
-                            stderr_stream = new FileInputStream(stderr_fd);
-                        }
+        processReaperExecutor.execute(new Runnable() {
+            public void run() {
+                int exitcode = waitForProcessExit(pid);
+                UNIXProcess.this.processExited(exitcode);
+            }});
+    }
 
-                        return null; }});
-                        gate.exit(); /* exit from constructor */
-                        int res = waitForProcessExit(pid);
-                        synchronized (UNIXProcess.this) {
-                            hasExited = true;
-                            exitcode = res;
-                            UNIXProcess.this.notifyAll();
-                        }
-                    }
-                };
-                t.setDaemon(true);
-                t.start();
-                return null; }});
-        gate.waitForExit();
-        IOException e = gate.getException();
-        if (e != null)
-            throw new IOException(e.toString());
+    synchronized void processExited(int exitcode) {
+        if (stdout instanceof ProcessPipeInputStream)
+            ((ProcessPipeInputStream) stdout).processExited();
+
+        if (stderr instanceof ProcessPipeInputStream)
+            ((ProcessPipeInputStream) stderr).processExited();
+
+        if (stdin instanceof ProcessPipeOutputStream)
+            ((ProcessPipeOutputStream) stdin).processExited();
+
+        this.exitcode = exitcode;
+        hasExited = true;
+        notifyAll();
     }
 
     public OutputStream getOutputStream() {
-        return stdin_stream;
+        return stdin;
     }
 
     public InputStream getInputStream() {
-        return stdout_stream;
+        return stdout;
     }
 
     public InputStream getErrorStream() {
-        return stderr_stream;
+        return stderr;
     }
 
     public synchronized int waitFor() throws InterruptedException {
@@ -228,13 +252,9 @@
             if (!hasExited)
                 destroyProcess(pid);
         }
-        try {
-            stdin_stream.close();
-            stdout_stream.close();
-            stderr_stream.close();
-        } catch (IOException e) {
-            // ignore
-        }
+        try { stdin.close();  } catch (IOException ignored) {}
+        try { stdout.close(); } catch (IOException ignored) {}
+        try { stderr.close(); } catch (IOException ignored) {}
     }
 
     /* This routine initializes JNI field offsets for the class */
@@ -243,4 +263,77 @@
     static {
         initIDs();
     }
+
+    /**
+     * A buffered input stream for a subprocess pipe file descriptor
+     * that allows the underlying file descriptor to be reclaimed when
+     * the process exits, via the processExited hook.
+     *
+     * This is tricky because we do not want the user-level InputStream to be
+     * closed until the user invokes close(), and we need to continue to be
+     * able to read any buffered data lingering in the OS pipe buffer.
+     */
+    static class ProcessPipeInputStream extends BufferedInputStream {
+        ProcessPipeInputStream(int fd) {
+            super(new FileInputStream(newFileDescriptor(fd)));
+        }
+
+        private static byte[] drainInputStream(InputStream in)
+                throws IOException {
+            if (in == null) return null;
+            int n = 0;
+            int j;
+            byte[] a = null;
+            while ((j = in.available()) > 0) {
+                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
+                n += in.read(a, n, j);
+            }
+            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
+        }
+
+        /** Called by the process reaper thread when the process exits. */
+        synchronized void processExited() {
+            // Most BufferedInputStream methods are synchronized, but close()
+            // is not, and so we have to handle concurrent racing close().
+            try {
+                InputStream in = this.in;
+                if (in != null) {
+                    byte[] stragglers = drainInputStream(in);
+                    in.close();
+                    this.in = (stragglers == null) ?
+                        NullInputStream.INSTANCE :
+                        new ByteArrayInputStream(stragglers);
+                    if (buf == null) // asynchronous close()?
+                        this.in = null;
+                }
+            } catch (IOException ignored) {
+                // probably an asynchronous close().
+            }
+        }
+    }
+
+    /**
+     * A buffered output stream for a subprocess pipe file descriptor
+     * that allows the underlying file descriptor to be reclaimed when
+     * the process exits, via the processExited hook.
+     */
+    static class ProcessPipeOutputStream extends BufferedOutputStream {
+        ProcessPipeOutputStream(int fd) {
+            super(new FileOutputStream(newFileDescriptor(fd)));
+        }
+
+        /** Called by the process reaper thread when the process exits. */
+        synchronized void processExited() {
+            OutputStream out = this.out;
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException ignored) {
+                    // We know of no reason to get an IOException, but if
+                    // we do, there's nothing else to do but carry on.
+                }
+                this.out = NullOutputStream.INSTANCE;
+            }
+        }
+    }
 }
--- a/jvm.cfg.in	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-#
-# @(#)jvm.cfg   1.7 07/05/05
-#
-#
-# Copyright 2002-2003 Sun Microsystems, Inc.  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.  Sun designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-# CA 95054 USA or visit www.sun.com if you need additional information or
-# have any questions.
-#
-#
-#
-# List of JVMs that can be used as an option to java, javac, etc.
-# Order is important -- first in this list is the default JVM.
-# NOTE that this both this file and its format are UNSUPPORTED and
-# WILL GO AWAY in a future release.
-#
-# You may also select a JVM in an arbitrary location with the
-# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
-# and may not be available in a future release.
-#
--server KNOWN
--hotspot ERROR
--classic WARN
--client IGNORE
--native ERROR
--green ERROR
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/break-processbuilder-dependency.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -0,0 +1,136 @@
+diff -Nru openjdk-boot.orig/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux openjdk-boot/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux
+--- openjdk-boot.orig/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux	2010-09-01 22:21:08.815402468 +0100
++++ openjdk-boot/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux	2010-09-01 22:23:19.572081778 +0100
+@@ -62,6 +62,32 @@
+     private /* final */ InputStream  stdout;
+     private /* final */ InputStream  stderr;
+ 
++    /**
++     * Required package-private classes taken from
++     * Oracle's java.lang.ProcessBuilder for bootstrapping.
++     */
++
++    /**
++     * Implements a <a href="#redirect-output">null input stream</a>.
++     */
++    static class NullInputStream extends InputStream {
++        static final NullInputStream INSTANCE = new NullInputStream();
++        private NullInputStream() {}
++        public int read()      { return -1; }
++        public int available() { return 0; }
++    }
++
++    /**
++     * Implements a <a href="#redirect-input">null output stream</a>.
++     */
++    static class NullOutputStream extends OutputStream {
++        static final NullOutputStream INSTANCE = new NullOutputStream();
++        private NullOutputStream() {}
++        public void write(int b) throws IOException {
++            throw new IOException("Stream closed");
++        }
++    }
++
+     /* this is for the reaping thread */
+     private native int waitForProcessExit(int pid);
+ 
+@@ -155,15 +181,15 @@
+ 
+     void initStreams(int[] fds) throws IOException {
+         stdin = (fds[0] == -1) ?
+-            ProcessBuilder.NullOutputStream.INSTANCE :
++            NullOutputStream.INSTANCE :
+             new ProcessPipeOutputStream(fds[0]);
+ 
+         stdout = (fds[1] == -1) ?
+-            ProcessBuilder.NullInputStream.INSTANCE :
++            NullInputStream.INSTANCE :
+             new ProcessPipeInputStream(fds[1]);
+ 
+         stderr = (fds[2] == -1) ?
+-            ProcessBuilder.NullInputStream.INSTANCE :
++            NullInputStream.INSTANCE :
+             new ProcessPipeInputStream(fds[2]);
+ 
+         processReaperExecutor.execute(new Runnable() {
+@@ -275,7 +301,7 @@
+                     byte[] stragglers = drainInputStream(in);
+                     in.close();
+                     this.in = (stragglers == null) ?
+-                        ProcessBuilder.NullInputStream.INSTANCE :
++                        NullInputStream.INSTANCE :
+                         new ByteArrayInputStream(stragglers);
+                     if (buf == null) // asynchronous close()?
+                         this.in = null;
+@@ -306,7 +332,7 @@
+                     // We know of no reason to get an IOException, but if
+                     // we do, there's nothing else to do but carry on.
+                 }
+-                this.out = ProcessBuilder.NullOutputStream.INSTANCE;
++                this.out = NullOutputStream.INSTANCE;
+             }
+         }
+     }
+diff -Nru openjdk-boot.orig/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris openjdk-boot/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris
+--- openjdk-boot.orig/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris	2010-09-01 22:21:08.815402468 +0100
++++ openjdk-boot/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris	2010-09-01 22:22:33.204096111 +0100
+@@ -45,6 +45,32 @@
+     private DeferredCloseInputStream stdout_inner_stream;
+     private InputStream stderr_stream;
+ 
++    /**
++     * Required package-private classes taken from
++     * Oracle's java.lang.ProcessBuilder for bootstrapping.
++     */
++
++    /**
++     * Implements a <a href="#redirect-output">null input stream</a>.
++     */
++    static class NullInputStream extends InputStream {
++        static final NullInputStream INSTANCE = new NullInputStream();
++        private NullInputStream() {}
++        public int read()      { return -1; }
++        public int available() { return 0; }
++    }
++
++    /**
++     * Implements a <a href="#redirect-input">null output stream</a>.
++     */
++    static class NullOutputStream extends OutputStream {
++        static final NullOutputStream INSTANCE = new NullOutputStream();
++        private NullOutputStream() {}
++        public void write(int b) throws IOException {
++            throw new IOException("Stream closed");
++        }
++    }
++
+     /* this is for the reaping thread */
+     private native int waitForProcessExit(int pid);
+ 
+@@ -86,7 +112,7 @@
+         java.security.AccessController.doPrivileged(
+         new java.security.PrivilegedAction<Void>() { public Void run() {
+             if (std_fds[0] == -1)
+-                stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE;
++                stdin_stream = NullOutputStream.INSTANCE;
+             else {
+                 FileDescriptor stdin_fd = new FileDescriptor();
+                 fdAccess.set(stdin_fd, std_fds[0]);
+@@ -95,7 +121,7 @@
+             }
+ 
+             if (std_fds[1] == -1)
+-                stdout_stream = ProcessBuilder.NullInputStream.INSTANCE;
++                stdout_stream = NullInputStream.INSTANCE;
+             else {
+                 FileDescriptor stdout_fd = new FileDescriptor();
+                 fdAccess.set(stdout_fd, std_fds[1]);
+@@ -104,7 +130,7 @@
+             }
+ 
+             if (std_fds[2] == -1)
+-                stderr_stream = ProcessBuilder.NullInputStream.INSTANCE;
++                stderr_stream = NullInputStream.INSTANCE;
+             else {
+                 FileDescriptor stderr_fd = new FileDescriptor();
+                 fdAccess.set(stderr_fd, std_fds[2]);
--- a/patches/boot/ecj-diamond.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/boot/ecj-diamond.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -73,3 +73,86 @@
                                  numOfCerts > 10 ? 10 : numOfCerts);
                          for (int j = 0; j < numOfCerts; j++) {
                              if (xVersion == 2) {
+diff -Nru openjdk-boot.orig/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java openjdk-boot/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java
+--- openjdk-boot.orig/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	2010-09-01 22:07:18.059282202 +0100
++++ openjdk-boot/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	2010-09-01 22:07:50.032515630 +0100
+@@ -60,7 +60,7 @@
+                                           int maxperkeyword,
+                                           int maxkeywords)
+     {
+-        LinkedList<String> ll = new LinkedList<>();
++        LinkedList<String> ll = new LinkedList<String>();
+ 
+         try {
+             BufferedReader in =
+@@ -200,7 +200,7 @@
+         // no local domain so try fallback (RPC) domain or
+         // hostname
+ 
+-        sl = new LinkedList<>();
++        sl = new LinkedList<String>();
+         String domain = fallbackDomain0();
+         if (domain != null && domain.length() > 0) {
+             sl.add(domain);
+diff -r a094068f4c7b src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java
+--- openjdk-boot.orig/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java	Fri Aug 27 19:01:53 2010 +0100
++++ openjdk-boot/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java	Mon Sep 06 17:03:29 2010 +0100
+@@ -52,7 +52,7 @@
+ 
+     // Per-thread soft cache of the last temporary context
+     private static ThreadLocal<SoftReference<ThreadContext>> contextRef =
+-            new ThreadLocal<>();
++            new ThreadLocal<SoftReference<ThreadContext>>();
+ 
+     // Simple class to encapsulate the temporary context
+     private static class ThreadContext {
+@@ -99,7 +99,7 @@
+ 
+         // new thread context needs to be created
+         if (thrCtxt == null) {
+-            final Hashtable<String,Object> env = new Hashtable<>();
++            final Hashtable<String,Object> env = new Hashtable<String,Object>();
+             env.put("java.naming.factory.initial",
+                     "com.sun.jndi.dns.DnsContextFactory");
+ 
+@@ -165,7 +165,7 @@
+                                       final String[] ids, int depth)
+             throws UnknownHostException
+     {
+-        ArrayList<String> results = new ArrayList<>();
++        ArrayList<String> results = new ArrayList<String>();
+         Attributes attrs;
+ 
+         // do the query
+diff -r a094068f4c7b src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java
+--- openjdk-boot.orig/jdk/src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java	Fri Aug 27 19:01:53 2010 +0100
++++ openjdk-boot/jdk/src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java	Mon Sep 06 18:44:51 2010 +0100
+@@ -153,12 +153,12 @@
+ 
+     static {
+         HashMap<ControlSequence, String> tSequenceToEncodingMap =
+-            new HashMap<>(33, 1.0f);
++            new HashMap<ControlSequence, String>(33, 1.0f);
+         HashMap<ControlSequence, Boolean> tHighBitsMap =
+-            new HashMap<>(31, 1.0f);
++            new HashMap<ControlSequence, Boolean>(31, 1.0f);
+         HashMap<String, ControlSequence> tEncodingToSequenceMap =
+-            new HashMap<>(21, 1.0f);
+-        ArrayList<String> tEncodings = new ArrayList<>(21);
++            new HashMap<String, ControlSequence>(21, 1.0f);
++        ArrayList<String> tEncodings = new ArrayList<String>(21);
+ 
+         if (!(isEncodingSupported("US-ASCII") &&
+               isEncodingSupported("ISO-8859-1")))
+diff -r a094068f4c7b src/share/classes/com/sun/jndi/dns/DnsContextFactory.java
+--- openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/dns/DnsContextFactory.java	Fri Aug 27 19:01:53 2010 +0100
++++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/dns/DnsContextFactory.java	Mon Sep 06 18:50:12 2010 +0100
+@@ -132,7 +132,7 @@
+             throw new ConfigurationException("DNS pseudo-URL required");
+         }
+ 
+-        List<String> servers = new ArrayList<>();
++        List<String> servers = new ArrayList<String>();
+ 
+         for (int i = 0; i < urls.length; i++) {
+             String server = urls[i].getHost();
--- a/patches/boot/icedtea-hotspot-default.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-diff -Nru ../openjdk.orig/openjdk-boot/hotspot/make/linux/Makefile openjdk-boot/hotspot/make/linux/Makefile
---- ../openjdk.orig/openjdk-boot/hotspot/make/linux/Makefile	2009-10-30 17:37:07.000000000 +0000
-+++ openjdk-boot/hotspot/make/linux/Makefile	2009-10-30 17:45:40.000000000 +0000
-@@ -287,35 +287,30 @@
- 
- $(TARGETS_C2):  $(SUBDIRS_C2)
- 	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
--	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
- ifdef INSTALL
- 	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
- endif
- 
- $(TARGETS_TIERED):  $(SUBDIRS_TIERED)
- 	cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
--	cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
- ifdef INSTALL
- 	cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
- endif
- 
- $(TARGETS_C1):  $(SUBDIRS_C1)
- 	cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
--	cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
- ifdef INSTALL
- 	cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
- endif
- 
- $(TARGETS_CORE):  $(SUBDIRS_CORE)
- 	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
--	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
- ifdef INSTALL
- 	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
- endif
- 
- $(TARGETS_ZERO):  $(SUBDIRS_ZERO)
- 	cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
--	cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
- ifdef INSTALL
- 	cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
- endif
-diff -Nru ../openjdk.orig/openjdk-boot/hotspot/make/linux/makefiles/sa.make openjdk-boot/hotspot/make/linux/makefiles/sa.make
---- ../openjdk.orig/openjdk-boot/hotspot/make/linux/makefiles/sa.make	2009-10-30 15:58:31.000000000 +0000
-+++ openjdk-boot/hotspot/make/linux/makefiles/sa.make	2009-10-30 17:44:58.000000000 +0000
-@@ -38,7 +38,7 @@
- GENERATED = $(TOPDIR)/../generated
- 
- # tools.jar is needed by the JDI - SA binding
--SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
-+SA_CLASSPATH = $(BOOT_JAVA_HOME)/jre/lib/rt.jar
- 
- # gnumake 3.78.1 does not accept the *s that
- # are in AGENT_FILES1 and AGENT_FILES2, so use the shell to expand them
--- a/patches/boot/icedtea-jaxp-dependency.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/boot/icedtea-jaxp-dependency.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,6 +1,6 @@
 diff -Nru openjdk-boot.orig/jaxws/build.properties openjdk-boot/jaxws/build.properties
---- openjdk-boot.orig/jaxws/build.properties	2009-12-04 15:34:46.000000000 +0000
-+++ openjdk-boot/jaxws/build.properties	2009-12-13 21:46:57.000000000 +0000
+--- openjdk-boot.orig/jaxws/build.properties	2010-07-29 21:54:11.000000000 +0100
++++ openjdk-boot/jaxws/build.properties	2010-09-01 21:25:29.587888259 +0100
 @@ -62,6 +62,9 @@
  build.dir=${output.dir}/build
  build.classes.dir=${build.dir}/classes
@@ -12,10 +12,10 @@
  dist.dir=${output.dir}/dist
  dist.lib.dir=${dist.dir}/lib
 diff -Nru openjdk-boot.orig/jaxws/build.xml openjdk-boot/jaxws/build.xml
---- openjdk-boot.orig/jaxws/build.xml	2009-12-04 15:34:46.000000000 +0000
-+++ openjdk-boot/jaxws/build.xml	2009-12-13 21:48:18.000000000 +0000
-@@ -115,7 +115,7 @@
- 	    depends="init, -init-src-dirs, -build-prep">
+--- openjdk-boot.orig/jaxws/build.xml	2010-09-01 21:00:02.000000000 +0100
++++ openjdk-boot/jaxws/build.xml	2010-09-01 21:25:29.595887577 +0100
+@@ -124,7 +124,7 @@
+         <mkdir dir="${build.classes.dir}"/>
          <javac 
  	     includeAntRuntime="false" 
 -	     classpath="${build.classes.dir}:${tools.jar}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/revert-6973616.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -0,0 +1,12 @@
+diff -Nru openjdk-boot.orig/jdk/make/common/shared/Defs-versions.gmk openjdk-boot/jdk/make/common/shared/Defs-versions.gmk
+--- openjdk-boot.orig/jdk/make/common/shared/Defs-versions.gmk	2010-09-06 13:47:55.000000000 +0100
++++ openjdk-boot/jdk/make/common/shared/Defs-versions.gmk	2010-09-06 13:54:03.765973618 +0100
+@@ -191,7 +191,7 @@
+ 
+ # Generic
+ REQUIRED_ANT_VER          = 1.6.3
+-REQUIRED_BOOT_VER         = 1.6
++REQUIRED_BOOT_VER         = 1.5
+ REQUIRED_FREETYPE_VERSION = 2.2.1
+ REQUIRED_MAKE_VER         = 3.78
+ REQUIRED_UNZIP_VER        = 5.12
--- a/patches/boot/symbols.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/boot/symbols.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,7 +1,7 @@
-diff -Nru ../openjdk.orig/openjdk-boot/jdk/make/common/Release.gmk openjdk-boot/jdk/make/common/Release.gmk
---- ../openjdk.orig/openjdk-boot/jdk/make/common/Release.gmk	2009-10-30 16:49:37.000000000 +0000
-+++ openjdk-boot/jdk/make/common/Release.gmk	2009-10-30 16:59:16.000000000 +0000
-@@ -944,19 +955,6 @@
+diff -Nru openjdk-boot.orig/jdk/make/common/Release.gmk openjdk-boot/jdk/make/common/Release.gmk
+--- openjdk-boot.orig/jdk/make/common/Release.gmk	2010-09-01 20:18:58.000000000 +0100
++++ openjdk-boot/jdk/make/common/Release.gmk	2010-09-01 20:24:27.111708385 +0100
+@@ -1013,19 +1013,6 @@
  	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
  	$(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
  	@#
@@ -12,7 +12,7 @@
 -	    -processor com.sun.tools.javac.sym.CreateSymbols \
 -	    -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
 -	    -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
--	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
+-	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
 -	$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
 -	    -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
 -	@$(java-vm-cleanup)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/test_gamma.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -0,0 +1,39 @@
+diff -Nru ../openjdk.orig/openjdk-boot/hotspot/make/linux/Makefile openjdk-boot/hotspot/make/linux/Makefile
+--- ../openjdk.orig/openjdk-boot/hotspot/make/linux/Makefile	2009-10-30 17:37:07.000000000 +0000
++++ openjdk-boot/hotspot/make/linux/Makefile	2009-10-30 17:45:40.000000000 +0000
+@@ -287,35 +287,30 @@
+ 
+ $(TARGETS_C2):  $(SUBDIRS_C2)
+ 	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
+-	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
+ ifdef INSTALL
+ 	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
+ endif
+ 
+ $(TARGETS_TIERED):  $(SUBDIRS_TIERED)
+ 	cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
+-	cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
+ ifdef INSTALL
+ 	cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
+ endif
+ 
+ $(TARGETS_C1):  $(SUBDIRS_C1)
+ 	cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
+-	cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
+ ifdef INSTALL
+ 	cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
+ endif
+ 
+ $(TARGETS_CORE):  $(SUBDIRS_CORE)
+ 	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
+-	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
+ ifdef INSTALL
+ 	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
+ endif
+ 
+ $(TARGETS_ZERO):  $(SUBDIRS_ZERO)
+ 	cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
+-	cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
+ ifdef INSTALL
+ 	cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
+ endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/tools.jar.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -0,0 +1,14 @@
+diff -Nru openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make openjdk-boot/hotspot/make/linux/makefiles/sa.make
+--- openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make	2010-08-27 19:15:27.000000000 +0100
++++ openjdk-boot/hotspot/make/linux/makefiles/sa.make	2010-09-01 20:49:39.417105243 +0100
+@@ -71,8 +71,8 @@
+ 	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
+ 	  exit 1; \
+ 	fi
+-	$(QUIETLY) if [ ! -f $(SA_CLASSPATH) -a ! -d $(MODULELIB_PATH) ] ; then \
+-	  echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
++	$(QUIETLY) if [ ! -d $(MODULELIB_PATH) ] ; then \
++	  echo "$(MODULELIB_PATH) is not a directory.";\
+ 	  echo ""; \
+ 	  exit 1; \
+ 	fi
--- a/patches/hotspot/default/icedtea-gcc-suffix.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/hotspot/default/icedtea-gcc-suffix.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,5 +1,6 @@
---- openjdk/hotspot/agent/src/os/linux/Makefile~	2007-08-02 09:16:50.000000000 +0200
-+++ openjdk/hotspot/agent/src/os/linux/Makefile	2007-08-08 17:00:11.204338801 +0200
+diff -Nru openjdk.orig/hotspot/agent/src/os/linux/Makefile openjdk/hotspot/agent/src/os/linux/Makefile
+--- openjdk.orig/hotspot/agent/src/os/linux/Makefile	2010-07-29 21:54:38.000000000 +0100
++++ openjdk/hotspot/agent/src/os/linux/Makefile	2010-08-31 17:54:44.523837437 +0100
 @@ -23,7 +23,7 @@
  #
  
@@ -9,17 +10,22 @@
  
  JAVAH    = ${JAVA_HOME}/bin/javah
  
---- openjdk/hotspot/make/linux/makefiles/gcc.make~	2007-08-08 16:13:12.281815996 +0200
-+++ openjdk/hotspot/make/linux/makefiles/gcc.make	2007-08-08 16:36:52.573240769 +0200
-@@ -25,8 +25,8 @@
- #------------------------------------------------------------------------
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
+--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2010-08-31 17:24:48.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/gcc.make	2010-08-31 17:55:09.288779769 +0100
+@@ -26,11 +26,11 @@
  # CC, CPP & AS
  
+ ifdef ALT_COMPILER_PATH
+-CPP = $(ALT_COMPILER_PATH)/g++
+-CC  = $(ALT_COMPILER_PATH)/gcc
++CPP = $(ALT_COMPILER_PATH)/g++$(GCC_SUFFIX)
++CC  = $(ALT_COMPILER_PATH)/gcc$(GCC_SUFFIX)
+ else
 -CPP = g++
 -CC  = gcc
 +CPP = g++$(GCC_SUFFIX)
 +CC  = gcc$(GCC_SUFFIX)
- AS  = $(CC) -c
+ endif
  
- # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
-
+ AS  = $(CC) -c
--- a/patches/hotspot/default/icedtea-shark-build.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +0,0 @@
-diff -Nru openjdk.orig/hotspot/make/linux/Makefile openjdk/hotspot/make/linux/Makefile
---- openjdk.orig/hotspot/make/linux/Makefile	2009-10-30 16:00:45.000000000 +0000
-+++ openjdk/hotspot/make/linux/Makefile	2010-05-04 12:31:29.000000000 +0100
-@@ -168,6 +168,13 @@
- #       profiledzero    zero            <os>_<arch>_zero/profiled
- #       productzero     zero            <os>_<arch>_zero/product
- #
-+#       debugshark      shark           <os>_<arch>_shark/debug
-+#       fastdebugshark  shark           <os>_<arch>_shark/fastdebug
-+#       jvmgshark       shark           <os>_<arch>_shark/jvmg
-+#       optimizedshark  shark           <os>_<arch>_shark/optimized
-+#       profiledshark   shark           <os>_<arch>_shark/profiled
-+#       productshark    shark           <os>_<arch>_shark/product
-+#
- # What you get with each target:
- #
- # debug*     - "thin" libjvm_g - debug info linked into the gamma_g launcher
-@@ -191,12 +198,14 @@
- SUBDIRS_TIERED    = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
- SUBDIRS_CORE      = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
- SUBDIRS_ZERO      = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
-+SUBDIRS_SHARK     = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
- 
- TARGETS_C2        = $(TARGETS)
- TARGETS_C1        = $(addsuffix 1,$(TARGETS))
- TARGETS_TIERED    = $(addsuffix tiered,$(TARGETS))
- TARGETS_CORE      = $(addsuffix core,$(TARGETS))
- TARGETS_ZERO      = $(addsuffix zero,$(TARGETS))
-+TARGETS_SHARK     = $(addsuffix shark,$(TARGETS))
- 
- BUILDTREE_MAKE    = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
- BUILDTREE_VARS    = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
-@@ -213,6 +222,7 @@
- 	@echo "  $(TARGETS_C1)"
- 	@echo "  $(TARGETS_CORE)"
- 	@echo "  $(TARGETS_ZERO)"
-+	@echo "  $(TARGETS_SHARK)"
- 
- checks: check_os_version check_j2se_version
- 
-@@ -266,6 +276,10 @@
- 	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
- 	$(BUILDTREE) VARIANT=zero VARIANTARCH=$(VARIANTARCH)
- 
-+$(SUBDIRS_SHARK): $(BUILDTREE_MAKE) platform_zero
-+	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
-+	$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
-+
- platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
- 	$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
- 
-@@ -306,6 +320,12 @@
- 	cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
- endif
- 
-+$(TARGETS_SHARK):  $(SUBDIRS_SHARK)
-+	cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
-+ifdef INSTALL
-+	cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
-+endif
-+
- # Just build the tree, and nothing else:
- tree:      $(SUBDIRS_C2)
- tree1:     $(SUBDIRS_C1)
-@@ -339,7 +359,7 @@
- 
- #-------------------------------------------------------------------------------
- 
--.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO)
-+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
- .PHONY: tree tree1 treecore treezero
- .PHONY: all compiler1 compiler2 core zero
- .PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero docs clean_docs
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/buildtree.make openjdk/hotspot/make/linux/makefiles/buildtree.make
---- openjdk.orig/hotspot/make/linux/makefiles/buildtree.make	2009-10-30 16:01:05.000000000 +0000
-+++ openjdk/hotspot/make/linux/makefiles/buildtree.make	2010-05-04 12:31:29.000000000 +0100
-@@ -225,8 +225,8 @@
- 
- ../shared_dirs.lst:  $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
- 	@echo Creating directory list $@
--	$(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \
--	-type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
-+	$(QUIETLY) find -L $(GAMMADIR)/src/share/vm/* -prune \
-+	-type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find -L {} \
-         \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@
- 
- Makefile: $(BUILDTREE_MAKE)
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
---- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2010-05-04 12:23:33.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/gcc.make	2010-05-04 12:31:29.000000000 +0100
-@@ -59,6 +59,9 @@
- ifeq ($(ZERO_BUILD), true)
- CFLAGS += $(LIBFFI_CFLAGS)
- endif
-+ifdef ICEDTEA_SHARK_BUILD
-+CFLAGS += $(LLVM_CFLAGS)
-+endif
- CFLAGS += $(VM_PICFLAG)
- CFLAGS += -fno-rtti
- CFLAGS += -fno-exceptions
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/top.make openjdk/hotspot/make/linux/makefiles/top.make
---- openjdk.orig/hotspot/make/linux/makefiles/top.make	2009-10-30 15:58:31.000000000 +0000
-+++ openjdk/hotspot/make/linux/makefiles/top.make	2010-05-04 12:31:29.000000000 +0100
-@@ -75,6 +75,7 @@
- Include_DBs/COMPILER2   = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
- Include_DBs/TIERED      = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
- Include_DBs/ZERO        = $(Include_DBs/CORE) $(VM)/includeDB_zero
-+Include_DBs/SHARK       = $(Include_DBs/ZERO) $(VM)/includeDB_shark
- Include_DBs = $(Include_DBs/$(TYPE))
- 
- Cached_plat = $(GENERATED)/platform.current
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make
---- openjdk.orig/hotspot/make/linux/makefiles/vm.make	2010-05-04 12:23:33.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/vm.make	2010-05-04 12:31:29.000000000 +0100
-@@ -140,10 +140,14 @@
- vm.def: $(Res_Files) $(Obj_Files)
- 	sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
- 
--ifeq ($(ZERO_LIBARCH), ppc64)
-+ifdef ICEDTEA_SHARK_BUILD
-   STATIC_CXX = false
- else
--  STATIC_CXX = true
-+  ifeq ($(ZERO_LIBARCH), ppc64)
-+    STATIC_CXX = false
-+  else
-+    STATIC_CXX = true
-+  endif
- endif
- 
- ifeq ($(LINK_INTO),AOUT)
-@@ -171,6 +175,10 @@
- ifeq ($(ZERO_BUILD), true)
-   LIBS_VM += $(LIBFFI_LIBS)
- endif
-+ifdef ICEDTEA_SHARK_BUILD
-+LFLAGS_VM += $(LLVM_LDFLAGS)
-+LIBS_VM   += $(LLVM_LIBS)
-+endif
- 
- LINK_VM = $(LINK_LIB.c)
- 
-diff -Nru openjdk.orig/hotspot/make/Makefile openjdk/hotspot/make/Makefile
---- openjdk.orig/hotspot/make/Makefile	2010-02-19 17:14:34.000000000 +0000
-+++ openjdk/hotspot/make/Makefile	2010-05-04 12:31:29.000000000 +0100
-@@ -80,11 +80,12 @@
-   ALT_OUT=
- endif
- 
--# Typical C1/C2 targets made available with this Makefile
-+# Typical C1/C2 and Shark (C0) targets made available with this Makefile
- C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
- C2_VM_TARGETS=product  fastdebug  optimized  jvmg
- KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
- ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
-+SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
- 
- # JDK directory list
- JDK_DIRS=bin include jre lib demo
-@@ -101,6 +102,12 @@
- all_debugzero:     jvmgzero docs export_debug
- all_optimizedzero: optimizedzero docs export_optimized
- 
-+allshark:           all_productshark all_fastdebugshark
-+all_productshark:   productshark docs export_product
-+all_fastdebugshark: fastdebugshark docs export_fastdebug
-+all_debugshark:     jvmgshark docs export_debug
-+all_optimizedshark: optimizedshark docs export_optimized
-+
- # Do everything
- world:         all create_jdk
- 
-@@ -123,6 +130,10 @@
- 	$(CD) $(GAMMADIR)/make; \
- 	$(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
- 
-+$(SHARK_VM_TARGETS):
-+	$(CD) $(GAMMADIR)/make; \
-+	$(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
-+
- $(KERNEL_VM_TARGETS):
- 	$(CD) $(GAMMADIR)/make; \
- 	$(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
-@@ -173,6 +184,12 @@
- 		      $(MAKE_ARGS) $(VM_TARGET)
- endif
- 
-+generic_buildshark:
-+	$(MKDIR) -p $(OUTPUTDIR)
-+	$(CD) $(OUTPUTDIR); \
-+		$(MAKE) -f $(ABS_OS_MAKEFILE) \
-+			$(MAKE_ARGS) $(VM_TARGET) 
-+
- generic_buildkernel:
- 	$(MKDIR) -p $(OUTPUTDIR)
- ifeq ($(OSNAME),windows)
-@@ -228,12 +245,18 @@
- C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
- KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
- ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
-+SHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark
- C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
- C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
- KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
- ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
-+SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
- 
- # Misc files and generated files need to come from C1 or C2 area
-+ifdef ICEDTEA_SHARK_BUILD
-+  MISC_DIR=$(SHARK_DIR)
-+  GEN_DIR=$(SHARK_BASE_DIR)/generated
-+else
- ifeq ($(ZERO_BUILD), true)
-   MISC_DIR=$(ZERO_DIR)
-   GEN_DIR=$(ZERO_BASE_DIR)/generated
-@@ -246,6 +269,7 @@
-   GEN_DIR=$(C2_BASE_DIR)/generated
- endif
- endif
-+endif
- 
- # Bin files (windows)
- ifeq ($(OSNAME),windows)
-@@ -289,12 +313,18 @@
- 
- # Shared Library
- ifneq ($(OSNAME),windows)
--  ifeq ($(ZERO_BUILD), true)
-+  ifdef ICEDTEA_SHARK_BUILD
-+$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(SHARK_DIR)/%.so
-+	$(install-file)
-+$(EXPORT_SERVER_DIR)/%.so:       $(SHARK_DIR)/%.so
-+	$(install-file)
-+  else
-+    ifeq ($(ZERO_BUILD), true)
- $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
- 	$(install-file)
- $(EXPORT_SERVER_DIR)/%.so:       $(ZERO_DIR)/%.so
- 	$(install-file)
--  else
-+    else
- $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
- 	$(install-file)
- $(EXPORT_CLIENT_DIR)/%.so:       $(C1_DIR)/%.so
-@@ -305,6 +335,7 @@
- 	$(install-file)
- $(EXPORT_SERVER_DIR)/64/%.so:    $(C2_DIR)/%.so
- 	$(install-file)
-+    endif
-   endif
- endif
- 
--- a/patches/hotspot/default/icedtea-shark.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,384 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciMethod.cpp openjdk/hotspot/src/share/vm/ci/ciMethod.cpp
---- openjdk.orig/hotspot/src/share/vm/ci/ciMethod.cpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/ci/ciMethod.cpp	2010-05-10 14:38:13.000000000 +0100
-@@ -56,9 +56,9 @@
-   _liveness           = NULL;
-   _bcea = NULL;
-   _method_blocks = NULL;
--#ifdef COMPILER2
-+#if defined(COMPILER2) || defined(SHARK)
-   _flow               = NULL;
--#endif // COMPILER2
-+#endif // COMPILER2 || SHARK
- 
-   ciEnv *env = CURRENT_ENV;
-   if (env->jvmti_can_hotswap_or_post_breakpoint() && _is_compilable) {
-@@ -124,9 +124,9 @@
-   _bcea = NULL;
-   _method_blocks = NULL;
-   _method_data = NULL;
--#ifdef COMPILER2
-+#if defined(COMPILER2) || defined(SHARK)
-   _flow = NULL;
--#endif // COMPILER2
-+#endif // COMPILER2 || SHARK
- }
- 
- 
-@@ -228,6 +228,18 @@
-   return get_methodOop()->vtable_index();
- }
- 
-+#ifdef SHARK
-+// ------------------------------------------------------------------
-+// ciMethod::itable_index
-+//
-+// Get the position of this method's entry in the itable, if any.
-+int ciMethod::itable_index() {
-+  check_is_loaded();
-+  assert(holder()->is_linked(), "must be linked");
-+  VM_ENTRY_MARK;
-+  return klassItable::compute_itable_index(get_methodOop());
-+}
-+#endif // SHARK
- 
- // ------------------------------------------------------------------
- // ciMethod::native_entry
-@@ -294,34 +306,34 @@
- // ------------------------------------------------------------------
- // ciMethod::get_flow_analysis
- ciTypeFlow* ciMethod::get_flow_analysis() {
--#ifdef COMPILER2
-+#if defined(COMPILER2) || defined(SHARK)
-   if (_flow == NULL) {
-     ciEnv* env = CURRENT_ENV;
-     _flow = new (env->arena()) ciTypeFlow(env, this);
-     _flow->do_flow();
-   }
-   return _flow;
--#else // COMPILER2
-+#else // COMPILER2 || SHARK
-   ShouldNotReachHere();
-   return NULL;
--#endif // COMPILER2
-+#endif // COMPILER2 || SHARK
- }
- 
- 
- // ------------------------------------------------------------------
- // ciMethod::get_osr_flow_analysis
- ciTypeFlow* ciMethod::get_osr_flow_analysis(int osr_bci) {
--#ifdef COMPILER2
-+#if defined(COMPILER2) || defined(SHARK)
-   // OSR entry points are always place after a call bytecode of some sort
-   assert(osr_bci >= 0, "must supply valid OSR entry point");
-   ciEnv* env = CURRENT_ENV;
-   ciTypeFlow* flow = new (env->arena()) ciTypeFlow(env, this, osr_bci);
-   flow->do_flow();
-   return flow;
--#else // COMPILER2
-+#else // COMPILER2 || SHARK
-   ShouldNotReachHere();
-   return NULL;
--#endif // COMPILER2
-+#endif // COMPILER2 || SHARK
- }
- 
- // ------------------------------------------------------------------
-diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciMethod.hpp openjdk/hotspot/src/share/vm/ci/ciMethod.hpp
---- openjdk.orig/hotspot/src/share/vm/ci/ciMethod.hpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/ci/ciMethod.hpp	2010-05-10 14:38:13.000000000 +0100
-@@ -71,7 +71,7 @@
- 
-   // Optional liveness analyzer.
-   MethodLiveness* _liveness;
--#ifdef COMPILER2
-+#if defined(COMPILER2) || defined(SHARK)
-   ciTypeFlow*     _flow;
- #endif
- 
-@@ -141,6 +141,9 @@
- 
-   // Runtime information.
-   int           vtable_index();
-+#ifdef SHARK
-+  int itable_index();
-+#endif // SHARK 
-   address       native_entry();
-   address       interpreter_entry();
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/code/nmethod.cpp openjdk/hotspot/src/share/vm/code/nmethod.cpp
---- openjdk.orig/hotspot/src/share/vm/code/nmethod.cpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/code/nmethod.cpp	2010-05-10 15:00:13.000000000 +0100
-@@ -65,6 +65,11 @@
-   if (is_native_method()) return false;
-   return compiler()->is_c2();
- }
-+bool nmethod::is_compiled_by_shark() const {
-+  if (is_native_method()) return false;
-+  assert(compiler() != NULL, "must be");
-+  return compiler()->is_shark();
-+}
- 
- 
- 
-@@ -1346,6 +1351,10 @@
-     CodeCache::remove_saved_code(this);
-   }
- 
-+#ifdef SHARK
-+  ((SharkCompiler *) compiler())->free_compiled_method(instructions_begin());
-+#endif // SHARK
-+  
-   ((CodeBlob*)(this))->flush();
- 
-   CodeCache::free(this);
-@@ -1737,6 +1746,7 @@
- // Method that knows how to preserve outgoing arguments at call. This method must be
- // called with a frame corresponding to a Java invoke
- void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
-+#ifndef SHARK
-   if (!method()->is_native()) {
-     SimpleScopeDesc ssd(this, fr.pc());
-     Bytecode_invoke* call = Bytecode_invoke_at(ssd.method(), ssd.bci());
-@@ -1744,6 +1754,7 @@
-     symbolOop signature = call->signature();
-     fr.oops_compiled_arguments_do(signature, has_receiver, reg_map, f);
-   }
-+#endif // !SHARK
- }
- 
- 
-@@ -2247,6 +2258,8 @@
-     tty->print("(c1) ");
-   } else if (is_compiled_by_c2()) {
-     tty->print("(c2) ");
-+  } else if (is_compiled_by_shark()) {
-+    tty->print("(shark) ");
-   } else {
-     tty->print("(nm) ");
-   }
-diff -Nru openjdk.orig/hotspot/src/share/vm/code/nmethod.hpp openjdk/hotspot/src/share/vm/code/nmethod.hpp
---- openjdk.orig/hotspot/src/share/vm/code/nmethod.hpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/code/nmethod.hpp	2010-05-10 14:38:13.000000000 +0100
-@@ -334,6 +334,7 @@
- 
-   bool is_compiled_by_c1() const;
-   bool is_compiled_by_c2() const;
-+  bool is_compiled_by_shark() const;
- 
-   // boundaries for different parts
-   address code_begin            () const          { return _entry_point; }
-diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/abstractCompiler.hpp openjdk/hotspot/src/share/vm/compiler/abstractCompiler.hpp
---- openjdk.orig/hotspot/src/share/vm/compiler/abstractCompiler.hpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/compiler/abstractCompiler.hpp	2010-05-10 14:38:13.000000000 +0100
-@@ -45,18 +45,26 @@
-   // Missing feature tests
-   virtual bool supports_native()                 { return true; }
-   virtual bool supports_osr   ()                 { return true; }
--#if defined(TIERED) || ( !defined(COMPILER1) && !defined(COMPILER2))
-+#if defined(TIERED) || ( !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK))
-   virtual bool is_c1   ()                        { return false; }
-   virtual bool is_c2   ()                        { return false; }
-+  virtual bool is_shark()                        { return false; }
- #else
- #ifdef COMPILER1
-   bool is_c1   ()                                { return true; }
-   bool is_c2   ()                                { return false; }
-+  bool is_shark()                                { return false; }
- #endif // COMPILER1
- #ifdef COMPILER2
-   bool is_c1   ()                                { return false; }
-   bool is_c2   ()                                { return true; }
-+  bool is_shark()                                { return false; }
- #endif // COMPILER2
-+#ifdef SHARK
-+  bool is_c1   ()                                { return false; }
-+  bool is_c2   ()                                { return false; }
-+  bool is_shark()                                { return true; }
-+#endif // SHARK  
- #endif // TIERED
- 
-   // Customization
-diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/compileBroker.cpp openjdk/hotspot/src/share/vm/compiler/compileBroker.cpp
---- openjdk.orig/hotspot/src/share/vm/compiler/compileBroker.cpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/compiler/compileBroker.cpp	2010-05-10 14:38:13.000000000 +0100
-@@ -555,6 +555,14 @@
- #endif
- #endif // COMPILER2
- 
-+#ifdef SHARK
-+#if defined(COMPILER1) || defined(COMPILER2)
-+#error "Can't use COMPILER1 or COMPILER2 with shark"
-+#endif
-+  _compilers[0] = new SharkCompiler();
-+  _compilers[1] = _compilers[0];  
-+#endif
-+  
-   // Initialize the CompileTask free list
-   _task_free_list = NULL;
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/memory/cardTableModRefBS.hpp openjdk/hotspot/src/share/vm/memory/cardTableModRefBS.hpp
---- openjdk.orig/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	2010-05-10 14:38:13.000000000 +0100
-@@ -44,6 +44,7 @@
-   friend class VMStructs;
-   friend class CardTableRS;
-   friend class CheckForUnmarkedOops; // Needs access to raw card bytes.
-+  friend class SharkBuilder;
- #ifndef PRODUCT
-   // For debugging.
-   friend class GuaranteeNotModClosure;
-diff -Nru openjdk.orig/hotspot/src/share/vm/oops/methodOop.cpp openjdk/hotspot/src/share/vm/oops/methodOop.cpp
---- openjdk.orig/hotspot/src/share/vm/oops/methodOop.cpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/oops/methodOop.cpp	2010-05-10 14:38:13.000000000 +0100
-@@ -751,10 +751,14 @@
-   }
- 
-   OrderAccess::storestore();
-+#ifdef SHARK
-+  mh->_from_interpreted_entry = code->instructions_begin();
-+#else
-   mh->_from_compiled_entry = code->verified_entry_point();
-   OrderAccess::storestore();
-   // Instantly compiled code can execute.
-   mh->_from_interpreted_entry = mh->get_i2c_entry();
-+#endif // SHARK
- 
- }
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/deoptimization.cpp openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/deoptimization.cpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp	2010-05-10 14:38:13.000000000 +0100
-@@ -254,6 +254,7 @@
- 
-   }
- 
-+#ifndef SHARK
-   // Compute the caller frame based on the sender sp of stub_frame and stored frame sizes info.
-   CodeBlob* cb = stub_frame.cb();
-   // Verify we have the right vframeArray
-@@ -270,6 +271,10 @@
-   assert(cb->is_deoptimization_stub() || cb->is_uncommon_trap_stub(), "just checking");
-   Events::log("fetch unroll sp " INTPTR_FORMAT, unpack_sp);
- #endif
-+#else
-+  intptr_t* unpack_sp = stub_frame.sender(&dummy_map).unextended_sp();
-+#endif // !SHARK
-+  
-   // This is a guarantee instead of an assert because if vframe doesn't match
-   // we will unpack the wrong deoptimized frame and wind up in strange places
-   // where it will be very difficult to figure out what went wrong. Better
-@@ -380,7 +385,9 @@
- 
-   frame_pcs[0] = deopt_sender.raw_pc();
- 
-+#ifndef SHARK
-   assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc");
-+#endif // SHARK
- 
-   UnrollBlock* info = new UnrollBlock(array->frame_size() * BytesPerWord,
-                                       caller_adjustment * BytesPerWord,
-@@ -1073,7 +1093,7 @@
- JRT_END
- 
- 
--#ifdef COMPILER2
-+#if defined(COMPILER2) || defined(SHARK)
- void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) {
-   // in case of an unresolved klass entry, load the class.
-   if (constant_pool->tag_at(index).is_unresolved_klass()) {
-@@ -1835,7 +1855,7 @@
-     if (xtty != NULL)  xtty->tail("statistics");
-   }
- }
--#else // COMPILER2
-+#else // COMPILER2 || SHARK
- 
- 
- // Stubs for C1 only system.
-@@ -1871,4 +1891,4 @@
-   return buf;
- }
- 
--#endif // COMPILER2
-+#endif // COMPILER2 || SHARK
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/globals.cpp openjdk/hotspot/src/share/vm/runtime/globals.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/globals.cpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/runtime/globals.cpp	2010-05-10 14:38:13.000000000 +0100
-@@ -181,6 +181,18 @@
-   #define C2_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{C2 notproduct}", DEFAULT },
- #endif
- 
-+#define SHARK_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark product}", DEFAULT },
-+#define SHARK_PD_PRODUCT_FLAG_STRUCT(type, name, doc)     { #type, XSTR(name), &name, "{Shark pd product}", DEFAULT },
-+#define SHARK_DIAGNOSTIC_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark diagnostic}", DEFAULT },
-+#ifdef PRODUCT
-+  #define SHARK_DEVELOP_FLAG_STRUCT(type, name, value, doc) /* flag is constant */
-+  #define SHARK_PD_DEVELOP_FLAG_STRUCT(type, name, doc)     /* flag is constant */
-+  #define SHARK_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc)
-+#else
-+  #define SHARK_DEVELOP_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark}", DEFAULT },
-+  #define SHARK_PD_DEVELOP_FLAG_STRUCT(type, name, doc)     { #type, XSTR(name), &name, "{Shark pd}", DEFAULT },
-+  #define SHARK_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, "{Shark notproduct}", DEFAULT },
-+#endif
- 
- static Flag flagTable[] = {
-  RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_STRUCT, RUNTIME_PD_DEVELOP_FLAG_STRUCT, RUNTIME_PRODUCT_FLAG_STRUCT, RUNTIME_PD_PRODUCT_FLAG_STRUCT, RUNTIME_DIAGNOSTIC_FLAG_STRUCT, RUNTIME_EXPERIMENTAL_FLAG_STRUCT, RUNTIME_NOTPRODUCT_FLAG_STRUCT, RUNTIME_MANAGEABLE_FLAG_STRUCT, RUNTIME_PRODUCT_RW_FLAG_STRUCT, RUNTIME_LP64_PRODUCT_FLAG_STRUCT)
-@@ -194,6 +206,9 @@
- #ifdef COMPILER2
-  C2_FLAGS(C2_DEVELOP_FLAG_STRUCT, C2_PD_DEVELOP_FLAG_STRUCT, C2_PRODUCT_FLAG_STRUCT, C2_PD_PRODUCT_FLAG_STRUCT, C2_DIAGNOSTIC_FLAG_STRUCT, C2_EXPERIMENTAL_FLAG_STRUCT, C2_NOTPRODUCT_FLAG_STRUCT)
- #endif
-+#ifdef SHARK
-+ SHARK_FLAGS(SHARK_DEVELOP_FLAG_STRUCT, SHARK_PD_DEVELOP_FLAG_STRUCT, SHARK_PRODUCT_FLAG_STRUCT, SHARK_PD_PRODUCT_FLAG_STRUCT, SHARK_DIAGNOSTIC_FLAG_STRUCT, SHARK_NOTPRODUCT_FLAG_STRUCT)
-+#endif
-  {0, NULL, NULL}
- };
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp
---- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp	2010-05-10 14:37:37.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/runtime/globals.hpp	2010-05-10 14:38:13.000000000 +0100
-@@ -22,7 +22,7 @@
-  *
-  */
- 
--#if !defined(COMPILER1) && !defined(COMPILER2)
-+#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
- define_pd_global(bool, BackgroundCompilation,        false);
- define_pd_global(bool, UseTLAB,                      false);
- define_pd_global(bool, CICompileOSR,                 false);
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/vm_version.cpp openjdk/hotspot/src/share/vm/runtime/vm_version.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/vm_version.cpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/runtime/vm_version.cpp	2010-05-10 14:38:13.000000000 +0100
-@@ -94,12 +94,16 @@
- #ifdef TIERED
-   #define VMTYPE "Server"
- #else // TIERED
-+#ifdef SHARK                                                                                                             
-+  #define VMTYPE "Shark"
-+#else
- #ifdef ZERO
-   #define VMTYPE "Zero"
- #else // ZERO
-    #define VMTYPE COMPILER1_PRESENT("Client")   \
-                   COMPILER2_PRESENT("Server")
- #endif // ZERO
-+#endif // SHARK
- #endif // TIERED
- #endif // KERNEL
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/macros.hpp openjdk/hotspot/src/share/vm/utilities/macros.hpp
---- openjdk.orig/hotspot/src/share/vm/utilities/macros.hpp	2010-04-28 22:16:22.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/utilities/macros.hpp	2010-05-10 14:38:13.000000000 +0100
-@@ -151,9 +151,11 @@
- #if defined(IA32) || defined(AMD64)
- #define X86
- #define X86_ONLY(code) code
-+#define NOT_X86(code)
- #else
- #undef X86
- #define X86_ONLY(code)
-+#define NOT_X86(code) code
- #endif
- 
- #ifdef IA32
--- a/patches/icedtea-alpha-fixes.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-alpha-fixes.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,19 +1,6 @@
-diff -Nru openjdk.orig/corba/make/common/Defs-linux.gmk openjdk/corba/make/common/Defs-linux.gmk
---- openjdk.orig/corba/make/common/Defs-linux.gmk	2009-10-05 14:09:53.391582691 +0100
-+++ openjdk/corba/make/common/Defs-linux.gmk	2009-10-06 09:39:43.273589275 +0100
-@@ -176,7 +176,8 @@
-   CXXFLAGS_DBG	+= $(CC_LOWER_OPT)
- endif
- 
--CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
-+CPPFLAGS_COMMON = -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) \
-+		  -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
- 		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
- 
- ifeq ($(ARCH_DATA_MODEL), 64)
 diff -Nru openjdk.orig/hotspot/agent/src/os/linux/Makefile openjdk/hotspot/agent/src/os/linux/Makefile
---- openjdk.orig/hotspot/agent/src/os/linux/Makefile	2009-10-05 14:09:52.722332564 +0100
-+++ openjdk/hotspot/agent/src/os/linux/Makefile	2009-10-06 09:39:43.274588369 +0100
+--- openjdk.orig/hotspot/agent/src/os/linux/Makefile	2010-09-01 09:57:06.000000000 +0100
++++ openjdk/hotspot/agent/src/os/linux/Makefile	2010-09-01 10:27:09.592191147 +0100
 @@ -40,7 +40,7 @@
  
  LIBS     = -lthread_db
@@ -33,27 +20,14 @@
  test: test.o
  	$(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS)
 diff -Nru openjdk.orig/hotspot/src/share/vm/oops/generateOopMap.cpp openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp
---- openjdk.orig/hotspot/src/share/vm/oops/generateOopMap.cpp	2009-10-05 02:24:10.384274774 +0100
-+++ openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp	2009-10-06 09:39:43.276589489 +0100
-@@ -2117,7 +2117,7 @@
-   // We do not distinguish between different types of errors for verification
-   // errors.  Let the verifier give a better message.
-   const char *msg = "Illegal class file encountered. Try running with -Xverify:all";
--  error_work(msg, NULL);
-+  report_error(msg, NULL);
+--- openjdk.orig/hotspot/src/share/vm/oops/generateOopMap.cpp	2010-08-27 19:15:27.000000000 +0100
++++ openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp	2010-09-01 10:28:08.943025196 +0100
+@@ -2104,7 +2104,7 @@
+ void GenerateOopMap::report_error(const char *format, ...) {
+   va_list ap;
+   va_start(ap, format);
+-  error_work(format, ap);
++  report_error(format, ap);
  }
  
- //
-diff -Nru openjdk.orig/jdk/make/common/Defs-linux.gmk openjdk/jdk/make/common/Defs-linux.gmk
---- openjdk.orig/jdk/make/common/Defs-linux.gmk	2009-10-05 14:09:53.392583324 +0100
-+++ openjdk/jdk/make/common/Defs-linux.gmk	2009-10-06 09:39:50.428589918 +0100
-@@ -194,7 +194,8 @@
-   CXXFLAGS_DBG	+= $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
- endif
- 
--CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
-+CPPFLAGS_COMMON = -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) \
-+		  -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
- 		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
- 
- ifeq ($(ARCH_DATA_MODEL), 64)
+ void GenerateOopMap::verify_error(const char *format, ...) {
--- a/patches/icedtea-clean-crypto.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-clean-crypto.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,7 +1,7 @@
 diff -Nru openjdk.orig/jdk/make/javax/crypto/Makefile openjdk/jdk/make/javax/crypto/Makefile
---- openjdk.orig/jdk/make/javax/crypto/Makefile	2009-08-07 02:44:13.000000000 +0100
-+++ openjdk/jdk/make/javax/crypto/Makefile	2009-08-07 11:26:43.000000000 +0100
-@@ -156,7 +156,8 @@
+--- openjdk.orig/jdk/make/javax/crypto/Makefile	2010-07-29 21:55:27.000000000 +0100
++++ openjdk/jdk/make/javax/crypto/Makefile	2010-09-01 10:37:32.926684780 +0100
+@@ -157,7 +157,8 @@
  #
  
  ifdef OPENJDK
@@ -12,8 +12,8 @@
  ifeq ($(strip $(FILES_java)),)
  all:
 diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java openjdk/jdk/src/share/classes/javax/crypto/Cipher.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java	2009-08-07 02:57:08.000000000 +0100
-+++ openjdk/jdk/src/share/classes/javax/crypto/Cipher.java	2009-08-07 11:26:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java	2010-07-29 21:55:43.000000000 +0100
++++ openjdk/jdk/src/share/classes/javax/crypto/Cipher.java	2010-09-01 10:37:32.926684780 +0100
 @@ -144,12 +144,6 @@
      // The transformation
      private String transformation;
@@ -336,18 +336,18 @@
  
      /**
 diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JarVerifier.java openjdk/jdk/src/share/classes/javax/crypto/JarVerifier.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/JarVerifier.java	2009-08-07 02:57:08.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/JarVerifier.java	2010-07-29 21:55:43.000000000 +0100
 +++ openjdk/jdk/src/share/classes/javax/crypto/JarVerifier.java	1970-01-01 01:00:00.000000000 +0100
 @@ -1,157 +0,0 @@
 -/*
-- * Copyright 2007-2009 Sun Microsystems, Inc.  All Rights Reserved.
+- * Copyright (c) 2007, 2009, 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.  Sun designates this
+- * published by the Free Software Foundation.  Oracle designates this
 - * particular file as subject to the "Classpath" exception as provided
-- * by Sun in the LICENSE file that accompanied this code.
+- * 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
@@ -359,9 +359,9 @@
 - * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-- * CA 95054 USA or visit www.sun.com if you need additional information or
-- * have any questions.
+- * 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 javax.crypto;
@@ -497,8 +497,8 @@
 -    }
 -}
 diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java	2009-08-07 02:57:08.000000000 +0100
-+++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java	2009-08-07 11:31:24.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java	2010-07-29 21:55:43.000000000 +0100
++++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java	2010-09-01 10:37:32.934684089 +0100
 @@ -27,8 +27,6 @@
  
  import java.util.*;
@@ -797,18 +797,18 @@
      }
  }
 diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurityManager.java openjdk/jdk/src/share/classes/javax/crypto/JceSecurityManager.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurityManager.java	2009-08-07 02:57:08.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurityManager.java	2010-07-29 21:55:43.000000000 +0100
 +++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurityManager.java	1970-01-01 01:00:00.000000000 +0100
 @@ -1,252 +0,0 @@
 -/*
-- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
+- * Copyright (c) 1999, 2007, 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.  Sun designates this
+- * published by the Free Software Foundation.  Oracle designates this
 - * particular file as subject to the "Classpath" exception as provided
-- * by Sun in the LICENSE file that accompanied this code.
+- * 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
@@ -820,9 +820,9 @@
 - * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-- * CA 95054 USA or visit www.sun.com if you need additional information or
-- * have any questions.
+- * 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 javax.crypto;
@@ -1053,8 +1053,8 @@
 -    }
 -}
 diff -Nru openjdk.orig/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java openjdk/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java
---- openjdk.orig/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2009-08-07 02:57:11.000000000 +0100
-+++ openjdk/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2009-08-07 11:26:43.000000000 +0100
+--- openjdk.orig/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2010-07-29 21:56:21.000000000 +0100
++++ openjdk/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2010-09-01 10:37:32.934684089 +0100
 @@ -44,18 +44,9 @@
          }
      }
--- a/patches/icedtea-demos.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-demos.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -252,12 +252,6 @@
  # Build jar file
 --- openjdkb18/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
 +++ openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2007-08-23 16:12:58.000000000 -0400
-@@ -1,4 +1,4 @@
--#
-+
- # Copyright 2004-2005 Sun Microsystems, Inc.  All Rights Reserved.
- #
- # Redistribution and use in source and binary forms, with or without
 @@ -43,7 +43,7 @@
  
  # Source lists
--- a/patches/icedtea-doc-headers.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/docs/Makefile openjdk/jdk/make/docs/Makefile
---- openjdk.orig/jdk/make/docs/Makefile	2009-04-14 15:55:52.000000000 +0100
-+++ openjdk/jdk/make/docs/Makefile	2009-04-15 23:13:07.000000000 +0100
-@@ -78,34 +78,19 @@
- 
- TAGS = $(IGNORED_TAGS:%=-tag %:X) $(TAG_JLS3)
- 
--ifeq ($(MILESTONE), fcs)
--    DOCTITLE_SWITCH = $(JAVADOCTITLE)
--    WINDOWTITLE_SWITCH = $(JAVADOCWINDOWTITLE)
--    HEADER_SWITCH = $(JAVADOCHEADER)
--    TOPOPTION=
--    JAVADOCBOTTOM_SWITCH= $(JAVADOCBOTTOM)
--    OVERVIEW_OPTION = -overview $(JAVADOCOVERVIEW)
--else
--    DOCTITLE_SWITCH = $(JAVADOCTITLE_EARLYACCESS)$(DRAFT)
--    WINDOWTITLE_SWITCH = $(JAVADOCWINDOWTITLE)" $(BUILD_NUMBER)"
--    HEADER_SWITCH = $(JAVADOCHEADER)$(DRAFT)
--    JAVADOCBOTTOM_SWITCH= $(JAVADOCBOTTOM_EARLYACCESS)
--    TOPOPTION= -top $(JAVADOCTOP_EARLYACCESS)
--    OVERVIEW_OPTION =
--endif
-+DOCTITLE_SWITCH = $(JAVADOCTITLE)
-+WINDOWTITLE_SWITCH = $(JAVADOCWINDOWTITLE)" $(BUILD_NUMBER)"
-+HEADER_SWITCH = $(JAVADOCHEADER)
-+TOPOPTION=
-+JAVADOCBOTTOM_SWITCH= $(JAVADOCBOTTOM)
-+OVERVIEW_OPTION = -overview $(JAVADOCOVERVIEW)
- 
- JAVADOCTITLE  = 'Java$(TRADEMARK) Platform, Standard Edition $(JDK_MINOR_VERSION)<br>API Specification'
- JAVADOCWINDOWTITLE  = 'Java Platform SE $(JDK_MINOR_VERSION)'
- JAVADOCHEADER = '<strong>Java$(TRADEMARK)&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(JDK_MINOR_VERSION)</strong>'
--JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="{@docroot}/../../webnotes/devdocs-vs-specs.html">Java SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to <a href="{@docroot}/../legal/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>'
-+JAVADOCBOTTOM = '<font size="-1"><a href="http://icedtea.classpath.org/bugzilla/">Submit a bug or feature</a> <p>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All rights reserved. Use is subject to the terms of the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.</font>'
- JAVADOCOVERVIEW = $(SHARE_SRC)/classes/overview-core.html
- 
--#
--# Early access top and bottom text (for snapshots, beta and rc)
--#
--JAVADOCTOP_EARLYACCESS = '<div style="background-color: \#EEEEEE"> <div style="padding: 6px; margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: 6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, sans-serif; font-weight: normal;"> Please note that this documentation is not final and is subject to change. </div> </div>'
--JAVADOCBOTTOM_EARLYACCESS = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a> <p>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to <a href="{@docroot}/../legal/license.html">license terms</a>.</font>'
--JAVADOCTITLE_EARLYACCESS = $(subst Specification,Documentation,$(JAVADOCTITLE))
- 
- #
- # Variables used by domapidocs target
-@@ -117,12 +102,11 @@
-                     -doctitle $(DOMAPI_JAVADOCTITLE)          \
-                     -windowtitle $(DOMAPI_JAVADOCWINDOWTITLE) \
-                     -header $(DOMAPI_JAVADOCHEADER)           \
--                    -bottom $(DOMAPI_JAVADOCBOTTOM)           \
-+                    -bottom $(JAVADOCBOTTOM)           \
-                     -group $(DOMAPI_GROUPNAME) $(DOMAPI_REGEXP)
- DOMAPI_JAVADOCTITLE  = 'Common DOM API'
- DOMAPI_JAVADOCWINDOWTITLE  = 'Common DOM API'
- DOMAPI_JAVADOCHEADER = '<strong>Common DOM API</strong>'
--DOMAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.<br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. 4150 Network Circle<br>Santa Clara, California, 95054, U.S.A.  All Rights Reserved.</font>'
- DOMAPI_GROUPNAME = "Packages"
- DOMAPI_REGEXP = "com.sun.java.browser.dom:org.w3c.dom*"
- # DOMAPI_PKGS is located in NON_CORE_PKGS.gmk
-@@ -136,13 +120,12 @@
-                     -doctitle $(MIRROR_JAVADOCTITLE)            \
-                     -windowtitle $(MIRROR_JAVADOCWINDOWTITLE)   \
-                     -header $(MIRROR_JAVADOCHEADER)             \
--                    -bottom $(MIRROR_JAVADOCBOTTOM)             \
-+                    -bottom $(JAVADOCBOTTOM)             	\
-                     -group $(MIRROR_GROUPNAME) $(MIRROR_REGEXP) \
-                     -overview $(MIRROR_OVERVIEW)
- MIRROR_JAVADOCTITLE = 'Mirror API'
- MIRROR_JAVADOCWINDOWTITLE = 'Mirror API'
- MIRROR_JAVADOCHEADER = '<strong>Mirror API</strong>'
--MIRROR_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
- MIRROR_GROUPNAME = "Packages"
- MIRROR_OVERVIEW = $(IMPORTSRCDIR)/com/sun/mirror/overview.html
- MIRROR_REGEXP = "com.sun.mirror.*"
-@@ -160,12 +143,11 @@
-                     -doctitle $(DOCLETAPI_JAVADOCTITLE)          \
-                     -windowtitle $(DOCLETAPI_JAVADOCWINDOWTITLE) \
-                     -header $(DOCLETAPI_JAVADOCHEADER)           \
--                    -bottom $(DOCLETAPI_JAVADOCBOTTOM)           \
-+                    -bottom $(JAVADOCBOTTOM)           \
-                     -group $(DOCLETAPI_GROUPNAME) $(DOCLETAPI_REGEXP)
- DOCLETAPI_JAVADOCTITLE  = 'Doclet API'
- DOCLETAPI_JAVADOCWINDOWTITLE  = 'Doclet API'
- DOCLETAPI_JAVADOCHEADER = '<strong>Doclet API</strong>'
--DOCLETAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-$(THIS_YEAR) Sun Microsystems, Inc. 4150 Network Circle<br>Santa Clara, California, 95054, U.S.A.  All Rights Reserved.</font>'
- DOCLETAPI_GROUPNAME = "Packages"
- DOCLETAPI_REGEXP = "com.sun.javadoc"
- DOCLETAPI_LINKOPT = -linkoffline ../../../../api $(DOCSDIR)/api/
-@@ -179,8 +161,7 @@
- 		    -encoding ascii			        \
-                     -nonavbar                                   \
-                     -noindex                                    \
--                    -bottom $(TAGLETAPI_JAVADOCBOTTOM)
--TAGLETAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-$(THIS_YEAR) Sun Microsystems, Inc. 4150 Network Circle<br>Santa Clara, California, 95054, U.S.A.  All Rights Reserved.</font>'
-+                    -bottom $(JAVADOCBOTTOM)
- # TAGLETAPI_FILE is located in NON_CORE_PKGS.gmk
- 
- #
-@@ -197,6 +178,7 @@
-                    -windowtitle $(JDI_WINDOWTITLE)               \
-                    -doctitle $(JDI_DOCTITLE)                     \
-                    -header $(JDI_HEADER)                         \
-+                   -bottom $(JAVADOCBOTTOM)             	\
-                    -linkoffline ../../../../api $(DOCSDIR)/api/     \
-                    -overview $(JPDA_SOURCEPATH)/jdi-overview.html
- JDI_WINDOWTITLE = "Java Debug Interface"
-@@ -204,9 +186,6 @@
- JDI_HEADER      = "Java Debug Interface"
- # JDI_PKGS is located in NON_CORE_PKGS.gmk
- 
--# Variables used by security components
--SECURITYAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
--
- #
- # Variables used by JAAS target
- #
-@@ -224,7 +203,7 @@
-                    -windowtitle $(JAAS_WINDOWTITLE)              \
-                    -doctitle $(JAAS_DOCTITLE)                    \
-                    -header $(JAAS_JAVADOCHEADER)                 \
--                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
-+                   -bottom $(JAVADOCBOTTOM)                      \
-                    -linkoffline ../../../../../api $(DOCSDIR)/api/	 \
-                    -overview $(TOPDIR)/src/share/classes/com/sun/security/auth/jaas-overview.html
- JAAS_WINDOWTITLE = "Java Authentication and Authorization Service "
-@@ -247,7 +226,7 @@
-                    -windowtitle $(JGSS_WINDOWTITLE)             \
-                    -doctitle $(JGSS_DOCTITLE)                   \
-                    -header $(JGSS_JAVADOCHEADER)                \
--                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
-+                   -bottom $(JAVADOCBOTTOM)                      \
-                    -linkoffline ../../../../../api $(DOCSDIR)/api/ \
-                    -overview $(JGSS_SOURCEPATH)/com/sun/security/jgss/jgss-overview.html
- 
-@@ -271,7 +250,7 @@
-                    -windowtitle $(SMARTCARDIO_WINDOWTITLE)             \
-                    -doctitle $(SMARTCARDIO_DOCTITLE)                   \
-                    -header $(SMARTCARDIO_JAVADOCHEADER)                \
--                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
-+                   -bottom $(JAVADOCBOTTOM)                      \
-                    -linkoffline ../../../../../api $(DOCSDIR)/api/
- 
- SMARTCARDIO_WINDOWTITLE = "Java Smart Card I/O"
-@@ -316,6 +295,7 @@
-                    -windowtitle $(HTTPSERVER_WINDOWTITLE)             \
-                    -doctitle $(HTTPSERVER_DOCTITLE)                   \
-                    -header $(HTTPSERVER_JAVADOCHEADER)                \
-+                   -bottom $(JAVADOCBOTTOM)             	\
-                    -linkoffline ../../../../../api $(DOCSDIR)/api/
- 
- HTTPSERVER_WINDOWTITLE = "Java HTTP Server"
-@@ -351,6 +331,7 @@
-                      -windowtitle $(MGMT_WINDOWTITLE)              \
-                      -doctitle $(MGMT_DOCTITLE)                    \
-                      -header $(MGMT_HEADER)                        \
-+                     -bottom $(JAVADOCBOTTOM)             	\
- 		     -linkoffline ../../../../api $(DOCSDIR)/api/  \
-                      -overview $(MGMT_SOURCEPATH)/com/sun/management/mgmt-overview.html
- MGMT_WINDOWTITLE = "Monitoring and Management Interface for the Java Platform"
-@@ -372,6 +353,7 @@
-                    -windowtitle $(ATTACH_WINDOWTITLE)               	\
-                    -doctitle $(ATTACH_DOCTITLE)                     	\
-                    -header $(ATTACH_HEADER)                         	\
-+                   -bottom $(JAVADOCBOTTOM)             	\
- 		   -linkoffline ../../../../api $(DOCSDIR)/api/
- ATTACH_WINDOWTITLE = "Attach API"
- ATTACH_DOCTITLE    = "Attach API"
-@@ -392,6 +374,7 @@
-                    -windowtitle $(JCONSOLE_WINDOWTITLE)               	\
-                    -doctitle $(JCONSOLE_DOCTITLE)                     	\
-                    -header $(JCONSOLE_HEADER)                         	\
-+                   -bottom $(JAVADOCBOTTOM)             	\
- 		   -linkoffline ../../../../api $(DOCSDIR)/api/
- JCONSOLE_WINDOWTITLE = "JConsole API"
- JCONSOLE_DOCTITLE    = "JConsole API"
-@@ -407,7 +390,7 @@
-                     -doctitle $(TREEAPI_JAVADOCTITLE)            \
-                     -windowtitle $(TREEAPI_JAVADOCWINDOWTITLE)   \
-                     -header $(TREEAPI_JAVADOCHEADER)             \
--                    -bottom $(TREEAPI_JAVADOCBOTTOM)             \
-+                    -bottom $(JAVADOCBOTTOM)                     \
-                     -group $(TREEAPI_GROUPNAME) $(TREEAPI_REGEXP) 
- #
- #	            -overview $(TREEAPI_OVERVIEW)
-@@ -415,7 +398,6 @@
- TREEAPI_JAVADOCTITLE = 'Compiler Tree API'
- TREEAPI_JAVADOCWINDOWTITLE = 'Compiler Tree API'
- TREEAPI_JAVADOCHEADER = '<strong>Compiler Tree API</strong>'
--TREEAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
- TREEAPI_GROUPNAME = "Packages"
- TREEAPI_OVERVIEW = $(SHARE_SRC)/classes/com/sun/source/overview.html
- TREEAPI_REGEXP = "com.sun.source.*"
--- a/patches/icedtea-freetypeversion.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-freetypeversion.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,9 +1,10 @@
---- openjdk/jdk/make/common/shared/Defs-versions.gmk.orig	2009-05-23 23:41:57.000000000 +0200
-+++ openjdk/jdk/make/common/shared/Defs-versions.gmk	2009-05-23 23:42:04.000000000 +0200
+diff -Nru openjdk.orig/jdk/make/common/shared/Defs-versions.gmk openjdk/jdk/make/common/shared/Defs-versions.gmk
+--- openjdk.orig/jdk/make/common/shared/Defs-versions.gmk	2010-08-27 19:16:10.000000000 +0100
++++ openjdk/jdk/make/common/shared/Defs-versions.gmk	2010-08-31 19:07:12.239786010 +0100
 @@ -192,7 +192,7 @@
  # Generic
  REQUIRED_ANT_VER          = 1.6.3
- REQUIRED_BOOT_VER         = 1.5
+ REQUIRED_BOOT_VER         = 1.6
 -REQUIRED_FREETYPE_VERSION = 2.3.0
 +REQUIRED_FREETYPE_VERSION = 2.2.1
  REQUIRED_MAKE_VER         = 3.78
--- a/patches/icedtea-javafiles.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-javafiles.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,6 +1,6 @@
 diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2008-08-14 08:39:29.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2008-08-20 23:37:00.000000000 +0100
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2010-09-01 19:20:12.256298401 +0100
 @@ -62,7 +62,6 @@
  	com/sun/corba/se/impl/encoding/TypeCodeInputStream.java \
  	com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java \
@@ -13,8 +13,8 @@
 +	com/sun/corba/se/impl/encoding/IDLJavaSerializationInputStream.java \
 +	com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java
 diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2008-08-14 08:39:29.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2008-08-20 23:37:00.000000000 +0100
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2010-09-01 19:20:12.264297713 +0100
 @@ -66,4 +66,5 @@
  	com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java \
  	com/sun/corba/se/impl/ior/iiop/MaxStreamFormatVersionComponentImpl.java \
@@ -23,8 +23,8 @@
 +	com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java \
 +	com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java
 diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2008-08-14 08:39:29.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2008-08-20 23:37:00.000000000 +0100
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2010-09-01 19:20:12.264297713 +0100
 @@ -81,4 +81,5 @@
  	com/sun/corba/se/impl/orbutil/graph/Node.java \
  	com/sun/corba/se/impl/orbutil/graph/NodeData.java \
@@ -33,8 +33,8 @@
 +	com/sun/corba/se/impl/orbutil/graph/GraphImpl.java \
 +	com/sun/corba/se/impl/orbutil/GetPropertyAction.java
 diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2008-08-14 08:39:29.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2008-08-20 23:37:00.000000000 +0100
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2010-09-01 19:20:12.264297713 +0100
 @@ -81,5 +81,5 @@
  	com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_1.java \
  	com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_2.java \
@@ -44,8 +44,8 @@
 +	com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java \
 +	com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyOrReplyMessage.java
 diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2008-08-14 08:39:29.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2008-08-20 23:37:00.000000000 +0100
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2010-09-01 19:20:12.264297713 +0100
 @@ -30,6 +30,7 @@
  	com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java \
  	com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java \
@@ -55,8 +55,8 @@
  	com/sun/corba/se/spi/monitoring/MonitoredObject.java \
  	com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java \
 diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2008-08-14 08:39:29.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2008-08-20 23:37:00.000000000 +0100
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2010-09-01 19:20:12.264297713 +0100
 @@ -29,5 +29,6 @@
  	com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java \
  	com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java \
@@ -65,8 +65,8 @@
  	com/sun/corba/se/spi/presentation/rmi/StubAdapter.java
  
 diff -Nru openjdk.orig/jdk/make/java/java/FILES_java.gmk openjdk/jdk/make/java/java/FILES_java.gmk
---- openjdk.orig/jdk/make/java/java/FILES_java.gmk	2008-08-14 08:42:49.000000000 +0100
-+++ openjdk/jdk/make/java/java/FILES_java.gmk	2008-08-20 23:37:00.000000000 +0100
+--- openjdk.orig/jdk/make/java/java/FILES_java.gmk	2010-07-29 21:55:26.000000000 +0100
++++ openjdk/jdk/make/java/java/FILES_java.gmk	2010-09-01 19:20:12.268297371 +0100
 @@ -29,6 +29,80 @@
  # will generate header files
  #
@@ -146,9 +146,9 @@
 +    java/lang/CharacterDataPrivateUse.java \
 +    java/lang/CharacterDataUndefined.java \
      java/lang/Object.java \
+     java/lang/AutoCloseable.java \
      java/lang/Class.java \
-     java/lang/Thread.java \
-@@ -135,13 +209,6 @@
+@@ -138,13 +212,6 @@
      java/lang/Readable.java \
      java/lang/Override.java \
      java/lang/SuppressWarnings.java \
--- a/patches/icedtea-linker-libs-order.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-linker-libs-order.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,7 +1,7 @@
 diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
---- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2009-09-21 18:42:07.000000000 +0100
-+++ openjdk/jdk/make/com/sun/java/pack/Makefile	2009-09-21 18:47:23.000000000 +0100
-@@ -74,12 +74,12 @@
+--- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2010-09-01 10:55:50.000000000 +0100
++++ openjdk/jdk/make/com/sun/java/pack/Makefile	2010-09-01 15:54:07.312808721 +0100
+@@ -75,12 +75,12 @@
  	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
  	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
  
@@ -16,7 +16,7 @@
  CXXFLAGS_DBG += -DFULL
  CXXFLAGS_OPT += -DPRODUCT
  CXXFLAGS_COMMON += -DFULL
-@@ -96,12 +96,11 @@
+@@ -97,12 +97,11 @@
    RES = $(OBJDIR)/$(PGRM).res
  else
    LDOUTPUT = -o #Have a space 
@@ -31,19 +31,19 @@
  endif
  endif #LINUX
  endif #PLATFORM
-@@ -144,7 +143,7 @@
+@@ -148,7 +147,7 @@
  
  $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) updatefiles winres
  	$(prep-target)
 -	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
 +	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(OTHER_LDLIBS) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
  ifdef MT
- 	$(MT) /manifest $(TEMPDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
+ 	$(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
  endif
 diff -Nru openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile openjdk/jdk/make/javax/sound/jsoundalsa/Makefile
---- openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile	2009-03-30 17:23:03.000000000 +0100
-+++ openjdk/jdk/make/javax/sound/jsoundalsa/Makefile	2009-09-21 18:47:23.000000000 +0100
-@@ -65,7 +65,7 @@
+--- openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile	2010-07-29 21:55:27.000000000 +0100
++++ openjdk/jdk/make/javax/sound/jsoundalsa/Makefile	2010-09-01 15:54:07.312808721 +0100
+@@ -66,7 +66,7 @@
  	$(MIDIFILES_export) \
  	$(PORTFILES_export)
  
--- a/patches/icedtea-print-lsb-release.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-print-lsb-release.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,10 +1,11 @@
---- openjdk/hotspot/src/os/linux/vm/os_linux.cpp~	2007-12-14 08:57:02.000000000 +0100
-+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2008-01-19 16:20:24.206979233 +0100
-@@ -1757,6 +1757,37 @@
+diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2010-08-27 19:15:27.000000000 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2010-08-31 18:50:26.191830872 +0100
+@@ -1888,6 +1888,37 @@
    return true;
  }
  
-+bool _print_debian_lsb_file(const char* filename, outputStream* st) {
++bool _print_lsb_file(const char* filename, outputStream* st) {
 +  int fd = open(filename, O_RDONLY);
 +  if (fd == -1) {
 +     return false;
@@ -38,11 +39,11 @@
  void os::print_dll_info(outputStream *st) {
     st->print_cr("Dynamic libraries:");
  
-@@ -1785,6 +1816,7 @@
+@@ -1916,6 +1947,7 @@
        !_print_ascii_file("/etc/SuSE-release", st) &&
        !_print_ascii_file("/etc/turbolinux-release", st) &&
        !_print_ascii_file("/etc/gentoo-release", st) &&
-+      !_print_debian_lsb_file("/etc/lsb-release", st) &&
-       !_print_ascii_file("/etc/debian_version", st)) {
-       st->print("Linux");
-   }
++      !_print_lsb_file("/etc/lsb-release", st) &&
+       !_print_ascii_file("/etc/debian_version", st) &&
+       !_print_ascii_file("/etc/ltib-release", st) &&
+       !_print_ascii_file("/etc/angstrom-version", st)) {
--- a/patches/icedtea-rhino.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-rhino.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,17 +1,19 @@
 diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/os.cpp openjdk/hotspot/src/share/vm/runtime/os.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/os.cpp	2010-01-25 14:41:13.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/os.cpp	2010-05-04 13:07:43.000000000 +0100
-@@ -884,6 +884,7 @@
-         "%/lib/jsse.jar:"
+--- openjdk.orig/hotspot/src/share/vm/runtime/os.cpp	2010-08-27 19:15:27.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/os.cpp	2010-09-01 18:12:38.850408989 +0100
+@@ -1033,6 +1033,9 @@
          "%/lib/jce.jar:"
          "%/lib/charsets.jar:"
+ 
++        // IcedTea addition to support Rhino via javax.script
 +	"%/lib/rhino.jar:"
-         "%/classes";
-     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
-     if (sysclasspath == NULL) return false;
++
+         // ## TEMPORARY hack to keep the legacy launcher working when
+         // ## only the boot module is installed (cf. j.l.ClassLoader)
+         "%/lib/modules/jdk.boot.jar:"
 diff -Nru openjdk.orig/jdk/make/com/sun/Makefile openjdk/jdk/make/com/sun/Makefile
---- openjdk.orig/jdk/make/com/sun/Makefile	2010-04-28 22:05:26.000000000 +0100
-+++ openjdk/jdk/make/com/sun/Makefile	2010-05-04 13:08:15.000000000 +0100
+--- openjdk.orig/jdk/make/com/sun/Makefile	2010-07-29 21:55:26.000000000 +0100
++++ openjdk/jdk/make/com/sun/Makefile	2010-09-01 18:08:22.164610031 +0100
 @@ -31,13 +31,6 @@
  PRODUCT = sun
  include $(BUILDDIR)/common/Defs.gmk
@@ -27,7 +29,7 @@
  SUBDIRS = java security net/ssl jarsigner
  
 @@ -45,7 +38,7 @@
- SUBDIRS_desktop    = image inputmethods
+ SUBDIRS_desktop    = image
  SUBDIRS_enterprise = crypto/provider jndi \
                       org xml rowset net/httpserver
 -SUBDIRS_misc       = $(SCRIPT_SUBDIR) tracing servicetag nio demo
@@ -36,8 +38,8 @@
  # Omit mirror since it's built with the apt tool.
  SUBDIRS_tools      = tools
 diff -Nru openjdk.orig/jdk/make/com/sun/script/Makefile openjdk/jdk/make/com/sun/script/Makefile
---- openjdk.orig/jdk/make/com/sun/script/Makefile	2010-02-22 15:15:16.000000000 +0000
-+++ openjdk/jdk/make/com/sun/script/Makefile	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/make/com/sun/script/Makefile	2010-07-29 21:55:26.000000000 +0100
++++ openjdk/jdk/make/com/sun/script/Makefile	2010-09-01 18:08:22.168609689 +0100
 @@ -32,6 +32,8 @@
  
  AUTO_FILES_JAVA_DIRS = com/sun/script
@@ -48,9 +50,9 @@
  # Files that need to be copied
  #
 diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
---- openjdk.orig/jdk/make/common/Release.gmk	2010-05-04 12:50:37.000000000 +0100
-+++ openjdk/jdk/make/common/Release.gmk	2010-05-04 13:07:43.000000000 +0100
-@@ -774,6 +774,7 @@
+--- openjdk.orig/jdk/make/common/Release.gmk	2010-09-01 18:03:55.000000000 +0100
++++ openjdk/jdk/make/common/Release.gmk	2010-09-01 18:08:22.168609689 +0100
+@@ -798,6 +798,7 @@
  	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
  	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
  	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
@@ -59,8 +61,8 @@
  	$(CD) $(JRE_IMAGE_DIR)/lib && \
  	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2010-09-01 18:08:22.168609689 +0100
 @@ -24,7 +24,7 @@
   */
  
@@ -71,8 +73,8 @@
  import java.util.*;
  
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2010-09-01 18:08:22.168609689 +0100
 @@ -26,7 +26,7 @@
  package com.sun.script.javascript;
  
@@ -83,8 +85,8 @@
  /**
   * This class implements Rhino-like JavaAdapter to help implement a Java
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2010-09-01 18:08:22.168609689 +0100
 @@ -25,7 +25,7 @@
  
  package com.sun.script.javascript;
@@ -95,8 +97,8 @@
  
  /**
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2010-09-01 18:08:22.168609689 +0100
 @@ -26,7 +26,7 @@
  package com.sun.script.javascript;
  
@@ -107,8 +109,8 @@
  /**
   * This class prevents script access to certain sensitive classes.
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2010-09-01 18:08:22.168609689 +0100
 @@ -25,7 +25,7 @@
  
  package com.sun.script.javascript;
@@ -119,8 +121,8 @@
  /**
   * Represents compiled JavaScript code.
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2010-09-01 18:08:22.168609689 +0100
 @@ -26,7 +26,7 @@
  package com.sun.script.javascript;
  import javax.script.*;
@@ -131,8 +133,8 @@
  
  /**
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2010-09-01 18:08:22.168609689 +0100
 @@ -26,7 +26,7 @@
  package com.sun.script.javascript;
  import com.sun.script.util.*;
@@ -143,8 +145,8 @@
  import java.io.*;
  import java.util.*;
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2010-09-01 18:08:22.168609689 +0100
 @@ -25,7 +25,7 @@
  
  package com.sun.script.javascript;
@@ -155,8 +157,8 @@
  
  /**
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2010-05-04 12:49:42.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2010-05-04 13:07:43.000000000 +0100
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2010-09-01 18:08:22.168609689 +0100
 @@ -27,7 +27,7 @@
  
  import java.lang.reflect.*;
--- a/patches/icedtea-shark-build.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/java/redist/Makefile openjdk/jdk/make/java/redist/Makefile
---- openjdk.orig/jdk/make/java/redist/Makefile	2009-10-26 21:42:20.000000000 +0000
-+++ openjdk/jdk/make/java/redist/Makefile	2009-10-29 16:33:44.000000000 +0000
-@@ -96,11 +96,13 @@
- 
- # Hotspot client is only available on 32-bit non-Zero builds
- ifneq ($(ZERO_BUILD), true)
-+ifndef ICEDTEA_SHARK_BUILD
- ifeq ($(ARCH_DATA_MODEL), 32)
-   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
-                  $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
- endif
- endif
-+endif
- 
- ifeq ($(PLATFORM), windows)
- #  Windows     vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  Windows
-@@ -174,6 +176,7 @@
- endif 
- 
- ifneq ($(ZERO_BUILD), true)
-+ifndef ICEDTEA_SHARK_BUILD
- ifeq ($(ARCH_DATA_MODEL), 32)
- 
- IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)
-@@ -204,6 +207,8 @@
- 
- endif # 32bit
- 
-+endif # ICEDTEA_SHARK_BUILD
-+
- endif # ZERO_BUILD
- 
- #  NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows
-diff -Nru openjdk.orig/make/hotspot-rules.gmk openjdk/make/hotspot-rules.gmk
---- openjdk.orig/make/hotspot-rules.gmk	2009-10-21 16:40:25.000000000 +0100
-+++ openjdk/make/hotspot-rules.gmk	2009-10-29 16:33:44.000000000 +0000
-@@ -72,9 +72,13 @@
-   HOTSPOT_TARGET = all_fastdebug
- endif
- 
-+ifdef ICEDTEA_SHARK_BUILD
-+  HOTSPOT_TARGET := $(HOTSPOT_TARGET)shark
-+else
- ifeq ($(ZERO_BUILD), true)
-   HOTSPOT_TARGET := $(HOTSPOT_TARGET)zero
- endif
-+endif
- 
- HOTSPOT_BUILD_ARGUMENTS += $(COMMON_BUILD_ARGUMENTS)
- HOTSPOT_BUILD_ARGUMENTS += ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
--- a/patches/icedtea-sunsrc.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-sunsrc.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,7 +1,7 @@
 diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
---- openjdk.orig/jdk/make/common/Release.gmk	2008-05-23 22:40:01.000000000 +0100
-+++ openjdk/jdk/make/common/Release.gmk	2008-05-23 22:41:52.000000000 +0100
-@@ -338,8 +338,6 @@
+--- openjdk.orig/jdk/make/common/Release.gmk	2010-08-27 19:16:10.000000000 +0100
++++ openjdk/jdk/make/common/Release.gmk	2010-08-31 18:26:34.688231634 +0100
+@@ -345,8 +345,6 @@
  # Bug 5008685 - exclude jconsole from sun/tools
  #
  TOOLS = \
@@ -10,7 +10,7 @@
  	sun/tools/asm		\
  	sun/tools/jar		\
  	sun/tools/java		\
-@@ -381,8 +379,6 @@
+@@ -389,8 +387,6 @@
  	com/sun/tools/corba     \
  	com/sun/tools/internal/xjc       \
  	com/sun/tools/internal/ws       \
@@ -19,7 +19,7 @@
  	com/sun/istack/internal/tools       \
  	com/sun/istack/internal/ws       \
          com/sun/codemodel       \
-@@ -393,7 +389,6 @@
+@@ -401,7 +397,6 @@
  	com/sun/xml/internal/dtdparser \
  	com/sun/tools/jdi	\
  	com/sun/tools/script/shell	\
@@ -27,7 +27,7 @@
  	com/sun/tools/attach	\
  	sun/tools/attach	\
  	sun/tools/jstack        \
-@@ -557,10 +552,6 @@
+@@ -565,10 +560,6 @@
  	$(ECHO) "com/sun/source/" >> $@
  	$(ECHO) "com/sun/istack/internal/tools/" >> $@
  	$(ECHO) "com/sun/istack/internal/ws/" >> $@
@@ -37,8 +37,8 @@
 -	$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
  	$(ECHO) "com/sun/tools/" >> $@
  	$(ECHO) "sun/jvmstat/" >> $@
- 	$(ECHO) "sun/rmi/rmic/" >> $@
-@@ -592,7 +583,6 @@
+ 	$(ECHO) "sun/nio/cs/ext/" >> $@
+@@ -611,7 +602,6 @@
  	$(ECHO) "javax/crypto/" >> $@
  	$(ECHO) "sun/security/internal/" >> $@
  	$(ECHO) "com/sun/crypto/provider/" >> $@
@@ -46,7 +46,7 @@
  	$(ECHO) "com/sun/tools/attach/" >> $@
  	$(ECHO) "org/relaxng/datatype/" >> $@
  	$(ECHO) "com/sun/codemodel/" >> $@
-@@ -626,6 +616,10 @@
+@@ -645,6 +635,10 @@
  	    $(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
  		-o  $@.temp $(ABS_LIBDIR)/classlist $(NOT_RT_JAR_LIST) . )
  	$(MV) $@.temp $@
--- a/patches/icedtea-systemtap.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-systemtap.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,6 +1,6 @@
 diff -Nru openjdk.orig/hotspot/make/linux/makefiles/dtrace.make openjdk/hotspot/make/linux/makefiles/dtrace.make
---- openjdk.orig/hotspot/make/linux/makefiles/dtrace.make	2010-05-14 16:02:53.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/dtrace.make	2010-06-07 17:42:38.000000000 +0100
+--- openjdk.orig/hotspot/make/linux/makefiles/dtrace.make	2010-07-29 21:54:46.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/dtrace.make	2010-09-01 20:10:41.490928687 +0100
 @@ -25,3 +25,7 @@
  # Linux does not build jvm_db
  LIBJVM_DB =
@@ -10,8 +10,8 @@
 +
 +# It doesn't support HAVE_DTRACE_H though.
 diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp
---- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp	2010-05-14 16:02:53.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/prims/jni.cpp	2010-06-07 17:42:38.000000000 +0100
+--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp	2010-08-27 19:15:27.000000000 +0100
++++ openjdk/hotspot/src/share/vm/prims/jni.cpp	2010-09-01 20:10:41.498927999 +0100
 @@ -1753,10 +1753,7 @@
  JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \
    JNIWrapper("Set" XSTR(Result) "Field"); \
@@ -37,9 +37,9 @@
    JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \
    assert(id->is_static_field_id(), "invalid static field id"); \
 diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2010-06-07 17:41:12.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2010-06-07 17:42:38.000000000 +0100
-@@ -2441,16 +2441,16 @@
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2010-09-01 19:24:41.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2010-09-01 20:10:41.498927999 +0100
+@@ -2490,16 +2490,16 @@
        FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false);
        FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true);
      } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) {
@@ -61,16 +61,16 @@
      } else if (match_option(option, "-XX:+FullGCALot", &tail)) {
        FLAG_SET_CMDLINE(bool, FullGCALot, true);
 diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp openjdk/hotspot/src/share/vm/utilities/dtrace.hpp
---- openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp	2010-05-14 16:02:53.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp	2010-06-07 17:42:38.000000000 +0100
+--- openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp	2010-07-29 21:54:53.000000000 +0100
++++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp	2010-09-01 20:12:19.582467794 +0100
 @@ -1,5 +1,6 @@
  /*
-  * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+  * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
 + * Copyright 2009 Red Hat, Inc.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
-@@ -22,14 +23,14 @@
+@@ -22,7 +23,7 @@
   *
   */
  
@@ -79,15 +79,16 @@
  
  #include <sys/sdt.h>
  
- #define DTRACE_ONLY(x) x
- #define NOT_DTRACE(x)
+@@ -33,7 +34,7 @@
+ #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \
+   do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0)
  
 -#else // ndef SOLARIS || ndef DTRACE_ENABLED
 +#else // ndef DTRACE_ENABLED
  
  #define DTRACE_ONLY(x)
  #define NOT_DTRACE(x) x
-@@ -40,9 +41,16 @@
+@@ -44,11 +45,18 @@
  #define DTRACE_PROBE3(a,b,c,d,e) {;}
  #define DTRACE_PROBE4(a,b,c,d,e,f) {;}
  #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;}
@@ -97,6 +98,8 @@
 +#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;}
 +#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;}
  
+ #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
+ 
  #endif
  
 +#if defined(SOLARIS)
@@ -104,7 +107,7 @@
  #define HS_DTRACE_PROBE_FN(provider,name)\
    __dtrace_##provider##___##name
  
-@@ -50,6 +58,11 @@
+@@ -56,6 +64,11 @@
    DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args)
  #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \
    DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args)
@@ -116,7 +119,7 @@
  
  /* Dtrace probe declarations */
  #define HS_DTRACE_PROBE_DECL(provider,name) \
-@@ -88,6 +101,8 @@
+@@ -94,6 +107,8 @@
      uintptr_t,uintptr_t,uintptr_t))
  
  /* Dtrace probe definitions */
@@ -125,7 +128,7 @@
  #define HS_DTRACE_PROBE_N(provider,name, args) \
    DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args)
  
-@@ -123,3 +138,29 @@
+@@ -129,3 +144,29 @@
    HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
      (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
      (uintptr_t)a8,(uintptr_t)a9))
--- a/patches/icedtea-testenv.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/icedtea-testenv.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,18 +1,18 @@
 diff -Nru openjdk.orig/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java openjdk/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java
---- openjdk.orig/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2009-08-24 15:09:16.000000000 +0100
-+++ openjdk/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2009-08-24 15:15:58.000000000 +0100
-@@ -40,7 +40,7 @@
+--- openjdk.orig/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2010-07-29 21:56:30.000000000 +0100
++++ openjdk/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2010-09-01 16:45:06.244592103 +0100
+@@ -39,7 +39,7 @@
+     static void test1() throws Exception {
          InetAddress bogus = InetAddress.getByName("0.0.0.0");
-         SocketChannel sc = SocketChannel.open();
          InetSocketAddress saddr = new InetSocketAddress(
 -            InetAddress.getByName(TestUtil.HOST), 23);
 +            InetAddress.getByName(TestUtil.HOST), 7);
  
          //Test1: connect only
-         sc.connect(saddr);
+         SocketChannel sc = SocketChannel.open();
 diff -Nru openjdk.orig/jdk/test/java/nio/channels/TestUtil.java openjdk/jdk/test/java/nio/channels/TestUtil.java
---- openjdk.orig/jdk/test/java/nio/channels/TestUtil.java	2009-08-24 15:09:16.000000000 +0100
-+++ openjdk/jdk/test/java/nio/channels/TestUtil.java	2009-08-24 15:15:58.000000000 +0100
+--- openjdk.orig/jdk/test/java/nio/channels/TestUtil.java	2010-07-29 21:56:30.000000000 +0100
++++ openjdk/jdk/test/java/nio/channels/TestUtil.java	2010-09-01 16:45:06.244592103 +0100
 @@ -36,9 +36,9 @@
  
      // Test hosts used by the channels tests - change these when
@@ -27,8 +27,8 @@
  
      private TestUtil() { }
 diff -Nru openjdk.orig/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh openjdk/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh
---- openjdk.orig/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2009-03-30 17:23:12.000000000 +0100
-+++ openjdk/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2009-08-24 15:15:58.000000000 +0100
+--- openjdk.orig/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2010-07-29 21:56:39.000000000 +0100
++++ openjdk/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2010-09-01 16:45:06.252591410 +0100
 @@ -26,14 +26,14 @@
  
  # @test
--- a/patches/sh4-support.patch	Thu Aug 05 14:12:08 2010 +0200
+++ b/patches/sh4-support.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -1,6 +1,6 @@
 diff -Nru openjdk.orig/corba/make/common/Defs-linux.gmk openjdk/corba/make/common/Defs-linux.gmk
---- openjdk.orig/corba/make/common/Defs-linux.gmk	2010-06-03 14:00:19.000000000 +0100
-+++ openjdk/corba/make/common/Defs-linux.gmk	2010-06-03 14:08:47.000000000 +0100
+--- openjdk.orig/corba/make/common/Defs-linux.gmk	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/corba/make/common/Defs-linux.gmk	2010-09-01 17:57:24.737476265 +0100
 @@ -109,6 +109,7 @@
  LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
  CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
@@ -9,19 +9,29 @@
  ifeq ($(ZERO_BUILD), true)
    CFLAGS_REQUIRED       =  $(ZERO_ARCHFLAG)
    ifeq ($(ZERO_ENDIANNESS), little)
-@@ -186,7 +187,7 @@
-   CXXFLAGS_DBG	+= $(CC_LOWER_OPT)
+@@ -188,11 +189,15 @@
+ 
+ CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
+ 
+-# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
+-ifneq ($(ARCH),alpha)
+-  CPP_ARCH_FLAGS += -D$(ARCH)
++# Alpha and sh archs do not like "alpha" or "sh" defined (potential general arch cleanup issue here)
++ifeq ($(ARCH),alpha)
++  CPP_ARCH_FLAGS += -D_$(ARCH)_
+ else
++ifeq ($(ARCH),sh)
+   CPP_ARCH_FLAGS += -D_$(ARCH)_
++else
++  CPP_ARCH_FLAGS += -D$(ARCH)
++endif
  endif
  
--CPPFLAGS_COMMON = -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) \
-+CPPFLAGS_COMMON = -D_$(ARCH)_ $(if $(filter $(ARCH),alpha sh),,-D$(ARCH)) \
- 		  -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
- 		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
- 
+ CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
 diff -Nru openjdk.orig/corba/make/common/shared/Platform.gmk openjdk/corba/make/common/shared/Platform.gmk
---- openjdk.orig/corba/make/common/shared/Platform.gmk	2010-06-03 14:00:19.000000000 +0100
-+++ openjdk/corba/make/common/shared/Platform.gmk	2010-06-03 14:11:30.000000000 +0100
-@@ -193,6 +193,9 @@
+--- openjdk.orig/corba/make/common/shared/Platform.gmk	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/corba/make/common/shared/Platform.gmk	2010-09-01 17:44:42.267438042 +0100
+@@ -191,6 +191,9 @@
                  arm*) \
                      echo arm \
                      ;; \
@@ -31,7 +41,7 @@
                  *) \
                      echo $(mach) \
                      ;; \
-@@ -220,6 +223,9 @@
+@@ -218,6 +221,9 @@
        else
          ARCH_DATA_MODEL=64
        endif
@@ -42,9 +52,9 @@
    endif
  
 diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
---- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2010-06-03 14:00:19.000000000 +0100
-+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2010-06-03 14:08:47.000000000 +0100
-@@ -1756,7 +1756,8 @@
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2010-09-01 17:44:42.267438042 +0100
+@@ -1770,7 +1770,8 @@
      {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"},
      {EM_MIPS,        EM_MIPS,    ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"},
      {EM_PARISC,      EM_PARISC,  ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"},
@@ -54,7 +64,7 @@
    };
  
    #if  (defined IA32)
-@@ -1787,9 +1788,11 @@
+@@ -1801,9 +1802,11 @@
      static  Elf32_Half running_arch_code=EM_MIPS;
    #elif  (defined M68K)
      static  Elf32_Half running_arch_code=EM_68K;
@@ -68,8 +78,8 @@
  
    // Identify compatability class for VM's architecture and library's architecture
 diff -Nru openjdk.orig/jdk/make/common/Defs-linux.gmk openjdk/jdk/make/common/Defs-linux.gmk
---- openjdk.orig/jdk/make/common/Defs-linux.gmk	2010-06-03 14:00:19.000000000 +0100
-+++ openjdk/jdk/make/common/Defs-linux.gmk	2010-06-03 14:08:47.000000000 +0100
+--- openjdk.orig/jdk/make/common/Defs-linux.gmk	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/jdk/make/common/Defs-linux.gmk	2010-09-01 17:58:18.296843208 +0100
 @@ -126,6 +126,7 @@
  LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
  CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
@@ -78,18 +88,28 @@
  ifeq ($(ZERO_BUILD), true)
    CFLAGS_REQUIRED       =  $(ZERO_ARCHFLAG)
    ifeq ($(ZERO_ENDIANNESS), little)
-@@ -204,7 +205,7 @@
-   CXXFLAGS_DBG	+= $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
+@@ -206,11 +207,15 @@
+ 
+ CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
+ 
+-# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
+-ifneq ($(ARCH),alpha)
+-  CPP_ARCH_FLAGS += -D$(ARCH)
++# Alpha and sh archs do not like "alpha" or "sh" defined (potential general arch cleanup issue here)
++ifeq ($(ARCH),alpha)
++  CPP_ARCH_FLAGS += -D_$(ARCH)_
+ else
++ifeq ($(ARCH),sh)
+   CPP_ARCH_FLAGS += -D_$(ARCH)_
++else
++  CPP_ARCH_FLAGS += -D$(ARCH)
++endif
  endif
  
--CPPFLAGS_COMMON = -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) \
-+CPPFLAGS_COMMON = -D_$(ARCH)_ $(if $(filter $(ARCH),alpha sh),,-D$(ARCH)) \
- 		  -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
- 		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
- 
+ CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
 diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
---- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2010-06-03 14:00:21.000000000 +0100
-+++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2010-06-03 14:08:47.000000000 +0100
+--- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2010-09-01 17:44:42.267438042 +0100
 @@ -117,6 +117,11 @@
      REQUIRED_CC_VER = 3.2
      REQUIRED_GCC_VER = 3.2.*
@@ -103,8 +123,8 @@
    SHARED_LIBRARY_FLAG = -shared -mimpure-text
    SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )
 diff -Nru openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
---- openjdk.orig/jdk/make/common/shared/Platform.gmk	2010-06-03 14:00:19.000000000 +0100
-+++ openjdk/jdk/make/common/shared/Platform.gmk	2010-06-03 14:08:47.000000000 +0100
+--- openjdk.orig/jdk/make/common/shared/Platform.gmk	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/jdk/make/common/shared/Platform.gmk	2010-09-01 17:44:42.275437349 +0100
 @@ -171,6 +171,9 @@
                  arm*) \
                      echo arm \
@@ -126,8 +146,8 @@
    endif
  
 diff -Nru openjdk.orig/jdk/make/javax/sound/SoundDefs.gmk openjdk/jdk/make/javax/sound/SoundDefs.gmk
---- openjdk.orig/jdk/make/javax/sound/SoundDefs.gmk	2010-06-03 14:00:19.000000000 +0100
-+++ openjdk/jdk/make/javax/sound/SoundDefs.gmk	2010-06-03 14:10:12.000000000 +0100
+--- openjdk.orig/jdk/make/javax/sound/SoundDefs.gmk	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/jdk/make/javax/sound/SoundDefs.gmk	2010-09-01 17:44:42.279437008 +0100
 @@ -114,9 +114,9 @@
      CPPFLAGS += -DX_ARCH=X_SPARCV9
    endif # ARCH sparcv9
@@ -142,8 +162,8 @@
  
  
 diff -Nru openjdk.orig/jdk/make/jdk_generic_profile.sh openjdk/jdk/make/jdk_generic_profile.sh
---- openjdk.orig/jdk/make/jdk_generic_profile.sh	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/make/jdk_generic_profile.sh	2010-06-03 14:10:57.000000000 +0100
+--- openjdk.orig/jdk/make/jdk_generic_profile.sh	2010-07-29 21:55:27.000000000 +0100
++++ openjdk/jdk/make/jdk_generic_profile.sh	2010-09-01 17:44:42.279437008 +0100
 @@ -349,13 +349,14 @@
      i?86)    ZERO_LIBARCH=i386      ;;
      sparc64) ZERO_LIBARCH=sparcv9   ;;
@@ -161,8 +181,8 @@
        ;;
      amd64|ppc64|s390x|sparcv9|ia64|alpha)
 diff -Nru openjdk.orig/jdk/src/share/native/com/sun/media/sound/SoundDefs.h openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h
---- openjdk.orig/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2010-06-03 14:00:19.000000000 +0100
-+++ openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2010-06-03 14:08:47.000000000 +0100
+--- openjdk.orig/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2010-09-01 17:36:18.000000000 +0100
++++ openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2010-09-01 17:44:42.279437008 +0100
 @@ -47,7 +47,8 @@
  #define X_S390X         12
  #define X_SPARC         13
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/systemtap-alloc-size-workaround.patch	Mon Sep 06 23:52:04 2010 +0100
@@ -0,0 +1,17 @@
+Generating a dwarf location expression for variable * "constant" as used
+in this probe argument triggers unforseen complications. See
+https://bugzilla.redhat.com/show_bug.cgi?id=613824
+Workaround for now by passing the size without HeapWordSize adjustment.
+See also the hotspot.object_alloc in tapset/hotspot.stp[.in].
+
+--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp	2010-05-18 20:00:22.130618755 +0200
++++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp	2010-07-28 22:53:23.662310007 +0200
+@@ -711,7 +711,7 @@
+   int size = o->size();
+   symbolOop name = klass->name();
+   HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread),
+-                   name->bytes(), name->utf8_length(), size * HeapWordSize);
++                   name->bytes(), name->utf8_length(), size);
+   return 0;
+ }
+ 
--- a/patches/xrender/icedtea-001.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5277 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/sun/font/FILES_c.gmk openjdk/jdk/make/sun/font/FILES_c.gmk
---- openjdk.orig/jdk/make/sun/font/FILES_c.gmk	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/make/sun/font/FILES_c.gmk	2010-06-02 19:03:05.000000000 +0100
-@@ -115,6 +115,7 @@
- FILES_cpp_platform =
- else
- FILES_c_platform = X11FontScaler.c \
-+                   XRTextRenderer.c \
-                    X11TextRenderer.c
- FILES_cpp_platform =
- endif
-diff -Nru openjdk.orig/jdk/make/sun/font/Makefile openjdk/jdk/make/sun/font/Makefile
---- openjdk.orig/jdk/make/sun/font/Makefile	2010-06-02 18:53:13.000000000 +0100
-+++ openjdk/jdk/make/sun/font/Makefile	2010-06-02 19:03:05.000000000 +0100
-@@ -87,6 +87,7 @@
-     sun/font/NativeStrike.java \
-     sun/font/NativeStrikeDisposer.java \
-     sun/font/X11TextRenderer.java \
-+    sun/font/XRTextRenderer.java \
-     sun/awt/X11GraphicsEnvironment.java 
- 
- endif # PLATFORM
-diff -Nru openjdk.orig/jdk/make/sun/font/mapfile-vers openjdk/jdk/make/sun/font/mapfile-vers
---- openjdk.orig/jdk/make/sun/font/mapfile-vers	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/make/sun/font/mapfile-vers	2010-06-02 19:03:05.000000000 +0100
-@@ -56,6 +56,7 @@
-                 Java_sun_font_NativeFont_getGlyphImage;
-                 Java_sun_font_NativeFont_getGlyphImageNoDefault;
-                 Java_sun_font_NativeFont_getFontMetrics;
-+                Java_sun_font_XRTextRenderer_doDrawGlyphList;
- 	local:
- 		*;
- };
-diff -Nru openjdk.orig/jdk/make/sun/font/mapfile-vers.openjdk openjdk/jdk/make/sun/font/mapfile-vers.openjdk
---- openjdk.orig/jdk/make/sun/font/mapfile-vers.openjdk	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/make/sun/font/mapfile-vers.openjdk	2010-06-02 19:03:05.000000000 +0100
-@@ -75,6 +75,7 @@
-                 Java_sun_font_FreetypeFontScaler_getUnitsPerEMNative;
-                 Java_sun_font_FreetypeFontScaler_initNativeScaler;
-                 Java_sun_font_FreetypeFontScaler_getGlyphPointNative;
-+                Java_sun_font_XRTextRenderer_doDrawGlyphList;
- 	local:
- 		*;
- };
-diff -Nru openjdk.orig/jdk/make/sun/xawt/FILES_c_unix.gmk openjdk/jdk/make/sun/xawt/FILES_c_unix.gmk
---- openjdk.orig/jdk/make/sun/xawt/FILES_c_unix.gmk	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/make/sun/xawt/FILES_c_unix.gmk	2010-06-02 19:03:05.000000000 +0100
-@@ -79,4 +79,11 @@
- 	gtk2_interface.c \
-         swing_GTKEngine.c \
-         swing_GTKStyle.c \
--        rect.c
-+        rect.c \
-+	ArrayList.c \
-+ 	MaskBuffer.c \
-+ 	XRSurfaceData.c \
-+ 	XRGlyphCache.c \
-+ 	XRTextRenderer_md.c \
-+        XRRenderer.c \
-+        XRPMBlitLoops.c
-diff -Nru openjdk.orig/jdk/make/sun/xawt/Makefile openjdk/jdk/make/sun/xawt/Makefile
---- openjdk.orig/jdk/make/sun/xawt/Makefile	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/make/sun/xawt/Makefile	2010-06-02 19:03:05.000000000 +0100
-@@ -88,7 +88,7 @@
- vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/opengl
- vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/x11
- 
--OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -ldl \
-+OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \
-                    $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
- 
- ifeq  ($(PLATFORM), solaris)
-diff -Nru openjdk.orig/jdk/make/sun/xawt/mapfile-vers openjdk/jdk/make/sun/xawt/mapfile-vers
---- openjdk.orig/jdk/make/sun/xawt/mapfile-vers	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/make/sun/xawt/mapfile-vers	2010-06-02 19:03:05.000000000 +0100
-@@ -370,6 +370,33 @@
-         Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
-         Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures;
- 
-+        Java_sun_java2d_xr_XRSurfaceData_flushNativeSurface;
-+        Java_sun_java2d_xr_XRSurfaceData_XRIsDrawableValid;
-+        Java_sun_java2d_xr_XRSurfaceData_setInvalid;
-+        Java_sun_java2d_xr_XRSurfaceData_XRInitXRender;
-+        Java_sun_java2d_xr_XRSurfaceData_initOps;
-+        Java_sun_java2d_xr_XRSurfaceData_XRSetForeground;
-+        Java_sun_java2d_xr_XRSurfaceData_XRSetComposite;
-+        Java_sun_java2d_xr_XRSurfaceData_initIDs;
-+        Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
-+	Java_sun_java2d_xr_XRSurfaceData_XRResetClip;
-+	Java_sun_java2d_xr_XRSurfaceData_XRSetTransformNative;
-+        Java_sun_java2d_xr_XRSurfaceData_XRSetFilter;
-+	Java_sun_java2d_xr_XRSurfaceData_XRSetTexturePaint;
-+	Java_sun_java2d_xr_XRSurfaceData_XRSetGradientPaint;
-+        Java_sun_java2d_xr_XRSurfaceData_XRSetLinearGradientPaint;
-+        Java_sun_java2d_xr_XRSurfaceData_XRSetRadialGradientPaint;
-+        Java_sun_java2d_xr_XRSurfaceData_XRResetPaint;
-+        Java_sun_java2d_xr_XRSurfaceData_XRSetRepeat;
-+	Java_sun_java2d_xr_XRPMBlitLoops_nativeRenderBlit;
-+	Java_sun_java2d_xr_XRRenderer_XRFillRect;
-+	Java_sun_java2d_xr_XRRenderer_XRFillSpans;
-+        Java_sun_java2d_xr_XRRenderer_XRDoPath;
-+	Java_sun_java2d_xr_XRRenderer_XRDrawLine;
-+        Java_sun_java2d_xr_XRMaskFill_maskFill;
-+	Java_sun_java2d_xr_XRMaskBlit_maskBlit;
-+	XRT_DrawGlyphList;
-+
-         Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow;
-         Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box;
-         Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box_1gap;
-diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java openjdk/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java	2010-06-02 19:03:05.000000000 +0100
-@@ -307,7 +307,7 @@
-      * linear RGB space.  Copied directly from the
-      * MultipleGradientPaintContext class.
-      */
--    private static int convertSRGBtoLinearRGB(int color) {
-+    public static int convertSRGBtoLinearRGB(int color) {
-         float input, output;
- 
-         input = color / 255.0f;
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java openjdk/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	2010-06-02 19:03:05.000000000 +0100
-@@ -37,6 +37,7 @@
- import java.util.HashMap;
- 
- import sun.java2d.opengl.GLXGraphicsConfig;
-+import sun.java2d.xr.*;
- import sun.java2d.loops.SurfaceType;
- 
- /**
-@@ -150,6 +151,8 @@
-             }
- 
-             boolean glxSupported = X11GraphicsEnvironment.isGLXAvailable();
-+            boolean xrender = X11GraphicsEnvironment.isXRenderAvailable();
-+            
-             boolean dbeSupported = isDBESupported();
-             if (dbeSupported && doubleBufferVisuals == null) {
-                 doubleBufferVisuals = new HashSet();
-@@ -165,9 +168,18 @@
-                     boolean doubleBuffer =
-                         (dbeSupported &&
-                          doubleBufferVisuals.contains(Integer.valueOf(visNum)));
--                    ret[i] = X11GraphicsConfig.getConfig(this, visNum, depth,
--                            getConfigColormap(i, screen),
--                            doubleBuffer);
-+                    
-+                    if(!xrender)
-+                    {
-+                        ret[i] = XRGraphicsConfig.getConfig(this, visNum, depth,
-+                                getConfigColormap(i, screen),
-+                                doubleBuffer);
-+                    }else
-+                    {
-+                        ret[i] = X11GraphicsConfig.getConfig(this, visNum, depth,
-+                                getConfigColormap(i, screen),
-+                                doubleBuffer);
-+                    }
-                 }
-             }
-             configs = ret;
-@@ -241,9 +253,19 @@
-                     doubleBuffer =
-                         doubleBufferVisuals.contains(Integer.valueOf(visNum));
-                 }
--                defaultConfig = X11GraphicsConfig.getConfig(this, visNum,
--                                                            depth, getConfigColormap(0, screen),
--                                                            doubleBuffer);
-+                
-+                if(X11GraphicsEnvironment.isXRenderAvailable())
-+                {
-+                	System.out.println("XRender pipeline enabled");
-+                    defaultConfig = XRGraphicsConfig.getConfig(this, visNum,
-+                            depth, getConfigColormap(0, screen),
-+                            doubleBuffer);
-+                }else
-+                {
-+                    defaultConfig = X11GraphicsConfig.getConfig(this, visNum,
-+                            depth, getConfigColormap(0, screen),
-+                            doubleBuffer);
-+                }
-             }
-         }
-     }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java openjdk/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	2010-06-02 19:03:05.000000000 +0100
-@@ -47,9 +47,9 @@
- import sun.font.Font2D;
- import sun.font.FontManager;
- import sun.font.NativeFont;
--import sun.java2d.SunGraphicsEnvironment;
--import sun.java2d.SurfaceManagerFactory;
--import sun.java2d.UnixSurfaceManagerFactory;
-+import sun.java2d.*;
-+import sun.java2d.x11.*;
-+import sun.java2d.xr.*;
- import sun.util.logging.PlatformLogger;
- 
- /**
-@@ -104,20 +104,46 @@
-                                 "pipeline (GLX 1.3 not available)");
-                         }
-                     }
-+
-+                    /*CE*/
-+                    // Now check for XRender system property
-+                    String xProp = System.getProperty("sun.java2d.xrender");
-+                        if (xProp != null) {
-+                        if (xProp.equals("true") || xProp.equals("t")) {
-+                            xRenderAvailable = true;
-+                        } else if (xProp.equals("True") || xProp.equals("T")) {
-+                            xRenderAvailable = true;
-+                            xRenderVerbose = true;
-+                        }
-+                    }
-+
-+                        if(xRenderAvailable)
-+                        {
-+                            XRSurfaceData.initXRSurfaceData();
-+                        }else
-+                        {
-+                            // X11SurfaceData.initX11SurfaceData();
-+                            // Don't initialize here the X11SurfaceData
-+                            // static initializer will do it for us later.
-+                        }
-                 }
- 
-+
-                 return null;
-             }
-          });
- 
-         // Install the correct surface manager factory.
-         SurfaceManagerFactory.setInstance(new UnixSurfaceManagerFactory());
--
-     }
- 
-     private static boolean glxAvailable;
-     private static boolean glxVerbose;
- 
-+    private static boolean xRenderAvailable; /*CE*/
-+    private static boolean xRenderVerbose;
-+    private static boolean isX11SurfaceDataInitialized = false;
-+
-     private static native boolean initGLX();
- 
-     public static boolean isGLXAvailable() {
-@@ -128,6 +154,15 @@
-         return glxVerbose;
-     }
- 
-+    /*CE*/
-+    public static boolean isXRenderAvailable() {
-+        return xRenderAvailable;
-+    }
-+
-+    public static boolean isXRenderVerbose() {
-+        return xRenderVerbose;
-+    }
-+
-     /**
-      * Checks if Shared Memory extension can be used.
-      * Returns:
-@@ -397,4 +432,14 @@
-     @Override
-     public void paletteChanged() {
-     }
-+
-+        public static boolean isX11SurfaceDataInitialized()
-+        {
-+                return isX11SurfaceDataInitialized;
-+        }
-+
-+        public static void setX11SurfaceDataInitialized()
-+        {
-+                X11GraphicsEnvironment.isX11SurfaceDataInitialized = true;
-+        }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/font/XRTextRenderer.java openjdk/jdk/src/solaris/classes/sun/font/XRTextRenderer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/font/XRTextRenderer.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/font/XRTextRenderer.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,53 @@
-+/*
-+ * Copyright 2000-2006 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+package sun.font;
-+
-+import sun.awt.SunToolkit;
-+import sun.java2d.SunGraphics2D;
-+import sun.java2d.pipe.GlyphListPipe;
-+import sun.java2d.xr.*;
-+
-+/**
-+ * A delegate pipe of SG2D for drawing any text to a XRender surface
-+ */
-+public class XRTextRenderer extends GlyphListPipe {
-+    
-+    native void doDrawGlyphList(long dstData, int numGlyphs, boolean subPixPos, boolean rgbOrder, int lcdContrast, boolean usePositions, float xOrigin, float yOrigin, long[] imgArray, float[] posArray);
-+    
-+    protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) 
-+    {
-+        try 
-+        {
-+            SunToolkit.awtLock();
-+            XRSurfaceData x11sd = (XRSurfaceData)sg2d.surfaceData;
-+    		x11sd.validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform, sg2d.paint, sg2d, 0);
-+            
-+            doDrawGlyphList(x11sd.getNativeOps(), gl.getNumGlyphs(), gl.isSubPixPos(), gl.isRGBOrder(), sg2d.lcdTextContrast, gl.usePositions(), gl.getX(), gl.getY(), gl.getImages(), gl.getPositions());
-+        } finally {
-+            SunToolkit.awtUnlock();
-+        }
-+    }
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java openjdk/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java	2010-06-02 19:03:05.000000000 +0100
-@@ -33,6 +33,7 @@
- import sun.java2d.opengl.GLXGraphicsConfig;
- import sun.java2d.opengl.GLXVolatileSurfaceManager;
- import sun.java2d.x11.X11VolatileSurfaceManager;
-+import sun.java2d.xr.*;
- 
- /**
-  * The SurfaceManagerFactory that creates VolatileSurfaceManager
-@@ -52,11 +53,14 @@
-      */
-     public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
-                                                         Object context)
--    {
-+    {    	
-         GraphicsConfiguration gc = vImg.getGraphicsConfig();
-+        
-         if (gc instanceof GLXGraphicsConfig) {
-             return new GLXVolatileSurfaceManager(vImg, context);
--        } else {
-+        } else if(gc instanceof XRGraphicsConfig) {
-+            return new XRVolatileSurfaceManager(vImg, context);
-+        }else {
-             return new X11VolatileSurfaceManager(vImg, context);
-         }
-     }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java openjdk/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	2010-06-02 19:03:05.000000000 +0100
-@@ -42,10 +42,7 @@
- import java.awt.image.Raster;
- import java.awt.peer.ComponentPeer;
- 
--import sun.awt.SunHints;
--import sun.awt.SunToolkit;
--import sun.awt.X11ComponentPeer;
--import sun.awt.X11GraphicsConfig;
-+import sun.awt.*;
- import sun.awt.image.PixelConverter;
- import sun.font.X11TextRenderer;
- import sun.java2d.InvalidPipeException;
-@@ -71,7 +68,7 @@
- 
-     protected int depth;
- 
--    private static native void initIDs(Class xorComp, boolean tryDGA);
-+    private static native void initIDs(Class xorComp, boolean tryDGA);  //OK
-     protected native void initSurface(int depth, int width, int height,
-                                       long drawable);
-     native boolean isDrawableValid();
-@@ -212,6 +209,13 @@
-     protected static boolean dgaAvailable;
- 
-     static {
-+        initX11SurfaceData();
-+    }
-+
-+    public static void initX11SurfaceData()
-+    {
-+    	if(!X11GraphicsEnvironment.isX11SurfaceDataInitialized())
-+    	{
-         if (!GraphicsEnvironment.isHeadless()) {
-             // If a screen magnifier is present, don't attempt to use DGA
-             String magPresent = (String) java.security.AccessController.doPrivileged
-@@ -245,9 +249,12 @@
-                 X11PMBlitLoops.register();
-                 X11PMBlitBgLoops.register();
-             }
--        }
-+            
-+            X11GraphicsEnvironment.setX11SurfaceDataInitialized();
-+        }    	
-+    	}
-     }
--
-+    
-     /**
-      * Returns true if we can use DGA on any of the screens
-      */
-@@ -664,7 +671,7 @@
-     {
-         // assert SunToolkit.isAWTLockHeldByCurrentThread();
- 
--        if (!isValid()) {
-+    	if (!isValid()) {
-             throw new InvalidPipeException("bounds changed");
-         }
- 
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,50 @@
-+package sun.java2d.xr;
-+
-+import java.awt.*;
-+import java.awt.geom.*;
-+
-+import sun.java2d.*;
-+import sun.java2d.loops.*;
-+import sun.java2d.pipe.*;
-+
-+
-+public class XRDrawImage extends DrawImage {
-+
-+    @Override
-+    protected void renderImageXform(SunGraphics2D sg, Image img,
-+                                    AffineTransform tx, int interpType,
-+                                    int sx1, int sy1, int sx2, int sy2,
-+                                    Color bgColor)
-+    {    	
-+            SurfaceData dstData = sg.surfaceData;
-+            SurfaceData srcData =
-+                dstData.getSourceSurfaceData(img,
-+                                             sg.TRANSFORM_GENERIC,
-+                                             sg.imageComp,
-+                                             bgColor);
-+
-+            if (srcData != null && !isBgOperation(srcData, bgColor) && srcData instanceof XRSurfaceData)
-+            {
-+                SurfaceType srcType = srcData.getSurfaceType();
-+                SurfaceType dstType = dstData.getSurfaceType();
-+                
-+                ((XRSurfaceData) srcData).setPreferredInterpolation(XRUtils.ATransOpToXRQuality(interpType));
-+                
-+                TransformBlit blit = TransformBlit.getFromCache(srcType,
-+                                                                sg.imageComp,
-+                                                                dstType);
-+
-+                if (blit != null) {
-+                    blit.Transform(srcData, dstData,
-+                                   sg.composite, sg.getCompClip(),
-+                                   tx, interpType,
-+                                   sx1, sy1, 0, 0, sx2-sx1, sy2-sy1);
-+                    return;
-+                }
-+       
-+        }
-+
-+        super.renderImageXform(sg, img, tx, interpType,  sx1, sy1, sx2, sy2, bgColor);
-+    }
-+}
-+
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,42 @@
-+/*
-+ * To change this template, choose Tools | Templates
-+ * and open the template in the editor.
-+ */
-+
-+package sun.java2d.xr;
-+
-+import sun.awt.*;
-+import sun.awt.image.*;
-+import sun.java2d.*;
-+
-+/**
-+ *
-+ * @author ce
-+ */
-+public class XRGraphicsConfig extends X11GraphicsConfig
-+implements SurfaceManager.ProxiedGraphicsConfig
-+{
-+	private XRGraphicsConfig(X11GraphicsDevice device, int visualnum, int depth, int colormap, boolean doubleBuffer)
-+    {
-+		super(device, visualnum, depth, colormap, doubleBuffer);
-+    }
-+    
-+    public SurfaceData createSurfaceData(X11ComponentPeer peer) {
-+        return XRSurfaceData.createData(peer);
-+    }
-+	
-+    public static XRGraphicsConfig getConfig(X11GraphicsDevice device,
-+            int visualnum, int depth,
-+            int colormap, boolean doubleBuffer)
-+    {
-+        if (!X11GraphicsEnvironment.isXRenderAvailable()) {
-+            return null;
-+        }
-+        
-+        return new XRGraphicsConfig(device, visualnum, depth, colormap, doubleBuffer);
-+    }
-+    
-+    public Object getProxyKey() {
-+        return this;
-+    }
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,71 @@
-+package sun.java2d.xr;
-+
-+import static sun.java2d.loops.CompositeType.SrcNoEa;
-+import static sun.java2d.loops.CompositeType.SrcOver;
-+import static sun.java2d.loops.SurfaceType.IntArgb;
-+import static sun.java2d.loops.SurfaceType.IntArgbPre;
-+import static sun.java2d.loops.SurfaceType.IntRgb;
-+
-+import java.awt.AlphaComposite;
-+import java.awt.Composite;
-+
-+import sun.awt.*;
-+import sun.java2d.*;
-+import sun.java2d.loops.*;
-+import sun.java2d.pipe.Region;
-+
-+public class XRMaskBlit extends MaskBlit
-+{
-+	static void register()
-+	{
-+		GraphicsPrimitive[] primitives = 
-+		{ 
-+				new XRMaskBlit(IntArgbPre, SrcOver, IntArgbPre), 
-+				new XRMaskBlit(IntRgb, SrcOver, IntRgb), 
-+				new XRMaskBlit(IntArgbPre, SrcNoEa, IntRgb), 
-+				new XRMaskBlit(IntRgb, SrcNoEa, IntArgbPre)
-+		};
-+		GraphicsPrimitiveMgr.register(primitives);
-+	}
-+
-+	public XRMaskBlit(SurfaceType srcType, CompositeType compType, SurfaceType dstType)
-+	{
-+		super(srcType, CompositeType.AnyAlpha, dstType);
-+	}
-+
-+	protected native void maskBlit(long srcXsdo, long dstxsdo, long alphaXsdo, int srcx, int srcy, int dstx, int dsty, int w, int h, int maskoff, int maskscan, int masklen, byte[] mask);
-+
-+	
-+	static XRSurfaceData alphaPM;
-+	static int alphaWidth = 0, alphaHeight = 0;
-+	public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan)
-+	{
-+		if (width <= 0 || height <= 0)
-+		{
-+			return;
-+		}
-+
-+		try
-+		{
-+			SunToolkit.awtLock();
-+			
-+			if (alphaPM == null || alphaWidth < width || alphaHeight < height)
-+			{
-+				alphaPM = XRSurfaceData.createData(((XRSurfaceData) dst).graphicsConfig, width, height);
-+				alphaWidth = width;
-+				alphaHeight = height;
-+			}
-+
-+			XRSurfaceData x11sd = (XRSurfaceData) src;
-+			x11sd.validateAsSource(null, XRUtils.RepeatNone);
-+			
-+			XRSurfaceData x11dst = (XRSurfaceData) dst;
-+			x11dst.validate(clip, comp, null, null, null, 0);
-+			
-+			maskBlit(src.getNativeOps(), dst.getNativeOps(), alphaPM.getNativeOps(), srcx, srcy, dstx, dsty, width, height, maskoff, maskscan, mask != null ? mask.length : 0, mask);
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,75 @@
-+package sun.java2d.xr;
-+
-+import static sun.java2d.loops.CompositeType.SrcNoEa;
-+import static sun.java2d.loops.CompositeType.SrcOver;
-+import static sun.java2d.loops.SurfaceType.AnyColor;
-+import static sun.java2d.loops.SurfaceType.GradientPaint;
-+import static sun.java2d.loops.SurfaceType.LinearGradientPaint;
-+import static sun.java2d.loops.SurfaceType.OpaqueColor;
-+import static sun.java2d.loops.SurfaceType.OpaqueGradientPaint;
-+import static sun.java2d.loops.SurfaceType.OpaqueLinearGradientPaint;
-+import static sun.java2d.loops.SurfaceType.OpaqueRadialGradientPaint;
-+import static sun.java2d.loops.SurfaceType.OpaqueTexturePaint;
-+import static sun.java2d.loops.SurfaceType.RadialGradientPaint;
-+import static sun.java2d.loops.SurfaceType.TexturePaint;
-+import static sun.java2d.pipe.BufferedOpCodes.MASK_FILL;
-+
-+import java.awt.*;
-+import java.awt.geom.*;
-+import java.awt.geom.Rectangle2D.Float;
-+import java.awt.image.*;
-+
-+import sun.awt.*;
-+import sun.java2d.*;
-+import sun.java2d.loops.*;
-+import sun.java2d.opengl.*;
-+import sun.java2d.pipe.*;
-+
-+public class XRMaskFill extends MaskFill
-+{
-+	static void register()
-+	{
-+		GraphicsPrimitive[] primitives = { new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntRgbX11), new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueGradientPaint, SrcNoEa, XRSurfaceData.IntRgbX11),
-+				new XRMaskFill(LinearGradientPaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa, XRSurfaceData.IntRgbX11), new XRMaskFill(RadialGradientPaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa, XRSurfaceData.IntRgbX11),
-+				new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueTexturePaint, SrcNoEa, XRSurfaceData.IntRgbX11),
-+
-+				new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntArgbX11), new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueGradientPaint, SrcNoEa, XRSurfaceData.IntArgbX11),
-+				new XRMaskFill(LinearGradientPaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa, XRSurfaceData.IntArgbX11), new XRMaskFill(RadialGradientPaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa, XRSurfaceData.IntArgbX11),
-+				new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueTexturePaint, SrcNoEa, XRSurfaceData.IntArgbX11) };
-+
-+		GraphicsPrimitiveMgr.register(primitives);
-+	}
-+
-+	protected XRMaskFill(SurfaceType srcType, CompositeType compType, SurfaceType surfaceType)
-+	{
-+		super(srcType, compType, surfaceType);
-+	}
-+
-+	protected native void maskFill(long xsdo, long alphaXsdo, int x, int y, int w, int h, int maskoff, int maskscan, int masklen, byte[] mask);
-+
-+	static XRSurfaceData alphaPM;
-+	static int alphaWidth = 0, alphaHeight = 0;
-+
-+	public void MaskFill(SunGraphics2D sg2d, SurfaceData sData, Composite comp, final int x, final int y, final int w, final int h, final byte[] mask, final int maskoff, final int maskscan)
-+	{
-+		try
-+		{
-+			SunToolkit.awtLock();
-+
-+			XRSurfaceData x11sd = (XRSurfaceData) sData;
-+			x11sd.validate(sg2d.getCompClip(), sg2d.getComposite(), sg2d.getTransform(), sg2d.getPaint(), sg2d, 0);
-+
-+			if (alphaPM == null || alphaWidth < w || alphaHeight < h)
-+			{
-+				alphaPM = XRSurfaceData.createData(((XRSurfaceData) sData).graphicsConfig, w, h);
-+				alphaWidth = w;
-+				alphaHeight = h;
-+			}
-+
-+			maskFill(sData.getNativeOps(), alphaPM.getNativeOps(), x, y, w, h, maskoff, maskscan, mask != null ? mask.length : 0, mask);
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,206 @@
-+/*
-+ * Copyright 2000-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+package sun.java2d.xr;
-+
-+import sun.awt.SunToolkit;
-+import sun.java2d.loops.*;
-+import sun.java2d.opengl.*;
-+import sun.java2d.pipe.Region;
-+import sun.java2d.SurfaceData;
-+import java.awt.*;
-+import java.awt.geom.*;
-+import java.awt.image.*;
-+
-+/**
-+ * X11PMBlitLoops
-+ *
-+ * This class accelerates Blits between two surfaces of types *PM.  Since
-+ * the onscreen surface is of that type and some of the offscreen surfaces
-+ * may be of that type (if they were created via X11OffScreenImage), then
-+ * this type of Blit will accelerated double-buffer copies between those
-+ * two surfaces.
-+*/
-+public class XRPMBlitLoops
-+{
-+
-+	public static void register()
-+	{
-+		GraphicsPrimitive[] primitives = {
-+		
-+				new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11), new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11), new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11), new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
-+
-+				new X11PMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11), new X11PMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11), new X11PMScaledBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11), new X11PMScaledBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
-+
-+				new X11PMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11), new X11PMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11), new X11PMTransformedBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11), new X11PMTransformedBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
-+
-+				/*TODO Allow blits from argb surfaces too*/
-+		};
-+		GraphicsPrimitiveMgr.register(primitives);
-+	}
-+
-+	/**
-+	 * Blit
-+	 * This native method is where all of the work happens in the
-+	 * accelerated Blit.
-+	 */
-+	public static native void nativeRenderBlit(long srcData, long dstData, int sx, int sy, int dx, int dy, int w, int h);
-+
-+	static AffineTransform identityTransform = AffineTransform.getTranslateInstance(0, 0);
-+	static double[] tmpCoord = new double[4];
-+}
-+
-+class X11PMBlit extends Blit
-+{
-+	public X11PMBlit(SurfaceType srcType, SurfaceType dstType)
-+	{
-+		super(srcType, CompositeType.AnyAlpha, dstType);
-+	}
-+
-+	public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h)
-+	{
-+		try
-+		{
-+			SunToolkit.awtLock();
-+
-+			XRSurfaceData x11sdDst = (XRSurfaceData) dst;
-+			x11sdDst.validate(clip, comp, null, null, null, 0);
-+			XRSurfaceData x11sdSrc = (XRSurfaceData) src;
-+	
-+			x11sdSrc.validateAsSource(null, XRUtils.RepeatNone, XRUtils.FAST);
-+
-+			XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), sx, sy, dx, dy, w, h);
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+}
-+
-+class X11PMScaledBlit extends ScaledBlit
-+{
-+	public X11PMScaledBlit(SurfaceType srcType, SurfaceType dstType)
-+	{
-+		super(srcType, CompositeType.AnyAlpha, dstType);
-+	}
-+
-+	public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2)
-+	{
-+		try
-+		{
-+			SunToolkit.awtLock();
-+
-+			XRSurfaceData x11sdDst = (XRSurfaceData) dst;
-+			x11sdDst.validate(clip, comp, null, null, null, 0);
-+			XRSurfaceData x11sdSrc = (XRSurfaceData) src;
-+
-+			double xScale = (dx2 - dx1) / (sx2 - sx1);
-+			double yScale = (dy2 - dy1) / (sy2 - sy1);
-+
-+			sx1 *= xScale;
-+			sx2 *= xScale;
-+			sy1 *= yScale;
-+			sy2 *= yScale;
-+
-+			AffineTransform xForm = AffineTransform.getScaleInstance(1 / xScale, 1 / yScale);
-+
-+			x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST);
-+
-+			XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), (int) sx1, (int) sy1, (int) dx1, (int) dy1, (int) (dx2 - dx1), (int) (dy2 - dy1));
-+
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+}
-+
-+/**
-+ * Called also if scale+transform is set
-+ * @author Clemens Eisserer
-+ */
-+class X11PMTransformedBlit extends TransformBlit
-+{
-+	public X11PMTransformedBlit(SurfaceType srcType, SurfaceType dstType)
-+	{
-+		super(srcType, CompositeType.AnyAlpha, dstType);
-+	}
-+
-+	public void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform xform, int hint, int srcx, int srcy, int dstx, int dsty, int width, int height)
-+	{
-+		try
-+		{			
-+			SunToolkit.awtLock();
-+
-+			XRSurfaceData x11sdDst = (XRSurfaceData) dst;
-+			x11sdDst.validate(clip, comp, null, null, null, 0);
-+			XRSurfaceData x11sdSrc = (XRSurfaceData) src;
-+
-+			boolean needClip =  (xform.getScaleX() != 0.0f) || (xform.getShearY() != 0.0f);
-+			try
-+			{				
-+				/*Calculate area which will be covered by the transform-blit*/
-+				Rectangle2D.Float rect = new Rectangle2D.Float(dstx, dsty, width, height);
-+				Shape shp = xform.createTransformedShape(rect);
-+				Rectangle bounds = shp.getBounds();
-+				
-+				AffineTransform sourceTrans = (AffineTransform) xform.clone();
-+				sourceTrans.translate(-srcx, -srcy);
-+			
-+//				System.out.println("srcx "+srcx+" srcy:"+srcy+" dstx:"+dstx+" dsty:"+dsty+" width:"+width+" height:"+height);
-+//				System.out.println("Dest-Translation: x:"+xform.getTranslateX()+" y:"+xform.getTranslateY());
-+				
-+				//AffineTransform sourceTransform = new AffineTransform(xform.getScaleX(), xform.getShearY(), xform.getShearX(), xform.getScaleY(), 0, 0);
-+				//sourceTransform.translate(-srcx, -srcy);
-+				
-+				sourceTrans.invert();
-+			    
-+				
-+			    //x11sdSrc.validateAsSource(sourceTrans, XRUtils.RepeatPad); /*Pad avoids smearing, but falls back to software*/
-+				x11sdSrc.validateAsSource(sourceTrans, XRUtils.RepeatNone);
-+
-+				
-+				if(needClip)
-+				{
-+			        x11sdDst.setShapeClip(shp);
-+				}
-+				
-+			    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), 0, 0, 0, 0, bounds.x + bounds.width, bounds.y + bounds.height);// bounds.x, bounds.y, bounds.width, bounds.height);//(int) (maxX - minX), (int) (maxY - minY));
-+		
-+			    if(needClip)
-+			    {
-+			        x11sdDst.resetShapeClip();
-+			    }
-+			   
-+			} catch (Exception ex)
-+			{
-+				ex.printStackTrace();
-+			}
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+}
-\ No newline at end of file
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,255 @@
-+package sun.java2d.xr;
-+
-+import java.awt.*;
-+import java.awt.geom.*;
-+
-+import sun.awt.SunToolkit;
-+import sun.java2d.SunGraphics2D;
-+import sun.java2d.pipe.Region;
-+import sun.java2d.pipe.PixelDrawPipe;
-+import sun.java2d.pipe.PixelFillPipe;
-+import sun.java2d.pipe.ShapeDrawPipe;
-+import sun.java2d.pipe.SpanIterator;
-+import sun.java2d.pipe.ShapeSpanIterator;
-+import sun.java2d.pipe.LoopPipe;
-+
-+public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe
-+{
-+	public XRRenderer()
-+	{}
-+
-+	public static XRRenderer getInstance()
-+	{
-+		return new XRRenderer();
-+		//	return (GraphicsPrimitive.tracingEnabled() ? new X11TracingRenderer() : new X11Renderer());
-+	}
-+
-+	private final void validate(SunGraphics2D sg2d)
-+	{
-+		// NOTE: getCompClip() will revalidateAll() if the
-+		// surfaceData is invalid.  This should ensure that
-+		// the clip and pixel that we are validating against
-+		// are the most current.
-+		//
-+		// The assumption is that the pipeline after that
-+		// revalidation will either be another X11 pipe
-+		// (because the drawable format never changes on X11)
-+		// or a null pipeline if the surface is disposed.
-+		//
-+		// Since we do not get the ops structure of the SurfaceData
-+		// until the actual call down to the native level we will
-+		// pick up the most recently validated copy.
-+		// Note that if the surface is disposed, a NullSurfaceData
-+		// (with null native data structure) will be set in
-+		// sg2d, so we have to protect against it in native code.
-+
-+		XRSurfaceData x11sd = (XRSurfaceData) sg2d.surfaceData;
-+		x11sd.validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform, sg2d.paint, sg2d, 0);
-+	}
-+
-+	native void XRDrawLine(long pXSData, int x1, int y1, int x2, int y2);
-+
-+	public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2)
-+	{
-+		try
-+		{
-+			SunToolkit.awtLock();
-+			
-+			validate(sg2d);
-+			int transx = sg2d.transX;
-+			int transy = sg2d.transY;
-+			XRDrawLine(sg2d.surfaceData.getNativeOps(), x1 + transx, y1 + transy, x2 + transx, y2 + transy);
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+
-+	public void drawRect(SunGraphics2D sg2d, int x, int y, int width, int height)
-+	{
-+		draw(sg2d, new Rectangle2D.Float(x, y, width, height));
-+	}
-+
-+	public void drawPolyline(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints)
-+	{
-+		throw new RuntimeException("Not implemented");
-+	}
-+
-+	public void drawPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints)
-+	{
-+		draw(sg2d, new Polygon(xpoints, ypoints, npoints));
-+	}
-+
-+	native void XRFillRect(long pXSData, int x, int y, int width, int height);
-+
-+	public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height)
-+	{
-+		SunToolkit.awtLock();
-+		try
-+		{
-+			validate(sg2d);
-+
-+			x += sg2d.transform.getTranslateX();
-+			y += sg2d.transform.getTranslateY();
-+			XRFillRect(sg2d.surfaceData.getNativeOps(), x, y, width, height);
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+
-+	public void fillPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints)
-+	{
-+		fill(sg2d, new Polygon(xpoints, ypoints, npoints));
-+	}
-+
-+	public void drawRoundRect(SunGraphics2D sg2d, int x, int y, int width, int height, int arcWidth, int arcHeight)
-+	{
-+		draw(sg2d, new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight));
-+	}
-+
-+	public void fillRoundRect(SunGraphics2D sg2d, int x, int y, int width, int height, int arcWidth, int arcHeight)
-+	{
-+		fill(sg2d, new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight));
-+	}
-+
-+	public void drawOval(SunGraphics2D sg2d, int x, int y, int width, int height)
-+	{
-+		draw(sg2d, new Ellipse2D.Float(x, y, width, height));
-+	}
-+
-+	public void fillOval(SunGraphics2D sg2d, int x, int y, int width, int height)
-+	{
-+		fill(sg2d, new Ellipse2D.Float(x, y, width, height));
-+	}
-+
-+	public void drawArc(SunGraphics2D sg2d, int x, int y, int width, int height, int startAngle, int arcAngle)
-+	{
-+		draw(sg2d, new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN));
-+	}
-+
-+	public void fillArc(SunGraphics2D sg2d, int x, int y, int width, int height, int startAngle, int arcAngle)
-+	{
-+		fill(sg2d, new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE));
-+	}
-+
-+	native void XRFillSpans(long pXSData, SpanIterator si, long iterator, int transx, int transy);
-+
-+	native void XRDoPath(SunGraphics2D sg2d, long pXSData, int transX, int transY, Path2D.Float p2df, boolean isFill);
-+
-+	private void doPath(SunGraphics2D sg2d, Shape s, boolean isFill)
-+	{
-+		Path2D.Float p2df;
-+		int transx, transy;
-+		if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE)
-+		{
-+			if (s instanceof Path2D.Float)
-+			{
-+				p2df = (Path2D.Float) s;
-+			} else
-+			{
-+				p2df = new Path2D.Float(s);
-+			}
-+			transx = sg2d.transX;
-+			transy = sg2d.transY;
-+		} else
-+		{
-+			p2df = new Path2D.Float(s, sg2d.transform);
-+			transx = 0;
-+			transy = 0;
-+		}
-+		
-+		try
-+		{
-+			SunToolkit.awtLock();
-+			validate(sg2d);
-+			XRDoPath(sg2d, sg2d.surfaceData.getNativeOps(), transx, transy, p2df, isFill);
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+
-+	public void draw(SunGraphics2D sg2d, Shape s)
-+	{
-+
-+		if (sg2d.strokeState == sg2d.STROKE_THIN)
-+		{
-+			doPath(sg2d, s, false);
-+			return;
-+		}
-+		
-+		if (sg2d.strokeState < sg2d.STROKE_CUSTOM)
-+		{
-+			ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
-+			try
-+			{
-+				try
-+				{
-+					SunToolkit.awtLock();
-+					validate(sg2d);
-+					XRFillSpans(sg2d.surfaceData.getNativeOps(), si, si.getNativeIterator(), 0, 0);
-+				} finally
-+				{
-+					SunToolkit.awtUnlock();
-+				}
-+			} finally
-+			{
-+				si.dispose();
-+			}
-+		} else
-+		{
-+			fill(sg2d, sg2d.stroke.createStrokedShape(s));
-+		}
-+	}
-+
-+	public void fill(SunGraphics2D sg2d, Shape s)
-+	{
-+		if (sg2d.strokeState == sg2d.STROKE_THIN)
-+		{
-+			doPath(sg2d, s, true);
-+			return;
-+		}
-+
-+		AffineTransform at;
-+		int transx, transy;
-+		if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE)
-+		{
-+			// Transform (translation) will be done by XFillSpans
-+			at = null;
-+			transx = sg2d.transX;
-+			transy = sg2d.transY;
-+		} else
-+		{
-+			// Transform will be done by the PathIterator
-+			at = sg2d.transform;
-+			transx = transy = 0;
-+		}
-+
-+		ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
-+		try
-+		{
-+			// Subtract transx/y from the SSI clip to match the
-+			// (potentially untranslated) geometry fed to it
-+			Region clip = sg2d.getCompClip();
-+			ssi.setOutputAreaXYXY(clip.getLoX() - transx, clip.getLoY() - transy, clip.getHiX() - transx, clip.getHiY() - transy);
-+			ssi.appendPath(s.getPathIterator(at));
-+			try
-+			{
-+				SunToolkit.awtLock();
-+				
-+				validate(sg2d);
-+				XRFillSpans(sg2d.surfaceData.getNativeOps(), ssi, ssi.getNativeIterator(), transx, transy);
-+			} finally
-+			{
-+				SunToolkit.awtUnlock();
-+			}
-+		} finally
-+		{
-+			ssi.dispose();
-+		}
-+	}
-+
-+	native void devCopyArea(long sdOps, long xgc, int srcx, int srcy, int dstx, int dsty, int w, int h);
-+
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,1017 @@
-+/*
-+ * Copyright 1999-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+package sun.java2d.xr;
-+
-+import java.awt.*;
-+import java.awt.MultipleGradientPaint.*;
-+import java.awt.Transparency;
-+import java.awt.geom.*;
-+import java.awt.image.*;
-+import sun.awt.*;
-+import sun.awt.image.PixelConverter;
-+import sun.font.*;
-+import sun.java2d.InvalidPipeException;
-+import sun.java2d.SunGraphics2D;
-+import sun.java2d.SurfaceData;
-+import sun.java2d.SurfaceDataProxy;
-+import sun.java2d.loops.*;
-+import sun.java2d.pipe.*;
-+import static sun.java2d.xr.XRUtils.XDoubleToFixed;
-+
-+public abstract class XRSurfaceData extends SurfaceData
-+{
-+	X11ComponentPeer peer;
-+	XRGraphicsConfig graphicsConfig;
-+	private RenderLoops solidloops;
-+
-+	protected int depth;
-+
-+	private static native void initIDs(boolean gradCache);
-+
-+	protected native void XRInitSurface(int depth, int width, int height, long drawable, int pictFormat);
-+
-+	native boolean XRIsDrawableValid();
-+
-+	protected native void flushNativeSurface();
-+
-+	native void XRInitXRender(long xsdo, int pictForm);
-+
-+	public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap";
-+	public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap";
-+	public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap";
-+
-+	public static final SurfaceType ByteA8X11 = SurfaceType.ByteGray.deriveSubType(DESC_BYTE_A8_X11);
-+	public static final SurfaceType IntRgbX11 = SurfaceType.IntRgb.deriveSubType(DESC_INT_RGB_X11);
-+	public static final SurfaceType IntArgbX11 = SurfaceType.IntArgbPre.deriveSubType(DESC_INT_ARGB_X11);
-+
-+	public Raster getRaster(int x, int y, int w, int h)
-+	{
-+		throw new InternalError("not implemented yet");
-+	}
-+
-+	protected XRRenderer x11pipe;
-+	protected PixelToShapeConverter x11txpipe;
-+	protected TextPipe x11textpipe;
-+	protected XRDrawImage xrDrawImage;
-+
-+	public static void initXRSurfaceData()
-+	{
-+		if (!X11GraphicsEnvironment.isX11SurfaceDataInitialized())
-+		{
-+			boolean cacheGradients = true;
-+			String xProp = System.getProperty("sun.java2d.xrgradcache");
-+			if (xProp != null)
-+			{
-+				cacheGradients = !(xProp.equalsIgnoreCase("false") || xProp.equalsIgnoreCase("f"));
-+			}
-+
-+			initIDs(cacheGradients);
-+
-+			XRPMBlitLoops.register();
-+			XRMaskFill.register();
-+			XRMaskBlit.register();
-+
-+			X11GraphicsEnvironment.setX11SurfaceDataInitialized();
-+		}
-+	}
-+
-+	protected boolean isDrawableValid()
-+	{
-+		try
-+		{
-+			SunToolkit.awtLock();
-+			return XRIsDrawableValid();
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+
-+	@Override
-+	public SurfaceDataProxy makeProxyFor(SurfaceData srcData)
-+	{
-+		return XRSurfaceDataProxy.createProxy(srcData, graphicsConfig);
-+	}
-+
-+	public void validatePipe(SunGraphics2D sg2d)
-+	{
-+	        TextPipe textpipe;
-+	        boolean validated = false;
-+
-+	        if (/* CompositeType.SrcNoEa (any color) */
-+	            (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
-+	             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)        ||
-+
-+	            /* CompositeType.SrcOver (any color) */
-+	            (sg2d.compositeState == SunGraphics2D.COMP_ALPHA    &&
-+	             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
-+	             (((AlphaComposite)sg2d.composite).getRule() ==
-+	              AlphaComposite.SRC_OVER)))
-+	        {
-+	            textpipe = x11textpipe;
-+	        } else {
-+	            // do this to initialize textpipe correctly; we will attempt
-+	            // to override the non-text pipes below
-+	            super.validatePipe(sg2d);
-+	            textpipe = sg2d.textpipe;
-+	            validated = true;
-+	        }
-+
-+	        PixelToShapeConverter txPipe = null;
-+	        XRRenderer nonTxPipe = null;
-+
-+	        if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) 
-+	        {
-+	            if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
-+	                if (sg2d.compositeState < sg2d.COMP_XOR) {
-+	                    txPipe = x11txpipe;
-+	                    nonTxPipe = x11pipe;
-+	                }
-+	            } else if (sg2d.compositeState <= sg2d.COMP_ALPHA) {
-+	                if (isPaintValid(sg2d)) {
-+	                    txPipe = x11txpipe;
-+	                    nonTxPipe = x11pipe;
-+	                }
-+	                // custom paints handled by super.validatePipe() below
-+	            }
-+	        }
-+
-+	        if (txPipe != null) {
-+	            if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
-+	                sg2d.drawpipe = txPipe;
-+	                sg2d.fillpipe = txPipe;
-+	            } else if (sg2d.strokeState != sg2d.STROKE_THIN) {
-+	                sg2d.drawpipe = txPipe;
-+	                sg2d.fillpipe = nonTxPipe;
-+	            } else {
-+	                sg2d.drawpipe = nonTxPipe;
-+	                sg2d.fillpipe = nonTxPipe;
-+	            }
-+	            sg2d.shapepipe = nonTxPipe;
-+	        } else {
-+	            if (!validated) {
-+	                super.validatePipe(sg2d);
-+	            }
-+	        }
-+
-+	        // install the text pipe based on our earlier decision
-+	        sg2d.textpipe = textpipe;
-+
-+	        // always override the image pipe with the specialized OGL pipe
-+	        sg2d.imagepipe = xrDrawImage;
-+		
-+//		
-+//		if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON && /*sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&*/(sg2d.compositeState <= sg2d.COMP_ALPHA || sg2d.compositeState == sg2d.COMP_XOR))
-+//		{
-+//			if (x11txpipe == null)
-+//			{
-+//				/*
-+//				 * Note: this is thread-safe since x11txpipe is the
-+//				 * second of the two pipes constructed in makePipes().
-+//				 * In the rare case we are racing against another
-+//				 * thread making new pipes, setting lazypipe is a
-+//				 * safe alternative to waiting for the other thread.
-+//				 */
-+//				sg2d.drawpipe = lazypipe;
-+//				sg2d.fillpipe = lazypipe;
-+//				sg2d.shapepipe = lazypipe;
-+//				sg2d.imagepipe = lazypipe;
-+//				sg2d.textpipe = lazypipe;
-+//				return;
-+//			}
-+//
-+//			if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE)
-+//			{
-+//				sg2d.drawpipe = x11txpipe;
-+//				sg2d.fillpipe = x11txpipe;
-+//			} else if (sg2d.strokeState != sg2d.STROKE_THIN)
-+//			{
-+//				sg2d.drawpipe = x11txpipe;
-+//				sg2d.fillpipe = x11pipe;
-+//			} else
-+//			{
-+//				sg2d.drawpipe = x11pipe;
-+//				sg2d.fillpipe = x11pipe;
-+//			}
-+//			sg2d.shapepipe = x11pipe;
-+//			sg2d.imagepipe = new XRDrawImage();
-+//		} else
-+//		{
-+//			super.validatePipe(sg2d);
-+//		}
-+//
-+//		//		 if (sg2d.compositeState <= sg2d.COMP_ALPHA) {
-+//		//             if (XRPaints.isValid(sg2d)) {
-+//		//                 sg2d.drawpipe = x11pipe;
-+//		//                 sg2d.fillpipe = x11pipe;
-+//		//             }
-+//		//		 }
-+//
-+//		sg2d.textpipe = x11textpipe;
-+
-+	}
-+	
-+
-+    @Override
-+    protected MaskFill getMaskFill(SunGraphics2D sg2d) {
-+        if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR && !isPaintValid(sg2d)) {
-+            	return null;
-+        }
-+        return super.getMaskFill(sg2d);
-+    }
-+
-+	public RenderLoops getRenderLoops(SunGraphics2D sg2d)
-+	{
-+		if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR && sg2d.compositeState <= sg2d.COMP_ALPHA)
-+		{
-+			return solidloops;
-+		}
-+		
-+		return super.getRenderLoops(sg2d);
-+	}
-+
-+	public GraphicsConfiguration getDeviceConfiguration()
-+	{
-+		return graphicsConfig;
-+	}
-+
-+	/**
-+	 * Method for instantiating a Window SurfaceData
-+	 */
-+	public static XRWindowSurfaceData createData(X11ComponentPeer peer)
-+	{
-+		XRGraphicsConfig gc = getGC(peer);
-+		return new XRWindowSurfaceData(peer, gc, gc.getSurfaceType());
-+	}
-+
-+	/**
-+	 * Method for instantiating a Pixmap SurfaceData (offscreen)
-+	 */
-+	public static XRPixmapSurfaceData createData(XRGraphicsConfig gc, int width, int height, ColorModel cm, Image image, long drawable, int transparency)
-+	{
-+		int depth = transparency > Transparency.OPAQUE ? 32 : 24;
-+		if (depth == 24)
-+		{
-+			cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00, 0x000000FF);
-+		} else
-+		{
-+			cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
-+		}
-+
-+		return new XRPixmapSurfaceData(gc, width, height, image, getSurfaceType(gc, transparency), cm, drawable, transparency, XRUtils.getPictureFormatForTransparency(transparency), depth);
-+	}
-+
-+	public static XRPixmapSurfaceData createData(XRGraphicsConfig gc, int width, int height)
-+	{
-+		/*TODO - may I really pass this XRGraphicsConfig down, although depth is different??*/
-+		return new XRPixmapSurfaceData(gc, width, height, null, ByteA8X11, new DirectColorModel(8, 0x00000000, 0x00000000, 0x00000000, 0x000000FF), 0, Transparency.OPAQUE, XRUtils.PictStandardA8, 8);
-+	}
-+
-+	//	/**
-+	//	 * Initializes the native Ops pointer.
-+	//	 */
-+	private native void initOps(X11ComponentPeer peer, XRGraphicsConfig gc, int depth);
-+
-+	protected XRSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc, SurfaceType sType, ColorModel cm, int depth, int transparency)
-+	{
-+		super(sType, cm);
-+		this.peer = peer;
-+		this.graphicsConfig = gc;
-+		this.solidloops = graphicsConfig.getSolidLoops(sType);
-+		this.depth = depth;
-+		initOps(peer, graphicsConfig, depth);
-+
-+		setBlitProxyKey(gc.getProxyKey());
-+	}
-+
-+	public void initXRender(int pictureFormat)
-+	{
-+		try
-+		{
-+			SunToolkit.awtLock();
-+			XRInitXRender(getNativeOps(), pictureFormat);
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
-+
-+	public static XRGraphicsConfig getGC(X11ComponentPeer peer)
-+	{
-+		if (peer != null)
-+		{
-+			return (XRGraphicsConfig) peer.getGraphicsConfiguration();
-+		} else
-+		{
-+			GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
-+			GraphicsDevice gd = env.getDefaultScreenDevice();
-+			return (XRGraphicsConfig) gd.getDefaultConfiguration();
-+		}
-+	}
-+
-+	/**
-+	 * Returns a boolean indicating whether or not a copyArea from
-+	 * the given rectangle source coordinates might be incomplete
-+	 * and result in X11 GraphicsExposure events being generated
-+	 * from XCopyArea.
-+	 * This method allows the SurfaceData copyArea method to determine
-+	 * if it needs to set the GraphicsExposures attribute of the X11 GC
-+	 * to True or False to receive or avoid the events.
-+	 * @return true if there is any chance that an XCopyArea from the
-+	 *              given source coordinates could produce any X11
-+	 *              Exposure events.
-+	 */
-+	public abstract boolean canSourceSendExposures(int x, int y, int w, int h);
-+	
-+	public void validateCopyAreaGC(Region gcClip)
-+	{
-+		if (validatedGCClip != gcClip)
-+		{
-+			if (gcClip != null)
-+			{
-+				//XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
-+			} else
-+			{
-+				//XRResetClip(getNativeOps());
-+			}
-+			validatedGCClip = gcClip;
-+		}
-+	}
-+
-+	public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy)
-+	{
-+		if (x11pipe == null)
-+		{
-+			if (!isDrawableValid())
-+			{
-+				return true;
-+			}
-+			makePipes();
-+		}
-+		CompositeType comptype = sg2d.imageComp;
-+		if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE && (CompositeType.SrcOverNoEa.equals(comptype) || CompositeType.SrcNoEa.equals(comptype)))
-+		{
-+			x += sg2d.transX;
-+			y += sg2d.transY;
-+			SunToolkit.awtLock();
-+			try
-+			{
-+				validateCopyAreaGC(sg2d.getCompClip());
-+				//validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform, sg2d.paint, sg2d, 0);
-+				//						boolean needExposures = canSourceSendExposures(x, y, w, h);
-+				//						long xgc = getBlitGC(sg2d.getCompClip(), needExposures);
-+				
-+				
-+				x11pipe.devCopyArea(getNativeOps(), xgc, x, y, x + dx, y + dy, w, h);
-+				//X11PMBlitLoops.nativeRenderBlit(getNativeOps(), getNativeOps(), x, y, dx, dy, w, h);
-+			} finally
-+			{
-+				SunToolkit.awtUnlock();
-+			}
-+			return true;
-+		}
-+		return false;
-+	}
-+
-+	public static SurfaceType getSurfaceType(XRGraphicsConfig gc, int transparency)
-+	{
-+		SurfaceType sType = null;
-+
-+		switch (transparency)
-+		{
-+			case Transparency.OPAQUE:
-+				sType = XRSurfaceData.IntRgbX11;
-+				break;
-+
-+			case Transparency.BITMASK:
-+			case Transparency.TRANSLUCENT:
-+				sType = XRSurfaceData.IntArgbX11;
-+				break;
-+		}
-+
-+		return sType;
-+	}
-+
-+	public native void setInvalid();
-+
-+	public void invalidate()
-+	{
-+		if (isValid())
-+		{
-+			setInvalid();
-+			super.invalidate();
-+		}
-+	}
-+
-+	/**
-+	 * The following methods and variables are used to keep the Java-level
-+	 * context state in sync with the native X11 GC associated with this
-+	 * X11SurfaceData object.
-+	 */
-+
-+	private static native long XCreateGC(long pXSData);
-+
-+	private static native void XRSetForeground(int pixel);
-+
-+	private static native void XRSetComposite(int compRule, float eAlpha);
-+
-+	private static native void XRSetClip(long xsdo, int lox, int loy, int hix, int hiy, Region complexclip);
-+
-+	private static native void XRResetClip(long xsdo);
-+
-+	private static native void XRSetTransformNative(long xsdo, int m00, int m01, int m02, int m10, int m11, int m12);
-+
-+	private static native void XRSetTexturePaint(long xsdo);
-+
-+	private static native void XRResetPaint();
-+
-+	private static native void XRSetRepeat(long xsdo, int repeat);
-+
-+	private void XRSetTransform(AffineTransform transform)
-+	{
-+		double[] transformData = new double[6];
-+		transform.getMatrix(transformData);
-+
-+		XRSetTransformNative(getNativeOps(), XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]), XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-+	}
-+
-+	//private long xgc;
-+
-+	public static int validatedPixel = -1;
-+	public static int validatedPaintState = -1;
-+	private static Composite validatedComp;
-+	public static Paint validatedPaint;
-+	private static int validatedTextureInterpolation = -1;
-+
-+	private Region validatedClip;
-+	private Region validatedGCClip;
-+	private boolean validatedExposures = true;
-+
-+	private int validatedFlags;
-+
-+	private boolean transformInUse = false;
-+	private AffineTransform validatedSourceTransform = new AffineTransform();
-+	private int validatedRepeat = XRUtils.RepeatNone;
-+	private int validatedInterpolation = -1;
-+
-+	private int preferredInterpolation = -1;
-+
-+	public void setPreferredInterpolation(int interpolation)
-+	{
-+		this.preferredInterpolation = interpolation;
-+	}
-+
-+	public void setShapeClip(Shape shape)
-+	{
-+		Region shapeClip = Region.getInstance(validatedClip, shape, null);
-+		XRSetClip(getNativeOps(), shapeClip.getLoX(), shapeClip.getLoY(), shapeClip.getHiX(), shapeClip.getHiY(), shapeClip.isRectangular() ? null : shapeClip);
-+	}
-+
-+	public void resetShapeClip()
-+	{
-+		XRSetClip(getNativeOps(), validatedClip.getLoX(), validatedClip.getLoY(), validatedClip.getHiX(), validatedClip.getHiY(), validatedClip.isRectangular() ? null : validatedClip);
-+	}
-+
-+	void validateAsSource(AffineTransform sxForm, int repeat)
-+	{
-+		validateAsSource(sxForm, repeat, preferredInterpolation);
-+	}
-+
-+	void validateAsSource(AffineTransform sxForm, int repeat, int interpolation)
-+	{
-+		if (validatedClip != null)
-+		{
-+			validatedClip = null;
-+			XRResetClip(getNativeOps());
-+		}
-+
-+		if (validatedRepeat != repeat)
-+		{
-+			validatedRepeat = repeat;
-+			XRSetRepeat(getNativeOps(), repeat);
-+		}
-+
-+		if (sxForm == null)
-+		{
-+			if (transformInUse)
-+			{
-+				validatedSourceTransform.setToIdentity();
-+				XRSetTransform(validatedSourceTransform);
-+				transformInUse = false;
-+			}
-+		} else
-+		{
-+			if (!transformInUse || (transformInUse && !sxForm.equals(validatedSourceTransform)))
-+			{
-+				validatedSourceTransform.setTransform(sxForm.getScaleX(), sxForm.getShearY(), sxForm.getShearX(), sxForm.getScaleY(), sxForm.getTranslateX(), sxForm.getTranslateY());
-+				XRSetTransform(validatedSourceTransform);
-+				transformInUse = true;
-+			}
-+		}
-+
-+		if (interpolation != validatedInterpolation)
-+		{
-+			XRSetFilter(getNativeOps(), interpolation);
-+			validatedInterpolation = interpolation;
-+		}
-+	}
-+
-+	public static native void XRSetFilter(long xsdo, int value);
-+
-+	private void setComposite(Composite comp)
-+	{
-+		if (comp instanceof AlphaComposite)
-+		{
-+			AlphaComposite aComp = (AlphaComposite) comp;
-+			float extraAlpha = aComp.getAlpha();
-+			//extraAlphaUsed = extraAlpha != 1.0f;
-+
-+			XRSetComposite(XRUtils.j2dAlphaCompToXR(aComp.getRule()), extraAlpha);
-+		} else if (comp instanceof XORComposite)
-+		{
-+
-+		} else
-+		{
-+			throw new InternalError("Composite accaleration not implemented for: " + comp.getClass().getName());
-+		}
-+	}
-+
-+	public static int[] convertToIntArgbPixels(Color[] colors, boolean linear)
-+	{
-+		int[] pixels = new int[colors.length];
-+		for (int i = 0; i < colors.length; i++)
-+		{
-+			pixels[i] = colorToIntArgbPixel(colors[i], linear);
-+		}
-+		return pixels;
-+	}
-+
-+	public static int colorToIntArgbPixel(Color c, boolean linear)
-+	{
-+		int rgb = c.getRGB();
-+		if (!linear && ((rgb >> 24) == -1))
-+		{
-+			return rgb;
-+		}
-+		int a = rgb >>> 24;
-+		int r = (rgb >> 16) & 0xff;
-+		int g = (rgb >> 8) & 0xff;
-+		int b = (rgb) & 0xff;
-+		if (linear)
-+		{
-+			r = BufferedPaints.convertSRGBtoLinearRGB(r);
-+			g = BufferedPaints.convertSRGBtoLinearRGB(g);
-+			b = BufferedPaints.convertSRGBtoLinearRGB(b);
-+		}
-+
-+		return ((a << 24) | (r << 16) | (g << 8) | (b));
-+	}
-+
-+	private static void setGradientPaint(SunGraphics2D sg2d, GradientPaint paint, boolean useMask)
-+	{
-+		int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() }, false);
-+
-+		float fractions[] = new float[2];
-+		fractions[0] = 0;
-+		fractions[1] = 1;
-+
-+		Point2D pt1 = paint.getPoint1();
-+		Point2D pt2 = paint.getPoint2();
-+
-+		AffineTransform at = (AffineTransform) sg2d.transform.clone();
-+		try
-+		{
-+			at.invert();
-+		} catch (NoninvertibleTransformException ex)
-+		{
-+			ex.printStackTrace();
-+		}
-+
-+		double[] transformData = new double[6];
-+		at.getMatrix(transformData);
-+
-+		int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
-+
-+		XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()), XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()), XDoubleToFixed(pt2.getY()), 2, repeat, useMask, false, XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]),
-+				XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-+	}
-+
-+	public static boolean isPaintValid(SunGraphics2D sg2d)
-+	{
-+		if(sg2d.paintState == SunGraphics2D.PAINT_RAD_GRADIENT)
-+		{
-+			RadialGradientPaint grad = (RadialGradientPaint) sg2d.paint;
-+			return grad.getFocusPoint().equals(grad.getCenterPoint());
-+		}
-+		
-+		return true;
-+	}
-+	
-+	public static void setRadialGradientPaint(SunGraphics2D sg2d, RadialGradientPaint paint)
-+	{
-+		boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
-+		Color[] colors = paint.getColors();
-+		int numStops = colors.length;
-+		Point2D center = paint.getCenterPoint();
-+		Point2D focus = paint.getFocusPoint();
-+
-+		int cycleMethod = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
-+		float[] fractions = paint.getFractions();
-+		int[] pixels = convertToIntArgbPixels(colors, linear);
-+		float radius = paint.getRadius();
-+
-+		// save original (untransformed) center and focus points
-+		double cx = center.getX();
-+		double cy = center.getY();
-+		double fx = focus.getX();
-+		double fy = focus.getY();
-+
-+		AffineTransform at = paint.getTransform();
-+		at.preConcatenate(sg2d.transform);
-+		focus = at.transform(focus, focus);
-+
-+		// transform unit circle to gradient coords; we start with the
-+		// unit circle (center=(0,0), focus on positive x-axis, radius=1)
-+		// and then transform into gradient space
-+		at.translate(cx, cy);
-+		at.rotate(fx - cx, fy - cy);
-+		//  at.scale(radius, radius);
-+
-+		// invert to get mapping from device coords to unit circle
-+		try
-+		{
-+			at.invert();
-+		} catch (Exception e)
-+		{
-+			at.setToScale(0.0, 0.0);
-+		}
-+		focus = at.transform(focus, focus);
-+
-+		// clamp the focus point so that it does not rest on, or outside
-+		// of, the circumference of the gradient circle
-+		fx = Math.min(focus.getX(), 0.99);
-+
-+		double[] transformData = new double[6];
-+		at.getMatrix(transformData);
-+
-+		XRSetRadialGradientPaint(fractions, pixels, XDoubleToFixed(fx), numStops, cycleMethod, false, linear, XDoubleToFixed(0), XDoubleToFixed(radius), XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]), XDoubleToFixed(transformData[3]),
-+				XDoubleToFixed(transformData[5]));
-+	}
-+
-+	public native static void XRSetRadialGradientPaint(float[] fractions, int[] pixels, int fx, int numStops, int cycleMethod, boolean useMask, boolean linear, int innerRadius, int outerRadius, int m00, int m01, int m02, int m10, int m11, int m12);
-+
-+	public static void setLinearGradientPaint(SunGraphics2D sg2d, LinearGradientPaint paint, boolean useMask)
-+	{
-+		boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
-+		Color[] colors = paint.getColors();
-+		int numStops = colors.length;
-+		Point2D pt1 = paint.getStartPoint();
-+		Point2D pt2 = paint.getEndPoint();
-+
-+		AffineTransform at = paint.getTransform();
-+		at.preConcatenate(sg2d.transform);
-+
-+		int cycleMethod = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
-+		float[] fractions = paint.getFractions();
-+		int[] pixels = convertToIntArgbPixels(colors, linear);
-+
-+		try
-+		{
-+			at.invert();
-+		} catch (NoninvertibleTransformException ex)
-+		{
-+			ex.printStackTrace();
-+		}
-+
-+		double[] transformData = new double[6];
-+		at.getMatrix(transformData);
-+
-+		XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()), XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()), XDoubleToFixed(pt2.getY()), numStops, cycleMethod, useMask, linear, XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]),
-+				XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-+	}
-+
-+	private static native void XRSetLinearGradientPaint(float[] fractions, int[] pixels, int x1, int y1, int x2, int y2, int numStops, int cycleMethod, boolean useMask, boolean linear, int m00, int m01, int m02, int m10, int m11, int m12);
-+
-+	private static TexturePaint setTexturePaint(SunGraphics2D sg2d, TexturePaint paint, boolean useMask)
-+	{
-+		BufferedImage bi = paint.getImage();
-+		SurfaceData dstData = sg2d.surfaceData;
-+		SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
-+
-+		// REMIND: this hack tries to ensure that we have a cached texture
-+		if (!(srcData instanceof XRSurfaceData))
-+		{
-+			srcData = dstData.getSourceSurfaceData(paint.getImage(), SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
-+			if (!(srcData instanceof XRSurfaceData))
-+			{
-+				return null;
-+			}
-+		}
-+
-+		XRSurfaceData x11SrcData = (XRSurfaceData) srcData;
-+
-+		validatedTextureInterpolation = sg2d.interpolationType;
-+		XRSetFilter(x11SrcData.getNativeOps(), XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
-+
-+		AffineTransform at = (AffineTransform) sg2d.transform.clone();
-+		Rectangle2D anchor = paint.getAnchorRect();
-+		at.translate(anchor.getX(), anchor.getY());
-+		at.scale(anchor.getWidth() / ((double) bi.getWidth()), anchor.getHeight() / ((double) bi.getHeight()));
-+		try
-+		{
-+			at.invert();
-+		} catch (NoninvertibleTransformException ex)
-+		{
-+			ex.printStackTrace();
-+		}
-+
-+		x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType)); /*Todo - doesn't work if interpolation value is changed after texturepaint is "realized"*/
-+
-+		XRSetTexturePaint(srcData.getNativeOps());
-+
-+		return paint;
-+	}
-+
-+	public void setPaint(SunGraphics2D sg2d, Paint paint)
-+	{
-+		if (sg2d != null)
-+		{
-+			if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)
-+			{
-+				XRResetPaint();
-+			} else
-+			{
-+				switch (sg2d.paintState)
-+				{
-+					case SunGraphics2D.PAINT_GRADIENT:
-+						setGradientPaint(sg2d, (GradientPaint) paint, false);
-+						validatedPaint = paint;
-+						break;
-+
-+					case SunGraphics2D.PAINT_LIN_GRADIENT:
-+						setLinearGradientPaint(sg2d, (LinearGradientPaint) paint, false);
-+						validatedPaint = paint;
-+						break;
-+
-+					case SunGraphics2D.PAINT_RAD_GRADIENT:
-+						setRadialGradientPaint(sg2d, (RadialGradientPaint) paint);
-+						validatedPaint = paint;
-+						break;
-+
-+					case SunGraphics2D.PAINT_TEXTURE:
-+						validatedPaint = setTexturePaint(sg2d, (TexturePaint) paint, false);
-+						break;
-+
-+					default:
-+						throw new InternalError("should not reach");
-+				}
-+			}
-+		}
-+	}
-+
-+	public void validate(Region clip, Composite comp, AffineTransform xform, Paint paint, SunGraphics2D sg2d, int flags)
-+	{
-+		boolean updateClip = (clip != validatedClip);
-+		boolean updatePaint = (paint != validatedPaint) || paint == null;
-+
-+		if (!isValid())
-+		{
-+			throw new InvalidPipeException("bounds changed");
-+		}
-+
-+		// validate clip
-+		if (updateClip)
-+		{
-+			if (clip != null)
-+			{
-+				XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
-+			} else
-+			{
-+				XRResetClip(getNativeOps());
-+			}
-+			validatedClip = clip;
-+		}
-+
-+		// validate composite (note that a change in the context flags
-+		// may require us to update the composite state, even if the
-+		// composite has not changed)
-+		if ((comp != validatedComp) || (flags != validatedFlags))
-+		{
-+			if (comp != null)
-+			{
-+				setComposite(comp);
-+			} else
-+			{
-+				comp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER);
-+				setComposite(comp);
-+			}
-+			// the paint state is dependent on the composite state, so make
-+			// sure we update the color below
-+			updatePaint = true;
-+			validatedComp = comp;
-+			validatedFlags = flags;
-+		}
-+
-+		if (sg2d != null && validatedPixel != sg2d.pixel)
-+		{
-+			validatedPixel = sg2d.pixel;
-+			XRSetForeground(validatedPixel);
-+		}
-+
-+		// validate paint
-+		if (updatePaint)
-+		{
-+			if (paint != null)
-+			{
-+				setPaint(sg2d, paint);
-+			} else
-+			{
-+				XRResetPaint();
-+			}
-+			validatedPaint = paint;
-+		}
-+	}
-+
-+	long xgc;
-+
-+	public void makePipes()
-+	{
-+		if (x11pipe == null)
-+		{
-+			try
-+			{
-+				SunToolkit.awtLock();
-+				xgc = XCreateGC(getNativeOps());
-+
-+				x11pipe = XRRenderer.getInstance();
-+				x11txpipe = new PixelToShapeConverter(x11pipe);
-+				x11textpipe = new XRTextRenderer();
-+				xrDrawImage = new XRDrawImage();
-+			} finally
-+			{
-+				SunToolkit.awtUnlock();
-+			}
-+		}
-+	}
-+
-+	public static class XRWindowSurfaceData extends XRSurfaceData
-+	{
-+		public XRWindowSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc, SurfaceType sType)
-+		{
-+			super(peer, gc, sType, peer.getColorModel(), peer.getColorModel().getPixelSize(), Transparency.OPAQUE);
-+
-+			if (isDrawableValid())
-+			{
-+				initXRender(XRUtils.getPictureFormatForTransparency(Transparency.OPAQUE));
-+				makePipes();
-+			}
-+		}
-+
-+		public SurfaceData getReplacement()
-+		{
-+			return peer.getSurfaceData();
-+		}
-+
-+		public Rectangle getBounds()
-+		{
-+			Rectangle r = peer.getBounds();
-+			r.x = r.y = 0;
-+			return r;
-+		}
-+
-+		@Override
-+		public boolean canSourceSendExposures(int x, int y, int w, int h)
-+		{
-+			return true;
-+		}
-+
-+		/**
-+		 * Returns destination Component associated with this SurfaceData.
-+		 */
-+		public Object getDestination()
-+		{
-+			return peer.getTarget();
-+		}
-+	}
-+
-+	public static class XRPixmapSurfaceData extends XRSurfaceData
-+	{
-+		Image offscreenImage;
-+		int width;
-+		int height;
-+		int transparency;
-+
-+		public XRPixmapSurfaceData(XRGraphicsConfig gc, int width, int height, Image image, SurfaceType sType, ColorModel cm, long drawable, int transparency, int pictFormat, int depth)
-+		{
-+			super(null, gc, sType, cm, depth, transparency);
-+			this.width = width;
-+			this.height = height;
-+			offscreenImage = image;
-+			this.transparency = transparency;
-+			initSurface(depth, width, height, drawable, pictFormat);
-+			makePipes();
-+		}
-+
-+		public void initSurface(int depth, int width, int height, long drawable, int pictFormat)
-+		{
-+			try
-+			{
-+				SunToolkit.awtLock();
-+				XRInitSurface(depth, width, height, drawable, pictFormat);
-+			} finally
-+			{
-+				SunToolkit.awtUnlock();
-+			}
-+		}
-+
-+		public SurfaceData getReplacement()
-+		{
-+			return restoreContents(offscreenImage);
-+		}
-+
-+		/**
-+		 * Need this since the surface data is created with
-+		 * the color model of the target GC, which is always
-+		 * opaque. But in SunGraphics2D.blitSD we choose loops
-+		 * based on the transparency on the source SD, so
-+		 * it could choose wrong loop (blit instead of blitbg,
-+		 * for example).
-+		 */
-+		public int getTransparency()
-+		{
-+			return transparency;
-+		}
-+
-+		public Rectangle getBounds()
-+		{
-+			return new Rectangle(width, height);
-+		}
-+
-+		@Override
-+		public boolean canSourceSendExposures(int x, int y, int w, int h)
-+		{
-+			return (x < 0 || y < 0 || (x + w) > width || (y + h) > height);
-+		}
-+
-+		public void flush()
-+		{
-+			/*
-+			 * We need to invalidate the surface before disposing the
-+			 * native Drawable and GC.  This way if an application tries
-+			 * to render to an already flushed X11SurfaceData, we will notice
-+			 * in the validate() method above that it has been invalidated,
-+			 * and we will avoid using those native resources that have
-+			 * already been disposed.
-+			 */
-+			invalidate();
-+			flushNativeSurface();
-+		}
-+
-+		/**
-+		 * Returns destination Image associated with this SurfaceData.
-+		 */
-+		public Object getDestination()
-+		{
-+			return offscreenImage;
-+		}
-+	}
-+
-+	private static LazyPipe lazypipe = new LazyPipe();
-+
-+	public static class LazyPipe extends ValidatePipe
-+	{
-+		public boolean validate(SunGraphics2D sg2d)
-+		{
-+			XRSurfaceData xsd = (XRSurfaceData) sg2d.surfaceData;
-+			if (!xsd.isDrawableValid())
-+			{
-+				return false;
-+			}
-+			xsd.makePipes();
-+			return super.validate(sg2d);
-+		}
-+	}
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,103 @@
-+/*
-+ * Copyright 2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+package sun.java2d.xr;
-+
-+import java.awt.Color;
-+import java.awt.AlphaComposite;
-+import java.awt.GraphicsConfiguration;
-+import java.awt.Transparency;
-+import java.awt.image.ColorModel;
-+import java.awt.image.IndexColorModel;
-+import java.awt.image.DirectColorModel;
-+
-+import sun.awt.X11GraphicsConfig;
-+import sun.java2d.SurfaceData;
-+import sun.java2d.SurfaceDataProxy;
-+import sun.java2d.SunGraphics2D;
-+import sun.java2d.loops.SurfaceType;
-+import sun.java2d.loops.CompositeType;
-+import sun.java2d.opengl.*;
-+
-+/**
-+ * The proxy class contains the logic for when to replace a
-+ * SurfaceData with a cached X11 Pixmap and the code to create
-+ * the accelerated surfaces.
-+ */
-+public class XRSurfaceDataProxy extends SurfaceDataProxy
-+    implements Transparency
-+{
-+    public static SurfaceDataProxy createProxy(SurfaceData srcData,
-+                                               XRGraphicsConfig dstConfig)
-+    {
-+        if (srcData instanceof XRSurfaceData) {
-+            // srcData must be a VolatileImage which either matches
-+            // our visual or not - either way we do not cache it...
-+            return UNCACHED;
-+        }
-+        
-+        return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency());
-+    }
-+
-+    XRGraphicsConfig xrgc;
-+    int transparency;
-+
-+    public XRSurfaceDataProxy(XRGraphicsConfig x11gc) {
-+        this.xrgc = x11gc;
-+    }
-+
-+    @Override
-+    public SurfaceData validateSurfaceData(SurfaceData srcData,
-+                                           SurfaceData cachedData,
-+                                           int w, int h)
-+    {
-+        if (cachedData == null) {
-+            // Bitmask will be created lazily during the blit phase
-+            cachedData = XRSurfaceData.createData(xrgc, w, h,
-+                                                   xrgc.getColorModel(),
-+                                                   null, 0, getTransparency());
-+        }
-+        return cachedData;
-+    }
-+    
-+    public XRSurfaceDataProxy(XRGraphicsConfig x11gc, int transparency) {
-+        this.xrgc = x11gc;
-+        this.transparency = transparency;
-+    }
-+
-+    @Override
-+    public boolean isSupportedOperation(SurfaceData srcData,
-+                                        int txtype,
-+                                        CompositeType comp,
-+                                        Color bgColor)
-+    {
-+        return (bgColor == null || transparency == Transparency.OPAQUE);
-+    }
-+
-+	public int getTransparency()
-+	{
-+		return transparency;
-+	}
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,142 @@
-+package sun.java2d.xr;
-+
-+import static java.awt.AlphaComposite.*;
-+
-+import java.awt.*;
-+import java.awt.MultipleGradientPaint.*;
-+import java.awt.image.*;
-+
-+public class XRUtils
-+{
-+	/*Composition Operators*/
-+	public static final int PictOpClear = 0;
-+	public static final int PictOpSrc = 1;
-+	public static final int PictOpDst = 2;
-+	public static final int PictOpOver = 3;
-+	public static final int PictOpOverReverse = 4;
-+	public static final int PictOpIn = 5;
-+	public static final int PictOpInReverse = 6;
-+	public static final int PictOpOut = 7;
-+	public static final int PictOpOutReverse = 8;
-+	public static final int PictOpAtop = 9;
-+	public static final int PictOpAtopReverse = 10;
-+	public static final int PictOpXor = 11;
-+	public static final int PictOpAdd = 12;
-+	public static final int PictOpSaturate = 13;
-+
-+	/*Repeats*/
-+	public static final int RepeatNone = 0;
-+	public static final int RepeatNormal = 1;
-+	public static final int RepeatPad = 2;
-+	public static final int RepeatReflect = 3;
-+	
-+	/*Interpolation qualities*/
-+	public static final int FAST = 0;
-+	public static final int GOOD = 1;
-+	public static final int BEST = 2;
-+	
-+	/*PictFormats*/
-+	public static final int PictStandardARGB32 = 0;
-+	public static final int PictStandardRGB24 = 1;
-+	public static final int PictStandardA8 = 2;
-+	public static final int PictStandardA4 = 3;
-+	public static final int PictStandardA1 = 4;
-+	
-+	public static int ATransOpToXRQuality(int affineTranformOp)
-+	{
-+		switch(affineTranformOp)
-+		{
-+			case AffineTransformOp.TYPE_NEAREST_NEIGHBOR:
-+				return FAST;
-+				
-+			case AffineTransformOp.TYPE_BILINEAR:
-+				return GOOD;
-+				
-+			case AffineTransformOp.TYPE_BICUBIC:
-+				return BEST;
-+		}
-+		
-+		return -1;
-+	}
-+	
-+	public static int getPictureFormatForTransparency(int transparency)
-+	{ 
-+		switch(transparency)
-+		{
-+			case Transparency.OPAQUE:
-+				return PictStandardRGB24;
-+				
-+			case Transparency.BITMASK:
-+			case Transparency.TRANSLUCENT:
-+				return PictStandardARGB32;
-+		}
-+		
-+		return -1;
-+	}
-+
-+	public static int getRepeatForCycleMethod(CycleMethod cycleMethod)
-+	{
-+		if (cycleMethod.equals(CycleMethod.NO_CYCLE))
-+		{
-+			return RepeatPad;
-+		} else if (cycleMethod.equals(CycleMethod.REFLECT))
-+		{
-+			return RepeatReflect;
-+		} else if (cycleMethod.equals(CycleMethod.REPEAT))
-+		{
-+			return RepeatNormal;
-+		}
-+
-+		return RepeatNone;
-+	}
-+
-+	public static int XDoubleToFixed(double dbl)
-+	{
-+		return (int) (dbl * 65536);
-+	}
-+
-+	public static int j2dAlphaCompToXR(int j2dRule)
-+	{
-+		switch (j2dRule)
-+		{
-+			case CLEAR:
-+				return PictOpClear;
-+
-+			case SRC:
-+				//return PictOpOver;
-+				return PictOpSrc;
-+
-+			case DST:
-+				return PictOpDst;
-+
-+			case SRC_OVER:
-+				return PictOpOver;
-+
-+			case DST_OVER:
-+				return PictOpOverReverse;
-+
-+			case SRC_IN:
-+				return PictOpIn;
-+
-+			case DST_IN:
-+				return PictOpInReverse;
-+
-+			case SRC_OUT:
-+				return PictOpOut;
-+
-+			case DST_OUT:
-+				return PictOpOutReverse;
-+
-+			case SRC_ATOP:
-+				return PictOpAtop;
-+
-+			case DST_ATOP:
-+				return PictOpAtopReverse;
-+
-+			case XOR:
-+				return PictOpXor;
-+		}
-+
-+		throw new InternalError("No XRender equivalent available for requested java2d composition rule");
-+	}
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,105 @@
-+/*
-+ * Copyright 2000-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+package sun.java2d.xr;
-+
-+import java.awt.GraphicsConfiguration;
-+import java.awt.ImageCapabilities;
-+import java.awt.Transparency;
-+import java.awt.image.ColorModel;
-+import sun.awt.X11GraphicsConfig;
-+import sun.awt.image.SunVolatileImage;
-+import sun.awt.image.VolatileSurfaceManager;
-+import sun.java2d.SurfaceData;
-+
-+/**
-+ * X11 platform implementation of the VolatileSurfaceManager class.
-+ * The class attempts to create and use a pixmap-based SurfaceData
-+ * object (X11PixmapSurfaceData).
-+ * If this object cannot be created or re-created as necessary, the
-+ * class falls back to a system memory based SurfaceData object
-+ * (BufImgSurfaceData) that will be used until the accelerated
-+ * SurfaceData can be restored.
-+ */
-+public class XRVolatileSurfaceManager extends VolatileSurfaceManager {
-+
-+    public XRVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
-+        super(vImg, context);
-+    }
-+
-+    protected boolean isAccelerationEnabled() {
-+        return true;
-+    }
-+
-+    /**
-+     * Create a pixmap-based SurfaceData object
-+     */
-+    protected SurfaceData initAcceleratedSurface() {
-+        SurfaceData sData;
-+
-+        try {
-+            XRGraphicsConfig gc = (XRGraphicsConfig) vImg.getGraphicsConfig();
-+            ColorModel cm = gc.getColorModel();
-+            long drawable = 0;
-+            if (context instanceof Long) {
-+                drawable = ((Long)context).longValue();
-+            }
-+            sData = XRSurfaceData.createData(gc,
-+                                              vImg.getWidth(),
-+                                              vImg.getHeight(),
-+                                              cm, vImg, drawable,
-+                                              vImg.getTransparency());
-+        } catch (NullPointerException ex) {
-+            sData = null;
-+        } catch (OutOfMemoryError er) {
-+            sData = null;
-+        }
-+
-+        return sData;
-+    }
-+
-+    protected boolean isConfigValid(GraphicsConfiguration gc) {
-+        // REMIND: we might be too paranoid here, requiring that
-+        // the GC be exactly the same as the original one.  The
-+        // real answer is one that guarantees that pixmap copies
-+        // will be correct (which requires like bit depths and
-+        // formats).
-+        return ((gc == null) || (gc == vImg.getGraphicsConfig()));
-+    }
-+
-+    /**
-+     * Need to override the default behavior because Pixmaps-based
-+     * images are accelerated but not volatile.
-+     */
-+    @Override
-+    public ImageCapabilities getCapabilities(GraphicsConfiguration gc) {
-+        if (isConfigValid(gc) && isAccelerationEnabled()) {
-+            // accelerated but not volatile
-+            return new ImageCapabilities(true);
-+        }
-+        // neither accelerated nor volatile
-+        return new ImageCapabilities(false);
-+    }
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/font/XRTextRenderer.c openjdk/jdk/src/solaris/native/sun/font/XRTextRenderer.c
---- openjdk.orig/jdk/src/solaris/native/sun/font/XRTextRenderer.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/font/XRTextRenderer.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,77 @@
-+/*
-+ * Copyright 2000-2005 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+/*
-+ * Important note : All AWTxxx functions are defined in font.h.
-+ * These were added to remove the dependency of this file on X11.
-+ * These functions are used to perform X11 operations and should
-+ * be "stubbed out" in environments that do not support X11.
-+ * The implementation of these functions has been moved from this file
-+ * into X11TextRenderer_md.c, which is compiled into another library.
-+ */
-+
-+#include "sun_font_X11TextRenderer.h"
-+
-+#include "Region.h"
-+#include "SurfaceData.h"
-+#include "GraphicsPrimitiveMgr.h"
-+#include "glyphblitting.h"
-+#include <malloc.h>
-+#include "Trace.h"
-+
-+
-+JNIEXPORT void JNICALL XRT_DrawGlyphList(JNIEnv *env, jobject xtr,
-+                 jlong dstData, jint numGlyphs, jboolean subPixPos, jboolean rgbOrder, jint lcdContrast,
-+                 jboolean usePositions, jfloat xOrigin, jfloat yOrigin, jlong *images, jfloat *positions);
-+
-+
-+
-+JNIEXPORT void JNICALL Java_sun_font_XRTextRenderer_doDrawGlyphList (JNIEnv *env, jobject xtr,
-+     jlong dstData, jint numGlyphs, jboolean subPixPos, jboolean rgbOrder, jint lcdContrast,
-+     jboolean usePositions, jfloat xOrigin, jfloat yOrigin, jlongArray imgArray, jfloatArray posArray)
-+{
-+    jlong *images;
-+
-+    J2dTraceLn(J2D_TRACE_INFO, "XRTextRenderer_drawGlyphList");
-+
-+    images = (jlong *) (*env)->GetPrimitiveArrayCritical(env, imgArray, NULL);
-+    if (images != NULL) {
-+
-+        if (usePositions == JNI_TRUE) {
-+            jfloat *positions = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, posArray, NULL);
-+
-+            if (positions != NULL) {
-+                XRT_DrawGlyphList(env, xtr, dstData, numGlyphs, subPixPos, rgbOrder, lcdContrast, usePositions, xOrigin, yOrigin, images, positions);
-+                (*env)->ReleasePrimitiveArrayCritical(env, posArray,
-+                                                      positions, JNI_ABORT);
-+            }
-+        } else {
-+            XRT_DrawGlyphList(env, xtr, dstData, numGlyphs, subPixPos, rgbOrder, lcdContrast, usePositions, xOrigin, yOrigin, images, NULL);
-+        }
-+
-+        (*env)->ReleasePrimitiveArrayCritical(env, imgArray,
-+                                              images, JNI_ABORT);
-+    }
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,39 @@
-+#include <malloc.h>
-+#include <string.h>
-+#include "ArrayList.h"
-+
-+void initXRList(XrArrayList *list, jint capacity, size_t blkSize)
-+{
-+  //printf("Init XR LIst!\n");fflush(stdout);
-+  list->used = 0;
-+  list->capacity = capacity;
-+
-+  if(capacity != 0) {
-+    list->elements = calloc(capacity, blkSize);
-+  }else {
-+    list->elements = NULL;
-+  }
-+}
-+
-+void* getNewXR(XrArrayList *list, size_t blkSize)
-+{
-+  if((list->used+1) >= list->capacity)
-+  {
-+    int newCapacity = list->capacity*2 + 10;
-+    if(list->capacity > 0) {
-+      list->elements = realloc(list->elements, newCapacity * blkSize);
-+    }else {
-+      list->elements = calloc(newCapacity, blkSize);
-+    }
-+    list->capacity = newCapacity;
-+  }
-+
-+  return list->elements + (list->used++ * blkSize);
-+}
-+
-+void clearXRList(XrArrayList *list)
-+{
-+  list->used = 0;
-+  //memset(list->elements, 0, list->used);
-+}
-+
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,18 @@
-+#ifndef ArrayList_h_Included
-+#define ArrayList_h_Included
-+
-+#include "jni.h"
-+
-+typedef struct {
-+   void *elements;
-+   jint capacity;
-+   jint used;
-+} XrArrayList;
-+
-+void initXRList(XrArrayList *list, jint capacity, size_t blkSize);
-+
-+void* getNewXR(XrArrayList *list, size_t blkSize);
-+
-+void clearXRList(XrArrayList *list);
-+
-+#endif /* ArrayList_h_Included */
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,576 @@
-+#include "MaskBuffer.h"
-+#include "XRSurfaceData.h"
-+#include "X11SurfaceData.h"
-+
-+#define MAX(a,b) ((a) > (b) ? (a) : (b))
-+#define MIN(a,b) ((a) < (b) ? (a) : (b))
-+
-+#define GET_DIRTY_LINE_REGION(X1, Y1, X2, Y2, RX1, RY1, RX2, RY2)        \
-+  {                                                                      \
-+    if(X1 < X2) {                                                        \
-+      RX1 = X1;                                                          \
-+      RX2 = X2;                                                          \
-+    }else {                                                              \
-+      RX1 = X2;                                                          \
-+      RX2 = X1;                                                          \
-+    }                                                                    \
-+                                                                         \
-+    if(Y1 < Y2) {                                                        \
-+      RY1 = Y1;                                                          \
-+      RY2 = Y2;                                                          \
-+    }else {                                                              \
-+      RY1 = Y2;                                                          \
-+      RY2 = Y1;                                                          \
-+    }                                                                    \
-+  }
-+
-+#ifndef HEADLESS
-+MaskBuffer* initMaskBuffer(Window window)
-+{
-+  MaskBuffer *buffer = malloc(sizeof(MaskBuffer));
-+  initRegion(&buffer->region);
-+ 
-+  initXRList(&buffer->rects, sizeof(XRectangle), 512);
-+  initXRList(&buffer->lines, sizeof(XSegment), 512);
-+
-+  buffer->xTiles = 0;
-+  buffer->yTiles = 0;
-+  buffer->xTileCap = 0;
-+  buffer->yTileCap = 0;
-+  buffer->tiles = NULL;
-+
-+  XRenderPictFormat *fmt = XRenderFindStandardFormat(awt_display, PictStandardA8);
-+  XRenderPictFormat *fmt32 = XRenderFindStandardFormat(awt_display, PictStandardARGB32);
-+
-+  buffer->maskPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 8);
-+  buffer->lineMaskPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 8);
-+  buffer->gradPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 32);
-+ 
-+  XRenderPictureAttributes pict_attr;
-+  buffer->maskPicture = XRenderCreatePicture(awt_display, buffer->maskPixmap, fmt, 0, &pict_attr);
-+  buffer->lineMaskPicture = XRenderCreatePicture(awt_display, buffer->lineMaskPixmap, fmt, 0, &pict_attr);
-+  buffer->gradPict = XRenderCreatePicture(awt_display, buffer->gradPixmap, fmt32, 0, &pict_attr);
-+
-+  XRenderColor color_black={.red=0, .green=0, .blue=0, .alpha=0xffff};
-+  XRenderFillRectangle (awt_display, PictOpClear, buffer->maskPicture, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
-+  XRenderFillRectangle (awt_display, PictOpClear, buffer->lineMaskPicture, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
-+  XRenderFillRectangle (awt_display, PictOpClear, buffer->gradPict, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
-+
-+  buffer->validatedGCAlpha = 1.0f;
-+  XGCValues values;
-+  values.foreground = 255;
-+  buffer->drawLineGC = XCreateGC(awt_display, buffer->lineMaskPixmap, GCForeground, &values);
-+  /*Invisible GC for readback assistance*/
-+  values.foreground = 0;
-+  buffer->clearLineGC = XCreateGC(awt_display, buffer->lineMaskPixmap, GCForeground, &values);
-+
-+  return buffer;
-+}
-+
-+static void allocTileBuffer(MaskBuffer* buf)
-+{
-+  buf->xTiles = ((buf->region.x2 - buf->region.x) / MASK_TILE_SIZE) + 1;
-+  buf->yTiles = ((buf->region.y2 - buf->region.y) / MASK_TILE_SIZE) + 1;
-+
-+  //If current tile-array is too small, allocate a larger one
-+  if(buf->tiles == NULL || buf->xTileCap < buf->xTiles || buf->yTileCap < buf->yTiles) {
-+    buf->xTileCap = MAX((buf->xTiles * 2), buf->xTileCap);
-+    buf->yTileCap = MAX((buf->yTiles * 2), buf->yTileCap);
-+    if(buf->tiles != NULL) {
-+      free(buf->tiles);
-+    }
-+    buf->tiles = calloc(buf->xTileCap * buf->yTileCap, sizeof(XrTile));
-+  }
-+
-+  //Init/Reset the tiles that will be used later
-+  int x,y;
-+  for(y=0; y < buf->yTiles; y++) {
-+    for(x=0; x < buf->xTiles; x++) {
-+      initXrTile(&buf->tiles[y*buf->xTileCap + x]);
-+    }
-+ }
-+}
-+
-+static void cleanMaskBuffer(MaskBuffer *buf)
-+{
-+  initRegion(&buf->region); //TODO: eigentlich nicht noetig
-+  buf->xTiles = 0;
-+  buf->yTiles = 0;
-+  clearXRList(&buf->rects);
-+  clearXRList(&buf->lines);
-+}
-+
-+static void getTileDirtyArea(MaskRegion *dirtyRectArea, MaskRegion *dirtyLineArea, MaskRegion *totalDirtyArea)
-+{
-+  totalDirtyArea->x = MIN(dirtyRectArea->x, dirtyLineArea->x);
-+  totalDirtyArea->y = MIN(dirtyRectArea->y, dirtyLineArea->y);
-+  totalDirtyArea->x2 = MAX(dirtyRectArea->x2, dirtyLineArea->x2);
-+  totalDirtyArea->y2 = MAX(dirtyRectArea->y2, dirtyLineArea->y2);
-+}
-+
-+/**
-+* Grows the dirty region of the tile.
-+* This allows to log which areas of the mask are used, and only do Composition
-+* with the parts that are really occupied.
-+*/
-+static void growDirtyRegion(MaskRegion *region, jint x, jint y, jint x2, jint y2)
-+{
-+  if(x < region->x){
-+    region->x = x;
-+  }
-+  if(y < region->y) {
-+    region->y = y;
-+  }
-+  if(x2 > region->x2){ 
-+    region->x2 = x2;
-+  }
-+  if(y2 > region->y2){
-+    region->y2 = y2;
-+  }
-+}
-+
-+static void growDirtyRegionTileLimit(MaskRegion *region, jint x, jint y, jint x2, jint y2)
-+{
-+  if(x < region->x){
-+    region->x = MAX(x, 0);
-+  }
-+  if(y < region->y) {
-+    region->y = MAX(y, 0);
-+  }
-+  if(x2 > region->x2){ 
-+    region->x2 = MIN(x2, MASK_TILE_SIZE);
-+  }
-+  if(y2 > region->y2){
-+    region->y2 = MIN(y2, MASK_TILE_SIZE);
-+  }
-+}
-+
-+/**
-+* Limits the rect's coordinates to the mask coordinates.
-+* The result is used by growDirtyRegion.
-+*/
-+static void limitRetcCoords(XRectangle *rect) 
-+{
-+   if((rect->x + rect->width) > MASK_TILE_SIZE) {
-+      rect->width = MASK_TILE_SIZE - rect->x;
-+   }
-+   if((rect->y + rect->height) > MASK_TILE_SIZE) {
-+      rect->height = MASK_TILE_SIZE - rect->y;
-+   }
-+
-+  if(rect->x < 0){
-+    rect->width += rect->x;
-+    rect->x = 0;
-+  }
-+  if(rect->y < 0) {
-+     rect->height += rect->y;
-+     rect->y = 0;
-+  }
-+}
-+
-+static void initRegion(MaskRegion *region)
-+{
-+  region->x = 99999;
-+  region->y = 99999;
-+  region->x2 = -99999;
-+  region->y2 = -99999;
-+}
-+
-+void addRect(MaskBuffer* buf, short x, short y, unsigned short w, unsigned short h)
-+{
-+  XRectangle *rect = (XRectangle*) getNewXR(&buf->rects, sizeof(XRectangle));
-+  rect->x = x;
-+  rect->y = y;
-+  rect->width = w;
-+  rect->height = h;
-+
-+  growDirtyRegion(&buf->region, x, y, x+w, y+h);
-+}
-+
-+void addLine(MaskBuffer* buf, int x1, int y1, int x2, int y2)
-+{
-+  /* EXA tries to accalerate lines which can be rendered with a single fillRect.
-+   * Unfourtunatly EXA is a bit dumb because our image is held in sysmem all the time anyway.
-+   * So although it would be pretty cheap in sysmem, it migrates the mask to vram just to do a single accalerated fillRect.
-+   * This should really be fixed in EXA, I hope I get it done sometimes.
-+   *
-+   * We seperate rect/line rendering to not cause exzessive migration, therefor we simple add that "line" to our rects.
-+   */
-+
-+  int minX, minY, maxX, maxY;
-+  GET_DIRTY_LINE_REGION(x1, y1, x2, y2, minX, minY, maxX, maxY); 
-+  int xDiff = maxX - minX;
-+  int yDiff = maxY - minY;
-+
-+   if(xDiff == 0 || yDiff == 0)
-+   {
-+     addRect(buf, minX, minY, maxX - minX + 1, maxY - minY + 1);
-+   }else
-+   if(xDiff == 1 && yDiff == 1)
-+   {
-+     addRect(buf, x1, y1, 1, 1);
-+     addRect(buf, x2, y2, 1, 1);
-+   } else 
-+   {
-+     XSegment *line = (XSegment*) getNewXR(&buf->lines, sizeof(XSegment));
-+     line->x1 = x1;
-+     line->y1 = y1;
-+     line->x2 = x2;
-+     line->y2 = y2;
-+ 
-+     growDirtyRegion(&buf->region, minX, minY, maxX + 1, maxY + 1);
-+  }
-+}
-+
-+static void initXrTile(XrTile *tile)
-+{
-+  initRegion(&tile->dirtyLineArea);
-+  initRegion(&tile->dirtyRectArea);
-+  clearXRList(&tile->rects);
-+  clearXRList(&tile->lines);
-+}
-+
-+static void storeLinesInTiles(MaskBuffer *buf)
-+{
-+  int i,n,m;
-+
-+  for(i=0; i < buf->lines.used; i++) {
-+     XSegment *line = ((XSegment*) buf->lines.elements) + i; 
-+
-+     line->x1 -= buf->region.x;
-+     line->y1 -= buf->region.y;
-+     line->x2 -= buf->region.x;
-+     line->y2 -= buf->region.y;
-+
-+    int minX, minY, maxX, maxY;
-+    GET_DIRTY_LINE_REGION(line->x1, line->y1, line->x2, line->y2, minX, minY, maxX, maxY);
-+
-+     int tileXStartIndex = minX / MASK_TILE_SIZE;
-+     int tileYStartIndex = minY / MASK_TILE_SIZE;
-+     int tileXLenght = (maxX / MASK_TILE_SIZE + 1) - tileXStartIndex;
-+     int tileYLenght = (maxY / MASK_TILE_SIZE + 1) - tileYStartIndex;
-+
-+      /*TODO: Better coverage analysis should really pay off for lines!*/
-+      for(n=0; n < tileYLenght; n++) {
-+        for(m=0; m < tileXLenght; m++) { /*Coverage indicator: Simply do not add to not covered tiles*/
-+          int tileIndex = (buf->xTileCap * (tileYStartIndex + n)) + tileXStartIndex + m;
-+          assert(tileIndex >= 0 && tileIndex < (buf->xTileCap*buf->yTileCap));
-+          XrTile *tile = &buf->tiles[tileIndex];
-+          XSegment *tileLine = (XSegment*) getNewXR(&tile->lines, sizeof(XSegment));
-+
-+          int tileStartPosX = (tileXStartIndex + m) * MASK_TILE_SIZE;
-+          int tileStartPosY = (tileYStartIndex + n) * MASK_TILE_SIZE;
-+
-+          tileLine->x1 = line->x1 - tileStartPosX; //Translate coordinates relative to the mask-location
-+          tileLine->y1 = line->y1 - tileStartPosY;
-+          tileLine->x2 = line->x2 - tileStartPosX;
-+          tileLine->y2 = line->y2 - tileStartPosY; 
-+
-+          int transminX = minX - tileStartPosX;
-+          int transminY = minY - tileStartPosY;
-+          int transmaxX = maxX - tileStartPosX;
-+          int transmaxY = maxY - tileStartPosY;
-+
-+          growDirtyRegionTileLimit(&tile->dirtyLineArea, transminX,  transminY, transmaxX + 1, transmaxY + 1);
-+       }
-+     }
-+  }
-+}
-+
-+static void storeRectsInTiles(MaskBuffer *buf)
-+{
-+  int i,n,m;
-+
-+  for(i=0; i < buf->rects.used; i++) {
-+     XRectangle *rect = ((XRectangle*) buf->rects.elements) + i; 
-+
-+     rect->x -= buf->region.x;
-+     rect->y -= buf->region.y;
-+
-+     int tileXStartIndex = rect->x / MASK_TILE_SIZE;
-+     int tileYStartIndex = rect->y / MASK_TILE_SIZE;
-+     int tileXLenght = ((rect->x + rect->width) / MASK_TILE_SIZE + 1) - tileXStartIndex;
-+     int tileYLenght = ((rect->y + rect->height) / MASK_TILE_SIZE + 1) - tileYStartIndex;
-+
-+      for(n=0; n < tileYLenght; n++) {
-+        for(m=0; m < tileXLenght; m++) {
-+          int tileIndex = (buf->xTileCap * (tileYStartIndex + n)) + tileXStartIndex + m;
-+          assert(tileIndex >= 0 && tileIndex < (buf->xTileCap*buf->yTileCap));
-+          //printf("Index: %d - tileX:%d, tileY:%d, tilesx:%d, tilesy:%d, capx:%d capy:%d\n",tileIndex,  (m + tileXLenght), (n + tileYStartIndex), buf->xTiles, buf->yTiles, buf->xTileCap, buf->yTileCap);fflush(stdout);
-+          XrTile *tile = &buf->tiles[tileIndex];
-+          XRectangle *tileRect = (XRectangle*) getNewXR(&tile->rects, sizeof(XRectangle));
-+
-+          int tileStartPosX = (tileXStartIndex + m) * MASK_TILE_SIZE;
-+          int tileStartPosY = (tileYStartIndex + n) * MASK_TILE_SIZE;
-+
-+          tileRect->x = rect->x - tileStartPosX; //Translate coordinates relative to the mask-location
-+          tileRect->y = rect->y - tileStartPosY;
-+          tileRect->width = rect->width;
-+          tileRect->height = rect->height; 
-+
-+          limitRetcCoords(tileRect);
-+          growDirtyRegion(&tile->dirtyRectArea, tileRect->x, tileRect->y, tileRect->x + tileRect->width, tileRect->y + tileRect->height);
-+       }
-+     }
-+  }
-+}
-+
-+static void translateRects(XrArrayList *rectList, int x, int y)
-+{
-+  int i;
-+  for(i = 0; i < rectList->used; i++) {
-+      XRectangle *rect = ((XRectangle *) rectList->elements) + i;
-+      rect->x += x;
-+      rect->y += y;
-+   }
-+}
-+
-+void fillMask(MaskBuffer* buf, Picture dest)
-+{
-+  XRenderColor color_black={.red=0, .green=0, .blue=0, .alpha=0xffff};
-+  int i, m, n;
-+
-+  jboolean maskRequired = (xrSrcData.src != xrSrcData.solid) || (xrSrcData.solidColor.alpha != 0xffff) || (xrSrcData.extraAlpha != 1.0f);
-+  /*Extra Alpha is already storen in solid-colo*/
-+  jdouble maskAlpha = (xrSrcData.src == xrSrcData.solid) ? 1.0f : xrSrcData.extraAlpha;
-+
-+  unsigned short alphaValueFixed = XDoubleToUShort(maskAlpha);
-+  XRenderColor maskColor;
-+  maskColor.alpha = alphaValueFixed;
-+
-+  /* If we don't have to use a mask and there are no lines, 
-+   * we can draw the rects directly and omit tile partitioning */
-+  if(maskRequired || buf->lines.used > 0) {
-+  allocTileBuffer(buf);
-+  storeRectsInTiles(buf);
-+  storeLinesInTiles(buf);
-+
-+  if(buf->lines.used > 0 && buf->validatedGCAlpha != maskAlpha) {
-+     buf->validatedGCAlpha = maskAlpha;
-+     XSetForeground(awt_display, buf->drawLineGC, (int) (buf->validatedGCAlpha*255));
-+  }
-+
-+  for(i=0; i < buf->yTiles; i++) {
-+   for(m=0; m < buf->xTiles; m++) {
-+       XrTile *tile = &buf->tiles[i*buf->xTileCap + m];
-+       XrArrayList *rectList = &tile->rects;
-+       XrArrayList *lineList = &tile->lines;
-+
-+       if(rectList->used != 0 || lineList->used != 0) {
-+	  MaskRegion tileDirtyArea;
-+          getTileDirtyArea(&tile->dirtyRectArea, &tile->dirtyLineArea, &tileDirtyArea);
-+
-+          int tileStartX = m * MASK_TILE_SIZE;
-+          int tileStartY = i * MASK_TILE_SIZE;
-+          int x = tileDirtyArea.x + tileStartX + buf->region.x;
-+          int y = tileDirtyArea.y + tileStartY + buf->region.y;
-+          int width = tileDirtyArea.x2 - tileDirtyArea.x;
-+          int height = tileDirtyArea.y2 - tileDirtyArea.y;
-+          width = MIN(width, MASK_TILE_SIZE);
-+          height = MIN(height, MASK_TILE_SIZE);
-+
-+	  if(maskRequired || lineList->used  > 0) /*Again, only composite _current_tile_ if required, otherwise just fill rects*/
-+          {
-+            Picture mask = None;
-+            if(lineList->used != 0) {
-+              XDrawSegments(awt_display, buf->lineMaskPixmap, buf->drawLineGC, (XSegment *) lineList->elements, lineList->used);
-+              mask = buf->lineMaskPicture;
-+            }
-+
-+            if(rectList->used != 0) {
-+               XRenderComposite (awt_display, PictOpSrc, buf->lineMaskPicture, None, buf->maskPicture, tile->dirtyLineArea.x, tile->dirtyLineArea.y, 0, 0, tile->dirtyLineArea.x, tile->dirtyLineArea.y, (tile->dirtyLineArea.x2 - tile->dirtyLineArea.x), (tile->dirtyLineArea.y2 - tile->dirtyLineArea.y)); 
-+               XRenderFillRectangles (awt_display, PictOpSrc, buf->maskPicture, &maskColor, (XRectangle*) rectList->elements, rectList->used);
-+               mask = buf->maskPicture;
-+               clearXRList(rectList);
-+            }
-+
-+             XRComposite(mask, dest, x, y, tileDirtyArea.x, tileDirtyArea.y, x, y, width, height);
-+
-+             /*Clear dirty rectangle of the rect-mask*/
-+             XRenderFillRectangle (awt_display, PictOpClear, buf->maskPicture, &color_black, tileDirtyArea.x, tileDirtyArea.y, width, height);
-+
-+             if(lineList->used != 0) {
-+               XDrawSegments(awt_display, buf->lineMaskPixmap, buf->clearLineGC, (XSegment *) lineList->elements, lineList->used);
-+               clearXRList(lineList);
-+	     }
-+          }else
-+          if(rectList->used != 0)
-+          {
-+             translateRects(rectList, (tileStartX + buf->region.x), (tileStartY + buf->region.y));
-+             XRenderFillRectangles (awt_display, xrSrcData.compRule, dest, &xrSrcData.solidColor, (XRectangle*) rectList->elements, rectList->used);
-+             clearXRList(rectList);
-+          }
-+        }
-+      }
-+     }
-+ } else 
-+ {
-+   XRenderFillRectangles (awt_display, xrSrcData.compRule, dest, &xrSrcData.solidColor, (XRectangle*) buf->rects.elements, buf->rects.used);
-+ }
-+
-+  cleanMaskBuffer(buf);
-+}
-+
-+#endif
-+
-+
-+	   /*printf("Composition: x:%d y:%d width:%d height:%d, dx:%d, dy:%d\n", x, y, width, height, tileDirtyArea.x, tileDirtyArea.y);
-+           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, 0, 0, MASK_TILE_SIZE, 1);
-+           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, 0, MASK_TILE_SIZE-1, MASK_TILE_SIZE, 1);
-+           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, 0, 0, 1, MASK_TILE_SIZE);
-+           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, MASK_TILE_SIZE-1, 0, 1, MASK_TILE_SIZE);*/
-+
-+
-+
-+           /* if(xrSrcData.src == xrSrcData.gradient)
-+             { 
-+               XRenderComposite (awt_display, PictOpSrc, xrSrcData.gradient, None, buf->gradPict, x, y, 0, 0, 0, 0, width, height);
-+               XRenderComposite (awt_display, xrSrcData.compRule, buf->gradPict, mask, dest, 0, 0, tileDirtyArea.x, tileDirtyArea.y, x, y, width, height);
-+             }else 
-+             {
-+               XRenderComposite (awt_display, xrSrcData.compRule, xrSrcData.src, mask, dest, x, y, tileDirtyArea.x, tileDirtyArea.y, x, y, width, height);
-+             }*/
-+
-+/*
-+void addTrap(MaskBuffer* buf, XTrapezoid *xt)
-+{
-+  XTrapezoid *trap = (XTrapezoid*) getNewXR(&buf->traps, sizeof(XTrapezoid));
-+  memcpy(trap, xt, sizeof(XTrapezoid));
-+
-+  int leftMin = XFixedToDouble(MIN(trap->left.p1.x, trap->left.p2.x)) - 1;
-+  int rightMax = XFixedToDouble(MAX(trap->right.p2.x, trap->right.p1.x)) + 1;
-+  int top = XFixedToDouble(trap->top) - 1;
-+  int bottom = XFixedToDouble(trap->bottom) + 1;
-+
-+  growDirtyRegion(&buf->region, leftMin, top, rightMax, bottom);
-+}
-+*/
-+
-+/*void translateTrap(XTrapezoid *trap, int x, int y)
-+{
-+   XFixed xTrans = XDoubleToFixed(x);     
-+   XFixed yTrans = XDoubleToFixed(y);
-+
-+   trap->left.p1.x  += xTrans;
-+   trap->left.p2.x  += xTrans;
-+   trap->right.p1.x += xTrans;    
-+   trap->right.p2.x += xTrans;
-+   trap->left.p1.y  += yTrans;
-+   trap->left.p2.y  += yTrans;
-+   trap->right.p1.y += yTrans;
-+   trap->right.p2.y += yTrans;
-+   trap->top += yTrans;
-+   trap->bottom += yTrans;
-+}*/
-+
-+/*
-+void storeTrapsInTiles(MaskBuffer *buf)
-+{
-+  int i,n,m;
-+
-+  for(i=0; i < buf->traps.used; i++) {
-+     XTrapezoid *trap = ((XTrapezoid*) buf->traps.elements) + i;
-+     translateTrap(trap, -buf->region.x, -buf->region.y);
-+
-+     int leftMin = XFixedToDouble(MIN(trap->left.p1.x, trap->left.p2.x));
-+     int rightMax = XFixedToDouble(MAX(trap->right.p2.x, trap->right.p1.x));
-+     int top = XFixedToDouble(trap->top) - 1;
-+     int bottom = XFixedToDouble(trap->bottom) + 1;
-+
-+     int tileXStartIndex = leftMin / MASK_TILE_SIZE;
-+     int tileYStartIndex = top / MASK_TILE_SIZE;
-+     int tileXLenght = ((rightMax / MASK_TILE_SIZE) + 1) - tileXStartIndex;
-+     int tileYLenght = ((bottom / MASK_TILE_SIZE) + 1) - tileYStartIndex;
-+
-+      for(n=0; n < tileYLenght; n++) {
-+        for(m=0; m < tileXLenght; m++) {
-+          int tileIndex = (buf->xTileCap * (tileYStartIndex + n)) + tileXStartIndex + m;
-+          assert(tileIndex >= 0);
-+          XrTile *tile = &buf->tiles[tileIndex];
-+
-+          XTrapezoid *tileTrap = (XTrapezoid*) getNewXR(&tile->traps, sizeof(XTrapezoid));
-+          memcpy(tileTrap, trap, sizeof(XTrapezoid));
-+
-+          int tileStartPosX = (tileXStartIndex + m) * MASK_TILE_SIZE;
-+          int tileStartPosY = (tileYStartIndex + n) * MASK_TILE_SIZE;
-+          translateTrap(tileTrap, -tileStartPosX, -tileStartPosY);
-+
-+          leftMin = XFixedToDouble(MIN(tileTrap->left.p1.x, tileTrap->left.p2.x)) - 1;
-+          rightMax = XFixedToDouble(MAX(tileTrap->right.p2.x, tileTrap->right.p1.x)) + 1;
-+          top = XFixedToDouble(tileTrap->top) - 1;
-+          bottom = XFixedToDouble(tileTrap->bottom) + 1;
-+
-+         // limitRetcCoords(tileRect);
-+          //TODO: Better dirty array handling
-+          growDirtyRegionTileLimit(&tile->dirtyArea, leftMin, top, rightMax, bottom);
-+        }
-+      }
-+  }
-+}*/
-+
-+//   XrArrayList tileRectList;
-+//   initXRList(&tileRectList, sizeof(XRectangle), 64); //Todo memory leak!
-+// 
-+//   int i, tileStartX, tileStartY;
-+//   MaskRegion ditryRegion;
-+// 
-+//   for(tileStartX = buf->region.x; tileStartX <= buf->region.x2; tileStartX += MASK_TILE_SIZE) {
-+//    int tileEndX = tileStartX + MASK_TILE_SIZE;
-+// 
-+//     for(tileStartY = buf->region.y; tileStartY <= buf->region.y2; tileStartY += MASK_TILE_SIZE) {
-+//       int tileEndY = tileStartY + MASK_TILE_SIZE;
-+//       initRegion(&ditryRegion);
-+// 
-+//       for(i=0; i < buf->rects.used; i++) {
-+//         XRectangle *rect = ((XRectangle*) buf->rects.elements) + i;
-+// 
-+//         if((rect->x <= tileEndX) && ((rect->x + rect->width) > tileStartX) &&
-+//            (rect->y <= tileEndY) && ((rect->y + rect->height) > tileStartY)) {
-+// 	  XRectangle *ptr = (XRectangle *) getNewXR(&tileRectList);
-+//           ptr->x = rect->x - tileStartX; /*Translate coordinates relative to the mask-location*/
-+//           ptr->y = rect->y - tileStartY;
-+//           ptr->width = rect->width;
-+//           ptr->height = rect->height;
-+// 
-+//           limitRetcCoords(ptr);
-+//           growDirtyRegion(&ditryRegion, ptr->x, ptr->y, ptr->x + ptr->width, ptr->y + ptr->height);
-+//         }
-+//       }
-+// 
-+//         if(tileRectList.used > 0) { 
-+//            XRenderFillRectangles (display, PictOpSrc, mask, alphaColor, (XRectangle*) tileRectList.elements, tileRectList.used);
-+//            clearXRList(&tileRectList);
-+// 
-+//            int x = ditryRegion.x + tileStartX;
-+//            int y = ditryRegion.y + tileStartY;
-+//            int width = ditryRegion.x2 - ditryRegion.x;
-+//            int height = ditryRegion.y2 - ditryRegion.y;
-+// 
-+//            XRenderComposite (display, PictOpOver, src, mask, dest, x, y, ditryRegion.x, ditryRegion.y, x, y, width, height);
-+//            XRenderFillRectangle (display, PictOpClear, mask, alphaColor, ditryRegion.x, ditryRegion.y, width, height);
-+//         }
-+//     } 
-+//   }
-+
-+
-+/*
-+          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, MASK_TILE_SIZE, 1);
-+          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, MASK_TILE_SIZE-1, MASK_TILE_SIZE, 1);
-+          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, 1, MASK_TILE_SIZE);
-+          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, MASK_TILE_SIZE-1, 0, 1, MASK_TILE_SIZE);
-+*/
-+
-+//         int z;
-+//         for(z=0; z < tileRectList.used; z++)
-+//  {
-+//      XRectangle *rect = ((XRectangle*) tileRectList.elements) + z;
-+//      printf("Rechteck %d - %d %d %d %d %d\n", z, rect->x, rect->y, rect->width, rect->height, tileRectList.used);
-+// }
-+
-+//printf("Composition rect: %d %d %d %d\n", x, y, ditryRegion.x2 - ditryRegion.x, ditryRegion.y2 - ditryRegion.y);fflush(stdout);
-+          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, MASK_TILE_SIZE, 1);
-+          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, MASK_TILE_SIZE-1, MASK_TILE_SIZE, 1);
-+          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, 1, MASK_TILE_SIZE);
-+          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, MASK_TILE_SIZE-1, 0, 1, MASK_TILE_SIZE);
-+
-+// printf("Rendering region: %d %d %d %d\n", buf->region.x, buf->region.y, buf->region.x2 - buf->region.x, buf->region.y2 - buf->region.y);fflush(stdout);
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,80 @@
-+#ifndef MaskBuffer_h_Included
-+#define MaskBuffer_h_Included
-+
-+#include "jni.h"
-+#include <X11/Xlib.h>
-+#include "ArrayList.h"
-+#include "ArrayList.h"
-+#include <malloc.h>
-+#include <string.h>
-+#include <X11/extensions/Xrender.h>
-+#include <assert.h>
-+
-+#define MASK_TILE_SIZE 256
-+
-+typedef struct {
-+  jint x;
-+  jint y;
-+  jint x2;
-+  jint y2;
-+}MaskRegion;
-+
-+typedef struct {
-+  XrArrayList rects;
-+  XrArrayList lines;
-+
-+  MaskRegion dirtyRectArea;
-+  MaskRegion dirtyLineArea;
-+} XrTile;
-+
-+typedef struct {
-+  Pixmap lineMaskPixmap;
-+  Picture lineMaskPicture;
-+  GC drawLineGC;
-+  GC clearLineGC;
-+
-+  Pixmap maskPixmap;
-+  Picture maskPicture;
-+  jfloat validatedGCAlpha;
-+
-+  XrArrayList rects;
-+  XrArrayList lines;
-+  MaskRegion region;
-+
-+  int xTiles;
-+  int yTiles;
-+  int xTileCap;
-+  int yTileCap;
-+  XrTile *tiles;
-+
-+  Pixmap gradPixmap;
-+  Picture gradPict;
-+}MaskBuffer;
-+
-+MaskBuffer* initMaskBuffer(Window window);
-+
-+void addRect(MaskBuffer* buf, short x, short y, unsigned short w, unsigned short h);
-+
-+void addLine(MaskBuffer* buf, int x1, int y1, int x2, int y2);
-+
-+void fillMask(MaskBuffer* buf, Picture dest);
-+
-+static void storeRectsInTiles(MaskBuffer *buf);
-+
-+static void cleanMaskBuffer(MaskBuffer *buf);
-+
-+static void limitRetcCoords(XRectangle *rect);
-+
-+static void initRegion(MaskRegion *region);
-+
-+static void growDirtyRegion(MaskRegion *region, jint x, jint y, jint x2, jint y2);
-+
-+static void growDirtyRegionTileLimit(MaskRegion *region, jint x, jint y, jint x2, jint y2);
-+
-+static void initXrTile(XrTile *tile);
-+
-+static void getTileDirtyArea(MaskRegion *dirtyRectArea, MaskRegion *dirtyLineArea, MaskRegion *totalDirtyArea);
-+
-+static void translateRects(XrArrayList *rectList, int x, int y);
-+
-+#endif /* MaskBuffer_h_Included */
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2010-06-02 19:03:05.000000000 +0100
-@@ -71,7 +71,7 @@
- extern AwtGraphicsConfigDataPtr
-     getGraphicsConfigFromComponentPeer(JNIEnv *env, jobject this);
- extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs;
--static jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo);
-+
- static int X11SD_FindClip(SurfaceDataBounds *b, SurfaceDataBounds *bounds,
-                           X11SDOps *xsdo);
- static int X11SD_ClipToRoot(SurfaceDataBounds *b, SurfaceDataBounds *bounds,
-@@ -97,19 +97,10 @@
- 
- #endif /* !HEADLESS */
- 
--/*
-- * Class:     sun_java2d_x11_X11SurfaceData
-- * Method:    initIDs
-- * Signature: (Ljava/lang/Class;Z)V
-- */
--JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_initIDs(JNIEnv *env, jclass xsd,
--                                           jclass XORComp, jboolean tryDGA)
-+jboolean XShared_initIDs(JNIEnv *env)
- {
- #ifndef HEADLESS
--    void *lib = 0;
--
--    union {
-+   union {
-         char c[4];
-         int i;
-     } endian;
-@@ -117,20 +108,59 @@
-     endian.i = 0xff000000;
-     nativeByteOrder = (endian.c[0]) ? MSBFirst : LSBFirst;
- 
-+    dgaAvailable = JNI_FALSE;
-+
-     cachedXImage = NULL;
- 
-     if (sizeof(X11RIPrivate) > SD_RASINFO_PRIVATE_SIZE) {
-         JNU_ThrowInternalError(env, "Private RasInfo structure too large!");
--        return;
-+        return JNI_FALSE;
-+    }
-+
-+#ifdef MITSHM
-+    if (getenv("NO_AWT_MITSHM") == NULL &&
-+        getenv("NO_J2D_MITSHM") == NULL) {
-+        char * force;
-+        TryInitMITShm(env, &useMitShmExt, &useMitShmPixmaps);
-+        useMitShmPixmaps = (useMitShmPixmaps == CAN_USE_MITSHM);
-+        force = getenv("J2D_PIXMAPS");
-+        if (force != NULL) {
-+            if (useMitShmPixmaps && (strcmp(force, "shared") == 0)) {
-+                forceSharedPixmaps = JNI_TRUE;
-+            } else if (strcmp(force, "server") == 0) {
-+                useMitShmPixmaps = JNI_FALSE;
-+            }
-+        }
-     }
- 
-+    return JNI_TRUE;
-+#endif /* MITSHM */
-+
-+#endif /* !HEADLESS */
-+}
-+
-+
-+/*
-+ * Class:     sun_java2d_x11_X11SurfaceData
-+ * Method:    initIDs
-+ * Signature: (Ljava/lang/Class;Z)V
-+ */
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_x11_X11SurfaceData_initIDs(JNIEnv *env, jclass xsd,
-+                                           jclass XORComp, jboolean tryDGA)
-+{
-+#ifndef HEADLESS
-+  if(XShared_initIDs(env))
-+  {
-+    void *lib = 0;
-+
-     xorCompClass = (*env)->NewGlobalRef(env, XORComp);
- 
-     if (tryDGA && (getenv("NO_J2D_DGA") == NULL)) {
-     /* we use RTLD_NOW because of bug 4032715 */
-         lib = dlopen("libsunwjdga.so", RTLD_NOW);
-     }
--    dgaAvailable = JNI_FALSE;
-+
-     if (lib != NULL) {
-         JDgaStatus ret = JDGA_FAILED;
-         void *sym = dlsym(lib, "JDgaLibInit");
-@@ -149,24 +179,7 @@
-             lib = NULL;
-         }
-     }
--
--#ifdef MITSHM
--    if (getenv("NO_AWT_MITSHM") == NULL &&
--        getenv("NO_J2D_MITSHM") == NULL) {
--        char * force;
--        TryInitMITShm(env, &useMitShmExt, &useMitShmPixmaps);
--        useMitShmPixmaps = (useMitShmPixmaps == CAN_USE_MITSHM);
--        force = getenv("J2D_PIXMAPS");
--        if (force != NULL) {
--            if (useMitShmPixmaps && (strcmp(force, "shared") == 0)) {
--                forceSharedPixmaps = JNI_TRUE;
--            } else if (strcmp(force, "server") == 0) {
--                useMitShmPixmaps = JNI_FALSE;
--            }
--        }
--    }
--#endif /* MITSHM */
--
-+  }
- #endif /* !HEADLESS */
- }
- 
-@@ -304,6 +317,8 @@
-     } else {
-         xsdo->pixelmask = 0xff;
-     }
-+
-+    xsdo->xrPic = None;
- #endif /* !HEADLESS */
- }
- 
-@@ -384,6 +399,10 @@
-         XFreeGC(awt_display, xsdo->cachedGC);
-         xsdo->cachedGC = NULL;
-     }
-+    if(xsdo->xrPic != None) {
-+      XRenderFreePicture(awt_display, xsdo->xrPic);
-+    }
-+
-     AWT_UNLOCK();
- #endif /* !HEADLESS */
- }
-@@ -404,29 +423,10 @@
- #endif /* !HEADLESS */
- }
- 
--/*
-- * Class:     sun_java2d_x11_X11SurfaceData
-- * Method:    initSurface
-- * Signature: ()V
-- */
--JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_initSurface(JNIEnv *env, jclass xsd,
--                                               jint depth,
--                                               jint width, jint height,
--                                               jlong drawable)
-+
-+jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width, jint height, jlong drawable)
- {
- #ifndef HEADLESS
--    X11SDOps *xsdo = X11SurfaceData_GetOps(env, xsd);
--    if (xsdo == NULL) {
--        return;
--    }
--
--    if (xsdo->configData->awt_cmap == (Colormap)NULL) {
--        awtJNI_CreateColorData(env, xsdo->configData, 1);
--    }
--    /* color_data will be initialized in awtJNI_CreateColorData for
--       8-bit visuals */
--    xsdo->cData = xsdo->configData->color_data;
- 
-     if (drawable != (jlong)0) {
-         /* Double-buffering */
-@@ -452,7 +452,7 @@
-             if (xsdo->drawable) {
-                 xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
-                 xsdo->shmPMData.shmPixmap = xsdo->drawable;
--                return;
-+                return JNI_TRUE;
-             }
-         }
- #endif /* MITSHM */
-@@ -472,7 +472,40 @@
-     if (xsdo->drawable == 0) {
-         JNU_ThrowOutOfMemoryError(env,
-                                   "Can't create offscreen surface");
-+        return JNI_FALSE;
-     }
-+
-+    return JNI_TRUE;
-+#endif /* !HEADLESS */
-+}
-+
-+
-+/*
-+ * Class:     sun_java2d_x11_X11SurfaceData
-+ * Method:    initSurface
-+ * Signature: ()V
-+ */
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_x11_X11SurfaceData_initSurface(JNIEnv *env, jclass xsd,
-+                                               jint depth,
-+                                               jint width, jint height,
-+                                               jlong drawable)
-+{
-+#ifndef HEADLESS
-+    X11SDOps *xsdo = X11SurfaceData_GetOps(env, xsd);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    if (xsdo->configData->awt_cmap == (Colormap)NULL) {
-+        awtJNI_CreateColorData(env, xsdo->configData, 1);
-+    }
-+    /* color_data will be initialized in awtJNI_CreateColorData for
-+       8-bit visuals */
-+    xsdo->cData = xsdo->configData->color_data;
-+
-+    XShared_initSurface(env, xsdo, depth, width, height, drawable);
-+    xsdo->xrPic = NULL;
- #endif /* !HEADLESS */
- }
- 
-@@ -718,7 +751,7 @@
- }
- #endif /* MITSHM */
- 
--static jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo)
-+jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo)
- {
-     if (xsdo->isPixmap == JNI_TRUE) {
-         return SD_FAILURE;
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h	2010-05-19 19:30:53.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h	2010-06-02 19:03:05.000000000 +0100
-@@ -30,6 +30,10 @@
- 
- #include <jdga.h>
- 
-+#include <X11/extensions/Xrender.h>
-+#include "MaskBuffer.h"
-+#include "XRSurfaceData.h"
-+
- /**
-  * This include file contains support declarations for loops using the
-  * X11 extended SurfaceData interface to talk to an X11 drawable from
-@@ -87,6 +91,7 @@
- } ShmPixmapData;
- #endif /* MITSHM */
- 
-+
- struct _X11SDOps {
-     SurfaceDataOps      sdOps;
-     GetPixmapBgFunc     *GetPixmapWithBg;
-@@ -110,6 +115,7 @@
-     jboolean            isBgInitialized; /* whether the bg pixel is valid */
-     jint                pmWidth;       /* width, height of the */
-     jint                pmHeight;      /* pixmap */
-+    Picture             xrPic;
- #ifdef MITSHM
-     ShmPixmapData       shmPMData;     /* data for switching between shm/nonshm pixmaps*/
- #endif /* MITSHM */
-@@ -156,3 +162,21 @@
-  */
- JNIEXPORT X11SDOps * JNICALL
- X11SurfaceData_GetOps(JNIEnv *env, jobject sData);
-+
-+/*Prototypes for shared functions used by XRSurfaceData*/
-+jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width, jint height, jlong drawable);
-+
-+jboolean XShared_initIDs(JNIEnv *env);
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_x11_X11SurfaceData_initOps(JNIEnv *env, jobject xsd,
-+                                           jobject peer,
-+                                           jobject graphicsConfig, jint depth);
-+
-+JNIEXPORT jlong JNICALL Java_sun_java2d_x11_X11SurfaceData_XCreateGC (JNIEnv *env, jclass xsd, jlong pXSData);
-+
-+jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo);
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd);
-+
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,313 @@
-+#include <malloc.h>
-+#include "jni.h"
-+#include "XRGlyphCache.h"
-+#include "ArrayList.h"
-+#include "Trace.h"
-+#include <X11/extensions/Xrender.h>
-+
-+#define DEFAULT_CACHE_SIZE 1024
-+#define CACHED_PIXELS 100000
-+#define TIMES_RENDERED_THRESHOLD 5
-+
-+#ifndef HEADLESS
-+XRGlyphCacheInfo* XRGlyphCache_Init(XRenderPictFormat* glyphSetPictFormat)
-+{
-+    XRGlyphCacheInfo *cache;
-+    J2dTraceLn(J2D_TRACE_INFO, "XRGlyphCache_Init");
-+
-+    cache = (XRGlyphCacheInfo *) malloc(sizeof(XRGlyphCacheInfo));
-+    if (cache == NULL) {
-+        J2dRlsTraceLn(J2D_TRACE_ERROR, "XRGlyphCache_Init: could not allocate GlyphCacheInfo");
-+        return NULL;
-+    }
-+
-+    cache->cells = (XRCacheCellInfo *) calloc(DEFAULT_CACHE_SIZE, sizeof(XRCacheCellInfo));
-+    if(cache->cells == NULL) {
-+        J2dRlsTraceLn(J2D_TRACE_ERROR, "XRGlyphCache_Init: could not allocate cell space");
-+        return NULL;
-+    }
-+
-+    cache->glyphSet = XRenderCreateGlyphSet (awt_display, glyphSetPictFormat);
-+    cache->cellCapacity = DEFAULT_CACHE_SIZE;
-+    cache->usedCells = 0;
-+    cache->searchPosition = 0;
-+    cache->pixelsUsed = 0;
-+
-+    return cache;
-+}
-+
-+static jboolean cleanCache(XRGlyphCacheInfo *cache)
-+{
-+  J2dTraceLn(J2D_TRACE_INFO, "XRGlyphCache_cleanCache");
-+
-+  jint i;
-+
-+  /*First set cold cache entries free*/
-+  for(i=0; i < cache->cellCapacity; i++) {
-+    XRCacheCellInfo *cacheCell = &cache->cells[i];
-+    if(cacheCell->pinned == JNI_FALSE) {
-+      if(cacheCell->glyphID != 0 && cacheCell->timesRendered < TIMES_RENDERED_THRESHOLD) {
-+        J2dTraceLn1(J2D_TRACE_INFO, "Removing glyph from cache. ID:", cacheCell->glyphID);
-+        XRenderFreeGlyphs (awt_display, cache->glyphSet, (Glyph *) &cacheCell->glyphID, 1);
-+        cacheCell->glyphID = 0;
-+        cache->pixelsUsed -= (cacheCell->width * cacheCell->height);
-+        cache->usedCells--;
-+
-+        if(cacheCell->glyphInfo != NULL) {
-+	   cacheCell->glyphInfo->cellInfo = NULL;
-+	}	
-+      }
-+    }
-+     cacheCell->timesRendered = 0;
-+  }
-+
-+  cache->searchPosition = 0;
-+   
-+  /*If more than 70% are occupied, we enlarge our cache-size by 1.5*/
-+  jint oldCapacity = cache->cellCapacity;
-+  XRCacheCellInfo *oldCache = cache->cells;
-+  jfloat relUsed = ((jfloat) cache->usedCells) / cache->cellCapacity;
-+  if(relUsed > 0.7)
-+  {
-+     cache->cellCapacity = (jint) cache->cellCapacity*1.5;
-+     J2dTraceLn1(J2D_TRACE_INFO, "Extensing glyph-cache capacity to", cache->cellCapacity);
-+     
-+     cache->cells = (XRCacheCellInfo *) realloc(cache->cells, sizeof(XRCacheCellInfo) * (cache->cellCapacity));
-+     if(cache->cells == NULL) {
-+        J2dRlsTraceLn(J2D_TRACE_ERROR, "XRGlyphCache_cleanCache: Could not enlarge cell space");
-+        return JNI_FALSE;
-+      }
-+     memset(&cache->cells[oldCapacity], 0, sizeof(XRCacheCellInfo) * (cache->cellCapacity - oldCapacity));
-+
-+   //If realloc gave us a different location, update pointers in GlyphInfo
-+   if(oldCache != cache->cells) {
-+       int cnt;
-+       for(cnt = 0; cnt < oldCapacity; cnt++) {
-+           XRCacheCellInfo *cacheCell = &cache->cells[cnt];
-+           if(cacheCell->glyphID != 0 && cacheCell->glyphInfo != NULL) {
-+              cacheCell->glyphInfo->cellInfo = cacheCell; /*TODO: we currently mis-use the pointer for our own type*/
-+           }
-+        }
-+    }
-+  } 
-+
-+  return JNI_TRUE;
-+}
-+
-+static jboolean uploadGlyph(XRGlyphCacheInfo *cache, GlyphInfo *jginfo, XRCacheCellInfo *cacheCell)
-+{
-+     J2dTraceLn(J2D_TRACE_INFO, "XRGlyphCache_uploadGlyph");
-+
-+     unsigned char* glyphBuf = (unsigned char*) jginfo->image; 
-+     jboolean grayscale = (jginfo->rowBytes == jginfo->width);
-+     jint dstBytesPerPixel = grayscale ? 1 : 4;
-+     jint srcBytesPerPixel = grayscale ? 1 : 3;
-+     jint dstStrideWidth = dstBytesPerPixel * jginfo->width;
-+     jint srcStrideWidth = srcBytesPerPixel * jginfo->width;
-+     jint bufLen = dstStrideWidth * jginfo->height;
-+     jint width = jginfo->width, height = jginfo->height;
-+     jboolean bufferAllocated = JNI_FALSE;
-+
-+        if(jginfo->image != NULL) {
-+          if(grayscale == JNI_TRUE) {
-+
-+                 /*XRender expects glyph images to be padded to 4-byte boundaries*/
-+                 if(jginfo->width%4 != 0 || jginfo->image == NULL) { 
-+                 int pad = 4 - (jginfo->width % 4);
-+	         dstBytesPerPixel = jginfo->width + pad;
-+                 bufLen =  dstBytesPerPixel * jginfo->height;
-+                 glyphBuf = calloc(1, bufLen);
-+                 bufferAllocated = JNI_TRUE;
-+
-+                 if(jginfo->image != NULL)  {
-+	           int line, pix;
-+	           for(line = 0; line < jginfo->height; line++) {
-+		     for(pix = 0; pix < jginfo->width; pix++) {
-+		        glyphBuf[line*jginfo->width + pad*line + pix] = jginfo->image[line*jginfo->width + pix];
-+		     }
-+	           }	
-+                 }
-+             }
-+
-+          }else {
-+            bufLen =  dstStrideWidth * height;
-+            glyphBuf = calloc(1, bufLen);
-+            bufferAllocated = JNI_TRUE;
-+
-+	    int line, srcpix, dstpix;
-+	    for(line = 0; line < height; line++) {
-+		srcpix = 0;
-+		dstpix = 0;
-+		while(dstpix < dstStrideWidth) {
-+             /*B*/glyphBuf[line*dstStrideWidth + dstpix + 0] = /*B*/jginfo->image[(line*jginfo->rowBytes + srcpix + 2)];
-+             /*G*/glyphBuf[line*dstStrideWidth + dstpix + 1] = /*G*/jginfo->image[(line*jginfo->rowBytes + srcpix + 1)];
-+             /*R*/glyphBuf[line*dstStrideWidth + dstpix + 2] = /*R*/jginfo->image[(line*jginfo->rowBytes + srcpix + 0)];
-+             /*A*/glyphBuf[line*dstStrideWidth + dstpix + 3] = 255;		
-+                  srcpix += 3;
-+                  dstpix += 4;
-+		}
-+	    }
-+	 }
-+      }else {
-+         bufLen = 4; //Work arround for bug in older servers
-+	 glyphBuf = calloc(1, bufLen);
-+         bufferAllocated = JNI_TRUE;
-+	 width = 1;
-+	 height = 1;
-+      }
-+     
-+
-+     Glyph gid = (Glyph) cacheCell->glyphID;
-+     XGlyphInfo xginfo={.x=(jginfo->topLeftX*-1),.y=(jginfo->topLeftY*-1),.width=width,.height=height, .xOff = cacheCell->xOff,.yOff = cacheCell->yOff};
-+
-+     XRenderAddGlyphs(awt_display, cache->glyphSet, &gid, &xginfo, 1, glyphBuf, bufLen);
-+     
-+     if(bufferAllocated == JNI_TRUE) {
-+       free(glyphBuf);
-+     }
-+
-+     return JNI_TRUE;
-+}
-+
-+jboolean XRGlyphCache_CacheGlyphs(XRGlyphCacheInfo *cache, jlong *glyphPtrs, jint glyphCount, jint *ids)
-+{ 
-+   jint glyphsStored = 0;
-+   
-+   do {
-+    /**
-+     * Search for free cache-cells to store glyphs which have not been cached already.
-+     * The outer loop iterates over all cache-zells, as long as either all have been walked over or all glyphs are stored.
-+     * The inner loop loops over all non-processed glyphs (if the current zell is free), 
-+     * and stores it in the free cache-zell if not already cached, and pins it.
-+     * If the outer-loop finishes before all glyphs are cached, not enough free zells were available and a cache-cleanup is triggered.
-+     */
-+      while((cache->searchPosition < cache->cellCapacity) && (glyphsStored < glyphCount)) {
-+       XRCacheCellInfo *cacheCell = &cache->cells[cache->searchPosition];
-+       
-+       while(glyphsStored < glyphCount) {  //loop over unprocessed glyphs
-+	 GlyphInfo *currGlyph = (GlyphInfo *)jlong_to_ptr(glyphPtrs[glyphsStored]);// &glyphs[glyphsStored];
-+
-+         if(currGlyph->cellInfo == NULL) { //If the current glyph is not cached, add it to cache if current cacheZell is a free one
-+           //Evaluate not in loop-head, otherwise we would have to iterate until a free cell
-+           //even if all glyphs are already cached (common case)
-+           if(cacheCell->glyphID != 0)
-+           {
-+             cache->searchPosition++;
-+             break;
-+           }
-+
-+           currGlyph->cellInfo = cacheCell;
-+           cacheCell->glyphInfo = currGlyph;
-+           cacheCell->glyphID = (unsigned short) cache->searchPosition + 1;
-+           cacheCell->xOff = round(currGlyph->advanceX);
-+	   cacheCell->yOff = round(currGlyph->advanceY);
-+           cacheCell->width = currGlyph->width;
-+           cacheCell->height = currGlyph->height;
-+
-+           jboolean uploadError = uploadGlyph(cache, currGlyph, cacheCell);
-+           if(uploadError == JNI_FALSE) {
-+             return JNI_FALSE;
-+           }
-+
-+           cache->pixelsUsed += (currGlyph->width * currGlyph->height);
-+           cache->usedCells++;
-+         }
-+
-+	  //Work that has to be done independently wether the cell was cached or not
-+          XRCacheCellInfo *usedCell = (XRCacheCellInfo *) currGlyph->cellInfo;
-+          usedCell->pinned = JNI_TRUE;
-+          usedCell->timesRendered++;
-+          glyphsStored++;
-+        }
-+     }
-+       
-+     //TODO: If we were not able to store all uncached glyphs we free the cache and try again
-+     if(glyphsStored < glyphCount || cache->pixelsUsed > CACHED_PIXELS) { 
-+       J2dTraceLn(J2D_TRACE_INFO, "XRGlyphCache: Glyph-cache too small, cleanup triggered");
-+       if(cleanCache(cache) == JNI_FALSE) {
-+	  return JNI_FALSE;
-+       }
-+     }
-+   }while(glyphsStored < glyphCount);
-+ 
-+   /* Remove pin-property from the cache-entries,
-+    * pass IDs to the caller                     */
-+   int i;
-+   for(i=0; i < glyphCount; i++) {
-+     XRCacheCellInfo *cell = (XRCacheCellInfo*) (((GlyphInfo *)jlong_to_ptr(glyphPtrs[i]))->cellInfo);
-+     cell->pinned = JNI_FALSE;
-+     ids[i] = cell->glyphID;
-+   }
-+
-+   return JNI_TRUE;
-+}
-+
-+#if 0
-+void dumpCache(XRGlyphCacheInfo *cache)
-+{
-+  int i;
-+  for(i=0; i < cache->cellCapacity; i++)
-+  {
-+    XRCacheCellInfo *cell = &cache->cells[i];
-+    if(cell->glyphID != 0)
-+    {
-+      printf("Cache-Position: %d enthaelt glyph: %d mit counter:%d\n", i, cell->glyphID, cell->timesRendered);
-+      fflush(stdout);
-+    }
-+  }
-+}
-+#endif
-+
-+#endif /*!Headless*/
-+
-+
-+// 	  int line_, pix_;
-+// 	  for(line_ = 0; line_ < jginfo->height; line_++)
-+// 	  {
-+// 		for(pix_ = 0; pix_ < jginfo->rowBytes; pix_+=3)
-+// 		{
-+// 		  int r = jginfo->image[line_*jginfo->rowBytes + pix_ + 0];
-+//                   int g = jginfo->image[line_*jginfo->rowBytes + pix_ + 1];
-+// 	          int b = jginfo->image[line_*jginfo->rowBytes + pix_ + 2];
-+//   
-+//                 if(r > 99)
-+// 	{
-+// 	printf("%d,", r);
-+// 	}else	
-+//         if(r > 9)
-+// {
-+// 	printf(" %d,", r);
-+// }else
-+// {
-+// 	printf("  %d,", r);
-+// }
-+// 
-+//                 if(g > 99)
-+// 	{
-+// 	printf("%d,", g);
-+// 	}else	
-+//         if(g > 9)
-+// {
-+// 	printf(" %d,", g);
-+// }else
-+// {
-+// 	printf("  %d,", g);
-+// }
-+// 
-+//                 if(b > 99)
-+// 	{
-+// 	printf("%d,", b);
-+// 	}else	
-+//         if(b > 9)
-+// {
-+// 	printf(" %d,", b);
-+// }else
-+// {
-+// 	printf("  %d,", b);
-+// }
-+// 
-+// 	printf(" 255, ");
-+// }
-+//             printf("\n");
-+// 	  }	
-+//         fflush(stdout);
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,41 @@
-+#ifndef XRGlyphCache_h_Included
-+#define XRGlyphCache_h_Included
-+
-+#include "awt_p.h"
-+#include "awt_GraphicsEnv.h"
-+
-+#include <X11/extensions/Xrender.h>
-+#include "jni.h"
-+#include "fontscalerdefs.h"
-+
-+typedef struct _XRGlyphCacheInfo XRGlyphCacheInfo;
-+typedef struct _XRCacheCellInfo XRCacheCellInfo;
-+
-+struct _XRGlyphCacheInfo {
-+    XRCacheCellInfo *cells;
-+    jint searchPosition;
-+    jint usedCells;
-+    jint cellCapacity;
-+    jint pixelsUsed;
-+    GlyphSet glyphSet;
-+};
-+
-+struct _XRCacheCellInfo {
-+    XRGlyphCacheInfo *cacheInfo;
-+    GlyphInfo *glyphInfo;
-+    unsigned short glyphID;
-+    jint timesRendered;
-+    jint width;
-+    jint height;
-+    jint xOff;
-+    jint yOff;
-+    jboolean pinned;
-+};
-+
-+#ifndef HEADLESS
-+XRGlyphCacheInfo* XRGlyphCache_Init(XRenderPictFormat* glyphSetPictFormat);
-+jboolean XRGlyphCache_CacheGlyphs(XRGlyphCacheInfo *cache, jlong *glyphPtrs, jint glyphCount, jint *ids);
-+void dumpCache(XRGlyphCacheInfo *cache);
-+#endif
-+
-+#endif /* XRGlyphCache_h_Included */
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,223 @@
-+/*
-+ * Copyright 2000-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+#include <stdlib.h>
-+#include <jni.h>
-+#include <jlong.h>
-+#include "X11SurfaceData.h"
-+#include "XRSurfaceData.h"
-+#include "Region.h"
-+#include "MaskBuffer.h"
-+#include "Trace.h"
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRPMBlitLoops_nativeRenderBlit
-+    (JNIEnv *env, jclass xsd,
-+     jlong srcData, jlong dstData,
-+     jint srcx, jint srcy,
-+     jint dstx, jint dsty,
-+     jint width, jint height)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRPBMBlitLoops_nativeRenderBlit");
-+
-+    X11SDOps *srcXsdo, *dstXsdo;
-+    SurfaceDataBounds span, srcBounds;
-+
-+    if (width <= 0 || height <= 0) {
-+        return;
-+    }
-+
-+    srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
-+    if (srcXsdo == NULL) {
-+        return;
-+    }
-+    dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
-+    if (dstXsdo == NULL) {
-+        return;
-+    }
-+
-+#ifdef MITSHM
-+    if (srcXsdo->isPixmap) {
-+        X11SD_UnPuntPixmap(srcXsdo);
-+    }
-+#endif /* MITSHM */
-+
-+/*   printf("src: %d, dst: %d", srcXsdo->xrData.xrPic, dstXsdo->xrData.xrPic);
-+   fflush(stdout);*/
-+
-+/*XTransform xf = {{{XDoubleToFixed (0.5), 0, 0 },
-+{0, XDoubleToFixed (0.5), 0 },
-+{XDoubleToFixed (0), XDoubleToFixed (0), XDoubleToFixed (1.0)}}};
-+
-+XRenderSetPictureTransform(awt_display, dstXsdo->xrData.xrPic, &xf);
-+XRenderSetPictureFilter(awt_display, dstXsdo->xrData.xrPic, "good", NULL, 0);*/
-+
-+   XRenderComposite (awt_display, xrSrcData.compRule, srcXsdo->xrPic, xrSrcData.alphaMask, dstXsdo->xrPic, srcx, srcy, 0, 0, dstx, dsty, width, height); 
-+
-+#ifdef MITSHM
-+    if (srcXsdo->shmPMData.usingShmPixmap) {
-+        srcXsdo->shmPMData.xRequestSent = JNI_TRUE;
-+    }
-+#endif /* MITSHM */
-+    X11SD_DirectRenderNotify(env, dstXsdo);
-+#endif /* !HEADLESS */
-+}
-+
-+#ifndef HEADLESS
-+static Picture prepareMaskPM(JNIEnv *env, X11SDOps *alphaXsdo, jbyteArray maskArray, jint maskoff, jint maskscan, jint w, jint h)
-+{
-+    int line, pix;
-+    unsigned char *mask;
-+    SurfaceDataOps *alphaOps = &alphaXsdo->sdOps;
-+
-+    jboolean useEA = (xrSrcData.src != xrSrcData.solid && xrSrcData.extraAlpha != 1.0f);
-+
-+    if (maskArray != NULL) {
-+    		SurfaceDataRasInfo alphaInfo;
-+    		alphaInfo.bounds.x1 = 0;
-+    		alphaInfo.bounds.y1 = 0;
-+    		alphaInfo.bounds.x2 = w;
-+    		alphaInfo.bounds.y2 = h;
-+
-+		if (alphaOps->Lock(env, alphaOps, &alphaInfo, SD_LOCK_WRITE) != SD_SUCCESS) {
-+			SurfaceData_InvokeUnlock(env, alphaOps, &alphaInfo);
-+			return None;
-+		}
-+                mask = (unsigned char *) (*env)->GetPrimitiveArrayCritical(env, maskArray, NULL);
-+
-+		alphaOps->GetRasInfo(env, alphaOps, &alphaInfo);
-+
-+              if(useEA && (w > MASK_TILE_SIZE || h > MASK_TILE_SIZE))
-+              {
-+		for(line=0; line < h; line++) {
-+		  for(pix=0; pix < w; pix++) {
-+  		     ((unsigned char*)alphaInfo.rasBase)[line*alphaInfo.scanStride + pix] = (unsigned char) (mask[maskscan*line + pix + maskoff] * xrSrcData.extraAlpha);  
-+		  }
-+		}
-+             }else
-+             {
-+		for(line=0; line < h; line++) {
-+		  for(pix=0; pix < w; pix++) {
-+  		     ((unsigned char*)alphaInfo.rasBase)[line*alphaInfo.scanStride + pix] = (unsigned char) (mask[maskscan*line + pix + maskoff]);  
-+		  }
-+		}
-+             }
-+
-+                SurfaceData_InvokeRelease(env, alphaOps, &alphaInfo);
-+                SurfaceData_InvokeUnlock(env, alphaOps, &alphaInfo);
-+                (*env)->ReleasePrimitiveArrayCritical(env, maskArray, mask, JNI_ABORT);
-+
-+	if(useEA) {
-+                XRenderComposite (awt_display, PictOpOver, alphaXsdo->xrPic, xrSrcData.alphaMask, maskBuffer->maskPicture, 0, 0, 0, 0, 0, 0, w, h); 
-+                return maskBuffer->maskPicture;
-+          }else
-+          {
-+             return alphaXsdo->xrPic;
-+          }
-+    }else
-+    {
-+      if(useEA) {
-+        return xrSrcData.alphaMask;
-+      }
-+    }
-+
-+    return None;
-+}
-+
-+static void cleanMask(Picture mask, int w, int h)
-+{
-+  if(mask == maskBuffer->maskPicture)
-+  {
-+     XRenderColor color_black={.red=0, .green=0, .blue=0, .alpha=0xffff};
-+     XRenderFillRectangle (awt_display, PictOpClear, maskBuffer->maskPicture, &color_black, 0, 0, w, h);
-+  }
-+}
-+#endif
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRMaskFill_maskFill
-+     (JNIEnv *env, jobject joSelf, 
-+      jlong dstData, jlong alphaData,
-+      jint x, jint y, jint w, jint h,
-+      jint maskoff, jint maskscan, 
-+      jint masklen, jbyteArray maskArray)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRPBMBlitLoops_maskFill");
-+
-+    Picture maskPic;
-+    X11SDOps *dstXsdo, *alphaXsdo;
-+    dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
-+    alphaXsdo = (X11SDOps *)jlong_to_ptr(alphaData);
-+    if (dstXsdo == NULL || alphaXsdo == NULL) {
-+        return;
-+    }
-+
-+    maskPic = prepareMaskPM(env, alphaXsdo, maskArray, maskoff, maskscan, w, h);
-+
-+    XRComposite(maskPic, dstXsdo->xrPic, x, y, 0, 0, x, y, w, h);
-+
-+    cleanMask(maskPic, w, h);
-+
-+    X11SD_DirectRenderNotify(env, dstXsdo);
-+#endif
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRMaskBlit_maskBlit
-+     (JNIEnv *env, jobject joSelf, 
-+      jlong srcData, jlong dstData, jlong alphaData,
-+      jint srcx, jint srcy,
-+      jint dstx, jint dsty, jint w, jint h,
-+      jint maskoff, jint maskscan, 
-+      jint masklen, jbyteArray maskArray)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRPBMBlitLoops_maskBlit");
-+
-+    Picture maskPic;
-+    X11SDOps *srcXsdo, *dstXsdo, *alphaXsdo;
-+    srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
-+    dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
-+    alphaXsdo = (X11SDOps *)jlong_to_ptr(alphaData);
-+    if (srcXsdo == NULL || dstXsdo == NULL || alphaXsdo == NULL) {
-+        return;
-+    }
-+
-+    maskPic = prepareMaskPM(env, alphaXsdo, maskArray, maskoff, maskscan, w, h);
-+    XRenderComposite (awt_display, xrSrcData.compRule, srcXsdo->xrPic, maskPic, dstXsdo->xrPic, srcx, srcy, 0, 0, dstx, dsty, w, h); 
-+    cleanMask(maskPic, w, h);
-+
-+    X11SD_DirectRenderNotify(env, dstXsdo);
-+
-+    #ifdef MITSHM
-+    if (srcXsdo->isPixmap) {
-+        X11SD_UnPuntPixmap(srcXsdo);
-+    }
-+    #endif /* MITSHM */
-+#endif
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,318 @@
-+/*
-+ * Copyright 2000-2006 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+#include "X11SurfaceData.h"
-+#include "XRSurfaceData.h"
-+#include "SpanIterator.h"
-+#include "Trace.h"
-+#include "ProcessPath.h"
-+#include "GraphicsPrimitiveMgr.h"
-+#include <math.h>
-+#include <stdint.h>
-+
-+#include <jlong.h>
-+
-+#define POLYTEMPSIZE    (int)(256 / sizeof(XPoint))
-+#define ABS(n)          (((n) < 0) ? -(n) : (n))
-+
-+#define MAX_SHORT 32767
-+#define MIN_SHORT (-32768)
-+
-+#define CLAMP_TO_SHORT(x) (((x) > MAX_SHORT)                            \
-+                           ? MAX_SHORT                                  \
-+                           : ((x) < MIN_SHORT)                          \
-+                               ? MIN_SHORT                              \
-+                               : (x))
-+
-+#define CLAMP_TO_USHORT(x)  (((x) > 65535) ? 65535 : ((x) < 0) ? 0 : (x))
-+
-+
-+JNIEXPORT void JNICALL XRDrawLines(Picture dst, XPoint * points, int npoints)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRRenderer_XRDrawLines");
-+
-+    int i;
-+    XPoint *start = &points[0], *end;
-+    for(i=1; i < npoints; i++)
-+    {
-+      end = &points[i];
-+      addLine(maskBuffer, start->x, start->y, end->x, end->y);
-+      start = end;
-+    }
-+#endif
-+}
-+
-+/*
-+ * Class:     sun_java2d_xr_XRRenderer
-+ * Method:    XDrawLine
-+ * Signature: (IJIIII)V
-+ */
-+JNIEXPORT void JNICALL Java_sun_java2d_xr_XRRenderer_XRDrawLine
-+    (JNIEnv *env, jobject xr, jlong pXSData, jint x1, jint y1, jint x2, jint y2)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRRenderer_XRDrawLine");
-+    X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    addLine(maskBuffer, x1, y1, x2, y2);
-+    fillMask(maskBuffer, xsdo->xrPic);
-+
-+    X11SD_DirectRenderNotify(env, xsdo);
-+#endif /* !HEADLESS */
-+}
-+
-+static void storeLine(DrawHandler* hnd,
-+                      jint x0, jint y0, jint x1, jint y1)
-+{
-+#ifndef HEADLESS
-+   addLine(maskBuffer, x0, y0, x1, y1);
-+#endif /* !HEADLESS */
-+}
-+
-+static void storePoint(DrawHandler* hnd, jint x0, jint y0) {
-+#ifndef HEADLESS
-+    addRect(maskBuffer, x0, y0, 1, 1);
-+#endif /* !HEADLESS */
-+}
-+
-+static void drawSubPath(ProcessHandler* hnd) {
-+#ifndef HEADLESS
-+#endif /* !HEADLESS */
-+}
-+
-+static void drawScanline(DrawHandler* hnd, jint x0, jint x1, jint y0)
-+{
-+#ifndef HEADLESS
-+   addRect(maskBuffer, x0, y0, x1-x0 + 1, 1);
-+#endif /* !HEADLESS */
-+}
-+
-+/*
-+ * Class:     sun_java2d_xr_XRRenderer
-+ * Method:    XDoPath
-+ * Signature: (Lsun/java2d/SunGraphics2D;JJIILjava/awt/geom/Path2D/Float;Z)V
-+ */
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRRenderer_XRDoPath
-+    (JNIEnv *env, jobject self, jobject sg2d, jlong pXSData,
-+     jint transX, jint transY, jobject p2df, jboolean isFill)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRRenderer_XRDoPath");
-+
-+    X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+    jarray typesArray;
-+    jobject pointArray;
-+    jarray coordsArray;
-+    jint numTypes;
-+    jint fillRule;
-+    jint maxCoords;
-+    jbyte *types;
-+    jfloat *coords;
-+
-+    DrawHandler drawHandler = {
-+        NULL, NULL, NULL,
-+        MIN_SHORT, MIN_SHORT, MAX_SHORT, MAX_SHORT,
-+        0, 0, 0, 0,
-+        NULL
-+    };
-+    PHStroke stroke;
-+
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    if (isFill) {
-+        fillRule = (*env)->GetIntField(env, p2df, path2DWindingRuleID);
-+    }
-+
-+    typesArray = (jarray)(*env)->GetObjectField(env, p2df, path2DTypesID);
-+    coordsArray = (jarray)(*env)->GetObjectField(env, p2df,
-+                                                 path2DFloatCoordsID);
-+    if (coordsArray == NULL) {
-+        JNU_ThrowNullPointerException(env, "coordinates array");
-+        return;
-+    }
-+    numTypes = (*env)->GetIntField(env, p2df, path2DNumTypesID);
-+    if ((*env)->GetArrayLength(env, typesArray) < numTypes) {
-+        JNU_ThrowArrayIndexOutOfBoundsException(env, "types array");
-+        return;
-+    }
-+
-+
-+    drawHandler.pData = NULL;
-+
-+    stroke = (((*env)->GetIntField(env, sg2d, sg2dStrokeHintID) ==
-+               sunHints_INTVAL_STROKE_PURE)
-+              ? PH_STROKE_PURE
-+              : PH_STROKE_DEFAULT);
-+
-+    maxCoords = (*env)->GetArrayLength(env, coordsArray);
-+    coords = (jfloat*)
-+        (*env)->GetPrimitiveArrayCritical(env, coordsArray, NULL);
-+    if (coords != NULL) {
-+        types = (jbyte*)
-+            (*env)->GetPrimitiveArrayCritical(env, typesArray, NULL);
-+        if (types != NULL) {
-+            jboolean ok;
-+
-+            if (isFill) {
-+                drawHandler.pDrawScanline = &drawScanline;
-+                ok = doFillPath(&drawHandler,
-+                                transX, transY,
-+                                coords, maxCoords,
-+                                types, numTypes,
-+                                stroke, fillRule);
-+            } else {
-+                drawHandler.pDrawLine = &storeLine;
-+                drawHandler.pDrawPixel = &storePoint;
-+                ok = doDrawPath(&drawHandler, &drawSubPath,
-+                                transX, transY,
-+                                coords, maxCoords,
-+                                types, numTypes,
-+                                stroke);
-+            }
-+            if (!ok) {
-+                JNU_ThrowArrayIndexOutOfBoundsException(env, "coords array");
-+            }
-+            (*env)->ReleasePrimitiveArrayCritical(env, typesArray, types,
-+                                                  JNI_ABORT);
-+        }
-+        (*env)->ReleasePrimitiveArrayCritical(env, coordsArray, coords,
-+                                              JNI_ABORT);
-+    }
-+
-+
-+    fillMask(maskBuffer, xsdo->xrPic);
-+
-+    X11SD_DirectRenderNotify(env, xsdo);
-+#endif /* !HEADLESS */
-+}
-+
-+JNIEXPORT void JNICALL Java_sun_java2d_xr_XRRenderer_XRFillRect
-+    (JNIEnv *env, jobject xr,
-+     jlong pXSData,
-+     jint x, jint y, jint w, jint h)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRRenderer_XRFillRect");
-+    X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+ 
-+    addRect(maskBuffer, x, y, w, h);
-+    fillMask(maskBuffer, xsdo->xrPic);
-+
-+    X11SD_DirectRenderNotify(env, xsdo);
-+#endif /* !HEADLESS */
-+}
-+
-+JNIEXPORT void JNICALL Java_sun_java2d_xr_XRRenderer_XRFillSpans
-+    (JNIEnv *env, jobject xr,
-+     jlong pXSData,
-+     jobject si, jlong pIterator,
-+     jint transx, jint transy)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRRenderer_XRFillSpans");
-+
-+    SpanIteratorFuncs *pFuncs = (SpanIteratorFuncs *) jlong_to_ptr(pIterator);
-+    void *srData;
-+    jint x, y, w, h;
-+    jint spanbox[4];
-+    X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    if (JNU_IsNull(env, si)) {
-+        JNU_ThrowNullPointerException(env, "span iterator");
-+        return;
-+    }
-+    if (pFuncs == NULL) {
-+        JNU_ThrowNullPointerException(env, "native iterator not supplied");
-+        return;
-+    }
-+
-+    srData = (*pFuncs->open)(env, si);
-+    while ((*pFuncs->nextSpan)(srData, spanbox)) {
-+        x = spanbox[0] + transx;
-+        y = spanbox[1] + transy;
-+        w = spanbox[2] - spanbox[0];
-+        h = spanbox[3] - spanbox[1];
-+
-+        addRect(maskBuffer, x, y, w, h);
-+    }
-+
-+    fillMask(maskBuffer, xsdo->xrPic);
-+
-+    (*pFuncs->close)(env, srData);
-+    X11SD_DirectRenderNotify(env, xsdo);
-+#endif /* !HEADLESS */
-+}
-+
-+/*
-+ * Class:     sun_java2d_xr_XRRenderer
-+ * Method:    devCopyArea
-+ * Signature: (Lsun/java2d/SurfaceData;IIIIII)V
-+ */
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRRenderer_devCopyArea
-+    (JNIEnv *env, jobject xr,
-+     jlong xsd, jlong gc,
-+     jint srcx, jint srcy,
-+     jint dstx, jint dsty,
-+     jint width, jint height)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRRenderer_devCopyArea");
-+
-+    X11SDOps *xsdo;
-+    GC xgc;
-+
-+    xsdo = (X11SDOps *) jlong_to_ptr(xsd);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    xgc = (GC) jlong_to_ptr(gc);
-+    if (xgc == NULL) {
-+        return;
-+    }
-+
-+    XCopyArea(awt_display, xsdo->drawable, xsdo->drawable, xgc,
-+              srcx, srcy, width, height, dstx, dsty);
-+
-+    X11SD_DirectRenderNotify(env, xsdo);
-+#endif /* !HEADLESS */
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,519 @@
-+#include "GraphicsPrimitiveMgr.h"
-+#include "Region.h"
-+#include "Trace.h"
-+#include "X11SurfaceData.h"
-+
-+#ifndef HEADLESS
-+SrcSurfaceData xrSrcData;
-+MaskBuffer *maskBuffer;
-+#endif /* !HEADLESS */
-+
-+#define BUILD_TRANSFORM_MATRIX(TRANSFORM, M00, M01, M02, M10, M11, M12)                        \
-+    {                                                                                          \
-+      TRANSFORM.matrix[0][0] = M00;                                                            \
-+      TRANSFORM.matrix[0][1] = M01;                                                            \
-+      TRANSFORM.matrix[0][2] = M02;                                                            \
-+      TRANSFORM.matrix[1][0] = M10;                                                            \
-+      TRANSFORM.matrix[1][1] = M11;                                                            \
-+      TRANSFORM.matrix[1][2] = M12;                                                            \
-+      TRANSFORM.matrix[2][0] = 0;                                                              \
-+      TRANSFORM.matrix[2][1] = 0;                                                              \
-+      TRANSFORM.matrix[2][2] = 1<<16;                                                          \
-+    }
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_initOps(JNIEnv *env, jobject xsd,
-+                                           jobject peer,
-+                                           jobject graphicsConfig, jint depth)
-+{
-+   J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initOps");
-+
-+   Java_sun_java2d_x11_X11SurfaceData_initOps(env, xsd, peer, graphicsConfig, depth);
-+}
-+
-+JNIEXPORT jlong JNICALL Java_sun_java2d_xr_XRSurfaceData_XCreateGC (JNIEnv *env, jclass xsd, jlong pXSData)
-+{
-+   J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XCreateGC");
-+
-+   return Java_sun_java2d_x11_X11SurfaceData_XCreateGC (env, xsd, pXSData);
-+}
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd)
-+{
-+  J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_flushNativeSurface");
-+
-+  Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface(env, xsd);
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_setInvalid(JNIEnv *env, jobject xsd)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_setInvalid");
-+    X11SDOps *xsdo = (X11SDOps *) SurfaceData_GetOps(env, xsd);
-+
-+    if (xsdo != NULL) {
-+        xsdo->invalid = JNI_TRUE;
-+    }
-+#endif /* !HEADLESS */
-+}
-+
-+JNIEXPORT jboolean JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRIsDrawableValid(JNIEnv *env, jobject this)
-+{
-+    jboolean ret = JNI_FALSE;
-+
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRIsDrawableValid");
-+    X11SDOps *xsdo = X11SurfaceData_GetOps(env, this);
-+
-+    if (xsdo->drawable != 0 || X11SD_InitWindow(env, xsdo) == SD_SUCCESS) {
-+        ret = JNI_TRUE;
-+    }
-+
-+#endif /* !HEADLESS */
-+
-+    return ret;
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+   Java_sun_java2d_xr_XRSurfaceData_XRInitXRender(JNIEnv *env, jobject xsd, jlong pXSData, jint pictFormat)
-+{
-+#ifndef HEADLESS
-+  J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initXRender");
-+  X11SDOps *xsdo;
-+  xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+  if (xsdo == NULL) {
-+      return;
-+  }
-+
-+  if(xsdo->xrPic == None)
-+  {
-+    XRenderPictureAttributes pict_attr;
-+    pict_attr.repeat = RepeatNone; 
-+    XRenderPictFormat *fmt = XRenderFindStandardFormat(awt_display, pictFormat);
-+    xsdo->xrPic = XRenderCreatePicture(awt_display, xsdo->drawable, fmt, CPRepeat, &pict_attr);
-+  }
-+
-+  if(maskBuffer == NULL) 
-+  {
-+    maskBuffer = initMaskBuffer(xsdo->drawable);
-+
-+    XRenderPictureAttributes pict_attr;
-+    pict_attr.repeat = 1;
-+
-+    /*Init solid color pen*/
-+    XRenderPictFormat *fmt = XRenderFindStandardFormat(awt_display, PictStandardARGB32);
-+    Pixmap solidPixmap = XCreatePixmap(awt_display, xsdo->drawable, 1, 1, 32);
-+    xrSrcData.solid = XRenderCreatePicture(awt_display, solidPixmap, fmt, CPRepeat, &pict_attr);
-+
-+    /*Init extra-alpha mask*/
-+    fmt = XRenderFindStandardFormat(awt_display, PictStandardA8);
-+    Pixmap alphaPixmap = XCreatePixmap(awt_display, xsdo->drawable, 1, 1, 8);
-+    xrSrcData.alphaMaskPict = XRenderCreatePicture(awt_display, alphaPixmap, fmt, CPRepeat, &pict_attr);
-+  }
-+#endif /* !HEADLESS */
-+}
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_initIDs(JNIEnv *env, jclass xsd, jboolean gradCacheEnabled)
-+{
-+#ifndef HEADLESS
-+  J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initIDs");
-+
-+  xrSrcData.src = None;
-+  xrSrcData.solid = None;
-+  xrSrcData.texture = None;
-+  xrSrcData.gradient = None;
-+  xrSrcData.alphaMask = None;
-+  xrSrcData.alphaMaskPict = None;
-+  xrSrcData.compRule = PictOpOver;
-+  xrSrcData.extraAlpha = 1.0f;
-+  xrSrcData.compRequired = JNI_FALSE;
-+
-+  xrSrcData.alphaColor.alpha = 0xffff;
-+  xrSrcData.alphaColor.red = 0xffff;
-+  xrSrcData.alphaColor.green = 0xffff;
-+  xrSrcData.alphaColor.blue = 0xffff;
-+
-+  xrSrcData.gradCacheEnabled = gradCacheEnabled;
-+
-+  maskBuffer = NULL;
-+
-+  XShared_initIDs(env);
-+#endif /* !HEADLESS */
-+}
-+
-+
-+void XRComposite(Picture mask, Picture dest, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, unsigned int width, unsigned int height)
-+{ 
-+  Picture cachedSrc = xrSrcData.src;
-+  int cachedX = srcX;
-+  int cachedY = srcY;
-+
-+  if(xrSrcData.src == xrSrcData.gradient && xrSrcData.gradCacheEnabled)
-+  {
-+    XRenderComposite(awt_display, PictOpSrc, xrSrcData.gradient, None, maskBuffer->gradPict, srcX, srcY, 0, 0, 0, 0, width, height);
-+    cachedX = 0;
-+    cachedY = 0; 
-+    cachedSrc = maskBuffer->gradPict;
-+  }
-+
-+   XRenderComposite (awt_display, xrSrcData.compRule, cachedSrc, mask, dest, cachedX, cachedY, maskX, maskY, dstX, dstY, width, height);
-+}
-+
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRInitSurface(JNIEnv *env, jclass xsd,
-+                                               jint depth,
-+                                               jint width, jint height,
-+                                               jlong drawable, jint pictFormat)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initSurface");
-+
-+    jboolean success = JNI_FALSE;
-+    X11SDOps *xsdo = X11SurfaceData_GetOps(env, xsd);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    if(XShared_initSurface(env, xsdo, depth, width, height, drawable))
-+    {
-+      XRenderPictureAttributes pict_attr;
-+      XRenderPictFormat *fmt = XRenderFindStandardFormat(awt_display, pictFormat); 
-+      xsdo->xrPic = XRenderCreatePicture(awt_display, xsdo->drawable, fmt, 0, &pict_attr);
-+    }
-+#endif /* !HEADLESS */
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRResetPaint
-+    (JNIEnv *env, jclass xsd)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRResetPaint");
-+    xrSrcData.src = xrSrcData.solid;
-+#endif /* !HEADLESS */
-+}
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetRepeat
-+    (JNIEnv *env, jclass xsd, jlong pXSData, jint repeat)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetRepeat");
-+    X11SDOps *xsdo;
-+    xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    XRenderPictureAttributes pict_attr;
-+    pict_attr.repeat = repeat;
-+    XRenderChangePicture (awt_display, xsdo->xrPic, CPRepeat, &pict_attr);
-+#endif /* !HEADLESS */
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetLinearGradientPaint
-+    (JNIEnv *env, jclass xsd, jfloatArray fractionsArray, jintArray pixelsArray, jint x1, jint y1, jint x2, jint y2, jint numStops, jint cycleMethod, jboolean useMask, jboolean linear, jint m00, jint m01, jint m02, jint m10, jint m11, jint m12)
-+{
-+#ifndef HEADLESS
-+   J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetLinearGradientPaint");
-+
-+   jint i;
-+   jint* pixels;
-+   jfloat* fractions;
-+
-+   if((pixels = (jint *) (*env)->GetPrimitiveArrayCritical(env, pixelsArray, NULL)) == NULL) {
-+     return;
-+   }
-+   if((fractions = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, fractionsArray, NULL)) == NULL) {
-+     return; //TODO release pixels first
-+   }
-+
-+   if(xrSrcData.gradient != None) {
-+      XRenderFreePicture(awt_display, xrSrcData.gradient);
-+      xrSrcData.gradient = None;
-+   }
-+
-+    XLinearGradient grad;
-+    XRenderColor colors[numStops];
-+    XFixed stops[numStops];
-+
-+    grad.p1.x = x1;
-+    grad.p1.y = y1;
-+    grad.p2.x = x2;
-+    grad.p2.y = y2;
-+
-+    for(i=0; i < numStops; i++) {
-+      stops[i] = XDoubleToFixed(fractions[i]);
-+      decodeRenderColorPre(pixels[i], &colors[i]);
-+    }
-+
-+    xrSrcData.gradient = XRenderCreateLinearGradient(awt_display, &grad, &stops[0], &colors[0], numStops);
-+    xrSrcData.src = xrSrcData.gradient;
-+
-+    XTransform tr;
-+    BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
-+    XRenderSetPictureTransform (awt_display, xrSrcData.gradient, &tr);
-+
-+    XRenderPictureAttributes pict_attr;
-+    pict_attr.repeat = cycleMethod;
-+    XRenderChangePicture (awt_display, xrSrcData.gradient, CPRepeat, &pict_attr);
-+
-+   (*env)->ReleasePrimitiveArrayCritical(env, pixelsArray, pixels, JNI_ABORT);
-+   (*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, fractions, JNI_ABORT);
-+#endif /* !HEADLESS */
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetRadialGradientPaint
-+    (JNIEnv *env, jclass xsd, jfloatArray fractionsArray, jintArray pixelsArray, jint fx, jint numStops, jint cycleMethod, jboolean useMask, jboolean linear, jint innerRadius, jint outerRadius, jint m00, jint m01, jint m02, jint m10, jint m11, jint m12)
-+{
-+#ifndef HEADLESS
-+   J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetRadialGradientPaint");
-+   jint i;
-+   jint* pixels;
-+   jfloat* fractions;
-+
-+   if((pixels = (jint *) (*env)->GetPrimitiveArrayCritical(env, pixelsArray, NULL)) == NULL) {
-+     return;
-+   }
-+   if((fractions = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, fractionsArray, NULL)) == NULL) {
-+     return;
-+   }
-+
-+   if(xrSrcData.gradient != None) {
-+      XRenderFreePicture(awt_display, xrSrcData.gradient);
-+      xrSrcData.gradient = None;
-+   }
-+
-+    XRadialGradient grad;
-+    XRenderColor colors[numStops];
-+    XFixed stops[numStops];
-+
-+    grad.inner.x = 0;
-+    grad.inner.y = 0;
-+    grad.inner.radius = innerRadius;
-+    grad.outer.x = 0;
-+    grad.outer.y = 0;
-+    grad.outer.radius = outerRadius;
-+
-+    for(i=0; i < numStops; i++) {
-+      stops[i] = XDoubleToFixed(fractions[i]);
-+      decodeRenderColorPre(pixels[i], &colors[i]);
-+    }
-+
-+    xrSrcData.gradient = XRenderCreateRadialGradient(awt_display, &grad, &stops[0], &colors[0], numStops);
-+    xrSrcData.src = xrSrcData.gradient;
-+
-+    XTransform tr;
-+    BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
-+    XRenderSetPictureTransform (awt_display, xrSrcData.gradient, &tr);
-+
-+    XRenderPictureAttributes pict_attr;
-+    pict_attr.repeat = cycleMethod;
-+    XRenderChangePicture (awt_display, xrSrcData.gradient, CPRepeat, &pict_attr);
-+
-+   (*env)->ReleasePrimitiveArrayCritical(env, pixelsArray, pixels, JNI_ABORT);
-+   (*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, fractions, JNI_ABORT);
-+#endif /* !HEADLESS */
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetTexturePaint
-+    (JNIEnv *env, jclass xsd, jlong pXSData)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetTexturePaint");
-+
-+    X11SDOps *xsdo;
-+    xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    xrSrcData.texture = xsdo->xrPic;
-+    xrSrcData.src = xrSrcData.texture;
-+#endif /* !HEADLESS */
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetComposite
-+    (JNIEnv *env, jclass xsd, jint compRule, jfloat eAlpha)
-+{
-+#ifndef HEADLESS
-+  J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetComposite");
-+
-+  xrSrcData.compRule = compRule;
-+  xrSrcData.extraAlpha = eAlpha;
-+
-+  if(eAlpha != 1.0f) {
-+    unsigned short alphaValue = XDoubleToUShort(eAlpha);
-+    xrSrcData.alphaColor.alpha = alphaValue;
-+    xrSrcData.alphaColor.red = alphaValue;
-+    xrSrcData.alphaColor.green = alphaValue;
-+    xrSrcData.alphaColor.blue = alphaValue;
-+    XRenderFillRectangle (awt_display, PictOpSrc, xrSrcData.alphaMaskPict, &xrSrcData.alphaColor, 0, 0, 1, 1);
-+    xrSrcData.alphaMask = xrSrcData.alphaMaskPict;
-+  }else {
-+    xrSrcData.alphaMask = None;
-+  }
-+#endif /* !HEADLESS */
-+}
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetClip
-+    (JNIEnv *env, jclass xsd, jlong pXSData,
-+     jint x1, jint y1, jint x2, jint y2,
-+     jobject complexclip)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetClip");
-+
-+    int numrects;
-+    XRectangle rects[256];
-+    XRectangle *pRect = rects;
-+    X11SDOps *xsdo;
-+
-+    xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    numrects = RegionToYXBandedRectangles(env,
-+            x1, y1, x2, y2, complexclip,
-+            &pRect, 256);
-+
-+
-+     XRenderSetPictureClipRectangles (awt_display, xsdo->xrPic, 0, 0, pRect, numrects);
-+
-+    if (pRect != rects) {
-+        free(pRect);
-+    }
-+#endif /* !HEADLESS */
-+}
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRResetClip
-+    (JNIEnv *env, jclass xsd, jlong pXSData)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRResetClip");
-+    X11SDOps *xsdo;
-+
-+    xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    XRectangle clip;
-+    clip.x = 0;
-+    clip.y = 0;
-+    clip.width = 32767;
-+    clip.height = 32767;
-+
-+    XRenderSetPictureClipRectangles (awt_display, xsdo->xrPic, 0, 0, &clip, 1);
-+#endif /* !HEADLESS */
-+}
-+
-+
-+	//private static native void XRSetTransform(long xsdo, double m00, double m01, double m02, double m10, double m11, double m12);
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetTransformNative
-+    (JNIEnv *env, jclass xsd, jlong pXSData, jint m00, jint m01, jint m02, jint m10, jint m11, jint m12)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetTransformNative");
-+    X11SDOps *xsdo;
-+
-+    xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    XTransform tr;
-+    BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
-+
-+    XRenderSetPictureTransform (awt_display, xsdo->xrPic, &tr);
-+#endif /* !HEADLESS */
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetForeground
-+    (JNIEnv *env, jclass xsd, jint pixel)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetForeground");
-+
-+    decodeRenderColor(pixel, &xrSrcData.solidColor);
-+    XRenderFillRectangle (awt_display, PictOpSrc, xrSrcData.solid, &xrSrcData.solidColor, 0, 0, 1, 1);
-+#endif /* !HEADLESS */
-+}
-+
-+
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRSurfaceData_XRSetFilter
-+    (JNIEnv *env, jclass xsd, jlong pXSData, jint filter)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRSetFilter");
-+    X11SDOps *xsdo;
-+
-+    xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
-+    if (xsdo == NULL) {
-+        return;
-+    }
-+
-+    switch(filter)
-+    {
-+      case 0:
-+        XRenderSetPictureFilter(awt_display, xsdo->xrPic, "fast", NULL, 0);
-+        break;
-+
-+      case 1:
-+        XRenderSetPictureFilter(awt_display, xsdo->xrPic, "good", NULL, 0);
-+        break;
-+
-+      case 2:
-+        XRenderSetPictureFilter(awt_display, xsdo->xrPic, "best", NULL, 0);
-+        break;
-+    }
-+#endif /* !HEADLESS */
-+}
-+
-+static void decodeRenderColor(jint pixel, XRenderColor *color)
-+{ 
-+   /*Extract color values from pixel, premultiply values. TODO: shouldn't this be done at the Java-level?*/
-+    XFixed alpha = (((pixel & 0xFF000000) >> 16) + 255); /*REMIND: We rely on optimizations that this is 0xffff for opaque colors*/
-+    XFixed red =   (((pixel & 0x00FF0000) >> 8)  + 255);
-+    XFixed green = (((pixel & 0x0000FF00) >> 0)  + 255);
-+    XFixed blue =  (((pixel & 0x000000FF) << 8)  + 255);
-+
-+    XDouble alphaMult = XFixedToDouble(alpha);
-+    color->alpha = alpha;
-+    color->red = (XFixed) red*alphaMult;
-+    color->green = (XFixed) green*alphaMult;
-+    color->blue = (XFixed) blue*alphaMult;
-+}
-+
-+static void decodeRenderColorPre(jint pixel, XRenderColor *color)
-+{ 
-+    color->alpha = (((pixel & 0xFF000000) >> 16) + 255); /*REMIND: We rely on optimizations that this is 0xffff for opaque colors*/
-+    color->red =   (((pixel & 0x00FF0000) >> 8)  + 255);
-+    color->green = (((pixel & 0x0000FF00) >> 0)  + 255);
-+    color->blue =  (((pixel & 0x000000FF) << 8)  + 255);
-+}
-\ No newline at end of file
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,33 @@
-+#ifndef XRSurfaceData_h_Included
-+#define XRSurfaceData_h_Included
-+
-+#define XDoubleToUShort(f)    ((unsigned short) ((f) * 65535))
-+
-+typedef struct {
-+  Picture src;
-+  jboolean compRequired;
-+  XRenderColor alphaColor;
-+
-+  Picture solid;
-+  XRenderColor solidColor;
-+  Picture texture;
-+  Picture gradient;
-+
-+  jint compRule;
-+  jfloat extraAlpha;
-+  Picture alphaMask; //Only !None when eA turned on
-+
-+  Picture alphaMaskPict;
-+  jboolean gradCacheEnabled;
-+} SrcSurfaceData;
-+
-+extern SrcSurfaceData xrSrcData;
-+extern MaskBuffer *maskBuffer;
-+
-+void XRComposite(Picture mask, Picture dest, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, unsigned int width, unsigned int height);
-+
-+static void decodeRenderColor(jint pixel, XRenderColor *color);
-+
-+static void decodeRenderColorPre(jint pixel, XRenderColor *color);
-+
-+#endif //XRSurfaceData_h_Included
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c	2010-06-02 19:03:05.000000000 +0100
-@@ -0,0 +1,171 @@
-+/*
-+ * Copyright 2001-2005 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+#include "GlyphImageRef.h"
-+
-+#ifdef HEADLESS
-+#include "SurfaceData.h"
-+#else
-+#include "X11SurfaceData.h"
-+#include "XRSurfaceData.h"
-+#include "GraphicsPrimitiveMgr.h"
-+#include "glyphblitting.h"
-+#include "sunfontids.h"
-+#include "fontscalerdefs.h"
-+#include "AccelGlyphCache.h"
-+#include "sunfontids.h"
-+#include "XRGlyphCache.h"
-+#include "Trace.h"
-+#endif /* !HEADLESS */
-+#include <jlong.h>
-+
-+#define TEXT_BM_WIDTH   1024
-+#define TEXT_BM_HEIGHT  32
-+
-+
-+#define FLOOR_ASSIGN(l, r)\
-+ if ((r)<0) (l) = ((int)floor(r)); else (l) = ((int)(r))
-+
-+#ifndef HEADLESS
-+static XRGlyphCacheInfo* grayCache = NULL;
-+static XRGlyphCacheInfo* lcdCache = NULL;
-+#endif
-+
-+JNIEXPORT void JNICALL
-+XRT_DrawGlyphList(JNIEnv *env, jobject xtr,
-+                 jlong dstData, jint numGlyphs, jboolean subPixPos, jboolean rgbOrder, jint lcdContrast,
-+                 jboolean usePositions, jfloat xOrigin, jfloat yOrigin, jlong *images, jfloat *positions)
-+{
-+#ifndef HEADLESS
-+  J2dTraceLn(J2D_TRACE_INFO, "XRTextRenderer_md: XRT_DrawGlyphList");
-+
-+  jint i;
-+  jboolean grayscale = JNI_TRUE;
-+
-+  X11SDOps *xsdo = (X11SDOps *)jlong_to_ptr(dstData);
-+  if (xsdo == NULL) {  
-+      J2dTraceLn(J2D_TRACE_INFO, "XRTextRenderer_md: Destination-Pointer null!");
-+      return;
-+    }
-+
-+  if (numGlyphs > 0) {
-+      GlyphInfo *ginfo = (GlyphInfo *)jlong_to_ptr(images[0]);
-+      grayscale = (ginfo->rowBytes == ginfo->width);
-+      subPixPos = subPixPos && (!grayscale);
-+  }
-+
-+  if(grayCache == NULL && grayscale == JNI_TRUE) {
-+    grayCache = XRGlyphCache_Init(XRenderFindStandardFormat(awt_display, PictStandardA8));
-+  }else
-+  if(lcdCache == NULL && grayscale == JNI_FALSE) {
-+    lcdCache = XRGlyphCache_Init(XRenderFindStandardFormat(awt_display, PictStandardARGB32));
-+  }
-+
-+   int eltCnt = -1;
-+   jint ids[numGlyphs]; 
-+   XGlyphElt32 elts[numGlyphs];
-+
-+   float advX = xOrigin; //xOrigin;/*Contains all advance-corrections summed up*/
-+   float advY = yOrigin; //yOrigin; 
-+   int oldPosX = 0, oldPosY = 0; /*Stored to be able to caluclate integer-advance to last glyph*/
-+
-+   if(subPixPos == JNI_TRUE) {
-+     advX += 0.1666667f;
-+     advY += 0.1666667f;
-+   }else {
-+     advX += 0.5f;
-+     advY += 0.5f;
-+  }
-+
-+   XRGlyphCacheInfo *glyphCache = (grayscale == JNI_TRUE) ?  grayCache : lcdCache;
-+   jboolean cacheResult = XRGlyphCache_CacheGlyphs(glyphCache, images, numGlyphs, &ids[0]);
-+   if(cacheResult == JNI_FALSE){
-+      J2dTraceLn(J2D_TRACE_INFO, "XRTextRenderer_md: Glyph caching failed");
-+      return;
-+   }
-+
-+   for(i=0; i < numGlyphs; i++)
-+   {
-+      GlyphInfo *jginfo = (GlyphInfo *)jlong_to_ptr(images[i]);
-+      XRCacheCellInfo *cellInfo = (XRCacheCellInfo *) jginfo->cellInfo;
-+
-+	/** If the cached and the required relative position is equal (implies integer value), we can reuse
-+	 *  the existing ELT, and let XRender do the positioning.
-+	 *  If it does not match the positioning information stored on the server, create a new ELT.
-+	 *  advX/Y and posX/Y contain all advance-corrections summed up, so that we don't forget rounding errors happend in the past.
-+         *  The actual advance is computed from the difference to the last integer-correction-position.
-+         *  TODO: Spaeter mit cache vergleichen, statt einfach mit X-Werten
-+	 */
-+	int posX = 0, posY = 0;
-+	if(usePositions || (jginfo->advanceX != ((float)cellInfo->xOff) || jginfo->advanceY != ((float)cellInfo->yOff)) || eltCnt == -1) 
-+        {
-+          /*Setup the next elt*/
-+	  eltCnt++; 
-+	  elts[eltCnt].glyphset = glyphCache->glyphSet;
-+          elts[eltCnt].chars = (unsigned int*) &ids[i];
-+	  elts[eltCnt].nchars = 1;
-+
-+  	  if(usePositions)
-+	  {
-+            /*In this case advX only stores rounding errors*/
-+            jfloat x = positions[i*2] + advX;
-+            jfloat y = positions[i*2 + 1] + advY;
-+            FLOOR_ASSIGN(posX, x);
-+            FLOOR_ASSIGN(posY, y);
-+ 	    advX -= cellInfo->xOff;
-+ 	    advY -= cellInfo->yOff;
-+          }else
-+          {
-+	    /* 
-+             * Calculate next glyph's position in the case of relative positioning.
-+             * In XRender we can only position glyphs using integer coordinates, therefor
-+             * we sum all the advances up as float, and convert them to integer later.
-+             * This way rounding-error can be corrected,
-+             * and is required to be consistent with the software loops.
-+             */
-+             FLOOR_ASSIGN(posX, advX);
-+             FLOOR_ASSIGN(posY, advY);
-+             //Advance of ELT = difference between stored relative positioning information and required float.
-+	     advX += (jginfo->advanceX - cellInfo->xOff);
-+	     advY += (jginfo->advanceY - cellInfo->yOff);
-+          }
-+
-+            /*Offset of the current glyph is the difference to the last glyph and this one*/
-+	    elts[eltCnt].xOff = (posX - oldPosX);
-+	    elts[eltCnt].yOff = (posY - oldPosY);
-+
-+	    oldPosX = posX;
-+	    oldPosY = posY;
-+	}else
-+	{
-+           elts[eltCnt].nchars++;
-+	}
-+   }
-+
-+  /*TODO: Also integrate into MaskBuffer??*/
-+  XRenderCompositeText32(awt_display, PictOpOver, xrSrcData.src, xsdo->xrPic, None, 0, 0, 0, 0, &elts[0], eltCnt+1);
-+#endif
-+}
-+
--- a/patches/xrender/icedtea-002.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5159 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/sun/xawt/Makefile openjdk/jdk/make/sun/xawt/Makefile
---- openjdk.orig/jdk/make/sun/xawt/Makefile	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/make/sun/xawt/Makefile	2009-01-18 01:47:11.000000000 +0000
-@@ -86,7 +86,7 @@
- vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/opengl
- vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/x11
- 
--OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \
-+OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl -lm \
-                    $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
- 
- ifeq  ($(PLATFORM), solaris)
---- openjdk/jdk/make/sun/xawt/mapfile-vers.orig	2009-05-22 22:09:17.215916337 +0200
-+++ openjdk/jdk/make/sun/xawt/mapfile-vers	2009-05-22 22:11:26.919916611 +0200
-@@ -334,6 +334,15 @@
-         Java_sun_java2d_opengl_GLXSurfaceData_initOps;
-         Java_sun_java2d_opengl_GLXSurfaceData_initPbuffer;
- 
-+        Java_sun_java2d_x11_XSurfaceData_initOps;
-+        Java_sun_java2d_x11_XSurfaceData_XCreateGC;
-+        Java_sun_java2d_x11_XSurfaceData_XResetClip;
-+        Java_sun_java2d_x11_XSurfaceData_XSetClip;
-+        Java_sun_java2d_x11_XSurfaceData_flushNativeSurface;
-+       Java_sun_java2d_x11_XSurfaceData_isDrawableValid;
-+        Java_sun_java2d_x11_XSurfaceData_setInvalid;
-+        Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures;
-+
-         Java_sun_java2d_x11_X11PMBlitBgLoops_nativeBlitBg;
-         Java_sun_java2d_x11_X11PMBlitLoops_nativeBlit;
-         Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask;
-@@ -351,21 +360,13 @@
- 	Java_sun_java2d_x11_X11Renderer_XFillRect;
- 	Java_sun_java2d_x11_X11Renderer_XFillRoundRect;
-         Java_sun_java2d_x11_X11Renderer_devCopyArea;
--        Java_sun_java2d_x11_X11SurfaceData_setInvalid;
-         Java_sun_java2d_x11_X11SurfaceData_initIDs;
--	Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
-         Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
- 	Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
--        Java_sun_java2d_x11_X11SurfaceData_initOps;
-         Java_sun_java2d_x11_X11SurfaceData_initSurface;
--        Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
--        Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
--        Java_sun_java2d_x11_X11SurfaceData_XResetClip;
--        Java_sun_java2d_x11_X11SurfaceData_XSetClip;
-         Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode;
-         Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
-         Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
--        Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures;
- 
-         Java_sun_java2d_xr_XRSurfaceData_flushNativeSurface;
-         Java_sun_java2d_xr_XRSurfaceData_XRIsDrawableValid;
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/font/XRTextRenderer.java openjdk/jdk/src/solaris/classes/sun/font/XRTextRenderer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/font/XRTextRenderer.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/font/XRTextRenderer.java	2009-01-18 01:47:11.000000000 +0000
-@@ -25,7 +25,7 @@
- 
- package sun.font;
- 
--import sun.awt.SunToolkit;
-+import sun.awt.*;
- import sun.java2d.SunGraphics2D;
- import sun.java2d.pipe.GlyphListPipe;
- import sun.java2d.xr.*;
-@@ -33,21 +33,22 @@
- /**
-  * A delegate pipe of SG2D for drawing any text to a XRender surface
-  */
--public class XRTextRenderer extends GlyphListPipe {
--    
--    native void doDrawGlyphList(long dstData, int numGlyphs, boolean subPixPos, boolean rgbOrder, int lcdContrast, boolean usePositions, float xOrigin, float yOrigin, long[] imgArray, float[] posArray);
--    
--    protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) 
--    {
--        try 
--        {
--            SunToolkit.awtLock();
--            XRSurfaceData x11sd = (XRSurfaceData)sg2d.surfaceData;
--    		x11sd.validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform, sg2d.paint, sg2d, 0);
--            
--            doDrawGlyphList(x11sd.getNativeOps(), gl.getNumGlyphs(), gl.isSubPixPos(), gl.isRGBOrder(), sg2d.lcdTextContrast, gl.usePositions(), gl.getX(), gl.getY(), gl.getImages(), gl.getPositions());
--        } finally {
--            SunToolkit.awtUnlock();
--        }
--    }
-+public class XRTextRenderer extends GlyphListPipe
-+{
-+	native void doDrawGlyphList(long dstData, int numGlyphs, boolean subPixPos, boolean rgbOrder, int lcdContrast, boolean usePositions, float xOrigin, float yOrigin, long[] imgArray, float[] posArray);
-+
-+	protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl)
-+	{
-+		try
-+		{
-+			SunToolkit.awtLock();
-+			XRSurfaceData x11sd = (XRSurfaceData) sg2d.surfaceData;
-+			x11sd.validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform, sg2d.paint, sg2d, 0);
-+
-+			doDrawGlyphList(x11sd.getNativeOps(), gl.getNumGlyphs(), gl.isSubPixPos(), gl.isRGBOrder(), sg2d.lcdTextContrast, gl.usePositions(), gl.getX(), gl.getY(), gl.getImages(), gl.getPositions());
-+		} finally
-+		{
-+			SunToolkit.awtUnlock();
-+		}
-+	}
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java openjdk/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	2009-01-18 01:47:11.000000000 +0000
-@@ -61,7 +61,7 @@
- import sun.java2d.pipe.TextPipe;
- import sun.java2d.pipe.Region;
- 
--public abstract class X11SurfaceData extends SurfaceData {
-+public abstract class X11SurfaceData extends XSurfaceData {
-     X11ComponentPeer peer;
-     X11GraphicsConfig graphicsConfig;
-     private RenderLoops solidloops;
-@@ -71,8 +71,6 @@
-     private static native void initIDs(Class xorComp, boolean tryDGA);  //OK
-     protected native void initSurface(int depth, int width, int height,
-                                       long drawable);
--    native boolean isDrawableValid();
--    protected native void flushNativeSurface();
- 
-     public static final String
-         DESC_INT_BGR_X11        = "Integer BGR Pixmap";
-@@ -420,12 +418,6 @@
-                                         cm, drawable, transparency);
-     }
- 
--    /**
--     * Initializes the native Ops pointer.
--     */
--    private native void initOps(X11ComponentPeer peer,
--                                X11GraphicsConfig gc, int depth);
--
-     protected X11SurfaceData(X11ComponentPeer peer,
-                              X11GraphicsConfig gc,
-                              SurfaceType sType,
-@@ -583,8 +575,6 @@
-         return sType;
-     }
- 
--    public native void setInvalid();
--
-     public void invalidate() {
-         if (isValid()) {
-             setInvalid();
-@@ -596,18 +586,10 @@
-      * The following methods and variables are used to keep the Java-level
-      * context state in sync with the native X11 GC associated with this
-      * X11SurfaceData object.
--     */
--
--    private static native long XCreateGC(long pXSData);
--    private static native void XResetClip(long xgc);
--    private static native void XSetClip(long xgc,
--                                        int lox, int loy, int hix, int hiy,
--                                        Region complexclip);
-+     */ 
-     private static native void XSetCopyMode(long xgc);
-     private static native void XSetXorMode(long xgc);
-     private static native void XSetForeground(long xgc, int pixel);
--    private static native void XSetGraphicsExposures(long xgc,
--                                                     boolean needExposures);
- 
-     private long xgc;
-     private Region validatedClip;
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/XSurfaceData.java openjdk/jdk/src/solaris/classes/sun/java2d/x11/XSurfaceData.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/XSurfaceData.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/x11/XSurfaceData.java	2009-01-18 01:47:11.000000000 +0000
-@@ -0,0 +1,35 @@
-+package sun.java2d.x11;
-+
-+import java.awt.image.*;
-+
-+import sun.awt.*;
-+import sun.java2d.*;
-+import sun.java2d.loops.*;
-+import sun.java2d.pipe.*;
-+
-+public abstract class XSurfaceData extends SurfaceData
-+{
-+	public XSurfaceData(SurfaceType surfaceType, ColorModel cm)
-+	{
-+		super(surfaceType, cm);
-+	}
-+	
-+    protected native void initOps(X11ComponentPeer peer, X11GraphicsConfig gc, int depth);
-+	
-+    protected static native long XCreateGC(long pXSData);
-+    
-+    protected static native void XResetClip(long xgc);
-+    
-+    protected static native void XSetClip(long xgc,
-+                                        int lox, int loy, int hix, int hiy,
-+                                        Region complexclip);
-+    
-+    protected native void flushNativeSurface();
-+    
-+    protected native boolean isDrawableValid();
-+    
-+    protected native void setInvalid();
-+    
-+    protected static native void XSetGraphicsExposures(long xgc,
-+            boolean needExposures);
-+}
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	2009-01-18 01:47:11.000000000 +0000
-@@ -7,44 +7,36 @@
- import sun.java2d.loops.*;
- import sun.java2d.pipe.*;
- 
--
- public class XRDrawImage extends DrawImage {
- 
-     @Override
-     protected void renderImageXform(SunGraphics2D sg, Image img,
--                                    AffineTransform tx, int interpType,
--                                    int sx1, int sy1, int sx2, int sy2,
--                                    Color bgColor)
--    {    	
--            SurfaceData dstData = sg.surfaceData;
--            SurfaceData srcData =
--                dstData.getSourceSurfaceData(img,
--                                             sg.TRANSFORM_GENERIC,
--                                             sg.imageComp,
--                                             bgColor);
--
--            if (srcData != null && !isBgOperation(srcData, bgColor) && srcData instanceof XRSurfaceData)
--            {
--                SurfaceType srcType = srcData.getSurfaceType();
--                SurfaceType dstType = dstData.getSurfaceType();
--                
--                ((XRSurfaceData) srcData).setPreferredInterpolation(XRUtils.ATransOpToXRQuality(interpType));
--                
--                TransformBlit blit = TransformBlit.getFromCache(srcType,
--                                                                sg.imageComp,
--                                                                dstType);
--
--                if (blit != null) {
--                    blit.Transform(srcData, dstData,
--                                   sg.composite, sg.getCompClip(),
--                                   tx, interpType,
--                                   sx1, sy1, 0, 0, sx2-sx1, sy2-sy1);
--                    return;
--                }
--       
--        }
-+	    AffineTransform tx, int interpType, int sx1, int sy1, int sx2,
-+	    int sy2, Color bgColor) {
-+	SurfaceData dstData = sg.surfaceData;
-+	SurfaceData srcData = dstData.getSourceSurfaceData(img,
-+		SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor);
-+
-+	if (srcData != null && !isBgOperation(srcData, bgColor)
-+		&& srcData instanceof XRSurfaceData) {
-+	    SurfaceType srcType = srcData.getSurfaceType();
-+	    SurfaceType dstType = dstData.getSurfaceType();
-+
-+	    ((XRSurfaceData) srcData).setPreferredInterpolation(XRUtils
-+		    .ATransOpToXRQuality(interpType));
-+
-+	    TransformBlit blit = TransformBlit.getFromCache(srcType,
-+		    sg.imageComp, dstType);
-+
-+	    if (blit != null) {
-+		blit.Transform(srcData, dstData, sg.composite,
-+			sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
-+				- sx1, sy2 - sy1);
-+		return;
-+	    }
-+	}
- 
--        super.renderImageXform(sg, img, tx, interpType,  sx1, sy1, sx2, sy2, bgColor);
-+	super.renderImageXform(sg, img, tx, interpType, sx1, sy1, sx2, sy2,
-+		bgColor);
-     }
- }
--
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java	2009-01-18 01:47:11.000000000 +0000
-@@ -10,33 +10,31 @@
- import sun.java2d.*;
- 
- /**
-- *
-+ * Just a seperate
-  * @author ce
-  */
--public class XRGraphicsConfig extends X11GraphicsConfig
--implements SurfaceManager.ProxiedGraphicsConfig
--{
--	private XRGraphicsConfig(X11GraphicsDevice device, int visualnum, int depth, int colormap, boolean doubleBuffer)
--    {
--		super(device, visualnum, depth, colormap, doubleBuffer);
-+public class XRGraphicsConfig extends X11GraphicsConfig implements
-+	SurfaceManager.ProxiedGraphicsConfig {
-+    private XRGraphicsConfig(X11GraphicsDevice device, int visualnum,
-+	    int depth, int colormap, boolean doubleBuffer) {
-+	super(device, visualnum, depth, colormap, doubleBuffer);
-     }
--    
-+
-     public SurfaceData createSurfaceData(X11ComponentPeer peer) {
--        return XRSurfaceData.createData(peer);
-+	return XRSurfaceData.createData(peer);
-     }
--	
-+
-     public static XRGraphicsConfig getConfig(X11GraphicsDevice device,
--            int visualnum, int depth,
--            int colormap, boolean doubleBuffer)
--    {
--        if (!X11GraphicsEnvironment.isXRenderAvailable()) {
--            return null;
--        }
--        
--        return new XRGraphicsConfig(device, visualnum, depth, colormap, doubleBuffer);
-+	    int visualnum, int depth, int colormap, boolean doubleBuffer) {
-+	if (!X11GraphicsEnvironment.isXRenderAvailable()) {
-+	    return null;
-+	}
-+
-+	return new XRGraphicsConfig(device, visualnum, depth, colormap,
-+		doubleBuffer);
-     }
--    
-+
-     public Object getProxyKey() {
--        return this;
-+	return this;
-     }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	2009-01-18 01:47:11.000000000 +0000
-@@ -2,11 +2,9 @@
- 
- import static sun.java2d.loops.CompositeType.SrcNoEa;
- import static sun.java2d.loops.CompositeType.SrcOver;
--import static sun.java2d.loops.SurfaceType.IntArgb;
- import static sun.java2d.loops.SurfaceType.IntArgbPre;
- import static sun.java2d.loops.SurfaceType.IntRgb;
- 
--import java.awt.AlphaComposite;
- import java.awt.Composite;
- 
- import sun.awt.*;
-@@ -14,58 +12,52 @@
- import sun.java2d.loops.*;
- import sun.java2d.pipe.Region;
- 
--public class XRMaskBlit extends MaskBlit
--{
--	static void register()
--	{
--		GraphicsPrimitive[] primitives = 
--		{ 
--				new XRMaskBlit(IntArgbPre, SrcOver, IntArgbPre), 
--				new XRMaskBlit(IntRgb, SrcOver, IntRgb), 
--				new XRMaskBlit(IntArgbPre, SrcNoEa, IntRgb), 
--				new XRMaskBlit(IntRgb, SrcNoEa, IntArgbPre)
-+/**
-+ * For XRender there is no "blit", everything is just a fill with Repeat of Not.
-+ * So basically this just quite the same as MaskFill.
-+ * @author Clemens Eisserer
-+ */
-+public class XRMaskBlit extends MaskBlit {
-+    static void register() {
-+	GraphicsPrimitive[] primitives = {
-+		new XRMaskBlit(IntArgbPre, SrcOver, IntArgbPre),
-+		new XRMaskBlit(IntRgb, SrcOver, IntRgb),
-+		new XRMaskBlit(IntArgbPre, SrcNoEa, IntRgb),
-+		new XRMaskBlit(IntRgb, SrcNoEa, IntArgbPre) 
- 		};
--		GraphicsPrimitiveMgr.register(primitives);
--	}
-+	GraphicsPrimitiveMgr.register(primitives);
-+    }
- 
--	public XRMaskBlit(SurfaceType srcType, CompositeType compType, SurfaceType dstType)
--	{
--		super(srcType, CompositeType.AnyAlpha, dstType);
-+    public XRMaskBlit(SurfaceType srcType, CompositeType compType,
-+	    SurfaceType dstType) {
-+	super(srcType, CompositeType.AnyAlpha, dstType);
-+    }
-+
-+    protected native void maskBlit(long srcXsdo, long dstxsdo, int srcx,
-+	    int srcy, int dstx, int dsty, int w, int h, int maskoff,
-+	    int maskscan, int masklen, byte[] mask);
-+
-+    public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp,
-+	    Region clip, int srcx, int srcy, int dstx, int dsty, int width,
-+	    int height, byte[] mask, int maskoff, int maskscan) {
-+	if (width <= 0 || height <= 0) {
-+	    return;
- 	}
- 
--	protected native void maskBlit(long srcXsdo, long dstxsdo, long alphaXsdo, int srcx, int srcy, int dstx, int dsty, int w, int h, int maskoff, int maskscan, int masklen, byte[] mask);
-+	try {
-+	    SunToolkit.awtLock();
-+
-+	    XRSurfaceData x11sd = (XRSurfaceData) src;
-+	    x11sd.validateAsSource(null, XRUtils.RepeatNone);
-+
-+	    XRSurfaceData x11dst = (XRSurfaceData) dst;
-+	    x11dst.validate(clip, comp, null, null, null, 0);
- 
--	
--	static XRSurfaceData alphaPM;
--	static int alphaWidth = 0, alphaHeight = 0;
--	public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan)
--	{
--		if (width <= 0 || height <= 0)
--		{
--			return;
--		}
--
--		try
--		{
--			SunToolkit.awtLock();
--			
--			if (alphaPM == null || alphaWidth < width || alphaHeight < height)
--			{
--				alphaPM = XRSurfaceData.createData(((XRSurfaceData) dst).graphicsConfig, width, height);
--				alphaWidth = width;
--				alphaHeight = height;
--			}
--
--			XRSurfaceData x11sd = (XRSurfaceData) src;
--			x11sd.validateAsSource(null, XRUtils.RepeatNone);
--			
--			XRSurfaceData x11dst = (XRSurfaceData) dst;
--			x11dst.validate(clip, comp, null, null, null, 0);
--			
--			maskBlit(src.getNativeOps(), dst.getNativeOps(), alphaPM.getNativeOps(), srcx, srcy, dstx, dsty, width, height, maskoff, maskscan, mask != null ? mask.length : 0, mask);
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
-+	    maskBlit(src.getNativeOps(), dst.getNativeOps(), srcx, srcy, dstx,
-+		    dsty, width, height, maskoff, maskscan,
-+		    mask != null ? mask.length : 0, mask);
-+	} finally {
-+	    SunToolkit.awtUnlock();
- 	}
-+    }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	2009-01-18 01:47:11.000000000 +0000
-@@ -12,64 +12,75 @@
- import static sun.java2d.loops.SurfaceType.OpaqueTexturePaint;
- import static sun.java2d.loops.SurfaceType.RadialGradientPaint;
- import static sun.java2d.loops.SurfaceType.TexturePaint;
--import static sun.java2d.pipe.BufferedOpCodes.MASK_FILL;
- 
- import java.awt.*;
--import java.awt.geom.*;
--import java.awt.geom.Rectangle2D.Float;
--import java.awt.image.*;
--
- import sun.awt.*;
- import sun.java2d.*;
- import sun.java2d.loops.*;
--import sun.java2d.opengl.*;
--import sun.java2d.pipe.*;
--
--public class XRMaskFill extends MaskFill
--{
--	static void register()
--	{
--		GraphicsPrimitive[] primitives = { new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntRgbX11), new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueGradientPaint, SrcNoEa, XRSurfaceData.IntRgbX11),
--				new XRMaskFill(LinearGradientPaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa, XRSurfaceData.IntRgbX11), new XRMaskFill(RadialGradientPaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa, XRSurfaceData.IntRgbX11),
--				new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntRgbX11), new XRMaskFill(OpaqueTexturePaint, SrcNoEa, XRSurfaceData.IntRgbX11),
--
--				new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntArgbX11), new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueGradientPaint, SrcNoEa, XRSurfaceData.IntArgbX11),
--				new XRMaskFill(LinearGradientPaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa, XRSurfaceData.IntArgbX11), new XRMaskFill(RadialGradientPaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa, XRSurfaceData.IntArgbX11),
--				new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntArgbX11), new XRMaskFill(OpaqueTexturePaint, SrcNoEa, XRSurfaceData.IntArgbX11) };
--
--		GraphicsPrimitiveMgr.register(primitives);
--	}
--
--	protected XRMaskFill(SurfaceType srcType, CompositeType compType, SurfaceType surfaceType)
--	{
--		super(srcType, compType, surfaceType);
--	}
--
--	protected native void maskFill(long xsdo, long alphaXsdo, int x, int y, int w, int h, int maskoff, int maskscan, int masklen, byte[] mask);
--
--	static XRSurfaceData alphaPM;
--	static int alphaWidth = 0, alphaHeight = 0;
- 
--	public void MaskFill(SunGraphics2D sg2d, SurfaceData sData, Composite comp, final int x, final int y, final int w, final int h, final byte[] mask, final int maskoff, final int maskscan)
--	{
--		try
--		{
--			SunToolkit.awtLock();
--
--			XRSurfaceData x11sd = (XRSurfaceData) sData;
--			x11sd.validate(sg2d.getCompClip(), sg2d.getComposite(), sg2d.getTransform(), sg2d.getPaint(), sg2d, 0);
--
--			if (alphaPM == null || alphaWidth < w || alphaHeight < h)
--			{
--				alphaPM = XRSurfaceData.createData(((XRSurfaceData) sData).graphicsConfig, w, h);
--				alphaWidth = w;
--				alphaHeight = h;
--			}
--
--			maskFill(sData.getNativeOps(), alphaPM.getNativeOps(), x, y, w, h, maskoff, maskscan, mask != null ? mask.length : 0, mask);
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
-+public class XRMaskFill extends MaskFill {
-+    static void register() {
-+	GraphicsPrimitive[] primitives = {
-+		new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(OpaqueGradientPaint, SrcNoEa,
-+			XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(LinearGradientPaint, SrcOver,
-+			XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa,
-+			XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(RadialGradientPaint, SrcOver,
-+			XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa,
-+			XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntRgbX11),
-+		new XRMaskFill(OpaqueTexturePaint, SrcNoEa,
-+			XRSurfaceData.IntRgbX11),
-+
-+		new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(OpaqueGradientPaint, SrcNoEa,
-+			XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(LinearGradientPaint, SrcOver,
-+			XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa,
-+			XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(RadialGradientPaint, SrcOver,
-+			XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa,
-+			XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntArgbX11),
-+		new XRMaskFill(OpaqueTexturePaint, SrcNoEa,
-+			XRSurfaceData.IntArgbX11) 
-+		};
-+
-+	GraphicsPrimitiveMgr.register(primitives);
-+    }
-+
-+    protected XRMaskFill(SurfaceType srcType, CompositeType compType,
-+	    SurfaceType surfaceType) {
-+	super(srcType, compType, surfaceType);
-+    }
-+
-+    protected native void maskFill(long xsdo, int x, int y, int w, int h,
-+	    int maskoff, int maskscan, int masklen, byte[] mask);
-+
-+    public void MaskFill(SunGraphics2D sg2d, SurfaceData sData, Composite comp,
-+	    final int x, final int y, final int w, final int h,
-+	    final byte[] mask, final int maskoff, final int maskscan) {
-+	try {
-+	    SunToolkit.awtLock();
-+
-+	    XRSurfaceData x11sd = (XRSurfaceData) sData;
-+	    x11sd.validate(sg2d.getCompClip(), sg2d.getComposite(), sg2d
-+		    .getTransform(), sg2d.getPaint(), sg2d, 0);
-+
-+	    maskFill(sData.getNativeOps(), x, y, w, h, maskoff, maskscan,
-+		    mask != null ? mask.length : 0, mask);
-+	} finally {
-+	    SunToolkit.awtUnlock();
- 	}
-+    }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	2009-01-18 01:47:11.000000000 +0000
-@@ -27,180 +27,177 @@
- 
- import sun.awt.SunToolkit;
- import sun.java2d.loops.*;
--import sun.java2d.opengl.*;
- import sun.java2d.pipe.Region;
- import sun.java2d.SurfaceData;
- import java.awt.*;
- import java.awt.geom.*;
--import java.awt.image.*;
- 
- /**
-- * X11PMBlitLoops
-- *
-- * This class accelerates Blits between two surfaces of types *PM.  Since
-- * the onscreen surface is of that type and some of the offscreen surfaces
-- * may be of that type (if they were created via X11OffScreenImage), then
-- * this type of Blit will accelerated double-buffer copies between those
-- * two surfaces.
--*/
--public class XRPMBlitLoops
--{
--
--	public static void register()
--	{
--		GraphicsPrimitive[] primitives = {
--		
--				new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11), new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11), new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11), new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
--
--				new X11PMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11), new X11PMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11), new X11PMScaledBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11), new X11PMScaledBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
--
--				new X11PMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11), new X11PMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11), new X11PMTransformedBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11), new X11PMTransformedBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
--
--				/*TODO Allow blits from argb surfaces too*/
--		};
--		GraphicsPrimitiveMgr.register(primitives);
--	}
--
--	/**
--	 * Blit
--	 * This native method is where all of the work happens in the
--	 * accelerated Blit.
--	 */
--	public static native void nativeRenderBlit(long srcData, long dstData, int sx, int sy, int dx, int dy, int w, int h);
--
--	static AffineTransform identityTransform = AffineTransform.getTranslateInstance(0, 0);
--	static double[] tmpCoord = new double[4];
--}
--
--class X11PMBlit extends Blit
--{
--	public X11PMBlit(SurfaceType srcType, SurfaceType dstType)
--	{
--		super(srcType, CompositeType.AnyAlpha, dstType);
--	}
-+ * XRPMBlitLoops
-+ * 
-+ * This class accelerates Blits between two surfaces of types *PM.s
-+ */
-+public class XRPMBlitLoops {
- 
--	public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h)
--	{
--		try
--		{
--			SunToolkit.awtLock();
-+    public static void register() {
-+	GraphicsPrimitive[] primitives = {
- 
--			XRSurfaceData x11sdDst = (XRSurfaceData) dst;
--			x11sdDst.validate(clip, comp, null, null, null, 0);
--			XRSurfaceData x11sdSrc = (XRSurfaceData) src;
--	
--			x11sdSrc.validateAsSource(null, XRUtils.RepeatNone, XRUtils.FAST);
-+		new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11),
-+		new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11),
-+		new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11),
-+		new X11PMBlit(XRSurfaceData.IntArgbX11,
-+			XRSurfaceData.IntArgbX11),
-+
-+		new X11PMScaledBlit(XRSurfaceData.IntRgbX11,
-+			XRSurfaceData.IntRgbX11),
-+		new X11PMScaledBlit(XRSurfaceData.IntRgbX11,
-+			XRSurfaceData.IntArgbX11),
-+		new X11PMScaledBlit(XRSurfaceData.IntArgbX11,
-+			XRSurfaceData.IntRgbX11),
-+		new X11PMScaledBlit(XRSurfaceData.IntArgbX11,
-+			XRSurfaceData.IntArgbX11),
-+
-+		new X11PMTransformedBlit(XRSurfaceData.IntRgbX11,
-+			XRSurfaceData.IntRgbX11),
-+		new X11PMTransformedBlit(XRSurfaceData.IntRgbX11,
-+			XRSurfaceData.IntArgbX11),
-+		new X11PMTransformedBlit(XRSurfaceData.IntArgbX11,
-+			XRSurfaceData.IntRgbX11),
-+		new X11PMTransformedBlit(XRSurfaceData.IntArgbX11,
-+			XRSurfaceData.IntArgbX11),
-+	};
-+	GraphicsPrimitiveMgr.register(primitives);
-+    }
- 
--			XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), sx, sy, dx, dy, w, h);
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
--	}
-+    public static native void nativeRenderBlit(long srcData, long dstData,
-+	    int sx, int sy, int dx, int dy, int w, int h);
- }
- 
--class X11PMScaledBlit extends ScaledBlit
--{
--	public X11PMScaledBlit(SurfaceType srcType, SurfaceType dstType)
--	{
--		super(srcType, CompositeType.AnyAlpha, dstType);
-+class X11PMBlit extends Blit {
-+    public X11PMBlit(SurfaceType srcType, SurfaceType dstType) {
-+	super(srcType, CompositeType.AnyAlpha, dstType);
-+    }
-+
-+    public void Blit(SurfaceData src, SurfaceData dst, Composite comp,
-+	    Region clip, int sx, int sy, int dx, int dy, int w, int h) {
-+	try {
-+	    SunToolkit.awtLock();
-+
-+	    XRSurfaceData x11sdDst = (XRSurfaceData) dst;
-+	    x11sdDst.validate(clip, comp, null, null, null, 0);
-+	    XRSurfaceData x11sdSrc = (XRSurfaceData) src;
-+
-+	    x11sdSrc.validateAsSource(null, XRUtils.RepeatNone, XRUtils.FAST);
-+
-+	    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst
-+		    .getNativeOps(), sx, sy, dx, dy, w, h);
-+	} finally {
-+	    SunToolkit.awtUnlock();
- 	}
-+    }
-+}
- 
--	public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2)
--	{
--		try
--		{
--			SunToolkit.awtLock();
--
--			XRSurfaceData x11sdDst = (XRSurfaceData) dst;
--			x11sdDst.validate(clip, comp, null, null, null, 0);
--			XRSurfaceData x11sdSrc = (XRSurfaceData) src;
--
--			double xScale = (dx2 - dx1) / (sx2 - sx1);
--			double yScale = (dy2 - dy1) / (sy2 - sy1);
--
--			sx1 *= xScale;
--			sx2 *= xScale;
--			sy1 *= yScale;
--			sy2 *= yScale;
--
--			AffineTransform xForm = AffineTransform.getScaleInstance(1 / xScale, 1 / yScale);
--
--			x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST);
--
--			XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), (int) sx1, (int) sy1, (int) dx1, (int) dy1, (int) (dx2 - dx1), (int) (dy2 - dy1));
-+class X11PMScaledBlit extends ScaledBlit {
-+    public X11PMScaledBlit(SurfaceType srcType, SurfaceType dstType) {
-+	super(srcType, CompositeType.AnyAlpha, dstType);
-+    }
-+
-+    public void Scale(SurfaceData src, SurfaceData dst, Composite comp,
-+	    Region clip, int sx1, int sy1, int sx2, int sy2, double dx1,
-+	    double dy1, double dx2, double dy2) {
-+	try {
-+	    SunToolkit.awtLock();
-+
-+	    XRSurfaceData x11sdDst = (XRSurfaceData) dst;
-+	    x11sdDst.validate(clip, comp, null, null, null, 0);
-+	    XRSurfaceData x11sdSrc = (XRSurfaceData) src;
-+
-+	    double xScale = (dx2 - dx1) / (sx2 - sx1);
-+	    double yScale = (dy2 - dy1) / (sy2 - sy1);
-+
-+	    sx1 *= xScale;
-+	    sx2 *= xScale;
-+	    sy1 *= yScale;
-+	    sy2 *= yScale;
-+
-+	    AffineTransform xForm = AffineTransform.getScaleInstance(
-+		    1 / xScale, 1 / yScale);
-+
-+	    x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST);
-+
-+	    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst
-+		    .getNativeOps(), (int) sx1, (int) sy1, (int) dx1,
-+		    (int) dy1, (int) (dx2 - dx1), (int) (dy2 - dy1));
- 
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
-+	} finally {
-+	    SunToolkit.awtUnlock();
- 	}
-+    }
- }
- 
- /**
-  * Called also if scale+transform is set
-+ * 
-  * @author Clemens Eisserer
-  */
--class X11PMTransformedBlit extends TransformBlit
--{
--	public X11PMTransformedBlit(SurfaceType srcType, SurfaceType dstType)
--	{
--		super(srcType, CompositeType.AnyAlpha, dstType);
--	}
-+class X11PMTransformedBlit extends TransformBlit {
-+    public X11PMTransformedBlit(SurfaceType srcType, SurfaceType dstType) {
-+	super(srcType, CompositeType.AnyAlpha, dstType);
-+    }
-+
-+    public void Transform(SurfaceData src, SurfaceData dst, Composite comp,
-+	    Region clip, AffineTransform xform, int hint, int srcx, int srcy,
-+	    int dstx, int dsty, int width, int height) {
-+	try {
-+	    SunToolkit.awtLock();
-+
-+	    XRSurfaceData x11sdDst = (XRSurfaceData) dst;
-+	    x11sdDst.validate(clip, comp, null, null, null, 0);
-+	    XRSurfaceData x11sdSrc = (XRSurfaceData) src;
-+
-+	    boolean needClip = (xform.getScaleX() != 0.0f)
-+		    || (xform.getShearY() != 0.0f);
-+	    try {
-+		/* Calculate area which will be covered by the transform-blit */
-+		Rectangle2D.Float rect = new Rectangle2D.Float(dstx, dsty,
-+			width, height);
-+		Shape shp = xform.createTransformedShape(rect);
-+		Rectangle bounds = shp.getBounds();
- 
--	public void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform xform, int hint, int srcx, int srcy, int dstx, int dsty, int width, int height)
--	{
--		try
--		{			
--			SunToolkit.awtLock();
-+		AffineTransform sourceTrans = (AffineTransform) xform.clone();
-+		sourceTrans.translate(-srcx, -srcy);
- 
--			XRSurfaceData x11sdDst = (XRSurfaceData) dst;
--			x11sdDst.validate(clip, comp, null, null, null, 0);
--			XRSurfaceData x11sdSrc = (XRSurfaceData) src;
--
--			boolean needClip =  (xform.getScaleX() != 0.0f) || (xform.getShearY() != 0.0f);
--			try
--			{				
--				/*Calculate area which will be covered by the transform-blit*/
--				Rectangle2D.Float rect = new Rectangle2D.Float(dstx, dsty, width, height);
--				Shape shp = xform.createTransformedShape(rect);
--				Rectangle bounds = shp.getBounds();
--				
--				AffineTransform sourceTrans = (AffineTransform) xform.clone();
--				sourceTrans.translate(-srcx, -srcy);
--			
--//				System.out.println("srcx "+srcx+" srcy:"+srcy+" dstx:"+dstx+" dsty:"+dsty+" width:"+width+" height:"+height);
--//				System.out.println("Dest-Translation: x:"+xform.getTranslateX()+" y:"+xform.getTranslateY());
--				
--				//AffineTransform sourceTransform = new AffineTransform(xform.getScaleX(), xform.getShearY(), xform.getShearX(), xform.getScaleY(), 0, 0);
--				//sourceTransform.translate(-srcx, -srcy);
--				
--				sourceTrans.invert();
--			    
--				
--			    //x11sdSrc.validateAsSource(sourceTrans, XRUtils.RepeatPad); /*Pad avoids smearing, but falls back to software*/
--				x11sdSrc.validateAsSource(sourceTrans, XRUtils.RepeatNone);
--
--				
--				if(needClip)
--				{
--			        x11sdDst.setShapeClip(shp);
--				}
--				
--			    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), 0, 0, 0, 0, bounds.x + bounds.width, bounds.y + bounds.height);// bounds.x, bounds.y, bounds.width, bounds.height);//(int) (maxX - minX), (int) (maxY - minY));
--		
--			    if(needClip)
--			    {
--			        x11sdDst.resetShapeClip();
--			    }
--			   
--			} catch (Exception ex)
--			{
--				ex.printStackTrace();
--			}
--		} finally
-+		try
- 		{
--			SunToolkit.awtUnlock();
-+		     sourceTrans.invert();
-+		}catch(NoninvertibleTransformException ex)
-+		{
-+		    sourceTrans.setToIdentity();
-+		}
-+
-+		x11sdSrc.validateAsSource(sourceTrans, XRUtils.RepeatNone);
-+
-+		if (needClip) {
-+		    x11sdDst.setShapeClip(shp);
- 		}
-+
-+		XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst
-+			.getNativeOps(), 0, 0, 0, 0, bounds.x + bounds.width,
-+			bounds.y + bounds.height);// bounds.x, bounds.y,
-+						    // bounds.width,
-+						    // bounds.height);//(int)
-+						    // (maxX - minX), (int)
-+						    // (maxY - minY));
-+
-+		if (needClip) {
-+		    x11sdDst.resetShapeClip();
-+		}
-+
-+	    } catch (Exception ex) {
-+		ex.printStackTrace();
-+	    }
-+	} finally {
-+	    SunToolkit.awtUnlock();
- 	}
-+    }
- }
-\ No newline at end of file
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java	2009-01-18 01:47:11.000000000 +0000
-@@ -13,243 +13,222 @@
- import sun.java2d.pipe.ShapeSpanIterator;
- import sun.java2d.pipe.LoopPipe;
- 
--public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe
--{
--	public XRRenderer()
--	{}
--
--	public static XRRenderer getInstance()
--	{
--		return new XRRenderer();
--		//	return (GraphicsPrimitive.tracingEnabled() ? new X11TracingRenderer() : new X11Renderer());
--	}
--
--	private final void validate(SunGraphics2D sg2d)
--	{
--		// NOTE: getCompClip() will revalidateAll() if the
--		// surfaceData is invalid.  This should ensure that
--		// the clip and pixel that we are validating against
--		// are the most current.
--		//
--		// The assumption is that the pipeline after that
--		// revalidation will either be another X11 pipe
--		// (because the drawable format never changes on X11)
--		// or a null pipeline if the surface is disposed.
--		//
--		// Since we do not get the ops structure of the SurfaceData
--		// until the actual call down to the native level we will
--		// pick up the most recently validated copy.
--		// Note that if the surface is disposed, a NullSurfaceData
--		// (with null native data structure) will be set in
--		// sg2d, so we have to protect against it in native code.
--
--		XRSurfaceData x11sd = (XRSurfaceData) sg2d.surfaceData;
--		x11sd.validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform, sg2d.paint, sg2d, 0);
--	}
--
--	native void XRDrawLine(long pXSData, int x1, int y1, int x2, int y2);
--
--	public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2)
--	{
--		try
--		{
--			SunToolkit.awtLock();
--			
--			validate(sg2d);
--			int transx = sg2d.transX;
--			int transy = sg2d.transY;
--			XRDrawLine(sg2d.surfaceData.getNativeOps(), x1 + transx, y1 + transy, x2 + transx, y2 + transy);
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
--	}
--
--	public void drawRect(SunGraphics2D sg2d, int x, int y, int width, int height)
--	{
--		draw(sg2d, new Rectangle2D.Float(x, y, width, height));
--	}
--
--	public void drawPolyline(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints)
--	{
--		throw new RuntimeException("Not implemented");
--	}
--
--	public void drawPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints)
--	{
--		draw(sg2d, new Polygon(xpoints, ypoints, npoints));
--	}
--
--	native void XRFillRect(long pXSData, int x, int y, int width, int height);
--
--	public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height)
--	{
-+/**
-+ * XRender provides only accalerated rectangles and lines with some tricks.
-+ * To emulate higher geometry we have to pass everything else to DoPath/FillSpans.
-+ * 
-+ * TODO: DrawRect could be instrified
-+ * @author Clemens Eisserer
-+ */
-+
-+public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe {
-+    public XRRenderer() {
-+    }
-+
-+    public static XRRenderer getInstance() {
-+	return new XRRenderer();
-+    }
-+
-+    /**
-+     * Common validate method, used by all XRRender functions to
-+     * validate the destination context.
-+     */
-+    private final void validate(SunGraphics2D sg2d) {
-+	XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
-+	xrsd.validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform,
-+		sg2d.paint, sg2d, 0);
-+    }
-+
-+    native void XRDrawLine(long pXSData, int x1, int y1, int x2, int y2);
-+
-+    public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) {
-+	try {
-+	    SunToolkit.awtLock();
-+
-+	    validate(sg2d);
-+	    int transx = sg2d.transX;
-+	    int transy = sg2d.transY;
-+	    XRDrawLine(sg2d.surfaceData.getNativeOps(), x1 + transx, y1
-+		    + transy, x2 + transx, y2 + transy);
-+	} finally {
-+	    SunToolkit.awtUnlock();
-+	}
-+    }
-+
-+    public void drawRect(SunGraphics2D sg2d, int x, int y, int width, int height) {
-+	draw(sg2d, new Rectangle2D.Float(x, y, width, height));
-+    }
-+
-+    public void drawPolyline(SunGraphics2D sg2d, int xpoints[], int ypoints[],
-+	    int npoints) {
-+	Path2D.Float p2d = new Path2D.Float();
-+	if (npoints > 1) {
-+	    p2d.moveTo(xpoints[0], ypoints[0]);
-+	    for (int i = 1; i < npoints; i++) {
-+		p2d.lineTo(xpoints[i], ypoints[i]);
-+	    }
-+	}
-+
-+	draw(sg2d, p2d);
-+    }
-+
-+    public void drawPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[],
-+	    int npoints) {
-+	draw(sg2d, new Polygon(xpoints, ypoints, npoints));
-+    }
-+
-+    native void XRFillRect(long pXSData, int x, int y, int width, int height);
-+
-+    public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) {
-+	SunToolkit.awtLock();
-+	try {
-+	    validate(sg2d);
-+
-+	    x += sg2d.transform.getTranslateX();
-+	    y += sg2d.transform.getTranslateY();
-+	    XRFillRect(sg2d.surfaceData.getNativeOps(), x, y, width, height);
-+	} finally {
-+	    SunToolkit.awtUnlock();
-+	}
-+    }
-+
-+    public void fillPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[],
-+	    int npoints) {
-+	fill(sg2d, new Polygon(xpoints, ypoints, npoints));
-+    }
-+
-+    public void drawRoundRect(SunGraphics2D sg2d, int x, int y, int width,
-+	    int height, int arcWidth, int arcHeight) {
-+	draw(sg2d, new RoundRectangle2D.Float(x, y, width, height, arcWidth,
-+		arcHeight));
-+    }
-+
-+    public void fillRoundRect(SunGraphics2D sg2d, int x, int y, int width,
-+	    int height, int arcWidth, int arcHeight) {
-+	fill(sg2d, new RoundRectangle2D.Float(x, y, width, height, arcWidth,
-+		arcHeight));
-+    }
-+
-+    public void drawOval(SunGraphics2D sg2d, int x, int y, int width, int height) {
-+	draw(sg2d, new Ellipse2D.Float(x, y, width, height));
-+    }
-+
-+    public void fillOval(SunGraphics2D sg2d, int x, int y, int width, int height) {
-+	fill(sg2d, new Ellipse2D.Float(x, y, width, height));
-+    }
-+
-+    public void drawArc(SunGraphics2D sg2d, int x, int y, int width,
-+	    int height, int startAngle, int arcAngle) {
-+	draw(sg2d, new Arc2D.Float(x, y, width, height, startAngle, arcAngle,
-+		Arc2D.OPEN));
-+    }
-+
-+    public void fillArc(SunGraphics2D sg2d, int x, int y, int width,
-+	    int height, int startAngle, int arcAngle) {
-+	fill(sg2d, new Arc2D.Float(x, y, width, height, startAngle, arcAngle,
-+		Arc2D.PIE));
-+    }
-+
-+    native void XRFillSpans(long pXSData, SpanIterator si, long iterator,
-+	    int transx, int transy);
-+
-+    native void XRDoPath(SunGraphics2D sg2d, long pXSData, int transX,
-+	    int transY, Path2D.Float p2df, boolean isFill);
-+
-+    private void doPath(SunGraphics2D sg2d, Shape s, boolean isFill) {
-+	Path2D.Float p2df;
-+	int transx, transy;
-+	if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
-+	    if (s instanceof Path2D.Float) {
-+		p2df = (Path2D.Float) s;
-+	    } else {
-+		p2df = new Path2D.Float(s);
-+	    }
-+	    transx = sg2d.transX;
-+	    transy = sg2d.transY;
-+	} else {
-+	    p2df = new Path2D.Float(s, sg2d.transform);
-+	    transx = 0;
-+	    transy = 0;
-+	}
-+
-+	try {
-+	    SunToolkit.awtLock();
-+	    validate(sg2d);
-+	    XRDoPath(sg2d, sg2d.surfaceData.getNativeOps(), transx, transy,
-+		    p2df, isFill);
-+	} finally {
-+	    SunToolkit.awtUnlock();
-+	}
-+    }
-+
-+    public void draw(SunGraphics2D sg2d, Shape s) {
-+
-+	if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
-+	    doPath(sg2d, s, false);
-+	    return;
-+	}
-+
-+	if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM) {
-+	    ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
-+	    try {
-+		try {
-+		    SunToolkit.awtLock();
-+		    validate(sg2d);
-+		    XRFillSpans(sg2d.surfaceData.getNativeOps(), si, si
-+			    .getNativeIterator(), 0, 0);
-+		} finally {
-+		    SunToolkit.awtUnlock();
-+		}
-+	    } finally {
-+		si.dispose();
-+	    }
-+	} else {
-+	    fill(sg2d, sg2d.stroke.createStrokedShape(s));
-+	}
-+    }
-+
-+    public void fill(SunGraphics2D sg2d, Shape s) {
-+	if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
-+	    doPath(sg2d, s, true);
-+	    return;
-+	}
-+
-+	AffineTransform at;
-+	int transx, transy;
-+	if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
-+	    // Transform (translation) will be done by XFillSpans
-+	    at = null;
-+	    transx = sg2d.transX;
-+	    transy = sg2d.transY;
-+	} else {
-+	    // Transform will be done by the PathIterator
-+	    at = sg2d.transform;
-+	    transx = transy = 0;
-+	}
-+
-+	ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
-+	try {
-+	    // Subtract transx/y from the SSI clip to match the
-+	    // (potentially untranslated) geometry fed to it
-+	    Region clip = sg2d.getCompClip();
-+	    ssi.setOutputAreaXYXY(clip.getLoX() - transx, clip.getLoY()
-+		    - transy, clip.getHiX() - transx, clip.getHiY() - transy);
-+	    ssi.appendPath(s.getPathIterator(at));
-+	    try {
- 		SunToolkit.awtLock();
--		try
--		{
--			validate(sg2d);
--
--			x += sg2d.transform.getTranslateX();
--			y += sg2d.transform.getTranslateY();
--			XRFillRect(sg2d.surfaceData.getNativeOps(), x, y, width, height);
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
--	}
--
--	public void fillPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints)
--	{
--		fill(sg2d, new Polygon(xpoints, ypoints, npoints));
--	}
--
--	public void drawRoundRect(SunGraphics2D sg2d, int x, int y, int width, int height, int arcWidth, int arcHeight)
--	{
--		draw(sg2d, new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight));
--	}
--
--	public void fillRoundRect(SunGraphics2D sg2d, int x, int y, int width, int height, int arcWidth, int arcHeight)
--	{
--		fill(sg2d, new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight));
--	}
--
--	public void drawOval(SunGraphics2D sg2d, int x, int y, int width, int height)
--	{
--		draw(sg2d, new Ellipse2D.Float(x, y, width, height));
--	}
--
--	public void fillOval(SunGraphics2D sg2d, int x, int y, int width, int height)
--	{
--		fill(sg2d, new Ellipse2D.Float(x, y, width, height));
--	}
- 
--	public void drawArc(SunGraphics2D sg2d, int x, int y, int width, int height, int startAngle, int arcAngle)
--	{
--		draw(sg2d, new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN));
-+		validate(sg2d);
-+		XRFillSpans(sg2d.surfaceData.getNativeOps(), ssi, ssi
-+			.getNativeIterator(), transx, transy);
-+	    } finally {
-+		SunToolkit.awtUnlock();
-+	    }
-+	} finally {
-+	    ssi.dispose();
- 	}
-+    }
- 
--	public void fillArc(SunGraphics2D sg2d, int x, int y, int width, int height, int startAngle, int arcAngle)
--	{
--		fill(sg2d, new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE));
--	}
--
--	native void XRFillSpans(long pXSData, SpanIterator si, long iterator, int transx, int transy);
--
--	native void XRDoPath(SunGraphics2D sg2d, long pXSData, int transX, int transY, Path2D.Float p2df, boolean isFill);
--
--	private void doPath(SunGraphics2D sg2d, Shape s, boolean isFill)
--	{
--		Path2D.Float p2df;
--		int transx, transy;
--		if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE)
--		{
--			if (s instanceof Path2D.Float)
--			{
--				p2df = (Path2D.Float) s;
--			} else
--			{
--				p2df = new Path2D.Float(s);
--			}
--			transx = sg2d.transX;
--			transy = sg2d.transY;
--		} else
--		{
--			p2df = new Path2D.Float(s, sg2d.transform);
--			transx = 0;
--			transy = 0;
--		}
--		
--		try
--		{
--			SunToolkit.awtLock();
--			validate(sg2d);
--			XRDoPath(sg2d, sg2d.surfaceData.getNativeOps(), transx, transy, p2df, isFill);
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
--	}
--
--	public void draw(SunGraphics2D sg2d, Shape s)
--	{
--
--		if (sg2d.strokeState == sg2d.STROKE_THIN)
--		{
--			doPath(sg2d, s, false);
--			return;
--		}
--		
--		if (sg2d.strokeState < sg2d.STROKE_CUSTOM)
--		{
--			ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
--			try
--			{
--				try
--				{
--					SunToolkit.awtLock();
--					validate(sg2d);
--					XRFillSpans(sg2d.surfaceData.getNativeOps(), si, si.getNativeIterator(), 0, 0);
--				} finally
--				{
--					SunToolkit.awtUnlock();
--				}
--			} finally
--			{
--				si.dispose();
--			}
--		} else
--		{
--			fill(sg2d, sg2d.stroke.createStrokedShape(s));
--		}
--	}
--
--	public void fill(SunGraphics2D sg2d, Shape s)
--	{
--		if (sg2d.strokeState == sg2d.STROKE_THIN)
--		{
--			doPath(sg2d, s, true);
--			return;
--		}
--
--		AffineTransform at;
--		int transx, transy;
--		if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE)
--		{
--			// Transform (translation) will be done by XFillSpans
--			at = null;
--			transx = sg2d.transX;
--			transy = sg2d.transY;
--		} else
--		{
--			// Transform will be done by the PathIterator
--			at = sg2d.transform;
--			transx = transy = 0;
--		}
--
--		ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
--		try
--		{
--			// Subtract transx/y from the SSI clip to match the
--			// (potentially untranslated) geometry fed to it
--			Region clip = sg2d.getCompClip();
--			ssi.setOutputAreaXYXY(clip.getLoX() - transx, clip.getLoY() - transy, clip.getHiX() - transx, clip.getHiY() - transy);
--			ssi.appendPath(s.getPathIterator(at));
--			try
--			{
--				SunToolkit.awtLock();
--				
--				validate(sg2d);
--				XRFillSpans(sg2d.surfaceData.getNativeOps(), ssi, ssi.getNativeIterator(), transx, transy);
--			} finally
--			{
--				SunToolkit.awtUnlock();
--			}
--		} finally
--		{
--			ssi.dispose();
--		}
--	}
--
--	native void devCopyArea(long sdOps, long xgc, int srcx, int srcy, int dstx, int dsty, int w, int h);
--
-+    native void devCopyArea(long sdOps, long xgc, int srcx, int srcy, int dstx,
-+	    int dsty, int w, int h);
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	2009-01-18 01:47:11.000000000 +0000
-@@ -31,7 +31,6 @@
- import java.awt.geom.*;
- import java.awt.image.*;
- import sun.awt.*;
--import sun.awt.image.PixelConverter;
- import sun.font.*;
- import sun.java2d.InvalidPipeException;
- import sun.java2d.SunGraphics2D;
-@@ -39,979 +38,931 @@
- import sun.java2d.SurfaceDataProxy;
- import sun.java2d.loops.*;
- import sun.java2d.pipe.*;
-+import sun.java2d.x11.*;
- import static sun.java2d.xr.XRUtils.XDoubleToFixed;
- 
--public abstract class XRSurfaceData extends SurfaceData
--{
--	X11ComponentPeer peer;
--	XRGraphicsConfig graphicsConfig;
--	private RenderLoops solidloops;
-+public abstract class XRSurfaceData extends XSurfaceData {
-+    X11ComponentPeer peer;
-+    XRGraphicsConfig graphicsConfig;
-+    private RenderLoops solidloops;
- 
--	protected int depth;
-+    protected int depth;
- 
--	private static native void initIDs(boolean gradCache);
-+    private static native void initIDs(boolean gradCache);
- 
--	protected native void XRInitSurface(int depth, int width, int height, long drawable, int pictFormat);
-+    protected native void XRInitSurface(int depth, int width, int height,
-+	    long drawable, int pictFormat);
- 
--	native boolean XRIsDrawableValid();
-+    native void XRInitXRender(long xsdo, int pictForm);
- 
--	protected native void flushNativeSurface();
-+    public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap";
-+    public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap";
-+    public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap";
- 
--	native void XRInitXRender(long xsdo, int pictForm);
-+    public static final SurfaceType ByteA8X11 = SurfaceType.ByteGray.deriveSubType(DESC_BYTE_A8_X11);
-+    public static final SurfaceType IntRgbX11 = SurfaceType.IntRgb.deriveSubType(DESC_INT_RGB_X11);
-+    public static final SurfaceType IntArgbX11 = SurfaceType.IntArgbPre.deriveSubType(DESC_INT_ARGB_X11);
- 
--	public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap";
--	public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap";
--	public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap";
-+    public Raster getRaster(int x, int y, int w, int h) {
-+	throw new InternalError("not implemented yet");
-+    }
- 
--	public static final SurfaceType ByteA8X11 = SurfaceType.ByteGray.deriveSubType(DESC_BYTE_A8_X11);
--	public static final SurfaceType IntRgbX11 = SurfaceType.IntRgb.deriveSubType(DESC_INT_RGB_X11);
--	public static final SurfaceType IntArgbX11 = SurfaceType.IntArgbPre.deriveSubType(DESC_INT_ARGB_X11);
-+    protected XRRenderer xrpipe;
-+    protected PixelToShapeConverter xrtxpipe;
-+    protected TextPipe xrtextpipe;
-+    protected XRDrawImage xrDrawImage;
-+
-+    public static void initXRSurfaceData() {
-+	if (!X11GraphicsEnvironment.isX11SurfaceDataInitialized()) {
-+	    boolean cacheGradients = true;
-+	    String xProp = System.getProperty("sun.java2d.xrgradcache");
-+	    if (xProp != null) {
-+		cacheGradients = !(xProp.equalsIgnoreCase("false") || xProp.equalsIgnoreCase("f"));
-+	    }
-+	    initIDs(cacheGradients);
-+
-+	    XRPMBlitLoops.register();
-+	    XRMaskFill.register();
-+	    XRMaskBlit.register();
- 
--	public Raster getRaster(int x, int y, int w, int h)
--	{
--		throw new InternalError("not implemented yet");
-+	    X11GraphicsEnvironment.setX11SurfaceDataInitialized();
- 	}
-+    }
- 
--	protected XRRenderer x11pipe;
--	protected PixelToShapeConverter x11txpipe;
--	protected TextPipe x11textpipe;
--	protected XRDrawImage xrDrawImage;
--
--	public static void initXRSurfaceData()
--	{
--		if (!X11GraphicsEnvironment.isX11SurfaceDataInitialized())
--		{
--			boolean cacheGradients = true;
--			String xProp = System.getProperty("sun.java2d.xrgradcache");
--			if (xProp != null)
--			{
--				cacheGradients = !(xProp.equalsIgnoreCase("false") || xProp.equalsIgnoreCase("f"));
--			}
--
--			initIDs(cacheGradients);
--
--			XRPMBlitLoops.register();
--			XRMaskFill.register();
--			XRMaskBlit.register();
--
--			X11GraphicsEnvironment.setX11SurfaceDataInitialized();
--		}
-+    /**
-+     * Synchronized accessor method for isDrawableValid.
-+     */
-+    protected boolean isXRDrawableValid() {
-+	try {
-+	    SunToolkit.awtLock();
-+	    return isDrawableValid();
-+	} finally {
-+	    SunToolkit.awtUnlock();
- 	}
-+    }
- 
--	protected boolean isDrawableValid()
--	{
--		try
--		{
--			SunToolkit.awtLock();
--			return XRIsDrawableValid();
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
-+    @Override
-+    public SurfaceDataProxy makeProxyFor(SurfaceData srcData) {
-+	return XRSurfaceDataProxy.createProxy(srcData, graphicsConfig);
-+    }
-+
-+    public void validatePipe(SunGraphics2D sg2d) {
-+	TextPipe textpipe;
-+	boolean validated = false;
-+
-+	/* The textpipe for now can't handle TexturePaint when extra-alpha is specified nore XOR mode*/
-+	if (sg2d.compositeState < SunGraphics2D.COMP_XOR
-+		&& (sg2d.paintState < SunGraphics2D.PAINT_TEXTURE
-+		|| sg2d.composite == null
-+		|| !(sg2d.composite instanceof AlphaComposite)
-+		|| ((AlphaComposite) sg2d.composite).getAlpha() == 1.0f)) {
-+	    textpipe = xrtextpipe;
-+	} else {
-+	    super.validatePipe(sg2d);
-+	    textpipe = sg2d.textpipe;
-+	    validated = true;
-+	}
-+
-+	PixelToShapeConverter txPipe = null;
-+	XRRenderer nonTxPipe = null;
-+
-+	if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) {
-+	    if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
-+		if (sg2d.compositeState < SunGraphics2D.COMP_XOR) {
-+		    txPipe = xrtxpipe;
-+		    nonTxPipe = xrpipe;
-+		}
-+	    } else if (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
-+		if (isPaintValid(sg2d)) {
-+		    txPipe = xrtxpipe;
-+		    nonTxPipe = xrpipe;
-+		}
-+		// custom paints handled by super.validatePipe() below
-+	    }
-+	}
-+
-+	if (txPipe != null) {
-+	    if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
-+		sg2d.drawpipe = txPipe;
-+		sg2d.fillpipe = txPipe;
-+	    } else if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
-+		sg2d.drawpipe = txPipe;
-+		sg2d.fillpipe = nonTxPipe;
-+	    } else {
-+		sg2d.drawpipe = nonTxPipe;
-+		sg2d.fillpipe = nonTxPipe;
-+	    }
-+	    sg2d.shapepipe = nonTxPipe;
-+	} else {
-+	    if (!validated) {
-+		super.validatePipe(sg2d);
-+	    }
- 	}
- 
--	@Override
--	public SurfaceDataProxy makeProxyFor(SurfaceData srcData)
--	{
--		return XRSurfaceDataProxy.createProxy(srcData, graphicsConfig);
--	}
--
--	public void validatePipe(SunGraphics2D sg2d)
--	{
--	        TextPipe textpipe;
--	        boolean validated = false;
--
--	        if (/* CompositeType.SrcNoEa (any color) */
--	            (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
--	             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)        ||
--
--	            /* CompositeType.SrcOver (any color) */
--	            (sg2d.compositeState == SunGraphics2D.COMP_ALPHA    &&
--	             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
--	             (((AlphaComposite)sg2d.composite).getRule() ==
--	              AlphaComposite.SRC_OVER)))
--	        {
--	            textpipe = x11textpipe;
--	        } else {
--	            // do this to initialize textpipe correctly; we will attempt
--	            // to override the non-text pipes below
--	            super.validatePipe(sg2d);
--	            textpipe = sg2d.textpipe;
--	            validated = true;
--	        }
--
--	        PixelToShapeConverter txPipe = null;
--	        XRRenderer nonTxPipe = null;
--
--	        if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) 
--	        {
--	            if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
--	                if (sg2d.compositeState < sg2d.COMP_XOR) {
--	                    txPipe = x11txpipe;
--	                    nonTxPipe = x11pipe;
--	                }
--	            } else if (sg2d.compositeState <= sg2d.COMP_ALPHA) {
--	                if (isPaintValid(sg2d)) {
--	                    txPipe = x11txpipe;
--	                    nonTxPipe = x11pipe;
--	                }
--	                // custom paints handled by super.validatePipe() below
--	            }
--	        }
--
--	        if (txPipe != null) {
--	            if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
--	                sg2d.drawpipe = txPipe;
--	                sg2d.fillpipe = txPipe;
--	            } else if (sg2d.strokeState != sg2d.STROKE_THIN) {
--	                sg2d.drawpipe = txPipe;
--	                sg2d.fillpipe = nonTxPipe;
--	            } else {
--	                sg2d.drawpipe = nonTxPipe;
--	                sg2d.fillpipe = nonTxPipe;
--	            }
--	            sg2d.shapepipe = nonTxPipe;
--	        } else {
--	            if (!validated) {
--	                super.validatePipe(sg2d);
--	            }
--	        }
-+	// install the text pipe based on our earlier decision
-+	sg2d.textpipe = textpipe;
- 
--	        // install the text pipe based on our earlier decision
--	        sg2d.textpipe = textpipe;
-+	// always override the image pipe with the specialized OGL pipe
-+	sg2d.imagepipe = xrDrawImage;
-+    }
- 
--	        // always override the image pipe with the specialized OGL pipe
--	        sg2d.imagepipe = xrDrawImage;
--		
--//		
--//		if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON && /*sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&*/(sg2d.compositeState <= sg2d.COMP_ALPHA || sg2d.compositeState == sg2d.COMP_XOR))
--//		{
--//			if (x11txpipe == null)
--//			{
--//				/*
--//				 * Note: this is thread-safe since x11txpipe is the
--//				 * second of the two pipes constructed in makePipes().
--//				 * In the rare case we are racing against another
--//				 * thread making new pipes, setting lazypipe is a
--//				 * safe alternative to waiting for the other thread.
--//				 */
--//				sg2d.drawpipe = lazypipe;
--//				sg2d.fillpipe = lazypipe;
--//				sg2d.shapepipe = lazypipe;
--//				sg2d.imagepipe = lazypipe;
--//				sg2d.textpipe = lazypipe;
--//				return;
--//			}
--//
--//			if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE)
--//			{
--//				sg2d.drawpipe = x11txpipe;
--//				sg2d.fillpipe = x11txpipe;
--//			} else if (sg2d.strokeState != sg2d.STROKE_THIN)
--//			{
--//				sg2d.drawpipe = x11txpipe;
--//				sg2d.fillpipe = x11pipe;
--//			} else
--//			{
--//				sg2d.drawpipe = x11pipe;
--//				sg2d.fillpipe = x11pipe;
--//			}
--//			sg2d.shapepipe = x11pipe;
--//			sg2d.imagepipe = new XRDrawImage();
--//		} else
--//		{
--//			super.validatePipe(sg2d);
--//		}
--//
--//		//		 if (sg2d.compositeState <= sg2d.COMP_ALPHA) {
--//		//             if (XRPaints.isValid(sg2d)) {
--//		//                 sg2d.drawpipe = x11pipe;
--//		//                 sg2d.fillpipe = x11pipe;
--//		//             }
--//		//		 }
--//
--//		sg2d.textpipe = x11textpipe;
-+    /**
-+     * Returns an accalerated MaskFill object if the current paint
-+     *  is supported by the pipeline.
-+     */
-+    protected MaskFill getMaskFill(SunGraphics2D sg2d) {
-+	if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR && !isPaintValid(sg2d)) {
-+	    return null;
-+	}
-+	return super.getMaskFill(sg2d);
-+    }
- 
-+    public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
-+	if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR
-+		&& sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
-+	    return solidloops;
- 	}
--	
- 
--    @Override
--    protected MaskFill getMaskFill(SunGraphics2D sg2d) {
--        if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR && !isPaintValid(sg2d)) {
--            	return null;
--        }
--        return super.getMaskFill(sg2d);
-+	return super.getRenderLoops(sg2d);
-     }
- 
--	public RenderLoops getRenderLoops(SunGraphics2D sg2d)
--	{
--		if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR && sg2d.compositeState <= sg2d.COMP_ALPHA)
--		{
--			return solidloops;
--		}
--		
--		return super.getRenderLoops(sg2d);
--	}
-+    public GraphicsConfiguration getDeviceConfiguration() {
-+	return graphicsConfig;
-+    }
- 
--	public GraphicsConfiguration getDeviceConfiguration()
--	{
--		return graphicsConfig;
--	}
-+    /**
-+     * Method for instantiating a Window SurfaceData
-+     */
-+    public static XRWindowSurfaceData createData(X11ComponentPeer peer) {
-+	XRGraphicsConfig gc = getGC(peer);
-+	return new XRWindowSurfaceData(peer, gc, gc.getSurfaceType());
-+    }
- 
--	/**
--	 * Method for instantiating a Window SurfaceData
--	 */
--	public static XRWindowSurfaceData createData(X11ComponentPeer peer)
--	{
--		XRGraphicsConfig gc = getGC(peer);
--		return new XRWindowSurfaceData(peer, gc, gc.getSurfaceType());
--	}
-+    /**
-+     * Method for instantiating a Pixmap SurfaceData (offscreen).
-+     * If the surface is opaque a 24-bit/RGB surface is chosen, 
-+     * otherwise a 32-bit ARGB surface.
-+     */
-+    public static XRPixmapSurfaceData createData(XRGraphicsConfig gc,
-+	    int width, int height, ColorModel cm, Image image, long drawable,
-+	    int transparency) {
-+	int depth = transparency > Transparency.OPAQUE ? 32 : 24;
-+	if (depth == 24) {
-+	    cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00, 0x000000FF);
-+	} else {
-+	    cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00,
-+		    0x000000FF, 0xFF000000);
-+	}
-+
-+	return new XRPixmapSurfaceData(gc, width, height, image,
-+		getSurfaceType(gc, transparency), cm, drawable, transparency,
-+		XRUtils.getPictureFormatForTransparency(transparency), depth);
-+    }
- 
--	/**
--	 * Method for instantiating a Pixmap SurfaceData (offscreen)
--	 */
--	public static XRPixmapSurfaceData createData(XRGraphicsConfig gc, int width, int height, ColorModel cm, Image image, long drawable, int transparency)
--	{
--		int depth = transparency > Transparency.OPAQUE ? 32 : 24;
--		if (depth == 24)
--		{
--			cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00, 0x000000FF);
--		} else
--		{
--			cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
--		}
-+    protected XRSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc,
-+	    SurfaceType sType, ColorModel cm, int depth, int transparency) {
-+	super(sType, cm);
-+	this.peer = peer;
-+	this.graphicsConfig = gc;
-+	this.solidloops = graphicsConfig.getSolidLoops(sType);
-+	this.depth = depth;
-+	initOps(peer, graphicsConfig, depth);
- 
--		return new XRPixmapSurfaceData(gc, width, height, image, getSurfaceType(gc, transparency), cm, drawable, transparency, XRUtils.getPictureFormatForTransparency(transparency), depth);
--	}
-+	setBlitProxyKey(gc.getProxyKey());
-+    }
- 
--	public static XRPixmapSurfaceData createData(XRGraphicsConfig gc, int width, int height)
--	{
--		/*TODO - may I really pass this XRGraphicsConfig down, although depth is different??*/
--		return new XRPixmapSurfaceData(gc, width, height, null, ByteA8X11, new DirectColorModel(8, 0x00000000, 0x00000000, 0x00000000, 0x000000FF), 0, Transparency.OPAQUE, XRUtils.PictStandardA8, 8);
--	}
--
--	//	/**
--	//	 * Initializes the native Ops pointer.
--	//	 */
--	private native void initOps(X11ComponentPeer peer, XRGraphicsConfig gc, int depth);
--
--	protected XRSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc, SurfaceType sType, ColorModel cm, int depth, int transparency)
--	{
--		super(sType, cm);
--		this.peer = peer;
--		this.graphicsConfig = gc;
--		this.solidloops = graphicsConfig.getSolidLoops(sType);
--		this.depth = depth;
--		initOps(peer, graphicsConfig, depth);
--
--		setBlitProxyKey(gc.getProxyKey());
--	}
--
--	public void initXRender(int pictureFormat)
--	{
--		try
--		{
--			SunToolkit.awtLock();
--			XRInitXRender(getNativeOps(), pictureFormat);
--		} finally
--		{
--			SunToolkit.awtUnlock();
--		}
-+    /**
-+     * Inits the XRender-data-structures which belong to the XRSurfaceData.
-+     * @param pictureFormat
-+     */
-+    public void initXRender(int pictureFormat) {
-+	try {
-+	    SunToolkit.awtLock();
-+	    XRInitXRender(getNativeOps(), pictureFormat);
-+	} finally {
-+	    SunToolkit.awtUnlock();
- 	}
-+    }
- 
--	public static XRGraphicsConfig getGC(X11ComponentPeer peer)
--	{
--		if (peer != null)
--		{
--			return (XRGraphicsConfig) peer.getGraphicsConfiguration();
--		} else
--		{
--			GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
--			GraphicsDevice gd = env.getDefaultScreenDevice();
--			return (XRGraphicsConfig) gd.getDefaultConfiguration();
--		}
-+    public static XRGraphicsConfig getGC(X11ComponentPeer peer) {
-+	if (peer != null) {
-+	    return (XRGraphicsConfig) peer.getGraphicsConfiguration();
-+	} else {
-+	    GraphicsEnvironment env = GraphicsEnvironment
-+		    .getLocalGraphicsEnvironment();
-+	    GraphicsDevice gd = env.getDefaultScreenDevice();
-+	    return (XRGraphicsConfig) gd.getDefaultConfiguration();
- 	}
-+    }
- 
--	/**
--	 * Returns a boolean indicating whether or not a copyArea from
--	 * the given rectangle source coordinates might be incomplete
--	 * and result in X11 GraphicsExposure events being generated
--	 * from XCopyArea.
--	 * This method allows the SurfaceData copyArea method to determine
--	 * if it needs to set the GraphicsExposures attribute of the X11 GC
--	 * to True or False to receive or avoid the events.
--	 * @return true if there is any chance that an XCopyArea from the
--	 *              given source coordinates could produce any X11
--	 *              Exposure events.
--	 */
--	public abstract boolean canSourceSendExposures(int x, int y, int w, int h);
--	
--	public void validateCopyAreaGC(Region gcClip)
--	{
--		if (validatedGCClip != gcClip)
--		{
--			if (gcClip != null)
--			{
--				//XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
--			} else
--			{
--				//XRResetClip(getNativeOps());
--			}
--			validatedGCClip = gcClip;
--		}
-+    /**
-+     * Returns a boolean indicating whether or not a copyArea from the given
-+     * rectangle source coordinates might be incomplete and result in X11
-+     * GraphicsExposure events being generated from XCopyArea. This method
-+     * allows the SurfaceData copyArea method to determine if it needs to set
-+     * the GraphicsExposures attribute of the X11 GC to True or False to receive
-+     * or avoid the events.
-+     * 
-+     * @return true if there is any chance that an XCopyArea from the given
-+     *         source coordinates could produce any X11 Exposure events.
-+     */
-+    public abstract boolean canSourceSendExposures(int x, int y, int w, int h);
-+
-+    /**
-+     * CopyArea is implemented using the "old" X11 GC, 
-+     * therefor clip and needExposures have to be validated against that GC.
-+     * Pictures and GCs don't share state.
-+     */
-+    public void validateCopyAreaGC(Region gcClip, boolean needExposures) {
-+	if (validatedGCClip != gcClip) {
-+	    if (gcClip != null) {
-+		XSetClip(xgc, gcClip.getLoX(), gcClip.getLoY(),
-+			gcClip.getHiX(), gcClip.getHiY(), 
-+			gcClip.isRectangular() ? null : gcClip);
-+	    } else {
-+		XResetClip(xgc);
-+	    }
-+	    validatedGCClip = gcClip;
-+	}
-+
-+	if (validatedExposures != needExposures) {
-+	    validatedExposures = needExposures;
-+	    XSetGraphicsExposures(xgc, needExposures);
- 	}
-+    }
- 
--	public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy)
--	{
--		if (x11pipe == null)
--		{
--			if (!isDrawableValid())
--			{
--				return true;
--			}
--			makePipes();
--		}
--		CompositeType comptype = sg2d.imageComp;
--		if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE && (CompositeType.SrcOverNoEa.equals(comptype) || CompositeType.SrcNoEa.equals(comptype)))
--		{
--			x += sg2d.transX;
--			y += sg2d.transY;
--			SunToolkit.awtLock();
--			try
--			{
--				validateCopyAreaGC(sg2d.getCompClip());
--				//validate(sg2d.getCompClip(), sg2d.composite, sg2d.transform, sg2d.paint, sg2d, 0);
--				//						boolean needExposures = canSourceSendExposures(x, y, w, h);
--				//						long xgc = getBlitGC(sg2d.getCompClip(), needExposures);
--				
--				
--				x11pipe.devCopyArea(getNativeOps(), xgc, x, y, x + dx, y + dy, w, h);
--				//X11PMBlitLoops.nativeRenderBlit(getNativeOps(), getNativeOps(), x, y, dx, dy, w, h);
--			} finally
--			{
--				SunToolkit.awtUnlock();
--			}
--			return true;
--		}
--		return false;
-+    public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
-+	    int dx, int dy) {
-+	if (xrpipe == null) {
-+	    if (!isXRDrawableValid()) {
-+		return true;
-+	    }
-+	    makePipes();
- 	}
--
--	public static SurfaceType getSurfaceType(XRGraphicsConfig gc, int transparency)
--	{
--		SurfaceType sType = null;
--
--		switch (transparency)
--		{
--			case Transparency.OPAQUE:
--				sType = XRSurfaceData.IntRgbX11;
--				break;
--
--			case Transparency.BITMASK:
--			case Transparency.TRANSLUCENT:
--				sType = XRSurfaceData.IntArgbX11;
--				break;
--		}
--
--		return sType;
-+	CompositeType comptype = sg2d.imageComp;
-+	if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE
-+		&& (CompositeType.SrcOverNoEa.equals(comptype) || CompositeType.SrcNoEa
-+			.equals(comptype))) {
-+	    x += sg2d.transX;
-+	    y += sg2d.transY;
-+	    try {
-+		SunToolkit.awtLock();
-+		boolean needExposures = canSourceSendExposures(x, y, w, h);
-+		validateCopyAreaGC(sg2d.getCompClip(), needExposures);
-+		xrpipe.devCopyArea(getNativeOps(), xgc, x, y, x + dx, y + dy,
-+			w, h);
-+	    } finally {
-+		SunToolkit.awtUnlock();
-+	    }
-+	    return true;
- 	}
-+	return false;
-+    }
- 
--	public native void setInvalid();
--
--	public void invalidate()
--	{
--		if (isValid())
--		{
--			setInvalid();
--			super.invalidate();
--		}
-+    /**
-+     * Returns the XRender SurfaceType which is able to fullfill the
-+     * specified transparency requirement.
-+     */
-+    public static SurfaceType getSurfaceType(XRGraphicsConfig gc,
-+	    int transparency) {
-+	SurfaceType sType = null;
-+
-+	switch (transparency) {
-+	case Transparency.OPAQUE:
-+	    sType = XRSurfaceData.IntRgbX11;
-+	    break;
-+
-+	case Transparency.BITMASK:
-+	case Transparency.TRANSLUCENT:
-+	    sType = XRSurfaceData.IntArgbX11;
-+	    break;
- 	}
- 
--	/**
--	 * The following methods and variables are used to keep the Java-level
--	 * context state in sync with the native X11 GC associated with this
--	 * X11SurfaceData object.
--	 */
--
--	private static native long XCreateGC(long pXSData);
--
--	private static native void XRSetForeground(int pixel);
--
--	private static native void XRSetComposite(int compRule, float eAlpha);
--
--	private static native void XRSetClip(long xsdo, int lox, int loy, int hix, int hiy, Region complexclip);
--
--	private static native void XRResetClip(long xsdo);
--
--	private static native void XRSetTransformNative(long xsdo, int m00, int m01, int m02, int m10, int m11, int m12);
--
--	private static native void XRSetTexturePaint(long xsdo);
--
--	private static native void XRResetPaint();
--
--	private static native void XRSetRepeat(long xsdo, int repeat);
--
--	private void XRSetTransform(AffineTransform transform)
--	{
--		double[] transformData = new double[6];
--		transform.getMatrix(transformData);
-+	return sType;
-+    }
- 
--		XRSetTransformNative(getNativeOps(), XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]), XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-+    public void invalidate() {
-+	if (isValid()) {
-+	    setInvalid();
-+	    super.invalidate();
- 	}
-+    }
- 
--	//private long xgc;
-+    /**
-+     * Native methods used to set the state of the native XRender surface
-+     */
-+    private static native void XRSetForeground(int pixel);
-+
-+    private static native void XRSetComposite(int compRule, float eAlpha);
-+
-+    private static native void XRSetClip(long xsdo, int lox, int loy, int hix,
-+	    int hiy, Region complexclip);
-+
-+    private static native void XRResetClip(long xsdo);
-+
-+    private static native void XRSetTransformNative(long xsdo, int m00,
-+	    int m01, int m02, int m10, int m11, int m12);
-+
-+    private static native void XRSetTexturePaint(long xsdo);
-+
-+    private static native void XRResetPaint();
-+
-+    private static native void XRSetRepeat(long xsdo, int repeat);
-+    
-+    private static native void XRSetFilter(long xsdo, int value);
-+    
-+    private static native void XRSetLinearGradientPaint(float[] fractions,
-+	    int[] pixels, int x1, int y1, int x2, int y2, int numStops,
-+	    int cycleMethod, boolean useMask, boolean linear, int m00, int m01,
-+	    int m02, int m10, int m11, int m12);
-+    
-+    private native static void XRSetRadialGradientPaint(float[] fractions,
-+	    int[] pixels, int fx, int numStops, int cycleMethod,
-+	    boolean useMask, boolean linear, int innerRadius, int outerRadius,
-+	    int m00, int m01, int m02, int m10, int m11, int m12);
-+
-+    private void XRSetTransform(AffineTransform transform) {
-+	double[] transformData = new double[6];
-+	transform.getMatrix(transformData);
-+
-+	XRSetTransformNative(getNativeOps(), XDoubleToFixed(transformData[0]),
-+		XDoubleToFixed(transformData[2]),
-+		XDoubleToFixed(transformData[4]),
-+		XDoubleToFixed(transformData[1]),
-+		XDoubleToFixed(transformData[3]),
-+		XDoubleToFixed(transformData[5]));
-+    }
- 
--	public static int validatedPixel = -1;
--	public static int validatedPaintState = -1;
--	private static Composite validatedComp;
--	public static Paint validatedPaint;
--	private static int validatedTextureInterpolation = -1;
-+    private long xgc; //GC is still used for copyArea
- 
--	private Region validatedClip;
--	private Region validatedGCClip;
--	private boolean validatedExposures = true;
-+    public static int validatedPixel = -1;
-+    public static int validatedPaintState = -1;
-+    private static Composite validatedComp;
-+    public static Paint validatedPaint;
-+
-+    private Region validatedClip;
-+    private Region validatedGCClip;
-+    private boolean validatedExposures = true;
-+    private float validatedExtraAlpha = 1.0f;
-+    private int validatedFlags;
-+
-+    private boolean transformInUse = false;
-+    private AffineTransform validatedSourceTransform = new AffineTransform();
-+    private int validatedRepeat = XRUtils.RepeatNone;
-+    private int validatedInterpolation = -1;
-+    /*Used if API does not allow to pass interpolation value at the level needed*/
-+    private int preferredInterpolation = -1;
- 
--	private int validatedFlags;
-+    public void setPreferredInterpolation(int interpolation) {
-+	this.preferredInterpolation = interpolation;
-+    }
-+    
-+    
-+    /*
-+     * For now those shape-clips are used for transformed images,
-+     * because transformed image for now would invalidate a much larger area that they are intended to do.
-+     * However as soon as the transformed-mask approach I am working on turns out
-+     * to work well, those will be dropped.
-+     */
-+    public void setShapeClip(Shape shape) {
-+	Region shapeClip = Region.getInstance(validatedClip, shape, null);
-+	XRSetClip(getNativeOps(), shapeClip.getLoX(), shapeClip.getLoY(),
-+		shapeClip.getHiX(), shapeClip.getHiY(), shapeClip
-+			.isRectangular() ? null : shapeClip);
-+    }
- 
--	private boolean transformInUse = false;
--	private AffineTransform validatedSourceTransform = new AffineTransform();
--	private int validatedRepeat = XRUtils.RepeatNone;
--	private int validatedInterpolation = -1;
-+    public void resetShapeClip() {
-+	XRSetClip(getNativeOps(), validatedClip.getLoX(), validatedClip
-+		.getLoY(), validatedClip.getHiX(), validatedClip.getHiY(),
-+		validatedClip.isRectangular() ? null : validatedClip);
-+    }
- 
--	private int preferredInterpolation = -1;
-+    /**
-+     * Validate the source with the preferred interpolation set sometimes earlier.
-+     * @param sxForm
-+     * @param repeat
-+     */
-+    void validateAsSource(AffineTransform sxForm, int repeat) {
-+	validateAsSource(sxForm, repeat, preferredInterpolation);
-+    }
- 
--	public void setPreferredInterpolation(int interpolation)
--	{
--		this.preferredInterpolation = interpolation;
-+    /**
-+     * Validates an XRSurfaceData when used as source.
-+     * Note that the clip is applied when used as source as well as destination.
-+     */
-+    void validateAsSource(AffineTransform sxForm, int repeat, int interpolation) {
-+	if (validatedClip != null) {
-+	    validatedClip = null;
-+	    XRResetClip(getNativeOps());
-+	}
-+
-+	if (validatedRepeat != repeat) {
-+	    validatedRepeat = repeat;
-+	    XRSetRepeat(getNativeOps(), repeat);
-+	}
-+
-+	if (sxForm == null) {
-+	    if (transformInUse) {
-+		validatedSourceTransform.setToIdentity();
-+		XRSetTransform(validatedSourceTransform);
-+		transformInUse = false;
-+	    }
-+	} else {
-+	    if (!transformInUse
-+		 || (transformInUse && !sxForm.equals(validatedSourceTransform))) {
-+		
-+		validatedSourceTransform.setTransform(sxForm.getScaleX(),
-+			sxForm.getShearY(), sxForm.getShearX(), sxForm
-+				.getScaleY(), sxForm.getTranslateX(), sxForm
-+				.getTranslateY());
-+		
-+		XRSetTransform(validatedSourceTransform);
-+		transformInUse = true;
-+	    }
- 	}
- 
--	public void setShapeClip(Shape shape)
--	{
--		Region shapeClip = Region.getInstance(validatedClip, shape, null);
--		XRSetClip(getNativeOps(), shapeClip.getLoX(), shapeClip.getLoY(), shapeClip.getHiX(), shapeClip.getHiY(), shapeClip.isRectangular() ? null : shapeClip);
-+	if (interpolation != validatedInterpolation) {
-+	    XRSetFilter(getNativeOps(), interpolation);
-+	    validatedInterpolation = interpolation;
- 	}
-+    }
- 
--	public void resetShapeClip()
--	{
--		XRSetClip(getNativeOps(), validatedClip.getLoX(), validatedClip.getLoY(), validatedClip.getHiX(), validatedClip.getHiY(), validatedClip.isRectangular() ? null : validatedClip);
-+    /**
-+     * Utility method for setting the Composite,
-+     * passing down the arguments to the native method.
-+     * @param comp
-+     */
-+    private void setComposite(Composite comp) {
-+	if (comp instanceof AlphaComposite) {
-+	    AlphaComposite aComp = (AlphaComposite) comp;
-+	    validatedExtraAlpha = aComp.getAlpha();
-+
-+	    XRSetComposite(XRUtils.j2dAlphaCompToXR(aComp.getRule()),
-+		    validatedExtraAlpha);
-+	} else {
-+	    throw new InternalError(
-+		    "Composite accaleration not implemented for: "
-+			    + comp.getClass().getName());
- 	}
-+    }
- 
--	void validateAsSource(AffineTransform sxForm, int repeat)
--	{
--		validateAsSource(sxForm, repeat, preferredInterpolation);
-+    /**
-+     * @see: BufferedPaints
-+     */
-+    public int[] convertToIntArgbPixels(Color[] colors, boolean linear) {
-+	int[] pixels = new int[colors.length];
-+	for (int i = 0; i < colors.length; i++) {
-+	    pixels[i] = colorToIntArgbPixel(colors[i], linear);
- 	}
-+	return pixels;
-+    }
- 
--	void validateAsSource(AffineTransform sxForm, int repeat, int interpolation)
--	{
--		if (validatedClip != null)
--		{
--			validatedClip = null;
--			XRResetClip(getNativeOps());
--		}
--
--		if (validatedRepeat != repeat)
--		{
--			validatedRepeat = repeat;
--			XRSetRepeat(getNativeOps(), repeat);
--		}
--
--		if (sxForm == null)
--		{
--			if (transformInUse)
--			{
--				validatedSourceTransform.setToIdentity();
--				XRSetTransform(validatedSourceTransform);
--				transformInUse = false;
--			}
--		} else
--		{
--			if (!transformInUse || (transformInUse && !sxForm.equals(validatedSourceTransform)))
--			{
--				validatedSourceTransform.setTransform(sxForm.getScaleX(), sxForm.getShearY(), sxForm.getShearX(), sxForm.getScaleY(), sxForm.getTranslateX(), sxForm.getTranslateY());
--				XRSetTransform(validatedSourceTransform);
--				transformInUse = true;
--			}
--		}
--
--		if (interpolation != validatedInterpolation)
--		{
--			XRSetFilter(getNativeOps(), interpolation);
--			validatedInterpolation = interpolation;
--		}
-+    /**
-+     * @see: BufferedPaints
-+     */
-+    public int colorToIntArgbPixel(Color c, boolean linear) {
-+	int rgb = c.getRGB();
-+
-+	int a = rgb >>> 24;
-+	int r = (rgb >> 16) & 0xff;
-+	int g = (rgb >> 8) & 0xff;
-+	int b = (rgb) & 0xff;
-+	if (linear) {
-+	    r = BufferedPaints.convertSRGBtoLinearRGB(r);
-+	    g = BufferedPaints.convertSRGBtoLinearRGB(g);
-+	    b = BufferedPaints.convertSRGBtoLinearRGB(b);
- 	}
- 
--	public static native void XRSetFilter(long xsdo, int value);
-+	a *= validatedExtraAlpha;
- 
--	private void setComposite(Composite comp)
--	{
--		if (comp instanceof AlphaComposite)
--		{
--			AlphaComposite aComp = (AlphaComposite) comp;
--			float extraAlpha = aComp.getAlpha();
--			//extraAlphaUsed = extraAlpha != 1.0f;
--
--			XRSetComposite(XRUtils.j2dAlphaCompToXR(aComp.getRule()), extraAlpha);
--		} else if (comp instanceof XORComposite)
--		{
--
--		} else
--		{
--			throw new InternalError("Composite accaleration not implemented for: " + comp.getClass().getName());
--		}
-+	return ((a << 24) | (r << 16) | (g << 8) | (b));
-+    }
-+    
-+    /**
-+     * The currently only known paint XRender can't support are
-+     * radial gradients where focus and center paint differ.
-+     */
-+    public static boolean isPaintValid(SunGraphics2D sg2d) {
-+	if (sg2d.paintState == SunGraphics2D.PAINT_RAD_GRADIENT) {
-+	    RadialGradientPaint grad = (RadialGradientPaint) sg2d.paint;
-+	    return grad.getFocusPoint().equals(grad.getCenterPoint());
- 	}
-+	return true;
-+    }
- 
--	public static int[] convertToIntArgbPixels(Color[] colors, boolean linear)
--	{
--		int[] pixels = new int[colors.length];
--		for (int i = 0; i < colors.length; i++)
--		{
--			pixels[i] = colorToIntArgbPixel(colors[i], linear);
--		}
--		return pixels;
--	}
-+    /**
-+     * Sets a 2-stop gradient.
-+     * Utility method generating the by the native method expected
-+     * parameters and calling it.
-+     */
-+    private void setGradientPaint(SunGraphics2D sg2d, GradientPaint paint,
-+	    boolean useMask) {
-+	int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(),
-+		paint.getColor2() }, false);
-+
-+	float fractions[] = new float[2];
-+	fractions[0] = 0;
-+	fractions[1] = 1;
-+
-+	Point2D pt1 = paint.getPoint1();
-+	Point2D pt2 = paint.getPoint2();
-+
-+	AffineTransform at = (AffineTransform) sg2d.transform.clone();
-+	try {
-+	    at.invert();
-+	} catch (NoninvertibleTransformException ex) {
-+	    ex.printStackTrace();
-+	}
-+
-+	double[] transformData = new double[6];
-+	at.getMatrix(transformData);
-+
-+	int repeat = paint.isCyclic() ? XRUtils.RepeatReflect
-+		: XRUtils.RepeatPad;
-+
-+	XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()),
-+		XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()),
-+		XDoubleToFixed(pt2.getY()), 2, repeat, useMask, false,
-+		XDoubleToFixed(transformData[0]),
-+		XDoubleToFixed(transformData[2]),
-+		XDoubleToFixed(transformData[4]),
-+		XDoubleToFixed(transformData[1]),
-+		XDoubleToFixed(transformData[3]),
-+		XDoubleToFixed(transformData[5]));
-+    }
-+    
-+    /**
-+     * Sets a n-stop linear gradient.
-+     * Utility method generating the by the native method expected
-+     * parameters and calling it.
-+     */
-+    public void setLinearGradientPaint(SunGraphics2D sg2d,
-+	    LinearGradientPaint paint, boolean useMask) {
-+	boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
-+	Color[] colors = paint.getColors();
-+	int numStops = colors.length;
-+	Point2D pt1 = paint.getStartPoint();
-+	Point2D pt2 = paint.getEndPoint();
-+
-+	AffineTransform at = paint.getTransform();
-+	at.preConcatenate(sg2d.transform);
-+
-+	int cycleMethod = XRUtils.getRepeatForCycleMethod(paint
-+		.getCycleMethod());
-+	float[] fractions = paint.getFractions();
-+	int[] pixels = convertToIntArgbPixels(colors, linear);
-+
-+	try {
-+	    at.invert();
-+	} catch (NoninvertibleTransformException ex) {
-+	    ex.printStackTrace();
-+	}
-+
-+	double[] transformData = new double[6];
-+	at.getMatrix(transformData);
-+
-+	XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()),
-+		XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()),
-+		XDoubleToFixed(pt2.getY()), numStops, cycleMethod, useMask,
-+		linear, XDoubleToFixed(transformData[0]),
-+		XDoubleToFixed(transformData[2]),
-+		XDoubleToFixed(transformData[4]),
-+		XDoubleToFixed(transformData[1]),
-+		XDoubleToFixed(transformData[3]),
-+		XDoubleToFixed(transformData[5]));
-+    }
- 
--	public static int colorToIntArgbPixel(Color c, boolean linear)
--	{
--		int rgb = c.getRGB();
--		if (!linear && ((rgb >> 24) == -1))
--		{
--			return rgb;
--		}
--		int a = rgb >>> 24;
--		int r = (rgb >> 16) & 0xff;
--		int g = (rgb >> 8) & 0xff;
--		int b = (rgb) & 0xff;
--		if (linear)
--		{
--			r = BufferedPaints.convertSRGBtoLinearRGB(r);
--			g = BufferedPaints.convertSRGBtoLinearRGB(g);
--			b = BufferedPaints.convertSRGBtoLinearRGB(b);
--		}
-+    /**
-+     * Sets a Radial Gradient where focus and center point match.
-+     * Utility method generating the by the native method expected
-+     * parameters and calling it.
-+     */
-+    public void setRadialGradientPaint(SunGraphics2D sg2d,
-+	    RadialGradientPaint paint) {
-+	boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
-+	Color[] colors = paint.getColors();
-+	int numStops = colors.length;
-+	Point2D center = paint.getCenterPoint();
-+	Point2D focus = paint.getFocusPoint();
-+
-+	int cycleMethod = XRUtils.getRepeatForCycleMethod(paint
-+		.getCycleMethod());
-+	float[] fractions = paint.getFractions();
-+	int[] pixels = convertToIntArgbPixels(colors, linear);
-+	float radius = paint.getRadius();
-+
-+	// save original (untransformed) center and focus points
-+	double cx = center.getX();
-+	double cy = center.getY();
-+	double fx = focus.getX();
-+	double fy = focus.getY();
-+
-+	AffineTransform at = paint.getTransform();
-+	at.preConcatenate(sg2d.transform);
-+	focus = at.transform(focus, focus);
-+
-+	// transform unit circle to gradient coords; we start with the
-+	// unit circle (center=(0,0), focus on positive x-axis, radius=1)
-+	// and then transform into gradient space
-+	at.translate(cx, cy);
-+	at.rotate(fx - cx, fy - cy);
-+	// at.scale(radius, radius);
-+
-+	// invert to get mapping from device coords to unit circle
-+	try {
-+	    at.invert();
-+	} catch (Exception e) {
-+	    at.setToScale(0.0, 0.0);
-+	}
-+	focus = at.transform(focus, focus);
-+
-+	// clamp the focus point so that it does not rest on, or outside
-+	// of, the circumference of the gradient circle
-+	fx = Math.min(focus.getX(), 0.99);
-+
-+	double[] transformData = new double[6];
-+	at.getMatrix(transformData);
-+
-+	XRSetRadialGradientPaint(fractions, pixels, XDoubleToFixed(fx),
-+		numStops, cycleMethod, false, linear, XDoubleToFixed(0),
-+		XDoubleToFixed(radius), XDoubleToFixed(transformData[0]),
-+		XDoubleToFixed(transformData[2]),
-+		XDoubleToFixed(transformData[4]),
-+		XDoubleToFixed(transformData[1]),
-+		XDoubleToFixed(transformData[3]),
-+		XDoubleToFixed(transformData[5]));
-+    }
- 
--		return ((a << 24) | (r << 16) | (g << 8) | (b));
-+    private TexturePaint setTexturePaint(SunGraphics2D sg2d,
-+	    TexturePaint paint, boolean useMask) {
-+	BufferedImage bi = paint.getImage();
-+	SurfaceData dstData = sg2d.surfaceData;
-+	SurfaceData srcData = dstData.getSourceSurfaceData(bi,
-+		SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
-+
-+	// REMIND: this hack tries to ensure that we have a cached texture
-+	if (!(srcData instanceof XRSurfaceData)) {
-+	    srcData = dstData.getSourceSurfaceData(paint.getImage(),
-+		    SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver,
-+		    null);
-+	    if (!(srcData instanceof XRSurfaceData)) {
-+		return null;
-+	    }
-+	}
-+
-+	XRSurfaceData x11SrcData = (XRSurfaceData) srcData;
-+
-+	AffineTransform at = (AffineTransform) sg2d.transform.clone();
-+	Rectangle2D anchor = paint.getAnchorRect();
-+	at.translate(anchor.getX(), anchor.getY());
-+	at.scale(anchor.getWidth() / ((double) bi.getWidth()), 
-+		anchor.getHeight() / ((double) bi.getHeight()));
-+	
-+	try {
-+	    at.invert();
-+	} catch (NoninvertibleTransformException ex) {
-+	    at.setToIdentity(); /* TODO: Right thing to do in this case? */
- 	}
- 
--	private static void setGradientPaint(SunGraphics2D sg2d, GradientPaint paint, boolean useMask)
--	{
--		int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() }, false);
--
--		float fractions[] = new float[2];
--		fractions[0] = 0;
--		fractions[1] = 1;
--
--		Point2D pt1 = paint.getPoint1();
--		Point2D pt2 = paint.getPoint2();
--
--		AffineTransform at = (AffineTransform) sg2d.transform.clone();
--		try
--		{
--			at.invert();
--		} catch (NoninvertibleTransformException ex)
--		{
--			ex.printStackTrace();
--		}
-+	x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, 
-+		XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
- 
--		double[] transformData = new double[6];
--		at.getMatrix(transformData);
-+	XRSetTexturePaint(srcData.getNativeOps());
- 
--		int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
-+	return paint;
-+    }
- 
--		XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()), XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()), XDoubleToFixed(pt2.getY()), 2, repeat, useMask, false, XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]),
--				XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
--	}
-+    /**
-+     * Sets the paint as source.
-+     * Checks the type of paint and calls the appropriate set*Paint method.
-+     * @param sg2d
-+     * @param paint
-+     */
-+    public void setPaint(SunGraphics2D sg2d, Paint paint) {
-+	if (sg2d != null) {
-+	    if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
-+		XRResetPaint();
-+	    } else {
-+		switch (sg2d.paintState) {
-+		case SunGraphics2D.PAINT_GRADIENT:
-+		    setGradientPaint(sg2d, (GradientPaint) paint, false);
-+		    validatedPaint = paint;
-+		    break;
-+
-+		case SunGraphics2D.PAINT_LIN_GRADIENT:
-+		    setLinearGradientPaint(sg2d, (LinearGradientPaint) paint,
-+			    false);
-+		    validatedPaint = paint;
-+		    break;
-+
-+		case SunGraphics2D.PAINT_RAD_GRADIENT:
-+		    setRadialGradientPaint(sg2d, (RadialGradientPaint) paint);
-+		    validatedPaint = paint;
-+		    break;
-+
-+		case SunGraphics2D.PAINT_TEXTURE:
-+		    validatedPaint = setTexturePaint(sg2d,
-+			    (TexturePaint) paint, false);
-+		    break;
- 
--	public static boolean isPaintValid(SunGraphics2D sg2d)
--	{
--		if(sg2d.paintState == SunGraphics2D.PAINT_RAD_GRADIENT)
--		{
--			RadialGradientPaint grad = (RadialGradientPaint) sg2d.paint;
--			return grad.getFocusPoint().equals(grad.getCenterPoint());
-+		default:
-+		    throw new InternalError("should not reach");
- 		}
--		
--		return true;
-+	    }
- 	}
--	
--	public static void setRadialGradientPaint(SunGraphics2D sg2d, RadialGradientPaint paint)
--	{
--		boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
--		Color[] colors = paint.getColors();
--		int numStops = colors.length;
--		Point2D center = paint.getCenterPoint();
--		Point2D focus = paint.getFocusPoint();
--
--		int cycleMethod = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
--		float[] fractions = paint.getFractions();
--		int[] pixels = convertToIntArgbPixels(colors, linear);
--		float radius = paint.getRadius();
--
--		// save original (untransformed) center and focus points
--		double cx = center.getX();
--		double cy = center.getY();
--		double fx = focus.getX();
--		double fy = focus.getY();
--
--		AffineTransform at = paint.getTransform();
--		at.preConcatenate(sg2d.transform);
--		focus = at.transform(focus, focus);
--
--		// transform unit circle to gradient coords; we start with the
--		// unit circle (center=(0,0), focus on positive x-axis, radius=1)
--		// and then transform into gradient space
--		at.translate(cx, cy);
--		at.rotate(fx - cx, fy - cy);
--		//  at.scale(radius, radius);
--
--		// invert to get mapping from device coords to unit circle
--		try
--		{
--			at.invert();
--		} catch (Exception e)
--		{
--			at.setToScale(0.0, 0.0);
--		}
--		focus = at.transform(focus, focus);
--
--		// clamp the focus point so that it does not rest on, or outside
--		// of, the circumference of the gradient circle
--		fx = Math.min(focus.getX(), 0.99);
--
--		double[] transformData = new double[6];
--		at.getMatrix(transformData);
--
--		XRSetRadialGradientPaint(fractions, pixels, XDoubleToFixed(fx), numStops, cycleMethod, false, linear, XDoubleToFixed(0), XDoubleToFixed(radius), XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]), XDoubleToFixed(transformData[3]),
--				XDoubleToFixed(transformData[5]));
--	}
--
--	public native static void XRSetRadialGradientPaint(float[] fractions, int[] pixels, int fx, int numStops, int cycleMethod, boolean useMask, boolean linear, int innerRadius, int outerRadius, int m00, int m01, int m02, int m10, int m11, int m12);
--
--	public static void setLinearGradientPaint(SunGraphics2D sg2d, LinearGradientPaint paint, boolean useMask)
--	{
--		boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
--		Color[] colors = paint.getColors();
--		int numStops = colors.length;
--		Point2D pt1 = paint.getStartPoint();
--		Point2D pt2 = paint.getEndPoint();
--
--		AffineTransform at = paint.getTransform();
--		at.preConcatenate(sg2d.transform);
--
--		int cycleMethod = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
--		float[] fractions = paint.getFractions();
--		int[] pixels = convertToIntArgbPixels(colors, linear);
--
--		try
--		{
--			at.invert();
--		} catch (NoninvertibleTransformException ex)
--		{
--			ex.printStackTrace();
--		}
--
--		double[] transformData = new double[6];
--		at.getMatrix(transformData);
-+    }
- 
--		XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()), XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()), XDoubleToFixed(pt2.getY()), numStops, cycleMethod, useMask, linear, XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]),
--				XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-+    /**
-+     * Validates the Surface when used as destination, 
-+     * takes care that the native surface has the same state as expected, 
-+     * changing it it not.
-+     */
-+    public void validate(Region clip, Composite comp, AffineTransform xform,
-+	    Paint paint, SunGraphics2D sg2d, int flags) {
-+	boolean updateClip = (clip != validatedClip);
-+	boolean updatePaint = (paint != validatedPaint) || paint == null;
-+
-+	if (!isValid()) {
-+	    throw new InvalidPipeException("bounds changed");
-+	}
-+
-+	// validate clip
-+	if (updateClip) {
-+	    if (clip != null) {
-+		XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip
-+			.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
-+	    } else {
-+		XRResetClip(getNativeOps());
-+	    }
-+	    validatedClip = clip;
-+	}
-+
-+	// validate composite (note that a change in the context flags
-+	// may require us to update the composite state, even if the
-+	// composite has not changed)
-+	if ((comp != validatedComp) || (flags != validatedFlags)) {
-+	    if (comp != null) {
-+		setComposite(comp);
-+	    } else {
-+		comp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER);
-+		setComposite(comp);
-+	    }
-+	    // the paint state is dependent on the composite state, so make
-+	    // sure we update the color below
-+	    updatePaint = true;
-+	    validatedComp = comp;
-+	    validatedFlags = flags;
-+	}
-+
-+	if (sg2d != null && validatedPixel != sg2d.pixel) {
-+	    validatedPixel = sg2d.pixel;
-+	    XRSetForeground(validatedPixel);
-+	}
-+
-+	// validate paint
-+	if (updatePaint) {
-+	    if (paint != null) {
-+		setPaint(sg2d, paint);
-+	    } else {
-+		XRResetPaint();
-+	    }
-+	    validatedPaint = paint;
- 	}
-+    }
- 
--	private static native void XRSetLinearGradientPaint(float[] fractions, int[] pixels, int x1, int y1, int x2, int y2, int numStops, int cycleMethod, boolean useMask, boolean linear, int m00, int m01, int m02, int m10, int m11, int m12);
--
--	private static TexturePaint setTexturePaint(SunGraphics2D sg2d, TexturePaint paint, boolean useMask)
--	{
--		BufferedImage bi = paint.getImage();
--		SurfaceData dstData = sg2d.surfaceData;
--		SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
--
--		// REMIND: this hack tries to ensure that we have a cached texture
--		if (!(srcData instanceof XRSurfaceData))
--		{
--			srcData = dstData.getSourceSurfaceData(paint.getImage(), SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
--			if (!(srcData instanceof XRSurfaceData))
--			{
--				return null;
--			}
--		}
--
--		XRSurfaceData x11SrcData = (XRSurfaceData) srcData;
--
--		validatedTextureInterpolation = sg2d.interpolationType;
--		XRSetFilter(x11SrcData.getNativeOps(), XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
--
--		AffineTransform at = (AffineTransform) sg2d.transform.clone();
--		Rectangle2D anchor = paint.getAnchorRect();
--		at.translate(anchor.getX(), anchor.getY());
--		at.scale(anchor.getWidth() / ((double) bi.getWidth()), anchor.getHeight() / ((double) bi.getHeight()));
--		try
--		{
--			at.invert();
--		} catch (NoninvertibleTransformException ex)
--		{
--			ex.printStackTrace();
--		}
--
--		x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType)); /*Todo - doesn't work if interpolation value is changed after texturepaint is "realized"*/
--
--		XRSetTexturePaint(srcData.getNativeOps());
--
--		return paint;
-+    public void makePipes() { /*TODO: Why was this synchronized, but access not?*/
-+	if (xrpipe == null) {
-+	    try {
-+		SunToolkit.awtLock();
-+		xgc = XCreateGC(getNativeOps());
-+
-+		xrpipe = XRRenderer.getInstance();
-+		xrtxpipe = new PixelToShapeConverter(xrpipe);
-+		xrtextpipe = new XRTextRenderer();
-+		xrDrawImage = new XRDrawImage();
-+	    } finally {
-+		SunToolkit.awtUnlock();
-+	    }
- 	}
-+    }
- 
--	public void setPaint(SunGraphics2D sg2d, Paint paint)
--	{
--		if (sg2d != null)
--		{
--			if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)
--			{
--				XRResetPaint();
--			} else
--			{
--				switch (sg2d.paintState)
--				{
--					case SunGraphics2D.PAINT_GRADIENT:
--						setGradientPaint(sg2d, (GradientPaint) paint, false);
--						validatedPaint = paint;
--						break;
--
--					case SunGraphics2D.PAINT_LIN_GRADIENT:
--						setLinearGradientPaint(sg2d, (LinearGradientPaint) paint, false);
--						validatedPaint = paint;
--						break;
--
--					case SunGraphics2D.PAINT_RAD_GRADIENT:
--						setRadialGradientPaint(sg2d, (RadialGradientPaint) paint);
--						validatedPaint = paint;
--						break;
--
--					case SunGraphics2D.PAINT_TEXTURE:
--						validatedPaint = setTexturePaint(sg2d, (TexturePaint) paint, false);
--						break;
--
--					default:
--						throw new InternalError("should not reach");
--				}
--			}
--		}
-+    public static class XRWindowSurfaceData extends XRSurfaceData {
-+	public XRWindowSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc,
-+		SurfaceType sType) {
-+	    super(peer, gc, sType, peer.getColorModel(), peer.getColorModel()
-+		    .getPixelSize(), Transparency.OPAQUE);
-+
-+	    if (isXRDrawableValid()) {
-+		initXRender(XRUtils
-+			.getPictureFormatForTransparency(Transparency.OPAQUE));
-+		makePipes();
-+	    }
-+	}
-+
-+	public SurfaceData getReplacement() {
-+	    return peer.getSurfaceData();
-+	}
-+
-+	public Rectangle getBounds() {
-+	    Rectangle r = peer.getBounds();
-+	    r.x = r.y = 0;
-+	    return r;
- 	}
- 
--	public void validate(Region clip, Composite comp, AffineTransform xform, Paint paint, SunGraphics2D sg2d, int flags)
--	{
--		boolean updateClip = (clip != validatedClip);
--		boolean updatePaint = (paint != validatedPaint) || paint == null;
--
--		if (!isValid())
--		{
--			throw new InvalidPipeException("bounds changed");
--		}
--
--		// validate clip
--		if (updateClip)
--		{
--			if (clip != null)
--			{
--				XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
--			} else
--			{
--				XRResetClip(getNativeOps());
--			}
--			validatedClip = clip;
--		}
--
--		// validate composite (note that a change in the context flags
--		// may require us to update the composite state, even if the
--		// composite has not changed)
--		if ((comp != validatedComp) || (flags != validatedFlags))
--		{
--			if (comp != null)
--			{
--				setComposite(comp);
--			} else
--			{
--				comp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER);
--				setComposite(comp);
--			}
--			// the paint state is dependent on the composite state, so make
--			// sure we update the color below
--			updatePaint = true;
--			validatedComp = comp;
--			validatedFlags = flags;
--		}
--
--		if (sg2d != null && validatedPixel != sg2d.pixel)
--		{
--			validatedPixel = sg2d.pixel;
--			XRSetForeground(validatedPixel);
--		}
--
--		// validate paint
--		if (updatePaint)
--		{
--			if (paint != null)
--			{
--				setPaint(sg2d, paint);
--			} else
--			{
--				XRResetPaint();
--			}
--			validatedPaint = paint;
--		}
-+	@Override
-+	public boolean canSourceSendExposures(int x, int y, int w, int h) {
-+	    return true;
- 	}
- 
--	long xgc;
--
--	public void makePipes()
--	{
--		if (x11pipe == null)
--		{
--			try
--			{
--				SunToolkit.awtLock();
--				xgc = XCreateGC(getNativeOps());
--
--				x11pipe = XRRenderer.getInstance();
--				x11txpipe = new PixelToShapeConverter(x11pipe);
--				x11textpipe = new XRTextRenderer();
--				xrDrawImage = new XRDrawImage();
--			} finally
--			{
--				SunToolkit.awtUnlock();
--			}
--		}
-+	/**
-+	 * Returns destination Component associated with this SurfaceData.
-+	 */
-+	public Object getDestination() {
-+	    return peer.getTarget();
- 	}
-+    }
- 
--	public static class XRWindowSurfaceData extends XRSurfaceData
--	{
--		public XRWindowSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc, SurfaceType sType)
--		{
--			super(peer, gc, sType, peer.getColorModel(), peer.getColorModel().getPixelSize(), Transparency.OPAQUE);
--
--			if (isDrawableValid())
--			{
--				initXRender(XRUtils.getPictureFormatForTransparency(Transparency.OPAQUE));
--				makePipes();
--			}
--		}
--
--		public SurfaceData getReplacement()
--		{
--			return peer.getSurfaceData();
--		}
--
--		public Rectangle getBounds()
--		{
--			Rectangle r = peer.getBounds();
--			r.x = r.y = 0;
--			return r;
--		}
--
--		@Override
--		public boolean canSourceSendExposures(int x, int y, int w, int h)
--		{
--			return true;
--		}
--
--		/**
--		 * Returns destination Component associated with this SurfaceData.
--		 */
--		public Object getDestination()
--		{
--			return peer.getTarget();
--		}
-+    public static class XRPixmapSurfaceData extends XRSurfaceData {
-+	Image offscreenImage;
-+	int width;
-+	int height;
-+	int transparency;
-+
-+	public XRPixmapSurfaceData(XRGraphicsConfig gc, int width, int height,
-+		Image image, SurfaceType sType, ColorModel cm, long drawable,
-+		int transparency, int pictFormat, int depth) {
-+	    super(null, gc, sType, cm, depth, transparency);
-+	    this.width = width;
-+	    this.height = height;
-+	    offscreenImage = image;
-+	    this.transparency = transparency;
-+	    initSurface(depth, width, height, drawable, pictFormat);
-+	    makePipes();
-+	}
-+
-+	public void initSurface(int depth, int width, int height,
-+		long drawable, int pictFormat) {
-+	    try {
-+		SunToolkit.awtLock();
-+		XRInitSurface(depth, width, height, drawable, pictFormat);
-+	    } finally {
-+		SunToolkit.awtUnlock();
-+	    }
- 	}
- 
--	public static class XRPixmapSurfaceData extends XRSurfaceData
--	{
--		Image offscreenImage;
--		int width;
--		int height;
--		int transparency;
--
--		public XRPixmapSurfaceData(XRGraphicsConfig gc, int width, int height, Image image, SurfaceType sType, ColorModel cm, long drawable, int transparency, int pictFormat, int depth)
--		{
--			super(null, gc, sType, cm, depth, transparency);
--			this.width = width;
--			this.height = height;
--			offscreenImage = image;
--			this.transparency = transparency;
--			initSurface(depth, width, height, drawable, pictFormat);
--			makePipes();
--		}
--
--		public void initSurface(int depth, int width, int height, long drawable, int pictFormat)
--		{
--			try
--			{
--				SunToolkit.awtLock();
--				XRInitSurface(depth, width, height, drawable, pictFormat);
--			} finally
--			{
--				SunToolkit.awtUnlock();
--			}
--		}
--
--		public SurfaceData getReplacement()
--		{
--			return restoreContents(offscreenImage);
--		}
-+	public SurfaceData getReplacement() {
-+	    return restoreContents(offscreenImage);
-+	}
- 
--		/**
--		 * Need this since the surface data is created with
--		 * the color model of the target GC, which is always
--		 * opaque. But in SunGraphics2D.blitSD we choose loops
--		 * based on the transparency on the source SD, so
--		 * it could choose wrong loop (blit instead of blitbg,
--		 * for example).
--		 */
--		public int getTransparency()
--		{
--			return transparency;
--		}
-+	/**
-+	 * Need this since the surface data is created with the color model of
-+	 * the target GC, which is always opaque. But in SunGraphics2D.blitSD we
-+	 * choose loops based on the transparency on the source SD, so it could
-+	 * choose wrong loop (blit instead of blitbg, for example).
-+	 */
-+	public int getTransparency() {
-+	    return transparency;
-+	}
- 
--		public Rectangle getBounds()
--		{
--			return new Rectangle(width, height);
--		}
-+	public Rectangle getBounds() {
-+	    return new Rectangle(width, height);
-+	}
- 
--		@Override
--		public boolean canSourceSendExposures(int x, int y, int w, int h)
--		{
--			return (x < 0 || y < 0 || (x + w) > width || (y + h) > height);
--		}
-+	@Override
-+	public boolean canSourceSendExposures(int x, int y, int w, int h) {
-+	    return (x < 0 || y < 0 || (x + w) > width || (y + h) > height);
-+	}
- 
--		public void flush()
--		{
--			/*
--			 * We need to invalidate the surface before disposing the
--			 * native Drawable and GC.  This way if an application tries
--			 * to render to an already flushed X11SurfaceData, we will notice
--			 * in the validate() method above that it has been invalidated,
--			 * and we will avoid using those native resources that have
--			 * already been disposed.
--			 */
--			invalidate();
--			flushNativeSurface();
--		}
-+	public void flush() {
-+	    /*
-+	     * We need to invalidate the surface before disposing the native
-+	     * Drawable and Picture. This way if an application tries to render to an
-+	     * already flushed XRSurfaceData, we will notice in the validate()
-+	     * method above that it has been invalidated, and we will avoid
-+	     * using those native resources that have already been disposed.
-+	     */
-+	    invalidate();
-+	    flushNativeSurface();
-+	}
- 
--		/**
--		 * Returns destination Image associated with this SurfaceData.
--		 */
--		public Object getDestination()
--		{
--			return offscreenImage;
--		}
-+	/**
-+	 * Returns destination Image associated with this SurfaceData.
-+	 */
-+	public Object getDestination() {
-+	    return offscreenImage;
- 	}
-+    }
- 
--	private static LazyPipe lazypipe = new LazyPipe();
-+    private static LazyPipe lazypipe = new LazyPipe();
- 
--	public static class LazyPipe extends ValidatePipe
--	{
--		public boolean validate(SunGraphics2D sg2d)
--		{
--			XRSurfaceData xsd = (XRSurfaceData) sg2d.surfaceData;
--			if (!xsd.isDrawableValid())
--			{
--				return false;
--			}
--			xsd.makePipes();
--			return super.validate(sg2d);
--		}
-+    public static class LazyPipe extends ValidatePipe {
-+	public boolean validate(SunGraphics2D sg2d) {
-+	    XRSurfaceData xsd = (XRSurfaceData) sg2d.surfaceData;
-+	    if (!xsd.isXRDrawableValid()) {
-+		return false;
-+	    }
-+	    xsd.makePipes();
-+	    return super.validate(sg2d);
- 	}
-+    }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java	2009-01-18 01:47:11.000000000 +0000
-@@ -42,62 +42,51 @@
- import sun.java2d.opengl.*;
- 
- /**
-- * The proxy class contains the logic for when to replace a
-- * SurfaceData with a cached X11 Pixmap and the code to create
-- * the accelerated surfaces.
-+ * The proxy class contains the logic for when to replace a SurfaceData with a
-+ * cached X11 Pixmap and the code to create the accelerated surfaces.
-  */
--public class XRSurfaceDataProxy extends SurfaceDataProxy
--    implements Transparency
--{
-+public class XRSurfaceDataProxy extends SurfaceDataProxy implements
-+	Transparency {
-     public static SurfaceDataProxy createProxy(SurfaceData srcData,
--                                               XRGraphicsConfig dstConfig)
--    {
--        if (srcData instanceof XRSurfaceData) {
--            // srcData must be a VolatileImage which either matches
--            // our visual or not - either way we do not cache it...
--            return UNCACHED;
--        }
--        
--        return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency());
-+	    XRGraphicsConfig dstConfig) {
-+	
-+	/*Don't cache already native surfaces*/
-+	if (srcData instanceof XRSurfaceData) { 
-+	    return UNCACHED;
-+	}
-+
-+	return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency());
-     }
- 
-     XRGraphicsConfig xrgc;
-     int transparency;
- 
-     public XRSurfaceDataProxy(XRGraphicsConfig x11gc) {
--        this.xrgc = x11gc;
-+	this.xrgc = x11gc;
-     }
- 
-     @Override
-     public SurfaceData validateSurfaceData(SurfaceData srcData,
--                                           SurfaceData cachedData,
--                                           int w, int h)
--    {
--        if (cachedData == null) {
--            // Bitmask will be created lazily during the blit phase
--            cachedData = XRSurfaceData.createData(xrgc, w, h,
--                                                   xrgc.getColorModel(),
--                                                   null, 0, getTransparency());
--        }
--        return cachedData;
-+	    SurfaceData cachedData, int w, int h) {
-+	if (cachedData == null) {
-+	    cachedData = XRSurfaceData.createData(xrgc, w, h, xrgc
-+		    .getColorModel(), null, 0, getTransparency());
-+	}
-+	return cachedData;
-     }
--    
-+
-     public XRSurfaceDataProxy(XRGraphicsConfig x11gc, int transparency) {
--        this.xrgc = x11gc;
--        this.transparency = transparency;
-+	this.xrgc = x11gc;
-+	this.transparency = transparency;
-     }
- 
-     @Override
--    public boolean isSupportedOperation(SurfaceData srcData,
--                                        int txtype,
--                                        CompositeType comp,
--                                        Color bgColor)
--    {
--        return (bgColor == null || transparency == Transparency.OPAQUE);
-+    public boolean isSupportedOperation(SurfaceData srcData, int txtype,
-+	    CompositeType comp, Color bgColor) {
-+	return (bgColor == null || transparency == Transparency.TRANSLUCENT);
-     }
- 
--	public int getTransparency()
--	{
--		return transparency;
--	}
-+    public int getTransparency() {
-+	return transparency;
-+    }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	2009-01-18 01:47:11.000000000 +0000
-@@ -6,137 +6,143 @@
- import java.awt.MultipleGradientPaint.*;
- import java.awt.image.*;
- 
--public class XRUtils
--{
--	/*Composition Operators*/
--	public static final int PictOpClear = 0;
--	public static final int PictOpSrc = 1;
--	public static final int PictOpDst = 2;
--	public static final int PictOpOver = 3;
--	public static final int PictOpOverReverse = 4;
--	public static final int PictOpIn = 5;
--	public static final int PictOpInReverse = 6;
--	public static final int PictOpOut = 7;
--	public static final int PictOpOutReverse = 8;
--	public static final int PictOpAtop = 9;
--	public static final int PictOpAtopReverse = 10;
--	public static final int PictOpXor = 11;
--	public static final int PictOpAdd = 12;
--	public static final int PictOpSaturate = 13;
--
--	/*Repeats*/
--	public static final int RepeatNone = 0;
--	public static final int RepeatNormal = 1;
--	public static final int RepeatPad = 2;
--	public static final int RepeatReflect = 3;
-+public class XRUtils {
-+    /* Composition Operators */
-+    public static final int PictOpClear = 0;
-+    public static final int PictOpSrc = 1;
-+    public static final int PictOpDst = 2;
-+    public static final int PictOpOver = 3;
-+    public static final int PictOpOverReverse = 4;
-+    public static final int PictOpIn = 5;
-+    public static final int PictOpInReverse = 6;
-+    public static final int PictOpOut = 7;
-+    public static final int PictOpOutReverse = 8;
-+    public static final int PictOpAtop = 9;
-+    public static final int PictOpAtopReverse = 10;
-+    public static final int PictOpXor = 11;
-+    public static final int PictOpAdd = 12;
-+    public static final int PictOpSaturate = 13;
-+
-+    /* Repeats */
-+    public static final int RepeatNone = 0;
-+    public static final int RepeatNormal = 1;
-+    public static final int RepeatPad = 2;
-+    public static final int RepeatReflect = 3;
-+
-+    /* Interpolation qualities */
-+    public static final int FAST = 0;
-+    public static final int GOOD = 1;
-+    public static final int BEST = 2;
-+
-+    /* PictFormats */
-+    public static final int PictStandardARGB32 = 0;
-+    public static final int PictStandardRGB24 = 1;
-+    public static final int PictStandardA8 = 2;
-+    public static final int PictStandardA4 = 3;
-+    public static final int PictStandardA1 = 4;
-+
-+  /**
-+   * Maps the specified affineTransformOp to the corresponding XRender
-+   * image filter.
-+   */
-+    public static int ATransOpToXRQuality(int affineTranformOp) {
- 	
--	/*Interpolation qualities*/
--	public static final int FAST = 0;
--	public static final int GOOD = 1;
--	public static final int BEST = 2;
--	
--	/*PictFormats*/
--	public static final int PictStandardARGB32 = 0;
--	public static final int PictStandardRGB24 = 1;
--	public static final int PictStandardA8 = 2;
--	public static final int PictStandardA4 = 3;
--	public static final int PictStandardA1 = 4;
--	
--	public static int ATransOpToXRQuality(int affineTranformOp)
--	{
--		switch(affineTranformOp)
--		{
--			case AffineTransformOp.TYPE_NEAREST_NEIGHBOR:
--				return FAST;
--				
--			case AffineTransformOp.TYPE_BILINEAR:
--				return GOOD;
--				
--			case AffineTransformOp.TYPE_BICUBIC:
--				return BEST;
--		}
--		
--		return -1;
--	}
--	
--	public static int getPictureFormatForTransparency(int transparency)
--	{ 
--		switch(transparency)
--		{
--			case Transparency.OPAQUE:
--				return PictStandardRGB24;
--				
--			case Transparency.BITMASK:
--			case Transparency.TRANSLUCENT:
--				return PictStandardARGB32;
--		}
--		
--		return -1;
-+	switch (affineTranformOp) {
-+	case AffineTransformOp.TYPE_NEAREST_NEIGHBOR:
-+	    return FAST;
-+
-+	case AffineTransformOp.TYPE_BILINEAR:
-+	    return GOOD;
-+
-+	case AffineTransformOp.TYPE_BICUBIC:
-+	    return BEST;
- 	}
- 
--	public static int getRepeatForCycleMethod(CycleMethod cycleMethod)
--	{
--		if (cycleMethod.equals(CycleMethod.NO_CYCLE))
--		{
--			return RepeatPad;
--		} else if (cycleMethod.equals(CycleMethod.REFLECT))
--		{
--			return RepeatReflect;
--		} else if (cycleMethod.equals(CycleMethod.REPEAT))
--		{
--			return RepeatNormal;
--		}
-+	return -1;
-+    }
- 
--		return RepeatNone;
-+    /**
-+     * Returns the XRender picture Format which is 
-+     * required to fullfill the Java2D transparency requirement.
-+     */
-+    public static int getPictureFormatForTransparency(int transparency) {
-+	switch (transparency) {
-+	case Transparency.OPAQUE:
-+	    return PictStandardRGB24;
-+
-+	case Transparency.BITMASK:
-+	case Transparency.TRANSLUCENT:
-+	    return PictStandardARGB32;
- 	}
- 
--	public static int XDoubleToFixed(double dbl)
--	{
--		return (int) (dbl * 65536);
-+	return -1;
-+    }
-+
-+    /**
-+     * Maps the Java2D CycleMethod to XRender's Repeat properties.
-+     */
-+    public static int getRepeatForCycleMethod(CycleMethod cycleMethod) {
-+	if (cycleMethod.equals(CycleMethod.NO_CYCLE)) {
-+	    return RepeatPad;
-+	} else if (cycleMethod.equals(CycleMethod.REFLECT)) {
-+	    return RepeatReflect;
-+	} else if (cycleMethod.equals(CycleMethod.REPEAT)) {
-+	    return RepeatNormal;
- 	}
- 
--	public static int j2dAlphaCompToXR(int j2dRule)
--	{
--		switch (j2dRule)
--		{
--			case CLEAR:
--				return PictOpClear;
-+	return RepeatNone;
-+    }
- 
--			case SRC:
--				//return PictOpOver;
--				return PictOpSrc;
-+    /**
-+     * Converts a double into an XFixed.
-+     */
-+    public static int XDoubleToFixed(double dbl) {
-+	return (int) (dbl * 65536);
-+    }
- 
--			case DST:
--				return PictOpDst;
-+    /**
-+     * Maps the specified Java2D composition rule, 
-+     * to the corresponding XRender composition rule.
-+     */
-+    public static int j2dAlphaCompToXR(int j2dRule) {
-+	switch (j2dRule) {
-+	case CLEAR:
-+	    return PictOpClear;
- 
--			case SRC_OVER:
--				return PictOpOver;
-+	case SRC:
-+	    return PictOpSrc;
- 
--			case DST_OVER:
--				return PictOpOverReverse;
-+	case DST:
-+	    return PictOpDst;
- 
--			case SRC_IN:
--				return PictOpIn;
-+	case SRC_OVER:
-+	    return PictOpOver;
- 
--			case DST_IN:
--				return PictOpInReverse;
-+	case DST_OVER:
-+	    return PictOpOverReverse;
- 
--			case SRC_OUT:
--				return PictOpOut;
-+	case SRC_IN:
-+	    return PictOpIn;
- 
--			case DST_OUT:
--				return PictOpOutReverse;
-+	case DST_IN:
-+	    return PictOpInReverse;
- 
--			case SRC_ATOP:
--				return PictOpAtop;
-+	case SRC_OUT:
-+	    return PictOpOut;
- 
--			case DST_ATOP:
--				return PictOpAtopReverse;
-+	case DST_OUT:
-+	    return PictOpOutReverse;
- 
--			case XOR:
--				return PictOpXor;
--		}
-+	case SRC_ATOP:
-+	    return PictOpAtop;
- 
--		throw new InternalError("No XRender equivalent available for requested java2d composition rule");
-+	case DST_ATOP:
-+	    return PictOpAtopReverse;
-+
-+	case XOR:
-+	    return PictOpXor;
- 	}
-+
-+	throw new InternalError("No XRender equivalent available for requested java2d composition rule");
-+    }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java	2009-01-18 01:47:11.000000000 +0000
-@@ -35,13 +35,7 @@
- import sun.java2d.SurfaceData;
- 
- /**
-- * X11 platform implementation of the VolatileSurfaceManager class.
-- * The class attempts to create and use a pixmap-based SurfaceData
-- * object (X11PixmapSurfaceData).
-- * If this object cannot be created or re-created as necessary, the
-- * class falls back to a system memory based SurfaceData object
-- * (BufImgSurfaceData) that will be used until the accelerated
-- * SurfaceData can be restored.
-+ * XRender platform implementation of the VolatileSurfaceManager class.
-  */
- public class XRVolatileSurfaceManager extends VolatileSurfaceManager {
- 
-@@ -80,13 +74,12 @@
-         return sData;
-     }
- 
-+   /**
-+    * XRender should allow copies between different formats and depths.
-+    * TODO: verify that this assumption is correct.
-+    */
-     protected boolean isConfigValid(GraphicsConfiguration gc) {
--        // REMIND: we might be too paranoid here, requiring that
--        // the GC be exactly the same as the original one.  The
--        // real answer is one that guarantees that pixmap copies
--        // will be correct (which requires like bit depths and
--        // formats).
--        return ((gc == null) || (gc == vImg.getGraphicsConfig()));
-+    	return true;
-     }
- 
-     /**
-@@ -96,10 +89,8 @@
-     @Override
-     public ImageCapabilities getCapabilities(GraphicsConfiguration gc) {
-         if (isConfigValid(gc) && isAccelerationEnabled()) {
--            // accelerated but not volatile
-             return new ImageCapabilities(true);
-         }
--        // neither accelerated nor volatile
-         return new ImageCapabilities(false);
-     }
- }
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.c	2009-01-18 01:47:11.000000000 +0000
-@@ -2,9 +2,7 @@
- #include <string.h>
- #include "ArrayList.h"
- 
--void initXRList(XrArrayList *list, jint capacity, size_t blkSize)
--{
--  //printf("Init XR LIst!\n");fflush(stdout);
-+void initXRList(XrArrayList *list, jint capacity, size_t blkSize) {
-   list->used = 0;
-   list->capacity = capacity;
- 
-@@ -15,10 +13,8 @@
-   }
- }
- 
--void* getNewXR(XrArrayList *list, size_t blkSize)
--{
--  if((list->used+1) >= list->capacity)
--  {
-+void* getNewXR(XrArrayList *list, size_t blkSize) {
-+  if((list->used+1) >= list->capacity) {
-     int newCapacity = list->capacity*2 + 10;
-     if(list->capacity > 0) {
-       list->elements = realloc(list->elements, newCapacity * blkSize);
-@@ -31,9 +27,7 @@
-   return list->elements + (list->used++ * blkSize);
- }
- 
--void clearXRList(XrArrayList *list)
--{
-+void clearXRList(XrArrayList *list) {
-   list->used = 0;
--  //memset(list->elements, 0, list->used);
- }
- 
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/ArrayList.h	2009-01-18 01:47:11.000000000 +0000
-@@ -1,3 +1,8 @@
-+/* Utility functions, providing some kind of growable array
-+ * with the restriction that elements can only be added 
-+ * at the end of the list 
-+ */
-+
- #ifndef ArrayList_h_Included
- #define ArrayList_h_Included
- 
-@@ -9,10 +14,14 @@
-    jint used;
- } XrArrayList;
- 
-+/* Initializes the list data strutures */
- void initXRList(XrArrayList *list, jint capacity, size_t blkSize);
- 
-+/* Returns a pointer to a blksize large memory area, 
-+   enlarging the underlaying array on demand */
- void* getNewXR(XrArrayList *list, size_t blkSize);
- 
-+/* Clears the list content */
- void clearXRList(XrArrayList *list);
- 
- #endif /* ArrayList_h_Included */
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	2009-01-18 01:47:11.000000000 +0000
-@@ -1,12 +1,13 @@
- #include "MaskBuffer.h"
- #include "XRSurfaceData.h"
- #include "X11SurfaceData.h"
-+#include "Trace.h"
-+#include "awt_GraphicsEnv.h"
- 
- #define MAX(a,b) ((a) > (b) ? (a) : (b))
- #define MIN(a,b) ((a) < (b) ? (a) : (b))
- 
--#define GET_DIRTY_LINE_REGION(X1, Y1, X2, Y2, RX1, RY1, RX2, RY2)        \
--  {                                                                      \
-+#define GET_DIRTY_LINE_REGION(X1, Y1, X2, Y2, RX1, RY1, RX2, RY2)  {     \
-     if(X1 < X2) {                                                        \
-       RX1 = X1;                                                          \
-       RX2 = X2;                                                          \
-@@ -25,8 +26,8 @@
-   }
- 
- #ifndef HEADLESS
--MaskBuffer* initMaskBuffer(Window window)
--{
-+
-+MaskBuffer* initMaskBuffer(Window window) {
-   MaskBuffer *buffer = malloc(sizeof(MaskBuffer));
-   initRegion(&buffer->region);
-  
-@@ -40,21 +41,16 @@
-   buffer->tiles = NULL;
- 
-   XRenderPictFormat *fmt = XRenderFindStandardFormat(awt_display, PictStandardA8);
--  XRenderPictFormat *fmt32 = XRenderFindStandardFormat(awt_display, PictStandardARGB32);
- 
-   buffer->maskPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 8);
-   buffer->lineMaskPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 8);
--  buffer->gradPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 32);
-  
-   XRenderPictureAttributes pict_attr;
-   buffer->maskPicture = XRenderCreatePicture(awt_display, buffer->maskPixmap, fmt, 0, &pict_attr);
-   buffer->lineMaskPicture = XRenderCreatePicture(awt_display, buffer->lineMaskPixmap, fmt, 0, &pict_attr);
--  buffer->gradPict = XRenderCreatePicture(awt_display, buffer->gradPixmap, fmt32, 0, &pict_attr);
- 
--  XRenderColor color_black={.red=0, .green=0, .blue=0, .alpha=0xffff};
-   XRenderFillRectangle (awt_display, PictOpClear, buffer->maskPicture, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
-   XRenderFillRectangle (awt_display, PictOpClear, buffer->lineMaskPicture, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
--  XRenderFillRectangle (awt_display, PictOpClear, buffer->gradPict, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
- 
-   buffer->validatedGCAlpha = 1.0f;
-   XGCValues values;
-@@ -63,16 +59,21 @@
-   /*Invisible GC for readback assistance*/
-   values.foreground = 0;
-   buffer->clearLineGC = XCreateGC(awt_display, buffer->lineMaskPixmap, GCForeground, &values);
-+  buffer->maskGC = XCreateGC(awt_display, buffer->maskPixmap, 0, &values);
-+ 
-+  buffer->alphaData = malloc(32*32);
-+  buffer->alphaImg = XCreateImage(awt_display, &buffer->maskPixmap, 8, ZPixmap, 0, (char *) buffer->alphaData, 32, 32, 8, 0);
-+  buffer->aImgWidth = 32;
-+  buffer->aImgHeight = 32;
- 
-   return buffer;
- }
- 
--static void allocTileBuffer(MaskBuffer* buf)
--{
-+static void allocTileBuffer(MaskBuffer* buf) {
-   buf->xTiles = ((buf->region.x2 - buf->region.x) / MASK_TILE_SIZE) + 1;
-   buf->yTiles = ((buf->region.y2 - buf->region.y) / MASK_TILE_SIZE) + 1;
- 
--  //If current tile-array is too small, allocate a larger one
-+  /* If current tile-array is too small, allocate a larger one */
-   if(buf->tiles == NULL || buf->xTileCap < buf->xTiles || buf->yTileCap < buf->yTiles) {
-     buf->xTileCap = MAX((buf->xTiles * 2), buf->xTileCap);
-     buf->yTileCap = MAX((buf->yTiles * 2), buf->yTileCap);
-@@ -82,7 +83,7 @@
-     buf->tiles = calloc(buf->xTileCap * buf->yTileCap, sizeof(XrTile));
-   }
- 
--  //Init/Reset the tiles that will be used later
-+  /* Init/Reset the tiles that will be used later */
-   int x,y;
-   for(y=0; y < buf->yTiles; y++) {
-     for(x=0; x < buf->xTiles; x++) {
-@@ -91,30 +92,22 @@
-  }
- }
- 
--static void cleanMaskBuffer(MaskBuffer *buf)
--{
--  initRegion(&buf->region); //TODO: eigentlich nicht noetig
-+static void cleanMaskBuffer(MaskBuffer *buf) {
-+  initRegion(&buf->region);
-   buf->xTiles = 0;
-   buf->yTiles = 0;
-   clearXRList(&buf->rects);
-   clearXRList(&buf->lines);
- }
- 
--static void getTileDirtyArea(MaskRegion *dirtyRectArea, MaskRegion *dirtyLineArea, MaskRegion *totalDirtyArea)
--{
-+static void getTileDirtyArea(MaskRegion *dirtyRectArea, MaskRegion *dirtyLineArea, MaskRegion *totalDirtyArea) {
-   totalDirtyArea->x = MIN(dirtyRectArea->x, dirtyLineArea->x);
-   totalDirtyArea->y = MIN(dirtyRectArea->y, dirtyLineArea->y);
-   totalDirtyArea->x2 = MAX(dirtyRectArea->x2, dirtyLineArea->x2);
-   totalDirtyArea->y2 = MAX(dirtyRectArea->y2, dirtyLineArea->y2);
- }
- 
--/**
--* Grows the dirty region of the tile.
--* This allows to log which areas of the mask are used, and only do Composition
--* with the parts that are really occupied.
--*/
--static void growDirtyRegion(MaskRegion *region, jint x, jint y, jint x2, jint y2)
--{
-+static void growDirtyRegion(MaskRegion *region, jint x, jint y, jint x2, jint y2) {
-   if(x < region->x){
-     region->x = x;
-   }
-@@ -129,8 +122,7 @@
-   }
- }
- 
--static void growDirtyRegionTileLimit(MaskRegion *region, jint x, jint y, jint x2, jint y2)
--{
-+static void growDirtyRegionTileLimit(MaskRegion *region, jint x, jint y, jint x2, jint y2) {
-   if(x < region->x){
-     region->x = MAX(x, 0);
-   }
-@@ -149,8 +141,7 @@
- * Limits the rect's coordinates to the mask coordinates.
- * The result is used by growDirtyRegion.
- */
--static void limitRetcCoords(XRectangle *rect) 
--{
-+static void limitRetcCoords(XRectangle *rect)  {
-    if((rect->x + rect->width) > MASK_TILE_SIZE) {
-       rect->width = MASK_TILE_SIZE - rect->x;
-    }
-@@ -168,16 +159,14 @@
-   }
- }
- 
--static void initRegion(MaskRegion *region)
--{
--  region->x = 99999;
-+static void initRegion(MaskRegion *region) {
-+  region->x = 99999; /*TODO: Integer max/min*/
-   region->y = 99999;
-   region->x2 = -99999;
-   region->y2 = -99999;
- }
- 
--void addRect(MaskBuffer* buf, short x, short y, unsigned short w, unsigned short h)
--{
-+void addRect(MaskBuffer* buf, short x, short y, unsigned short w, unsigned short h) {
-   XRectangle *rect = (XRectangle*) getNewXR(&buf->rects, sizeof(XRectangle));
-   rect->x = x;
-   rect->y = y;
-@@ -187,51 +176,40 @@
-   growDirtyRegion(&buf->region, x, y, x+w, y+h);
- }
- 
--void addLine(MaskBuffer* buf, int x1, int y1, int x2, int y2)
--{
--  /* EXA tries to accalerate lines which can be rendered with a single fillRect.
--   * Unfourtunatly EXA is a bit dumb because our image is held in sysmem all the time anyway.
--   * So although it would be pretty cheap in sysmem, it migrates the mask to vram just to do a single accalerated fillRect.
--   * This should really be fixed in EXA, I hope I get it done sometimes.
--   *
--   * We seperate rect/line rendering to not cause exzessive migration, therefor we simple add that "line" to our rects.
--   */
-+void addLine(MaskBuffer* buf, int x1, int y1, int x2, int y2) {
-+  /* EXA is not able to accalerate diagonal lines, 
-+     we try to "guide" it a bit to avoid excessive migration
-+     See project documentation for an detailed explanation */
- 
-   int minX, minY, maxX, maxY;
--  GET_DIRTY_LINE_REGION(x1, y1, x2, y2, minX, minY, maxX, maxY); 
-+  GET_DIRTY_LINE_REGION(x1, y1, x2, y2, minX, minY, maxX, maxY);
-   int xDiff = maxX - minX;
-   int yDiff = maxY - minY;
- 
--   if(xDiff == 0 || yDiff == 0)
--   {
-+  if(xDiff == 0 || yDiff == 0) {
-      addRect(buf, minX, minY, maxX - minX + 1, maxY - minY + 1);
--   }else
--   if(xDiff == 1 && yDiff == 1)
--   {
-+  } else if(xDiff == 1 && yDiff == 1) {
-      addRect(buf, x1, y1, 1, 1);
-      addRect(buf, x2, y2, 1, 1);
--   } else 
--   {
-+  } else {
-      XSegment *line = (XSegment*) getNewXR(&buf->lines, sizeof(XSegment));
-      line->x1 = x1;
-      line->y1 = y1;
-      line->x2 = x2;
-      line->y2 = y2;
-- 
-+
-      growDirtyRegion(&buf->region, minX, minY, maxX + 1, maxY + 1);
-   }
- }
- 
--static void initXrTile(XrTile *tile)
--{
-+static void initXrTile(XrTile *tile) {
-   initRegion(&tile->dirtyLineArea);
-   initRegion(&tile->dirtyRectArea);
-   clearXRList(&tile->rects);
-   clearXRList(&tile->lines);
- }
- 
--static void storeLinesInTiles(MaskBuffer *buf)
--{
-+static void storeLinesInTiles(MaskBuffer *buf) {
-   int i,n,m;
- 
-   for(i=0; i < buf->lines.used; i++) {
-@@ -242,8 +220,8 @@
-      line->x2 -= buf->region.x;
-      line->y2 -= buf->region.y;
- 
--    int minX, minY, maxX, maxY;
--    GET_DIRTY_LINE_REGION(line->x1, line->y1, line->x2, line->y2, minX, minY, maxX, maxY);
-+     int minX, minY, maxX, maxY;
-+     GET_DIRTY_LINE_REGION(line->x1, line->y1, line->x2, line->y2, minX, minY, maxX, maxY);
- 
-      int tileXStartIndex = minX / MASK_TILE_SIZE;
-      int tileYStartIndex = minY / MASK_TILE_SIZE;
-@@ -277,8 +255,7 @@
-   }
- }
- 
--static void storeRectsInTiles(MaskBuffer *buf)
--{
-+static void storeRectsInTiles(MaskBuffer *buf) {
-   int i,n,m;
- 
-   for(i=0; i < buf->rects.used; i++) {
-@@ -296,7 +273,7 @@
-         for(m=0; m < tileXLenght; m++) {
-           int tileIndex = (buf->xTileCap * (tileYStartIndex + n)) + tileXStartIndex + m;
-           assert(tileIndex >= 0 && tileIndex < (buf->xTileCap*buf->yTileCap));
--          //printf("Index: %d - tileX:%d, tileY:%d, tilesx:%d, tilesy:%d, capx:%d capy:%d\n",tileIndex,  (m + tileXLenght), (n + tileYStartIndex), buf->xTiles, buf->yTiles, buf->xTileCap, buf->yTileCap);fflush(stdout);
-+
-           XrTile *tile = &buf->tiles[tileIndex];
-           XRectangle *tileRect = (XRectangle*) getNewXR(&tile->rects, sizeof(XRectangle));
- 
-@@ -315,8 +292,7 @@
-   }
- }
- 
--static void translateRects(XrArrayList *rectList, int x, int y)
--{
-+static void translateRects(XrArrayList *rectList, int x, int y) {
-   int i;
-   for(i = 0; i < rectList->used; i++) {
-       XRectangle *rect = ((XRectangle *) rectList->elements) + i;
-@@ -325,20 +301,18 @@
-    }
- }
- 
--void fillMask(MaskBuffer* buf, Picture dest)
--{
--  XRenderColor color_black={.red=0, .green=0, .blue=0, .alpha=0xffff};
-+void fillMask(MaskBuffer* buf, Picture dest) {
-   int i, m, n;
- 
-   jboolean maskRequired = (xrSrcData.src != xrSrcData.solid) || (xrSrcData.solidColor.alpha != 0xffff) || (xrSrcData.extraAlpha != 1.0f);
--  /*Extra Alpha is already storen in solid-colo*/
--  jdouble maskAlpha = (xrSrcData.src == xrSrcData.solid) ? 1.0f : xrSrcData.extraAlpha;
-+  /*Extra Alpha is already stored in solid-color*/
-+  jdouble maskAlpha = (xrSrcData.src != xrSrcData.texture) ? 1.0f : xrSrcData.extraAlpha;
- 
-   unsigned short alphaValueFixed = XDoubleToUShort(maskAlpha);
-   XRenderColor maskColor;
-   maskColor.alpha = alphaValueFixed;
- 
--  /* If we don't have to use a mask and there are no lines, 
-+  /* If we don't have to use a mask and there are no lines,
-    * we can draw the rects directly and omit tile partitioning */
-   if(maskRequired || buf->lines.used > 0) {
-   allocTileBuffer(buf);
-@@ -369,9 +343,10 @@
-           width = MIN(width, MASK_TILE_SIZE);
-           height = MIN(height, MASK_TILE_SIZE);
- 
--	  if(maskRequired || lineList->used  > 0) /*Again, only composite _current_tile_ if required, otherwise just fill rects*/
--          {
-+          /*Again, only composite the current tile if required, otherwise just fill rects*/
-+	  if(maskRequired || lineList->used  > 0) {
-             Picture mask = None;
-+
-             if(lineList->used != 0) {
-               XDrawSegments(awt_display, buf->lineMaskPixmap, buf->drawLineGC, (XSegment *) lineList->elements, lineList->used);
-               mask = buf->lineMaskPicture;
-@@ -386,16 +361,17 @@
- 
-              XRComposite(mask, dest, x, y, tileDirtyArea.x, tileDirtyArea.y, x, y, width, height);
- 
--             /*Clear dirty rectangle of the rect-mask*/
-+             /* Clear dirty rectangle of the rect-mask */
-              XRenderFillRectangle (awt_display, PictOpClear, buf->maskPicture, &color_black, tileDirtyArea.x, tileDirtyArea.y, width, height);
- 
-+             /* Clear diagonal lines with lines again,
-+                to avoid the sysmem copy marked "dirty" causing migration for the next lines*/
-              if(lineList->used != 0) {
-                XDrawSegments(awt_display, buf->lineMaskPixmap, buf->clearLineGC, (XSegment *) lineList->elements, lineList->used);
-                clearXRList(lineList);
- 	     }
-           }else
--          if(rectList->used != 0)
--          {
-+          if(rectList->used != 0) {
-              translateRects(rectList, (tileStartX + buf->region.x), (tileStartY + buf->region.y));
-              XRenderFillRectangles (awt_display, xrSrcData.compRule, dest, &xrSrcData.solidColor, (XRectangle*) rectList->elements, rectList->used);
-              clearXRList(rectList);
-@@ -403,8 +379,7 @@
-         }
-       }
-      }
-- } else 
-- {
-+  } else {
-    XRenderFillRectangles (awt_display, xrSrcData.compRule, dest, &xrSrcData.solidColor, (XRectangle*) buf->rects.elements, buf->rects.used);
-  }
- 
-@@ -412,165 +387,3 @@
- }
- 
- #endif
--
--
--	   /*printf("Composition: x:%d y:%d width:%d height:%d, dx:%d, dy:%d\n", x, y, width, height, tileDirtyArea.x, tileDirtyArea.y);
--           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, 0, 0, MASK_TILE_SIZE, 1);
--           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, 0, MASK_TILE_SIZE-1, MASK_TILE_SIZE, 1);
--           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, 0, 0, 1, MASK_TILE_SIZE);
--           XRenderFillRectangle (awt_display, PictOpSrc, buf->maskPicture, &color_black, MASK_TILE_SIZE-1, 0, 1, MASK_TILE_SIZE);*/
--
--
--
--           /* if(xrSrcData.src == xrSrcData.gradient)
--             { 
--               XRenderComposite (awt_display, PictOpSrc, xrSrcData.gradient, None, buf->gradPict, x, y, 0, 0, 0, 0, width, height);
--               XRenderComposite (awt_display, xrSrcData.compRule, buf->gradPict, mask, dest, 0, 0, tileDirtyArea.x, tileDirtyArea.y, x, y, width, height);
--             }else 
--             {
--               XRenderComposite (awt_display, xrSrcData.compRule, xrSrcData.src, mask, dest, x, y, tileDirtyArea.x, tileDirtyArea.y, x, y, width, height);
--             }*/
--
--/*
--void addTrap(MaskBuffer* buf, XTrapezoid *xt)
--{
--  XTrapezoid *trap = (XTrapezoid*) getNewXR(&buf->traps, sizeof(XTrapezoid));
--  memcpy(trap, xt, sizeof(XTrapezoid));
--
--  int leftMin = XFixedToDouble(MIN(trap->left.p1.x, trap->left.p2.x)) - 1;
--  int rightMax = XFixedToDouble(MAX(trap->right.p2.x, trap->right.p1.x)) + 1;
--  int top = XFixedToDouble(trap->top) - 1;
--  int bottom = XFixedToDouble(trap->bottom) + 1;
--
--  growDirtyRegion(&buf->region, leftMin, top, rightMax, bottom);
--}
--*/
--
--/*void translateTrap(XTrapezoid *trap, int x, int y)
--{
--   XFixed xTrans = XDoubleToFixed(x);     
--   XFixed yTrans = XDoubleToFixed(y);
--
--   trap->left.p1.x  += xTrans;
--   trap->left.p2.x  += xTrans;
--   trap->right.p1.x += xTrans;    
--   trap->right.p2.x += xTrans;
--   trap->left.p1.y  += yTrans;
--   trap->left.p2.y  += yTrans;
--   trap->right.p1.y += yTrans;
--   trap->right.p2.y += yTrans;
--   trap->top += yTrans;
--   trap->bottom += yTrans;
--}*/
--
--/*
--void storeTrapsInTiles(MaskBuffer *buf)
--{
--  int i,n,m;
--
--  for(i=0; i < buf->traps.used; i++) {
--     XTrapezoid *trap = ((XTrapezoid*) buf->traps.elements) + i;
--     translateTrap(trap, -buf->region.x, -buf->region.y);
--
--     int leftMin = XFixedToDouble(MIN(trap->left.p1.x, trap->left.p2.x));
--     int rightMax = XFixedToDouble(MAX(trap->right.p2.x, trap->right.p1.x));
--     int top = XFixedToDouble(trap->top) - 1;
--     int bottom = XFixedToDouble(trap->bottom) + 1;
--
--     int tileXStartIndex = leftMin / MASK_TILE_SIZE;
--     int tileYStartIndex = top / MASK_TILE_SIZE;
--     int tileXLenght = ((rightMax / MASK_TILE_SIZE) + 1) - tileXStartIndex;
--     int tileYLenght = ((bottom / MASK_TILE_SIZE) + 1) - tileYStartIndex;
--
--      for(n=0; n < tileYLenght; n++) {
--        for(m=0; m < tileXLenght; m++) {
--          int tileIndex = (buf->xTileCap * (tileYStartIndex + n)) + tileXStartIndex + m;
--          assert(tileIndex >= 0);
--          XrTile *tile = &buf->tiles[tileIndex];
--
--          XTrapezoid *tileTrap = (XTrapezoid*) getNewXR(&tile->traps, sizeof(XTrapezoid));
--          memcpy(tileTrap, trap, sizeof(XTrapezoid));
--
--          int tileStartPosX = (tileXStartIndex + m) * MASK_TILE_SIZE;
--          int tileStartPosY = (tileYStartIndex + n) * MASK_TILE_SIZE;
--          translateTrap(tileTrap, -tileStartPosX, -tileStartPosY);
--
--          leftMin = XFixedToDouble(MIN(tileTrap->left.p1.x, tileTrap->left.p2.x)) - 1;
--          rightMax = XFixedToDouble(MAX(tileTrap->right.p2.x, tileTrap->right.p1.x)) + 1;
--          top = XFixedToDouble(tileTrap->top) - 1;
--          bottom = XFixedToDouble(tileTrap->bottom) + 1;
--
--         // limitRetcCoords(tileRect);
--          //TODO: Better dirty array handling
--          growDirtyRegionTileLimit(&tile->dirtyArea, leftMin, top, rightMax, bottom);
--        }
--      }
--  }
--}*/
--
--//   XrArrayList tileRectList;
--//   initXRList(&tileRectList, sizeof(XRectangle), 64); //Todo memory leak!
--// 
--//   int i, tileStartX, tileStartY;
--//   MaskRegion ditryRegion;
--// 
--//   for(tileStartX = buf->region.x; tileStartX <= buf->region.x2; tileStartX += MASK_TILE_SIZE) {
--//    int tileEndX = tileStartX + MASK_TILE_SIZE;
--// 
--//     for(tileStartY = buf->region.y; tileStartY <= buf->region.y2; tileStartY += MASK_TILE_SIZE) {
--//       int tileEndY = tileStartY + MASK_TILE_SIZE;
--//       initRegion(&ditryRegion);
--// 
--//       for(i=0; i < buf->rects.used; i++) {
--//         XRectangle *rect = ((XRectangle*) buf->rects.elements) + i;
--// 
--//         if((rect->x <= tileEndX) && ((rect->x + rect->width) > tileStartX) &&
--//            (rect->y <= tileEndY) && ((rect->y + rect->height) > tileStartY)) {
--// 	  XRectangle *ptr = (XRectangle *) getNewXR(&tileRectList);
--//           ptr->x = rect->x - tileStartX; /*Translate coordinates relative to the mask-location*/
--//           ptr->y = rect->y - tileStartY;
--//           ptr->width = rect->width;
--//           ptr->height = rect->height;
--// 
--//           limitRetcCoords(ptr);
--//           growDirtyRegion(&ditryRegion, ptr->x, ptr->y, ptr->x + ptr->width, ptr->y + ptr->height);
--//         }
--//       }
--// 
--//         if(tileRectList.used > 0) { 
--//            XRenderFillRectangles (display, PictOpSrc, mask, alphaColor, (XRectangle*) tileRectList.elements, tileRectList.used);
--//            clearXRList(&tileRectList);
--// 
--//            int x = ditryRegion.x + tileStartX;
--//            int y = ditryRegion.y + tileStartY;
--//            int width = ditryRegion.x2 - ditryRegion.x;
--//            int height = ditryRegion.y2 - ditryRegion.y;
--// 
--//            XRenderComposite (display, PictOpOver, src, mask, dest, x, y, ditryRegion.x, ditryRegion.y, x, y, width, height);
--//            XRenderFillRectangle (display, PictOpClear, mask, alphaColor, ditryRegion.x, ditryRegion.y, width, height);
--//         }
--//     } 
--//   }
--
--
--/*
--          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, MASK_TILE_SIZE, 1);
--          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, MASK_TILE_SIZE-1, MASK_TILE_SIZE, 1);
--          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, 1, MASK_TILE_SIZE);
--          XRenderFillRectangle (display, PictOpSrc, mask, &color_black, MASK_TILE_SIZE-1, 0, 1, MASK_TILE_SIZE);
--*/
--
--//         int z;
--//         for(z=0; z < tileRectList.used; z++)
--//  {
--//      XRectangle *rect = ((XRectangle*) tileRectList.elements) + z;
--//      printf("Rechteck %d - %d %d %d %d %d\n", z, rect->x, rect->y, rect->width, rect->height, tileRectList.used);
--// }
--
--//printf("Composition rect: %d %d %d %d\n", x, y, ditryRegion.x2 - ditryRegion.x, ditryRegion.y2 - ditryRegion.y);fflush(stdout);
--          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, MASK_TILE_SIZE, 1);
--          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, MASK_TILE_SIZE-1, MASK_TILE_SIZE, 1);
--          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, 0, 0, 1, MASK_TILE_SIZE);
--          //XRenderFillRectangle (display, PictOpSrc, mask, &color_black, MASK_TILE_SIZE-1, 0, 1, MASK_TILE_SIZE);
--
--// printf("Rendering region: %d %d %d %d\n", buf->region.x, buf->region.y, buf->region.x2 - buf->region.x, buf->region.y2 - buf->region.y);fflush(stdout);
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h	2009-01-18 01:47:11.000000000 +0000
-@@ -1,3 +1,11 @@
-+/* MaskBuffer buffers geometry (for now only lines and rects),
-+ * renders those primitives into a mask in one go and composites
-+ * using the mask as geometry-buffer.
-+ * The advantage is that rendering rects can be done quite efficiently,
-+ * but composition scanline-by-scanline is very slow.
-+ * Please see the project-page for an in-depth explanation of MaskBuffer.
-+ */
-+
- #ifndef MaskBuffer_h_Included
- #define MaskBuffer_h_Included
- 
-@@ -10,6 +18,8 @@
- #include <X11/extensions/Xrender.h>
- #include <assert.h>
- 
-+/* To not alloc/dealloc the mask pixmap tiling is used.
-+   This specifies the size of the alpha-tile.        */
- #define MASK_TILE_SIZE 256
- 
- typedef struct {
-@@ -19,6 +29,7 @@
-   jint y2;
- }MaskRegion;
- 
-+/*Holds information which belongs to a single tile*/
- typedef struct {
-   XrArrayList rects;
-   XrArrayList lines;
-@@ -27,6 +38,8 @@
-   MaskRegion dirtyLineArea;
- } XrTile;
- 
-+/* The MaskBuffer data-structure itself is shared in the application
-+   and contains pixmaps for gradient-caching and MaskFill/MaskBlit */
- typedef struct {
-   Pixmap lineMaskPixmap;
-   Picture lineMaskPicture;
-@@ -35,6 +48,7 @@
- 
-   Pixmap maskPixmap;
-   Picture maskPicture;
-+  GC maskGC;
-   jfloat validatedGCAlpha;
- 
-   XrArrayList rects;
-@@ -47,34 +61,59 @@
-   int yTileCap;
-   XrTile *tiles;
- 
--  Pixmap gradPixmap;
--  Picture gradPict;
-+  XImage *alphaImg;
-+  unsigned char* alphaData;
-+  jint aImgWidth;
-+  jint aImgHeight;
- }MaskBuffer;
- 
-+/* Initializes the MaskBuffer data structure*/
- MaskBuffer* initMaskBuffer(Window window);
- 
-+/* Adds a rect which will be filled to the geometry-buffer*/ 
- void addRect(MaskBuffer* buf, short x, short y, unsigned short w, unsigned short h);
- 
-+/* Adds a line to the geometry-buffer*/
- void addLine(MaskBuffer* buf, int x1, int y1, int x2, int y2);
- 
-+/* Composites using the stored geometry as mask, using properties stored in SrcSurfaceData*/
- void fillMask(MaskBuffer* buf, Picture dest);
- 
-+/* Builds a 2D array of tiles and adds the rects buffered by addRect,
-+   to the tiles which are affacted. */
- static void storeRectsInTiles(MaskBuffer *buf);
- 
-+/* Builds a 2D array of tiles and adds the lines stored by addLine 
-+ * to the tiles which are affacted*/
-+static void storeLinesInTiles(MaskBuffer *buf);
-+
-+/* Re-sets the MaskBuffer to an empty state */
- static void cleanMaskBuffer(MaskBuffer *buf);
- 
-+/* Shrinks the rectangle's coordinates if in the middle of two tiles*/
- static void limitRetcCoords(XRectangle *rect);
- 
-+/* Re-Sets the values of a MaskRegion */
- static void initRegion(MaskRegion *region);
- 
-+/* If parameters are outside the bounds of the MaskRegion, the MaskRegion will be enlarged */
- static void growDirtyRegion(MaskRegion *region, jint x, jint y, jint x2, jint y2);
- 
-+/* If parameters are outside the bounds of the MaskRegion, the MaskRegion will be enlarged, 
-+   but is limited to the size of a single tile */
- static void growDirtyRegionTileLimit(MaskRegion *region, jint x, jint y, jint x2, jint y2);
- 
-+/* Re-Sets a tile data-structure*/
- static void initXrTile(XrTile *tile);
- 
-+/* Returns the total dirty size of both, the rect and the line tile combined */
- static void getTileDirtyArea(MaskRegion *dirtyRectArea, MaskRegion *dirtyLineArea, MaskRegion *totalDirtyArea);
- 
-+/* Translates all rects in rectList by x/y */
- static void translateRects(XrArrayList *rectList, int x, int y);
- 
-+/* Allocates and initializes the tile-datastructures nescessary
-+   to hold the geometry stored in the MaskBuffer*/
-+static void allocTileBuffer(MaskBuffer* buf);
-+
- #endif /* MaskBuffer_h_Included */
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2009-01-18 01:47:11.000000000 +0000
-@@ -97,7 +97,7 @@
- 
- #endif /* !HEADLESS */
- 
--jboolean XShared_initIDs(JNIEnv *env)
-+jboolean XShared_initIDs(JNIEnv *env, jboolean allowShmPixmaps)
- {
- #ifndef HEADLESS
-    union {
-@@ -122,14 +122,19 @@
-         getenv("NO_J2D_MITSHM") == NULL) {
-         char * force;
-         TryInitMITShm(env, &useMitShmExt, &useMitShmPixmaps);
--        useMitShmPixmaps = (useMitShmPixmaps == CAN_USE_MITSHM);
--        force = getenv("J2D_PIXMAPS");
--        if (force != NULL) {
--            if (useMitShmPixmaps && (strcmp(force, "shared") == 0)) {
--                forceSharedPixmaps = JNI_TRUE;
--            } else if (strcmp(force, "server") == 0) {
--                useMitShmPixmaps = JNI_FALSE;
--            }
-+
-+        if(allowShmPixmaps) {
-+          useMitShmPixmaps = (useMitShmPixmaps == CAN_USE_MITSHM);
-+          force = getenv("J2D_PIXMAPS");
-+          if (force != NULL) {
-+              if (useMitShmPixmaps && (strcmp(force, "shared") == 0)) {
-+                  forceSharedPixmaps = JNI_TRUE;
-+              } else if (strcmp(force, "server") == 0) {
-+                  useMitShmPixmaps = JNI_FALSE;
-+              }
-+          }
-+        }else {
-+          useMitShmPixmaps = JNI_FALSE;
-         }
-     }
- 
-@@ -150,7 +155,7 @@
-                                            jclass XORComp, jboolean tryDGA)
- {
- #ifndef HEADLESS
--  if(XShared_initIDs(env))
-+  if(XShared_initIDs(env, JNI_TRUE))
-   {
-     void *lib = 0;
- 
-@@ -189,7 +194,7 @@
-  * Signature: ()Z
-  */
- JNIEXPORT jboolean JNICALL
--Java_sun_java2d_x11_X11SurfaceData_isDrawableValid(JNIEnv *env, jobject this)
-+Java_sun_java2d_x11_XSurfaceData_isDrawableValid(JNIEnv *env, jobject this)
- {
-     jboolean ret = JNI_FALSE;
- 
-@@ -244,7 +249,7 @@
-  * Signature: (Ljava/lang/Object;I)V
-  */
- JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_initOps(JNIEnv *env, jobject xsd,
-+Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd,
-                                            jobject peer,
-                                            jobject graphicsConfig, jint depth)
- {
-@@ -328,7 +333,7 @@
-  * Signature: ()V
-  */
- JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd)
-+Java_sun_java2d_x11_XSurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd)
- {
- #ifndef HEADLESS
-     SurfaceDataOps *ops = SurfaceData_GetOps(env, xsd);
-@@ -412,7 +417,7 @@
-  * Signature: ()V
-  */
- JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_setInvalid(JNIEnv *env, jobject xsd)
-+Java_sun_java2d_x11_XSurfaceData_setInvalid(JNIEnv *env, jobject xsd)
- {
- #ifndef HEADLESS
-     X11SDOps *xsdo = (X11SDOps *) SurfaceData_GetOps(env, xsd);
-@@ -1601,7 +1606,7 @@
-  * Signature: (I)J
-  */
- JNIEXPORT jlong JNICALL
--Java_sun_java2d_x11_X11SurfaceData_XCreateGC
-+Java_sun_java2d_x11_XSurfaceData_XCreateGC
-     (JNIEnv *env, jclass xsd, jlong pXSData)
- {
-     jlong ret;
-@@ -1631,7 +1636,7 @@
-  * Signature: (JIIIILsun/java2d/pipe/Region;)V
-  */
- JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_XResetClip
-+Java_sun_java2d_x11_XSurfaceData_XResetClip
-     (JNIEnv *env, jclass xsd, jlong xgc)
- {
- #ifndef HEADLESS
-@@ -1646,7 +1651,7 @@
-  * Signature: (JIIIILsun/java2d/pipe/Region;)V
-  */
- JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_XSetClip
-+Java_sun_java2d_x11_XSurfaceData_XSetClip
-     (JNIEnv *env, jclass xsd, jlong xgc,
-      jint x1, jint y1, jint x2, jint y2,
-      jobject complexclip)
-@@ -1721,7 +1726,7 @@
-  * Signature: (JZ)V
-  */
- JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures
-+Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures
-     (JNIEnv *env, jclass xsd, jlong xgc, jboolean needExposures)
- {
- #ifndef HEADLESS
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h	2009-01-18 01:47:11.000000000 +0000
-@@ -166,17 +166,17 @@
- /*Prototypes for shared functions used by XRSurfaceData*/
- jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width, jint height, jlong drawable);
- 
--jboolean XShared_initIDs(JNIEnv *env);
-+jboolean XShared_initIDs(JNIEnv *env, jboolean allowShmPixmaps);
- 
--JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_initOps(JNIEnv *env, jobject xsd,
--                                           jobject peer,
--                                           jobject graphicsConfig, jint depth);
-+// JNIEXPORT void JNICALL
-+// Java_sun_java2d_x11_X11SurfaceData_initOps(JNIEnv *env, jobject xsd,
-+//                                            jobject peer,
-+//                                            jobject graphicsConfig, jint depth);
- 
--JNIEXPORT jlong JNICALL Java_sun_java2d_x11_X11SurfaceData_XCreateGC (JNIEnv *env, jclass xsd, jlong pXSData);
-+// JNIEXPORT jlong JNICALL Java_sun_java2d_x11_X11SurfaceData_XCreateGC (JNIEnv *env, jclass xsd, jlong pXSData);
- 
- jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo);
--
-+/*
- JNIEXPORT void JNICALL
--Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd);
-+Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd);*/
- 
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c	2009-01-18 01:47:11.000000000 +0000
-@@ -36,6 +36,7 @@
-     return cache;
- }
- 
-+
- static jboolean cleanCache(XRGlyphCacheInfo *cache)
- {
-   J2dTraceLn(J2D_TRACE_INFO, "XRGlyphCache_cleanCache");
-@@ -158,7 +159,13 @@
-      
- 
-      Glyph gid = (Glyph) cacheCell->glyphID;
--     XGlyphInfo xginfo={.x=(jginfo->topLeftX*-1),.y=(jginfo->topLeftY*-1),.width=width,.height=height, .xOff = cacheCell->xOff,.yOff = cacheCell->yOff};
-+     XGlyphInfo xginfo;
-+     xginfo.x = (jginfo->topLeftX*-1);
-+     xginfo.y = (jginfo->topLeftY*-1);
-+     xginfo.width = width;
-+     xginfo.height = height;
-+     xginfo.xOff = cacheCell->xOff;
-+     xginfo.yOff = cacheCell->yOff;
- 
-      XRenderAddGlyphs(awt_display, cache->glyphSet, &gid, &xginfo, 1, glyphBuf, bufLen);
-      
-@@ -242,25 +249,23 @@
-    return JNI_TRUE;
- }
- 
--#if 0
--void dumpCache(XRGlyphCacheInfo *cache)
--{
--  int i;
--  for(i=0; i < cache->cellCapacity; i++)
--  {
--    XRCacheCellInfo *cell = &cache->cells[i];
--    if(cell->glyphID != 0)
--    {
--      printf("Cache-Position: %d enthaelt glyph: %d mit counter:%d\n", i, cell->glyphID, cell->timesRendered);
--      fflush(stdout);
--    }
--  }
--}
--#endif
--
- #endif /*!Headless*/
- 
- 
-+// Dev-only debug and trace function.
-+// void dumpCache(XRGlyphCacheInfo *cache)
-+// {
-+//   int i;
-+//   for(i=0; i < cache->cellCapacity; i++)
-+//   {
-+//     XRCacheCellInfo *cell = &cache->cells[i];
-+//     if(cell->glyphID != 0)
-+//     {
-+//       printf("Cache-Position: %d enthaelt glyph: %d mit counter:%d\n", i, cell->glyphID, cell->timesRendered);
-+//       fflush(stdout);
-+//     }
-+//   }
-+// }
- // 	  int line_, pix_;
- // 	  for(line_ = 0; line_ < jginfo->height; line_++)
- // 	  {
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h	2009-01-18 01:47:11.000000000 +0000
-@@ -11,6 +11,7 @@
- typedef struct _XRGlyphCacheInfo XRGlyphCacheInfo;
- typedef struct _XRCacheCellInfo XRCacheCellInfo;
- 
-+/* Cell-Cache structure*/
- struct _XRGlyphCacheInfo {
-     XRCacheCellInfo *cells;
-     jint searchPosition;
-@@ -20,6 +21,10 @@
-     GlyphSet glyphSet;
- };
- 
-+/* CacheCellInfo structure, 
-+*  holds a cached GlyphInfo and
-+*  other per-glpyh information.
-+*/
- struct _XRCacheCellInfo {
-     XRGlyphCacheInfo *cacheInfo;
-     GlyphInfo *glyphInfo;
-@@ -33,9 +38,17 @@
- };
- 
- #ifndef HEADLESS
-+/*Initialized the GlyphCache structure*/
- XRGlyphCacheInfo* XRGlyphCache_Init(XRenderPictFormat* glyphSetPictFormat);
-+
-+/*Add a list of GlyphInfo's to the cache, returns false of not succeeded.*/
- jboolean XRGlyphCache_CacheGlyphs(XRGlyphCacheInfo *cache, jlong *glyphPtrs, jint glyphCount, jint *ids);
--void dumpCache(XRGlyphCacheInfo *cache);
-+
-+/* Frees entries which have not been used a lot, and enlarges cache if nescessary */
-+static jboolean cleanCache(XRGlyphCacheInfo *cache);
-+
-+/* Adds a single glyph to the cache and uploads it to the X-Server*/
-+static jboolean uploadGlyph(XRGlyphCacheInfo *cache, GlyphInfo *jginfo, XRCacheCellInfo *cacheCell);
- #endif
- 
- #endif /* XRGlyphCache_h_Included */
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	2009-01-18 01:47:11.000000000 +0000
-@@ -59,84 +59,69 @@
-         return;
-     }
- 
--#ifdef MITSHM
--    if (srcXsdo->isPixmap) {
--        X11SD_UnPuntPixmap(srcXsdo);
--    }
--#endif /* MITSHM */
--
--/*   printf("src: %d, dst: %d", srcXsdo->xrData.xrPic, dstXsdo->xrData.xrPic);
--   fflush(stdout);*/
--
--/*XTransform xf = {{{XDoubleToFixed (0.5), 0, 0 },
--{0, XDoubleToFixed (0.5), 0 },
--{XDoubleToFixed (0), XDoubleToFixed (0), XDoubleToFixed (1.0)}}};
-+    XRenderComposite (awt_display, xrSrcData.compRule, srcXsdo->xrPic, xrSrcData.alphaMask, dstXsdo->xrPic, srcx, srcy, 0, 0, dstx, dsty, width, height); 
- 
--XRenderSetPictureTransform(awt_display, dstXsdo->xrData.xrPic, &xf);
--XRenderSetPictureFilter(awt_display, dstXsdo->xrData.xrPic, "good", NULL, 0);*/
--
--   XRenderComposite (awt_display, xrSrcData.compRule, srcXsdo->xrPic, xrSrcData.alphaMask, dstXsdo->xrPic, srcx, srcy, 0, 0, dstx, dsty, width, height); 
--
--#ifdef MITSHM
--    if (srcXsdo->shmPMData.usingShmPixmap) {
--        srcXsdo->shmPMData.xRequestSent = JNI_TRUE;
--    }
--#endif /* MITSHM */
-     X11SD_DirectRenderNotify(env, dstXsdo);
- #endif /* !HEADLESS */
- }
- 
-+
- #ifndef HEADLESS
--static Picture prepareMaskPM(JNIEnv *env, X11SDOps *alphaXsdo, jbyteArray maskArray, jint maskoff, jint maskscan, jint w, jint h)
-+static Picture prepareMaskPM(JNIEnv *env, jbyteArray maskArray, jint maskoff, jint maskscan, jint w, jint h)
- {
-     int line, pix;
-     unsigned char *mask;
--    SurfaceDataOps *alphaOps = &alphaXsdo->sdOps;
- 
--    jboolean useEA = (xrSrcData.src != xrSrcData.solid && xrSrcData.extraAlpha != 1.0f);
-+    jboolean useEA = (xrSrcData.src == xrSrcData.texture && xrSrcData.extraAlpha != 1.0f);
- 
--    if (maskArray != NULL) {
--    		SurfaceDataRasInfo alphaInfo;
--    		alphaInfo.bounds.x1 = 0;
--    		alphaInfo.bounds.y1 = 0;
--    		alphaInfo.bounds.x2 = w;
--    		alphaInfo.bounds.y2 = h;
--
--		if (alphaOps->Lock(env, alphaOps, &alphaInfo, SD_LOCK_WRITE) != SD_SUCCESS) {
--			SurfaceData_InvokeUnlock(env, alphaOps, &alphaInfo);
--			return None;
--		}
--                mask = (unsigned char *) (*env)->GetPrimitiveArrayCritical(env, maskArray, NULL);
--
--		alphaOps->GetRasInfo(env, alphaOps, &alphaInfo);
--
--              if(useEA && (w > MASK_TILE_SIZE || h > MASK_TILE_SIZE))
--              {
--		for(line=0; line < h; line++) {
--		  for(pix=0; pix < w; pix++) {
--  		     ((unsigned char*)alphaInfo.rasBase)[line*alphaInfo.scanStride + pix] = (unsigned char) (mask[maskscan*line + pix + maskoff] * xrSrcData.extraAlpha);  
--		  }
--		}
--             }else
--             {
--		for(line=0; line < h; line++) {
--		  for(pix=0; pix < w; pix++) {
--  		     ((unsigned char*)alphaInfo.rasBase)[line*alphaInfo.scanStride + pix] = (unsigned char) (mask[maskscan*line + pix + maskoff]);  
--		  }
--		}
--             }
--
--                SurfaceData_InvokeRelease(env, alphaOps, &alphaInfo);
--                SurfaceData_InvokeUnlock(env, alphaOps, &alphaInfo);
--                (*env)->ReleasePrimitiveArrayCritical(env, maskArray, mask, JNI_ABORT);
--
--	if(useEA) {
--                XRenderComposite (awt_display, PictOpOver, alphaXsdo->xrPic, xrSrcData.alphaMask, maskBuffer->maskPicture, 0, 0, 0, 0, 0, 0, w, h); 
--                return maskBuffer->maskPicture;
--          }else
--          {
--             return alphaXsdo->xrPic;
-+    if(maskArray != NULL) {
-+
-+         mask = (unsigned char *) (*env)->GetPrimitiveArrayCritical(env, maskArray, NULL);
-+
-+         /* Tries to optimize Mask-Upload:  
-+          * 1. If existing XImage and supplied buffer match, only adjust the data pointer
-+          * 2. If existing XImage is large enough to hold the data put does not match in scan,
-+          *    the data is copied in way to fit the XImage.
-+          * 3. If data is larger than the existing XImage a new temporary XImage is allocated
-+          * The default XImage is optimized for the AA tiles, which are currently 32x32.
-+          */
-+          XImage *defaultImg = maskBuffer->alphaImg;
-+          XImage *img = maskBuffer->alphaImg;
-+          jboolean imageFits = defaultImg->width >= w && defaultImg->height >= h;
-+
-+          if(imageFits && maskoff == defaultImg->xoffset && maskscan == defaultImg->bytes_per_line) {
-+                defaultImg->data = mask;
-+          }else {
-+            if(imageFits) {
-+               defaultImg->data = maskBuffer->alphaData;
-+
-+               for(line=0; line < h; line++) {
-+                   for(pix=0; pix < w; pix++) {
-+                       img->data[line*img->bytes_per_line + pix] = (unsigned char) (mask[maskscan*line + pix + maskoff]);  
-+                   }
-+               }
-+
-+            }else { 
-+               /*TODO: handle case where XImage is larger than pixmap*/
-+               img = XCreateImage(awt_display, &maskBuffer->maskPixmap, 8, ZPixmap, maskoff, mask, maskscan, h, 8, 0);
-+            }
-+          }
-+
-+          XPutImage(awt_display, maskBuffer->maskPixmap, maskBuffer->maskGC, img, 0, 0, 0, 0, w, h);
-+          (*env)->ReleasePrimitiveArrayCritical(env, maskArray, mask, JNI_ABORT);
-+
-+	  if(img != defaultImg) {
-+             img->data = NULL;
-+             XDestroyImage(img);
-           }
-+
-+        /* XRender does not expose multitexturing, therefor we have to Composite with the alphaMask to get EA in*/
-+	if(useEA)  {
-+                XRenderComposite (awt_display, PictOpSrc, maskBuffer->maskPicture, xrSrcData.alphaMask, maskBuffer->lineMaskPicture, 0, 0, 0, 0, 0, 0, w, h); 
-+                return maskBuffer->lineMaskPicture;
-+	}else {
-+           return maskBuffer->maskPicture;
-+        }
-     }else
-     {
-       if(useEA) {
-@@ -147,12 +132,11 @@
-     return None;
- }
- 
--static void cleanMask(Picture mask, int w, int h)
--{
--  if(mask == maskBuffer->maskPicture)
--  {
--     XRenderColor color_black={.red=0, .green=0, .blue=0, .alpha=0xffff};
--     XRenderFillRectangle (awt_display, PictOpClear, maskBuffer->maskPicture, &color_black, 0, 0, w, h);
-+/* Clean up the area of the masks which have been used as target-pixmap for mask-upload */
-+static void cleanMask(Picture mask, int w, int h) {
-+  XRenderFillRectangle (awt_display, PictOpClear, maskBuffer->maskPicture, &color_black, 0, 0, w, h);
-+  if(mask == maskBuffer->lineMaskPicture) {
-+     XRenderFillRectangle (awt_display, PictOpClear, maskBuffer->lineMaskPicture, &color_black, 0, 0, w, h);
-   }
- }
- #endif
-@@ -160,7 +144,7 @@
- JNIEXPORT void JNICALL
- Java_sun_java2d_xr_XRMaskFill_maskFill
-      (JNIEnv *env, jobject joSelf, 
--      jlong dstData, jlong alphaData,
-+      jlong dstData,
-       jint x, jint y, jint w, jint h,
-       jint maskoff, jint maskscan, 
-       jint masklen, jbyteArray maskArray)
-@@ -169,17 +153,14 @@
-     J2dTraceLn(J2D_TRACE_INFO, "in XRPBMBlitLoops_maskFill");
- 
-     Picture maskPic;
--    X11SDOps *dstXsdo, *alphaXsdo;
-+    X11SDOps *dstXsdo;
-     dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
--    alphaXsdo = (X11SDOps *)jlong_to_ptr(alphaData);
--    if (dstXsdo == NULL || alphaXsdo == NULL) {
-+    if (dstXsdo == NULL) {
-         return;
-     }
- 
--    maskPic = prepareMaskPM(env, alphaXsdo, maskArray, maskoff, maskscan, w, h);
--
-+    maskPic = prepareMaskPM(env, maskArray, maskoff, maskscan, w, h);
-     XRComposite(maskPic, dstXsdo->xrPic, x, y, 0, 0, x, y, w, h);
--
-     cleanMask(maskPic, w, h);
- 
-     X11SD_DirectRenderNotify(env, dstXsdo);
-@@ -190,7 +171,7 @@
- JNIEXPORT void JNICALL
- Java_sun_java2d_xr_XRMaskBlit_maskBlit
-      (JNIEnv *env, jobject joSelf, 
--      jlong srcData, jlong dstData, jlong alphaData,
-+      jlong srcData, jlong dstData,
-       jint srcx, jint srcy,
-       jint dstx, jint dsty, jint w, jint h,
-       jint maskoff, jint maskscan, 
-@@ -200,15 +181,14 @@
-     J2dTraceLn(J2D_TRACE_INFO, "in XRPBMBlitLoops_maskBlit");
- 
-     Picture maskPic;
--    X11SDOps *srcXsdo, *dstXsdo, *alphaXsdo;
-+    X11SDOps *srcXsdo, *dstXsdo;
-     srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
-     dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
--    alphaXsdo = (X11SDOps *)jlong_to_ptr(alphaData);
--    if (srcXsdo == NULL || dstXsdo == NULL || alphaXsdo == NULL) {
-+    if (srcXsdo == NULL || dstXsdo == NULL) {
-         return;
-     }
- 
--    maskPic = prepareMaskPM(env, alphaXsdo, maskArray, maskoff, maskscan, w, h);
-+    maskPic = prepareMaskPM(env, maskArray, maskoff, maskscan, w, h);
-     XRenderComposite (awt_display, xrSrcData.compRule, srcXsdo->xrPic, maskPic, dstXsdo->xrPic, srcx, srcy, 0, 0, dstx, dsty, w, h); 
-     cleanMask(maskPic, w, h);
- 
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRRenderer.c	2009-01-18 01:47:11.000000000 +0000
-@@ -49,6 +49,7 @@
- #define CLAMP_TO_USHORT(x)  (((x) > 65535) ? 65535 : ((x) < 0) ? 0 : (x))
- 
- 
-+/* Adds a PolyLine consisting of multiple points to the MaskBuffer */
- JNIEXPORT void JNICALL XRDrawLines(Picture dst, XPoint * points, int npoints)
- {
- #ifndef HEADLESS
-@@ -216,6 +217,7 @@
- #endif /* !HEADLESS */
- }
- 
-+
- JNIEXPORT void JNICALL Java_sun_java2d_xr_XRRenderer_XRFillRect
-     (JNIEnv *env, jobject xr,
-      jlong pXSData,
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	2009-01-18 01:47:11.000000000 +0000
-@@ -6,6 +6,7 @@
- #ifndef HEADLESS
- SrcSurfaceData xrSrcData;
- MaskBuffer *maskBuffer;
-+XRenderColor color_black;
- #endif /* !HEADLESS */
- 
- #define BUILD_TRANSFORM_MATRIX(TRANSFORM, M00, M01, M02, M10, M11, M12)                        \
-@@ -21,65 +22,6 @@
-       TRANSFORM.matrix[2][2] = 1<<16;                                                          \
-     }
- 
--
--JNIEXPORT void JNICALL
--Java_sun_java2d_xr_XRSurfaceData_initOps(JNIEnv *env, jobject xsd,
--                                           jobject peer,
--                                           jobject graphicsConfig, jint depth)
--{
--   J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initOps");
--
--   Java_sun_java2d_x11_X11SurfaceData_initOps(env, xsd, peer, graphicsConfig, depth);
--}
--
--JNIEXPORT jlong JNICALL Java_sun_java2d_xr_XRSurfaceData_XCreateGC (JNIEnv *env, jclass xsd, jlong pXSData)
--{
--   J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XCreateGC");
--
--   return Java_sun_java2d_x11_X11SurfaceData_XCreateGC (env, xsd, pXSData);
--}
--
--JNIEXPORT void JNICALL
--Java_sun_java2d_xr_XRSurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd)
--{
--  J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_flushNativeSurface");
--
--  Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface(env, xsd);
--}
--
--
--JNIEXPORT void JNICALL
--Java_sun_java2d_xr_XRSurfaceData_setInvalid(JNIEnv *env, jobject xsd)
--{
--#ifndef HEADLESS
--    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_setInvalid");
--    X11SDOps *xsdo = (X11SDOps *) SurfaceData_GetOps(env, xsd);
--
--    if (xsdo != NULL) {
--        xsdo->invalid = JNI_TRUE;
--    }
--#endif /* !HEADLESS */
--}
--
--JNIEXPORT jboolean JNICALL
--Java_sun_java2d_xr_XRSurfaceData_XRIsDrawableValid(JNIEnv *env, jobject this)
--{
--    jboolean ret = JNI_FALSE;
--
--#ifndef HEADLESS
--    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_XRIsDrawableValid");
--    X11SDOps *xsdo = X11SurfaceData_GetOps(env, this);
--
--    if (xsdo->drawable != 0 || X11SD_InitWindow(env, xsdo) == SD_SUCCESS) {
--        ret = JNI_TRUE;
--    }
--
--#endif /* !HEADLESS */
--
--    return ret;
--}
--
--
- JNIEXPORT void JNICALL
-    Java_sun_java2d_xr_XRSurfaceData_XRInitXRender(JNIEnv *env, jobject xsd, jlong pXSData, jint pictFormat)
- {
-@@ -99,26 +41,38 @@
-     xsdo->xrPic = XRenderCreatePicture(awt_display, xsdo->drawable, fmt, CPRepeat, &pict_attr);
-   }
- 
--  if(maskBuffer == NULL) 
--  {
-+  /*TODO: Improper place to initialize that stuff here - however we need a drawable in order to create the pixmaps*/
-+  if(maskBuffer == NULL) {
-     maskBuffer = initMaskBuffer(xsdo->drawable);
-+    initXRSrcData(xsdo->drawable);
-+  }
-+#endif /* !HEADLESS */
-+}
- 
-+static void initXRSrcData(Drawable *drawable) {
-+#ifndef HEADLESS
-     XRenderPictureAttributes pict_attr;
-     pict_attr.repeat = 1;
- 
-     /*Init solid color pen*/
--    XRenderPictFormat *fmt = XRenderFindStandardFormat(awt_display, PictStandardARGB32);
--    Pixmap solidPixmap = XCreatePixmap(awt_display, xsdo->drawable, 1, 1, 32);
--    xrSrcData.solid = XRenderCreatePicture(awt_display, solidPixmap, fmt, CPRepeat, &pict_attr);
-+    XRenderPictFormat *fmt32 = XRenderFindStandardFormat(awt_display, PictStandardARGB32);
-+    Pixmap solidPixmap = XCreatePixmap(awt_display, drawable, 1, 1, 32);
-+    xrSrcData.solid = XRenderCreatePicture(awt_display, solidPixmap, fmt32, CPRepeat, &pict_attr);
- 
-     /*Init extra-alpha mask*/
--    fmt = XRenderFindStandardFormat(awt_display, PictStandardA8);
--    Pixmap alphaPixmap = XCreatePixmap(awt_display, xsdo->drawable, 1, 1, 8);
--    xrSrcData.alphaMaskPict = XRenderCreatePicture(awt_display, alphaPixmap, fmt, CPRepeat, &pict_attr);
--  }
-+    XRenderPictFormat *fmt8 = XRenderFindStandardFormat(awt_display, PictStandardA8);
-+    Pixmap alphaPixmap = XCreatePixmap(awt_display, drawable, 1, 1, 8);
-+    xrSrcData.alphaMaskPict = XRenderCreatePicture(awt_display, alphaPixmap, fmt8, CPRepeat, &pict_attr);
-+
-+    /*Init gradient cache*/
-+    if(xrSrcData.gradCacheEnabled) {
-+      xrSrcData.gradPixmap = XCreatePixmap(awt_display, drawable, MASK_TILE_SIZE, MASK_TILE_SIZE, 32);
-+      xrSrcData.gradPict = XRenderCreatePicture(awt_display, xrSrcData.gradPixmap, fmt32, 0, &pict_attr);
-+    }
- #endif /* !HEADLESS */
- }
- 
-+
- JNIEXPORT void JNICALL
- Java_sun_java2d_xr_XRSurfaceData_initIDs(JNIEnv *env, jclass xsd, jboolean gradCacheEnabled)
- {
-@@ -133,18 +87,15 @@
-   xrSrcData.alphaMaskPict = None;
-   xrSrcData.compRule = PictOpOver;
-   xrSrcData.extraAlpha = 1.0f;
--  xrSrcData.compRequired = JNI_FALSE;
--
--  xrSrcData.alphaColor.alpha = 0xffff;
--  xrSrcData.alphaColor.red = 0xffff;
--  xrSrcData.alphaColor.green = 0xffff;
--  xrSrcData.alphaColor.blue = 0xffff;
--
-   xrSrcData.gradCacheEnabled = gradCacheEnabled;
--
-   maskBuffer = NULL;
- 
--  XShared_initIDs(env);
-+  color_black.red=0;
-+  color_black.green=0;
-+  color_black.blue=0;
-+  color_black.alpha=0xffff;
-+
-+  XShared_initIDs(env, JNI_FALSE);
- #endif /* !HEADLESS */
- }
- 
-@@ -157,10 +108,10 @@
- 
-   if(xrSrcData.src == xrSrcData.gradient && xrSrcData.gradCacheEnabled)
-   {
--    XRenderComposite(awt_display, PictOpSrc, xrSrcData.gradient, None, maskBuffer->gradPict, srcX, srcY, 0, 0, 0, 0, width, height);
-+    XRenderComposite(awt_display, PictOpSrc, xrSrcData.gradient, None, xrSrcData.gradPict, srcX, srcY, 0, 0, 0, 0, width, height);
-     cachedX = 0;
-     cachedY = 0; 
--    cachedSrc = maskBuffer->gradPict;
-+    cachedSrc = xrSrcData.gradPict;
-   }
- 
-    XRenderComposite (awt_display, xrSrcData.compRule, cachedSrc, mask, dest, cachedX, cachedY, maskX, maskY, dstX, dstY, width, height);
-@@ -246,20 +197,24 @@
-    }
- 
-     XLinearGradient grad;
--    XRenderColor colors[numStops];
--    XFixed stops[numStops];
--
-     grad.p1.x = x1;
-     grad.p1.y = y1;
-     grad.p2.x = x2;
-     grad.p2.y = y2;
- 
-+    /*TODO optimized & malloc check*/
-+    XRenderColor *colors = (XRenderColor *) malloc(numStops * sizeof(XRenderColor));
-+    XFixed *stops =  (XFixed *) malloc(numStops * sizeof(XFixed));
-+
-     for(i=0; i < numStops; i++) {
-       stops[i] = XDoubleToFixed(fractions[i]);
--      decodeRenderColorPre(pixels[i], &colors[i]);
-+      decodeRenderColorPre(pixels[i], colors + i);
-     }
- 
--    xrSrcData.gradient = XRenderCreateLinearGradient(awt_display, &grad, &stops[0], &colors[0], numStops);
-+    xrSrcData.gradient = XRenderCreateLinearGradient(awt_display, &grad, stops, colors, numStops);
-+    free(colors);
-+    free(stops);
-+
-     xrSrcData.src = xrSrcData.gradient;
- 
-     XTransform tr;
-@@ -299,9 +254,6 @@
-    }
- 
-     XRadialGradient grad;
--    XRenderColor colors[numStops];
--    XFixed stops[numStops];
--
-     grad.inner.x = 0;
-     grad.inner.y = 0;
-     grad.inner.radius = innerRadius;
-@@ -309,12 +261,19 @@
-     grad.outer.y = 0;
-     grad.outer.radius = outerRadius;
- 
-+    /*TODO optimized & malloc check*/
-+    XRenderColor *colors = (XRenderColor *) malloc(numStops * sizeof(XRenderColor));
-+    XFixed *stops = (XFixed *) malloc(numStops * sizeof(XFixed));
-+
-     for(i=0; i < numStops; i++) {
-       stops[i] = XDoubleToFixed(fractions[i]);
--      decodeRenderColorPre(pixels[i], &colors[i]);
-+      decodeRenderColorPre(pixels[i], colors + i);
-     }
- 
--    xrSrcData.gradient = XRenderCreateRadialGradient(awt_display, &grad, &stops[0], &colors[0], numStops);
-+    xrSrcData.gradient = XRenderCreateRadialGradient(awt_display, &grad, stops, colors, numStops);
-+    free(colors);
-+    free(stops);
-+
-     xrSrcData.src = xrSrcData.gradient;
- 
-     XTransform tr;
-@@ -362,11 +321,12 @@
- 
-   if(eAlpha != 1.0f) {
-     unsigned short alphaValue = XDoubleToUShort(eAlpha);
--    xrSrcData.alphaColor.alpha = alphaValue;
--    xrSrcData.alphaColor.red = alphaValue;
--    xrSrcData.alphaColor.green = alphaValue;
--    xrSrcData.alphaColor.blue = alphaValue;
--    XRenderFillRectangle (awt_display, PictOpSrc, xrSrcData.alphaMaskPict, &xrSrcData.alphaColor, 0, 0, 1, 1);
-+    XRenderColor alphaColor;
-+    alphaColor.alpha = alphaValue;
-+    alphaColor.red = alphaValue;
-+    alphaColor.green = alphaValue;
-+    alphaColor.blue = alphaValue;
-+    XRenderFillRectangle (awt_display, PictOpSrc, xrSrcData.alphaMaskPict, &alphaColor, 0, 0, 1, 1);
-     xrSrcData.alphaMask = xrSrcData.alphaMaskPict;
-   }else {
-     xrSrcData.alphaMask = None;
-@@ -430,7 +390,6 @@
- }
- 
- 
--	//private static native void XRSetTransform(long xsdo, double m00, double m01, double m02, double m10, double m11, double m12);
- JNIEXPORT void JNICALL
- Java_sun_java2d_xr_XRSurfaceData_XRSetTransformNative
-     (JNIEnv *env, jclass xsd, jlong pXSData, jint m00, jint m01, jint m02, jint m10, jint m11, jint m12)
-@@ -498,11 +457,17 @@
- static void decodeRenderColor(jint pixel, XRenderColor *color)
- { 
-    /*Extract color values from pixel, premultiply values. TODO: shouldn't this be done at the Java-level?*/
--    XFixed alpha = (((pixel & 0xFF000000) >> 16) + 255); /*REMIND: We rely on optimizations that this is 0xffff for opaque colors*/
-+    XFixed alpha = (((pixel & 0xFF000000) >> 16) + 255);
-     XFixed red =   (((pixel & 0x00FF0000) >> 8)  + 255);
-     XFixed green = (((pixel & 0x0000FF00) >> 0)  + 255);
-     XFixed blue =  (((pixel & 0x000000FF) << 8)  + 255);
- 
-+    /* Optimizations are based on the fact that alpha is 0xffff,
-+     * but XRender maybe also optimizes if alpha==0, so we correct here in that case */
-+    if(alpha == 255) {
-+      alpha = 0;
-+    }
-+
-     XDouble alphaMult = XFixedToDouble(alpha);
-     color->alpha = alpha;
-     color->red = (XFixed) red*alphaMult;
-@@ -516,4 +481,8 @@
-     color->red =   (((pixel & 0x00FF0000) >> 8)  + 255);
-     color->green = (((pixel & 0x0000FF00) >> 0)  + 255);
-     color->blue =  (((pixel & 0x000000FF) << 8)  + 255);
-+
-+    if(color->alpha == 255) {
-+      color->alpha = 0;
-+    }
- }
-\ No newline at end of file
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	2009-01-18 01:47:11.000000000 +0000
-@@ -3,11 +3,9 @@
- 
- #define XDoubleToUShort(f)    ((unsigned short) ((f) * 65535))
- 
-+/* Holds source-parameters*/
- typedef struct {
--  Picture src;
--  jboolean compRequired;
--  XRenderColor alphaColor;
--
-+  Picture src;            /* Currently used source*/
-   Picture solid;
-   XRenderColor solidColor;
-   Picture texture;
-@@ -15,19 +13,28 @@
- 
-   jint compRule;
-   jfloat extraAlpha;
--  Picture alphaMask; //Only !None when eA turned on
-+  Picture alphaMaskPict;  /*Reference to the 1x1 alpha Mask*/
-+  Picture alphaMask;      /*Alpha-Mask which should be used for composition, either alphaMaskPict or None*/ 
- 
--  Picture alphaMaskPict;
-   jboolean gradCacheEnabled;
-+  Pixmap gradPixmap;
-+  Picture gradPict;
- } SrcSurfaceData;
- 
- extern SrcSurfaceData xrSrcData;
- extern MaskBuffer *maskBuffer;
-+extern XRenderColor color_black;
- 
-+/* Composite using gradient-caching if enabled */ 
- void XRComposite(Picture mask, Picture dest, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, unsigned int width, unsigned int height);
- 
-+/* Initializes the global source structure*/
-+static void initXRSrcData();
-+
-+/*Decodes non-premultiplied pixel, multiplies it and stores the result in color*/
- static void decodeRenderColor(jint pixel, XRenderColor *color);
- 
-+/*Decodes a pixel and stores the result in color*/
- static void decodeRenderColorPre(jint pixel, XRenderColor *color);
- 
- #endif //XRSurfaceData_h_Included
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c	2009-01-18 01:30:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRTextRenderer_md.c	2009-01-18 01:47:11.000000000 +0000
-@@ -44,7 +44,6 @@
- #define TEXT_BM_WIDTH   1024
- #define TEXT_BM_HEIGHT  32
- 
--
- #define FLOOR_ASSIGN(l, r)\
-  if ((r)<0) (l) = ((int)floor(r)); else (l) = ((int)(r))
- 
-@@ -84,8 +83,19 @@
-   }
- 
-    int eltCnt = -1;
--   jint ids[numGlyphs]; 
--   XGlyphElt32 elts[numGlyphs];
-+   jint *ids; 
-+   XGlyphElt32 *elts;
-+
-+   /*for less then 128 glyphs we allocate temorary mem on stack*/
-+   jint idArray[128];
-+   XGlyphElt32 eltArray[128];
-+   if(numGlyphs <= 128) {
-+     ids = &idArray[0];
-+     elts = &eltArray[0];
-+   }else {
-+     ids = (jint *) malloc(numGlyphs * sizeof(jint));
-+     elts = (XGlyphElt32 *) malloc(numGlyphs * sizeof(XGlyphElt32));
-+   }
- 
-    float advX = xOrigin; //xOrigin;/*Contains all advance-corrections summed up*/
-    float advY = yOrigin; //yOrigin; 
-@@ -100,7 +110,7 @@
-   }
- 
-    XRGlyphCacheInfo *glyphCache = (grayscale == JNI_TRUE) ?  grayCache : lcdCache;
--   jboolean cacheResult = XRGlyphCache_CacheGlyphs(glyphCache, images, numGlyphs, &ids[0]);
-+   jboolean cacheResult = XRGlyphCache_CacheGlyphs(glyphCache, images, numGlyphs, ids);
-    if(cacheResult == JNI_FALSE){
-       J2dTraceLn(J2D_TRACE_INFO, "XRTextRenderer_md: Glyph caching failed");
-       return;
-@@ -116,7 +126,6 @@
- 	 *  If it does not match the positioning information stored on the server, create a new ELT.
- 	 *  advX/Y and posX/Y contain all advance-corrections summed up, so that we don't forget rounding errors happend in the past.
-          *  The actual advance is computed from the difference to the last integer-correction-position.
--         *  TODO: Spaeter mit cache vergleichen, statt einfach mit X-Werten
- 	 */
- 	int posX = 0, posY = 0;
- 	if(usePositions || (jginfo->advanceX != ((float)cellInfo->xOff) || jginfo->advanceY != ((float)cellInfo->yOff)) || eltCnt == -1) 
-@@ -165,7 +174,12 @@
-    }
- 
-   /*TODO: Also integrate into MaskBuffer??*/
--  XRenderCompositeText32(awt_display, PictOpOver, xrSrcData.src, xsdo->xrPic, None, 0, 0, 0, 0, &elts[0], eltCnt+1);
-+  XRenderCompositeText32(awt_display, PictOpOver, xrSrcData.src, xsdo->xrPic, None, 0, 0, 0, 0, elts, eltCnt+1);
-+
-+  if(numGlyphs > 128) {
-+    free(ids);
-+    free(elts);
-+  }
- #endif
- }
- 
--- a/patches/xrender/icedtea-003.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers openjdk/jdk/make/sun/awt/mapfile-mawt-vers
---- openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers	2009-10-21 16:42:03.000000000 +0100
-+++ openjdk/jdk/make/sun/awt/mapfile-mawt-vers	2009-10-23 15:32:29.000000000 +0100
-@@ -419,6 +419,35 @@
-                 Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
-                 Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures;
- 
-+		Java_sun_java2d_xr_XRSurfaceData_flushNativeSurface;
-+		Java_sun_java2d_xr_XRSurfaceData_XRIsDrawableValid;
-+		Java_sun_java2d_xr_XRSurfaceData_setInvalid;
-+		Java_sun_java2d_xr_XRSurfaceData_XRInitXRender;
-+		Java_sun_java2d_xr_XRSurfaceData_initOps;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetForeground;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetComposite;
-+		Java_sun_java2d_xr_XRSurfaceData_initIDs;
-+		Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
-+		Java_sun_java2d_xr_XRSurfaceData_XRResetClip;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetClip;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetTransformNative;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetFilter;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetTexturePaint;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetGradientPaint;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetLinearGradientPaint;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetRadialGradientPaint;
-+		Java_sun_java2d_xr_XRSurfaceData_XRResetPaint;
-+		Java_sun_java2d_xr_XRSurfaceData_XRSetRepeat;
-+		Java_sun_java2d_xr_XRPMBlitLoops_nativeRenderBlit;
-+		Java_sun_java2d_xr_XRRenderer_XRFillRect;
-+		Java_sun_java2d_xr_XRRenderer_XRFillSpans;
-+		Java_sun_java2d_xr_XRRenderer_XRDoPath;
-+		Java_sun_java2d_xr_XRRenderer_XRDrawLine;
-+        	Java_sun_java2d_xr_XRRenderer_devCopyArea;
-+		Java_sun_java2d_xr_XRMaskFill_maskFill;
-+		Java_sun_java2d_xr_XRMaskBlit_maskBlit;
-+ 		XRT_DrawGlyphList;
-+
-                 Java_sun_java2d_opengl_OGLContext_getOGLIdString;
-                 Java_sun_java2d_opengl_OGLMaskFill_maskFill;
-                 Java_sun_java2d_opengl_OGLRenderer_drawPoly;
-diff -Nru openjdk.orig/jdk/make/sun/headless/mapfile-vers openjdk/jdk/make/sun/headless/mapfile-vers
---- openjdk.orig/jdk/make/sun/headless/mapfile-vers	2009-10-21 16:42:03.000000000 +0100
-+++ openjdk/jdk/make/sun/headless/mapfile-vers	2009-10-23 15:32:29.000000000 +0100
-@@ -57,6 +57,8 @@
-                 Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
-                 Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
- 
-+		XRT_DrawGlyphList;
-+
- 		X11SurfaceData_GetOps;
- 		Java_java_awt_Font_initIDs;
-                 Java_sun_font_FontConfigManager_getFontConfig;
-diff -Nru openjdk.orig/jdk/make/sun/xawt/mapfile-vers openjdk/jdk/make/sun/xawt/mapfile-vers
---- openjdk.orig/jdk/make/sun/xawt/mapfile-vers	2009-10-23 14:45:10.000000000 +0100
-+++ openjdk/jdk/make/sun/xawt/mapfile-vers	2009-10-23 15:32:29.000000000 +0100
-@@ -377,6 +377,7 @@
-         Java_sun_java2d_xr_XRSurfaceData_XRSetComposite;
-         Java_sun_java2d_xr_XRSurfaceData_initIDs;
-         Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
-+	Java_sun_java2d_xr_XRSurfaceData_XRSetClip;
- 	Java_sun_java2d_xr_XRSurfaceData_XRResetClip;
- 	Java_sun_java2d_xr_XRSurfaceData_XRSetTransformNative;
-         Java_sun_java2d_xr_XRSurfaceData_XRSetFilter;
-@@ -391,6 +392,7 @@
- 	Java_sun_java2d_xr_XRRenderer_XRFillSpans;
-         Java_sun_java2d_xr_XRRenderer_XRDoPath;
- 	Java_sun_java2d_xr_XRRenderer_XRDrawLine;
-+        Java_sun_java2d_xr_XRRenderer_devCopyArea;
-         Java_sun_java2d_xr_XRMaskFill_maskFill;
- 	Java_sun_java2d_xr_XRMaskBlit_maskBlit;
- 	XRT_DrawGlyphList;
--- a/patches/xrender/icedtea-004.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers openjdk/jdk/make/sun/awt/mapfile-mawt-vers
---- openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers	2009-10-23 15:37:31.000000000 +0100
-+++ openjdk/jdk/make/sun/awt/mapfile-mawt-vers	2009-10-23 15:48:18.000000000 +0100
-@@ -446,7 +446,6 @@
-         	Java_sun_java2d_xr_XRRenderer_devCopyArea;
- 		Java_sun_java2d_xr_XRMaskFill_maskFill;
- 		Java_sun_java2d_xr_XRMaskBlit_maskBlit;
-- 		XRT_DrawGlyphList;
- 
-                 Java_sun_java2d_opengl_OGLContext_getOGLIdString;
-                 Java_sun_java2d_opengl_OGLMaskFill_maskFill;
-@@ -544,6 +543,7 @@
-                 AWTCharAscent;
-                 AWTCharDescent;
-                 AWTDrawGlyphList;
-+ 		XRT_DrawGlyphList;
-                 AccelGlyphCache_RemoveAllCellInfos;
- 
- 	local:
-diff -Nru openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux openjdk/jdk/make/sun/awt/mapfile-vers-linux
---- openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux	2009-10-21 16:42:03.000000000 +0100
-+++ openjdk/jdk/make/sun/awt/mapfile-vers-linux	2009-10-23 15:48:18.000000000 +0100
-@@ -568,6 +568,7 @@
-                 AWTCharAscent;
-                 AWTCharDescent;
-                 AWTDrawGlyphList;
-+		XRT_DrawGlyphList;
-                 AccelGlyphCache_RemoveAllCellInfos;
- 
- 	local:
-diff -Nru openjdk.orig/jdk/make/sun/headless/mapfile-vers openjdk/jdk/make/sun/headless/mapfile-vers
---- openjdk.orig/jdk/make/sun/headless/mapfile-vers	2009-10-23 15:37:31.000000000 +0100
-+++ openjdk/jdk/make/sun/headless/mapfile-vers	2009-10-23 15:48:18.000000000 +0100
-@@ -57,8 +57,6 @@
-                 Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
-                 Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
- 
--		XRT_DrawGlyphList;
--
- 		X11SurfaceData_GetOps;
- 		Java_java_awt_Font_initIDs;
-                 Java_sun_font_FontConfigManager_getFontConfig;
-@@ -99,6 +97,7 @@
-                 AWTCharAscent;
-                 AWTCharDescent;
-                 AWTDrawGlyphList;
-+		XRT_DrawGlyphList;
-                 AccelGlyphCache_RemoveAllCellInfos;
- 
- 
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	2009-10-23 15:37:31.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	2009-10-23 15:48:18.000000000 +0100
-@@ -67,6 +67,9 @@
- 
- 
- #ifndef HEADLESS
-+/**
-+ * Prepares a mask-picture according to the mask and the properties currently set, which is used for composition later.
-+ */
- static Picture prepareMaskPM(JNIEnv *env, jbyteArray maskArray, jint maskoff, jint maskscan, jint w, jint h)
- {
-     int line, pix;
-@@ -107,6 +110,7 @@
-             }
-           }
- 
-+          /*Upload Image to X-Server*/
-           XPutImage(awt_display, maskBuffer->maskPixmap, maskBuffer->maskGC, img, 0, 0, 0, 0, w, h);
-           (*env)->ReleasePrimitiveArrayCritical(env, maskArray, mask, JNI_ABORT);
- 
-@@ -124,6 +128,7 @@
-         }
-     }else
-     {
-+      /*If we haven't got a mask (full coverage), we have to return the EA mask, if EA is used*/
-       if(useEA) {
-         return xrSrcData.alphaMask;
-       }
--- a/patches/xrender/icedtea-005.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/sun/awt/FILES_c_unix.gmk openjdk/jdk/make/sun/awt/FILES_c_unix.gmk
---- openjdk.orig/jdk/make/sun/awt/FILES_c_unix.gmk	2009-05-12 15:54:23.000000000 +0100
-+++ openjdk/jdk/make/sun/awt/FILES_c_unix.gmk	2009-10-23 15:48:51.000000000 +0100
-@@ -211,6 +211,7 @@
- 	X11SurfaceData.c \
- 	X11FontScaler_md.c \
- 	X11TextRenderer_md.c \
-+        XRTextRenderer_md.c \
-         OGLBlitLoops.c \
-         OGLBufImgOps.c \
-         OGLContext.c \
--- a/patches/xrender/icedtea-006.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-# HG changeset patch
-# User ceisserer
-# Date 1217901941 -7200
-# Node ID 2e58d73ce3ffd0301067d097ba443910c387c8d5
-# Parent  8463c586ceaf12e5bc9d49e916a300c5b2a3ef81
-Summary: Added copyright / gpl2 header
-
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/classes/sun/java2d/xr/XRDrawImage.java
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2003-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- package sun.java2d.xr;
- 
- import java.awt.*;
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/classes/sun/java2d/xr/XRMaskBlit.java
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2003-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- package sun.java2d.xr;
- 
- import static sun.java2d.loops.CompositeType.SrcNoEa;
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/classes/sun/java2d/xr/XRMaskFill.java
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2003-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- package sun.java2d.xr;
- 
- import static sun.java2d.loops.CompositeType.SrcNoEa;
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/classes/sun/java2d/xr/XRRenderer.java
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2003-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- package sun.java2d.xr;
- 
- import java.awt.*;
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/classes/sun/java2d/xr/XRUtils.java
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2003-2007 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- package sun.java2d.xr;
- 
- import static java.awt.AlphaComposite.*;
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/native/sun/java2d/x11/XRGlyphCache.c
---- openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.c	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2001-2003 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- #include <malloc.h>
- #include "jni.h"
- #include "XRGlyphCache.h"
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/native/sun/java2d/x11/XRGlyphCache.h
---- openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRGlyphCache.h	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2001-2003 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- #ifndef XRGlyphCache_h_Included
- #define XRGlyphCache_h_Included
- 
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/native/sun/java2d/x11/XRSurfaceData.c
---- openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2001-2003 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- #include "GraphicsPrimitiveMgr.h"
- #include "Region.h"
- #include "Trace.h"
-diff -r 8463c586ceaf -r 2e58d73ce3ff src/solaris/native/sun/java2d/x11/XRSurfaceData.h
---- openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	Mon Aug 04 23:36:14 2008 +0200
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	Tue Aug 05 04:05:41 2008 +0200
-@@ -1,3 +1,28 @@
-+/*
-+ * Copyright 2001-2003 Sun Microsystems, Inc.  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.  Sun designates this
-+ * particular file as subject to the "Classpath" exception as provided
-+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
- #ifndef XRSurfaceData_h_Included
- #define XRSurfaceData_h_Included
- 
--- a/patches/xrender/icedtea-007.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1142 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	2009-10-23 15:52:32.000000000 +0100
-@@ -42,14 +42,11 @@
- 	SurfaceData srcData = dstData.getSourceSurfaceData(img,
- 		SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor);
- 
--	if (srcData != null && !isBgOperation(srcData, bgColor)
-+	if (srcData != null && !isBgOperation(srcData, bgColor) // TODO: Don't bail out on bg-blits
- 		&& srcData instanceof XRSurfaceData) {
- 	    SurfaceType srcType = srcData.getSurfaceType();
- 	    SurfaceType dstType = dstData.getSurfaceType();
- 
--	    ((XRSurfaceData) srcData).setPreferredInterpolation(XRUtils
--		    .ATransOpToXRQuality(interpType));
--
- 	    TransformBlit blit = TransformBlit.getFromCache(srcType,
- 		    sg.imageComp, dstType);
- 
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	2009-10-23 15:52:32.000000000 +0100
-@@ -42,35 +42,25 @@
-     public static void register() {
- 	GraphicsPrimitive[] primitives = {
- 
--		new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11),
--		new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11),
--		new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11),
--		new X11PMBlit(XRSurfaceData.IntArgbX11,
--			XRSurfaceData.IntArgbX11),
--
--		new X11PMScaledBlit(XRSurfaceData.IntRgbX11,
--			XRSurfaceData.IntRgbX11),
--		new X11PMScaledBlit(XRSurfaceData.IntRgbX11,
--			XRSurfaceData.IntArgbX11),
--		new X11PMScaledBlit(XRSurfaceData.IntArgbX11,
--			XRSurfaceData.IntRgbX11),
--		new X11PMScaledBlit(XRSurfaceData.IntArgbX11,
--			XRSurfaceData.IntArgbX11),
--
--		new X11PMTransformedBlit(XRSurfaceData.IntRgbX11,
--			XRSurfaceData.IntRgbX11),
--		new X11PMTransformedBlit(XRSurfaceData.IntRgbX11,
--			XRSurfaceData.IntArgbX11),
--		new X11PMTransformedBlit(XRSurfaceData.IntArgbX11,
--			XRSurfaceData.IntRgbX11),
--		new X11PMTransformedBlit(XRSurfaceData.IntArgbX11,
--			XRSurfaceData.IntArgbX11),
--	};
-+	new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11), new X11PMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11),
-+		new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11), new X11PMBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
-+
-+		new X11PMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11),
-+		new X11PMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11),
-+		new X11PMScaledBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11),
-+		new X11PMScaledBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11),
-+
-+		new X11PMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11),
-+		new X11PMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbX11),
-+		new X11PMTransformedBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntRgbX11),
-+		new X11PMTransformedBlit(XRSurfaceData.IntArgbX11, XRSurfaceData.IntArgbX11), };
- 	GraphicsPrimitiveMgr.register(primitives);
-     }
- 
--    public static native void nativeRenderBlit(long srcData, long dstData,
--	    int sx, int sy, int dx, int dy, int w, int h);
-+    public static native void nativeRenderBlit(long srcData, long dstData, int sx, int sy, int dx, int dy, int w, int h);
-+
-+    public static native void nativeTransformedRenderBlit(long srcData, long dstData, int sx, int sy, int dx, int dy, int w, int h, int m00, int m01,
-+	    int m02, int m10, int m11, int m12, int maskWidth, int maskHeight, int lastMaskWidth, int lastMaskHeight);
- }
- 
- class X11PMBlit extends Blit {
-@@ -78,8 +68,7 @@
- 	super(srcType, CompositeType.AnyAlpha, dstType);
-     }
- 
--    public void Blit(SurfaceData src, SurfaceData dst, Composite comp,
--	    Region clip, int sx, int sy, int dx, int dy, int w, int h) {
-+    public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) {
- 	try {
- 	    SunToolkit.awtLock();
- 
-@@ -89,8 +78,7 @@
- 
- 	    x11sdSrc.validateAsSource(null, XRUtils.RepeatNone, XRUtils.FAST);
- 
--	    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst
--		    .getNativeOps(), sx, sy, dx, dy, w, h);
-+	    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), sx, sy, dx, dy, w, h);
- 	} finally {
- 	    SunToolkit.awtUnlock();
- 	}
-@@ -101,10 +89,9 @@
-     public X11PMScaledBlit(SurfaceType srcType, SurfaceType dstType) {
- 	super(srcType, CompositeType.AnyAlpha, dstType);
-     }
--
--    public void Scale(SurfaceData src, SurfaceData dst, Composite comp,
--	    Region clip, int sx1, int sy1, int sx2, int sy2, double dx1,
--	    double dy1, double dx2, double dy2) {
-+    
-+    public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1,
-+	    double dx2, double dy2) {
- 	try {
- 	    SunToolkit.awtLock();
- 
-@@ -120,14 +107,13 @@
- 	    sy1 *= yScale;
- 	    sy2 *= yScale;
- 
--	    AffineTransform xForm = AffineTransform.getScaleInstance(
--		    1 / xScale, 1 / yScale);
-+	    AffineTransform xForm = AffineTransform.getScaleInstance(1 / xScale, 1 / yScale);
- 
- 	    x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST);
- 
--	    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst
--		    .getNativeOps(), (int) sx1, (int) sy1, (int) dx1,
--		    (int) dy1, (int) (dx2 - dx1), (int) (dy2 - dy1));
-+	    /*TODO: This breaks non-integer scaled images*/
-+	    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), (int) sx1, (int) sy1, (int) dx1, (int) dy1, (int) (dx2 - dx1),
-+		    (int) (dy2 - dy1));
- 
- 	} finally {
- 	    SunToolkit.awtUnlock();
-@@ -145,59 +131,90 @@
- 	super(srcType, CompositeType.AnyAlpha, dstType);
-     }
- 
--    public void Transform(SurfaceData src, SurfaceData dst, Composite comp,
--	    Region clip, AffineTransform xform, int hint, int srcx, int srcy,
-+    static int lastMaskWidth = 0, lastMaskHeight = 0;
-+
-+    /**
-+     * Possible optimizations: 
-+     * - Nearest interpolation -> ExtraAlpha mit 1x1 maske durchfuehren
-+     * - Mehere Maskengroessen anlegen, und skalieren
-+     * - Ueberpruefen ob aktueller Maskeninhalt mit skalierung passen wuerde, bzw. nur so viel aendern bis passt (wenn bereich < maske)
-+     * - Aendering entweder mit 2 filLRects, oder nur 1 fillrect je nach groesse
-+     */
-+    
-+    public void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform xform, int hint, int srcx, int srcy,
- 	    int dstx, int dsty, int width, int height) {
- 	try {
- 	    SunToolkit.awtLock();
- 
-+	    int xrInterpolationType = XRUtils.ATransOpToXRQuality(hint);
-+
- 	    XRSurfaceData x11sdDst = (XRSurfaceData) dst;
- 	    x11sdDst.validate(clip, comp, null, null, null, 0);
- 	    XRSurfaceData x11sdSrc = (XRSurfaceData) src;
- 
--	    boolean needClip = (xform.getScaleX() != 0.0f)
--		    || (xform.getShearY() != 0.0f);
--	    try {
--		/* Calculate area which will be covered by the transform-blit */
--		Rectangle2D.Float rect = new Rectangle2D.Float(dstx, dsty,
--			width, height);
--		Shape shp = xform.createTransformedShape(rect);
--		Rectangle bounds = shp.getBounds();
--
--		AffineTransform sourceTrans = (AffineTransform) xform.clone();
--		sourceTrans.translate(-srcx, -srcy);
--
--		try
--		{
--		     sourceTrans.invert();
--		}catch(NoninvertibleTransformException ex)
--		{
--		    sourceTrans.setToIdentity();
--		}
-+	    Rectangle2D.Float rect = new Rectangle2D.Float(dstx, dsty, width, height);
-+	    Shape shp = xform.createTransformedShape(rect);
-+	    Rectangle bounds = shp.getBounds();
-+
-+	    AffineTransform trx = AffineTransform.getTranslateInstance((-bounds.x), (-bounds.y));
-+	    trx.concatenate(xform);
-+	    AffineTransform maskTX = (AffineTransform) trx.clone();
- 
--		x11sdSrc.validateAsSource(sourceTrans, XRUtils.RepeatNone);
-+	    trx.translate(-srcx, -srcy);
- 
--		if (needClip) {
--		    x11sdDst.setShapeClip(shp);
--		}
-+	    try {
-+		trx.invert();
-+	    } catch (NoninvertibleTransformException ex) {
-+		trx.setToIdentity();
-+		System.err.println("Reseted to identity!");
-+	    }
- 
--		XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst
--			.getNativeOps(), 0, 0, 0, 0, bounds.x + bounds.width,
--			bounds.y + bounds.height);// bounds.x, bounds.y,
--						    // bounds.width,
--						    // bounds.height);//(int)
--						    // (maxX - minX), (int)
--						    // (maxY - minY));
-+	    boolean omitMask = isMaskOmittable(trx, comp, xrInterpolationType);
- 
--		if (needClip) {
--		    x11sdDst.resetShapeClip();
-+	    if (!omitMask) {
-+		int maskWidth = Math.max(width / 8, 1);
-+		int maskHeight = Math.max(height / 8, 1);
-+		maskTX.scale(((double) width) / maskWidth, ((double) height) / maskHeight);
-+
-+		try {
-+		    maskTX.invert();
-+		} catch (NoninvertibleTransformException ex) {
-+		    maskTX.setToIdentity();
-+		    System.err.println("Reseted to identity!");
- 		}
- 
--	    } catch (Exception ex) {
--		ex.printStackTrace();
-+		x11sdSrc.validateAsSource(trx, XRUtils.RepeatPad, xrInterpolationType);
-+
-+		XRPMBlitLoops.nativeTransformedRenderBlit(src.getNativeOps(), dst.getNativeOps(), 0, 0, bounds.x, bounds.y, bounds.width,
-+			bounds.height, XRUtils.XDoubleToFixed(maskTX.getScaleX()), XRUtils.XDoubleToFixed(maskTX.getShearX()), XRUtils
-+				.XDoubleToFixed(maskTX.getTranslateX()), XRUtils.XDoubleToFixed(maskTX.getShearY()), XRUtils.XDoubleToFixed(maskTX
-+				.getScaleY()), XRUtils.XDoubleToFixed(maskTX.getTranslateY()), maskWidth, maskHeight, lastMaskWidth, lastMaskHeight);
-+
-+		lastMaskWidth = maskWidth;
-+		lastMaskHeight = maskHeight;
-+	    } else {
-+		int repeat = xrInterpolationType <= XRUtils.FAST ? XRUtils.RepeatNone : XRUtils.RepeatPad;
-+		x11sdSrc.validateAsSource(trx, repeat, xrInterpolationType);
-+		XRPMBlitLoops.nativeTransformedRenderBlit(src.getNativeOps(), dst.getNativeOps(), 0, 0, bounds.x, bounds.y, bounds.width,
-+			bounds.height, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0);
- 	    }
-+
- 	} finally {
- 	    SunToolkit.awtUnlock();
- 	}
-     }
-+
-+    protected static boolean isMaskOmittable(AffineTransform trx, Composite comp, int interpolation) {
-+	return (interpolation <= XRUtils.FAST || trx.getTranslateX() == (int) trx.getTranslateX() /*
-+												     * If
-+												     * translate
-+												     * is
-+												     * integer only
-+												     */
-+		&& trx.getTranslateY() == (int) trx.getTranslateY() && (trx.getShearX() == 0 && trx.getShearY() == 0 // Only
-+															// "90 degrees"
-+															// rotation
-+		|| trx.getShearX() == -trx.getShearY())) && ((AlphaComposite) comp).getAlpha() == 1.0f; // No
-+													// ExtraAlpha!=1
-+    }
- }
-\ No newline at end of file
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
---- openjdk.orig/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	2009-10-23 15:52:32.000000000 +0100
-@@ -50,8 +50,7 @@
- 
-     private static native void initIDs(boolean gradCache);
- 
--    protected native void XRInitSurface(int depth, int width, int height,
--	    long drawable, int pictFormat);
-+    protected native void XRInitSurface(int depth, int width, int height, long drawable, int pictFormat);
- 
-     native void XRInitXRender(long xsdo, int pictForm);
- 
-@@ -110,12 +109,13 @@
- 	TextPipe textpipe;
- 	boolean validated = false;
- 
--	/* The textpipe for now can't handle TexturePaint when extra-alpha is specified nore XOR mode*/
-+	/*
-+	 * The textpipe for now can't handle TexturePaint when extra-alpha is
-+	 * specified nore XOR mode
-+	 */
- 	if (sg2d.compositeState < SunGraphics2D.COMP_XOR
--		&& (sg2d.paintState < SunGraphics2D.PAINT_TEXTURE
--		|| sg2d.composite == null
--		|| !(sg2d.composite instanceof AlphaComposite)
--		|| ((AlphaComposite) sg2d.composite).getAlpha() == 1.0f)) {
-+		&& (sg2d.paintState < SunGraphics2D.PAINT_TEXTURE || sg2d.composite == null || !(sg2d.composite instanceof AlphaComposite) || ((AlphaComposite) sg2d.composite)
-+			.getAlpha() == 1.0f)) {
- 	    textpipe = xrtextpipe;
- 	} else {
- 	    super.validatePipe(sg2d);
-@@ -167,8 +167,8 @@
-     }
- 
-     /**
--     * Returns an accalerated MaskFill object if the current paint
--     *  is supported by the pipeline.
-+     * Returns an accalerated MaskFill object if the current paint is supported
-+     * by the pipeline.
-      */
-     protected MaskFill getMaskFill(SunGraphics2D sg2d) {
- 	if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR && !isPaintValid(sg2d)) {
-@@ -178,8 +178,7 @@
-     }
- 
-     public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
--	if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR
--		&& sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
-+	if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR && sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
- 	    return solidloops;
- 	}
- 
-@@ -199,28 +198,24 @@
-     }
- 
-     /**
--     * Method for instantiating a Pixmap SurfaceData (offscreen).
--     * If the surface is opaque a 24-bit/RGB surface is chosen, 
--     * otherwise a 32-bit ARGB surface.
-+     * Method for instantiating a Pixmap SurfaceData (offscreen). If the surface
-+     * is opaque a 24-bit/RGB surface is chosen, otherwise a 32-bit ARGB
-+     * surface.
-      */
--    public static XRPixmapSurfaceData createData(XRGraphicsConfig gc,
--	    int width, int height, ColorModel cm, Image image, long drawable,
-+    public static XRPixmapSurfaceData createData(XRGraphicsConfig gc, int width, int height, ColorModel cm, Image image, long drawable,
- 	    int transparency) {
- 	int depth = transparency > Transparency.OPAQUE ? 32 : 24;
- 	if (depth == 24) {
- 	    cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00, 0x000000FF);
- 	} else {
--	    cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00,
--		    0x000000FF, 0xFF000000);
-+	    cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
- 	}
- 
--	return new XRPixmapSurfaceData(gc, width, height, image,
--		getSurfaceType(gc, transparency), cm, drawable, transparency,
--		XRUtils.getPictureFormatForTransparency(transparency), depth);
-+	return new XRPixmapSurfaceData(gc, width, height, image, getSurfaceType(gc, transparency), cm, drawable, transparency, XRUtils
-+		.getPictureFormatForTransparency(transparency), depth);
-     }
- 
--    protected XRSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc,
--	    SurfaceType sType, ColorModel cm, int depth, int transparency) {
-+    protected XRSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc, SurfaceType sType, ColorModel cm, int depth, int transparency) {
- 	super(sType, cm);
- 	this.peer = peer;
- 	this.graphicsConfig = gc;
-@@ -233,6 +228,7 @@
- 
-     /**
-      * Inits the XRender-data-structures which belong to the XRSurfaceData.
-+     * 
-      * @param pictureFormat
-      */
-     public void initXRender(int pictureFormat) {
-@@ -248,8 +244,7 @@
- 	if (peer != null) {
- 	    return (XRGraphicsConfig) peer.getGraphicsConfiguration();
- 	} else {
--	    GraphicsEnvironment env = GraphicsEnvironment
--		    .getLocalGraphicsEnvironment();
-+	    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
- 	    GraphicsDevice gd = env.getDefaultScreenDevice();
- 	    return (XRGraphicsConfig) gd.getDefaultConfiguration();
- 	}
-@@ -269,16 +264,14 @@
-     public abstract boolean canSourceSendExposures(int x, int y, int w, int h);
- 
-     /**
--     * CopyArea is implemented using the "old" X11 GC, 
--     * therefor clip and needExposures have to be validated against that GC.
--     * Pictures and GCs don't share state.
-+     * CopyArea is implemented using the "old" X11 GC, therefor clip and
-+     * needExposures have to be validated against that GC. Pictures and GCs
-+     * don't share state.
-      */
-     public void validateCopyAreaGC(Region gcClip, boolean needExposures) {
- 	if (validatedGCClip != gcClip) {
- 	    if (gcClip != null) {
--		XSetClip(xgc, gcClip.getLoX(), gcClip.getLoY(),
--			gcClip.getHiX(), gcClip.getHiY(), 
--			gcClip.isRectangular() ? null : gcClip);
-+		XSetClip(xgc, gcClip.getLoX(), gcClip.getLoY(), gcClip.getHiX(), gcClip.getHiY(), gcClip.isRectangular() ? null : gcClip);
- 	    } else {
- 		XResetClip(xgc);
- 	    }
-@@ -291,8 +284,7 @@
- 	}
-     }
- 
--    public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
--	    int dx, int dy) {
-+    public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy) {
- 	if (xrpipe == null) {
- 	    if (!isXRDrawableValid()) {
- 		return true;
-@@ -301,16 +293,14 @@
- 	}
- 	CompositeType comptype = sg2d.imageComp;
- 	if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE
--		&& (CompositeType.SrcOverNoEa.equals(comptype) || CompositeType.SrcNoEa
--			.equals(comptype))) {
-+		&& (CompositeType.SrcOverNoEa.equals(comptype) || CompositeType.SrcNoEa.equals(comptype))) {
- 	    x += sg2d.transX;
- 	    y += sg2d.transY;
- 	    try {
- 		SunToolkit.awtLock();
- 		boolean needExposures = canSourceSendExposures(x, y, w, h);
- 		validateCopyAreaGC(sg2d.getCompClip(), needExposures);
--		xrpipe.devCopyArea(getNativeOps(), xgc, x, y, x + dx, y + dy,
--			w, h);
-+		xrpipe.devCopyArea(getNativeOps(), xgc, x, y, x + dx, y + dy, w, h);
- 	    } finally {
- 		SunToolkit.awtUnlock();
- 	    }
-@@ -320,11 +310,10 @@
-     }
- 
-     /**
--     * Returns the XRender SurfaceType which is able to fullfill the
--     * specified transparency requirement.
-+     * Returns the XRender SurfaceType which is able to fullfill the specified
-+     * transparency requirement.
-      */
--    public static SurfaceType getSurfaceType(XRGraphicsConfig gc,
--	    int transparency) {
-+    public static SurfaceType getSurfaceType(XRGraphicsConfig gc, int transparency) {
- 	SurfaceType sType = null;
- 
- 	switch (transparency) {
-@@ -355,45 +344,35 @@
- 
-     private static native void XRSetComposite(int compRule, float eAlpha);
- 
--    private static native void XRSetClip(long xsdo, int lox, int loy, int hix,
--	    int hiy, Region complexclip);
-+    private static native void XRSetClip(long xsdo, int lox, int loy, int hix, int hiy, Region complexclip);
- 
-     private static native void XRResetClip(long xsdo);
- 
--    private static native void XRSetTransformNative(long xsdo, int m00,
--	    int m01, int m02, int m10, int m11, int m12);
-+    private static native void XRSetTransformNative(long xsdo, int m00, int m01, int m02, int m10, int m11, int m12);
- 
-     private static native void XRSetTexturePaint(long xsdo);
- 
-     private static native void XRResetPaint();
- 
-     private static native void XRSetRepeat(long xsdo, int repeat);
--    
-+
-     private static native void XRSetFilter(long xsdo, int value);
--    
--    private static native void XRSetLinearGradientPaint(float[] fractions,
--	    int[] pixels, int x1, int y1, int x2, int y2, int numStops,
--	    int cycleMethod, boolean useMask, boolean linear, int m00, int m01,
--	    int m02, int m10, int m11, int m12);
--    
--    private native static void XRSetRadialGradientPaint(float[] fractions,
--	    int[] pixels, int fx, int numStops, int cycleMethod,
--	    boolean useMask, boolean linear, int innerRadius, int outerRadius,
--	    int m00, int m01, int m02, int m10, int m11, int m12);
-+
-+    private static native void XRSetLinearGradientPaint(float[] fractions, int[] pixels, int x1, int y1, int x2, int y2, int numStops,
-+	    int cycleMethod, boolean useMask, boolean linear, int m00, int m01, int m02, int m10, int m11, int m12);
-+
-+    private native static void XRSetRadialGradientPaint(float[] fractions, int[] pixels, int fx, int numStops, int cycleMethod, boolean useMask,
-+	    boolean linear, int innerRadius, int outerRadius, int m00, int m01, int m02, int m10, int m11, int m12);
- 
-     private void XRSetTransform(AffineTransform transform) {
- 	double[] transformData = new double[6];
- 	transform.getMatrix(transformData);
- 
--	XRSetTransformNative(getNativeOps(), XDoubleToFixed(transformData[0]),
--		XDoubleToFixed(transformData[2]),
--		XDoubleToFixed(transformData[4]),
--		XDoubleToFixed(transformData[1]),
--		XDoubleToFixed(transformData[3]),
--		XDoubleToFixed(transformData[5]));
-+	XRSetTransformNative(getNativeOps(), XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]),
-+		XDoubleToFixed(transformData[1]), XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-     }
- 
--    private long xgc; //GC is still used for copyArea
-+    private long xgc; // GC is still used for copyArea
- 
-     public static int validatedPixel = -1;
-     public static int validatedPaintState = -1;
-@@ -410,35 +389,37 @@
-     private AffineTransform validatedSourceTransform = new AffineTransform();
-     private int validatedRepeat = XRUtils.RepeatNone;
-     private int validatedInterpolation = -1;
--    /*Used if API does not allow to pass interpolation value at the level needed*/
-+    /*
-+     * Used if API does not allow to pass interpolation value at the level
-+     * needed
-+     */
-     private int preferredInterpolation = -1;
- 
-     public void setPreferredInterpolation(int interpolation) {
- 	this.preferredInterpolation = interpolation;
-     }
--    
--    
-+
-     /*
--     * For now those shape-clips are used for transformed images,
--     * because transformed image for now would invalidate a much larger area that they are intended to do.
--     * However as soon as the transformed-mask approach I am working on turns out
--     * to work well, those will be dropped.
-+     * For now those shape-clips are used for transformed images, because
-+     * transformed image for now would invalidate a much larger area that they
-+     * are intended to do. However as soon as the transformed-mask approach I am
-+     * working on turns out to work well, those will be dropped.
-      */
-     public void setShapeClip(Shape shape) {
- 	Region shapeClip = Region.getInstance(validatedClip, shape, null);
--	XRSetClip(getNativeOps(), shapeClip.getLoX(), shapeClip.getLoY(),
--		shapeClip.getHiX(), shapeClip.getHiY(), shapeClip
--			.isRectangular() ? null : shapeClip);
-+	XRSetClip(getNativeOps(), shapeClip.getLoX(), shapeClip.getLoY(), shapeClip.getHiX(), shapeClip.getHiY(), shapeClip.isRectangular() ? null
-+		: shapeClip);
-     }
- 
-     public void resetShapeClip() {
--	XRSetClip(getNativeOps(), validatedClip.getLoX(), validatedClip
--		.getLoY(), validatedClip.getHiX(), validatedClip.getHiY(),
--		validatedClip.isRectangular() ? null : validatedClip);
-+	XRSetClip(getNativeOps(), validatedClip.getLoX(), validatedClip.getLoY(), validatedClip.getHiX(), validatedClip.getHiY(), validatedClip
-+		.isRectangular() ? null : validatedClip);
-     }
- 
-     /**
--     * Validate the source with the preferred interpolation set sometimes earlier.
-+     * Validate the source with the preferred interpolation set sometimes
-+     * earlier.
-+     * 
-      * @param sxForm
-      * @param repeat
-      */
-@@ -447,35 +428,40 @@
-     }
- 
-     /**
--     * Validates an XRSurfaceData when used as source.
--     * Note that the clip is applied when used as source as well as destination.
-+     * Validates an XRSurfaceData when used as source. Note that the clip is
-+     * applied when used as source as well as destination.
-      */
-     void validateAsSource(AffineTransform sxForm, int repeat, int interpolation) {
-+	// System.out.println("Source:
-+	// "+getBounds().width+"/"+getBounds().height);
-+
- 	if (validatedClip != null) {
- 	    validatedClip = null;
- 	    XRResetClip(getNativeOps());
-+	    // System.out.println("Clip ge-reseted");
- 	}
- 
- 	if (validatedRepeat != repeat) {
- 	    validatedRepeat = repeat;
- 	    XRSetRepeat(getNativeOps(), repeat);
-+	    // System.out.println("Repeat ge-reseted");
- 	}
- 
- 	if (sxForm == null) {
- 	    if (transformInUse) {
- 		validatedSourceTransform.setToIdentity();
-+		// System.out.println("Transform ge-reseted");
- 		XRSetTransform(validatedSourceTransform);
- 		transformInUse = false;
- 	    }
- 	} else {
--	    if (!transformInUse
--		 || (transformInUse && !sxForm.equals(validatedSourceTransform))) {
--		
--		validatedSourceTransform.setTransform(sxForm.getScaleX(),
--			sxForm.getShearY(), sxForm.getShearX(), sxForm
--				.getScaleY(), sxForm.getTranslateX(), sxForm
--				.getTranslateY());
--		
-+	    if (!transformInUse || (transformInUse && !sxForm.equals(validatedSourceTransform))) {
-+
-+		// System.out.println("Setze transform: "+sxForm);
-+
-+		validatedSourceTransform.setTransform(sxForm.getScaleX(), sxForm.getShearY(), sxForm.getShearX(), sxForm.getScaleY(), sxForm
-+			.getTranslateX(), sxForm.getTranslateY());
-+
- 		XRSetTransform(validatedSourceTransform);
- 		transformInUse = true;
- 	    }
-@@ -488,8 +474,9 @@
-     }
- 
-     /**
--     * Utility method for setting the Composite,
--     * passing down the arguments to the native method.
-+     * Utility method for setting the Composite, passing down the arguments to
-+     * the native method.
-+     * 
-      * @param comp
-      */
-     private void setComposite(Composite comp) {
-@@ -497,12 +484,9 @@
- 	    AlphaComposite aComp = (AlphaComposite) comp;
- 	    validatedExtraAlpha = aComp.getAlpha();
- 
--	    XRSetComposite(XRUtils.j2dAlphaCompToXR(aComp.getRule()),
--		    validatedExtraAlpha);
-+	    XRSetComposite(XRUtils.j2dAlphaCompToXR(aComp.getRule()), validatedExtraAlpha);
- 	} else {
--	    throw new InternalError(
--		    "Composite accaleration not implemented for: "
--			    + comp.getClass().getName());
-+	    throw new InternalError("Composite accaleration not implemented for: " + comp.getClass().getName());
- 	}
-     }
- 
-@@ -537,10 +521,10 @@
- 
- 	return ((a << 24) | (r << 16) | (g << 8) | (b));
-     }
--    
-+
-     /**
--     * The currently only known paint XRender can't support are
--     * radial gradients where focus and center paint differ.
-+     * The currently only known paint XRender can't support are radial gradients
-+     * where focus and center paint differ.
-      */
-     public static boolean isPaintValid(SunGraphics2D sg2d) {
- 	if (sg2d.paintState == SunGraphics2D.PAINT_RAD_GRADIENT) {
-@@ -551,14 +535,11 @@
-     }
- 
-     /**
--     * Sets a 2-stop gradient.
--     * Utility method generating the by the native method expected
--     * parameters and calling it.
--     */
--    private void setGradientPaint(SunGraphics2D sg2d, GradientPaint paint,
--	    boolean useMask) {
--	int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(),
--		paint.getColor2() }, false);
-+     * Sets a 2-stop gradient. Utility method generating the by the native
-+     * method expected parameters and calling it.
-+     */
-+    private void setGradientPaint(SunGraphics2D sg2d, GradientPaint paint, boolean useMask) {
-+	int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() }, false);
- 
- 	float fractions[] = new float[2];
- 	fractions[0] = 0;
-@@ -577,27 +558,19 @@
- 	double[] transformData = new double[6];
- 	at.getMatrix(transformData);
- 
--	int repeat = paint.isCyclic() ? XRUtils.RepeatReflect
--		: XRUtils.RepeatPad;
-+	int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
- 
--	XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()),
--		XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()),
--		XDoubleToFixed(pt2.getY()), 2, repeat, useMask, false,
--		XDoubleToFixed(transformData[0]),
--		XDoubleToFixed(transformData[2]),
--		XDoubleToFixed(transformData[4]),
--		XDoubleToFixed(transformData[1]),
--		XDoubleToFixed(transformData[3]),
-+	XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()), XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()),
-+		XDoubleToFixed(pt2.getY()), 2, repeat, useMask, false, XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]),
-+		XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]), XDoubleToFixed(transformData[3]),
- 		XDoubleToFixed(transformData[5]));
-     }
--    
-+
-     /**
--     * Sets a n-stop linear gradient.
--     * Utility method generating the by the native method expected
--     * parameters and calling it.
-+     * Sets a n-stop linear gradient. Utility method generating the by the
-+     * native method expected parameters and calling it.
-      */
--    public void setLinearGradientPaint(SunGraphics2D sg2d,
--	    LinearGradientPaint paint, boolean useMask) {
-+    public void setLinearGradientPaint(SunGraphics2D sg2d, LinearGradientPaint paint, boolean useMask) {
- 	boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
- 	Color[] colors = paint.getColors();
- 	int numStops = colors.length;
-@@ -607,8 +580,7 @@
- 	AffineTransform at = paint.getTransform();
- 	at.preConcatenate(sg2d.transform);
- 
--	int cycleMethod = XRUtils.getRepeatForCycleMethod(paint
--		.getCycleMethod());
-+	int cycleMethod = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
- 	float[] fractions = paint.getFractions();
- 	int[] pixels = convertToIntArgbPixels(colors, linear);
- 
-@@ -621,32 +593,24 @@
- 	double[] transformData = new double[6];
- 	at.getMatrix(transformData);
- 
--	XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()),
--		XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()),
--		XDoubleToFixed(pt2.getY()), numStops, cycleMethod, useMask,
--		linear, XDoubleToFixed(transformData[0]),
--		XDoubleToFixed(transformData[2]),
--		XDoubleToFixed(transformData[4]),
--		XDoubleToFixed(transformData[1]),
--		XDoubleToFixed(transformData[3]),
--		XDoubleToFixed(transformData[5]));
-+	XRSetLinearGradientPaint(fractions, pixels, XDoubleToFixed(pt1.getX()), XDoubleToFixed(pt1.getY()), XDoubleToFixed(pt2.getX()),
-+		XDoubleToFixed(pt2.getY()), numStops, cycleMethod, useMask, linear, XDoubleToFixed(transformData[0]),
-+		XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]), XDoubleToFixed(transformData[1]),
-+		XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-     }
- 
-     /**
--     * Sets a Radial Gradient where focus and center point match.
--     * Utility method generating the by the native method expected
--     * parameters and calling it.
-+     * Sets a Radial Gradient where focus and center point match. Utility method
-+     * generating the by the native method expected parameters and calling it.
-      */
--    public void setRadialGradientPaint(SunGraphics2D sg2d,
--	    RadialGradientPaint paint) {
-+    public void setRadialGradientPaint(SunGraphics2D sg2d, RadialGradientPaint paint) {
- 	boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
- 	Color[] colors = paint.getColors();
- 	int numStops = colors.length;
- 	Point2D center = paint.getCenterPoint();
- 	Point2D focus = paint.getFocusPoint();
- 
--	int cycleMethod = XRUtils.getRepeatForCycleMethod(paint
--		.getCycleMethod());
-+	int cycleMethod = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
- 	float[] fractions = paint.getFractions();
- 	int[] pixels = convertToIntArgbPixels(colors, linear);
- 	float radius = paint.getRadius();
-@@ -683,28 +647,19 @@
- 	double[] transformData = new double[6];
- 	at.getMatrix(transformData);
- 
--	XRSetRadialGradientPaint(fractions, pixels, XDoubleToFixed(fx),
--		numStops, cycleMethod, false, linear, XDoubleToFixed(0),
--		XDoubleToFixed(radius), XDoubleToFixed(transformData[0]),
--		XDoubleToFixed(transformData[2]),
--		XDoubleToFixed(transformData[4]),
--		XDoubleToFixed(transformData[1]),
--		XDoubleToFixed(transformData[3]),
--		XDoubleToFixed(transformData[5]));
-+	XRSetRadialGradientPaint(fractions, pixels, XDoubleToFixed(fx), numStops, cycleMethod, false, linear, XDoubleToFixed(0),
-+		XDoubleToFixed(radius), XDoubleToFixed(transformData[0]), XDoubleToFixed(transformData[2]), XDoubleToFixed(transformData[4]),
-+		XDoubleToFixed(transformData[1]), XDoubleToFixed(transformData[3]), XDoubleToFixed(transformData[5]));
-     }
- 
--    private TexturePaint setTexturePaint(SunGraphics2D sg2d,
--	    TexturePaint paint, boolean useMask) {
-+    private TexturePaint setTexturePaint(SunGraphics2D sg2d, TexturePaint paint, boolean useMask) {
- 	BufferedImage bi = paint.getImage();
- 	SurfaceData dstData = sg2d.surfaceData;
--	SurfaceData srcData = dstData.getSourceSurfaceData(bi,
--		SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
-+	SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
- 
- 	// REMIND: this hack tries to ensure that we have a cached texture
- 	if (!(srcData instanceof XRSurfaceData)) {
--	    srcData = dstData.getSourceSurfaceData(paint.getImage(),
--		    SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver,
--		    null);
-+	    srcData = dstData.getSourceSurfaceData(paint.getImage(), SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
- 	    if (!(srcData instanceof XRSurfaceData)) {
- 		return null;
- 	    }
-@@ -715,17 +670,15 @@
- 	AffineTransform at = (AffineTransform) sg2d.transform.clone();
- 	Rectangle2D anchor = paint.getAnchorRect();
- 	at.translate(anchor.getX(), anchor.getY());
--	at.scale(anchor.getWidth() / ((double) bi.getWidth()), 
--		anchor.getHeight() / ((double) bi.getHeight()));
--	
-+	at.scale(anchor.getWidth() / ((double) bi.getWidth()), anchor.getHeight() / ((double) bi.getHeight()));
-+
- 	try {
- 	    at.invert();
- 	} catch (NoninvertibleTransformException ex) {
- 	    at.setToIdentity(); /* TODO: Right thing to do in this case? */
- 	}
- 
--	x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, 
--		XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
-+	x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
- 
- 	XRSetTexturePaint(srcData.getNativeOps());
- 
-@@ -733,8 +686,9 @@
-     }
- 
-     /**
--     * Sets the paint as source.
--     * Checks the type of paint and calls the appropriate set*Paint method.
-+     * Sets the paint as source. Checks the type of paint and calls the
-+     * appropriate set*Paint method.
-+     * 
-      * @param sg2d
-      * @param paint
-      */
-@@ -750,8 +704,7 @@
- 		    break;
- 
- 		case SunGraphics2D.PAINT_LIN_GRADIENT:
--		    setLinearGradientPaint(sg2d, (LinearGradientPaint) paint,
--			    false);
-+		    setLinearGradientPaint(sg2d, (LinearGradientPaint) paint, false);
- 		    validatedPaint = paint;
- 		    break;
- 
-@@ -761,8 +714,7 @@
- 		    break;
- 
- 		case SunGraphics2D.PAINT_TEXTURE:
--		    validatedPaint = setTexturePaint(sg2d,
--			    (TexturePaint) paint, false);
-+		    validatedPaint = setTexturePaint(sg2d, (TexturePaint) paint, false);
- 		    break;
- 
- 		default:
-@@ -773,12 +725,10 @@
-     }
- 
-     /**
--     * Validates the Surface when used as destination, 
--     * takes care that the native surface has the same state as expected, 
--     * changing it it not.
-+     * Validates the Surface when used as destination, takes care that the
-+     * native surface has the same state as expected, changing it it not.
-      */
--    public void validate(Region clip, Composite comp, AffineTransform xform,
--	    Paint paint, SunGraphics2D sg2d, int flags) {
-+    public void validate(Region clip, Composite comp, AffineTransform xform, Paint paint, SunGraphics2D sg2d, int flags) {
- 	boolean updateClip = (clip != validatedClip);
- 	boolean updatePaint = (paint != validatedPaint) || paint == null;
- 
-@@ -789,8 +739,7 @@
- 	// validate clip
- 	if (updateClip) {
- 	    if (clip != null) {
--		XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip
--			.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
-+		XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
- 	    } else {
- 		XRResetClip(getNativeOps());
- 	    }
-@@ -830,7 +779,10 @@
- 	}
-     }
- 
--    public void makePipes() { /*TODO: Why was this synchronized, but access not?*/
-+    public void makePipes() { /*
-+				 * TODO: Why was this synchronized, but access
-+				 * not?
-+				 */
- 	if (xrpipe == null) {
- 	    try {
- 		SunToolkit.awtLock();
-@@ -847,14 +799,11 @@
-     }
- 
-     public static class XRWindowSurfaceData extends XRSurfaceData {
--	public XRWindowSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc,
--		SurfaceType sType) {
--	    super(peer, gc, sType, peer.getColorModel(), peer.getColorModel()
--		    .getPixelSize(), Transparency.OPAQUE);
-+	public XRWindowSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc, SurfaceType sType) {
-+	    super(peer, gc, sType, peer.getColorModel(), peer.getColorModel().getPixelSize(), Transparency.OPAQUE);
- 
- 	    if (isXRDrawableValid()) {
--		initXRender(XRUtils
--			.getPictureFormatForTransparency(Transparency.OPAQUE));
-+		initXRender(XRUtils.getPictureFormatForTransparency(Transparency.OPAQUE));
- 		makePipes();
- 	    }
- 	}
-@@ -888,8 +837,7 @@
- 	int height;
- 	int transparency;
- 
--	public XRPixmapSurfaceData(XRGraphicsConfig gc, int width, int height,
--		Image image, SurfaceType sType, ColorModel cm, long drawable,
-+	public XRPixmapSurfaceData(XRGraphicsConfig gc, int width, int height, Image image, SurfaceType sType, ColorModel cm, long drawable,
- 		int transparency, int pictFormat, int depth) {
- 	    super(null, gc, sType, cm, depth, transparency);
- 	    this.width = width;
-@@ -900,8 +848,7 @@
- 	    makePipes();
- 	}
- 
--	public void initSurface(int depth, int width, int height,
--		long drawable, int pictFormat) {
-+	public void initSurface(int depth, int width, int height, long drawable, int pictFormat) {
- 	    try {
- 		SunToolkit.awtLock();
- 		XRInitSurface(depth, width, height, drawable, pictFormat);
-@@ -936,10 +883,11 @@
- 	public void flush() {
- 	    /*
- 	     * We need to invalidate the surface before disposing the native
--	     * Drawable and Picture. This way if an application tries to render to an
--	     * already flushed XRSurfaceData, we will notice in the validate()
--	     * method above that it has been invalidated, and we will avoid
--	     * using those native resources that have already been disposed.
-+	     * Drawable and Picture. This way if an application tries to render
-+	     * to an already flushed XRSurfaceData, we will notice in the
-+	     * validate() method above that it has been invalidated, and we will
-+	     * avoid using those native resources that have already been
-+	     * disposed.
- 	     */
- 	    invalidate();
- 	    flushNativeSurface();
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	2009-10-23 15:52:32.000000000 +0100
-@@ -44,7 +44,7 @@
- 
-   buffer->maskPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 8);
-   buffer->lineMaskPixmap = XCreatePixmap(awt_display, window, MASK_TILE_SIZE, MASK_TILE_SIZE, 8);
-- 
-+
-   XRenderPictureAttributes pict_attr;
-   buffer->maskPicture = XRenderCreatePicture(awt_display, buffer->maskPixmap, fmt, 0, &pict_attr);
-   buffer->lineMaskPicture = XRenderCreatePicture(awt_display, buffer->lineMaskPixmap, fmt, 0, &pict_attr);
-@@ -52,6 +52,29 @@
-   XRenderFillRectangle (awt_display, PictOpClear, buffer->maskPicture, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
-   XRenderFillRectangle (awt_display, PictOpClear, buffer->lineMaskPicture, &color_black, 0, 0, MASK_TILE_SIZE, MASK_TILE_SIZE);
- 
-+/*
-+  //1x1 image mask pixmap
-+  Pixmap m1p =  XCreatePixmap(awt_display, window, 1, 1, 8);
-+  buffer->img1Mask = XRenderCreatePicture(awt_display, m1p, fmt, 0, &pict_attr);
-+  XRenderFillRectangle (awt_display, PictOpSrc, buffer->img1Mask, &color_black, 0, 0, 1, 1);
-+
-+  //8x8 image mask pixmap
-+  Pixmap m8p =  XCreatePixmap(awt_display, window, 8, 8, 8);
-+  buffer->img8Mask = XRenderCreatePicture(awt_display, m8p, fmt, 0, &pict_attr);
-+  XRenderFillRectangle (awt_display, PictOpSrc, buffer->img8Mask, &color_black, 0, 0, 8, 8);
-+
-+  //64x64 image mask pixmap
-+  Pixmap m64p =  XCreatePixmap(awt_display, window, 64, 64, 8);
-+  buffer->img64Mask = XRenderCreatePicture(awt_display, m64p, fmt, 0, &pict_attr);
-+  XRenderFillRectangle (awt_display, PictOpSrc, buffer->img64Mask, &color_black, 0, 0, 64, 64);
-+*/
-+
-+  Pixmap mp =  XCreatePixmap(awt_display, window, 64, 64, 8);
-+  buffer->maxMask = XRenderCreatePicture(awt_display, mp, fmt, 0, &pict_attr);
-+  XRenderFillRectangle (awt_display, PictOpClear, buffer->maxMask, &color_black, 0, 0, 64, 64);
-+  buffer->maxWidth = 64;
-+  buffer->maxHeight = 64;
-+
-   buffer->validatedGCAlpha = 1.0f;
-   XGCValues values;
-   values.foreground = 255;
-@@ -347,12 +370,12 @@
- 	  if(maskRequired || lineList->used  > 0) {
-             Picture mask = None;
- 
--            if(lineList->used != 0) {
-+            if(lineList->used > 0) {
-               XDrawSegments(awt_display, buf->lineMaskPixmap, buf->drawLineGC, (XSegment *) lineList->elements, lineList->used);
-               mask = buf->lineMaskPicture;
-             }
- 
--            if(rectList->used != 0) {
-+            if(rectList->used > 0) {
-                XRenderComposite (awt_display, PictOpSrc, buf->lineMaskPicture, None, buf->maskPicture, tile->dirtyLineArea.x, tile->dirtyLineArea.y, 0, 0, tile->dirtyLineArea.x, tile->dirtyLineArea.y, (tile->dirtyLineArea.x2 - tile->dirtyLineArea.x), (tile->dirtyLineArea.y2 - tile->dirtyLineArea.y)); 
-                XRenderFillRectangles (awt_display, PictOpSrc, buf->maskPicture, &maskColor, (XRectangle*) rectList->elements, rectList->used);
-                mask = buf->maskPicture;
-@@ -371,7 +394,7 @@
-                clearXRList(lineList);
- 	     }
-           }else
--          if(rectList->used != 0) {
-+          if(rectList->used > 0) {
-              translateRects(rectList, (tileStartX + buf->region.x), (tileStartY + buf->region.y));
-              XRenderFillRectangles (awt_display, xrSrcData.compRule, dest, &xrSrcData.solidColor, (XRectangle*) rectList->elements, rectList->used);
-              clearXRList(rectList);
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.h	2009-10-23 15:52:32.000000000 +0100
-@@ -51,6 +51,13 @@
-   GC maskGC;
-   jfloat validatedGCAlpha;
- 
-+  /*Picture img1Mask;
-+  Picture img8Mask;
-+  Picture img64Mask;*/
-+  Picture maxMask;
-+  jint maxWidth;
-+  jint maxHeight;
-+
-   XrArrayList rects;
-   XrArrayList lines;
-   MaskRegion region;
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRPMBlitLoops.c	2009-10-23 15:52:32.000000000 +0100
-@@ -66,6 +66,92 @@
- }
- 
- 
-+JNIEXPORT void JNICALL
-+Java_sun_java2d_xr_XRPMBlitLoops_nativeTransformedRenderBlit
-+    (JNIEnv *env, jclass xsd,
-+     jlong srcData, jlong dstData,
-+     jint srcx, jint srcy,
-+     jint dstx, jint dsty,
-+     jint width, jint height,
-+     jint m00, jint m01, jint m02, jint m10, jint m11, jint m12, jint maskWidth, jint maskHeight, jint lastWidth, jint lastHeight)
-+{
-+#ifndef HEADLESS
-+    J2dTraceLn(J2D_TRACE_INFO, "in XRPBMBlitLoops_nativeTranformedRenderBlit");
-+
-+    X11SDOps *srcXsdo, *dstXsdo;
-+    SurfaceDataBounds span, srcBounds;
-+
-+    if (width <= 0 || height <= 0) {
-+        return;
-+    }
-+
-+    srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
-+    if (srcXsdo == NULL) {
-+        return;
-+    }
-+    dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
-+    if (dstXsdo == NULL) {
-+        return;
-+    }
-+
-+
-+    Picture mask = None;
-+    if(maskWidth > -1)
-+    {
-+      XRenderColor maskColor;
-+      maskColor.alpha = XDoubleToUShort(xrSrcData.extraAlpha);
-+
-+    /*Picture mask;
-+    switch(maskSize)
-+    {
-+      case 1: 
-+        mask = maskBuffer->img1Mask;
-+        break;
-+
-+      case 8:
-+        mask = maskBuffer->img8Mask;
-+        break;
-+
-+      case 64:
-+        mask = maskBuffer->img64Mask;
-+        break;
-+    }*/
-+
-+   if(maskBuffer->maxWidth < maskWidth || maskBuffer->maxHeight < maskHeight) {
-+     XRenderPictFormat *fmt = XRenderFindStandardFormat(awt_display, PictStandardA8);
-+     XRenderPictureAttributes pict_attr;
-+     Pixmap mp =  XCreatePixmap(awt_display, RootWindow(awt_display, dstXsdo->configData->awt_visInfo.screen), maskWidth, maskHeight, 8);
-+
-+     //TODO: Alte maske free'n
-+     maskBuffer->maxMask = XRenderCreatePicture(awt_display, mp, fmt, 0, &pict_attr);
-+     XRenderFillRectangle (awt_display, PictOpClear, maskBuffer->maxMask, &maskColor, 0, 0, maskWidth, maskHeight);
-+     maskBuffer->maxWidth = maskWidth;
-+     maskBuffer->maxHeight = maskHeight;
-+
-+  //   printf("Reinitialized it!\n"); fflush(stdout);
-+   }else
-+   {
-+    XRenderFillRectangle (awt_display, PictOpClear, maskBuffer->maxMask, &maskColor, 0, 0, lastWidth, lastHeight);
-+   }
-+
-+    //printf("Blit: %d, %d, %d, %d\n", maskWidth, maskHeight, lastWidth, lastHeight); fflush(stdout);
-+
-+    XRenderFillRectangle (awt_display, PictOpSrc, maskBuffer->maxMask, &maskColor, 0, 0, maskWidth, maskHeight);
-+    
-+    XTransform tr;
-+    BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
-+    XRenderSetPictureTransform (awt_display, maskBuffer->maxMask, &tr);
-+
-+    mask = maskBuffer->maxMask;
-+}
-+
-+    XRenderComposite (awt_display, xrSrcData.compRule, srcXsdo->xrPic, mask, dstXsdo->xrPic, srcx, srcy, 0, 0, dstx, dsty, width, height); 
-+    
-+
-+    X11SD_DirectRenderNotify(env, dstXsdo);
-+#endif /* !HEADLESS */
-+}
-+
- #ifndef HEADLESS
- /**
-  * Prepares a mask-picture according to the mask and the properties currently set, which is used for composition later.
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	2009-10-23 15:52:32.000000000 +0100
-@@ -34,19 +34,6 @@
- XRenderColor color_black;
- #endif /* !HEADLESS */
- 
--#define BUILD_TRANSFORM_MATRIX(TRANSFORM, M00, M01, M02, M10, M11, M12)                        \
--    {                                                                                          \
--      TRANSFORM.matrix[0][0] = M00;                                                            \
--      TRANSFORM.matrix[0][1] = M01;                                                            \
--      TRANSFORM.matrix[0][2] = M02;                                                            \
--      TRANSFORM.matrix[1][0] = M10;                                                            \
--      TRANSFORM.matrix[1][1] = M11;                                                            \
--      TRANSFORM.matrix[1][2] = M12;                                                            \
--      TRANSFORM.matrix[2][0] = 0;                                                              \
--      TRANSFORM.matrix[2][1] = 0;                                                              \
--      TRANSFORM.matrix[2][2] = 1<<16;                                                          \
--    }
--
- JNIEXPORT void JNICALL
-    Java_sun_java2d_xr_XRSurfaceData_XRInitXRender(JNIEnv *env, jobject xsd, jlong pXSData, jint pictFormat)
- {
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	2009-10-23 15:51:54.000000000 +0100
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.h	2009-10-23 15:52:32.000000000 +0100
-@@ -28,6 +28,19 @@
- 
- #define XDoubleToUShort(f)    ((unsigned short) ((f) * 65535))
- 
-+#define BUILD_TRANSFORM_MATRIX(TRANSFORM, M00, M01, M02, M10, M11, M12)                        \
-+    {                                                                                          \
-+      TRANSFORM.matrix[0][0] = M00;                                                            \
-+      TRANSFORM.matrix[0][1] = M01;                                                            \
-+      TRANSFORM.matrix[0][2] = M02;                                                            \
-+      TRANSFORM.matrix[1][0] = M10;                                                            \
-+      TRANSFORM.matrix[1][1] = M11;                                                            \
-+      TRANSFORM.matrix[1][2] = M12;                                                            \
-+      TRANSFORM.matrix[2][0] = 0;                                                              \
-+      TRANSFORM.matrix[2][1] = 0;                                                              \
-+      TRANSFORM.matrix[2][2] = 1<<16;                                                          \
-+    }
-+
- /* Holds source-parameters*/
- typedef struct {
-   Picture src;            /* Currently used source*/
--- a/patches/xrender/icedtea-008.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-# HG changeset patch
-# User ceisserer
-# Date 1224781905 -7200
-# Node ID 0ae86de6889ebd18b1a8f0232c50ce2c3049bc40
-# Parent  d6ab5f9f96efa37a823e071a27e3555557930203
-Updated Symbol-Mapping files
-
-diff -r d6ab5f9f96ef -r 0ae86de6889e make/sun/awt/mapfile-mawt-vers
---- openjdk/jdk/make/sun/awt/mapfile-mawt-vers	Thu Oct 23 17:25:18 2008 +0200
-+++ openjdk/jdk/make/sun/awt/mapfile-mawt-vers	Thu Oct 23 19:11:45 2008 +0200
-@@ -438,6 +438,7 @@
- 		Java_sun_java2d_xr_XRSurfaceData_XRResetPaint;
- 		Java_sun_java2d_xr_XRSurfaceData_XRSetRepeat;
- 		Java_sun_java2d_xr_XRPMBlitLoops_nativeRenderBlit;
-+                Java_sun_java2d_xr_XRPMBlitLoops_nativeTransformedRenderBlit;
- 		Java_sun_java2d_xr_XRRenderer_XRFillRect;
- 		Java_sun_java2d_xr_XRRenderer_XRFillSpans;
- 		Java_sun_java2d_xr_XRRenderer_XRDoPath;
-diff -r d6ab5f9f96ef -r 0ae86de6889e make/sun/xawt/mapfile-vers
---- openjdk/jdk/make/sun/xawt/mapfile-vers	Thu Oct 23 17:25:18 2008 +0200
-+++ openjdk/jdk/make/sun/xawt/mapfile-vers	Thu Oct 23 19:11:45 2008 +0200
-@@ -367,6 +367,7 @@
-         Java_sun_java2d_xr_XRSurfaceData_XRResetPaint;
-         Java_sun_java2d_xr_XRSurfaceData_XRSetRepeat;
- 	Java_sun_java2d_xr_XRPMBlitLoops_nativeRenderBlit;
-+        Java_sun_java2d_xr_XRPMBlitLoops_nativeTransformedRenderBlit;
- 	Java_sun_java2d_xr_XRRenderer_XRFillRect;
- 	Java_sun_java2d_xr_XRRenderer_XRFillSpans;
-         Java_sun_java2d_xr_XRRenderer_XRDoPath;
-diff -r d6ab5f9f96ef -r 0ae86de6889e src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	Thu Oct 23 17:25:18 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	Thu Oct 23 19:11:45 2008 +0200
-@@ -31,6 +31,7 @@
- import sun.java2d.SurfaceData;
- import java.awt.*;
- import java.awt.geom.*;
-+import java.awt.image.*;
- 
- /**
-  * XRPMBlitLoops
-@@ -38,7 +39,7 @@
-  * This class accelerates Blits between two surfaces of types *PM.s
-  */
- public class XRPMBlitLoops {
--
-+    
-     public static void register() {
- 	GraphicsPrimitive[] primitives = {
- 
-@@ -90,15 +91,32 @@
- 	super(srcType, CompositeType.AnyAlpha, dstType);
-     }
-     
-+    /*
-+     * TODO:  This breaks scales with non-integer coordinates!
-+     */
-     public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1,
- 	    double dx2, double dy2) {
- 	try {
- 	    SunToolkit.awtLock();
--
-+	    
-+//	    int width = sx2-sx1;
-+//	    int height = sy2-sy1;
-+//	    double xScale = (dx2 - dx1) / width;
-+//	    double yScale = (dy2 - dy1) / height;
-+//	    AffineTransform scaleTransform = AffineTransform.getTranslateInstance(sx1, sy1);
-+//	    scaleTransform.scale(xScale, yScale);
-+//	   // scaleTransform.translate(sx1, sy1);
-+//	    
-+//	    /*
-+//             *    static void IsoBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform xform, int hint, 
-+//             *    int srcx, int srcy, int dstx, int dsty, int width, int height)
-+//	     */
-+//	    XRPMBlitLoops.IsoBlit(src, dst, comp, clip, scaleTransform, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, 0, 0, (int)(dx1/xScale), (int)(dy1/yScale), width, height);
-+////
- 	    XRSurfaceData x11sdDst = (XRSurfaceData) dst;
- 	    x11sdDst.validate(clip, comp, null, null, null, 0);
- 	    XRSurfaceData x11sdSrc = (XRSurfaceData) src;
--
-+	    
- 	    double xScale = (dx2 - dx1) / (sx2 - sx1);
- 	    double yScale = (dy2 - dy1) / (sy2 - sy1);
- 
-@@ -110,8 +128,7 @@
- 	    AffineTransform xForm = AffineTransform.getScaleInstance(1 / xScale, 1 / yScale);
- 
- 	    x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST);
--
--	    /*TODO: This breaks non-integer scaled images*/
-+	    
- 	    XRPMBlitLoops.nativeRenderBlit(src.getNativeOps(), dst.getNativeOps(), (int) sx1, (int) sy1, (int) dx1, (int) dy1, (int) (dx2 - dx1),
- 		    (int) (dy2 - dy1));
- 
-@@ -127,11 +144,12 @@
-  * @author Clemens Eisserer
-  */
- class X11PMTransformedBlit extends TransformBlit {
-+    
-+    static int lastMaskWidth = 0, lastMaskHeight = 0;
-+    
-     public X11PMTransformedBlit(SurfaceType srcType, SurfaceType dstType) {
- 	super(srcType, CompositeType.AnyAlpha, dstType);
-     }
--
--    static int lastMaskWidth = 0, lastMaskHeight = 0;
- 
-     /**
-      * Possible optimizations: 
-@@ -145,7 +163,6 @@
- 	    int dstx, int dsty, int width, int height) {
- 	try {
- 	    SunToolkit.awtLock();
--
- 	    int xrInterpolationType = XRUtils.ATransOpToXRQuality(hint);
- 
- 	    XRSurfaceData x11sdDst = (XRSurfaceData) dst;
-@@ -198,12 +215,11 @@
- 		XRPMBlitLoops.nativeTransformedRenderBlit(src.getNativeOps(), dst.getNativeOps(), 0, 0, bounds.x, bounds.y, bounds.width,
- 			bounds.height, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0);
- 	    }
--
- 	} finally {
- 	    SunToolkit.awtUnlock();
- 	}
-     }
--
-+    
-     protected static boolean isMaskOmittable(AffineTransform trx, Composite comp, int interpolation) {
- 	return (interpolation <= XRUtils.FAST || trx.getTranslateX() == (int) trx.getTranslateX() /*
- 												     * If
--- a/patches/xrender/icedtea-009.patch	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-
-# HG changeset patch
-# User ceisserer
-# Date 1228079698 -3600
-# Node ID c72b1c0435c0b262a78dea6ee7109634a82eb574
-# Parent 0ae86de6889ebd18b1a8f0232c50ce2c3049bc40
-- Improved performance of non-solid operations
-- Improved performance of GPUs not supporting A8+A8 composition, but are capable of XCopyArea'ing with A8->A8 with their 2D engines (i830, GF6/7)
-- X11/XR pipeline initialization in X11GraphicsDevice was mixed up
-
---- openjdk/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Thu Oct 23 19:11:45 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Sun Nov 30 22:14:58 2008 +0100
-@@ -151,7 +151,7 @@ public class X11GraphicsDevice
-             }
- 
-             boolean glxSupported = X11GraphicsEnvironment.isGLXAvailable();
--            boolean xrender = X11GraphicsEnvironment.isXRenderAvailable();
-+            boolean xrenderSupported = X11GraphicsEnvironment.isXRenderAvailable();
-             
-             boolean dbeSupported = isDBESupported();
-             if (dbeSupported && doubleBufferVisuals == null) {
-@@ -169,7 +169,7 @@ public class X11GraphicsDevice
-                         (dbeSupported &&
-                          doubleBufferVisuals.contains(Integer.valueOf(visNum)));
-                     
--                    if(!xrender)
-+                    if(xrenderSupported)
-                     {
-                         ret[i] = XRGraphicsConfig.getConfig(this, visNum, depth,
-                                 getConfigColormap(i, screen),
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	Thu Oct 23 19:11:45 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	Sun Nov 30 22:14:58 2008 +0100
-@@ -104,6 +104,7 @@ public class XRMaskFill extends MaskFill
- 
- 	    maskFill(sData.getNativeOps(), x, y, w, h, maskoff, maskscan,
- 		    mask != null ? mask.length : 0, mask);
-+	
- 	} finally {
- 	    SunToolkit.awtUnlock();
- 	}
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	Thu Oct 23 19:11:45 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	Sun Nov 30 22:14:58 2008 +0100
-@@ -211,6 +211,7 @@ class X11PMTransformedBlit extends Trans
- 		lastMaskHeight = maskHeight;
- 	    } else {
- 		int repeat = xrInterpolationType <= XRUtils.FAST ? XRUtils.RepeatNone : XRUtils.RepeatPad;
-+		
- 		x11sdSrc.validateAsSource(trx, repeat, xrInterpolationType);
- 		XRPMBlitLoops.nativeTransformedRenderBlit(src.getNativeOps(), dst.getNativeOps(), 0, 0, bounds.x, bounds.y, bounds.width,
- 			bounds.height, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0);
---- openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Thu Oct 23 19:11:45 2008 +0200
-+++ openjdk/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Sun Nov 30 22:14:58 2008 +0100
-@@ -399,23 +399,6 @@ public abstract class XRSurfaceData exte
- 	this.preferredInterpolation = interpolation;
-     }
- 
--    /*
--     * For now those shape-clips are used for transformed images, because
--     * transformed image for now would invalidate a much larger area that they
--     * are intended to do. However as soon as the transformed-mask approach I am
--     * working on turns out to work well, those will be dropped.
--     */
--    public void setShapeClip(Shape shape) {
--	Region shapeClip = Region.getInstance(validatedClip, shape, null);
--	XRSetClip(getNativeOps(), shapeClip.getLoX(), shapeClip.getLoY(), shapeClip.getHiX(), shapeClip.getHiY(), shapeClip.isRectangular() ? null
--		: shapeClip);
--    }
--
--    public void resetShapeClip() {
--	XRSetClip(getNativeOps(), validatedClip.getLoX(), validatedClip.getLoY(), validatedClip.getHiX(), validatedClip.getHiY(), validatedClip
--		.isRectangular() ? null : validatedClip);
--    }
--
-     /**
-      * Validate the source with the preferred interpolation set sometimes
-      * earlier.
-@@ -432,32 +415,25 @@ public abstract class XRSurfaceData exte
-      * applied when used as source as well as destination.
-      */
-     void validateAsSource(AffineTransform sxForm, int repeat, int interpolation) {
--	// System.out.println("Source:
--	// "+getBounds().width+"/"+getBounds().height);
- 
- 	if (validatedClip != null) {
- 	    validatedClip = null;
- 	    XRResetClip(getNativeOps());
--	    // System.out.println("Clip ge-reseted");
- 	}
- 
- 	if (validatedRepeat != repeat) {
- 	    validatedRepeat = repeat;
- 	    XRSetRepeat(getNativeOps(), repeat);
--	    // System.out.println("Repeat ge-reseted");
- 	}
- 
- 	if (sxForm == null) {
- 	    if (transformInUse) {
- 		validatedSourceTransform.setToIdentity();
--		// System.out.println("Transform ge-reseted");
- 		XRSetTransform(validatedSourceTransform);
- 		transformInUse = false;
- 	    }
- 	} else {
- 	    if (!transformInUse || (transformInUse && !sxForm.equals(validatedSourceTransform))) {
--
--		// System.out.println("Setze transform: "+sxForm);
- 
- 		validatedSourceTransform.setTransform(sxForm.getScaleX(), sxForm.getShearY(), sxForm.getShearX(), sxForm.getScaleY(), sxForm
- 			.getTranslateX(), sxForm.getTranslateY());
-@@ -677,7 +653,7 @@ public abstract class XRSurfaceData exte
- 	} catch (NoninvertibleTransformException ex) {
- 	    at.setToIdentity(); /* TODO: Right thing to do in this case? */
- 	}
--
-+	
- 	x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
- 
- 	XRSetTexturePaint(srcData.getNativeOps());
-@@ -739,6 +715,8 @@ public abstract class XRSurfaceData exte
- 	// validate clip
- 	if (updateClip) {
- 	    if (clip != null) {
-+		//    System.out.println("Set paint clip: "+getBounds().width+":"+getBounds().height);
-+		//    Thread.dumpStack();
- 		XRSetClip(getNativeOps(), clip.getLoX(), clip.getLoY(), clip.getHiX(), clip.getHiY(), clip.isRectangular() ? null : clip);
- 	    } else {
- 		XRResetClip(getNativeOps());
---- openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	Thu Oct 23 19:11:45 2008 +0200
-+++ openjdk/jdk/src/solaris/native/sun/java2d/x11/MaskBuffer.c	Sun Nov 30 22:14:58 2008 +0100
-@@ -77,12 +77,14 @@ MaskBuffer* initMaskBuffer(Window window
- 
-   buffer->validatedGCAlpha = 1.0f;
-   XGCValues values;
-+  values.graphics_exposures = 0;
-+
-   values.foreground = 255;
--  buffer->drawLineGC = XCreateGC(awt_display, buffer->lineMaskPixmap, GCForeground, &values);
-+  buffer->drawLineGC = XCreateGC(awt_display, buffer->lineMaskPixmap, GCForeground | GCGraphicsExposures, &values);
-   /*Invisible GC for readback assistance*/
-   values.foreground = 0;
--  buffer->clearLineGC = XCreateGC(awt_display, buffer->lineMaskPixmap, GCForeground, &values);
--  buffer->maskGC = XCreateGC(awt_display, buffer->maskPixmap, 0, &values);
-+  buffer->clearLineGC = XCreateGC(awt_display, buffer->lineMaskPixmap, GCForeground | GCGraphicsExposures, &values);
-+  buffer->maskGC = XCreateGC(awt_display, buffer->maskPixmap, GCGraphicsExposures, &values);
-  
-   buffer->alphaData = malloc(32*32);
-   buffer->alphaImg = XCreateImage(awt_display, &buffer->maskPixmap, 8, ZPixmap, 0, (char *) buffer->alphaData, 32, 32, 8, 0);
-@@ -376,7 +378,11 @@ void fillMask(MaskBuffer* buf, Picture d
-             }
- 
-             if(rectList->used > 0) {
--               XRenderComposite (awt_display, PictOpSrc, buf->lineMaskPicture, None, buf->maskPicture, tile->dirtyLineArea.x, tile->dirtyLineArea.y, 0, 0, tile->dirtyLineArea.x, tile->dirtyLineArea.y, (tile->dirtyLineArea.x2 - tile->dirtyLineArea.x), (tile->dirtyLineArea.y2 - tile->dirtyLineArea.y)); 
-+               if(lineList->used > 0) {
-+                 XCopyArea(awt_display, buf->lineMaskPixmap, buf->maskPixmap, buf->maskGC, tile->dirtyLineArea.x, tile->dirtyLineArea.y, (tile->dirtyLineArea.x2 - tile->dirtyLineArea.x), (tile->dirtyLineArea.y2 - tile->dirtyLineArea.y), tile->dirtyLineArea.x, tile->dirtyLineArea.y);
-+                 //XRenderComposite (awt_display, PictOpSrc, buf->lineMaskPicture, None, buf->maskPicture, tile->dirtyLineArea.x, tile->dirtyLineArea.y, 0, 0, tile->dirtyLineArea.x, tile->dirtyLineArea.y, (tile->dirtyLineArea.x2 - tile->dirtyLineArea.x), (tile->dirtyLineArea.y2 - tile->dirtyLineArea.y)); 
-+               }
-+
-                XRenderFillRectangles (awt_display, PictOpSrc, buf->maskPicture, &maskColor, (XRectangle*) rectList->elements, rectList->used);
-                mask = buf->maskPicture;
-                clearXRList(rectList);
-@@ -389,7 +395,7 @@ void fillMask(MaskBuffer* buf, Picture d
- 
-              /* Clear diagonal lines with lines again,
-                 to avoid the sysmem copy marked "dirty" causing migration for the next lines*/
--             if(lineList->used != 0) {
-+             if(lineList->used > 0) {
-                XDrawSegments(awt_display, buf->lineMaskPixmap, buf->clearLineGC, (XSegment *) lineList->elements, lineList->used);
-                clearXRList(lineList);
- 	     }
-
--- a/ports/hotspot/make/linux/makefiles/shark.make	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#
-# Copyright 1999-2005 Sun Microsystems, Inc.  All Rights Reserved.
-# Copyright 2008, 2010 Red Hat, Inc.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-# CA 95054 USA or visit www.sun.com if you need additional information or
-# have any questions.
-#
-#
-
-# Sets make macros for making Shark version of VM
-
-TYPE = SHARK
-
-VM_SUBDIR = server
-
-CFLAGS += -DSHARK
--- a/ports/hotspot/make/linux/platform_zero.in	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-os_family = linux
-
-arch = zero
-
-arch_model = zero
-
-os_arch = linux_zero
-
-os_arch_model = linux_zero
-
-lib_arch = zero
-
-compiler = gcc
-
-gnu_dis_arch = zero
-
-sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\"
--- a/ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-// Set the default values for platform dependent flags used by the
-// Shark compiler.  See globals.hpp for details of what they do.
-
-define_pd_global(bool,     BackgroundCompilation,        true );
-define_pd_global(bool,     UseTLAB,                      true );
-define_pd_global(bool,     ResizeTLAB,                   true );
-define_pd_global(bool,     InlineIntrinsics,             false);
-define_pd_global(bool,     PreferInterpreterNativeStubs, false);
-define_pd_global(bool,     ProfileTraps,                 false);
-define_pd_global(bool,     UseOnStackReplacement,        true );
-define_pd_global(bool,     TieredCompilation,            false);
-
-define_pd_global(intx,     CompileThreshold,             1500);
-define_pd_global(intx,     Tier2CompileThreshold,        1500);
-define_pd_global(intx,     Tier3CompileThreshold,        2500);
-define_pd_global(intx,     Tier4CompileThreshold,        4500);
-
-define_pd_global(intx,     BackEdgeThreshold,            100000);
-define_pd_global(intx,     Tier2BackEdgeThreshold,       100000);
-define_pd_global(intx,     Tier3BackEdgeThreshold,       100000);
-define_pd_global(intx,     Tier4BackEdgeThreshold,       100000);
-
-define_pd_global(intx,     OnStackReplacePercentage,     933  );
-define_pd_global(intx,     FreqInlineSize,               325  );
-define_pd_global(intx,     InlineSmallCode,              1000 );
-define_pd_global(intx,     NewRatio,                     12   );
-define_pd_global(intx,     NewSizeThreadIncrease,        4*K  );
-define_pd_global(intx,     InitialCodeCacheSize,         160*K);
-define_pd_global(intx,     ReservedCodeCacheSize,        32*M );
-define_pd_global(bool,     ProfileInterpreter,           false);
-define_pd_global(intx,     CodeCacheExpansionSize,       32*K );
-define_pd_global(uintx,    CodeCacheMinBlockLength,      1    );
-define_pd_global(uintx,    PermSize,                     12*M );
-define_pd_global(uintx,    MaxPermSize,                  64*M );
-define_pd_global(bool,     NeverActAsServerClassMachine, true );
-define_pd_global(uintx,    DefaultMaxRAM,                1*G  );
-define_pd_global(uint64_t, MaxRAM,                      1ULL*G);
-define_pd_global(bool,     CICompileOSR,                 true );
--- a/ports/hotspot/src/share/vm/includeDB_shark	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,369 +0,0 @@
-//
-// Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
-// Copyright 2008, 2009, 2010 Red Hat, Inc.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// This code is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License version 2 only, as
-// published by the Free Software Foundation.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-// CA 95054 USA or visit www.sun.com if you need additional information or
-// have any questions.
-//
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-ciMethod.cpp                            ciTypeFlow.hpp
-ciMethod.cpp                            methodOop.hpp
-
-ciTypeFlow.cpp                          allocation.inline.hpp
-ciTypeFlow.cpp                          bytecode.hpp
-ciTypeFlow.cpp                          bytecodes.hpp
-ciTypeFlow.cpp                          ciConstant.hpp
-ciTypeFlow.cpp                          ciField.hpp
-ciTypeFlow.cpp                          ciMethod.hpp
-ciTypeFlow.cpp                          ciMethodData.hpp
-ciTypeFlow.cpp                          ciObjArrayKlass.hpp
-ciTypeFlow.cpp                          ciStreams.hpp
-ciTypeFlow.cpp                          ciTypeArrayKlass.hpp
-ciTypeFlow.cpp                          ciTypeFlow.hpp
-ciTypeFlow.cpp                          compileLog.hpp
-ciTypeFlow.cpp                          deoptimization.hpp
-ciTypeFlow.cpp                          growableArray.hpp
-ciTypeFlow.cpp                          shark_globals.hpp
-
-ciTypeFlow.hpp                          ciEnv.hpp
-ciTypeFlow.hpp                          ciKlass.hpp
-ciTypeFlow.hpp                          ciMethodBlocks.hpp
-
-cppInterpreter_<arch>.cpp               shark_globals.hpp
-
-compileBroker.cpp                       sharkCompiler.hpp
-
-globals.hpp                             shark_globals_<arch>.hpp
-
-globals.cpp                             shark_globals.hpp
-
-llvmValue.hpp                           llvmHeaders.hpp
-llvmValue.hpp                           sharkContext.hpp
-llvmValue.hpp                           sharkType.hpp
-
-nmethod.cpp                             sharkCompiler.hpp
-
-sharedRuntime_<arch>.cpp                compileBroker.hpp
-sharedRuntime_<arch>.cpp                sharkCompiler.hpp
-
-shark_globals.cpp                       shark_globals.hpp
-
-shark_globals.hpp                       shark_globals_<arch>.hpp
-shark_globals.hpp                       globals.hpp
-
-sharkBlock.cpp                          debug.hpp
-sharkBlock.cpp                          bytecodes.hpp
-sharkBlock.cpp                          llvmHeaders.hpp
-sharkBlock.cpp                          llvmValue.hpp
-sharkBlock.cpp                          shark_globals.hpp
-sharkBlock.cpp                          sharkBlock.hpp
-sharkBlock.cpp                          sharkBuilder.hpp
-sharkBlock.cpp                          sharkConstant.hpp
-sharkBlock.cpp                          sharkState.hpp
-sharkBlock.cpp                          sharkValue.hpp
-
-sharkBlock.hpp                          allocation.hpp
-sharkBlock.hpp                          ciMethod.hpp
-sharkBlock.hpp                          ciStreams.hpp
-sharkBlock.hpp                          debug.hpp
-sharkBlock.hpp                          llvmHeaders.hpp
-sharkBlock.hpp                          sharkBuilder.hpp
-sharkBlock.hpp                          sharkConstant.hpp
-sharkBlock.hpp                          sharkInvariants.hpp
-sharkBlock.hpp                          sharkState.hpp
-sharkBlock.hpp                          sharkValue.hpp
-
-sharkBuilder.cpp                        ciMethod.hpp
-sharkBuilder.cpp                        debug.hpp
-sharkBuilder.cpp                        llvmHeaders.hpp
-sharkBuilder.cpp                        llvmValue.hpp
-sharkBuilder.cpp                        methodOop.hpp
-sharkBuilder.cpp                        os.hpp
-sharkBuilder.cpp                        resourceArea.hpp
-sharkBuilder.cpp                        llvmHeaders.hpp
-sharkBuilder.cpp                        sharkBuilder.hpp
-sharkBuilder.cpp                        sharkContext.hpp
-sharkBuilder.cpp                        sharkRuntime.hpp
-sharkBuilder.cpp                        synchronizer.hpp
-sharkBuilder.cpp                        thread.hpp
-
-sharkBuilder.hpp                        barrierSet.hpp
-sharkBuilder.hpp                        cardTableModRefBS.hpp
-sharkBuilder.hpp                        ciType.hpp
-sharkBuilder.hpp                        debug.hpp
-sharkBuilder.hpp                        llvmHeaders.hpp
-sharkBuilder.hpp                        llvmValue.hpp
-sharkBuilder.hpp                        sizes.hpp
-sharkBuilder.hpp                        sharkCodeBuffer.hpp
-sharkBuilder.hpp                        sharkType.hpp
-sharkBuilder.hpp                        sharkValue.hpp
-sharkBuilder.hpp                        sharkEntry.hpp
-
-sharkCacheDecache.cpp                   ciMethod.hpp
-sharkCacheDecache.cpp                   debugInfoRec.hpp
-sharkCacheDecache.cpp                   llvmValue.hpp
-sharkCacheDecache.cpp                   sharkBuilder.hpp
-sharkCacheDecache.cpp                   sharkCacheDecache.hpp
-sharkCacheDecache.cpp                   sharkFunction.hpp
-sharkCacheDecache.cpp                   sharkState.hpp
-
-sharkCacheDecache.hpp                   ciMethod.hpp
-sharkCacheDecache.hpp                   debugInfoRec.hpp
-sharkCacheDecache.hpp                   sharkBuilder.hpp
-sharkCacheDecache.hpp                   sharkFunction.hpp
-sharkCacheDecache.hpp                   sharkStateScanner.hpp
-
-sharkCodeBuffer.hpp                     allocation.hpp
-sharkCodeBuffer.hpp                     codeBuffer.hpp
-sharkCodeBuffer.hpp                     llvmHeaders.hpp
-
-sharkCompiler.cpp                       abstractCompiler.hpp
-sharkCompiler.cpp                       ciEnv.hpp
-sharkCompiler.cpp                       ciMethod.hpp
-sharkCompiler.cpp                       debug.hpp
-sharkCompiler.cpp                       debugInfoRec.hpp
-sharkCompiler.cpp                       dependencies.hpp
-sharkCompiler.cpp                       exceptionHandlerTable.hpp
-sharkCompiler.cpp                       llvmHeaders.hpp
-sharkCompiler.cpp                       oopMap.hpp
-sharkCompiler.cpp                       oopRecorder.hpp
-sharkCompiler.cpp                       shark_globals.hpp
-sharkCompiler.cpp                       sharkBuilder.hpp
-sharkCompiler.cpp                       sharkCodeBuffer.hpp
-sharkCompiler.cpp                       sharkCompiler.hpp
-sharkCompiler.cpp                       sharkContext.hpp
-sharkCompiler.cpp                       sharkEntry.hpp
-sharkCompiler.cpp                       sharkFunction.hpp
-sharkCompiler.cpp                       sharkMemoryManager.hpp
-sharkCompiler.cpp                       sharkNativeWrapper.hpp
-
-sharkCompiler.hpp                       abstractCompiler.hpp
-sharkCompiler.hpp                       ciEnv.hpp
-sharkCompiler.hpp                       ciMethod.hpp
-sharkCompiler.hpp                       compileBroker.hpp
-sharkCompiler.hpp                       llvmHeaders.hpp
-sharkCompiler.hpp                       sharkMemoryManager.hpp
-
-sharkContext.cpp                        arrayOop.hpp
-sharkContext.cpp                        globalDefinitions.hpp
-sharkContext.cpp                        llvmHeaders.hpp
-sharkContext.cpp                        oop.hpp
-sharkContext.cpp                        sharkContext.hpp
-
-sharkContext.hpp                        llvmHeaders.hpp
-sharkContext.hpp                        sharkCompiler.hpp
-
-sharkConstant.cpp                       ciInstance.hpp
-sharkConstant.cpp                       ciStreams.hpp
-sharkConstant.cpp                       sharkBuilder.hpp
-sharkConstant.cpp                       sharkConstant.hpp
-sharkConstant.cpp                       sharkValue.hpp
-
-sharkConstant.hpp                       allocation.hpp
-sharkConstant.hpp                       ciStreams.hpp
-sharkConstant.hpp                       sharkBuilder.hpp
-sharkConstant.hpp                       sharkValue.hpp
-
-sharkEntry.hpp                          llvmHeaders.hpp
-
-sharkFunction.cpp                       allocation.hpp
-sharkFunction.cpp                       ciTypeFlow.hpp
-sharkFunction.cpp                       debug.hpp
-sharkFunction.cpp                       llvmHeaders.hpp
-sharkFunction.cpp                       llvmValue.hpp
-sharkFunction.cpp                       shark_globals.hpp
-sharkFunction.cpp                       sharkBuilder.hpp
-sharkFunction.cpp                       sharkEntry.hpp
-sharkFunction.cpp                       sharkFunction.hpp
-sharkFunction.cpp                       sharkState.hpp
-sharkFunction.cpp                       sharkTopLevelBlock.hpp
-
-sharkFunction.hpp                       allocation.hpp
-sharkFunction.hpp                       ciEnv.hpp
-sharkFunction.hpp                       ciStreams.hpp
-sharkFunction.hpp                       ciTypeFlow.hpp
-sharkFunction.hpp                       llvmHeaders.hpp
-sharkFunction.hpp                       llvmValue.hpp
-sharkFunction.hpp                       sharkBuilder.hpp
-sharkFunction.hpp                       sharkContext.hpp
-sharkFunction.hpp                       sharkInvariants.hpp
-sharkFunction.hpp                       sharkStack.hpp
-
-sharkInliner.cpp                        allocation.hpp
-sharkInliner.cpp                        bytecodes.hpp
-sharkInliner.cpp                        ciField.hpp
-sharkInliner.cpp                        ciMethod.hpp
-sharkInliner.cpp                        ciStreams.hpp
-sharkInliner.cpp                        shark_globals.hpp
-sharkInliner.cpp                        sharkBlock.hpp
-sharkInliner.cpp                        sharkConstant.hpp
-sharkInliner.cpp                        sharkInliner.hpp
-sharkInliner.cpp                        sharkIntrinsics.hpp
-sharkInliner.cpp                        sharkState.hpp
-sharkInliner.cpp                        sharkValue.hpp
-
-sharkInliner.hpp                        allocation.hpp
-sharkInliner.hpp                        ciMethod.hpp
-sharkInliner.hpp                        llvmHeaders.hpp
-sharkInliner.hpp                        sharkState.hpp
-
-sharkIntrinsics.cpp                     ciMethod.hpp
-sharkIntrinsics.cpp                     llvmHeaders.hpp
-sharkIntrinsics.cpp                     shark_globals.hpp
-sharkIntrinsics.cpp                     sharkIntrinsics.hpp
-sharkIntrinsics.cpp                     sharkState.hpp
-sharkIntrinsics.cpp                     sharkValue.hpp
-
-sharkIntrinsics.hpp                     allocation.hpp
-sharkIntrinsics.hpp                     ciMethod.hpp
-sharkIntrinsics.hpp                     llvmHeaders.hpp
-sharkIntrinsics.hpp                     sharkState.hpp
-
-sharkInvariants.cpp                     sharkInvariants.hpp
-
-sharkInvariants.hpp                     allocation.hpp
-sharkInvariants.hpp                     ciEnv.hpp
-sharkInvariants.hpp                     ciMethod.hpp
-sharkInvariants.hpp                     ciInstanceKlass.hpp
-sharkInvariants.hpp                     ciTypeFlow.hpp
-sharkInvariants.hpp                     debugInfoRec.hpp
-sharkInvariants.hpp                     dependencies.hpp
-sharkInvariants.hpp                     llvmHeaders.hpp
-sharkInvariants.hpp                     sharkBuilder.hpp
-
-sharkMemoryManager.hpp                  llvmHeaders.hpp
-sharkMemoryManager.hpp                  sharkEntry.hpp
-
-sharkMemoryManager.cpp                  llvmHeaders.hpp
-sharkMemoryManager.cpp                  sharkEntry.hpp
-sharkMemoryManager.cpp                  sharkMemoryManager.hpp
-
-sharkNativeWrapper.cpp                  llvmHeaders.hpp
-sharkNativeWrapper.cpp                  sharkNativeWrapper.hpp
-sharkNativeWrapper.cpp                  sharkType.hpp
-
-sharkNativeWrapper.hpp                  handles.hpp
-sharkNativeWrapper.hpp                  llvmHeaders.hpp
-sharkNativeWrapper.hpp                  sharkBuilder.hpp
-sharkNativeWrapper.hpp                  sharkContext.hpp
-sharkNativeWrapper.hpp                  sharkInvariants.hpp
-sharkNativeWrapper.hpp                  sharkStack.hpp
-
-sharkRuntime.cpp                        biasedLocking.hpp
-sharkRuntime.cpp                        deoptimization.hpp
-sharkRuntime.cpp                        llvmHeaders.hpp
-sharkRuntime.cpp                        klassOop.hpp
-sharkRuntime.cpp                        sharkRuntime.hpp
-sharkRuntime.cpp                        stack_<arch>.inline.hpp
-sharkRuntime.cpp                        thread.hpp
-
-sharkRuntime.hpp                        allocation.hpp
-sharkRuntime.hpp                        llvmHeaders.hpp
-sharkRuntime.hpp                        llvmValue.hpp
-sharkRuntime.hpp                        klassOop.hpp
-sharkRuntime.hpp                        thread.hpp
-
-sharkStack.cpp                          llvmHeaders.hpp
-sharkStack.cpp                          sharkFunction.hpp
-sharkStack.cpp                          sharkNativeWrapper.hpp
-sharkStack.cpp                          sharkStack.hpp
-sharkStack.cpp                          sharkType.hpp
-
-sharkStack.hpp                          llvmHeaders.hpp
-sharkStack.hpp                          sharkInvariants.hpp
-sharkStack.hpp                          sharkType.hpp
-
-sharkState.cpp                          allocation.hpp
-sharkState.cpp                          ciType.hpp
-sharkState.cpp                          ciTypeFlow.hpp
-sharkState.cpp                          sharkBuilder.hpp
-sharkState.cpp                          sharkCacheDecache.hpp
-sharkState.cpp                          sharkState.hpp
-sharkState.cpp                          sharkTopLevelBlock.hpp
-sharkState.cpp                          sharkType.hpp
-sharkState.cpp                          sharkValue.hpp
-
-sharkState.hpp                          allocation.hpp
-sharkState.hpp                          ciMethod.hpp
-sharkState.hpp                          llvmHeaders.hpp
-sharkState.hpp                          sharkBuilder.hpp
-sharkState.hpp                          sharkInvariants.hpp
-sharkState.hpp                          sharkValue.hpp
-
-sharkStateScanner.cpp                   sharkState.hpp
-sharkStateScanner.cpp                   sharkStateScanner.hpp
-
-sharkStateScanner.hpp                   allocation.hpp
-sharkStateScanner.hpp                   llvmHeaders.hpp
-sharkStateScanner.hpp                   sharkFunction.hpp
-sharkStateScanner.hpp                   sharkInvariants.hpp
-
-sharkTopLevelBlock.cpp                  allocation.hpp
-sharkTopLevelBlock.cpp                  bytecodes.hpp
-sharkTopLevelBlock.cpp                  ciField.hpp
-sharkTopLevelBlock.cpp                  ciInstance.hpp
-sharkTopLevelBlock.cpp                  ciObjArrayKlass.hpp
-sharkTopLevelBlock.cpp                  ciStreams.hpp
-sharkTopLevelBlock.cpp                  ciType.hpp
-sharkTopLevelBlock.cpp                  ciTypeFlow.hpp
-sharkTopLevelBlock.cpp                  debug.hpp
-sharkTopLevelBlock.cpp                  deoptimization.hpp
-sharkTopLevelBlock.cpp                  llvmHeaders.hpp
-sharkTopLevelBlock.cpp                  llvmValue.hpp
-sharkTopLevelBlock.cpp                  shark_globals.hpp
-sharkTopLevelBlock.cpp                  sharkCacheDecache.hpp
-sharkTopLevelBlock.cpp                  sharkTopLevelBlock.hpp
-sharkTopLevelBlock.cpp                  sharkBuilder.hpp
-sharkTopLevelBlock.cpp                  sharkConstant.hpp
-sharkTopLevelBlock.cpp                  sharkInliner.hpp
-sharkTopLevelBlock.cpp                  sharkState.hpp
-sharkTopLevelBlock.cpp                  sharkValue.hpp
-
-sharkTopLevelBlock.hpp                  allocation.hpp
-sharkTopLevelBlock.hpp                  bytecodes.hpp
-sharkTopLevelBlock.hpp                  ciStreams.hpp
-sharkTopLevelBlock.hpp                  ciType.hpp
-sharkTopLevelBlock.hpp                  ciTypeFlow.hpp
-sharkTopLevelBlock.hpp                  llvmHeaders.hpp
-sharkTopLevelBlock.hpp                  sharkBlock.hpp
-sharkTopLevelBlock.hpp                  sharkBuilder.hpp
-sharkTopLevelBlock.hpp                  sharkFunction.hpp
-sharkTopLevelBlock.hpp                  sharkState.hpp
-sharkTopLevelBlock.hpp                  sharkValue.hpp
-
-sharkType.hpp                           allocation.hpp
-sharkType.hpp                           ciType.hpp
-sharkType.hpp                           globalDefinitions.hpp
-sharkType.hpp                           llvmHeaders.hpp
-sharkType.hpp                           sharkContext.hpp
-
-sharkValue.cpp                          ciType.hpp
-sharkValue.cpp                          llvmHeaders.hpp
-sharkValue.cpp                          llvmValue.hpp
-sharkValue.cpp                          sharkBuilder.hpp
-sharkValue.cpp                          sharkValue.hpp
-
-sharkValue.hpp                          allocation.hpp
-sharkValue.hpp                          ciType.hpp
-sharkValue.hpp                          llvmHeaders.hpp
-sharkValue.hpp                          llvmValue.hpp
-sharkValue.hpp                          sharkType.hpp
--- a/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#ifdef assert
-  #undef assert
-#endif
-
-#ifdef DEBUG
-  #define SHARK_DEBUG
-  #undef DEBUG
-#endif
-
-#include <llvm/Argument.h>
-#include <llvm/Constants.h>
-#include <llvm/DerivedTypes.h>
-#include <llvm/ExecutionEngine/ExecutionEngine.h>
-#include <llvm/Instructions.h>
-#include <llvm/LLVMContext.h>
-#include <llvm/Module.h>
-#if SHARK_LLVM_VERSION < 27
-#include <llvm/ModuleProvider.h>
-#endif
-#include <llvm/Support/IRBuilder.h>
-#include <llvm/System/Threading.h>
-#include <llvm/Target/TargetSelect.h>
-#include <llvm/Type.h>
-#include <llvm/ExecutionEngine/JITMemoryManager.h>
-#include <llvm/Support/CommandLine.h>
-#if SHARK_LLVM_VERSION >= 27
-#include <llvm/ExecutionEngine/JIT.h>
-#include <llvm/ADT/StringMap.h>
-#include <llvm/Support/Debug.h>
-#include <llvm/System/Host.h>
-#endif
-
-#include <map>
-
-#ifdef assert
-  #undef assert
-#endif
-
-// from hotspot/src/share/vm/utilities/debug.hpp
-#ifdef ASSERT
-  #define assert(p, msg)                                          \
-    if (!(p)) {                                                  \
-      report_assertion_failure(__FILE__, __LINE__,               \
-                              "assert(" XSTR(p) ",\"" msg "\")");\
-      BREAKPOINT;                                                \
-    }
-#else
-  #define assert(p, msg)
-#endif
-
-#ifdef DEBUG
-  #undef DEBUG
-#endif
-#ifdef SHARK_DEBUG
-  #define DEBUG
-  #undef SHARK_DEBUG
-#endif
--- a/ports/hotspot/src/share/vm/shark/llvmValue.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class LLVMValue : public AllStatic {
- public:
-  static llvm::ConstantInt* jbyte_constant(jbyte value)
-  {
-    return llvm::ConstantInt::get(SharkType::jbyte_type(), value, true);
-  }
-  static llvm::ConstantInt* jint_constant(jint value)
-  {
-    return llvm::ConstantInt::get(SharkType::jint_type(), value, true);
-  }
-  static llvm::ConstantInt* jlong_constant(jlong value)
-  {
-    return llvm::ConstantInt::get(SharkType::jlong_type(), value, true);
-  }
-  static llvm::ConstantFP* jfloat_constant(jfloat value)
-  {
-    return llvm::ConstantFP::get(SharkContext::current(), llvm::APFloat(value));
-  }
-  static llvm::ConstantFP* jdouble_constant(jdouble value)
-  {
-    return llvm::ConstantFP::get(SharkContext::current(), llvm::APFloat(value));
-  }
-  static llvm::ConstantPointerNull* null()
-  {
-    return llvm::ConstantPointerNull::get(SharkType::oop_type());
-  }
-
- public:
-  static llvm::ConstantInt* bit_constant(int value)
-  {
-    return llvm::ConstantInt::get(SharkType::bit_type(), value, false);
-  }
-  static llvm::ConstantInt* intptr_constant(intptr_t value)
-  {
-    return llvm::ConstantInt::get(SharkType::intptr_type(), value, false);
-  }
-};
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1260 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkBlock.cpp.incl"
-
-using namespace llvm;
-
-void SharkBlock::parse_bytecode(int start, int limit) {
-  SharkValue *a, *b, *c, *d;
-  int i;
-
-  // Ensure the current state is initialized before we emit any code,
-  // so that any setup code for the state is at the start of the block
-  current_state();
-
-  // Parse the bytecodes
-  iter()->reset_to_bci(start);
-  while (iter()->next_bci() < limit) {
-    NOT_PRODUCT(a = b = c = d = NULL);
-    iter()->next();
-
-    if (SharkTraceBytecodes)
-      tty->print_cr("%4d: %s", bci(), Bytecodes::name(bc()));
-
-    if (has_trap() && trap_bci() == bci()) {
-      do_trap(trap_request());
-      return;
-    }
-
-    if (UseLoopSafepoints) {
-      // XXX if a lcmp is followed by an if_?? then C2 maybe-inserts
-      // the safepoint before the lcmp rather than before the if.
-      // Maybe we should do this too.  See parse2.cpp for details.
-      switch (bc()) {
-      case Bytecodes::_goto:
-      case Bytecodes::_ifnull:
-      case Bytecodes::_ifnonnull:
-      case Bytecodes::_if_acmpeq:
-      case Bytecodes::_if_acmpne:
-      case Bytecodes::_ifeq:
-      case Bytecodes::_ifne:
-      case Bytecodes::_iflt:
-      case Bytecodes::_ifle:
-      case Bytecodes::_ifgt:
-      case Bytecodes::_ifge:
-      case Bytecodes::_if_icmpeq:
-      case Bytecodes::_if_icmpne:
-      case Bytecodes::_if_icmplt:
-      case Bytecodes::_if_icmple:
-      case Bytecodes::_if_icmpgt:
-      case Bytecodes::_if_icmpge:
-        if (iter()->get_dest() <= bci())
-          maybe_add_backedge_safepoint();
-        break;
-
-      case Bytecodes::_goto_w:
-        if (iter()->get_far_dest() <= bci())
-          maybe_add_backedge_safepoint();
-        break;
-
-      case Bytecodes::_tableswitch:
-      case Bytecodes::_lookupswitch:
-        if (switch_default_dest() <= bci()) {
-          maybe_add_backedge_safepoint();
-          break;
-        }
-        int len = switch_table_length();
-        for (int i = 0; i < len; i++) {
-          if (switch_dest(i) <= bci()) {
-            maybe_add_backedge_safepoint();
-            break;
-          }
-        }
-        break;
-      }
-    }
-
-    switch (bc()) {
-    case Bytecodes::_nop:
-      break;
-
-    case Bytecodes::_aconst_null:
-      push(SharkValue::null());
-      break;
-
-    case Bytecodes::_iconst_m1:
-      push(SharkValue::jint_constant(-1));
-      break;
-    case Bytecodes::_iconst_0:
-      push(SharkValue::jint_constant(0));
-      break;
-    case Bytecodes::_iconst_1:
-      push(SharkValue::jint_constant(1));
-      break;
-    case Bytecodes::_iconst_2:
-      push(SharkValue::jint_constant(2));
-      break;
-    case Bytecodes::_iconst_3:
-      push(SharkValue::jint_constant(3));
-      break;
-    case Bytecodes::_iconst_4:
-      push(SharkValue::jint_constant(4));
-      break;
-    case Bytecodes::_iconst_5:
-      push(SharkValue::jint_constant(5));
-      break;
-
-    case Bytecodes::_lconst_0:
-      push(SharkValue::jlong_constant(0));
-      break;
-    case Bytecodes::_lconst_1:
-      push(SharkValue::jlong_constant(1));
-      break;
-
-    case Bytecodes::_fconst_0:
-      push(SharkValue::jfloat_constant(0));
-      break;
-    case Bytecodes::_fconst_1:
-      push(SharkValue::jfloat_constant(1));
-      break;
-    case Bytecodes::_fconst_2:
-      push(SharkValue::jfloat_constant(2));
-      break;
-
-    case Bytecodes::_dconst_0:
-      push(SharkValue::jdouble_constant(0));
-      break;
-    case Bytecodes::_dconst_1:
-      push(SharkValue::jdouble_constant(1));
-      break;
-
-    case Bytecodes::_bipush:
-      push(SharkValue::jint_constant(iter()->get_byte()));
-      break;
-    case Bytecodes::_sipush:
-      push(SharkValue::jint_constant(iter()->get_short()));
-      break;
-
-    case Bytecodes::_ldc:
-    case Bytecodes::_ldc_w:
-    case Bytecodes::_ldc2_w:
-      push(SharkConstant::for_ldc(iter())->value(builder()));
-      break;
-
-    case Bytecodes::_iload_0:
-    case Bytecodes::_lload_0:
-    case Bytecodes::_fload_0:
-    case Bytecodes::_dload_0:
-    case Bytecodes::_aload_0:
-      push(local(0));
-      break;
-    case Bytecodes::_iload_1:
-    case Bytecodes::_lload_1:
-    case Bytecodes::_fload_1:
-    case Bytecodes::_dload_1:
-    case Bytecodes::_aload_1:
-      push(local(1));
-      break;
-    case Bytecodes::_iload_2:
-    case Bytecodes::_lload_2:
-    case Bytecodes::_fload_2:
-    case Bytecodes::_dload_2:
-    case Bytecodes::_aload_2:
-      push(local(2));
-      break;
-    case Bytecodes::_iload_3:
-    case Bytecodes::_lload_3:
-    case Bytecodes::_fload_3:
-    case Bytecodes::_dload_3:
-    case Bytecodes::_aload_3:
-      push(local(3));
-      break;
-    case Bytecodes::_iload:
-    case Bytecodes::_lload:
-    case Bytecodes::_fload:
-    case Bytecodes::_dload:
-    case Bytecodes::_aload:
-      push(local(iter()->get_index()));
-      break;
-
-    case Bytecodes::_baload:
-      do_aload(T_BYTE);
-      break;
-    case Bytecodes::_caload:
-      do_aload(T_CHAR);
-      break;
-    case Bytecodes::_saload:
-      do_aload(T_SHORT);
-      break;
-    case Bytecodes::_iaload:
-      do_aload(T_INT);
-      break;
-    case Bytecodes::_laload:
-      do_aload(T_LONG);
-      break;
-    case Bytecodes::_faload:
-      do_aload(T_FLOAT);
-      break;
-    case Bytecodes::_daload:
-      do_aload(T_DOUBLE);
-      break;
-    case Bytecodes::_aaload:
-      do_aload(T_OBJECT);
-      break;
-
-    case Bytecodes::_istore_0:
-    case Bytecodes::_lstore_0:
-    case Bytecodes::_fstore_0:
-    case Bytecodes::_dstore_0:
-    case Bytecodes::_astore_0:
-      set_local(0, pop());
-      break;
-    case Bytecodes::_istore_1:
-    case Bytecodes::_lstore_1:
-    case Bytecodes::_fstore_1:
-    case Bytecodes::_dstore_1:
-    case Bytecodes::_astore_1:
-      set_local(1, pop());
-      break;
-    case Bytecodes::_istore_2:
-    case Bytecodes::_lstore_2:
-    case Bytecodes::_fstore_2:
-    case Bytecodes::_dstore_2:
-    case Bytecodes::_astore_2:
-      set_local(2, pop());
-      break;
-    case Bytecodes::_istore_3:
-    case Bytecodes::_lstore_3:
-    case Bytecodes::_fstore_3:
-    case Bytecodes::_dstore_3:
-    case Bytecodes::_astore_3:
-      set_local(3, pop());
-      break;
-    case Bytecodes::_istore:
-    case Bytecodes::_lstore:
-    case Bytecodes::_fstore:
-    case Bytecodes::_dstore:
-    case Bytecodes::_astore:
-      set_local(iter()->get_index(), pop());
-      break;
-
-    case Bytecodes::_bastore:
-      do_astore(T_BYTE);
-      break;
-    case Bytecodes::_castore:
-      do_astore(T_CHAR);
-      break;
-    case Bytecodes::_sastore:
-      do_astore(T_SHORT);
-      break;
-    case Bytecodes::_iastore:
-      do_astore(T_INT);
-      break;
-    case Bytecodes::_lastore:
-      do_astore(T_LONG);
-      break;
-    case Bytecodes::_fastore:
-      do_astore(T_FLOAT);
-      break;
-    case Bytecodes::_dastore:
-      do_astore(T_DOUBLE);
-      break;
-    case Bytecodes::_aastore:
-      do_astore(T_OBJECT);
-      break;
-
-    case Bytecodes::_pop:
-      xpop();
-      break;
-    case Bytecodes::_pop2:
-      xpop();
-      xpop();
-      break;
-    case Bytecodes::_swap:
-      a = xpop();
-      b = xpop();
-      xpush(a);
-      xpush(b);
-      break;
-    case Bytecodes::_dup:
-      a = xpop();
-      xpush(a);
-      xpush(a);
-      break;
-    case Bytecodes::_dup_x1:
-      a = xpop();
-      b = xpop();
-      xpush(a);
-      xpush(b);
-      xpush(a);
-      break;
-    case Bytecodes::_dup_x2:
-      a = xpop();
-      b = xpop();
-      c = xpop();
-      xpush(a);
-      xpush(c);
-      xpush(b);
-      xpush(a);
-      break;
-    case Bytecodes::_dup2:
-      a = xpop();
-      b = xpop();
-      xpush(b);
-      xpush(a);
-      xpush(b);
-      xpush(a);
-      break;
-    case Bytecodes::_dup2_x1:
-      a = xpop();
-      b = xpop();
-      c = xpop();
-      xpush(b);
-      xpush(a);
-      xpush(c);
-      xpush(b);
-      xpush(a);
-      break;
-    case Bytecodes::_dup2_x2:
-      a = xpop();
-      b = xpop();
-      c = xpop();
-      d = xpop();
-      xpush(b);
-      xpush(a);
-      xpush(d);
-      xpush(c);
-      xpush(b);
-      xpush(a);
-      break;
-
-    case Bytecodes::_arraylength:
-      do_arraylength();
-      break;
-
-    case Bytecodes::_getfield:
-      do_getfield();
-      break;
-    case Bytecodes::_getstatic:
-      do_getstatic();
-      break;
-    case Bytecodes::_putfield:
-      do_putfield();
-      break;
-    case Bytecodes::_putstatic:
-      do_putstatic();
-      break;
-
-    case Bytecodes::_iadd:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateAdd(a->jint_value(), b->jint_value()), false));
-      break;
-    case Bytecodes::_isub:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateSub(a->jint_value(), b->jint_value()), false));
-      break;
-    case Bytecodes::_imul:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateMul(a->jint_value(), b->jint_value()), false));
-      break;
-    case Bytecodes::_idiv:
-      do_idiv();
-      break;
-    case Bytecodes::_irem:
-      do_irem();
-      break;
-    case Bytecodes::_ineg:
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateNeg(a->jint_value()), a->zero_checked()));
-      break;
-    case Bytecodes::_ishl:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateShl(
-          a->jint_value(),
-          builder()->CreateAnd(
-            b->jint_value(), LLVMValue::jint_constant(0x1f))), false));
-      break;
-    case Bytecodes::_ishr:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateAShr(
-          a->jint_value(),
-          builder()->CreateAnd(
-            b->jint_value(), LLVMValue::jint_constant(0x1f))), false));
-      break;
-    case Bytecodes::_iushr:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateLShr(
-          a->jint_value(),
-          builder()->CreateAnd(
-            b->jint_value(), LLVMValue::jint_constant(0x1f))), false));
-      break;
-    case Bytecodes::_iand:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateAnd(a->jint_value(), b->jint_value()), false));
-      break;
-    case Bytecodes::_ior:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateOr(a->jint_value(), b->jint_value()),
-        a->zero_checked() && b->zero_checked()));
-      break;
-    case Bytecodes::_ixor:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jint(
-        builder()->CreateXor(a->jint_value(), b->jint_value()), false));
-      break;
-
-    case Bytecodes::_ladd:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateAdd(a->jlong_value(), b->jlong_value()), false));
-      break;
-    case Bytecodes::_lsub:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateSub(a->jlong_value(), b->jlong_value()), false));
-      break;
-    case Bytecodes::_lmul:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateMul(a->jlong_value(), b->jlong_value()), false));
-      break;
-    case Bytecodes::_ldiv:
-      do_ldiv();
-      break;
-    case Bytecodes::_lrem:
-      do_lrem();
-      break;
-    case Bytecodes::_lneg:
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateNeg(a->jlong_value()), a->zero_checked()));
-      break;
-    case Bytecodes::_lshl:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateShl(
-          a->jlong_value(),
-          builder()->CreateIntCast(
-            builder()->CreateAnd(
-              b->jint_value(), LLVMValue::jint_constant(0x3f)),
-            SharkType::jlong_type(), true)), false));
-      break;
-    case Bytecodes::_lshr:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateAShr(
-          a->jlong_value(),
-          builder()->CreateIntCast(
-            builder()->CreateAnd(
-              b->jint_value(), LLVMValue::jint_constant(0x3f)),
-            SharkType::jlong_type(), true)), false));
-      break;
-    case Bytecodes::_lushr:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateLShr(
-          a->jlong_value(),
-          builder()->CreateIntCast(
-            builder()->CreateAnd(
-              b->jint_value(), LLVMValue::jint_constant(0x3f)),
-            SharkType::jlong_type(), true)), false));
-      break;
-    case Bytecodes::_land:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateAnd(a->jlong_value(), b->jlong_value()), false));
-      break;
-    case Bytecodes::_lor:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateOr(a->jlong_value(), b->jlong_value()),
-        a->zero_checked() && b->zero_checked()));
-      break;
-    case Bytecodes::_lxor:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateXor(a->jlong_value(), b->jlong_value()), false));
-      break;
-
-    case Bytecodes::_fadd:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jfloat(
-        builder()->CreateFAdd(a->jfloat_value(), b->jfloat_value())));
-      break;
-    case Bytecodes::_fsub:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jfloat(
-        builder()->CreateFSub(a->jfloat_value(), b->jfloat_value())));
-      break;
-    case Bytecodes::_fmul:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jfloat(
-        builder()->CreateFMul(a->jfloat_value(), b->jfloat_value())));
-      break;
-    case Bytecodes::_fdiv:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jfloat(
-        builder()->CreateFDiv(a->jfloat_value(), b->jfloat_value())));
-      break;
-    case Bytecodes::_frem:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jfloat(
-        builder()->CreateFRem(a->jfloat_value(), b->jfloat_value())));
-      break;
-    case Bytecodes::_fneg:
-      a = pop();
-      push(SharkValue::create_jfloat(
-        builder()->CreateFNeg(a->jfloat_value())));
-      break;
-
-    case Bytecodes::_dadd:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jdouble(
-        builder()->CreateFAdd(a->jdouble_value(), b->jdouble_value())));
-      break;
-    case Bytecodes::_dsub:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jdouble(
-        builder()->CreateFSub(a->jdouble_value(), b->jdouble_value())));
-      break;
-    case Bytecodes::_dmul:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jdouble(
-        builder()->CreateFMul(a->jdouble_value(), b->jdouble_value())));
-      break;
-    case Bytecodes::_ddiv:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jdouble(
-        builder()->CreateFDiv(a->jdouble_value(), b->jdouble_value())));
-      break;
-    case Bytecodes::_drem:
-      b = pop();
-      a = pop();
-      push(SharkValue::create_jdouble(
-        builder()->CreateFRem(a->jdouble_value(), b->jdouble_value())));
-      break;
-    case Bytecodes::_dneg:
-      a = pop();
-      push(SharkValue::create_jdouble(
-        builder()->CreateFNeg(a->jdouble_value())));
-      break;
-
-    case Bytecodes::_iinc:
-      i = iter()->get_index();
-      set_local(
-        i,
-        SharkValue::create_jint(
-          builder()->CreateAdd(
-            LLVMValue::jint_constant(iter()->get_iinc_con()),
-            local(i)->jint_value()), false));
-      break;
-
-    case Bytecodes::_lcmp:
-      do_lcmp();
-      break;
-
-    case Bytecodes::_fcmpl:
-      do_fcmp(false, false);
-      break;
-    case Bytecodes::_fcmpg:
-      do_fcmp(false, true);
-      break;
-    case Bytecodes::_dcmpl:
-      do_fcmp(true, false);
-      break;
-    case Bytecodes::_dcmpg:
-      do_fcmp(true, true);
-      break;
-
-    case Bytecodes::_i2l:
-      a = pop();
-      push(SharkValue::create_jlong(
-        builder()->CreateIntCast(
-          a->jint_value(), SharkType::jlong_type(), true), a->zero_checked()));
-      break;
-    case Bytecodes::_i2f:
-      push(SharkValue::create_jfloat(
-        builder()->CreateSIToFP(
-          pop()->jint_value(), SharkType::jfloat_type())));
-      break;
-    case Bytecodes::_i2d:
-      push(SharkValue::create_jdouble(
-        builder()->CreateSIToFP(
-          pop()->jint_value(), SharkType::jdouble_type())));
-      break;
-
-    case Bytecodes::_l2i:
-      push(SharkValue::create_jint(
-        builder()->CreateIntCast(
-          pop()->jlong_value(), SharkType::jint_type(), true), false));
-      break;
-    case Bytecodes::_l2f:
-      push(SharkValue::create_jfloat(
-        builder()->CreateSIToFP(
-          pop()->jlong_value(), SharkType::jfloat_type())));
-      break;
-    case Bytecodes::_l2d:
-      push(SharkValue::create_jdouble(
-        builder()->CreateSIToFP(
-          pop()->jlong_value(), SharkType::jdouble_type())));
-      break;
-
-    case Bytecodes::_f2i:
-      push(SharkValue::create_jint(
-        builder()->CreateCall(
-          builder()->f2i(), pop()->jfloat_value()), false));
-      break;
-    case Bytecodes::_f2l:
-      push(SharkValue::create_jlong(
-        builder()->CreateCall(
-          builder()->f2l(), pop()->jfloat_value()), false));
-      break;
-    case Bytecodes::_f2d:
-      push(SharkValue::create_jdouble(
-        builder()->CreateFPExt(
-          pop()->jfloat_value(), SharkType::jdouble_type())));
-      break;
-
-    case Bytecodes::_d2i:
-      push(SharkValue::create_jint(
-        builder()->CreateCall(
-          builder()->d2i(), pop()->jdouble_value()), false));
-      break;
-    case Bytecodes::_d2l:
-      push(SharkValue::create_jlong(
-        builder()->CreateCall(
-          builder()->d2l(), pop()->jdouble_value()), false));
-      break;
-    case Bytecodes::_d2f:
-      push(SharkValue::create_jfloat(
-        builder()->CreateFPTrunc(
-          pop()->jdouble_value(), SharkType::jfloat_type())));
-      break;
-
-    case Bytecodes::_i2b:
-      push(SharkValue::create_jint(
-        builder()->CreateAShr(
-          builder()->CreateShl(
-            pop()->jint_value(),
-            LLVMValue::jint_constant(24)),
-          LLVMValue::jint_constant(24)), false));
-      break;
-    case Bytecodes::_i2c:
-      push(SharkValue::create_jint(
-        builder()->CreateAnd(
-            pop()->jint_value(),
-            LLVMValue::jint_constant(0xffff)), false));
-      break;
-    case Bytecodes::_i2s:
-      push(SharkValue::create_jint(
-        builder()->CreateAShr(
-          builder()->CreateShl(
-            pop()->jint_value(),
-            LLVMValue::jint_constant(16)),
-          LLVMValue::jint_constant(16)), false));
-      break;
-
-    case Bytecodes::_return:
-      do_return(T_VOID);
-      break;
-    case Bytecodes::_ireturn:
-      do_return(T_INT);
-      break;
-    case Bytecodes::_lreturn:
-      do_return(T_LONG);
-      break;
-    case Bytecodes::_freturn:
-      do_return(T_FLOAT);
-      break;
-    case Bytecodes::_dreturn:
-      do_return(T_DOUBLE);
-      break;
-    case Bytecodes::_areturn:
-      do_return(T_OBJECT);
-      break;
-
-    case Bytecodes::_athrow:
-      do_athrow();
-      break;
-
-    case Bytecodes::_goto:
-    case Bytecodes::_goto_w:
-      do_goto();
-      break;
-
-    case Bytecodes::_jsr:
-    case Bytecodes::_jsr_w:
-      do_jsr();
-      break;
-
-    case Bytecodes::_ret:
-      do_ret();
-      break;
-
-    case Bytecodes::_ifnull:
-      do_if(ICmpInst::ICMP_EQ, SharkValue::null(), pop());
-      break;
-    case Bytecodes::_ifnonnull:
-      do_if(ICmpInst::ICMP_NE, SharkValue::null(), pop());
-      break;
-    case Bytecodes::_if_acmpeq:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_EQ, b, a);
-      break;
-    case Bytecodes::_if_acmpne:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_NE, b, a);
-      break;
-    case Bytecodes::_ifeq:
-      do_if(ICmpInst::ICMP_EQ, SharkValue::jint_constant(0), pop());
-      break;
-    case Bytecodes::_ifne:
-      do_if(ICmpInst::ICMP_NE, SharkValue::jint_constant(0), pop());
-      break;
-    case Bytecodes::_iflt:
-      do_if(ICmpInst::ICMP_SLT, SharkValue::jint_constant(0), pop());
-      break;
-    case Bytecodes::_ifle:
-      do_if(ICmpInst::ICMP_SLE, SharkValue::jint_constant(0), pop());
-      break;
-    case Bytecodes::_ifgt:
-      do_if(ICmpInst::ICMP_SGT, SharkValue::jint_constant(0), pop());
-      break;
-    case Bytecodes::_ifge:
-      do_if(ICmpInst::ICMP_SGE, SharkValue::jint_constant(0), pop());
-      break;
-    case Bytecodes::_if_icmpeq:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_EQ, b, a);
-      break;
-    case Bytecodes::_if_icmpne:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_NE, b, a);
-      break;
-    case Bytecodes::_if_icmplt:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_SLT, b, a);
-      break;
-    case Bytecodes::_if_icmple:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_SLE, b, a);
-      break;
-    case Bytecodes::_if_icmpgt:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_SGT, b, a);
-      break;
-    case Bytecodes::_if_icmpge:
-      b = pop();
-      a = pop();
-      do_if(ICmpInst::ICMP_SGE, b, a);
-      break;
-
-    case Bytecodes::_tableswitch:
-    case Bytecodes::_lookupswitch:
-      do_switch();
-      break;
-
-    case Bytecodes::_invokestatic:
-    case Bytecodes::_invokespecial:
-    case Bytecodes::_invokevirtual:
-    case Bytecodes::_invokeinterface:
-      do_call();
-      break;
-
-    case Bytecodes::_instanceof:
-      // This is a very common construct:
-      //
-      //  if (object instanceof Klass) {
-      //    something = (Klass) object;
-      //    ...
-      //  }
-      //
-      // which gets compiled to something like this:
-      //
-      //  28: aload 9
-      //  30: instanceof <Class Klass>
-      //  33: ifeq 52
-      //  36: aload 9
-      //  38: checkcast <Class Klass>
-      //
-      // Handling both bytecodes at once allows us
-      // to eliminate the checkcast.
-      if (iter()->next_bci() < limit &&
-          (iter()->next_bc() == Bytecodes::_ifeq ||
-           iter()->next_bc() == Bytecodes::_ifne) &&
-          (!UseLoopSafepoints ||
-           iter()->next_get_dest() > iter()->next_bci())) {
-        if (maybe_do_instanceof_if()) {
-          iter()->next();
-          if (SharkTraceBytecodes)
-            tty->print_cr("%4d: %s", bci(), Bytecodes::name(bc()));
-          break;
-        }
-      }
-      // fall through
-    case Bytecodes::_checkcast:
-      do_instance_check();
-      break;
-
-    case Bytecodes::_new:
-      do_new();
-      break;
-    case Bytecodes::_newarray:
-      do_newarray();
-      break;
-    case Bytecodes::_anewarray:
-      do_anewarray();
-      break;
-    case Bytecodes::_multianewarray:
-      do_multianewarray();
-      break;
-
-    case Bytecodes::_monitorenter:
-      do_monitorenter();
-      break;
-    case Bytecodes::_monitorexit:
-      do_monitorexit();
-      break;
-
-    default:
-      ShouldNotReachHere();
-    }
-  }
-}
-
-SharkState* SharkBlock::initial_current_state() {
-  return entry_state()->copy();
-}
-
-int SharkBlock::switch_default_dest() {
-  return iter()->get_dest_table(0);
-}
-
-int SharkBlock::switch_table_length() {
-  switch(bc()) {
-  case Bytecodes::_tableswitch:
-    return iter()->get_int_table(2) - iter()->get_int_table(1) + 1;
-
-  case Bytecodes::_lookupswitch:
-    return iter()->get_int_table(1);
-
-  default:
-    ShouldNotReachHere();
-  }
-}
-
-int SharkBlock::switch_key(int i) {
-  switch(bc()) {
-  case Bytecodes::_tableswitch:
-    return iter()->get_int_table(1) + i;
-
-  case Bytecodes::_lookupswitch:
-    return iter()->get_int_table(2 + 2 * i);
-
-  default:
-    ShouldNotReachHere();
-  }
-}
-
-int SharkBlock::switch_dest(int i) {
-  switch(bc()) {
-  case Bytecodes::_tableswitch:
-    return iter()->get_dest_table(i + 3);
-
-  case Bytecodes::_lookupswitch:
-    return iter()->get_dest_table(2 + 2 * i + 1);
-
-  default:
-    ShouldNotReachHere();
-  }
-}
-
-void SharkBlock::do_div_or_rem(bool is_long, bool is_rem) {
-  SharkValue *sb = pop();
-  SharkValue *sa = pop();
-
-  check_divide_by_zero(sb);
-
-  Value *a, *b, *p, *q;
-  if (is_long) {
-    a = sa->jlong_value();
-    b = sb->jlong_value();
-    p = LLVMValue::jlong_constant(0x8000000000000000LL);
-    q = LLVMValue::jlong_constant(-1);
-  }
-  else {
-    a = sa->jint_value();
-    b = sb->jint_value();
-    p = LLVMValue::jint_constant(0x80000000);
-    q = LLVMValue::jint_constant(-1);
-  }
-
-  BasicBlock *ip           = builder()->GetBlockInsertionPoint();
-  BasicBlock *special_case = builder()->CreateBlock(ip, "special_case");
-  BasicBlock *general_case = builder()->CreateBlock(ip, "general_case");
-  BasicBlock *done         = builder()->CreateBlock(ip, "done");
-
-  builder()->CreateCondBr(
-    builder()->CreateAnd(
-      builder()->CreateICmpEQ(a, p),
-      builder()->CreateICmpEQ(b, q)),
-    special_case, general_case);
-
-  builder()->SetInsertPoint(special_case);
-  Value *special_result;
-  if (is_rem) {
-    if (is_long)
-      special_result = LLVMValue::jlong_constant(0);
-    else
-      special_result = LLVMValue::jint_constant(0);
-  }
-  else {
-    special_result = a;
-  }
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(general_case);
-  Value *general_result;
-  if (is_rem)
-    general_result = builder()->CreateSRem(a, b);
-  else
-    general_result = builder()->CreateSDiv(a, b);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(done);
-  PHINode *result;
-  if (is_long)
-    result = builder()->CreatePHI(SharkType::jlong_type(), "result");
-  else
-    result = builder()->CreatePHI(SharkType::jint_type(), "result");
-  result->addIncoming(special_result, special_case);
-  result->addIncoming(general_result, general_case);
-
-  if (is_long)
-    push(SharkValue::create_jlong(result, false));
-  else
-    push(SharkValue::create_jint(result, false));
-}
-
-void SharkBlock::do_field_access(bool is_get, bool is_field) {
-  bool will_link;
-  ciField *field = iter()->get_field(will_link);
-  assert(will_link, "typeflow responsibility");
-  assert(is_field != field->is_static(), "mismatch");
-
-  // Pop the value off the stack where necessary
-  SharkValue *value = NULL;
-  if (!is_get)
-    value = pop();
-
-  // Find the object we're accessing, if necessary
-  Value *object = NULL;
-  if (is_field) {
-    SharkValue *value = pop();
-    check_null(value);
-    object = value->generic_value();
-  }
-  if (is_get && field->is_constant()) {
-    SharkConstant *constant = SharkConstant::for_field(iter());
-    if (constant->is_loaded())
-      value = constant->value(builder());
-  }
-  if (!is_get || value == NULL) {
-    if (!is_field)
-      object = builder()->CreateInlineOop(field->holder());
-
-    BasicType   basic_type = field->type()->basic_type();
-    const Type *stack_type = SharkType::to_stackType(basic_type);
-    const Type *field_type = SharkType::to_arrayType(basic_type);
-
-    Value *addr = builder()->CreateAddressOfStructEntry(
-      object, in_ByteSize(field->offset_in_bytes()),
-      PointerType::getUnqual(field_type),
-      "addr");
-
-    // Do the access
-    if (is_get) {
-      Value *field_value = builder()->CreateLoad(addr);
-
-      if (field_type != stack_type) {
-        field_value = builder()->CreateIntCast(
-          field_value, stack_type, basic_type != T_CHAR);
-      }
-
-      value = SharkValue::create_generic(field->type(), field_value, false);
-    }
-    else {
-      Value *field_value = value->generic_value();
-
-      if (field_type != stack_type) {
-        field_value = builder()->CreateIntCast(
-          field_value, field_type, basic_type != T_CHAR);
-      }
-
-      builder()->CreateStore(field_value, addr);
-
-      if (!field->type()->is_primitive_type())
-        builder()->CreateUpdateBarrierSet(oopDesc::bs(), addr);
-
-      if (field->is_volatile())
-        builder()->CreateMemoryBarrier(SharkBuilder::BARRIER_STORELOAD);
-    }
-  }
-
-  // Push the value onto the stack where necessary
-  if (is_get)
-    push(value);
-}
-
-void SharkBlock::do_lcmp() {
-  Value *b = pop()->jlong_value();
-  Value *a = pop()->jlong_value();
-
-  BasicBlock *ip   = builder()->GetBlockInsertionPoint();
-  BasicBlock *ne   = builder()->CreateBlock(ip, "lcmp_ne");
-  BasicBlock *lt   = builder()->CreateBlock(ip, "lcmp_lt");
-  BasicBlock *gt   = builder()->CreateBlock(ip, "lcmp_gt");
-  BasicBlock *done = builder()->CreateBlock(ip, "done");
-
-  BasicBlock *eq = builder()->GetInsertBlock();
-  builder()->CreateCondBr(builder()->CreateICmpEQ(a, b), done, ne);
-
-  builder()->SetInsertPoint(ne);
-  builder()->CreateCondBr(builder()->CreateICmpSLT(a, b), lt, gt);
-
-  builder()->SetInsertPoint(lt);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(gt);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(done);
-  PHINode *result = builder()->CreatePHI(SharkType::jint_type(), "result");
-  result->addIncoming(LLVMValue::jint_constant(-1), lt);
-  result->addIncoming(LLVMValue::jint_constant(0),  eq);
-  result->addIncoming(LLVMValue::jint_constant(1),  gt);
-
-  push(SharkValue::create_jint(result, false));
-}
-
-void SharkBlock::do_fcmp(bool is_double, bool unordered_is_greater) {
-  Value *a, *b;
-  if (is_double) {
-    b = pop()->jdouble_value();
-    a = pop()->jdouble_value();
-  }
-  else {
-    b = pop()->jfloat_value();
-    a = pop()->jfloat_value();
-  }
-
-  BasicBlock *ip      = builder()->GetBlockInsertionPoint();
-  BasicBlock *ordered = builder()->CreateBlock(ip, "ordered");
-  BasicBlock *ge      = builder()->CreateBlock(ip, "fcmp_ge");
-  BasicBlock *lt      = builder()->CreateBlock(ip, "fcmp_lt");
-  BasicBlock *eq      = builder()->CreateBlock(ip, "fcmp_eq");
-  BasicBlock *gt      = builder()->CreateBlock(ip, "fcmp_gt");
-  BasicBlock *done    = builder()->CreateBlock(ip, "done");
-
-  builder()->CreateCondBr(
-    builder()->CreateFCmpUNO(a, b),
-    unordered_is_greater ? gt : lt, ordered);
-
-  builder()->SetInsertPoint(ordered);
-  builder()->CreateCondBr(builder()->CreateFCmpULT(a, b), lt, ge);
-
-  builder()->SetInsertPoint(ge);
-  builder()->CreateCondBr(builder()->CreateFCmpUGT(a, b), gt, eq);
-
-  builder()->SetInsertPoint(lt);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(gt);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(eq);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(done);
-  PHINode *result = builder()->CreatePHI(SharkType::jint_type(), "result");
-  result->addIncoming(LLVMValue::jint_constant(-1), lt);
-  result->addIncoming(LLVMValue::jint_constant(0),  eq);
-  result->addIncoming(LLVMValue::jint_constant(1),  gt);
-
-  push(SharkValue::create_jint(result, false));
-}
-
-void SharkBlock::emit_IR() {
-  ShouldNotCallThis();
-}
-
-SharkState* SharkBlock::entry_state() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_zero_check(SharkValue* value) {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::maybe_add_backedge_safepoint() {
-  ShouldNotCallThis();
-}
-
-bool SharkBlock::has_trap() {
-  return false;
-}
-
-int SharkBlock::trap_request() {
-  ShouldNotCallThis();
-}
-
-int SharkBlock::trap_bci() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_trap(int trap_request) {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_arraylength() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_aload(BasicType basic_type) {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_astore(BasicType basic_type) {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_return(BasicType type) {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_athrow() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_goto() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_jsr() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_ret() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_if(ICmpInst::Predicate p, SharkValue* b, SharkValue* a) {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_switch() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_call() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_instance_check() {
-  ShouldNotCallThis();
-}
-
-bool SharkBlock::maybe_do_instanceof_if() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_new() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_newarray() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_anewarray() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_multianewarray() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_monitorenter() {
-  ShouldNotCallThis();
-}
-
-void SharkBlock::do_monitorexit() {
-  ShouldNotCallThis();
-}
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkState;
-
-class SharkBlock : public SharkTargetInvariants {
- protected:
-  SharkBlock(const SharkTargetInvariants* parent)
-    : SharkTargetInvariants(parent),
-      _iter(target()),
-      _current_state(NULL) {}
-
-  SharkBlock(const SharkCompileInvariants* parent, ciMethod* target)
-    : SharkTargetInvariants(parent, target),
-      _iter(target),
-      _current_state(NULL) {}
-
- private:
-  ciBytecodeStream _iter;
-  SharkState*      _current_state;
-
- public:
-  ciBytecodeStream* iter() {
-    return &_iter;
-  }
-  Bytecodes::Code bc() {
-    return iter()->cur_bc();
-  }
-  int bci() {
-    return iter()->cur_bci();
-  }
-
-  // Entry state
- protected:
-  virtual SharkState* entry_state();
-
-  // Current state
- private:
-  SharkState* initial_current_state();
-
- public:
-  SharkState* current_state() {
-    if (_current_state == NULL)
-      set_current_state(initial_current_state());
-    return _current_state;
-  }
-
- protected:
-  void set_current_state(SharkState* current_state) {
-    _current_state = current_state;
-  }
-
-  // Local variables
- protected:
-  SharkValue* local(int index) {
-    SharkValue *value = current_state()->local(index);
-    assert(value != NULL, "shouldn't be");
-    assert(value->is_one_word() ||
-           (index + 1 < max_locals() &&
-            current_state()->local(index + 1) == NULL), "should be");
-    return value;
-  }
-  void set_local(int index, SharkValue* value) {
-    assert(value != NULL, "shouldn't be");
-    current_state()->set_local(index, value);
-    if (value->is_two_word())
-      current_state()->set_local(index + 1, NULL);
-  }
-
-  // Expression stack (raw)
- protected:
-  void xpush(SharkValue* value) {
-    current_state()->push(value);
-  }
-  SharkValue* xpop() {
-    return current_state()->pop();
-  }
-  SharkValue* xstack(int slot) {
-    SharkValue *value = current_state()->stack(slot);
-    assert(value != NULL, "shouldn't be");
-    assert(value->is_one_word() ||
-           (slot > 0 &&
-            current_state()->stack(slot - 1) == NULL), "should be");
-    return value;
-  }
-  int xstack_depth() {
-    return current_state()->stack_depth();
-  }
-
-  // Expression stack (cooked)
- protected:
-  void push(SharkValue* value) {
-    assert(value != NULL, "shouldn't be");
-    xpush(value);
-    if (value->is_two_word())
-      xpush(NULL);
-  }
-  SharkValue* pop() {
-    int size = current_state()->stack(0) == NULL ? 2 : 1;
-    if (size == 2)
-      xpop();
-    SharkValue *value = xpop();
-    assert(value && value->size() == size, "should be");
-    return value;
-  }
-  SharkValue* pop_result(BasicType type) {
-    SharkValue *result = pop();
-
-#ifdef ASSERT
-    switch (result->basic_type()) {
-    case T_BOOLEAN:
-    case T_BYTE:
-    case T_CHAR:
-    case T_SHORT:
-      assert(type == T_INT, "type mismatch");
-      break;
-
-    case T_ARRAY:
-      assert(type == T_OBJECT, "type mismatch");
-      break;
-
-    default:
-      assert(result->basic_type() == type, "type mismatch");
-    }
-#endif // ASSERT
-
-    return result;
-  }
-
-  // Code generation
- public:
-  virtual void emit_IR();
-
- protected:
-  void parse_bytecode(int start, int limit);
-
-  // Helpers
- protected:
-  virtual void do_zero_check(SharkValue* value);
-
-  // Zero checking
- protected:
-  void check_null(SharkValue* object) {
-    zero_check(object);
-  }
-  void check_divide_by_zero(SharkValue* value) {
-    zero_check(value);
-  }
- private:
-  void zero_check(SharkValue* value) {
-    if (!value->zero_checked())
-      do_zero_check(value);
-  }
-
-  // Safepoints
- protected:
-  virtual void maybe_add_backedge_safepoint();
-
-  // Traps
- protected:
-  virtual bool has_trap();
-  virtual int  trap_request();
-  virtual int  trap_bci();
-  virtual void do_trap(int trap_request);
-
-  // arraylength
- protected:
-  virtual void do_arraylength();
-
-  // *aload and *astore
- protected:
-  virtual void do_aload(BasicType basic_type);
-  virtual void do_astore(BasicType basic_type);
-
-  // *div and *rem
- private:
-  void do_idiv() {
-    do_div_or_rem(false, false);
-  }
-  void do_irem() {
-    do_div_or_rem(false, true);
-  }
-  void do_ldiv() {
-    do_div_or_rem(true, false);
-  }
-  void do_lrem() {
-    do_div_or_rem(true, true);
-  }
-  void do_div_or_rem(bool is_long, bool is_rem);
-
-  // get* and put*
- private:
-  void do_getstatic() {
-    do_field_access(true, false);
-  }
-  void do_getfield() {
-    do_field_access(true, true);
-  }
-  void do_putstatic() {
-    do_field_access(false, false);
-  }
-  void do_putfield() {
-    do_field_access(false, true);
-  }
-  void do_field_access(bool is_get, bool is_field);
-
-  // lcmp and [fd]cmp[lg]
- private:
-  void do_lcmp();
-  void do_fcmp(bool is_double, bool unordered_is_greater);
-
-  // *return and athrow
- protected:
-  virtual void do_return(BasicType type);
-  virtual void do_athrow();
-
-  // goto*
- protected:
-  virtual void do_goto();
-
-  // jsr* and ret
- protected:
-  virtual void do_jsr();
-  virtual void do_ret();
-
-  // if*
- protected:
-  virtual void do_if(llvm::ICmpInst::Predicate p, SharkValue* b, SharkValue* a);
-
-  // *switch
- protected:
-  int switch_default_dest();
-  int switch_table_length();
-  int switch_key(int i);
-  int switch_dest(int i);
-
-  virtual void do_switch();
-
-  // invoke*
- protected:
-  virtual void do_call();
-
-  // checkcast and instanceof
- protected:
-  virtual void do_instance_check();
-  virtual bool maybe_do_instanceof_if();
-
-  // new and *newarray
- protected:
-  virtual void do_new();
-  virtual void do_newarray();
-  virtual void do_anewarray();
-  virtual void do_multianewarray();
-
-  // monitorenter and monitorexit
- protected:
-  virtual void do_monitorenter();
-  virtual void do_monitorexit();
-};
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,591 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkBuilder.cpp.incl"
-
-using namespace llvm;
-
-SharkBuilder::SharkBuilder(SharkCodeBuffer* code_buffer)
-  : IRBuilder<>(SharkContext::current()),
-    _code_buffer(code_buffer) {
-}
-
-// Helpers for accessing structures
-Value* SharkBuilder::CreateAddressOfStructEntry(Value*      base,
-                                                ByteSize    offset,
-                                                const Type* type,
-                                                const char* name) {
-  return CreateBitCast(CreateStructGEP(base, in_bytes(offset)), type, name);
-}
-
-LoadInst* SharkBuilder::CreateValueOfStructEntry(Value*      base,
-                                                 ByteSize    offset,
-                                                 const Type* type,
-                                                 const char* name) {
-  return CreateLoad(
-    CreateAddressOfStructEntry(
-      base, offset, PointerType::getUnqual(type)),
-    name);
-}
-
-// Helpers for accessing arrays
-
-LoadInst* SharkBuilder::CreateArrayLength(Value* arrayoop) {
-  return CreateValueOfStructEntry(
-    arrayoop, in_ByteSize(arrayOopDesc::length_offset_in_bytes()),
-    SharkType::jint_type(), "length");
-}
-
-Value* SharkBuilder::CreateArrayAddress(Value*      arrayoop,
-                                        const Type* element_type,
-                                        int         element_bytes,
-                                        ByteSize    base_offset,
-                                        Value*      index,
-                                        const char* name) {
-  Value* offset = CreateIntCast(index, SharkType::intptr_type(), false);
-  if (element_bytes != 1)
-    offset = CreateShl(
-      offset,
-      LLVMValue::intptr_constant(exact_log2(element_bytes)));
-  offset = CreateAdd(
-    LLVMValue::intptr_constant(in_bytes(base_offset)), offset);
-
-  return CreateIntToPtr(
-    CreateAdd(CreatePtrToInt(arrayoop, SharkType::intptr_type()), offset),
-    PointerType::getUnqual(element_type),
-    name);
-}
-
-Value* SharkBuilder::CreateArrayAddress(Value*      arrayoop,
-                                        BasicType   basic_type,
-                                        ByteSize    base_offset,
-                                        Value*      index,
-                                        const char* name) {
-  return CreateArrayAddress(
-    arrayoop,
-    SharkType::to_arrayType(basic_type),
-    type2aelembytes(basic_type),
-    base_offset, index, name);
-}
-
-Value* SharkBuilder::CreateArrayAddress(Value*      arrayoop,
-                                        BasicType   basic_type,
-                                        Value*      index,
-                                        const char* name) {
-  return CreateArrayAddress(
-    arrayoop, basic_type,
-    in_ByteSize(arrayOopDesc::base_offset_in_bytes(basic_type)),
-    index, name);
-}
-
-// Helpers for creating intrinsics and external functions.
-
-const Type* SharkBuilder::make_type(char type, bool void_ok) {
-  switch (type) {
-    // Primitive types
-  case 'c':
-    return SharkType::jbyte_type();
-  case 'i':
-    return SharkType::jint_type();
-  case 'l':
-    return SharkType::jlong_type();
-  case 'x':
-    return SharkType::intptr_type();
-  case 'f':
-    return SharkType::jfloat_type();
-  case 'd':
-    return SharkType::jdouble_type();
-
-    // Pointers to primitive types
-  case 'C':
-  case 'I':
-  case 'L':
-  case 'X':
-  case 'F':
-  case 'D':
-    return PointerType::getUnqual(make_type(tolower(type), false));
-
-    // VM objects
-  case 'T':
-    return SharkType::thread_type();
-  case 'M':
-    return PointerType::getUnqual(SharkType::monitor_type());
-  case 'O':
-    return SharkType::oop_type();
-
-    // Miscellaneous
-  case 'v':
-    assert(void_ok, "should be");
-    return SharkType::void_type();
-  case '1':
-    return SharkType::bit_type();
-
-  default:
-    ShouldNotReachHere();
-  }
-}
-
-const FunctionType* SharkBuilder::make_ftype(const char* params,
-                                             const char* ret) {
-  std::vector<const Type*> param_types;
-  for (const char* c = params; *c; c++)
-    param_types.push_back(make_type(*c, false));
-
-  assert(strlen(ret) == 1, "should be");
-  const Type *return_type = make_type(*ret, true);
-
-  return FunctionType::get(return_type, param_types, false);
-}
-
-// Create an object representing an intrinsic or external function by
-// referencing the symbol by name.  This is the LLVM-style approach,
-// but it cannot be used on functions within libjvm.so its symbols
-// are not exported.  Note that you cannot make this work simply by
-// exporting the symbols, as some symbols have the same names as
-// symbols in the standard libraries (eg, atan2, fabs) and would
-// obscure them were they visible.
-Value* SharkBuilder::make_function(const char* name,
-                                   const char* params,
-                                   const char* ret) {
-  return SharkContext::current().get_external(name, make_ftype(params, ret));
-}
-
-// Create an object representing an external function by inlining a
-// function pointer in the code.  This is not the LLVM way, but it's
-// the only way to access functions in libjvm.so and functions like
-// __kernel_dmb on ARM which is accessed via an absolute address.
-Value* SharkBuilder::make_function(address     func,
-                                   const char* params,
-                                   const char* ret) {
-  return CreateIntToPtr(
-    LLVMValue::intptr_constant((intptr_t) func),
-    PointerType::getUnqual(make_ftype(params, ret)));
-}
-
-// VM calls
-
-Value* SharkBuilder::find_exception_handler() {
-  return make_function(
-    (address) SharkRuntime::find_exception_handler, "TIi", "i");
-}
-
-Value* SharkBuilder::monitorenter() {
-  return make_function((address) SharkRuntime::monitorenter, "TM", "v");
-}
-
-Value* SharkBuilder::monitorexit() {
-  return make_function((address) SharkRuntime::monitorexit, "TM", "v");
-}
-
-Value* SharkBuilder::new_instance() {
-  return make_function((address) SharkRuntime::new_instance, "Ti", "v");
-}
-
-Value* SharkBuilder::newarray() {
-  return make_function((address) SharkRuntime::newarray, "Tii", "v");
-}
-
-Value* SharkBuilder::anewarray() {
-  return make_function((address) SharkRuntime::anewarray, "Tii", "v");
-}
-
-Value* SharkBuilder::multianewarray() {
-  return make_function((address) SharkRuntime::multianewarray, "TiiI", "v");
-}
-
-Value* SharkBuilder::register_finalizer() {
-  return make_function((address) SharkRuntime::register_finalizer, "TO", "v");
-}
-
-Value* SharkBuilder::safepoint() {
-  return make_function((address) SafepointSynchronize::block, "T", "v");
-}
-
-Value* SharkBuilder::throw_ArithmeticException() {
-  return make_function(
-    (address) SharkRuntime::throw_ArithmeticException, "TCi", "v");
-}
-
-Value* SharkBuilder::throw_ArrayIndexOutOfBoundsException() {
-  return make_function(
-    (address) SharkRuntime::throw_ArrayIndexOutOfBoundsException, "TCii", "v");
-}
-
-Value* SharkBuilder::throw_ClassCastException() {
-  return make_function(
-    (address) SharkRuntime::throw_ClassCastException, "TCi", "v");
-}
-
-Value* SharkBuilder::throw_NullPointerException() {
-  return make_function(
-    (address) SharkRuntime::throw_NullPointerException, "TCi", "v");
-}
-
-// High-level non-VM calls
-
-Value* SharkBuilder::f2i() {
-  return make_function((address) SharedRuntime::f2i, "f", "i");
-}
-
-Value* SharkBuilder::f2l() {
-  return make_function((address) SharedRuntime::f2l, "f", "l");
-}
-
-Value* SharkBuilder::d2i() {
-  return make_function((address) SharedRuntime::d2i, "d", "i");
-}
-
-Value* SharkBuilder::d2l() {
-  return make_function((address) SharedRuntime::d2l, "d", "l");
-}
-
-Value* SharkBuilder::is_subtype_of() {
-  return make_function((address) SharkRuntime::is_subtype_of, "OO", "c");
-}
-
-Value* SharkBuilder::current_time_millis() {
-  return make_function((address) os::javaTimeMillis, "", "l");
-}
-
-Value* SharkBuilder::sin() {
-  return make_function("llvm.sin.f64", "d", "d");
-}
-
-Value* SharkBuilder::cos() {
-  return make_function("llvm.cos.f64", "d", "d");
-}
-
-Value* SharkBuilder::tan() {
-  return make_function((address) ::tan, "d", "d");
-}
-
-Value* SharkBuilder::atan2() {
-  return make_function((address) ::atan2, "dd", "d");
-}
-
-Value* SharkBuilder::sqrt() {
-  return make_function("llvm.sqrt.f64", "d", "d");
-}
-
-Value* SharkBuilder::log() {
-  return make_function("llvm.log.f64", "d", "d");
-}
-
-Value* SharkBuilder::log10() {
-  return make_function("llvm.log10.f64", "d", "d");
-}
-
-Value* SharkBuilder::pow() {
-  return make_function("llvm.pow.f64", "dd", "d");
-}
-
-Value* SharkBuilder::exp() {
-  return make_function("llvm.exp.f64", "d", "d");
-}
-
-Value* SharkBuilder::fabs() {
-  return make_function((address) ::fabs, "d", "d");
-}
-
-Value* SharkBuilder::unsafe_field_offset_to_byte_offset() {
-  extern jlong Unsafe_field_offset_to_byte_offset(jlong field_offset);
-  return make_function((address) Unsafe_field_offset_to_byte_offset, "l", "l");
-}
-
-Value* SharkBuilder::osr_migration_end() {
-  return make_function((address) SharedRuntime::OSR_migration_end, "C", "v");
-}
-
-// Semi-VM calls
-
-Value* SharkBuilder::throw_StackOverflowError() {
-  return make_function((address) ZeroStack::handle_overflow, "T", "v");
-}
-
-Value* SharkBuilder::uncommon_trap() {
-  return make_function((address) SharkRuntime::uncommon_trap, "Ti", "i");
-}
-
-Value* SharkBuilder::deoptimized_entry_point() {
-  return make_function((address) CppInterpreter::main_loop, "iT", "v");
-}
-
-// Native-Java transition
-
-Value* SharkBuilder::check_special_condition_for_native_trans() {
-  return make_function(
-    (address) JavaThread::check_special_condition_for_native_trans,
-    "T", "v");
-}
-
-// Low-level non-VM calls
-
-// The ARM-specific code here is to work around unimplemented
-// atomic exchange and memory barrier intrinsics in LLVM.
-//
-// Delegating to external functions for these would normally
-// incur a speed penalty, but Linux on ARM is a special case
-// in that atomic operations on that platform are handled by
-// external functions anyway.  It would be *preferable* for
-// the calls to be hidden away in LLVM, but it's not hurting
-// performance so having the calls here is acceptable.
-//
-// If you are building Shark on a platform without atomic
-// exchange and/or memory barrier intrinsics then it is only
-// acceptable to mimic this approach if your platform cannot
-// perform these operations without delegating to a function.
-
-#ifdef ARM
-static jint zero_cmpxchg_int(volatile jint *ptr, jint oldval, jint newval) {
-  return Atomic::cmpxchg(newval, ptr, oldval);
-}
-#endif // ARM
-
-Value* SharkBuilder::cmpxchg_int() {
-  return make_function(
-#ifdef ARM
-    (address) zero_cmpxchg_int,
-#else
-    "llvm.atomic.cmp.swap.i32.p0i32",
-#endif // ARM
-    "Iii", "i");
-}
-
-#ifdef ARM
-static intptr_t zero_cmpxchg_ptr(volatile intptr_t* ptr,
-                                 intptr_t           oldval,
-                                 intptr_t           newval) {
-  return Atomic::cmpxchg_ptr(newval, ptr, oldval);
-}
-#endif // ARM
-
-Value* SharkBuilder::cmpxchg_ptr() {
-  return make_function(
-#ifdef ARM
-    (address) zero_cmpxchg_ptr,
-#else
-    "llvm.atomic.cmp.swap.i" LP64_ONLY("64") NOT_LP64("32") ".p0i" LP64_ONLY("64") NOT_LP64("32"),
-#endif // ARM
-    "Xxx", "x");
-}
-
-Value* SharkBuilder::frame_address() {
-  return make_function("llvm.frameaddress", "i", "C");
-}
-
-Value* SharkBuilder::memory_barrier() {
-  return make_function(
-#ifdef ARM
-    (address) 0xffff0fa0, // __kernel_dmb
-#else
-    "llvm.memory.barrier",
-#endif // ARM
-    "11111", "v");
-}
-
-Value* SharkBuilder::memset() {
-#if SHARK_LLVM_VERSION >= 28
-  // LLVM 2.8 added a fifth isVolatile field for memset
-  // introduced with LLVM r100304
-  return make_function("llvm.memset.i32", "Cciii", "v");
-#else
-  return make_function("llvm.memset.i32", "Ccii", "v");
-#endif
-}
-
-Value* SharkBuilder::unimplemented() {
-  return make_function((address) report_unimplemented, "Ci", "v");
-}
-
-Value* SharkBuilder::should_not_reach_here() {
-  return make_function((address) report_should_not_reach_here, "Ci", "v");
-}
-
-Value* SharkBuilder::dump() {
-  return make_function((address) SharkRuntime::dump, "Cx", "v");
-}
-
-// Public interface to low-level non-VM calls
-
-CallInst* SharkBuilder::CreateCmpxchgInt(Value* exchange_value,
-                                         Value* dst,
-                                         Value* compare_value) {
-  return CreateCall3(cmpxchg_int(), dst, compare_value, exchange_value);
-}
-
-CallInst* SharkBuilder::CreateCmpxchgPtr(Value* exchange_value,
-                                         Value* dst,
-                                         Value* compare_value) {
-  return CreateCall3(cmpxchg_ptr(), dst, compare_value, exchange_value);
-}
-
-CallInst* SharkBuilder::CreateGetFrameAddress() {
-  return CreateCall(frame_address(), LLVMValue::jint_constant(0));
-}
-
-CallInst *SharkBuilder::CreateMemoryBarrier(int flags) {
-  Value *args[] = {
-    LLVMValue::bit_constant((flags & BARRIER_LOADLOAD) ? 1 : 0),
-    LLVMValue::bit_constant((flags & BARRIER_LOADSTORE) ? 1 : 0),
-    LLVMValue::bit_constant((flags & BARRIER_STORELOAD) ? 1 : 0),
-    LLVMValue::bit_constant((flags & BARRIER_STORESTORE) ? 1 : 0),
-    LLVMValue::bit_constant(1)};
-
-  return CreateCall(memory_barrier(), args, args + 5);
-}
-
-CallInst* SharkBuilder::CreateMemset(Value* dst,
-                                     Value* value,
-                                     Value* len,
-                                     Value* align) {
-#if SHARK_LLVM_VERSION >= 28
-  return CreateCall5(memset(), dst, value, len, align,
-                     LLVMValue::jint_constant(0));
-#else
-  return CreateCall4(memset(), dst, value, len, align);
-#endif
-}
-
-CallInst* SharkBuilder::CreateUnimplemented(const char* file, int line) {
-  return CreateCall2(
-    unimplemented(),
-    CreateIntToPtr(
-      LLVMValue::intptr_constant((intptr_t) file),
-      PointerType::getUnqual(SharkType::jbyte_type())),
-    LLVMValue::jint_constant(line));
-}
-
-CallInst* SharkBuilder::CreateShouldNotReachHere(const char* file, int line) {
-  return CreateCall2(
-    should_not_reach_here(),
-    CreateIntToPtr(
-      LLVMValue::intptr_constant((intptr_t) file),
-      PointerType::getUnqual(SharkType::jbyte_type())),
-    LLVMValue::jint_constant(line));
-}
-
-#ifndef PRODUCT
-CallInst* SharkBuilder::CreateDump(Value* value) {
-  const char *name;
-  if (value->hasName())
-    // XXX this leaks, but it's only debug code
-    name = strdup(value->getName().str().c_str());
-  else
-    name = "unnamed_value";
-
-  if (isa<PointerType>(value->getType()))
-    value = CreatePtrToInt(value, SharkType::intptr_type());
-  else if (value->getType()->
-#if SHARK_LLVM_VERSION >= 27
-           isIntegerTy()
-#else
-           isInteger()
-#endif
-           )
-    value = CreateIntCast(value, SharkType::intptr_type(), false);
-  else
-    Unimplemented();
-
-  return CreateCall2(
-    dump(),
-    CreateIntToPtr(
-      LLVMValue::intptr_constant((intptr_t) name),
-      PointerType::getUnqual(SharkType::jbyte_type())),
-    value);
-}
-#endif // PRODUCT
-
-// HotSpot memory barriers
-
-void SharkBuilder::CreateUpdateBarrierSet(BarrierSet* bs, Value* field) {
-  if (bs->kind() != BarrierSet::CardTableModRef)
-    Unimplemented();
-
-  CreateStore(
-    LLVMValue::jbyte_constant(CardTableModRefBS::dirty_card),
-    CreateIntToPtr(
-      CreateAdd(
-        LLVMValue::intptr_constant(
-          (intptr_t) ((CardTableModRefBS *) bs)->byte_map_base),
-        CreateLShr(
-          CreatePtrToInt(field, SharkType::intptr_type()),
-          LLVMValue::intptr_constant(CardTableModRefBS::card_shift))),
-      PointerType::getUnqual(SharkType::jbyte_type())));
-}
-
-// Helpers for accessing the code buffer
-
-Value* SharkBuilder::code_buffer_address(int offset) {
-  return CreateAdd(
-    code_buffer()->base_pc(),
-    LLVMValue::intptr_constant(offset));
-}
-
-Value* SharkBuilder::CreateInlineOop(jobject object, const char* name) {
-  return CreateLoad(
-    CreateIntToPtr(
-      code_buffer_address(code_buffer()->inline_oop(object)),
-      PointerType::getUnqual(SharkType::oop_type())),
-    name);
-}
-
-Value* SharkBuilder::CreateInlineData(void*       data,
-                                      size_t      size,
-                                      const Type* type, 
-                                      const char* name) {
-  return CreateIntToPtr(
-    code_buffer_address(code_buffer()->inline_data(data, size)),
-    type,
-    name);
-}
-
-// Helpers for creating basic blocks.
-
-BasicBlock* SharkBuilder::GetBlockInsertionPoint() const {
-  BasicBlock *cur = GetInsertBlock();
-
-  // BasicBlock::Create takes an insertBefore argument, so
-  // we need to find the block _after_ the current block
-  Function::iterator iter = cur->getParent()->begin();
-  Function::iterator end  = cur->getParent()->end();
-  while (iter != end) {
-    iter++;
-    if (&*iter == cur) {
-      iter++;
-      break;
-    }
-  }
-
-  if (iter == end)
-    return NULL;
-  else
-    return iter;
-}
-
-BasicBlock* SharkBuilder::CreateBlock(BasicBlock* ip, const char* name) const {
-  return BasicBlock::Create(
-    SharkContext::current(), name, GetInsertBlock()->getParent(), ip);
-}
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkBuilder : public llvm::IRBuilder<> {
-  friend class SharkCompileInvariants;
-
- public:
-  SharkBuilder(SharkCodeBuffer* code_buffer);
-
-  // The code buffer we are building into.
- private:
-  SharkCodeBuffer* _code_buffer;
-
- protected:
-  SharkCodeBuffer* code_buffer() const {
-    return _code_buffer;
-  }
-
-  // Helpers for accessing structures.
- public:
-  llvm::Value* CreateAddressOfStructEntry(llvm::Value* base,
-                                          ByteSize offset,
-                                          const llvm::Type* type,
-                                          const char *name = "");
-  llvm::LoadInst* CreateValueOfStructEntry(llvm::Value* base,
-                                           ByteSize offset,
-                                           const llvm::Type* type,
-                                           const char *name = "");
-
-  // Helpers for accessing arrays.
- public:
-  llvm::LoadInst* CreateArrayLength(llvm::Value* arrayoop);
-  llvm::Value* CreateArrayAddress(llvm::Value*      arrayoop,
-                                  const llvm::Type* element_type,
-                                  int               element_bytes,
-                                  ByteSize          base_offset,
-                                  llvm::Value*      index,
-                                  const char*       name = "");
-  llvm::Value* CreateArrayAddress(llvm::Value* arrayoop,
-                                  BasicType    basic_type,
-                                  ByteSize     base_offset,
-                                  llvm::Value* index,
-                                  const char*  name = "");
-  llvm::Value* CreateArrayAddress(llvm::Value* arrayoop,
-                                  BasicType    basic_type,
-                                  llvm::Value* index,
-                                  const char*  name = "");
-
-  // Helpers for creating intrinsics and external functions.
- private:
-  static const llvm::Type* make_type(char type, bool void_ok);
-  static const llvm::FunctionType* make_ftype(const char* params,
-                                              const char* ret);
-  llvm::Value* make_function(const char* name,
-                             const char* params,
-                             const char* ret);
-  llvm::Value* make_function(address     func,
-                             const char* params,
-                             const char* ret);
-
-  // Intrinsics and external functions, part 1: VM calls.
-  //   These are functions declared with JRT_ENTRY and JRT_EXIT,
-  //   macros which flip the thread from _thread_in_Java to
-  //   _thread_in_vm and back.  VM calls always safepoint, and can
-  //   therefore throw exceptions.  VM calls require of setup and
-  //   teardown, and must be called with SharkTopLevelBlock::call_vm.
- public:
-  llvm::Value* find_exception_handler();
-  llvm::Value* monitorenter();
-  llvm::Value* monitorexit();
-  llvm::Value* new_instance();
-  llvm::Value* newarray();
-  llvm::Value* anewarray();
-  llvm::Value* multianewarray();
-  llvm::Value* register_finalizer();
-  llvm::Value* safepoint();
-  llvm::Value* throw_ArithmeticException();
-  llvm::Value* throw_ArrayIndexOutOfBoundsException();
-  llvm::Value* throw_ClassCastException();
-  llvm::Value* throw_NullPointerException();
-
-  // Intrinsics and external functions, part 2: High-level non-VM calls.
-  //   These are called like normal functions.  The stack is not set
-  //   up for walking so they must not safepoint or throw exceptions,
-  //   or call anything that might.
- public:
-  llvm::Value* f2i();
-  llvm::Value* f2l();
-  llvm::Value* d2i();
-  llvm::Value* d2l();
-  llvm::Value* is_subtype_of();
-  llvm::Value* current_time_millis();
-  llvm::Value* sin();
-  llvm::Value* cos();
-  llvm::Value* tan();
-  llvm::Value* atan2();
-  llvm::Value* sqrt();
-  llvm::Value* log();
-  llvm::Value* log10();
-  llvm::Value* pow();
-  llvm::Value* exp();
-  llvm::Value* fabs();
-  llvm::Value* unsafe_field_offset_to_byte_offset();
-  llvm::Value* osr_migration_end();
-
-  // Intrinsics and external functions, part 3: semi-VM calls.
-  //   These are special cases that do VM call stuff but are invoked
-  //   as though they were normal calls.  This is acceptable so long
-  //   as the method that calls them returns to its immediately that
-  //   the semi VM call returns.
- public:
-  llvm::Value* throw_StackOverflowError();
-  llvm::Value* uncommon_trap();
-  llvm::Value* deoptimized_entry_point();
-
-  // Intrinsics and external functions, part 4: Native-Java transition.
-  //   This is a special case in that it is invoked during a thread
-  //   state transition.  The stack must be set up for walking, and it
-  //   may throw exceptions, but the state is _thread_in_native_trans.
- public:
-  llvm::Value* check_special_condition_for_native_trans();
-
-  // Intrinsics and external functions, part 5: Low-level non-VM calls.
-  //   These have the same caveats as the high-level non-VM calls
-  //   above.  They are not accessed directly; rather, you should
-  //   access them via the various Create* methods below.
- private:
-  llvm::Value* cmpxchg_int();
-  llvm::Value* cmpxchg_ptr();
-  llvm::Value* frame_address();
-  llvm::Value* memory_barrier();
-  llvm::Value* memset();
-  llvm::Value* unimplemented();
-  llvm::Value* should_not_reach_here();
-  llvm::Value* dump();
-
-  // Public interface to low-level non-VM calls.
- public:
-  llvm::CallInst* CreateCmpxchgInt(llvm::Value* exchange_value,
-                                   llvm::Value* dst,
-                                   llvm::Value* compare_value);
-  llvm::CallInst* CreateCmpxchgPtr(llvm::Value* exchange_value,
-                                   llvm::Value* dst,
-                                   llvm::Value* compare_value);
-  llvm::CallInst* CreateGetFrameAddress();
-  llvm::CallInst* CreateMemoryBarrier(int flags);
-  llvm::CallInst* CreateMemset(llvm::Value* dst,
-                               llvm::Value* value,
-                               llvm::Value* len,
-                               llvm::Value* align);
-  llvm::CallInst* CreateUnimplemented(const char* file, int line);
-  llvm::CallInst* CreateShouldNotReachHere(const char* file, int line);
-  NOT_PRODUCT(llvm::CallInst* CreateDump(llvm::Value* value));
-
-  // Flags for CreateMemoryBarrier.
- public:
-  enum BarrierFlags {
-    BARRIER_LOADLOAD   = 1,
-    BARRIER_LOADSTORE  = 2,
-    BARRIER_STORELOAD  = 4,
-    BARRIER_STORESTORE = 8
-  };
-
-  // HotSpot memory barriers
- public:
-  void CreateUpdateBarrierSet(BarrierSet* bs, llvm::Value* field);
-
-  // Helpers for accessing the code buffer.
- public:
-  llvm::Value* code_buffer_address(int offset);
-  llvm::Value* CreateInlineOop(jobject object, const char* name = "");
-  llvm::Value* CreateInlineOop(ciObject* object, const char* name = "") {
-    return CreateInlineOop(object->constant_encoding(), name);
-  }
-  llvm::Value* CreateInlineData(void*             data,
-                                size_t            size,
-                                const llvm::Type* type, 
-                                const char*       name = ""); 
-
-  // Helpers for creating basic blocks.
-  // NB don't use unless SharkFunction::CreateBlock is unavailable.
-  // XXX these are hacky and should be removed.
- public:
-  llvm::BasicBlock* GetBlockInsertionPoint() const;
-  llvm::BasicBlock* CreateBlock(llvm::BasicBlock* ip,
-                                const char*       name="") const;
-};
--- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,259 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkCacheDecache.cpp.incl"
-
-using namespace llvm;
-
-void SharkDecacher::start_frame() {
-  // Start recording the debug information
-  _pc_offset = code_buffer()->create_unique_offset();
-  _oopmap = new OopMap(
-    oopmap_slot_munge(stack()->oopmap_frame_size()),
-    oopmap_slot_munge(arg_size()));
-  debug_info()->add_safepoint(pc_offset(), oopmap());
-}
-
-void SharkDecacher::start_stack(int stack_depth) {
-  // Create the array we'll record our stack slots in
-  _exparray = new GrowableArray<ScopeValue*>(stack_depth);
-
-  // Set the stack pointer
-  stack()->CreateStoreStackPointer(
-    builder()->CreatePtrToInt(
-      stack()->slot_addr(
-        stack()->stack_slots_offset() + max_stack() - stack_depth),
-      SharkType::intptr_type()));
-}
-
-void SharkDecacher::process_stack_slot(int          index,
-                                       SharkValue** addr,
-                                       int          offset) {
-  SharkValue *value = *addr;
-
-  // Write the value to the frame if necessary
-  if (stack_slot_needs_write(index, value)) {
-    write_value_to_frame(
-      SharkType::to_stackType(value->basic_type()),
-      value->generic_value(),
-      adjusted_offset(value, offset));
-  }
-
-  // Record the value in the oopmap if necessary
-  if (stack_slot_needs_oopmap(index, value)) {
-    oopmap()->set_oop(slot2reg(offset));
-  }
-
-  // Record the value in the debuginfo if necessary
-  if (stack_slot_needs_debuginfo(index, value)) {
-    exparray()->append(slot2lv(offset, stack_location_type(index, addr)));
-  }
-}
-
-void SharkDecacher::start_monitors(int num_monitors) {
-  // Create the array we'll record our monitors in
-  _monarray = new GrowableArray<MonitorValue*>(num_monitors);
-}
-
-void SharkDecacher::process_monitor(int index, int box_offset, int obj_offset) {
-  oopmap()->set_oop(slot2reg(obj_offset));
-
-  monarray()->append(new MonitorValue(
-    slot2lv (obj_offset, Location::oop),
-    slot2loc(box_offset, Location::normal)));
-}
-
-void SharkDecacher::process_oop_tmp_slot(Value** value, int offset) {
-  // Decache the temporary oop slot
-  if (*value) {
-    write_value_to_frame(
-      SharkType::oop_type(),
-      *value,
-      offset);
-
-    oopmap()->set_oop(slot2reg(offset));
-  }
-}
-
-void SharkDecacher::process_method_slot(Value** value, int offset) {
-  // Decache the method pointer
-  write_value_to_frame(
-    SharkType::methodOop_type(),
-    *value,
-    offset);
-
-  oopmap()->set_oop(slot2reg(offset));
-}
-
-void SharkDecacher::process_pc_slot(int offset) {
-  // Record the PC
-  builder()->CreateStore(
-    builder()->code_buffer_address(pc_offset()),
-    stack()->slot_addr(offset));
-}
-
-void SharkDecacher::start_locals() {
-  // Create the array we'll record our local variables in
-  _locarray = new GrowableArray<ScopeValue*>(max_locals());}
-
-void SharkDecacher::process_local_slot(int          index,
-                                       SharkValue** addr,
-                                       int          offset) {
-  SharkValue *value = *addr;
-
-  // Write the value to the frame if necessary
-  if (local_slot_needs_write(index, value)) {
-    write_value_to_frame(
-      SharkType::to_stackType(value->basic_type()),
-      value->generic_value(),
-      adjusted_offset(value, offset));
-  }
-
-  // Record the value in the oopmap if necessary
-  if (local_slot_needs_oopmap(index, value)) {
-    oopmap()->set_oop(slot2reg(offset));
-  }
-
-  // Record the value in the debuginfo if necessary
-  if (local_slot_needs_debuginfo(index, value)) {
-    locarray()->append(slot2lv(offset, local_location_type(index, addr)));
-  }
-}
-
-void SharkDecacher::end_frame() {
-  // Record the scope
-  debug_info()->describe_scope(
-    pc_offset(),
-    target(),
-    bci(),
-    true,
-    false,
-    false,
-    debug_info()->create_scope_values(locarray()),
-    debug_info()->create_scope_values(exparray()),
-    debug_info()->create_monitor_values(monarray()));
-
-  // Finish recording the debug information
-  debug_info()->end_safepoint(pc_offset());
-}
-
-void SharkCacher::process_stack_slot(int          index,
-                                     SharkValue** addr,
-                                     int          offset) {
-  SharkValue *value = *addr;
-
-  // Read the value from the frame if necessary
-  if (stack_slot_needs_read(index, value)) {
-    *addr = SharkValue::create_generic(
-      value->type(),
-      read_value_from_frame(
-        SharkType::to_stackType(value->basic_type()),
-        adjusted_offset(value, offset)),
-      value->zero_checked());
-  }
-}
-
-void SharkOSREntryCacher::process_monitor(int index,
-                                          int box_offset,
-                                          int obj_offset) {
-  // Copy the monitor from the OSR buffer to the frame
-  int src_offset = max_locals() + index * 2;
-  builder()->CreateStore(
-    builder()->CreateLoad(
-      CreateAddressOfOSRBufEntry(src_offset, SharkType::intptr_type())),
-    stack()->slot_addr(box_offset, SharkType::intptr_type()));
-  builder()->CreateStore(
-    builder()->CreateLoad(
-      CreateAddressOfOSRBufEntry(src_offset + 1, SharkType::oop_type())),
-    stack()->slot_addr(obj_offset, SharkType::oop_type()));
-}
-
-void SharkCacher::process_oop_tmp_slot(Value** value, int offset) {
-  // Cache the temporary oop
-  if (*value)
-    *value = read_value_from_frame(SharkType::oop_type(), offset);
-}
-
-void SharkCacher::process_method_slot(Value** value, int offset) {
-  // Cache the method pointer
-  *value = read_value_from_frame(SharkType::methodOop_type(), offset);
-}
-
-void SharkFunctionEntryCacher::process_method_slot(Value** value, int offset) {
-  // "Cache" the method pointer
-  *value = method();
-}
-
-void SharkCacher::process_local_slot(int          index,
-                                     SharkValue** addr,
-                                     int          offset) {
-  SharkValue *value = *addr;
-
-  // Read the value from the frame if necessary
-  if (local_slot_needs_read(index, value)) {
-    *addr = SharkValue::create_generic(
-      value->type(),
-      read_value_from_frame(
-        SharkType::to_stackType(value->basic_type()),
-        adjusted_offset(value, offset)),
-      value->zero_checked());
-  }
-}
-
-Value* SharkOSREntryCacher::CreateAddressOfOSRBufEntry(int         offset,
-                                                       const Type* type) {
-  Value *result = builder()->CreateStructGEP(osr_buf(), offset);
-  if (type != SharkType::intptr_type())
-    result = builder()->CreateBitCast(result, PointerType::getUnqual(type));
-  return result;
-}
-
-void SharkOSREntryCacher::process_local_slot(int          index,
-                                             SharkValue** addr,
-                                             int          offset) {
-  SharkValue *value = *addr;
-
-  // Read the value from the OSR buffer if necessary
-  if (local_slot_needs_read(index, value)) {
-    *addr = SharkValue::create_generic(
-      value->type(),
-      builder()->CreateLoad(
-        CreateAddressOfOSRBufEntry(
-          adjusted_offset(value, max_locals() - 1 - index),
-          SharkType::to_stackType(value->basic_type()))),
-      value->zero_checked());
-  }
-}
-
-void SharkDecacher::write_value_to_frame(const Type* type,
-                                         Value*      value,
-                                         int         offset) {
-  builder()->CreateStore(value, stack()->slot_addr(offset, type));
-}
-
-Value* SharkCacher::read_value_from_frame(const Type* type, int offset) {
-  return builder()->CreateLoad(stack()->slot_addr(offset, type));
-}
--- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,417 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-// Class hierarchy:
-// - SharkStateScanner
-//   - SharkCacherDecacher
-//     - SharkDecacher
-//       - SharkJavaCallDecacher
-//       - SharkVMCallDecacher
-//       - SharkTrapDecacher
-//     - SharkCacher
-//       - SharkJavaCallCacher
-//       - SharkVMCallCacher
-//       - SharkFunctionEntryCacher
-//         - SharkNormalEntryCacher
-//         - SharkOSREntryCacher
-
-class SharkCacherDecacher : public SharkStateScanner {
- protected:
-  SharkCacherDecacher(SharkFunction* function)
-    : SharkStateScanner(function) {}
-
-  // Helper
- protected:
-  static int adjusted_offset(SharkValue* value, int offset) {
-    if (value->is_two_word())
-      offset--;
-    return offset;
-  }
-};
-
-class SharkDecacher : public SharkCacherDecacher {
- protected:
-  SharkDecacher(SharkFunction* function, int bci)
-    : SharkCacherDecacher(function), _bci(bci) {}
-
- private:
-  int _bci;
-
- protected:
-  int bci() const {
-    return _bci;
-  }
-
- private:
-  int                           _pc_offset;
-  OopMap*                       _oopmap;
-  GrowableArray<ScopeValue*>*   _exparray;
-  GrowableArray<MonitorValue*>* _monarray;
-  GrowableArray<ScopeValue*>*   _locarray;
-
- private:
-  int pc_offset() const {
-    return _pc_offset;
-  }
-  OopMap* oopmap() const {
-    return _oopmap;
-  }
-  GrowableArray<ScopeValue*>* exparray() const {
-    return _exparray;
-  }
-  GrowableArray<MonitorValue*>* monarray() const {
-    return _monarray;
-  }
-  GrowableArray<ScopeValue*>* locarray() const {
-    return _locarray;
-  }
-
-  // Callbacks
- protected:
-  void start_frame();
-
-  void start_stack(int stack_depth);
-  void process_stack_slot(int index, SharkValue** value, int offset);
-
-  void start_monitors(int num_monitors);
-  void process_monitor(int index, int box_offset, int obj_offset);
-
-  void process_oop_tmp_slot(llvm::Value** value, int offset);
-  void process_method_slot(llvm::Value** value, int offset);
-  void process_pc_slot(int offset);
-
-  void start_locals();
-  void process_local_slot(int index, SharkValue** value, int offset);
-
-  void end_frame();
-
-  // oopmap and debuginfo helpers
- private:
-  static int oopmap_slot_munge(int offset) {
-    return SharkStack::oopmap_slot_munge(offset);
-  }
-  static VMReg slot2reg(int offset) {
-    return SharkStack::slot2reg(offset);
-  }
-  static Location slot2loc(int offset, Location::Type type) {
-    return Location::new_stk_loc(type, offset * wordSize);
-  }
-  static LocationValue* slot2lv(int offset, Location::Type type) {
-    return new LocationValue(slot2loc(offset, type));
-  }
-  static Location::Type location_type(SharkValue** addr, bool maybe_two_word) {
-    // low addresses this end
-    //                           Type       32-bit    64-bit
-    //   ----------------------------------------------------
-    //   stack[0]    local[3]    jobject    oop       oop
-    //   stack[1]    local[2]    NULL       normal    lng
-    //   stack[2]    local[1]    jlong      normal    invalid
-    //   stack[3]    local[0]    jint       normal    normal
-    //
-    // high addresses this end
-
-    SharkValue *value = *addr;
-    if (value) {
-      if (value->is_jobject())
-        return Location::oop;
-#ifdef _LP64
-      if (value->is_two_word())
-        return Location::invalid;
-#endif // _LP64
-      return Location::normal;
-    }
-    else {
-      if (maybe_two_word) {
-        value = *(addr - 1);
-        if (value && value->is_two_word()) {
-#ifdef _LP64
-          if (value->is_jlong())
-            return Location::lng;
-          if (value->is_jdouble())
-            return Location::dbl;
-          ShouldNotReachHere();
-#else
-          return Location::normal;
-#endif // _LP64
-        }
-      }
-      return Location::invalid;
-    }
-  }
-
-  // Stack slot helpers
- protected:
-  virtual bool stack_slot_needs_write(int index, SharkValue* value) = 0;
-  virtual bool stack_slot_needs_oopmap(int index, SharkValue* value) = 0;
-  virtual bool stack_slot_needs_debuginfo(int index, SharkValue* value) = 0;
-
-  static Location::Type stack_location_type(int index, SharkValue** addr) {
-    return location_type(addr, *addr == NULL);
-  }
-
-  // Local slot helpers
- protected:
-  virtual bool local_slot_needs_write(int index, SharkValue* value) = 0;
-  virtual bool local_slot_needs_oopmap(int index, SharkValue* value) = 0;
-  virtual bool local_slot_needs_debuginfo(int index, SharkValue* value) = 0;
-
-  static Location::Type local_location_type(int index, SharkValue** addr) {
-    return location_type(addr, index > 0);
-  }
-
-  // Writer helper
- protected:
-  void write_value_to_frame(const llvm::Type* type,
-                            llvm::Value*      value,
-                            int               offset);
-};
-
-class SharkJavaCallDecacher : public SharkDecacher {
- public:
-  SharkJavaCallDecacher(SharkFunction* function, int bci, ciMethod* callee)
-    : SharkDecacher(function, bci), _callee(callee) {}
-
- private:
-  ciMethod* _callee;
-
- protected:
-  ciMethod* callee() const {
-    return _callee;
-  }
-
-  // Stack slot helpers
- protected:
-  bool stack_slot_needs_write(int index, SharkValue* value) {
-    return value && (index < callee()->arg_size() || value->is_jobject());
-  }
-  bool stack_slot_needs_oopmap(int index, SharkValue* value) {
-    return value && value->is_jobject() && index >= callee()->arg_size();
-  }
-  bool stack_slot_needs_debuginfo(int index, SharkValue* value) {
-    return index >= callee()->arg_size();
-  }
-
-  // Local slot helpers
- protected:
-  bool local_slot_needs_write(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool local_slot_needs_oopmap(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool local_slot_needs_debuginfo(int index, SharkValue* value) {
-    return true;
-  }
-};
-
-class SharkVMCallDecacher : public SharkDecacher {
- public:
-  SharkVMCallDecacher(SharkFunction* function, int bci)
-    : SharkDecacher(function, bci) {}
-
-  // Stack slot helpers
- protected:
-  bool stack_slot_needs_write(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool stack_slot_needs_oopmap(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool stack_slot_needs_debuginfo(int index, SharkValue* value) {
-    return true;
-  }
-
-  // Local slot helpers
- protected:
-  bool local_slot_needs_write(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool local_slot_needs_oopmap(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool local_slot_needs_debuginfo(int index, SharkValue* value) {
-    return true;
-  }
-};
-
-class SharkTrapDecacher : public SharkDecacher {
- public:
-  SharkTrapDecacher(SharkFunction* function, int bci)
-    : SharkDecacher(function, bci) {}
-
-  // Stack slot helpers
- protected:
-  bool stack_slot_needs_write(int index, SharkValue* value) {
-    return value != NULL;
-  }
-  bool stack_slot_needs_oopmap(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool stack_slot_needs_debuginfo(int index, SharkValue* value) {
-    return true;
-  }
-
-  // Local slot helpers
- protected:
-  bool local_slot_needs_write(int index, SharkValue* value) {
-    return value != NULL;
-  }
-  bool local_slot_needs_oopmap(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-  bool local_slot_needs_debuginfo(int index, SharkValue* value) {
-    return true;
-  }
-};
-
-class SharkCacher : public SharkCacherDecacher {
- protected:
-  SharkCacher(SharkFunction* function)
-    : SharkCacherDecacher(function) {}
-
-  // Callbacks
- protected:
-  void process_stack_slot(int index, SharkValue** value, int offset);
-
-  void process_oop_tmp_slot(llvm::Value** value, int offset);
-  virtual void process_method_slot(llvm::Value** value, int offset);
-
-  virtual void process_local_slot(int index, SharkValue** value, int offset);
-
-  // Stack slot helper
- protected:
-  virtual bool stack_slot_needs_read(int index, SharkValue* value) = 0;
-
-  // Local slot helper
- protected:
-  virtual bool local_slot_needs_read(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-
-  // Writer helper
- protected:
-  llvm::Value* read_value_from_frame(const llvm::Type* type, int offset);
-};
-
-class SharkJavaCallCacher : public SharkCacher {
- public:
-  SharkJavaCallCacher(SharkFunction* function, ciMethod* callee)
-    : SharkCacher(function), _callee(callee) {}
-
- private:
-  ciMethod* _callee;
-
- protected:
-  ciMethod* callee() const {
-    return _callee;
-  }
-
-  // Stack slot helper
- protected:
-  bool stack_slot_needs_read(int index, SharkValue* value) {
-    return value && (index < callee()->return_type()->size() ||
-                     value->is_jobject());
-  }
-};
-
-class SharkVMCallCacher : public SharkCacher {
- public:
-  SharkVMCallCacher(SharkFunction* function)
-    : SharkCacher(function) {}
-
-  // Stack slot helper
- protected:
-  bool stack_slot_needs_read(int index, SharkValue* value) {
-    return value && value->is_jobject();
-  }
-};
-
-class SharkFunctionEntryCacher : public SharkCacher {
- public:
-  SharkFunctionEntryCacher(SharkFunction* function, llvm::Value* method)
-    : SharkCacher(function), _method(method) {}
-
- private:
-  llvm::Value* _method;
-
- private:
-  llvm::Value* method() const {
-    return _method;
-  }
-
-  // Method slot callback
- protected:
-  void process_method_slot(llvm::Value** value, int offset);
-
-  // Stack slot helper
- protected:
-  bool stack_slot_needs_read(int index, SharkValue* value) {
-    ShouldNotReachHere(); // entry block shouldn't have stack
-  }
-
-  // Local slot helper
- protected:
-  bool local_slot_needs_read(int index, SharkValue* value) {
-    return value != NULL;
-  }
-};
-
-class SharkNormalEntryCacher : public SharkFunctionEntryCacher {
- public:
-  SharkNormalEntryCacher(SharkFunction* function, llvm::Value* method)
-    : SharkFunctionEntryCacher(function, method) {}
-};
-
-class SharkOSREntryCacher : public SharkFunctionEntryCacher {
- public:
-  SharkOSREntryCacher(SharkFunction* function,
-                      llvm::Value*   method,
-                      llvm::Value*   osr_buf)
-    : SharkFunctionEntryCacher(function, method),
-      _osr_buf(
-        builder()->CreateBitCast(
-          osr_buf,
-          llvm::PointerType::getUnqual(
-            llvm::ArrayType::get(
-              SharkType::intptr_type(),
-              max_locals() + max_monitors() * 2)))) {}
-
- private:
-  llvm::Value* _osr_buf;
-
- private:
-  llvm::Value* osr_buf() const {
-    return _osr_buf;
-  }
-
-  // Callbacks
- protected:
-  void process_monitor(int index, int box_offset, int obj_offset);
-  void process_local_slot(int index, SharkValue** value, int offset);
-
-  // Helper
- private:
-  llvm::Value* CreateAddressOfOSRBufEntry(int offset, const llvm::Type* type);
-};
--- a/ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkCodeBuffer : public StackObj {
- public:
-  SharkCodeBuffer(MacroAssembler* masm)
-    : _masm(masm), _base_pc(NULL) {}
-
- private:
-  MacroAssembler* _masm;
-  llvm::Value*    _base_pc;
-
- private:
-  MacroAssembler* masm() const {
-    return _masm;
-  }
-
- public:
-  llvm::Value* base_pc() const {
-    return _base_pc;
-  }
-  void set_base_pc(llvm::Value* base_pc) {
-    assert(_base_pc == NULL, "only do this once");
-    _base_pc = base_pc;
-  }
-
-  // Allocate some space in the buffer and return its address.
-  // This buffer will have been relocated by the time the method
-  // is installed, so you can't inline the result in code.
- public:
-  void* malloc(size_t size) const {
-    masm()->align(BytesPerWord);
-    void *result = masm()->pc();
-    masm()->advance(size);
-    return result;
-  }
-
-  // Create a unique offset in the buffer.
- public:
-  int create_unique_offset() const {
-    int offset = masm()->offset();
-    masm()->advance(1);
-    return offset;
-  }
-
-  // Inline an oop into the buffer and return its offset.
- public:
-  int inline_oop(jobject object) const {
-    masm()->align(BytesPerWord);
-    int offset = masm()->offset();
-    masm()->store_oop(object);
-    return offset;
-  }
-
-  // Inline a block of non-oop data into the buffer and return its offset.
- public:
-  int inline_data(void *src, size_t size) const {
-    masm()->align(BytesPerWord);
-    int offset = masm()->offset();
-    void *dst = masm()->pc();
-    masm()->advance(size);
-    memcpy(dst, src, size);
-    return offset;
-  }
-};
--- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,340 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkCompiler.cpp.incl"
-
-#include <fnmatch.h>
-
-using namespace llvm;
-
-#if SHARK_LLVM_VERSION >= 27
-namespace {
-  cl::opt<std::string>
-  MCPU("mcpu");
-
-  cl::list<std::string>
-  MAttrs("mattr",
-         cl::CommaSeparated);
-}
-#endif
-
-SharkCompiler::SharkCompiler()
-  : AbstractCompiler() {
-  // Create the lock to protect the memory manager and execution engine
-  _execution_engine_lock = new Monitor(Mutex::leaf, "SharkExecutionEngineLock");
-  MutexLocker locker(execution_engine_lock());
-
-  // Make LLVM safe for multithreading
-  if (!llvm_start_multithreaded())
-    fatal("llvm_start_multithreaded() failed");
-
-  // Initialize the native target
-  InitializeNativeTarget();
-
-  // Create the two contexts which we'll use
-  _normal_context = new SharkContext("normal");
-  _native_context = new SharkContext("native");
-
-  // Create the memory manager
-  _memory_manager = new SharkMemoryManager();
-
-#if SHARK_LLVM_VERSION >= 27
-  // Finetune LLVM for the current host CPU.
-  StringMap<bool> Features;
-  bool gotCpuFeatures = llvm::sys::getHostCPUFeatures(Features);
-  std::string cpu("-mcpu=" + llvm::sys::getHostCPUName());
-
-  std::vector<const char*> args;
-  args.push_back(""); // program name
-  args.push_back(cpu.c_str());
-
-  std::string mattr("-mattr=");
-  if(gotCpuFeatures){
-    for(StringMap<bool>::iterator I = Features.begin(),
-      E = Features.end(); I != E; ++I){
-      if(I->second){
-        std::string attr(I->first());
-        mattr+="+"+attr+",";
-      }
-    }
-    args.push_back(mattr.c_str());
-  }
-
-  args.push_back(0);  // terminator
-  cl::ParseCommandLineOptions(args.size() - 1, (char **) &args[0]);
-
-  // Create the JIT
-  std::string ErrorMsg;
-
-  EngineBuilder builder(_normal_context->module());
-  builder.setMCPU(MCPU);
-  builder.setMAttrs(MAttrs);
-  builder.setJITMemoryManager(memory_manager());
-  builder.setEngineKind(EngineKind::JIT);
-  builder.setErrorStr(&ErrorMsg);
-  _execution_engine = builder.create();
-
-  if (!execution_engine()) {
-    if (!ErrorMsg.empty())
-      printf("Error while creating Shark JIT: %s\n",ErrorMsg.c_str());
-    else
-      printf("Unknown error while creating Shark JIT\n");
-    exit(1);
-  }
-
-  execution_engine()->addModule(
-    _native_context->module());
-#else
-  _execution_engine = ExecutionEngine::createJIT(
-    _normal_context->module_provider(),
-    NULL, memory_manager(), CodeGenOpt::Default);
-  execution_engine()->addModuleProvider(
-    _native_context->module_provider());
-#endif
-
-  // All done
-  mark_initialized();
-}
-
-void SharkCompiler::initialize() {
-  ShouldNotCallThis();
-}
-
-void SharkCompiler::compile_method(ciEnv*    env,
-                                   ciMethod* target,
-                                   int       entry_bci) {
-  assert(is_initialized(), "should be");
-  ResourceMark rm;
-  const char *name = methodname(
-    target->holder()->name()->as_utf8(), target->name()->as_utf8());
-
-  // Do the typeflow analysis
-  ciTypeFlow *flow;
-  if (entry_bci == InvocationEntryBci)
-    flow = target->get_flow_analysis();
-  else
-    flow = target->get_osr_flow_analysis(entry_bci);
-  if (flow->failing())
-    return;
-  if (SharkPrintTypeflowOf != NULL) {
-    if (!fnmatch(SharkPrintTypeflowOf, name, 0))
-      flow->print_on(tty);
-  }
-
-  // Create the recorders
-  Arena arena;
-  env->set_oop_recorder(new OopRecorder(&arena));
-  OopMapSet oopmaps;
-  env->set_debug_info(new DebugInformationRecorder(env->oop_recorder()));
-  env->debug_info()->set_oopmaps(&oopmaps);
-  env->set_dependencies(new Dependencies(env));
-
-  // Create the code buffer and builder
-  CodeBuffer hscb("Shark", 256 * K, 64 * K);
-  hscb.initialize_oop_recorder(env->oop_recorder());
-  MacroAssembler *masm = new MacroAssembler(&hscb);
-  SharkCodeBuffer cb(masm);
-  SharkBuilder builder(&cb);
-
-  // Emit the entry point
-  SharkEntry *entry = (SharkEntry *) cb.malloc(sizeof(SharkEntry));
-
-  // Build the LLVM IR for the method
-  Function *function = SharkFunction::build(env, &builder, flow, name);
-
-  // Generate native code.  It's unpleasant that we have to drop into
-  // the VM to do this -- it blocks safepoints -- but I can't see any
-  // other way to handle the locking.
-  {
-    ThreadInVMfromNative tiv(JavaThread::current());
-    generate_native_code(entry, function, name);
-  }
-
-  // Install the method into the VM
-  CodeOffsets offsets;
-  offsets.set_value(CodeOffsets::Deopt, 0);
-  offsets.set_value(CodeOffsets::Exceptions, 0);
-  offsets.set_value(CodeOffsets::Verified_Entry,
-                    target->is_static() ? 0 : wordSize);
-
-  ExceptionHandlerTable handler_table;
-  ImplicitExceptionTable inc_table;
-
-  env->register_method(target,
-                       entry_bci,
-                       &offsets,
-                       0,
-                       &hscb,
-                       0,
-                       &oopmaps,
-                       &handler_table,
-                       &inc_table,
-                       this,
-                       env->comp_level(),
-                       false,
-                       false);
-}
-
-nmethod* SharkCompiler::generate_native_wrapper(MacroAssembler* masm,
-                                                methodHandle    target,
-                                                BasicType*      arg_types,
-                                                BasicType       return_type) {
-  assert(is_initialized(), "should be");
-  ResourceMark rm;
-  const char *name = methodname(
-    target->klass_name()->as_utf8(), target->name()->as_utf8());
-
-  // Create the code buffer and builder
-  SharkCodeBuffer cb(masm);
-  SharkBuilder builder(&cb);
-
-  // Emit the entry point
-  SharkEntry *entry = (SharkEntry *) cb.malloc(sizeof(SharkEntry));
-
-  // Build the LLVM IR for the method
-  SharkNativeWrapper *wrapper = SharkNativeWrapper::build(
-    &builder, target, name, arg_types, return_type);
-
-  // Generate native code
-  generate_native_code(entry, wrapper->function(), name);
-
-  // Return the nmethod for installation in the VM
-  return nmethod::new_native_nmethod(target,
-                                     masm->code(),
-                                     0,
-                                     0,
-                                     wrapper->frame_size(),
-                                     wrapper->receiver_offset(),
-                                     wrapper->lock_offset(),
-                                     wrapper->oop_maps());
-}
-
-void SharkCompiler::generate_native_code(SharkEntry* entry,
-                                         Function*   function,
-                                         const char* name) {
-  // Print the LLVM bitcode, if requested
-  if (SharkPrintBitcodeOf != NULL) {
-    if (!fnmatch(SharkPrintBitcodeOf, name, 0))
-      function->dump();
-  }
-
-  // Compile to native code
-  address code = NULL;
-  context()->add_function(function);
-  {
-    MutexLocker locker(execution_engine_lock());
-    free_queued_methods();
-
-    if (SharkPrintAsmOf != NULL) {
-#if SHARK_LLVM_VERSION >= 27
-#ifndef NDEBUG
-      if (!fnmatch(SharkPrintAsmOf, name, 0)) {
-        llvm::SetCurrentDebugType(X86_ONLY("x86-emitter") NOT_X86("jit"));
-        llvm::DebugFlag = true;
-      }
-      else {
-        llvm::SetCurrentDebugType("");
-        llvm::DebugFlag = false;
-      }
-#endif // !NDEBUG
-#else
-      // NB you need to patch LLVM with http://tinyurl.com/yf3baln for this
-      std::vector<const char*> args;
-      args.push_back(""); // program name
-      if (!fnmatch(SharkPrintAsmOf, name, 0))
-        args.push_back("-debug-only=x86-emitter");
-      else
-        args.push_back("-debug-only=none");
-      args.push_back(0);  // terminator
-      cl::ParseCommandLineOptions(args.size() - 1, (char **) &args[0]);
-#endif // SHARK_LLVM_VERSION
-    }
-    memory_manager()->set_entry_for_function(function, entry);
-    code = (address) execution_engine()->getPointerToFunction(function);
-  }
-  entry->set_entry_point(code);
-  entry->set_function(function);
-  entry->set_context(context());
-  address code_start = entry->code_start();
-  address code_limit = entry->code_limit();
-
-  // Register generated code for profiling, etc
-  if (JvmtiExport::should_post_dynamic_code_generated())
-    JvmtiExport::post_dynamic_code_generated(name, code_start, code_limit);
-
-  // Print debug information, if requested
-  if (SharkTraceInstalls) {
-    tty->print_cr(
-      " [%p-%p): %s (%d bytes code)",
-      code_start, code_limit, name, code_limit - code_start);
-  }
-}
-
-void SharkCompiler::free_compiled_method(address code) {
-  // This method may only be called when the VM is at a safepoint.
-  // All _thread_in_vm threads will be waiting for the safepoint to
-  // finish with the exception of the VM thread, so we can consider
-  // ourself the owner of the execution engine lock even though we
-  // can't actually acquire it at this time.
-  assert(Thread::current()->is_VM_thread(), "must be called by VM thread");
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-
-  SharkEntry *entry = (SharkEntry *) code;
-  entry->context()->push_to_free_queue(entry->function());
-}
-
-void SharkCompiler::free_queued_methods() {
-  // The free queue is protected by the execution engine lock
-  assert(execution_engine_lock()->owned_by_self(), "should be");
-
-  while (true) {
-    Function *function = context()->pop_from_free_queue();
-    if (function == NULL)
-      break;
-
-    execution_engine()->freeMachineCodeForFunction(function);
-    function->eraseFromParent();
-  }
-}
-
-const char* SharkCompiler::methodname(const char* klass, const char* method) {
-  char *buf = NEW_RESOURCE_ARRAY(char, strlen(klass) + 2 + strlen(method) + 1);
-
-  char *dst = buf;
-  for (const char *c = klass; *c; c++) {
-    if (*c == '/')
-      *(dst++) = '.';
-    else
-      *(dst++) = *c;
-  }
-  *(dst++) = ':';
-  *(dst++) = ':';
-  for (const char *c = method; *c; c++) {
-    *(dst++) = *c;
-  }
-  *(dst++) = '\0';
-  return buf;
-}
--- a/ports/hotspot/src/share/vm/shark/sharkCompiler.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkContext;
-
-class SharkCompiler : public AbstractCompiler {
- public:
-  // Creation
-  SharkCompiler();
-
-  // Name of this compiler
-  const char *name()     { return "shark"; }
-
-  // Missing feature tests
-  bool supports_native() { return true; }
-  bool supports_osr()    { return true; }
-
-  // Customization
-  bool needs_adapters()  { return false; }
-  bool needs_stubs()     { return false; }
-
-  // Initialization
-  void initialize();
-
-  // Compile a normal (bytecode) method and install it in the VM
-  void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
-
-  // Generate a wrapper for a native (JNI) method
-  nmethod* generate_native_wrapper(MacroAssembler* masm,
-                                   methodHandle    target,
-                                   BasicType*      arg_types,
-                                   BasicType       return_type);
-
-  // Free compiled methods (and native wrappers)
-  void free_compiled_method(address code);
-
-  // Each thread generating IR needs its own context.  The normal
-  // context is used for bytecode methods, and is protected from
-  // multiple simultaneous accesses by being restricted to the
-  // compiler thread.  The native context is used for JNI methods,
-  // and is protected from multiple simultaneous accesses by the
-  // adapter handler library lock.
- private:
-  SharkContext* _normal_context;
-  SharkContext* _native_context;
-
- public:
-  SharkContext* context() const {
-    if (JavaThread::current()->is_Compiler_thread()) {
-      return _normal_context;
-    }
-    else {
-      assert(AdapterHandlerLibrary_lock->owned_by_self(), "should be");
-      return _native_context;
-    }
-  }
-
-  // The LLVM execution engine is the JIT we use to generate native
-  // code.  It is thread safe, but we need to protect it with a lock
-  // of our own because otherwise LLVM's lock and HotSpot's locks
-  // interleave and deadlock.  The SharkMemoryManager is not thread
-  // safe, and is protected by the same lock as the execution engine.
- private:
-  Monitor*               _execution_engine_lock;
-  SharkMemoryManager*    _memory_manager;
-  llvm::ExecutionEngine* _execution_engine;
-
- private:
-  Monitor* execution_engine_lock() const {
-    return _execution_engine_lock;
-  }
-  SharkMemoryManager* memory_manager() const {
-    assert(execution_engine_lock()->owned_by_self(), "should be");
-    return _memory_manager;
-  }
-  llvm::ExecutionEngine* execution_engine() const {
-    assert(execution_engine_lock()->owned_by_self(), "should be");
-    return _execution_engine;
-  }
-
-  // Global access
- public:
-  static SharkCompiler* compiler() {
-    AbstractCompiler *compiler =
-      CompileBroker::compiler(CompLevel_fast_compile);
-    assert(compiler->is_shark() && compiler->is_initialized(), "should be");
-    return (SharkCompiler *) compiler;
-  }
-
-  // Helpers
- private:
-  static const char* methodname(const char* klass, const char* method);
-  void generate_native_code(SharkEntry*     entry,
-                            llvm::Function* function,
-                            const char*     name);
-  void free_queued_methods();
-};
--- a/ports/hotspot/src/share/vm/shark/sharkConstant.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkConstant.cpp.incl"
-
-using namespace llvm;
-
-SharkConstant* SharkConstant::for_ldc(ciBytecodeStream *iter) {
-  ciConstant constant = iter->get_constant();
-  ciType *type = NULL;
-  if (constant.basic_type() == T_OBJECT) {
-    ciEnv *env = ciEnv::current();
-    if (constant.as_object()->is_klass())
-      type = env->Class_klass();
-    else
-      type = env->String_klass();
-  }
-  return new SharkConstant(constant, type);
-}
-
-SharkConstant* SharkConstant::for_field(ciBytecodeStream *iter) {
-  bool will_link;
-  ciField *field = iter->get_field(will_link);
-  assert(will_link, "typeflow responsibility");
-
-  return new SharkConstant(field->constant_value(), field->type());
-}
-
-SharkConstant::SharkConstant(ciConstant constant, ciType *type) {
-  SharkValue *value = NULL;
-
-  switch (constant.basic_type()) {
-  case T_BOOLEAN:
-  case T_BYTE:
-  case T_CHAR:
-  case T_SHORT:
-  case T_INT:
-    value = SharkValue::jint_constant(constant.as_int());
-    break;
-
-  case T_LONG:
-    value = SharkValue::jlong_constant(constant.as_long());
-    break;
-
-  case T_FLOAT:
-    value = SharkValue::jfloat_constant(constant.as_float());
-    break;
-
-  case T_DOUBLE:
-    value = SharkValue::jdouble_constant(constant.as_double());
-    break;
-
-  case T_OBJECT:
-  case T_ARRAY:
-    break;
-
-  case T_ILLEGAL:
-    // out of memory
-    _is_loaded = false;
-    return;
-
-  default:
-    tty->print_cr("Unhandled type %s", type2name(constant.basic_type()));
-    ShouldNotReachHere();
-  }
-
-  // Handle primitive types.  We create SharkValues for these
-  // now; doing so doesn't emit any code, and it allows us to
-  // delegate a bunch of stuff to the SharkValue code.
-  if (value) {
-    _value       = value;
-    _is_loaded   = true;
-    _is_nonzero  = value->zero_checked();
-    _is_two_word = value->is_two_word();
-    return;
-  }
-
-  // Handle reference types.  This is tricky because some
-  // ciObjects are psuedo-objects that refer to oops which
-  // have yet to be created.  We need to spot the unloaded
-  // objects (which differ between ldc* and get*, thanks!)
-  ciObject *object = constant.as_object();
-  assert(type != NULL, "shouldn't be");
-  if (object->is_klass()) {
-    // The constant returned for a klass is the ciKlass
-    // for the entry, but we want the java_mirror.
-    ciKlass *klass = object->as_klass();
-    if (!klass->is_loaded()) {
-      _is_loaded = false;
-      return;
-    }
-    object = klass->java_mirror();
-  }
-  if (object->is_null_object() || !object->should_be_constant()) {
-    _is_loaded = false;
-    return;
-  }
-
-  _value       = NULL;
-  _object      = object;
-  _type        = type;
-  _is_loaded   = true;
-  _is_nonzero  = true;
-  _is_two_word = false;
-}
--- a/ports/hotspot/src/share/vm/shark/sharkConstant.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkConstant : public ResourceObj {
- public:
-  static SharkConstant* for_ldc(ciBytecodeStream* iter);
-  static SharkConstant* for_field(ciBytecodeStream* iter);
-
- private:
-  SharkConstant(ciConstant constant, ciType* type);
-
- private:
-  SharkValue* _value;
-  ciObject*   _object;
-  ciType*     _type;
-  bool        _is_loaded;
-  bool        _is_nonzero;
-  bool        _is_two_word;
-
- public:
-  bool is_loaded() const {
-    return _is_loaded;
-  }
-  bool is_nonzero() const {
-    assert(is_loaded(), "should be");
-    return _is_nonzero;
-  }
-  bool is_two_word() const {
-    assert(is_loaded(), "should be");
-    return _is_two_word;
-  }
-
- public:
-  SharkValue* value(SharkBuilder* builder) {
-    assert(is_loaded(), "should be");
-    if (_value == NULL) {
-      _value = SharkValue::create_generic(
-        _type, builder->CreateInlineOop(_object), _is_nonzero);
-    }
-    return _value;
-  }
-};
--- a/ports/hotspot/src/share/vm/shark/sharkContext.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkContext.cpp.incl"
-
-using namespace llvm;
-
-SharkContext::SharkContext(const char* name)
-  : LLVMContext(),
-    _free_queue(NULL) {
-  // Create a module to build our functions into
-  _module = new Module(name, *this);
-
-  // Create basic types
-  _void_type    = Type::getVoidTy(*this);
-  _bit_type     = Type::getInt1Ty(*this);
-  _jbyte_type   = Type::getInt8Ty(*this);
-  _jshort_type  = Type::getInt16Ty(*this);
-  _jint_type    = Type::getInt32Ty(*this);
-  _jlong_type   = Type::getInt64Ty(*this);
-  _jfloat_type  = Type::getFloatTy(*this);
-  _jdouble_type = Type::getDoubleTy(*this);
-
-  // Create compound types
-  _itableOffsetEntry_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), itableOffsetEntry::size() * wordSize));
-
-  _klass_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), sizeof(Klass)));
-
-  _jniEnv_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), sizeof(JNIEnv)));
-
-  _jniHandleBlock_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), sizeof(JNIHandleBlock)));
-
-  _methodOop_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), sizeof(methodOopDesc)));
-
-  _monitor_type = ArrayType::get(
-    jbyte_type(), frame::interpreter_frame_monitor_size() * wordSize);
-
-  _oop_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), sizeof(oopDesc)));
-
-  _thread_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), sizeof(JavaThread)));
-
-  _zeroStack_type = PointerType::getUnqual(
-    ArrayType::get(jbyte_type(), sizeof(ZeroStack)));
-
-  std::vector<const Type*> params;
-  params.push_back(methodOop_type());
-  params.push_back(intptr_type());
-  params.push_back(thread_type());
-  _entry_point_type = FunctionType::get(jint_type(), params, false);
-
-  params.clear();
-  params.push_back(methodOop_type());
-  params.push_back(PointerType::getUnqual(jbyte_type()));
-  params.push_back(intptr_type());
-  params.push_back(thread_type());
-  _osr_entry_point_type = FunctionType::get(jint_type(), params, false);
-
-  // Create mappings
-  for (int i = 0; i < T_CONFLICT; i++) {
-    switch (i) {
-    case T_BOOLEAN:
-      _to_stackType[i] = jint_type();
-      _to_arrayType[i] = jbyte_type();
-      break;
-
-    case T_BYTE:
-      _to_stackType[i] = jint_type();
-      _to_arrayType[i] = jbyte_type();
-      break;
-
-    case T_CHAR:
-      _to_stackType[i] = jint_type();
-      _to_arrayType[i] = jshort_type();
-      break;
-
-    case T_SHORT:
-      _to_stackType[i] = jint_type();
-      _to_arrayType[i] = jshort_type();
-      break;
-
-    case T_INT:
-      _to_stackType[i] = jint_type();
-      _to_arrayType[i] = jint_type();
-      break;
-
-    case T_LONG:
-      _to_stackType[i] = jlong_type();
-      _to_arrayType[i] = jlong_type();
-      break;
-
-    case T_FLOAT:
-      _to_stackType[i] = jfloat_type();
-      _to_arrayType[i] = jfloat_type();
-      break;
-
-    case T_DOUBLE:
-      _to_stackType[i] = jdouble_type();
-      _to_arrayType[i] = jdouble_type();
-      break;
-
-    case T_OBJECT:
-    case T_ARRAY:
-      _to_stackType[i] = oop_type();
-      _to_arrayType[i] = oop_type();
-      break;
-
-    case T_ADDRESS:
-      _to_stackType[i] = intptr_type();
-      _to_arrayType[i] = NULL;
-      break;
-
-    default:
-      _to_stackType[i] = NULL;
-      _to_arrayType[i] = NULL;
-    }
-  }
-}
-
-class SharkFreeQueueItem : public CHeapObj {
- public:
-  SharkFreeQueueItem(llvm::Function* function, SharkFreeQueueItem *next)
-    : _function(function), _next(next) {}
-
- private:
-  llvm::Function*     _function;
-  SharkFreeQueueItem* _next;
-
- public:
-  llvm::Function* function() const {
-    return _function;
-  }
-  SharkFreeQueueItem* next() const {
-    return _next;
-  }
-};
-
-void SharkContext::push_to_free_queue(Function* function) {
-  _free_queue = new SharkFreeQueueItem(function, _free_queue);
-}
-
-Function* SharkContext::pop_from_free_queue() {
-  if (_free_queue == NULL)
-    return NULL;
-
-  SharkFreeQueueItem *item = _free_queue;
-  Function *function = item->function();
-  _free_queue = item->next();
-  delete item;
-  return function;
-}
--- a/ports/hotspot/src/share/vm/shark/sharkContext.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-// The LLVMContext class allows multiple instances of LLVM to operate
-// independently of each other in a multithreaded context.  We extend
-// this here to store things in Shark that are LLVMContext-specific.
-
-class SharkFreeQueueItem;
-
-class SharkContext : public llvm::LLVMContext {
- public:
-  SharkContext(const char* name);
-
- private:
-  llvm::Module* _module;
-
-#if SHARK_LLVM_VERSION >= 27
- public:
-#else
- private:
-#endif
-  llvm::Module* module() const {
-    return _module;
-  }
-
-  // Get this thread's SharkContext
- public:
-  static SharkContext& current() {
-    return *SharkCompiler::compiler()->context();
-  }
-
-  // Module accessors
- public:
-#if SHARK_LLVM_VERSION < 27
-  llvm::ModuleProvider* module_provider() const {
-    return new llvm::ExistingModuleProvider(module());
-  }
-#endif
-  void add_function(llvm::Function* function) const {
-    module()->getFunctionList().push_back(function);
-  }
-  llvm::Constant* get_external(const char*               name,
-                               const llvm::FunctionType* sig) {
-    return module()->getOrInsertFunction(name, sig);
-  }
-
-  // Basic types
- private:
-  const llvm::Type*        _void_type;
-  const llvm::IntegerType* _bit_type;
-  const llvm::IntegerType* _jbyte_type;
-  const llvm::IntegerType* _jshort_type;
-  const llvm::IntegerType* _jint_type;
-  const llvm::IntegerType* _jlong_type;
-  const llvm::Type*        _jfloat_type;
-  const llvm::Type*        _jdouble_type;
-
- public:
-  const llvm::Type* void_type() const {
-    return _void_type;
-  }
-  const llvm::IntegerType* bit_type() const {
-    return _bit_type;
-  }
-  const llvm::IntegerType* jbyte_type() const {
-    return _jbyte_type;
-  }
-  const llvm::IntegerType* jshort_type() const {
-    return _jshort_type;
-  }
-  const llvm::IntegerType* jint_type() const {
-    return _jint_type;
-  }
-  const llvm::IntegerType* jlong_type() const {
-    return _jlong_type;
-  }
-  const llvm::Type* jfloat_type() const {
-    return _jfloat_type;
-  }
-  const llvm::Type* jdouble_type() const {
-    return _jdouble_type;
-  }
-  const llvm::IntegerType* intptr_type() const {
-    return LP64_ONLY(jlong_type()) NOT_LP64(jint_type());
-  }
-
-  // Compound types
- private:
-  const llvm::PointerType*  _itableOffsetEntry_type;
-  const llvm::PointerType*  _jniEnv_type;
-  const llvm::PointerType*  _jniHandleBlock_type;
-  const llvm::PointerType*  _klass_type;
-  const llvm::PointerType*  _methodOop_type;
-  const llvm::ArrayType*    _monitor_type;
-  const llvm::PointerType*  _oop_type;
-  const llvm::PointerType*  _thread_type;
-  const llvm::PointerType*  _zeroStack_type;
-  const llvm::FunctionType* _entry_point_type;
-  const llvm::FunctionType* _osr_entry_point_type;
-
- public:
-  const llvm::PointerType* itableOffsetEntry_type() const {
-    return _itableOffsetEntry_type;
-  }
-  const llvm::PointerType* jniEnv_type() const {
-    return _jniEnv_type;
-  }
-  const llvm::PointerType* jniHandleBlock_type() const {
-    return _jniHandleBlock_type;
-  }
-  const llvm::PointerType* klass_type() const {
-    return _klass_type;
-  }
-  const llvm::PointerType* methodOop_type() const {
-    return _methodOop_type;
-  }
-  const llvm::ArrayType* monitor_type() const {
-    return _monitor_type;
-  }
-  const llvm::PointerType* oop_type() const {
-    return _oop_type;
-  }
-  const llvm::PointerType* thread_type() const {
-    return _thread_type;
-  }
-  const llvm::PointerType* zeroStack_type() const {
-    return _zeroStack_type;
-  }
-  const llvm::FunctionType* entry_point_type() const {
-    return _entry_point_type;
-  }
-  const llvm::FunctionType* osr_entry_point_type() const {
-    return _osr_entry_point_type;
-  }
-
-  // Mappings
- private:
-  const llvm::Type* _to_stackType[T_CONFLICT];
-  const llvm::Type* _to_arrayType[T_CONFLICT];
-
- private:
-  const llvm::Type* map_type(const llvm::Type* const* table,
-                             BasicType                type) const {
-    assert(type >= 0 && type < T_CONFLICT, "unhandled type");
-    const llvm::Type* result = table[type];
-    assert(type != NULL, "unhandled type");
-    return result;
-  }
-
- public:
-  const llvm::Type* to_stackType(BasicType type) const {
-    return map_type(_to_stackType, type);
-  }
-  const llvm::Type* to_arrayType(BasicType type) const {
-    return map_type(_to_arrayType, type);
-  }
-
-  // Functions queued for freeing
- private:
-  SharkFreeQueueItem* _free_queue;
-
- public:
-  void push_to_free_queue(llvm::Function* function);
-  llvm::Function* pop_from_free_queue();
-};
--- a/ports/hotspot/src/share/vm/shark/sharkEntry.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkContext;
-
-class SharkEntry : public ZeroEntry {
- private:
-  address         _code_limit;
-  SharkContext*   _context;
-  llvm::Function* _function;
-
- public:
-  address code_start() const {
-    return entry_point();
-  }
-  address code_limit() const {
-    return _code_limit;
-  }
-  SharkContext* context() const {
-    return _context;
-  }
-  llvm::Function* function() const {
-    return _function;
-  }
-
- public:
-  void set_code_limit(address code_limit) {
-    _code_limit = code_limit;
-  }
-  void set_context(SharkContext* context) {
-    _context = context;
-  }
-  void set_function(llvm::Function* function) {
-    _function = function;
-  }
-};
--- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkFunction.cpp.incl"
-
-using namespace llvm;
-
-void SharkFunction::initialize(const char *name) {
-  // Create the function
-  _function = Function::Create(
-    entry_point_type(),
-    GlobalVariable::InternalLinkage,
-    name);
-
-  // Get our arguments
-  Function::arg_iterator ai = function()->arg_begin();
-  Argument *method = ai++;
-  method->setName("method");
-  Argument *osr_buf = NULL;
-  if (is_osr()) {
-    osr_buf = ai++;
-    osr_buf->setName("osr_buf");
-  }
-  Argument *base_pc = ai++;
-  base_pc->setName("base_pc");
-  code_buffer()->set_base_pc(base_pc);
-  Argument *thread = ai++;
-  thread->setName("thread");
-  set_thread(thread);
-
-  // Create the list of blocks
-  set_block_insertion_point(NULL);
-  _blocks = NEW_RESOURCE_ARRAY(SharkTopLevelBlock*, block_count());
-  for (int i = 0; i < block_count(); i++) {
-    ciTypeFlow::Block *b = flow()->pre_order_at(i);
-
-    // Work around a bug in pre_order_at() that does not return
-    // the correct pre-ordering.  If pre_order_at() were correct
-    // this line could simply be:
-    // _blocks[i] = new SharkTopLevelBlock(this, b);
-    _blocks[b->pre_order()] = new SharkTopLevelBlock(this, b);
-  }
-
-  // Walk the tree from the start block to determine which
-  // blocks are entered and which blocks require phis
-  SharkTopLevelBlock *start_block = block(flow()->start_block_num());
-  assert(start_block->start() == flow()->start_bci(), "blocks out of order");
-  start_block->enter();
-
-  // Initialize all entered blocks
-  for (int i = 0; i < block_count(); i++) {
-    if (block(i)->entered())
-      block(i)->initialize();
-  }
-
-  // Create and push our stack frame
-  set_block_insertion_point(&function()->front());
-  builder()->SetInsertPoint(CreateBlock());
-  _stack = SharkStack::CreateBuildAndPushFrame(this, method);
-
-  // Create the entry state
-  SharkState *entry_state;
-  if (is_osr()) {
-    entry_state = new SharkOSREntryState(start_block, method, osr_buf);
-
-    // Free the OSR buffer
-    builder()->CreateCall(builder()->osr_migration_end(), osr_buf);
-  }
-  else {
-    entry_state = new SharkNormalEntryState(start_block, method);
-
-    // Lock if necessary
-    if (is_synchronized()) {
-      SharkTopLevelBlock *locker =
-        new SharkTopLevelBlock(this, start_block->ciblock());
-      locker->add_incoming(entry_state);
-
-      set_block_insertion_point(start_block->entry_block());
-      locker->acquire_method_lock();
-
-      entry_state = locker->current_state();
-    }
-  }
-
-  // Transition into the method proper
-  start_block->add_incoming(entry_state);
-  builder()->CreateBr(start_block->entry_block());
-
-  // Parse the blocks
-  for (int i = 0; i < block_count(); i++) {
-    if (!block(i)->entered())
-      continue;
-
-    if (i + 1 < block_count())
-      set_block_insertion_point(block(i + 1)->entry_block());
-    else
-      set_block_insertion_point(NULL);
-
-    block(i)->emit_IR();
-  }
-  do_deferred_zero_checks();
-}
-
-class DeferredZeroCheck : public SharkTargetInvariants {
- public:
-  DeferredZeroCheck(SharkTopLevelBlock* block, SharkValue* value)
-    : SharkTargetInvariants(block),
-      _block(block),
-      _value(value),
-      _bci(block->bci()),
-      _state(block->current_state()->copy()),
-      _check_block(builder()->GetInsertBlock()),
-      _continue_block(function()->CreateBlock("not_zero")) {
-    builder()->SetInsertPoint(continue_block());
-  }
-
- private:
-  SharkTopLevelBlock* _block;
-  SharkValue*         _value;
-  int                 _bci;
-  SharkState*         _state;
-  BasicBlock*         _check_block;
-  BasicBlock*         _continue_block;
-
- public:
-  SharkTopLevelBlock* block() const {
-    return _block;
-  }
-  SharkValue* value() const {
-    return _value;
-  }
-  int bci() const {
-    return _bci;
-  }
-  SharkState* state() const {
-    return _state;
-  }
-  BasicBlock* check_block() const {
-    return _check_block;
-  }
-  BasicBlock* continue_block() const {
-    return _continue_block;
-  }
-
- public:
-  SharkFunction* function() const {
-    return block()->function();
-  }
-
- public:
-  void process() const {
-    builder()->SetInsertPoint(check_block());
-    block()->do_deferred_zero_check(value(), bci(), state(), continue_block());
-  }
-};
-
-void SharkFunction::add_deferred_zero_check(SharkTopLevelBlock* block,
-                                            SharkValue*         value) {
-  deferred_zero_checks()->append(new DeferredZeroCheck(block, value));
-}
-
-void SharkFunction::do_deferred_zero_checks() {
-  for (int i = 0; i < deferred_zero_checks()->length(); i++)
-    deferred_zero_checks()->at(i)->process();
-}
--- a/ports/hotspot/src/share/vm/shark/sharkFunction.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkTopLevelBlock;
-class DeferredZeroCheck;
-
-class SharkFunction : public SharkTargetInvariants {
- friend class SharkStackWithNormalFrame;
-
- public:
-  static llvm::Function* build(ciEnv*        env,
-                               SharkBuilder* builder,
-                               ciTypeFlow*   flow,
-                               const char*   name) {
-    SharkFunction function(env, builder, flow, name);
-    return function.function();
-  }
-
- private:
-  SharkFunction(ciEnv*        env,
-                SharkBuilder* builder,
-                ciTypeFlow*   flow,
-                const char*   name)
-    : SharkTargetInvariants(env, builder, flow) { initialize(name); }
-
- private:
-  void initialize(const char* name);
-
- private:
-  llvm::Function*                   _function;
-  SharkTopLevelBlock**              _blocks;
-  GrowableArray<DeferredZeroCheck*> _deferred_zero_checks;
-  SharkStack*                       _stack;
-
- public:
-  llvm::Function* function() const {
-    return _function;
-  }
-  int block_count() const {
-    return flow()->block_count();
-  }
-  SharkTopLevelBlock* block(int i) const {
-    assert(i < block_count(), "should be");
-    return _blocks[i];
-  }
-  GrowableArray<DeferredZeroCheck*>* deferred_zero_checks() {
-    return &_deferred_zero_checks;
-  }
-  SharkStack* stack() const {
-    return _stack;
-  }
-
-  // On-stack replacement
- private:
-  bool is_osr() const {
-    return flow()->is_osr_flow();
-  }
-  const llvm::FunctionType* entry_point_type() const {
-    if (is_osr())
-      return SharkType::osr_entry_point_type();
-    else
-      return SharkType::entry_point_type();
-  }
-
-  // Block management
- private:
-  llvm::BasicBlock* _block_insertion_point;
-
-  void set_block_insertion_point(llvm::BasicBlock* block_insertion_point) {
-    _block_insertion_point = block_insertion_point;
-  }
-  llvm::BasicBlock* block_insertion_point() const {
-    return _block_insertion_point;
-  }
-
- public:
-  llvm::BasicBlock* CreateBlock(const char* name = "") const {
-    return llvm::BasicBlock::Create(
-      SharkContext::current(), name, function(), block_insertion_point());
-  }
-
-  // Deferred zero checks
- public:
-  void add_deferred_zero_check(SharkTopLevelBlock* block,
-                               SharkValue*         value);
-
- private:
-  void do_deferred_zero_checks();
-};
--- a/ports/hotspot/src/share/vm/shark/sharkInliner.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,749 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkInliner.cpp.incl"
-
-using namespace llvm;
-
-class SharkInlineBlock : public SharkBlock {
- public:
-  SharkInlineBlock(ciMethod* target, SharkState* state)
-    : SharkBlock(state, target),
-      _outer_state(state),
-      _entry_state(new SharkState(this)) {
-    for (int i = target->max_locals() - 1; i >= 0; i--) {
-      SharkValue *value = NULL;
-      if (i < target->arg_size())
-        value = outer_state()->pop();
-      entry_state()->set_local(i, value);
-    }
-  }
-
- private:
-  SharkState* _outer_state;
-  SharkState* _entry_state;
-
- private:
-  SharkState* outer_state() {
-    return _outer_state;
-  }
-  SharkState* entry_state() {
-    return _entry_state;
-  }
-
- public:
-  void emit_IR() {
-    parse_bytecode(0, target()->code_size());
-  }
-
- private:
-  void do_return(BasicType type) {
-    if (type != T_VOID) {
-      SharkValue *result = pop_result(type);
-      outer_state()->push(result);
-      if (result->is_two_word())
-        outer_state()->push(NULL);
-    }
-  }
-};
-
-class SharkInlinerHelper : public StackObj {
- public:
-  SharkInlinerHelper(ciMethod* target, SharkState* entry_state)
-    : _target(target),
-      _entry_state(entry_state),
-      _iter(target) {}
-
- private:
-  ciBytecodeStream _iter;
-  SharkState*      _entry_state;
-  ciMethod*        _target;
-
- public:
-  ciBytecodeStream* iter() {
-    return &_iter;
-  }
-  SharkState* entry_state() const {
-    return _entry_state;
-  }
-  ciMethod* target() const {
-    return _target;
-  }
-
- public:
-  Bytecodes::Code bc() {
-    return iter()->cur_bc();
-  }
-  int max_locals() const {
-    return target()->max_locals();
-  }
-  int max_stack() const {
-    return target()->max_stack();
-  }
-
-  // Inlinability check
- public:
-  bool is_inlinable();
-
- private:
-  void initialize_for_check();
-
-  bool do_getstatic() {
-    return do_field_access(true, false);
-  }
-  bool do_getfield() {
-    return do_field_access(true, true);
-  }
-  bool do_putfield() {
-    return do_field_access(false, true);
-  }
-  bool do_field_access(bool is_get, bool is_field);
-
-  // Local variables for inlinability check
- private:
-  bool* _locals;
-
- public:
-  bool* local_addr(int index) const {
-    assert(index >= 0 && index < max_locals(), "bad local variable index");
-    return &_locals[index];
-  }
-  bool local(int index) const {
-    return *local_addr(index);
-  }
-  void set_local(int index, bool value) {
-    *local_addr(index) = value;
-  }
-
-  // Expression stack for inlinability check
- private:
-  bool* _stack;
-  bool* _sp;
-
- public:
-  int stack_depth() const {
-    return _sp - _stack;
-  }
-  bool* stack_addr(int slot) const {
-    assert(slot >= 0 && slot < stack_depth(), "bad stack slot");
-    return &_sp[-(slot + 1)];
-  }
-  void push(bool value) {
-    assert(stack_depth() < max_stack(), "stack overrun");
-    *(_sp++) = value;
-  }
-  bool pop() {
-    assert(stack_depth() > 0, "stack underrun");
-    return *(--_sp);
-  }
-
-  // Methods for two-word locals
- public:
-  void push_pair_local(int index) {
-    push(local(index));
-    push(local(index + 1));
-  }
-  void pop_pair_local(int index) {
-    set_local(index + 1, pop());
-    set_local(index, pop());
-  }
-
-  // Code generation
- public:
-  void do_inline() {
-    (new SharkInlineBlock(target(), entry_state()))->emit_IR();
-  }
-};
-
-// Quick checks so we can bail out before doing too much
-bool SharkInliner::may_be_inlinable(ciMethod *target) {
-  // We can't inline native methods
-  if (target->is_native())
-    return false;
-
-  // Not much point inlining abstract ones, and in any
-  // case we'd need a stack frame to throw the exception
-  if (target->is_abstract())
-    return false;
-
-  // Don't inline anything huge
-  if (target->code_size() > SharkMaxInlineSize)
-    return false;
-
-  // Monitors aren't allowed without a frame to put them in
-  if (target->is_synchronized() || target->has_monitor_bytecodes())
-    return false;
-
-  // We don't do control flow
-  if (target->has_exception_handlers() || target->has_jsrs())
-    return false;
-
-  // Don't try to inline constructors, as they must
-  // eventually call Object.<init> which we can't inline.
-  // Note that this catches <clinit> too, but why would
-  // we be compiling that?
-  if (target->is_initializer())
-    return false;
-
-  // Mustn't inline Object.<init>
-  // Should be caught by the above, but just in case...
-  if (target->intrinsic_id() == vmIntrinsics::_Object_init)
-    return false;
-
-  return true;
-}
-
-// Full-on detailed check, for methods that pass the quick checks
-// Inlined methods have no stack frame, so we can't do anything
-// that would require one.  This means no safepoints (and hence
-// no loops) and no VM calls.  No VM calls means, amongst other
-// things, that no exceptions can be created, which means no null
-// checks or divide-by-zero checks are allowed.  The lack of null
-// checks in particular would eliminate practically everything,
-// but we can get around that restriction by relying on the zero-
-// check eliminator to strip the checks.  To do that, we need to
-// walk through the method, tracking which values are and are not
-// zero-checked.
-bool SharkInlinerHelper::is_inlinable() {
-  ResourceMark rm;
-  initialize_for_check();
-
-  SharkConstant *sc;
-  bool a, b, c, d;
-
-  iter()->reset_to_bci(0);
-  while (iter()->next() != ciBytecodeStream::EOBC()) {
-    switch (bc()) {
-    case Bytecodes::_nop:
-      break;
-
-    case Bytecodes::_aconst_null:
-      push(false);
-      break;
-
-    case Bytecodes::_iconst_0:
-      push(false);
-      break;
-    case Bytecodes::_iconst_m1:
-    case Bytecodes::_iconst_1:
-    case Bytecodes::_iconst_2:
-    case Bytecodes::_iconst_3:
-    case Bytecodes::_iconst_4:
-    case Bytecodes::_iconst_5:
-      push(true);
-      break;
-
-    case Bytecodes::_lconst_0:
-      push(false);
-      push(false);
-      break;
-    case Bytecodes::_lconst_1:
-      push(true);
-      push(false);
-      break;
-
-    case Bytecodes::_fconst_0:
-    case Bytecodes::_fconst_1:
-    case Bytecodes::_fconst_2:
-      push(false);
-      break;
-
-    case Bytecodes::_dconst_0:
-    case Bytecodes::_dconst_1:
-      push(false);
-      push(false);
-      break;
-
-    case Bytecodes::_bipush:
-      push(iter()->get_byte() != 0);
-      break;
-    case Bytecodes::_sipush:
-      push(iter()->get_short() != 0);
-      break;
-
-    case Bytecodes::_ldc:
-    case Bytecodes::_ldc_w:
-    case Bytecodes::_ldc2_w:
-      sc = SharkConstant::for_ldc(iter());
-      if (!sc->is_loaded())
-        return false;
-      push(sc->is_nonzero());
-      if (sc->is_two_word())
-        push(false);
-      break;
-
-    case Bytecodes::_iload_0:
-    case Bytecodes::_fload_0:
-    case Bytecodes::_aload_0:
-      push(local(0));
-      break;
-    case Bytecodes::_lload_0:
-    case Bytecodes::_dload_0:
-      push_pair_local(0);
-      break;
-
-    case Bytecodes::_iload_1:
-    case Bytecodes::_fload_1:
-    case Bytecodes::_aload_1:
-      push(local(1));
-      break;
-    case Bytecodes::_lload_1:
-    case Bytecodes::_dload_1:
-      push_pair_local(1);
-      break;
-
-    case Bytecodes::_iload_2:
-    case Bytecodes::_fload_2:
-    case Bytecodes::_aload_2:
-      push(local(2));
-      break;
-    case Bytecodes::_lload_2:
-    case Bytecodes::_dload_2:
-      push_pair_local(2);
-      break;
-
-    case Bytecodes::_iload_3:
-    case Bytecodes::_fload_3:
-    case Bytecodes::_aload_3:
-      push(local(3));
-      break;
-    case Bytecodes::_lload_3:
-    case Bytecodes::_dload_3:
-      push_pair_local(3);
-      break;
-
-    case Bytecodes::_iload:
-    case Bytecodes::_fload:
-    case Bytecodes::_aload:
-      push(local(iter()->get_index()));
-      break;
-    case Bytecodes::_lload:
-    case Bytecodes::_dload:
-      push_pair_local(iter()->get_index());
-      break;
-
-    case Bytecodes::_istore_0:
-    case Bytecodes::_fstore_0:
-    case Bytecodes::_astore_0:
-      set_local(0, pop());
-      break;
-    case Bytecodes::_lstore_0:
-    case Bytecodes::_dstore_0:
-      pop_pair_local(0);
-      break;
-
-    case Bytecodes::_istore_1:
-    case Bytecodes::_fstore_1:
-    case Bytecodes::_astore_1:
-      set_local(1, pop());
-      break;
-    case Bytecodes::_lstore_1:
-    case Bytecodes::_dstore_1:
-      pop_pair_local(1);
-      break;
-
-    case Bytecodes::_istore_2:
-    case Bytecodes::_fstore_2:
-    case Bytecodes::_astore_2:
-      set_local(2, pop());
-      break;
-    case Bytecodes::_lstore_2:
-    case Bytecodes::_dstore_2:
-      pop_pair_local(2);
-      break;
-
-    case Bytecodes::_istore_3:
-    case Bytecodes::_fstore_3:
-    case Bytecodes::_astore_3:
-      set_local(3, pop());
-      break;
-    case Bytecodes::_lstore_3:
-    case Bytecodes::_dstore_3:
-      pop_pair_local(3);
-      break;
-
-    case Bytecodes::_istore:
-    case Bytecodes::_fstore:
-    case Bytecodes::_astore:
-      set_local(iter()->get_index(), pop());
-      break;
-    case Bytecodes::_lstore:
-    case Bytecodes::_dstore:
-      pop_pair_local(iter()->get_index());
-      break;
-
-    case Bytecodes::_pop:
-      pop();
-      break;
-    case Bytecodes::_pop2:
-      pop();
-      pop();
-      break;
-    case Bytecodes::_swap:
-      a = pop();
-      b = pop();
-      push(a);
-      push(b);
-      break;
-    case Bytecodes::_dup:
-      a = pop();
-      push(a);
-      push(a);
-      break;
-    case Bytecodes::_dup_x1:
-      a = pop();
-      b = pop();
-      push(a);
-      push(b);
-      push(a);
-      break;
-    case Bytecodes::_dup_x2:
-      a = pop();
-      b = pop();
-      c = pop();
-      push(a);
-      push(c);
-      push(b);
-      push(a);
-      break;
-    case Bytecodes::_dup2:
-      a = pop();
-      b = pop();
-      push(b);
-      push(a);
-      push(b);
-      push(a);
-      break;
-    case Bytecodes::_dup2_x1:
-      a = pop();
-      b = pop();
-      c = pop();
-      push(b);
-      push(a);
-      push(c);
-      push(b);
-      push(a);
-      break;
-    case Bytecodes::_dup2_x2:
-      a = pop();
-      b = pop();
-      c = pop();
-      d = pop();
-      push(b);
-      push(a);
-      push(d);
-      push(c);
-      push(b);
-      push(a);
-      break;
-
-    case Bytecodes::_getfield:
-      if (!do_getfield())
-        return false;
-      break;
-    case Bytecodes::_getstatic:
-      if (!do_getstatic())
-        return false;
-      break;
-    case Bytecodes::_putfield:
-      if (!do_putfield())
-        return false;
-      break;
-
-    case Bytecodes::_iadd:
-    case Bytecodes::_isub:
-    case Bytecodes::_imul:
-    case Bytecodes::_iand:
-    case Bytecodes::_ixor:
-    case Bytecodes::_ishl:
-    case Bytecodes::_ishr:
-    case Bytecodes::_iushr:
-      pop();
-      pop();
-      push(false);
-      break;
-    case Bytecodes::_ior:
-      a = pop();
-      b = pop();
-      push(a && b);
-      break;
-    case Bytecodes::_idiv:
-    case Bytecodes::_irem:
-      if (!pop())
-        return false;
-      pop();
-      push(false);
-      break;
-    case Bytecodes::_ineg:
-      break;
-
-    case Bytecodes::_ladd:
-    case Bytecodes::_lsub:
-    case Bytecodes::_lmul:
-    case Bytecodes::_land:
-    case Bytecodes::_lxor:
-      pop();
-      pop();
-      pop();
-      pop();
-      push(false);
-      push(false);
-      break;
-    case Bytecodes::_lor:
-      a = pop();
-      b = pop();
-      push(a && b);
-      break;
-    case Bytecodes::_ldiv:
-    case Bytecodes::_lrem:
-      pop();
-      if (!pop())
-        return false;
-      pop();
-      pop();
-      push(false);
-      push(false);
-      break;
-    case Bytecodes::_lneg:
-      break;
-    case Bytecodes::_lshl:
-    case Bytecodes::_lshr:
-    case Bytecodes::_lushr:
-      pop();
-      pop();
-      pop();
-      push(false);
-      push(false);
-      break;
-
-    case Bytecodes::_fadd:
-    case Bytecodes::_fsub:
-    case Bytecodes::_fmul:
-    case Bytecodes::_fdiv:
-    case Bytecodes::_frem:
-      pop();
-      pop();
-      push(false);
-      break;
-    case Bytecodes::_fneg:
-      break;
-
-    case Bytecodes::_dadd:
-    case Bytecodes::_dsub:
-    case Bytecodes::_dmul:
-    case Bytecodes::_ddiv:
-    case Bytecodes::_drem:
-      pop();
-      pop();
-      pop();
-      pop();
-      push(false);
-      push(false);
-      break;
-    case Bytecodes::_dneg:
-      break;
-
-    case Bytecodes::_iinc:
-      set_local(iter()->get_index(), false);
-      break;
-
-    case Bytecodes::_lcmp:
-      pop();
-      pop();
-      pop();
-      pop();
-      push(false);
-      break;
-
-    case Bytecodes::_fcmpl:
-    case Bytecodes::_fcmpg:
-      pop();
-      pop();
-      push(false);
-      break;
-
-    case Bytecodes::_dcmpl:
-    case Bytecodes::_dcmpg:
-      pop();
-      pop();
-      pop();
-      pop();
-      push(false);
-      break;
-
-    case Bytecodes::_i2l:
-      push(false);
-      break;
-    case Bytecodes::_i2f:
-      pop();
-      push(false);
-      break;
-    case Bytecodes::_i2d:
-      pop();
-      push(false);
-      push(false);
-      break;
-
-    case Bytecodes::_l2i:
-    case Bytecodes::_l2f:
-      pop();
-      pop();
-      push(false);
-      break;
-    case Bytecodes::_l2d:
-      pop();
-      pop();
-      push(false);
-      push(false);
-      break;
-
-    case Bytecodes::_f2i:
-      pop();
-      push(false);
-      break;
-    case Bytecodes::_f2l:
-    case Bytecodes::_f2d:
-      pop();
-      push(false);
-      push(false);
-      break;
-
-    case Bytecodes::_d2i:
-    case Bytecodes::_d2f:
-      pop();
-      pop();
-      push(false);
-      break;
-    case Bytecodes::_d2l:
-      pop();
-      pop();
-      push(false);
-      push(false);
-      break;
-
-    case Bytecodes::_i2b:
-    case Bytecodes::_i2c:
-    case Bytecodes::_i2s:
-      pop();
-      push(false);
-      break;
-
-    case Bytecodes::_return:
-    case Bytecodes::_ireturn:
-    case Bytecodes::_lreturn:
-    case Bytecodes::_freturn:
-    case Bytecodes::_dreturn:
-    case Bytecodes::_areturn:
-      break;
-
-    default:
-      return false;
-    }
-  }
-
-  return true;
-}
-
-void SharkInlinerHelper::initialize_for_check() {
-  _locals = NEW_RESOURCE_ARRAY(bool, max_locals());
-  _stack = NEW_RESOURCE_ARRAY(bool, max_stack());
-
-  memset(_locals, 0, max_locals() * sizeof(bool));
-  for (int i = 0; i < target()->arg_size(); i++) {
-    SharkValue *arg = entry_state()->stack(target()->arg_size() - 1 - i);
-    if (arg && arg->zero_checked())
-      set_local(i, true);
-  }
-
-  _sp = _stack;
-}
-
-bool SharkInlinerHelper::do_field_access(bool is_get, bool is_field) {
-  assert(is_get || is_field, "can't inline putstatic");
-
-  // If the holder isn't linked then there isn't a lot we can do
-  if (!target()->holder()->is_linked())
-    return false;
-
-  // Get the field
-  bool will_link;
-  ciField *field = iter()->get_field(will_link);
-  if (!will_link)
-    return false;
-
-  // If the field is mismatched then an exception needs throwing
-  if (is_field == field->is_static())
-    return false;
-
-  // Pop the value off the stack if necessary
-  if (!is_get) {
-    pop();
-    if (field->type()->is_two_word())
-      pop();
-  }
-
-  // Pop and null-check the receiver if necessary
-  if (is_field) {
-    if (!pop())
-      return false;
-  }
-
-  // Push the result if necessary
-  if (is_get) {
-    bool result_pushed = false;
-    if (field->is_constant()) {
-      SharkConstant *sc = SharkConstant::for_field(iter());
-      if (sc->is_loaded()) {
-        push(sc->is_nonzero());
-        result_pushed = true;
-      }
-    }
-
-    if (!result_pushed)
-      push(false);
-
-    if (field->type()->is_two_word())
-      push(false);
-  }
-
-  return true;
-}
-
-bool SharkInliner::attempt_inline(ciMethod *target, SharkState *state) {
-  if (SharkIntrinsics::is_intrinsic(target)) {
-    SharkIntrinsics::inline_intrinsic(target, state);
-    return true;
-  }
-
-  if (may_be_inlinable(target)) {
-    SharkInlinerHelper inliner(target, state);
-    if (inliner.is_inlinable()) {
-      inliner.do_inline();
-      return true;
-    }
-  }
-  return false;
-}
--- a/ports/hotspot/src/share/vm/shark/sharkInliner.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkInliner : public AllStatic {
- public:
-  static bool attempt_inline(ciMethod* target, SharkState* state);
-
- private:
-  static bool may_be_inlinable(ciMethod* target);
-};
--- a/ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkIntrinsics.cpp.incl"
-
-using namespace llvm;
-
-bool SharkIntrinsics::is_intrinsic(ciMethod *target) {
-  switch (target->intrinsic_id()) {
-  case vmIntrinsics::_none:
-    return false;
-
-    // java.lang.Math
-  case vmIntrinsics::_min:
-  case vmIntrinsics::_max:
-  case vmIntrinsics::_dabs:
-  case vmIntrinsics::_dsin:
-  case vmIntrinsics::_dcos:
-  case vmIntrinsics::_dtan:
-  case vmIntrinsics::_datan2:
-  case vmIntrinsics::_dsqrt:
-  case vmIntrinsics::_dlog:
-  case vmIntrinsics::_dlog10:
-  case vmIntrinsics::_dpow:
-  case vmIntrinsics::_dexp:
-    return true;
-
-    // java.lang.Object
-  case vmIntrinsics::_getClass:
-    return true;
-
-    // java.lang.System
-  case vmIntrinsics::_currentTimeMillis:
-    return true;
-
-    // java.lang.Thread
-  case vmIntrinsics::_currentThread:
-    return true;
-
-    // sun.misc.Unsafe
-  case vmIntrinsics::_compareAndSwapInt:
-    return true;
-
-  default:
-    if (SharkPerformanceWarnings) {
-      warning(
-        "unhandled intrinsic vmIntrinsic::%s",
-        vmIntrinsics::name_at(target->intrinsic_id()));
-    }
-  }
-  return false;
-}
-
-void SharkIntrinsics::inline_intrinsic(ciMethod *target, SharkState *state) {
-  SharkIntrinsics intrinsic(state, target);
-  intrinsic.do_intrinsic();
-}
-
-void SharkIntrinsics::do_intrinsic() {
-  switch (target()->intrinsic_id()) {
-    // java.lang.Math
-  case vmIntrinsics::_min:
-    do_Math_minmax(llvm::ICmpInst::ICMP_SLE);
-    break;
-  case vmIntrinsics::_max:
-    do_Math_minmax(llvm::ICmpInst::ICMP_SGE);
-    break;
-  case vmIntrinsics::_dabs:
-    do_Math_1to1(builder()->fabs());
-    break;
-  case vmIntrinsics::_dsin:
-    do_Math_1to1(builder()->sin());
-    break;
-  case vmIntrinsics::_dcos:
-    do_Math_1to1(builder()->cos());
-    break;
-  case vmIntrinsics::_dtan:
-    do_Math_1to1(builder()->tan());
-    break;
-  case vmIntrinsics::_datan2:
-    do_Math_2to1(builder()->atan2());
-    break;
-  case vmIntrinsics::_dsqrt:
-    do_Math_1to1(builder()->sqrt());
-    break;
-  case vmIntrinsics::_dlog:
-    do_Math_1to1(builder()->log());
-    break;
-  case vmIntrinsics::_dlog10:
-    do_Math_1to1(builder()->log10());
-    break;
-  case vmIntrinsics::_dpow:
-    do_Math_2to1(builder()->pow());
-    break;
-  case vmIntrinsics::_dexp:
-    do_Math_1to1(builder()->exp());
-    break;
-
-    // java.lang.Object
-  case vmIntrinsics::_getClass:
-    do_Object_getClass();
-    break;
-
-    // java.lang.System
-  case vmIntrinsics::_currentTimeMillis:
-    do_System_currentTimeMillis();
-    break;
-
-    // java.lang.Thread
-  case vmIntrinsics::_currentThread:
-    do_Thread_currentThread();
-    break;
-
-    // sun.misc.Unsafe
-  case vmIntrinsics::_compareAndSwapInt:
-    do_Unsafe_compareAndSwapInt();
-    break;
-
-  default:
-    ShouldNotReachHere();
-  }
-}
-
-void SharkIntrinsics::do_Math_minmax(ICmpInst::Predicate p) {
-  // Pop the arguments
-  SharkValue *sb = state()->pop();
-  SharkValue *sa = state()->pop();
-  Value *a = sa->jint_value();
-  Value *b = sb->jint_value();
-
-  // Perform the test
-  BasicBlock *ip       = builder()->GetBlockInsertionPoint();
-  BasicBlock *return_a = builder()->CreateBlock(ip, "return_a");
-  BasicBlock *return_b = builder()->CreateBlock(ip, "return_b");
-  BasicBlock *done     = builder()->CreateBlock(ip, "done");
-
-  builder()->CreateCondBr(builder()->CreateICmp(p, a, b), return_a, return_b);
-
-  builder()->SetInsertPoint(return_a);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(return_b);
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(done);
-  PHINode *phi = builder()->CreatePHI(a->getType(), "result");
-  phi->addIncoming(a, return_a);
-  phi->addIncoming(b, return_b);
-
-  // Push the result
-  state()->push(
-    SharkValue::create_jint(
-      phi,
-      sa->zero_checked() && sb->zero_checked()));
-}
-
-void SharkIntrinsics::do_Math_1to1(Value *function) {
-  SharkValue *empty = state()->pop();
-  assert(empty == NULL, "should be");
-  state()->push(
-    SharkValue::create_jdouble(
-      builder()->CreateCall(
-        function, state()->pop()->jdouble_value())));
-  state()->push(NULL);
-}
-
-void SharkIntrinsics::do_Math_2to1(Value *function) {
-  SharkValue *empty = state()->pop();
-  assert(empty == NULL, "should be");
-  Value *y = state()->pop()->jdouble_value();
-  empty = state()->pop();
-  assert(empty == NULL, "should be");
-  Value *x = state()->pop()->jdouble_value();
-
-  state()->push(
-    SharkValue::create_jdouble(
-      builder()->CreateCall2(function, x, y)));
-  state()->push(NULL);
-}
-
-void SharkIntrinsics::do_Object_getClass() {
-  Value *klass = builder()->CreateValueOfStructEntry(
-    state()->pop()->jobject_value(),
-    in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::oop_type(),
-    "klass");
-
-  Value *klass_part = builder()->CreateAddressOfStructEntry(
-    klass,
-    in_ByteSize(klassOopDesc::klass_part_offset_in_bytes()),
-    SharkType::klass_type(),
-    "klass_part");
-
-  state()->push(
-    SharkValue::create_jobject(
-      builder()->CreateValueOfStructEntry(
-        klass_part,
-        in_ByteSize(Klass::java_mirror_offset_in_bytes()),
-        SharkType::oop_type(),
-        "java_mirror"),
-      true));
-}
-
-void SharkIntrinsics::do_System_currentTimeMillis() {
-  state()->push(
-    SharkValue::create_jlong(
-      builder()->CreateCall(builder()->current_time_millis()),
-      false));
-  state()->push(NULL);
-}
-
-void SharkIntrinsics::do_Thread_currentThread() {
-  state()->push(
-    SharkValue::create_jobject(
-      builder()->CreateValueOfStructEntry(
-        thread(), JavaThread::threadObj_offset(),
-        SharkType::oop_type(),
-        "threadObj"),
-      true));
-}
-
-void SharkIntrinsics::do_Unsafe_compareAndSwapInt() {
-  // Pop the arguments
-  Value *x      = state()->pop()->jint_value();
-  Value *e      = state()->pop()->jint_value();
-  SharkValue *empty = state()->pop();
-  assert(empty == NULL, "should be");
-  Value *offset = state()->pop()->jlong_value();
-  Value *object = state()->pop()->jobject_value();
-  Value *unsafe = state()->pop()->jobject_value();
-
-  // Convert the offset
-  offset = builder()->CreateCall(
-    builder()->unsafe_field_offset_to_byte_offset(),
-    offset);
-
-  // Locate the field
-  Value *addr = builder()->CreateIntToPtr(
-    builder()->CreateAdd(
-      builder()->CreatePtrToInt(object, SharkType::intptr_type()),
-      builder()->CreateIntCast(offset, SharkType::intptr_type(), true)),
-    PointerType::getUnqual(SharkType::jint_type()),
-    "addr");
-
-  // Perform the operation
-  Value *result = builder()->CreateCmpxchgInt(x, addr, e);
-
-  // Push the result
-  state()->push(
-    SharkValue::create_jint(
-      builder()->CreateIntCast(
-        builder()->CreateICmpEQ(result, e), SharkType::jint_type(), true),
-      false));
-}
--- a/ports/hotspot/src/share/vm/shark/sharkIntrinsics.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkIntrinsics : public SharkTargetInvariants {
- public:
-  static bool is_intrinsic(ciMethod* target);
-  static void inline_intrinsic(ciMethod* target, SharkState* state);
-
- private:
-  SharkIntrinsics(SharkState* state, ciMethod* target)
-    : SharkTargetInvariants(state, target), _state(state) {}
-
- private:
-  SharkState* _state;
-
- private:
-  SharkState* state() const {
-    return _state;
-  }
-
- private:
-  void do_intrinsic();
-
- private:
-  void do_Math_minmax(llvm::ICmpInst::Predicate p);
-  void do_Math_1to1(llvm::Value* function);
-  void do_Math_2to1(llvm::Value* function);
-  void do_Object_getClass();
-  void do_System_currentTimeMillis();
-  void do_Thread_currentThread();
-  void do_Unsafe_compareAndSwapInt();
-};
--- a/ports/hotspot/src/share/vm/shark/sharkInvariants.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkInvariants.cpp.incl"
-
-int SharkTargetInvariants::count_monitors() {
-  int result = 0;
-  if (is_synchronized() || target()->has_monitor_bytecodes()) {
-    for (int i = 0; i < flow()->block_count(); i++) {
-      result = MAX2(result, flow()->pre_order_at(i)->monitor_count());
-    }
-  }
-  return result;
-}
--- a/ports/hotspot/src/share/vm/shark/sharkInvariants.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-// Base classes used to track various values through the compilation.
-// SharkCompileInvariants is used to track values which remain the
-// same for the top-level method and any inlined methods it may have
-// (ie for the whole compilation).  SharkTargetInvariants is used to
-// track values which differ between methods.
-
-class SharkCompileInvariants : public ResourceObj {
- protected:
-  SharkCompileInvariants(ciEnv* env, SharkBuilder* builder)
-    : _env(env),
-      _builder(builder),
-      _thread(NULL) {}
-
-  SharkCompileInvariants(const SharkCompileInvariants* parent)
-    : _env(parent->_env),
-      _builder(parent->_builder),
-      _thread(parent->_thread) {}
-
- private:
-  ciEnv*        _env;
-  SharkBuilder* _builder;
-  llvm::Value*  _thread;
-
-  // Top-level broker for HotSpot's Compiler Interface.
-  //
-  // Its main purpose is to allow the various CI classes to access
-  // oops in the VM without having to worry about safepointing.  In
-  // addition to this it acts as a holder for various recorders and
-  // memory allocators.
-  //
-  // Accessing this directly is kind of ugly, so it's private.  Add
-  // new accessors below if you need something from it.
- private:
-  ciEnv* env() const {
-    assert(_env != NULL, "env not available");
-    return _env;
-  }
-
-  // The SharkBuilder that is used to build LLVM IR.
- protected:
-  SharkBuilder* builder() const {
-    return _builder;
-  }
-
-  // Pointer to this thread's JavaThread object.  This is not
-  // available until a short way into SharkFunction creation
-  // so a setter is required.  Assertions are used to enforce
-  // invariance.
- protected:
-  llvm::Value* thread() const {
-    assert(_thread != NULL, "thread not available");
-    return _thread;
-  }
-  void set_thread(llvm::Value* thread) {
-    assert(_thread == NULL, "thread already set");
-    _thread = thread;
-  }
-
-  // Objects that handle various aspects of the compilation.
- protected:
-  DebugInformationRecorder* debug_info() const {
-    return env()->debug_info();
-  }
-  Dependencies* dependencies() const {
-    return env()->dependencies();
-  }
-  SharkCodeBuffer* code_buffer() const {
-    return builder()->code_buffer();
-  }
-
-  // Commonly used classes
- protected:
-  ciInstanceKlass* java_lang_Object_klass() const {
-    return env()->Object_klass();
-  }
-  ciInstanceKlass* java_lang_Throwable_klass() const {
-    return env()->Throwable_klass();
-  }
-};
-
-class SharkTargetInvariants : public SharkCompileInvariants {
- protected:
-  SharkTargetInvariants(ciEnv* env, SharkBuilder* builder, ciTypeFlow* flow)
-    : SharkCompileInvariants(env, builder),
-      _target(flow->method()),
-      _flow(flow),
-      _max_monitors(count_monitors()) {}
-
-  SharkTargetInvariants(const SharkCompileInvariants* parent, ciMethod* target)
-    : SharkCompileInvariants(parent),
-      _target(target),
-      _flow(NULL),
-      _max_monitors(count_monitors()) {}
-
-  SharkTargetInvariants(const SharkTargetInvariants* parent)
-    : SharkCompileInvariants(parent),
-      _target(parent->_target),
-      _flow(parent->_flow),
-      _max_monitors(parent->_max_monitors) {}
-
- private:
-  int count_monitors();
-
- private:
-  ciMethod*   _target;
-  ciTypeFlow* _flow;
-  int         _max_monitors;
-
-  // The method being compiled.
- protected:
-  ciMethod* target() const {
-    return _target;
-  }
-
-  // Typeflow analysis of the method being compiled.
- protected:
-  ciTypeFlow* flow() const {
-    assert(_flow != NULL, "typeflow not available");
-    return _flow;
-  }
-
-  // Properties of the method.
- protected:
-  int max_locals() const {
-    return target()->max_locals();
-  }
-  int max_stack() const {
-    return target()->max_stack();
-  }
-  int max_monitors() const {
-    return _max_monitors;
-  }
-  int arg_size() const {
-    return target()->arg_size();
-  }
-  bool is_static() const {
-    return target()->is_static();
-  }
-  bool is_synchronized() const {
-    return target()->is_synchronized();
-  }
-};
--- a/ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkMemoryManager.cpp.incl"
-
-using namespace llvm;
-
-void SharkMemoryManager::AllocateGOT() {
-  mm()->AllocateGOT();
-}
-
-unsigned char* SharkMemoryManager::getGOTBase() const {
-  return mm()->getGOTBase();
-}
-
-unsigned char* SharkMemoryManager::allocateStub(const GlobalValue* F,
-                                                unsigned StubSize,
-                                                unsigned Alignment) {
-  return mm()->allocateStub(F, StubSize, Alignment);
-}
-
-unsigned char* SharkMemoryManager::startFunctionBody(const Function* F,
-                                                     uintptr_t& ActualSize) {
-  return mm()->startFunctionBody(F, ActualSize);
-}
-
-void SharkMemoryManager::endFunctionBody(const Function* F,
-                                         unsigned char* FunctionStart,
-                                         unsigned char* FunctionEnd) {
-  mm()->endFunctionBody(F, FunctionStart, FunctionEnd);
-
-  SharkEntry *entry = get_entry_for_function(F);
-  if (entry != NULL)
-    entry->set_code_limit(FunctionEnd);
-}
-
-unsigned char* SharkMemoryManager::startExceptionTable(const Function* F,
-                                                       uintptr_t& ActualSize) {
-  return mm()->startExceptionTable(F, ActualSize);
-}
-
-void SharkMemoryManager::endExceptionTable(const Function* F,
-                                           unsigned char* TableStart,
-                                           unsigned char* TableEnd,
-                                           unsigned char* FrameRegister) {
-  mm()->endExceptionTable(F, TableStart, TableEnd, FrameRegister);
-}
-
-void SharkMemoryManager::setMemoryWritable() {
-  mm()->setMemoryWritable();
-}
-
-void SharkMemoryManager::setMemoryExecutable() {
-  mm()->setMemoryExecutable();
-}
-
-#if SHARK_LLVM_VERSION >= 27
-void SharkMemoryManager::deallocateExceptionTable(void *ptr) {
-  mm()->deallocateExceptionTable(ptr);
-}
-
-void SharkMemoryManager::deallocateFunctionBody(void *ptr) {
-  mm()->deallocateFunctionBody(ptr);
-}
-#else
-void SharkMemoryManager::deallocateMemForFunction(const Function* F) {
-  return mm()->deallocateMemForFunction(F);
-}
-#endif
-
-uint8_t* SharkMemoryManager::allocateGlobal(uintptr_t Size,
-                                            unsigned int Alignment) {
-  return mm()->allocateGlobal(Size, Alignment);
-}
-
-#if SHARK_LLVM_VERSION < 27
-void* SharkMemoryManager::getDlsymTable() const {
-  return mm()->getDlsymTable();
-}
-
-void SharkMemoryManager::SetDlsymTable(void *ptr) {
-  mm()->SetDlsymTable(ptr);
-}
-#endif
-
-void SharkMemoryManager::setPoisonMemory(bool poison) {
-  mm()->setPoisonMemory(poison);
-}
-
-unsigned char *SharkMemoryManager::allocateSpace(intptr_t Size,
-                                                 unsigned int Alignment) {
-  return mm()->allocateSpace(Size, Alignment);
-}
--- a/ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-// SharkMemoryManager wraps the LLVM JIT Memory Manager.  We could use
-// this to run our own memory allocation policies, but for now all we
-// use it for is figuring out where the resulting native code ended up.
-
-class SharkMemoryManager : public llvm::JITMemoryManager {
- public:
-  SharkMemoryManager()
-    : _mm(llvm::JITMemoryManager::CreateDefaultMemManager()) {}
-
- private:
-  llvm::JITMemoryManager* _mm;
-
- private:
-  llvm::JITMemoryManager* mm() const {
-    return _mm;
-  }
-
- private:
-  std::map<const llvm::Function*, SharkEntry*> _entry_map;
-
- public:
-  void set_entry_for_function(const llvm::Function* function,
-                              SharkEntry*           entry) {
-    _entry_map[function] = entry;
-  }
-  SharkEntry* get_entry_for_function(const llvm::Function* function) {
-    return _entry_map[function];
-  }
-
- public:
-  void AllocateGOT();
-  unsigned char* getGOTBase() const;
-  unsigned char* allocateStub(const llvm::GlobalValue* F,
-                              unsigned StubSize,
-                              unsigned Alignment);
-  unsigned char* startFunctionBody(const llvm::Function* F,
-                                   uintptr_t& ActualSize);
-  void endFunctionBody(const llvm::Function* F,
-                       unsigned char* FunctionStart,
-                       unsigned char* FunctionEnd);
-  unsigned char* startExceptionTable(const llvm::Function* F,
-                                     uintptr_t& ActualSize);
-  void endExceptionTable(const llvm::Function* F,
-                         unsigned char* TableStart,
-                         unsigned char* TableEnd,
-                         unsigned char* FrameRegister);
-#if SHARK_LLVM_VERSION < 27
-  void* getDlsymTable() const;
-  void SetDlsymTable(void *ptr);
-#endif
-  void setPoisonMemory(bool);
-  uint8_t* allocateGlobal(uintptr_t, unsigned int);
-  void setMemoryWritable();
-  void setMemoryExecutable();
-#if SHARK_LLVM_VERSION >= 27
-  void deallocateExceptionTable(void *ptr);
-  void deallocateFunctionBody(void *ptr);
-#else
-  void deallocateMemForFunction(const llvm::Function* F);
-#endif
-  unsigned char *allocateSpace(intptr_t Size,
-                               unsigned int Alignment);
-};
--- a/ports/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,352 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkNativeWrapper.cpp.incl"
-
-using namespace llvm;
-
-void SharkNativeWrapper::initialize(const char *name) {
-  // Create the function
-  _function = Function::Create(
-    SharkType::entry_point_type(),
-    GlobalVariable::InternalLinkage,
-    name);
-
-  // Get our arguments
-  Function::arg_iterator ai = function()->arg_begin();
-  Argument *method = ai++;
-  method->setName("method");
-  Argument *base_pc = ai++;
-  base_pc->setName("base_pc");
-  code_buffer()->set_base_pc(base_pc);
-  Argument *thread = ai++;
-  thread->setName("thread");
-  set_thread(thread);
-
-  // Create and push our stack frame
-  builder()->SetInsertPoint(CreateBlock());
-  _stack = SharkStack::CreateBuildAndPushFrame(this, method);
-  NOT_PRODUCT(method = NULL);
-
-  // Create the oopmap.  We use the one oopmap for every call site in
-  // the wrapper, which results in the odd mild inefficiency but is a
-  // damn sight easier to code.
-  OopMap *oopmap = new OopMap(
-    SharkStack::oopmap_slot_munge(stack()->oopmap_frame_size()),
-    SharkStack::oopmap_slot_munge(arg_size()));
-  oopmap->set_oop(SharkStack::slot2reg(stack()->method_slot_offset()));
-
-  // Set up the oop_tmp slot if required:
-  //  - For static methods we use it to handlize the class argument
-  //    for the call, and to protect the same during slow path locks
-  //    (if synchronized).
-  //  - For methods returning oops, we use it to protect the return
-  //    value across safepoints or slow path unlocking.
-  if (is_static() || is_returning_oop()) {
-    _oop_tmp_slot = stack()->slot_addr(
-      stack()->oop_tmp_slot_offset(),
-      SharkType::oop_type(),
-      "oop_tmp_slot");
-
-    oopmap->set_oop(SharkStack::slot2reg(stack()->oop_tmp_slot_offset()));
-  }
-
-  // Set up the monitor slot, for synchronized methods
-  if (is_synchronized()) {
-    Unimplemented();
-    _lock_slot_offset = 23;
-  }
-
-  // Start building the argument list
-  std::vector<const Type*> param_types;
-  std::vector<Value*> param_values;
-  const PointerType *box_type = PointerType::getUnqual(SharkType::oop_type());
-
-  // First argument is the JNIEnv
-  param_types.push_back(SharkType::jniEnv_type());
-  param_values.push_back(
-    builder()->CreateAddressOfStructEntry(
-      thread,
-      JavaThread::jni_environment_offset(),
-      SharkType::jniEnv_type(),
-      "jni_environment"));
-
-  // For static methods, the second argument is the class
-  if (is_static()) {
-    builder()->CreateStore(
-      builder()->CreateInlineOop(
-        JNIHandles::make_local(
-          target()->method_holder()->klass_part()->java_mirror())),
-      oop_tmp_slot());
-
-    param_types.push_back(box_type);
-    param_values.push_back(oop_tmp_slot());
-
-    _receiver_slot_offset = stack()->oop_tmp_slot_offset();
-  }
-  else if (is_returning_oop()) {
-    // The oop_tmp slot is registered in the oopmap,
-    // so we need to clear it.  This is one of the
-    // mild inefficiencies I mentioned earlier.
-    builder()->CreateStore(LLVMValue::null(), oop_tmp_slot());
-  }
-
-  // Parse the arguments
-  for (int i = 0; i < arg_size(); i++) {
-    int slot_offset = stack()->locals_slots_offset() + arg_size() - 1 - i;
-    int adjusted_offset = slot_offset;
-    BasicBlock *null, *not_null, *merge;
-    Value *box;
-    PHINode *phi;
-
-    switch (arg_type(i)) {
-    case T_VOID:
-      break;
-
-    case T_OBJECT:
-    case T_ARRAY:
-      null     = CreateBlock("null");
-      not_null = CreateBlock("not_null");
-      merge    = CreateBlock("merge");
-
-      box = stack()->slot_addr(slot_offset, SharkType::oop_type());
-      builder()->CreateCondBr(
-        builder()->CreateICmp(
-          ICmpInst::ICMP_EQ,
-          builder()->CreateLoad(box),
-          LLVMValue::null()),
-        null, not_null);
-
-      builder()->SetInsertPoint(null);
-      builder()->CreateBr(merge);
-
-      builder()->SetInsertPoint(not_null);
-      builder()->CreateBr(merge);
-
-      builder()->SetInsertPoint(merge);
-      phi = builder()->CreatePHI(box_type, "boxed_object");
-      phi->addIncoming(ConstantPointerNull::get(box_type), null);
-      phi->addIncoming(box, not_null);
-      box = phi;
-
-      param_types.push_back(box_type);
-      param_values.push_back(box);
-
-      oopmap->set_oop(SharkStack::slot2reg(slot_offset));
-
-      if (i == 0 && !is_static())
-        _receiver_slot_offset = slot_offset;
-
-      break;
-
-    case T_LONG:
-    case T_DOUBLE:
-      adjusted_offset--;
-      // fall through
-
-    default:
-      const Type *param_type = SharkType::to_stackType(arg_type(i));
-
-      param_types.push_back(param_type);
-      param_values.push_back(
-        builder()->CreateLoad(stack()->slot_addr(adjusted_offset, param_type)));
-    }
-  }
-
-  // The oopmap is now complete, and everything is written
-  // into the frame except the PC.
-  int pc_offset = code_buffer()->create_unique_offset();
-
-  _oop_maps = new OopMapSet();
-  oop_maps()->add_gc_map(pc_offset, oopmap);
-
-  builder()->CreateStore(
-    builder()->code_buffer_address(pc_offset),
-    stack()->slot_addr(stack()->pc_slot_offset()));
-
-  // Set up the Java frame anchor
-  stack()->CreateSetLastJavaFrame();
-
-  // Lock if necessary
-  if (is_synchronized())
-    Unimplemented();
-
-  // Change the thread state to _thread_in_native
-  CreateSetThreadState(_thread_in_native);
-
-  // Make the call
-  BasicType result_type = target()->result_type();
-  const Type* return_type;
-  if (result_type == T_VOID)
-    return_type = SharkType::void_type();
-  else if (is_returning_oop())
-    return_type = box_type;
-  else
-    return_type = SharkType::to_arrayType(result_type);
-  Value* native_function = builder()->CreateIntToPtr(
-     LLVMValue::intptr_constant((intptr_t) target()->native_function()),
-     PointerType::getUnqual(
-       FunctionType::get(return_type, param_types, false)));
-  Value *result = builder()->CreateCall(
-    native_function, param_values.begin(), param_values.end());
-
-  // Start the transition back to _thread_in_Java
-  CreateSetThreadState(_thread_in_native_trans);
-
-  // Make sure new state is visible in the GC thread
-  if (os::is_MP()) {
-    if (UseMembar)
-      builder()->CreateMemoryBarrier(SharkBuilder::BARRIER_STORELOAD);
-    else
-      CreateWriteMemorySerializePage();
-  }
-
-  // Handle safepoint operations, pending suspend requests,
-  // and pending asynchronous exceptions.
-  BasicBlock *check_thread = CreateBlock("check_thread");
-  BasicBlock *do_safepoint = CreateBlock("do_safepoint");
-  BasicBlock *safepointed  = CreateBlock("safepointed");
-
-  Value *global_state = builder()->CreateLoad(
-    builder()->CreateIntToPtr(
-      LLVMValue::intptr_constant(
-        (intptr_t) SafepointSynchronize::address_of_state()),
-      PointerType::getUnqual(SharkType::jint_type())),
-    "global_state");
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpNE(
-      global_state,
-      LLVMValue::jint_constant(SafepointSynchronize::_not_synchronized)),
-    do_safepoint, check_thread);
-
-  builder()->SetInsertPoint(check_thread);
-  Value *thread_state = builder()->CreateValueOfStructEntry(
-    thread,
-    JavaThread::suspend_flags_offset(),
-    SharkType::jint_type(),
-    "thread_state");
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpNE(
-      thread_state,
-      LLVMValue::jint_constant(0)),
-    do_safepoint, safepointed);
-
-  builder()->SetInsertPoint(do_safepoint);
-  builder()->CreateCall(
-    builder()->check_special_condition_for_native_trans(), thread);
-  builder()->CreateBr(safepointed);
-
-  // Finally we can change the thread state to _thread_in_Java
-  builder()->SetInsertPoint(safepointed);
-  CreateSetThreadState(_thread_in_Java);
-
-  // Clear the frame anchor
-  stack()->CreateResetLastJavaFrame();
-
-  // If there is a pending exception then we can just unwind and
-  // return.  It seems totally wrong that unlocking is skipped here
-  // but apparently the template interpreter does this so we do too.
-  BasicBlock *exception    = CreateBlock("exception");
-  BasicBlock *no_exception = CreateBlock("no_exception");
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(
-      CreateLoadPendingException(),
-      LLVMValue::null()),
-    no_exception, exception);
-
-  builder()->SetInsertPoint(exception);
-  CreateResetHandleBlock();
-  stack()->CreatePopFrame(0);
-  builder()->CreateRet(LLVMValue::jint_constant(0));
-
-  builder()->SetInsertPoint(no_exception);
-
-  // If the result was an oop then unbox it before
-  // releasing the handle it might be protected by
-  if (is_returning_oop()) {
-    BasicBlock *null     = builder()->GetInsertBlock();
-    BasicBlock *not_null = CreateBlock("not_null");
-    BasicBlock *merge    = CreateBlock("merge");
-
-    builder()->CreateCondBr(
-      builder()->CreateICmpNE(result, ConstantPointerNull::get(box_type)),
-      not_null, merge);
-
-    builder()->SetInsertPoint(not_null);
-    Value *unboxed_result = builder()->CreateLoad(result);
-    builder()->CreateBr(merge);
-
-    builder()->SetInsertPoint(merge);
-    PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), "result");
-    phi->addIncoming(LLVMValue::null(), null);
-    phi->addIncoming(unboxed_result, not_null);
-    result = phi;
-  }
-
-  // Reset handle block
-  CreateResetHandleBlock();
-
-  // Unlock if necessary.
-  if (is_synchronized())
-    Unimplemented();
-
-  // Unwind and return
-  Value *result_addr = stack()->CreatePopFrame(type2size[result_type]);
-  if (result_type != T_VOID) {
-    bool needs_cast = false;
-    bool is_signed = false;
-    switch (result_type) {
-    case T_BOOLEAN:
-      result = builder()->CreateICmpNE(result, LLVMValue::jbyte_constant(0));
-      needs_cast = true;
-      break;
-
-    case T_CHAR:
-      needs_cast = true;
-      break;
-
-    case T_BYTE:
-    case T_SHORT:
-      needs_cast = true;
-      is_signed = true;
-      break;
-    }
-    if (needs_cast) {
-      result = builder()->CreateIntCast(
-        result, SharkType::to_stackType(result_type), is_signed);
-    }
-
-    builder()->CreateStore(
-      result,
-      builder()->CreateIntToPtr(
-        result_addr,
-        PointerType::getUnqual(SharkType::to_stackType(result_type))));
-  }
-  builder()->CreateRet(LLVMValue::jint_constant(0));
-}
--- a/ports/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkNativeWrapper : public SharkCompileInvariants {
-  friend class SharkStackWithNativeFrame;
-
- public:
-  static SharkNativeWrapper* build(SharkBuilder* builder,
-                                   methodHandle  target,
-                                   const char*   name,
-                                   BasicType*    arg_types,
-                                   BasicType     return_type) {
-    return new SharkNativeWrapper(builder,
-                                  target,
-                                  name,
-                                  arg_types,
-                                  return_type);
-  }
-
- private:
-  SharkNativeWrapper(SharkBuilder* builder,
-                     methodHandle  target,
-                     const char*   name,
-                     BasicType*    arg_types,
-                     BasicType     return_type)
-    : SharkCompileInvariants(NULL, builder),
-      _target(target),
-      _arg_types(arg_types),
-      _return_type(return_type),
-      _lock_slot_offset(0) { initialize(name); }
-
- private:
-  void initialize(const char* name);
-
- private:
-  methodHandle    _target;
-  BasicType*      _arg_types;
-  BasicType       _return_type;
-  llvm::Function* _function;
-  SharkStack*     _stack;
-  llvm::Value*    _oop_tmp_slot;
-  OopMapSet*      _oop_maps;
-  int             _receiver_slot_offset;
-  int             _lock_slot_offset;
-
-  // The method being compiled.
- protected:
-  methodHandle target() const {
-    return _target;
-  }
-
-  // Properties of the method.
- protected:
-  int arg_size() const {
-    return target()->size_of_parameters();
-  }
-  BasicType arg_type(int i) const {
-    return _arg_types[i];
-  }
-  BasicType return_type() const {
-    return _return_type;
-  }
-  bool is_static() const {
-    return target()->is_static();
-  }
-  bool is_synchronized() const {
-    return target()->is_synchronized();
-  }
-  bool is_returning_oop() const {
-    return target()->is_returning_oop();
-  }
-
-  // The LLVM function we are building.
- public:
-  llvm::Function* function() const {
-    return _function;
-  }
-
-  // The Zero stack and our frame on it.
- protected:
-  SharkStack* stack() const {
-    return _stack;
-  }
-
-  // Temporary oop storage.
- protected:
-  llvm::Value* oop_tmp_slot() const {
-    assert(is_static() || is_returning_oop(), "should be");
-    return _oop_tmp_slot;
-  }
-
-  // Information required by nmethod::new_native_nmethod().
- public:
-  int frame_size() const {
-    return stack()->oopmap_frame_size();
-  }
-  ByteSize receiver_offset() const {
-    return in_ByteSize(_receiver_slot_offset * wordSize);
-  }
-  ByteSize lock_offset() const {
-    return in_ByteSize(_lock_slot_offset * wordSize);
-  }
-  OopMapSet* oop_maps() const {
-    return _oop_maps;
-  }
-
-  // Helpers.
- private:
-  llvm::BasicBlock* CreateBlock(const char* name = "") const {
-    return llvm::BasicBlock::Create(SharkContext::current(), name, function());
-  }
-  llvm::Value* thread_state_address() const {
-    return builder()->CreateAddressOfStructEntry(
-      thread(), JavaThread::thread_state_offset(),
-      llvm::PointerType::getUnqual(SharkType::jint_type()),
-      "thread_state_address");
-  }
-  llvm::Value* pending_exception_address() const {
-    return builder()->CreateAddressOfStructEntry(
-      thread(), Thread::pending_exception_offset(),
-      llvm::PointerType::getUnqual(SharkType::oop_type()),
-      "pending_exception_address");
-  }
-  void CreateSetThreadState(JavaThreadState state) const {
-    builder()->CreateStore(
-      LLVMValue::jint_constant(state), thread_state_address());
-  }
-  void CreateWriteMemorySerializePage() const {
-    builder()->CreateStore(
-      LLVMValue::jint_constant(1),
-      builder()->CreateIntToPtr(
-        builder()->CreateAdd(
-          LLVMValue::intptr_constant(
-            (intptr_t) os::get_memory_serialize_page()),
-          builder()->CreateAnd(
-            builder()->CreateLShr(
-              builder()->CreatePtrToInt(thread(), SharkType::intptr_type()),
-              LLVMValue::intptr_constant(os::get_serialize_page_shift_count())),
-            LLVMValue::intptr_constant(os::get_serialize_page_mask()))),
-        llvm::PointerType::getUnqual(SharkType::jint_type())));
-  }
-  void CreateResetHandleBlock() const {
-    llvm::Value *active_handles = builder()->CreateValueOfStructEntry(
-      thread(),
-      JavaThread::active_handles_offset(),
-      SharkType::jniHandleBlock_type(),
-      "active_handles");
-    builder()->CreateStore(
-      LLVMValue::intptr_constant(0),
-      builder()->CreateAddressOfStructEntry(
-        active_handles,
-        in_ByteSize(JNIHandleBlock::top_offset_in_bytes()),
-        llvm::PointerType::getUnqual(SharkType::intptr_type()),
-        "top"));
-  }
-  llvm::LoadInst* CreateLoadPendingException() const {
-    return builder()->CreateLoad(
-      pending_exception_address(), "pending_exception");
-  }
-};
--- a/ports/hotspot/src/share/vm/shark/sharkRuntime.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkRuntime.cpp.incl"
-
-using namespace llvm;
-
-JRT_ENTRY(int, SharkRuntime::find_exception_handler(JavaThread* thread,
-                                                    int*        indexes,
-                                                    int         num_indexes))
-  constantPoolHandle pool(thread, method(thread)->constants());
-  KlassHandle exc_klass(thread, ((oop) tos_at(thread, 0))->klass());
-
-  for (int i = 0; i < num_indexes; i++) {
-    klassOop tmp = pool->klass_at(indexes[i], CHECK_0);
-    KlassHandle chk_klass(thread, tmp);
-
-    if (exc_klass() == chk_klass())
-      return i;
-
-    if (exc_klass()->klass_part()->is_subtype_of(chk_klass()))
-      return i;
-  }
-
-  return -1;
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::monitorenter(JavaThread*      thread,
-                                           BasicObjectLock* lock))
-  if (PrintBiasedLockingStatistics)
-    Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
-
-  Handle object(thread, lock->obj());
-  assert(Universe::heap()->is_in_reserved_or_null(object()), "should be");
-  if (UseBiasedLocking) {
-    // Retry fast entry if bias is revoked to avoid unnecessary inflation
-    ObjectSynchronizer::fast_enter(object, lock->lock(), true, CHECK);
-  } else {
-    ObjectSynchronizer::slow_enter(object, lock->lock(), CHECK);
-  }
-  assert(Universe::heap()->is_in_reserved_or_null(lock->obj()), "should be");
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::monitorexit(JavaThread*      thread,
-                                          BasicObjectLock* lock))
-  Handle object(thread, lock->obj());
-  assert(Universe::heap()->is_in_reserved_or_null(object()), "should be");
-  if (lock == NULL || object()->is_unlocked()) {
-    THROW(vmSymbols::java_lang_IllegalMonitorStateException());
-  }
-  ObjectSynchronizer::slow_exit(object(), lock->lock(), thread);
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::new_instance(JavaThread* thread, int index))
-  klassOop k_oop = method(thread)->constants()->klass_at(index, CHECK);
-  instanceKlassHandle klass(THREAD, k_oop);
-
-  // Make sure we are not instantiating an abstract klass
-  klass->check_valid_for_instantiation(true, CHECK);
-
-  // Make sure klass is initialized
-  klass->initialize(CHECK);
-
-  // At this point the class may not be fully initialized
-  // because of recursive initialization. If it is fully
-  // initialized & has_finalized is not set, we rewrite
-  // it into its fast version (Note: no locking is needed
-  // here since this is an atomic byte write and can be
-  // done more than once).
-  //
-  // Note: In case of classes with has_finalized we don't
-  //       rewrite since that saves us an extra check in
-  //       the fast version which then would call the
-  //       slow version anyway (and do a call back into
-  //       Java).
-  //       If we have a breakpoint, then we don't rewrite
-  //       because the _breakpoint bytecode would be lost.
-  oop obj = klass->allocate_instance(CHECK);
-  thread->set_vm_result(obj);
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::newarray(JavaThread* thread,
-                                       BasicType   type,
-                                       int         size))
-  oop obj = oopFactory::new_typeArray(type, size, CHECK);
-  thread->set_vm_result(obj);
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::anewarray(JavaThread* thread,
-                                        int         index,
-                                        int         size))
-  klassOop klass = method(thread)->constants()->klass_at(index, CHECK);
-  objArrayOop obj = oopFactory::new_objArray(klass, size, CHECK);
-  thread->set_vm_result(obj);
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::multianewarray(JavaThread* thread,
-                                             int         index,
-                                             int         ndims,
-                                             int*        dims))
-  klassOop klass = method(thread)->constants()->klass_at(index, CHECK);
-  oop obj = arrayKlass::cast(klass)->multi_allocate(ndims, dims, CHECK);
-  thread->set_vm_result(obj);
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::register_finalizer(JavaThread* thread,
-                                                 oop         object))
-  assert(object->is_oop(), "should be");
-  assert(object->klass()->klass_part()->has_finalizer(), "should have");
-  instanceKlass::register_finalizer(instanceOop(object), CHECK);
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::throw_ArithmeticException(JavaThread* thread,
-                                                        const char* file,
-                                                        int         line))
-  Exceptions::_throw_msg(
-    thread, file, line,
-    vmSymbols::java_lang_ArithmeticException(),
-    "");
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::throw_ArrayIndexOutOfBoundsException(
-                                                     JavaThread* thread,
-                                                     const char* file,
-                                                     int         line,
-                                                     int         index))
-  char msg[jintAsStringSize];
-  snprintf(msg, sizeof(msg), "%d", index);
-  Exceptions::_throw_msg(
-    thread, file, line,
-    vmSymbols::java_lang_ArrayIndexOutOfBoundsException(),
-    msg);
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::throw_ClassCastException(JavaThread* thread,
-                                                       const char* file,
-                                                       int         line))
-  Exceptions::_throw_msg(
-    thread, file, line,
-    vmSymbols::java_lang_ClassCastException(),
-    "");
-JRT_END
-
-JRT_ENTRY(void, SharkRuntime::throw_NullPointerException(JavaThread* thread,
-                                                         const char* file,
-                                                         int         line))
-  Exceptions::_throw_msg(
-    thread, file, line,
-    vmSymbols::java_lang_NullPointerException(),
-    "");
-JRT_END
-
-// Non-VM calls
-// Nothing in these must ever GC!
-
-void SharkRuntime::dump(const char *name, intptr_t value) {
-  oop valueOop = (oop) value;
-  tty->print("%s = ", name);
-  if (valueOop->is_oop(true))
-    valueOop->print_on(tty);
-  else if (value >= ' ' && value <= '~')
-    tty->print("'%c' (%d)", value, value);
-  else
-    tty->print("%p", value);
-  tty->print_cr("");
-}
-
-bool SharkRuntime::is_subtype_of(klassOop check_klass, klassOop object_klass) {
-  return object_klass->klass_part()->is_subtype_of(check_klass);
-}
-
-int SharkRuntime::uncommon_trap(JavaThread* thread, int trap_request) {
-  Thread *THREAD = thread;
-
-  // In C2, uncommon_trap_blob creates a frame, so all the various
-  // deoptimization functions expect to find the frame of the method
-  // being deopted one frame down on the stack.  We create a dummy
-  // frame to mirror this.
-  FakeStubFrame *stubframe = FakeStubFrame::build(CHECK_0);
-  thread->push_zero_frame(stubframe);
-
-  // Initiate the trap
-  thread->set_last_Java_frame();
-  Deoptimization::UnrollBlock *urb =
-    Deoptimization::uncommon_trap(thread, trap_request);
-  thread->reset_last_Java_frame();
-
-  // Pop our dummy frame and the frame being deoptimized
-  thread->pop_zero_frame();
-  thread->pop_zero_frame();
-
-  // Push skeleton frames
-  int number_of_frames = urb->number_of_frames();
-  for (int i = 0; i < number_of_frames; i++) {
-    intptr_t size = urb->frame_sizes()[i];
-    InterpreterFrame *frame = InterpreterFrame::build(size, CHECK_0);
-    thread->push_zero_frame(frame);
-  }
-
-  // Push another dummy frame
-  stubframe = FakeStubFrame::build(CHECK_0);
-  thread->push_zero_frame(stubframe);
-
-  // Fill in the skeleton frames
-  thread->set_last_Java_frame();
-  Deoptimization::unpack_frames(thread, Deoptimization::Unpack_uncommon_trap);
-  thread->reset_last_Java_frame();
-
-  // Pop our dummy frame
-  thread->pop_zero_frame();
-
-  // Fall back into the interpreter
-  return number_of_frames;
-}
-
-FakeStubFrame* FakeStubFrame::build(TRAPS) {
-  ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack();
-  stack->overflow_check(header_words, CHECK_NULL);
-
-  stack->push(0); // next_frame, filled in later
-  intptr_t *fp = stack->sp();
-  assert(fp - stack->sp() == next_frame_off, "should be");
-
-  stack->push(FAKE_STUB_FRAME);
-  assert(fp - stack->sp() == frame_type_off, "should be");
-
-  return (FakeStubFrame *) fp;
-}
--- a/ports/hotspot/src/share/vm/shark/sharkRuntime.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkRuntime : public AllStatic {
-  // VM calls
- public:
-  static int find_exception_handler(JavaThread* thread,
-                                    int*        indexes,
-                                    int         num_indexes);
-
-  static void monitorenter(JavaThread* thread, BasicObjectLock* lock);
-  static void monitorexit(JavaThread* thread, BasicObjectLock* lock);
-
-  static void new_instance(JavaThread* thread, int index);
-  static void newarray(JavaThread* thread, BasicType type, int size);
-  static void anewarray(JavaThread* thread, int index, int size);
-  static void multianewarray(JavaThread* thread,
-                             int         index,
-                             int         ndims,
-                             int*        dims);
-
-  static void register_finalizer(JavaThread* thread, oop object);
-
-  static void throw_ArithmeticException(JavaThread* thread,
-                                        const char* file,
-                                        int         line);
-  static void throw_ArrayIndexOutOfBoundsException(JavaThread* thread,
-                                                   const char* file,
-                                                   int         line,
-                                                   int         index);
-  static void throw_ClassCastException(JavaThread* thread,
-                                       const char* file,
-                                       int         line);
-  static void throw_NullPointerException(JavaThread* thread,
-                                         const char* file,
-                                         int         line);
-
-  // Helpers for VM calls
- private:
-  static const SharkFrame* last_frame(JavaThread *thread) {
-    return thread->last_frame().zero_sharkframe();
-  }
-  static methodOop method(JavaThread *thread) {
-    return last_frame(thread)->method();
-  }
-  static address bcp(JavaThread *thread, int bci) {
-    return method(thread)->code_base() + bci;
-  }
-  static int two_byte_index(JavaThread *thread, int bci) {
-    return Bytes::get_Java_u2(bcp(thread, bci) + 1);
-  }
-  static intptr_t tos_at(JavaThread *thread, int offset) {
-    return *(thread->zero_stack()->sp() + offset);
-  }
-
-  // Non-VM calls
- public:
-  static void dump(const char *name, intptr_t value);
-  static bool is_subtype_of(klassOop check_klass, klassOop object_klass);
-  static int uncommon_trap(JavaThread* thread, int trap_request);
-};
--- a/ports/hotspot/src/share/vm/shark/sharkStack.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkStack.cpp.incl"
-
-using namespace llvm;
-
-void SharkStack::initialize(Value* method) {
-  bool setup_sp_and_method = (method != NULL);
-
-  int locals_words  = max_locals();
-  int extra_locals  = locals_words - arg_size();
-  int header_words  = SharkFrame::header_words;
-  int monitor_words = max_monitors()*frame::interpreter_frame_monitor_size();
-  int stack_words   = max_stack();
-  int frame_words   = header_words + monitor_words + stack_words;
-
-  _extended_frame_size = frame_words + locals_words;
-
-  // Update the stack pointer
-  Value *stack_pointer = builder()->CreateSub(
-    CreateLoadStackPointer(),
-    LLVMValue::intptr_constant((frame_words + extra_locals) * wordSize));
-  CreateStackOverflowCheck(stack_pointer);
-  if (setup_sp_and_method)
-    CreateStoreStackPointer(stack_pointer);
-
-  // Create the frame
-  _frame = builder()->CreateIntToPtr(
-    stack_pointer,
-    PointerType::getUnqual(
-      ArrayType::get(SharkType::intptr_type(), extended_frame_size())),
-    "frame");
-  int offset = 0;
-
-  // Expression stack
-  _stack_slots_offset = offset;
-  offset += stack_words;
-
-  // Monitors
-  _monitors_slots_offset = offset;
-  offset += monitor_words;
-
-  // Temporary oop slot
-  _oop_tmp_slot_offset = offset++;
-
-  // Method pointer
-  _method_slot_offset = offset++;
-  if (setup_sp_and_method) {
-    builder()->CreateStore(
-      method, slot_addr(method_slot_offset(), SharkType::methodOop_type()));
-  }
-
-  // Unextended SP
-  builder()->CreateStore(stack_pointer, slot_addr(offset++));
-
-  // PC
-  _pc_slot_offset = offset++;
-
-  // Frame header
-  builder()->CreateStore(
-    LLVMValue::intptr_constant(ZeroFrame::SHARK_FRAME), slot_addr(offset++));
-  Value *fp = slot_addr(offset++);
-
-  // Local variables
-  _locals_slots_offset = offset;
-  offset += locals_words;
-
-  // Push the frame
-  assert(offset == extended_frame_size(), "should do");
-  builder()->CreateStore(CreateLoadFramePointer(), fp);
-  CreateStoreFramePointer(
-    builder()->CreatePtrToInt(fp, SharkType::intptr_type()));
-}
-
-// This function should match ZeroStack::overflow_check
-void SharkStack::CreateStackOverflowCheck(Value* sp) {
-  BasicBlock *zero_ok  = CreateBlock("zero_stack_ok");
-  BasicBlock *overflow = CreateBlock("stack_overflow");
-  BasicBlock *abi_ok   = CreateBlock("abi_stack_ok");
-
-  // Check the Zero stack
-  builder()->CreateCondBr(
-    builder()->CreateICmpULT(sp, stack_base()),
-    overflow, zero_ok);
-
-  // Check the ABI stack
-  builder()->SetInsertPoint(zero_ok);
-  Value *stack_top = builder()->CreateSub(
-    builder()->CreateValueOfStructEntry(
-      thread(),
-      Thread::stack_base_offset(),
-      SharkType::intptr_type(),
-      "abi_base"),
-    builder()->CreateValueOfStructEntry(
-      thread(),
-      Thread::stack_size_offset(),
-      SharkType::intptr_type(),
-      "abi_size"));
-  Value *free_stack = builder()->CreateSub(
-    builder()->CreatePtrToInt(
-      builder()->CreateGetFrameAddress(),
-      SharkType::intptr_type(),
-      "abi_sp"),
-    stack_top);
-  builder()->CreateCondBr(
-    builder()->CreateICmpULT(
-      free_stack,
-      LLVMValue::intptr_constant(StackShadowPages * os::vm_page_size())),
-    overflow, abi_ok);
-
-  // Handle overflows
-  builder()->SetInsertPoint(overflow);
-  builder()->CreateCall(builder()->throw_StackOverflowError(), thread());
-  builder()->CreateRet(LLVMValue::jint_constant(0));
-
-  builder()->SetInsertPoint(abi_ok);
-}
-
-Value* SharkStack::CreatePopFrame(int result_slots) {
-  assert(result_slots >= 0 && result_slots <= 2, "should be");
-  int locals_to_pop = max_locals() - result_slots;
-
-  Value *fp = CreateLoadFramePointer();
-  Value *sp = builder()->CreateAdd(
-    fp,
-    LLVMValue::intptr_constant((1 + locals_to_pop) * wordSize));
-
-  CreateStoreStackPointer(sp);
-  CreateStoreFramePointer(
-    builder()->CreateLoad(
-      builder()->CreateIntToPtr(
-        fp, PointerType::getUnqual(SharkType::intptr_type()))));
-
-  return sp;
-}
-
-Value* SharkStack::slot_addr(int         offset,
-                             const Type* type,
-                             const char* name) const {
-  bool needs_cast = type && type != SharkType::intptr_type();
-
-  Value* result = builder()->CreateStructGEP(
-    _frame, offset, needs_cast ? "" : name);
-
-  if (needs_cast) {
-    result = builder()->CreateBitCast(
-      result, PointerType::getUnqual(type), name);
-  }
-  return result;
-}
-
-// The bits that differentiate stacks with normal and native frames on top
-
-SharkStack* SharkStack::CreateBuildAndPushFrame(SharkFunction* function,
-                                                Value*         method) {
-  return new SharkStackWithNormalFrame(function, method);
-}
-SharkStack* SharkStack::CreateBuildAndPushFrame(SharkNativeWrapper* wrapper,
-                                                Value*              method) {
-  return new SharkStackWithNativeFrame(wrapper, method);
-}
-
-SharkStackWithNormalFrame::SharkStackWithNormalFrame(SharkFunction* function,
-                                                     Value*         method)
-  : SharkStack(function), _function(function) {
-  // For normal frames, the stack pointer and the method slot will
-  // be set during each decache, so it is not necessary to do them
-  // at the time the frame is created.  However, we set them for
-  // non-PRODUCT builds to make crash dumps easier to understand.
-  initialize(PRODUCT_ONLY(NULL) NOT_PRODUCT(method));
-}
-SharkStackWithNativeFrame::SharkStackWithNativeFrame(SharkNativeWrapper* wrp,
-                                                     Value*              method)
-  : SharkStack(wrp), _wrapper(wrp) {
-  initialize(method);
-}
-
-int SharkStackWithNormalFrame::arg_size() const {
-  return function()->arg_size();
-}
-int SharkStackWithNativeFrame::arg_size() const {
-  return wrapper()->arg_size();
-}
-
-int SharkStackWithNormalFrame::max_locals() const {
-  return function()->max_locals();
-}
-int SharkStackWithNativeFrame::max_locals() const {
-  return wrapper()->arg_size();
-}
-
-int SharkStackWithNormalFrame::max_stack() const {
-  return function()->max_stack();
-}
-int SharkStackWithNativeFrame::max_stack() const {
-  return 0;
-}
-
-int SharkStackWithNormalFrame::max_monitors() const {
-  return function()->max_monitors();
-}
-int SharkStackWithNativeFrame::max_monitors() const {
-  return wrapper()->is_synchronized() ? 1 : 0;
-}
-
-BasicBlock* SharkStackWithNormalFrame::CreateBlock(const char* name) const {
-  return function()->CreateBlock(name);
-}
-BasicBlock* SharkStackWithNativeFrame::CreateBlock(const char* name) const {
-  return wrapper()->CreateBlock(name);
-}
-
-address SharkStackWithNormalFrame::interpreter_entry_point() const {
-  return (address) CppInterpreter::normal_entry;
-}
-address SharkStackWithNativeFrame::interpreter_entry_point() const {
-  return (address) CppInterpreter::native_entry;
-}
-
-#ifndef PRODUCT
-void SharkStack::CreateAssertLastJavaSPIsNull() const {
-#ifdef ASSERT
-  BasicBlock *fail = CreateBlock("assert_failed");
-  BasicBlock *pass = CreateBlock("assert_ok");
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(
-      builder()->CreateLoad(last_Java_sp_addr()),
-      LLVMValue::intptr_constant(0)),
-    pass, fail);
-
-  builder()->SetInsertPoint(fail);
-  builder()->CreateShouldNotReachHere(__FILE__, __LINE__);
-  builder()->CreateUnreachable();
-
-  builder()->SetInsertPoint(pass);
-#endif // ASSERT
-}
-#endif // !PRODUCT
--- a/ports/hotspot/src/share/vm/shark/sharkStack.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,290 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkFunction;
-class SharkNativeWrapper;
-class SharkStackWithNormalFrame;
-class SharkStackWithNativeFrame;
-
-class SharkStack : public SharkCompileInvariants {
- public:
-  static SharkStack* CreateBuildAndPushFrame(
-    SharkFunction* function, llvm::Value* method);
-  static SharkStack* CreateBuildAndPushFrame(
-    SharkNativeWrapper* wrapper, llvm::Value* method);
-
- protected:
-  SharkStack(const SharkCompileInvariants* parent)
-    : SharkCompileInvariants(parent) {}
-
- protected:
-  void initialize(llvm::Value* method);
-
- protected:
-  void CreateStackOverflowCheck(llvm::Value* sp);
-
-  // Properties of the method being compiled
- protected:
-  virtual int arg_size() const = 0;
-  virtual int max_locals() const = 0;
-  virtual int max_stack() const = 0;
-  virtual int max_monitors() const = 0;
-
-  // BasicBlock creation
- protected:
-  virtual llvm::BasicBlock* CreateBlock(const char* name = "") const = 0;
-
-  // Interpreter entry point for bailouts
- protected:
-  virtual address interpreter_entry_point() const = 0;
-
-  // Interface with the Zero stack
- private:
-  llvm::Value* zero_stack() const {
-    return builder()->CreateAddressOfStructEntry(
-      thread(),
-      JavaThread::zero_stack_offset(),
-      SharkType::zeroStack_type(),
-      "zero_stack");
-  }
-  llvm::Value* stack_base() const {
-    return builder()->CreateValueOfStructEntry(
-      zero_stack(),
-      ZeroStack::base_offset(),
-      SharkType::intptr_type(),
-      "stack_base");
-  }
-  llvm::Value* stack_pointer_addr() const {
-    return builder()->CreateAddressOfStructEntry(
-      zero_stack(),
-      ZeroStack::sp_offset(),
-      llvm::PointerType::getUnqual(SharkType::intptr_type()),
-      "stack_pointer_addr");
-  }
-  llvm::Value* frame_pointer_addr() const {
-    return builder()->CreateAddressOfStructEntry(
-      thread(),
-      JavaThread::top_zero_frame_offset(),
-      llvm::PointerType::getUnqual(SharkType::intptr_type()),
-      "frame_pointer_addr");
-  }
-
- public:
-  llvm::LoadInst* CreateLoadStackPointer(const char *name = "") {
-    return builder()->CreateLoad(stack_pointer_addr(), name);
-  }
-  llvm::StoreInst* CreateStoreStackPointer(llvm::Value* value) {
-    return builder()->CreateStore(value, stack_pointer_addr());
-  }
-  llvm::LoadInst* CreateLoadFramePointer(const char *name = "") {
-    return builder()->CreateLoad(frame_pointer_addr(), name);
-  }
-  llvm::StoreInst* CreateStoreFramePointer(llvm::Value* value) {
-    return builder()->CreateStore(value, frame_pointer_addr());
-  }
-  llvm::Value* CreatePopFrame(int result_slots);
-
-  // Interface with the frame anchor
- private:
-  llvm::Value* last_Java_sp_addr() const {
-    return builder()->CreateAddressOfStructEntry(
-      thread(),
-      JavaThread::last_Java_sp_offset(),
-      llvm::PointerType::getUnqual(SharkType::intptr_type()),
-      "last_Java_sp_addr");
-  }
-  llvm::Value* last_Java_fp_addr() const {
-    return builder()->CreateAddressOfStructEntry(
-      thread(),
-      JavaThread::last_Java_fp_offset(),
-      llvm::PointerType::getUnqual(SharkType::intptr_type()),
-      "last_Java_fp_addr");
-  }
-
- public:
-  void CreateSetLastJavaFrame() {
-    // Note that whenever _last_Java_sp != NULL other anchor fields
-    // must be valid.  The profiler apparently depends on this.
-    NOT_PRODUCT(CreateAssertLastJavaSPIsNull());
-    builder()->CreateStore(CreateLoadFramePointer(), last_Java_fp_addr());
-    // XXX There's last_Java_pc as well, but I don't think anything uses it
-    // Also XXX: should we fence here?  Zero doesn't...
-    builder()->CreateStore(CreateLoadStackPointer(), last_Java_sp_addr());
-    // Also also XXX: we could probably cache the sp (and the fp we know??)
-  }
-  void CreateResetLastJavaFrame() {
-    builder()->CreateStore(LLVMValue::intptr_constant(0), last_Java_sp_addr());
-  }
-
- private:
-  void CreateAssertLastJavaSPIsNull() const PRODUCT_RETURN;
-
-  // Our method's frame
- private:
-  llvm::Value* _frame;
-  int          _extended_frame_size;
-  int          _stack_slots_offset;
-
- public:
-  int extended_frame_size() const {
-    return _extended_frame_size;
-  }
-  int oopmap_frame_size() const {
-    return extended_frame_size() - arg_size();
-  }
-
-  // Offsets of things in the frame
- private:
-  int _monitors_slots_offset;
-  int _oop_tmp_slot_offset;
-  int _method_slot_offset;
-  int _pc_slot_offset;
-  int _locals_slots_offset;
-
- public:
-  int stack_slots_offset() const {
-    return _stack_slots_offset;
-  }
-  int oop_tmp_slot_offset() const {
-    return _oop_tmp_slot_offset;
-  }
-  int method_slot_offset() const {
-    return _method_slot_offset;
-  }
-  int pc_slot_offset() const {
-    return _pc_slot_offset;
-  }
-  int locals_slots_offset() const {
-    return _locals_slots_offset;
-  }
-  int monitor_offset(int index) const {
-    assert(index >= 0 && index < max_monitors(), "invalid monitor index");
-    return _monitors_slots_offset +
-      (max_monitors() - 1 - index) * frame::interpreter_frame_monitor_size();
-  }
-  int monitor_object_offset(int index) const {
-    return monitor_offset(index) +
-      (BasicObjectLock::obj_offset_in_bytes() >> LogBytesPerWord);
-  }
-  int monitor_header_offset(int index) const {
-    return monitor_offset(index) +
-      ((BasicObjectLock::lock_offset_in_bytes() +
-        BasicLock::displaced_header_offset_in_bytes()) >> LogBytesPerWord);
-  }
-
-  // Addresses of things in the frame
- public:
-  llvm::Value* slot_addr(int               offset,
-                         const llvm::Type* type = NULL,
-                         const char*       name = "") const;
-
-  llvm::Value* monitor_addr(int index) const {
-    return slot_addr(
-      monitor_offset(index),
-      SharkType::monitor_type(),
-      "monitor");
-  }
-  llvm::Value* monitor_object_addr(int index) const {
-    return slot_addr(
-      monitor_object_offset(index),
-      SharkType::oop_type(),
-      "object_addr");
-  }
-  llvm::Value* monitor_header_addr(int index) const {
-    return slot_addr(
-      monitor_header_offset(index),
-      SharkType::intptr_type(),
-      "displaced_header_addr");
-  }
-
-  // oopmap helpers
- public:
-  static int oopmap_slot_munge(int offset) {
-    return offset << (LogBytesPerWord - LogBytesPerInt);
-  }
-  static VMReg slot2reg(int offset) {
-    return VMRegImpl::stack2reg(oopmap_slot_munge(offset));
-  }
-};
-
-class SharkStackWithNormalFrame : public SharkStack {
-  friend class SharkStack;
-
- protected:
-  SharkStackWithNormalFrame(SharkFunction* function, llvm::Value* method);
-
- private:
-  SharkFunction* _function;
-
- private:
-  SharkFunction* function() const {
-    return _function;
-  }
-
-  // Properties of the method being compiled
- private:
-  int arg_size() const;
-  int max_locals() const;
-  int max_stack() const;
-  int max_monitors() const;
-
-  // BasicBlock creation
- private:
-  llvm::BasicBlock* CreateBlock(const char* name = "") const;
-
-  // Interpreter entry point for bailouts
- private:
-  address interpreter_entry_point() const;
-};
-
-class SharkStackWithNativeFrame : public SharkStack {
-  friend class SharkStack;
-
- protected:
-  SharkStackWithNativeFrame(SharkNativeWrapper* wrapper, llvm::Value* method);
-
- private:
-  SharkNativeWrapper* _wrapper;
-
- private:
-  SharkNativeWrapper* wrapper() const {
-    return _wrapper;
-  }
-
-  // Properties of the method being compiled
- private:
-  int arg_size() const;
-  int max_locals() const;
-  int max_stack() const;
-  int max_monitors() const;
-
-  // BasicBlock creation
- private:
-  llvm::BasicBlock* CreateBlock(const char* name = "") const;
-
-  // Interpreter entry point for bailouts
- private:
-  address interpreter_entry_point() const;
-};
--- a/ports/hotspot/src/share/vm/shark/sharkState.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkState.cpp.incl"
-
-using namespace llvm;
-
-void SharkState::initialize(const SharkState *state) {
-  _locals = NEW_RESOURCE_ARRAY(SharkValue*, max_locals());
-  _stack  = NEW_RESOURCE_ARRAY(SharkValue*, max_stack());
-
-  NOT_PRODUCT(memset(_locals, 23, max_locals() * sizeof(SharkValue *)));
-  NOT_PRODUCT(memset(_stack,  23, max_stack()  * sizeof(SharkValue *)));
-  _sp = _stack;
-
-  if (state) {
-    for (int i = 0; i < max_locals(); i++) {
-      SharkValue *value = state->local(i);
-      if (value)
-        value = value->clone();
-      set_local(i, value);
-    }
-
-    for (int i = state->stack_depth() - 1; i >= 0; i--) {
-      SharkValue *value = state->stack(i);
-      if (value)
-        value = value->clone();
-      push(value);
-    }
-  }
-
-  set_num_monitors(state ? state->num_monitors() : 0);
-}
-
-bool SharkState::equal_to(SharkState *other) {
-  if (target() != other->target())
-    return false;
-
-  if (method() != other->method())
-    return false;
-
-  if (oop_tmp() != other->oop_tmp())
-    return false;
-
-  if (max_locals() != other->max_locals())
-    return false;
-
-  if (stack_depth() != other->stack_depth())
-    return false;
-
-  if (num_monitors() != other->num_monitors())
-    return false;
-
-  if (has_safepointed() != other->has_safepointed())
-    return false;
-
-  // Local variables
-  for (int i = 0; i < max_locals(); i++) {
-    SharkValue *value = local(i);
-    SharkValue *other_value = other->local(i);
-
-    if (value == NULL) {
-      if (other_value != NULL)
-        return false;
-    }
-    else {
-      if (other_value == NULL)
-        return false;
-
-      if (!value->equal_to(other_value))
-        return false;
-    }
-  }
-
-  // Expression stack
-  for (int i = 0; i < stack_depth(); i++) {
-    SharkValue *value = stack(i);
-    SharkValue *other_value = other->stack(i);
-
-    if (value == NULL) {
-      if (other_value != NULL)
-        return false;
-    }
-    else {
-      if (other_value == NULL)
-        return false;
-
-      if (!value->equal_to(other_value))
-        return false;
-    }
-  }
-
-  return true;
-}
-
-void SharkState::merge(SharkState* other,
-                       BasicBlock* other_block,
-                       BasicBlock* this_block) {
-  // Method
-  Value *this_method = this->method();
-  Value *other_method = other->method();
-  if (this_method != other_method) {
-    PHINode *phi = builder()->CreatePHI(SharkType::methodOop_type(), "method");
-    phi->addIncoming(this_method, this_block);
-    phi->addIncoming(other_method, other_block);
-    set_method(phi);
-  }
-
-  // Temporary oop slot
-  Value *this_oop_tmp = this->oop_tmp();
-  Value *other_oop_tmp = other->oop_tmp();
-  if (this_oop_tmp != other_oop_tmp) {
-    assert(this_oop_tmp && other_oop_tmp, "can't merge NULL with non-NULL");
-    PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), "oop_tmp");
-    phi->addIncoming(this_oop_tmp, this_block);
-    phi->addIncoming(other_oop_tmp, other_block);
-    set_oop_tmp(phi);
-  }
-
-  // Monitors
-  assert(this->num_monitors() == other->num_monitors(), "should be");
-
-  // Local variables
-  assert(this->max_locals() == other->max_locals(), "should be");
-  for (int i = 0; i < max_locals(); i++) {
-    SharkValue *this_value = this->local(i);
-    SharkValue *other_value = other->local(i);
-    assert((this_value == NULL) == (other_value == NULL), "should be");
-    if (this_value != NULL) {
-      char name[18];
-      snprintf(name, sizeof(name), "local_%d_", i);
-      set_local(i, this_value->merge(
-        builder(), other_value, other_block, this_block, name));
-    }
-  }
-
-  // Expression stack
-  assert(this->stack_depth() == other->stack_depth(), "should be");
-  for (int i = 0; i < stack_depth(); i++) {
-    SharkValue *this_value = this->stack(i);
-    SharkValue *other_value = other->stack(i);
-    assert((this_value == NULL) == (other_value == NULL), "should be");
-    if (this_value != NULL) {
-      char name[18];
-      snprintf(name, sizeof(name), "stack_%d_", i);
-      set_stack(i, this_value->merge(
-        builder(), other_value, other_block, this_block, name));
-    }
-  }
-
-  // Safepointed status
-  set_has_safepointed(this->has_safepointed() && other->has_safepointed());
-}
-
-void SharkState::replace_all(SharkValue* old_value, SharkValue* new_value) {
-  // Local variables
-  for (int i = 0; i < max_locals(); i++) {
-    if (local(i) == old_value)
-      set_local(i, new_value);
-  }
-
-  // Expression stack
-  for (int i = 0; i < stack_depth(); i++) {
-    if (stack(i) == old_value)
-      set_stack(i, new_value);
-  }
-}
-
-SharkNormalEntryState::SharkNormalEntryState(SharkTopLevelBlock* block,
-                                             Value*              method)
-  : SharkState(block) {
-  assert(!block->stack_depth_at_entry(), "entry block shouldn't have stack");
-
-  // Local variables
-  for (int i = 0; i < max_locals(); i++) {
-    ciType *type = block->local_type_at_entry(i);
-
-    SharkValue *value = NULL;
-    switch (type->basic_type()) {
-    case T_INT:
-    case T_LONG:
-    case T_FLOAT:
-    case T_DOUBLE:
-    case T_OBJECT:
-    case T_ARRAY:
-      if (i >= arg_size()) {
-        ShouldNotReachHere();
-      }
-      value = SharkValue::create_generic(type, NULL, i == 0 && !is_static());
-      break;
-
-    case ciTypeFlow::StateVector::T_NULL:
-      value = SharkValue::null();
-      break;
-
-    case ciTypeFlow::StateVector::T_BOTTOM:
-      break;
-
-    case ciTypeFlow::StateVector::T_LONG2:
-    case ciTypeFlow::StateVector::T_DOUBLE2:
-      break;
-
-    default:
-      ShouldNotReachHere();
-    }
-    set_local(i, value);
-  }
-  SharkNormalEntryCacher(block->function(), method).scan(this);
-}
-
-SharkOSREntryState::SharkOSREntryState(SharkTopLevelBlock* block,
-                                       Value*              method,
-                                       Value*              osr_buf)
-  : SharkState(block) {
-  assert(!block->stack_depth_at_entry(), "entry block shouldn't have stack");
-  set_num_monitors(block->ciblock()->monitor_count());
-
-  // Local variables
-  for (int i = 0; i < max_locals(); i++) {
-    ciType *type = block->local_type_at_entry(i);
-
-    SharkValue *value = NULL;
-    switch (type->basic_type()) {
-    case T_INT:
-    case T_LONG:
-    case T_FLOAT:
-    case T_DOUBLE:
-    case T_OBJECT:
-    case T_ARRAY:
-      value = SharkValue::create_generic(type, NULL, false);
-      break;
-
-    case ciTypeFlow::StateVector::T_NULL:
-      value = SharkValue::null();
-      break;
-
-    case ciTypeFlow::StateVector::T_BOTTOM:
-      break;
-
-    case ciTypeFlow::StateVector::T_LONG2:
-    case ciTypeFlow::StateVector::T_DOUBLE2:
-      break;
-
-    default:
-      ShouldNotReachHere();
-    }
-    set_local(i, value);
-  }
-  SharkOSREntryCacher(block->function(), method, osr_buf).scan(this);
-}
-
-SharkPHIState::SharkPHIState(SharkTopLevelBlock* block)
-  : SharkState(block), _block(block) {
-  BasicBlock *saved_insert_point = builder()->GetInsertBlock();
-  builder()->SetInsertPoint(block->entry_block());
-  char name[18];
-
-  // Method
-  set_method(builder()->CreatePHI(SharkType::methodOop_type(), "method"));
-
-  // Local variables
-  for (int i = 0; i < max_locals(); i++) {
-    ciType *type = block->local_type_at_entry(i);
-    if (type->basic_type() == (BasicType) ciTypeFlow::StateVector::T_NULL) {
-      // XXX we could do all kinds of clever stuff here
-      type = ciType::make(T_OBJECT); // XXX what about T_ARRAY?
-    }
-
-    SharkValue *value = NULL;
-    switch (type->basic_type()) {
-    case T_INT:
-    case T_LONG:
-    case T_FLOAT:
-    case T_DOUBLE:
-    case T_OBJECT:
-    case T_ARRAY:
-      snprintf(name, sizeof(name), "local_%d_", i);
-      value = SharkValue::create_phi(
-        type, builder()->CreatePHI(SharkType::to_stackType(type), name));
-      break;
-
-    case T_ADDRESS:
-      value = SharkValue::address_constant(type->as_return_address()->bci());
-      break;
-
-    case ciTypeFlow::StateVector::T_BOTTOM:
-      break;
-
-    case ciTypeFlow::StateVector::T_LONG2:
-    case ciTypeFlow::StateVector::T_DOUBLE2:
-      break;
-
-    default:
-      ShouldNotReachHere();
-    }
-    set_local(i, value);
-  }
-
-  // Expression stack
-  for (int i = 0; i < block->stack_depth_at_entry(); i++) {
-    ciType *type = block->stack_type_at_entry(i);
-    if (type->basic_type() == (BasicType) ciTypeFlow::StateVector::T_NULL) {
-      // XXX we could do all kinds of clever stuff here
-      type = ciType::make(T_OBJECT); // XXX what about T_ARRAY?
-    }
-
-    SharkValue *value = NULL;
-    switch (type->basic_type()) {
-    case T_INT:
-    case T_LONG:
-    case T_FLOAT:
-    case T_DOUBLE:
-    case T_OBJECT:
-    case T_ARRAY:
-      snprintf(name, sizeof(name), "stack_%d_", i);
-      value = SharkValue::create_phi(
-        type, builder()->CreatePHI(SharkType::to_stackType(type), name));
-      break;
-
-    case T_ADDRESS:
-      value = SharkValue::address_constant(type->as_return_address()->bci());
-      break;
-
-    case ciTypeFlow::StateVector::T_LONG2:
-    case ciTypeFlow::StateVector::T_DOUBLE2:
-      break;
-
-    default:
-      ShouldNotReachHere();
-    }
-    push(value);
-  }
-
-  // Monitors
-  set_num_monitors(block->ciblock()->monitor_count());
-
-  builder()->SetInsertPoint(saved_insert_point);
-}
-
-void SharkPHIState::add_incoming(SharkState* incoming_state) {
-  BasicBlock *predecessor = builder()->GetInsertBlock();
-
-  // Method
-  ((PHINode *) method())->addIncoming(incoming_state->method(), predecessor);
-
-  // Local variables
-  for (int i = 0; i < max_locals(); i++) {
-    if (local(i) != NULL)
-      local(i)->addIncoming(incoming_state->local(i), predecessor);
-  }
-
-  // Expression stack
-  int stack_depth = block()->stack_depth_at_entry();
-  assert(stack_depth == incoming_state->stack_depth(), "should be");
-  for (int i = 0; i < stack_depth; i++) {
-    assert((stack(i) == NULL) == (incoming_state->stack(i) == NULL), "oops");
-    if (stack(i))
-      stack(i)->addIncoming(incoming_state->stack(i), predecessor);
-  }
-
-  // Monitors
-  assert(num_monitors() == incoming_state->num_monitors(), "should be");
-
-  // Temporary oop slot
-  assert(oop_tmp() == incoming_state->oop_tmp(), "should be");
-}
--- a/ports/hotspot/src/share/vm/shark/sharkState.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkState : public SharkTargetInvariants {
- public:
-  SharkState(const SharkTargetInvariants* parent)
-    : SharkTargetInvariants(parent),
-      _method(NULL),
-      _oop_tmp(NULL),
-      _has_safepointed(false) { initialize(NULL); }
-
-  SharkState(const SharkState* state)
-    : SharkTargetInvariants(state),
-      _method(state->_method),
-      _oop_tmp(state->_oop_tmp),
-      _has_safepointed(state->_has_safepointed) { initialize(state); }
-
- private:
-  void initialize(const SharkState* state);
-
- private:
-  llvm::Value* _method;
-  SharkValue** _locals;
-  SharkValue** _stack;
-  SharkValue** _sp;
-  int          _num_monitors;
-  llvm::Value* _oop_tmp;
-  bool         _has_safepointed;
-
-  // Method
- public:
-  llvm::Value** method_addr() {
-    return &_method;
-  }
-  llvm::Value* method() const {
-    return _method;
-  }
- protected:
-  void set_method(llvm::Value* method) {
-    _method = method;
-  }
-
-  // Local variables
- public:
-  SharkValue** local_addr(int index) const {
-    assert(index >= 0 && index < max_locals(), "bad local variable index");
-    return &_locals[index];
-  }
-  SharkValue* local(int index) const {
-    return *local_addr(index);
-  }
-  void set_local(int index, SharkValue* value) {
-    *local_addr(index) = value;
-  }
-
-  // Expression stack
- public:
-  SharkValue** stack_addr(int slot) const {
-    assert(slot >= 0 && slot < stack_depth(), "bad stack slot");
-    return &_sp[-(slot + 1)];
-  }
-  SharkValue* stack(int slot) const {
-    return *stack_addr(slot);
-  }
- protected:
-  void set_stack(int slot, SharkValue* value) {
-    *stack_addr(slot) = value;
-  }
- public:
-  int stack_depth() const {
-    return _sp - _stack;
-  }
-  void push(SharkValue* value) {
-    assert(stack_depth() < max_stack(), "stack overrun");
-    *(_sp++) = value;
-  }
-  SharkValue* pop() {
-    assert(stack_depth() > 0, "stack underrun");
-    return *(--_sp);
-  }
-
-  // Monitors
- public:
-  int num_monitors() const {
-    return _num_monitors;
-  }
-  void set_num_monitors(int num_monitors) {
-    _num_monitors = num_monitors;
-  }
-
-  // Temporary oop slot
- public:
-  llvm::Value** oop_tmp_addr() {
-    return &_oop_tmp;
-  }
-  llvm::Value* oop_tmp() const {
-    return _oop_tmp;
-  }
-  void set_oop_tmp(llvm::Value* oop_tmp) {
-    _oop_tmp = oop_tmp;
-  }
-
-  // Safepointed status
- public:
-  bool has_safepointed() const {
-    return _has_safepointed;
-  }
-  void set_has_safepointed(bool has_safepointed) {
-    _has_safepointed = has_safepointed;
-  }
-
-  // Comparison
- public:
-  bool equal_to(SharkState* other);
-
-  // Copy and merge
- public:
-  SharkState* copy() const {
-    return new SharkState(this);
-  }
-  void merge(SharkState*       other,
-             llvm::BasicBlock* other_block,
-             llvm::BasicBlock* this_block);
-
-  // Value replacement
- public:
-  void replace_all(SharkValue* old_value, SharkValue* new_value);
-};
-
-class SharkTopLevelBlock;
-
-// SharkNormalEntryState objects are used to create the state
-// that the method will be entered with for a normal invocation.
-class SharkNormalEntryState : public SharkState {
- public:
-  SharkNormalEntryState(SharkTopLevelBlock* block,
-                        llvm::Value*        method);
-};
-
-// SharkOSREntryState objects are used to create the state
-// that the method will be entered with for an OSR invocation.
-class SharkOSREntryState : public SharkState {
- public:
-  SharkOSREntryState(SharkTopLevelBlock* block,
-                     llvm::Value*        method,
-                     llvm::Value*        osr_buf);
-};
-
-// SharkPHIState objects are used to manage the entry state
-// for blocks with more than one entry path or for blocks
-// entered from blocks that will be compiled later.
-class SharkPHIState : public SharkState {
- public:
-  SharkPHIState(SharkTopLevelBlock* block);
-
- private:
-  SharkTopLevelBlock* _block;
-
- private:
-  SharkTopLevelBlock* block() const {
-    return _block;
-  }
-
- public:
-  void add_incoming(SharkState* incoming_state);
-};
--- a/ports/hotspot/src/share/vm/shark/sharkStateScanner.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkStateScanner.cpp.incl"
-
-using namespace llvm;
-
-void SharkStateScanner::scan(SharkState* state) {
-  start_frame();
-
-  // Expression stack
-  stack_integrity_checks(state);
-  start_stack(state->stack_depth());
-  for (int i = state->stack_depth() - 1; i >= 0; i--) {
-    process_stack_slot(
-      i,
-      state->stack_addr(i),
-      stack()->stack_slots_offset() +
-        i + max_stack() - state->stack_depth());
-  }
-  end_stack();
-
-  // Monitors
-  start_monitors(state->num_monitors());
-  for (int i = 0; i < state->num_monitors(); i++) {
-    process_monitor(
-      i,
-      stack()->monitor_offset(i),
-      stack()->monitor_object_offset(i));
-  }
-  end_monitors();
-
-  // Frame header
-  start_frame_header();
-  process_oop_tmp_slot(
-    state->oop_tmp_addr(), stack()->oop_tmp_slot_offset());
-  process_method_slot(state->method_addr(), stack()->method_slot_offset());
-  process_pc_slot(stack()->pc_slot_offset());
-  end_frame_header();
-
-  // Local variables
-  locals_integrity_checks(state);
-  start_locals();
-  for (int i = 0; i < max_locals(); i++) {
-    process_local_slot(
-      i,
-      state->local_addr(i),
-      stack()->locals_slots_offset() + max_locals() - 1 - i);
-  }
-  end_locals();
-
-  end_frame();
-}
-
-#ifndef PRODUCT
-void SharkStateScanner::stack_integrity_checks(SharkState* state) {
-  for (int i = 0; i < state->stack_depth(); i++) {
-    if (state->stack(i)) {
-      if (state->stack(i)->is_two_word())
-        assert(state->stack(i - 1) == NULL, "should be");
-    }
-    else {
-      assert(state->stack(i + 1)->is_two_word(), "should be");
-    }
-  }
-}
-
-void SharkStateScanner::locals_integrity_checks(SharkState* state) {
-  for (int i = 0; i < max_locals(); i++) {
-    if (state->local(i)) {
-      if (state->local(i)->is_two_word())
-        assert(state->local(i + 1) == NULL, "should be");
-    }
-  }
-}
-#endif // !PRODUCT
--- a/ports/hotspot/src/share/vm/shark/sharkStateScanner.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkState;
-
-class SharkStateScanner : public SharkTargetInvariants {
- protected:
-  SharkStateScanner(SharkFunction* function)
-    : SharkTargetInvariants(function), _stack(function->stack()) {}
-
- private:
-  SharkStack* _stack;
-
- protected:
-  SharkStack* stack() const {
-    return _stack;
-  }
-
-  // Scan the frame
- public:
-  void scan(SharkState* state);
-
-  // Callbacks
-  // Note that the offsets supplied to the various process_* callbacks
-  // are specified in wordSize words from the frame's unextended_sp.
- protected:
-  virtual void start_frame()                                                 {}
-
-  virtual void start_stack(int stack_depth)                                  {}
-  virtual void process_stack_slot(int index, SharkValue** value, int offset) {}
-  virtual void end_stack()                                                   {}
-
-  virtual void start_monitors(int num_monitors)                              {}
-  virtual void process_monitor(int index, int box_offset, int obj_offset)    {}
-  virtual void end_monitors()                                                {}
-
-  virtual void start_frame_header()                                          {}
-  virtual void process_oop_tmp_slot(llvm::Value** value, int offset)         {}
-  virtual void process_method_slot(llvm::Value** value, int offset)          {}
-  virtual void process_pc_slot(int offset)                                   {}
-  virtual void end_frame_header()                                            {}
-
-  virtual void start_locals()                                                {}
-  virtual void process_local_slot(int index, SharkValue** value, int offset) {}
-  virtual void end_locals()                                                  {}
-
-  virtual void end_frame()                                                   {}
-
-  // Integrity checks
- private:
-  void stack_integrity_checks(SharkState* state) PRODUCT_RETURN;
-  void locals_integrity_checks(SharkState* state) PRODUCT_RETURN;
-};
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1991 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkTopLevelBlock.cpp.incl"
-
-using namespace llvm;
-
-void SharkTopLevelBlock::scan_for_traps() {
-  // If typeflow found a trap then don't scan past it
-  int limit_bci = ciblock()->has_trap() ? ciblock()->trap_bci() : limit();
-
-  // Scan the bytecode for traps that are always hit
-  iter()->reset_to_bci(start());
-  while (iter()->next_bci() < limit_bci) {
-    iter()->next();
-
-    ciField *field;
-    ciMethod *method;
-    ciInstanceKlass *klass;
-    bool will_link;
-    bool is_field;
-
-    switch (bc()) {
-    case Bytecodes::_ldc:
-    case Bytecodes::_ldc_w:
-      if (!SharkConstant::for_ldc(iter())->is_loaded()) {
-        set_trap(
-          Deoptimization::make_trap_request(
-            Deoptimization::Reason_uninitialized,
-            Deoptimization::Action_reinterpret), bci());
-        return;
-      }
-      break;
-
-    case Bytecodes::_getfield:
-    case Bytecodes::_getstatic:
-    case Bytecodes::_putfield:
-    case Bytecodes::_putstatic:
-      field = iter()->get_field(will_link);
-      assert(will_link, "typeflow responsibility");
-      is_field = (bc() == Bytecodes::_getfield || bc() == Bytecodes::_putfield);
-
-      // If the bytecode does not match the field then bail out to
-      // the interpreter to throw an IncompatibleClassChangeError
-      if (is_field == field->is_static()) {
-        set_trap(
-          Deoptimization::make_trap_request(
-            Deoptimization::Reason_unhandled,
-            Deoptimization::Action_none), bci());
-        return;
-      }
-
-      // Bail out if we are trying to access a static variable
-      // before the class initializer has completed.
-      if (!is_field && !field->holder()->is_initialized()) {
-        if (!static_field_ok_in_clinit(field)) {
-          set_trap(
-            Deoptimization::make_trap_request(
-              Deoptimization::Reason_uninitialized,
-              Deoptimization::Action_reinterpret), bci());
-          return;
-        }
-      }
-      break;
-
-    case Bytecodes::_invokestatic:
-    case Bytecodes::_invokespecial:
-    case Bytecodes::_invokevirtual:
-    case Bytecodes::_invokeinterface:
-      method = iter()->get_method(will_link);
-      assert(will_link, "typeflow responsibility");
-
-      if (!method->holder()->is_linked()) {
-        set_trap(
-          Deoptimization::make_trap_request(
-            Deoptimization::Reason_uninitialized,
-            Deoptimization::Action_reinterpret), bci());
-          return;
-      }
-
-      if (bc() == Bytecodes::_invokevirtual) {
-        klass = ciEnv::get_instance_klass_for_declared_method_holder(
-          iter()->get_declared_method_holder());
-        if (!klass->is_linked()) {
-          set_trap(
-            Deoptimization::make_trap_request(
-              Deoptimization::Reason_uninitialized,
-              Deoptimization::Action_reinterpret), bci());
-            return;
-        }
-      }
-      break;
-
-    case Bytecodes::_new:
-      klass = iter()->get_klass(will_link)->as_instance_klass();
-      assert(will_link, "typeflow responsibility");
-
-      // Bail out if the class is unloaded
-      if (iter()->is_unresolved_klass() || !klass->is_initialized()) {
-        set_trap(
-          Deoptimization::make_trap_request(
-            Deoptimization::Reason_uninitialized,
-            Deoptimization::Action_reinterpret), bci());
-        return;
-      }
-
-      // Bail out if the class cannot be instantiated
-      if (klass->is_abstract() || klass->is_interface() ||
-          klass->name() == ciSymbol::java_lang_Class()) {
-        set_trap(
-          Deoptimization::make_trap_request(
-            Deoptimization::Reason_unhandled,
-            Deoptimization::Action_reinterpret), bci());
-        return;
-      }
-      break;
-    }
-  }
-
-  // Trap if typeflow trapped (and we didn't before)
-  if (ciblock()->has_trap()) {
-    set_trap(
-      Deoptimization::make_trap_request(
-        Deoptimization::Reason_unloaded,
-        Deoptimization::Action_reinterpret,
-        ciblock()->trap_index()), ciblock()->trap_bci());
-    return;
-  }
-}
-
-bool SharkTopLevelBlock::static_field_ok_in_clinit(ciField* field) {
-  assert(field->is_static(), "should be");
-
-  // This code is lifted pretty much verbatim from C2's
-  // Parse::static_field_ok_in_clinit() in parse3.cpp.
-  bool access_OK = false;
-  if (target()->holder()->is_subclass_of(field->holder())) {
-    if (target()->is_static()) {
-      if (target()->name() == ciSymbol::class_initializer_name()) {
-        // It's OK to access static fields from the class initializer
-        access_OK = true;
-      }
-    }
-    else {
-      if (target()->name() == ciSymbol::object_initializer_name()) {
-        // It's also OK to access static fields inside a constructor,
-        // because any thread calling the constructor must first have
-        // synchronized on the class by executing a "new" bytecode.
-        access_OK = true;
-      }
-    }
-  }
-  return access_OK;
-}
-
-SharkState* SharkTopLevelBlock::entry_state() {
-  if (_entry_state == NULL) {
-    assert(needs_phis(), "should do");
-    _entry_state = new SharkPHIState(this);
-  }
-  return _entry_state;
-}
-
-void SharkTopLevelBlock::add_incoming(SharkState* incoming_state) {
-  if (needs_phis()) {
-    ((SharkPHIState *) entry_state())->add_incoming(incoming_state);
-  }
-  else if (_entry_state == NULL) {
-    _entry_state = incoming_state;
-  }
-  else {
-    assert(entry_state()->equal_to(incoming_state), "should be");
-  }
-}
-
-void SharkTopLevelBlock::enter(SharkTopLevelBlock* predecessor,
-                               bool is_exception) {
-  // This block requires phis:
-  //  - if it is entered more than once
-  //  - if it is an exception handler, because in which
-  //    case we assume it's entered more than once.
-  //  - if the predecessor will be compiled after this
-  //    block, in which case we can't simple propagate
-  //    the state forward.
-  if (!needs_phis() &&
-      (entered() ||
-       is_exception ||
-       (predecessor && predecessor->index() >= index())))
-    _needs_phis = true;
-
-  // Recurse into the tree
-  if (!entered()) {
-    _entered = true;
-
-    scan_for_traps();
-    if (!has_trap()) {
-      for (int i = 0; i < num_successors(); i++) {
-        successor(i)->enter(this, false);
-      }
-    }
-    compute_exceptions();
-    for (int i = 0; i < num_exceptions(); i++) {
-      SharkTopLevelBlock *handler = exception(i);
-      if (handler)
-        handler->enter(this, true);
-    }
-  }
-}
-
-void SharkTopLevelBlock::initialize() {
-  char name[28];
-  snprintf(name, sizeof(name),
-           "bci_%d%s",
-           start(), is_backedge_copy() ? "_backedge_copy" : "");
-  _entry_block = function()->CreateBlock(name);
-}
-
-void SharkTopLevelBlock::decache_for_Java_call(ciMethod *callee) {
-  SharkJavaCallDecacher(function(), bci(), callee).scan(current_state());
-  for (int i = 0; i < callee->arg_size(); i++)
-    xpop();
-}
-
-void SharkTopLevelBlock::cache_after_Java_call(ciMethod *callee) {
-  if (callee->return_type()->size()) {
-    ciType *type;
-    switch (callee->return_type()->basic_type()) {
-    case T_BOOLEAN:
-    case T_BYTE:
-    case T_CHAR:
-    case T_SHORT:
-      type = ciType::make(T_INT);
-      break;
-
-    default:
-      type = callee->return_type();
-    }
-
-    push(SharkValue::create_generic(type, NULL, false));
-  }
-  SharkJavaCallCacher(function(), callee).scan(current_state());
-}
-
-void SharkTopLevelBlock::decache_for_VM_call() {
-  SharkVMCallDecacher(function(), bci()).scan(current_state());
-}
-
-void SharkTopLevelBlock::cache_after_VM_call() {
-  SharkVMCallCacher(function()).scan(current_state());
-}
-
-void SharkTopLevelBlock::decache_for_trap() {
-  SharkTrapDecacher(function(), bci()).scan(current_state());
-}
-
-void SharkTopLevelBlock::emit_IR() {
-  builder()->SetInsertPoint(entry_block());
-
-  // Parse the bytecode
-  parse_bytecode(start(), limit());
-
-  // If this block falls through to the next then it won't have been
-  // terminated by a bytecode and we have to add the branch ourselves
-  if (falls_through() && !has_trap())
-    do_branch(ciTypeFlow::FALL_THROUGH);
-}
-
-SharkTopLevelBlock* SharkTopLevelBlock::bci_successor(int bci) const {
-  // XXX now with Linear Search Technology (tm)
-  for (int i = 0; i < num_successors(); i++) {
-    ciTypeFlow::Block *successor = ciblock()->successors()->at(i);
-    if (successor->start() == bci)
-      return function()->block(successor->pre_order());
-  }
-  ShouldNotReachHere();
-}
-
-void SharkTopLevelBlock::do_zero_check(SharkValue *value) {
-  if (value->is_phi() && value->as_phi()->all_incomers_zero_checked()) {
-    function()->add_deferred_zero_check(this, value);
-  }
-  else {
-    BasicBlock *continue_block = function()->CreateBlock("not_zero");
-    SharkState *saved_state = current_state();
-    set_current_state(saved_state->copy());
-    zero_check_value(value, continue_block);
-    builder()->SetInsertPoint(continue_block);
-    set_current_state(saved_state);
-  }
-
-  value->set_zero_checked(true);
-}
-
-void SharkTopLevelBlock::do_deferred_zero_check(SharkValue* value,
-                                                int         bci,
-                                                SharkState* saved_state,
-                                                BasicBlock* continue_block) {
-  if (value->as_phi()->all_incomers_zero_checked()) {
-    builder()->CreateBr(continue_block);
-  }
-  else {
-    iter()->force_bci(start());
-    set_current_state(saved_state);
-    zero_check_value(value, continue_block);
-  }
-}
-
-void SharkTopLevelBlock::zero_check_value(SharkValue* value,
-                                          BasicBlock* continue_block) {
-  BasicBlock *zero_block = builder()->CreateBlock(continue_block, "zero");
-
-  Value *a, *b;
-  switch (value->basic_type()) {
-  case T_BYTE:
-  case T_CHAR:
-  case T_SHORT:
-  case T_INT:
-    a = value->jint_value();
-    b = LLVMValue::jint_constant(0);
-    break;
-  case T_LONG:
-    a = value->jlong_value();
-    b = LLVMValue::jlong_constant(0);
-    break;
-  case T_OBJECT:
-  case T_ARRAY:
-    a = value->jobject_value();
-    b = LLVMValue::LLVMValue::null();
-    break;
-  default:
-    tty->print_cr("Unhandled type %s", type2name(value->basic_type()));
-    ShouldNotReachHere();
-  }
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpNE(a, b), continue_block, zero_block);
-
-  builder()->SetInsertPoint(zero_block);
-  if (value->is_jobject()) {
-    call_vm(
-      builder()->throw_NullPointerException(),
-      builder()->CreateIntToPtr(
-        LLVMValue::intptr_constant((intptr_t) __FILE__),
-        PointerType::getUnqual(SharkType::jbyte_type())),
-      LLVMValue::jint_constant(__LINE__),
-      EX_CHECK_NONE);
-  }
-  else {
-    call_vm(
-      builder()->throw_ArithmeticException(),
-      builder()->CreateIntToPtr(
-        LLVMValue::intptr_constant((intptr_t) __FILE__),
-        PointerType::getUnqual(SharkType::jbyte_type())),
-      LLVMValue::jint_constant(__LINE__),
-      EX_CHECK_NONE);
-  }
-
-  Value *pending_exception = get_pending_exception();
-  clear_pending_exception();
-  handle_exception(pending_exception, EX_CHECK_FULL);
-}
-
-void SharkTopLevelBlock::check_bounds(SharkValue* array, SharkValue* index) {
-  BasicBlock *out_of_bounds = function()->CreateBlock("out_of_bounds");
-  BasicBlock *in_bounds     = function()->CreateBlock("in_bounds");
-
-  Value *length = builder()->CreateArrayLength(array->jarray_value());
-  // we use an unsigned comparison to catch negative values
-  builder()->CreateCondBr(
-    builder()->CreateICmpULT(index->jint_value(), length),
-    in_bounds, out_of_bounds);
-
-  builder()->SetInsertPoint(out_of_bounds);
-  SharkState *saved_state = current_state()->copy();
-
-  call_vm(
-    builder()->throw_ArrayIndexOutOfBoundsException(),
-    builder()->CreateIntToPtr(
-      LLVMValue::intptr_constant((intptr_t) __FILE__),
-      PointerType::getUnqual(SharkType::jbyte_type())),
-    LLVMValue::jint_constant(__LINE__),
-    index->jint_value(),
-    EX_CHECK_NONE);
-
-  Value *pending_exception = get_pending_exception();
-  clear_pending_exception();
-  handle_exception(pending_exception, EX_CHECK_FULL);
-
-  set_current_state(saved_state);
-
-  builder()->SetInsertPoint(in_bounds);
-}
-
-void SharkTopLevelBlock::check_pending_exception(int action) {
-  assert(action & EAM_CHECK, "should be");
-
-  BasicBlock *exception    = function()->CreateBlock("exception");
-  BasicBlock *no_exception = function()->CreateBlock("no_exception");
-
-  Value *pending_exception = get_pending_exception();
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(pending_exception, LLVMValue::null()),
-    no_exception, exception);
-
-  builder()->SetInsertPoint(exception);
-  SharkState *saved_state = current_state()->copy();
-  if (action & EAM_MONITOR_FUDGE) {
-    // The top monitor is marked live, but the exception was thrown
-    // while setting it up so we need to mark it dead before we enter
-    // any exception handlers as they will not expect it to be there.
-    set_num_monitors(num_monitors() - 1);
-    action ^= EAM_MONITOR_FUDGE;
-  }
-  clear_pending_exception();
-  handle_exception(pending_exception, action);
-  set_current_state(saved_state);
-
-  builder()->SetInsertPoint(no_exception);
-}
-
-void SharkTopLevelBlock::compute_exceptions() {
-  ciExceptionHandlerStream str(target(), start());
-
-  int exc_count = str.count();
-  _exc_handlers = new GrowableArray<ciExceptionHandler*>(exc_count);
-  _exceptions   = new GrowableArray<SharkTopLevelBlock*>(exc_count);
-
-  int index = 0;
-  for (; !str.is_done(); str.next()) {
-    ciExceptionHandler *handler = str.handler();
-    if (handler->handler_bci() == -1)
-      break;
-    _exc_handlers->append(handler);
-
-    // Try and get this exception's handler from typeflow.  We should
-    // do it this way always, really, except that typeflow sometimes
-    // doesn't record exceptions, even loaded ones, and sometimes it
-    // returns them with a different handler bci.  Why???
-    SharkTopLevelBlock *block = NULL;
-    ciInstanceKlass* klass;
-    if (handler->is_catch_all()) {
-      klass = java_lang_Throwable_klass();
-    }
-    else {
-      klass = handler->catch_klass();
-    }
-    for (int i = 0; i < ciblock()->exceptions()->length(); i++) {
-      if (klass == ciblock()->exc_klasses()->at(i)) {
-        block = function()->block(ciblock()->exceptions()->at(i)->pre_order());
-        if (block->start() == handler->handler_bci())
-          break;
-        else
-          block = NULL;
-      }
-    }
-
-    // If typeflow let us down then try and figure it out ourselves
-    if (block == NULL) {
-      for (int i = 0; i < function()->block_count(); i++) {
-        SharkTopLevelBlock *candidate = function()->block(i);
-        if (candidate->start() == handler->handler_bci()) {
-          if (block != NULL) {
-            NOT_PRODUCT(warning("there may be trouble ahead"));
-            block = NULL;
-            break;
-          }
-          block = candidate;
-        }
-      }
-    }
-    _exceptions->append(block);
-  }
-}
-
-void SharkTopLevelBlock::handle_exception(Value* exception, int action) {
-  if (action & EAM_HANDLE && num_exceptions() != 0) {
-    // Clear the stack and push the exception onto it
-    while (xstack_depth())
-      pop();
-    push(SharkValue::create_jobject(exception, true));
-
-    // Work out how many options we have to check
-    bool has_catch_all = exc_handler(num_exceptions() - 1)->is_catch_all();
-    int num_options = num_exceptions();
-    if (has_catch_all)
-      num_options--;
-
-    // Marshal any non-catch-all handlers
-    if (num_options > 0) {
-      bool all_loaded = true;
-      for (int i = 0; i < num_options; i++) {
-        if (!exc_handler(i)->catch_klass()->is_loaded()) {
-          all_loaded = false;
-          break;
-        }
-      }
-
-      if (all_loaded)
-        marshal_exception_fast(num_options);
-      else
-        marshal_exception_slow(num_options);
-    }
-
-    // Install the catch-all handler, if present
-    if (has_catch_all) {
-      builder()->CreateBr(handler_for_exception(num_options));
-      return;
-    }
-  }
-
-  // No exception handler was found; unwind and return
-  handle_return(T_VOID, exception);
-}
-
-void SharkTopLevelBlock::marshal_exception_fast(int num_options) {
-  Value *exception_klass = builder()->CreateValueOfStructEntry(
-    xstack(0)->jobject_value(),
-    in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::oop_type(),
-    "exception_klass");
-
-  for (int i = 0; i < num_options; i++) {
-    Value *check_klass =
-      builder()->CreateInlineOop(exc_handler(i)->catch_klass());
-
-    BasicBlock *not_exact   = function()->CreateBlock("not_exact");
-    BasicBlock *not_subtype = function()->CreateBlock("not_subtype");
-
-    builder()->CreateCondBr(
-      builder()->CreateICmpEQ(check_klass, exception_klass),
-      handler_for_exception(i), not_exact);
-
-    builder()->SetInsertPoint(not_exact);
-    builder()->CreateCondBr(
-      builder()->CreateICmpNE(
-        builder()->CreateCall2(
-          builder()->is_subtype_of(), check_klass, exception_klass),
-        LLVMValue::jbyte_constant(0)),
-      handler_for_exception(i), not_subtype);
-
-    builder()->SetInsertPoint(not_subtype);
-  }
-}
-
-void SharkTopLevelBlock::marshal_exception_slow(int num_options) {
-  int *indexes = NEW_RESOURCE_ARRAY(int, num_options);
-  for (int i = 0; i < num_options; i++)
-    indexes[i] = exc_handler(i)->catch_klass_index();
-
-  Value *index = call_vm(
-    builder()->find_exception_handler(),
-    builder()->CreateInlineData(
-      indexes,
-      num_options * sizeof(int),
-      PointerType::getUnqual(SharkType::jint_type())),
-    LLVMValue::jint_constant(num_options),
-    EX_CHECK_NO_CATCH);
-
-  BasicBlock *no_handler = function()->CreateBlock("no_handler");
-  SwitchInst *switchinst = builder()->CreateSwitch(
-    index, no_handler, num_options);
-
-  for (int i = 0; i < num_options; i++) {
-    switchinst->addCase(
-      LLVMValue::jint_constant(i),
-      handler_for_exception(i));
-  }
-
-  builder()->SetInsertPoint(no_handler);
-}
-
-BasicBlock* SharkTopLevelBlock::handler_for_exception(int index) {
-  SharkTopLevelBlock *successor = this->exception(index);
-  if (successor) {
-    successor->add_incoming(current_state());
-    return successor->entry_block();
-  }
-  else {
-    return make_trap(
-      exc_handler(index)->handler_bci(),
-      Deoptimization::make_trap_request(
-        Deoptimization::Reason_unhandled,
-        Deoptimization::Action_reinterpret));
-  }
-}
-
-void SharkTopLevelBlock::maybe_add_safepoint() {
-  if (current_state()->has_safepointed())
-    return;
-
-  BasicBlock *orig_block = builder()->GetInsertBlock();
-  SharkState *orig_state = current_state()->copy();
-
-  BasicBlock *do_safepoint = function()->CreateBlock("do_safepoint");
-  BasicBlock *safepointed  = function()->CreateBlock("safepointed");
-
-  Value *state = builder()->CreateLoad(
-    builder()->CreateIntToPtr(
-      LLVMValue::intptr_constant(
-        (intptr_t) SafepointSynchronize::address_of_state()),
-      PointerType::getUnqual(SharkType::jint_type())),
-    "state");
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(
-      state,
-      LLVMValue::jint_constant(SafepointSynchronize::_synchronizing)),
-    do_safepoint, safepointed);
-
-  builder()->SetInsertPoint(do_safepoint);
-  call_vm(builder()->safepoint(), EX_CHECK_FULL);
-  BasicBlock *safepointed_block = builder()->GetInsertBlock();
-  builder()->CreateBr(safepointed);
-
-  builder()->SetInsertPoint(safepointed);
-  current_state()->merge(orig_state, orig_block, safepointed_block);
-
-  current_state()->set_has_safepointed(true);
-}
-
-void SharkTopLevelBlock::maybe_add_backedge_safepoint() {
-  if (current_state()->has_safepointed())
-    return;
-
-  for (int i = 0; i < num_successors(); i++) {
-    if (successor(i)->can_reach(this)) {
-      maybe_add_safepoint();
-      break;
-    }
-  }
-}
-
-bool SharkTopLevelBlock::can_reach(SharkTopLevelBlock* other) {
-  for (int i = 0; i < function()->block_count(); i++)
-    function()->block(i)->_can_reach_visited = false;
-
-  return can_reach_helper(other);
-}
-
-bool SharkTopLevelBlock::can_reach_helper(SharkTopLevelBlock* other) {
-  if (this == other)
-    return true;
-
-  if (_can_reach_visited)
-    return false;
-  _can_reach_visited = true;
-
-  if (!has_trap()) {
-    for (int i = 0; i < num_successors(); i++) {
-      if (successor(i)->can_reach_helper(other))
-        return true;
-    }
-  }
-
-  for (int i = 0; i < num_exceptions(); i++) {
-    SharkTopLevelBlock *handler = exception(i);
-    if (handler && handler->can_reach_helper(other))
-      return true;
-  }
-
-  return false;
-}
-
-BasicBlock* SharkTopLevelBlock::make_trap(int trap_bci, int trap_request) {
-  BasicBlock *trap_block = function()->CreateBlock("trap");
-  BasicBlock *orig_block = builder()->GetInsertBlock();
-  builder()->SetInsertPoint(trap_block);
-
-  int orig_bci = bci();
-  iter()->force_bci(trap_bci);
-
-  do_trap(trap_request);
-
-  builder()->SetInsertPoint(orig_block);
-  iter()->force_bci(orig_bci);
-
-  return trap_block;
-}
-
-void SharkTopLevelBlock::do_trap(int trap_request) {
-  decache_for_trap();
-  builder()->CreateRet(
-    builder()->CreateCall2(
-      builder()->uncommon_trap(),
-      thread(),
-      LLVMValue::jint_constant(trap_request)));
-}
-
-void SharkTopLevelBlock::call_register_finalizer(Value *receiver) {
-  BasicBlock *orig_block = builder()->GetInsertBlock();
-  SharkState *orig_state = current_state()->copy();
-
-  BasicBlock *do_call = function()->CreateBlock("has_finalizer");
-  BasicBlock *done    = function()->CreateBlock("done");
-
-  Value *klass = builder()->CreateValueOfStructEntry(
-    receiver,
-    in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::oop_type(),
-    "klass");
-
-  Value *klass_part = builder()->CreateAddressOfStructEntry(
-    klass,
-    in_ByteSize(klassOopDesc::klass_part_offset_in_bytes()),
-    SharkType::klass_type(),
-    "klass_part");
-
-  Value *access_flags = builder()->CreateValueOfStructEntry(
-    klass_part,
-    in_ByteSize(Klass::access_flags_offset_in_bytes()),
-    SharkType::jint_type(),
-    "access_flags");
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpNE(
-      builder()->CreateAnd(
-        access_flags,
-        LLVMValue::jint_constant(JVM_ACC_HAS_FINALIZER)),
-      LLVMValue::jint_constant(0)),
-    do_call, done);
-
-  builder()->SetInsertPoint(do_call);
-  call_vm(builder()->register_finalizer(), receiver, EX_CHECK_FULL);
-  BasicBlock *branch_block = builder()->GetInsertBlock();
-  builder()->CreateBr(done);
-
-  builder()->SetInsertPoint(done);
-  current_state()->merge(orig_state, orig_block, branch_block);
-}
-
-void SharkTopLevelBlock::handle_return(BasicType type, Value* exception) {
-  assert (exception == NULL || type == T_VOID, "exception OR result, please");
-
-  if (num_monitors()) {
-    // Protect our exception across possible monitor release decaches
-    if (exception)
-      set_oop_tmp(exception);
-
-    // We don't need to check for exceptions thrown here.  If
-    // we're returning a value then we just carry on as normal:
-    // the caller will see the pending exception and handle it.
-    // If we're returning with an exception then that exception
-    // takes priority and the release_lock one will be ignored.
-    while (num_monitors())
-      release_lock(EX_CHECK_NONE);
-
-    // Reload the exception we're throwing
-    if (exception)
-      exception = get_oop_tmp();
-  }
-
-  if (exception) {
-    builder()->CreateStore(exception, pending_exception_address());
-  }
-
-  Value *result_addr = stack()->CreatePopFrame(type2size[type]);
-  if (type != T_VOID) {
-    builder()->CreateStore(
-      pop_result(type)->generic_value(),
-      builder()->CreateIntToPtr(
-        result_addr,
-        PointerType::getUnqual(SharkType::to_stackType(type))));
-  }
-
-  builder()->CreateRet(LLVMValue::jint_constant(0));
-}
-
-void SharkTopLevelBlock::do_arraylength() {
-  SharkValue *array = pop();
-  check_null(array);
-  Value *length = builder()->CreateArrayLength(array->jarray_value());
-  push(SharkValue::create_jint(length, false));
-}
-
-void SharkTopLevelBlock::do_aload(BasicType basic_type) {
-  SharkValue *index = pop();
-  SharkValue *array = pop();
-
-  check_null(array);
-  check_bounds(array, index);
-
-  Value *value = builder()->CreateLoad(
-    builder()->CreateArrayAddress(
-      array->jarray_value(), basic_type, index->jint_value()));
-
-  const Type *stack_type = SharkType::to_stackType(basic_type);
-  if (value->getType() != stack_type)
-    value = builder()->CreateIntCast(value, stack_type, basic_type != T_CHAR);
-
-  switch (basic_type) {
-  case T_BYTE:
-  case T_CHAR:
-  case T_SHORT:
-  case T_INT:
-    push(SharkValue::create_jint(value, false));
-    break;
-
-  case T_LONG:
-    push(SharkValue::create_jlong(value, false));
-    break;
-
-  case T_FLOAT:
-    push(SharkValue::create_jfloat(value));
-    break;
-
-  case T_DOUBLE:
-    push(SharkValue::create_jdouble(value));
-    break;
-
-  case T_OBJECT:
-    // You might expect that array->type()->is_array_klass() would
-    // always be true, but it isn't.  If ciTypeFlow detects that a
-    // value is always null then that value becomes an untyped null
-    // object.  Shark doesn't presently support this, so a generic
-    // T_OBJECT is created.  In this case we guess the type using
-    // the BasicType we were supplied.  In reality the generated
-    // code will never be used, as the null value will be caught
-    // by the above null pointer check.
-    // http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=324
-    push(
-      SharkValue::create_generic(
-        array->type()->is_array_klass() ?
-          ((ciArrayKlass *) array->type())->element_type() :
-          ciType::make(basic_type),
-        value, false));
-    break;
-
-  default:
-    tty->print_cr("Unhandled type %s", type2name(basic_type));
-    ShouldNotReachHere();
-  }
-}
-
-void SharkTopLevelBlock::do_astore(BasicType basic_type) {
-  SharkValue *svalue = pop();
-  SharkValue *index  = pop();
-  SharkValue *array  = pop();
-
-  check_null(array);
-  check_bounds(array, index);
-
-  Value *value;
-  switch (basic_type) {
-  case T_BYTE:
-  case T_CHAR:
-  case T_SHORT:
-  case T_INT:
-    value = svalue->jint_value();
-    break;
-
-  case T_LONG:
-    value = svalue->jlong_value();
-    break;
-
-  case T_FLOAT:
-    value = svalue->jfloat_value();
-    break;
-
-  case T_DOUBLE:
-    value = svalue->jdouble_value();
-    break;
-
-  case T_OBJECT:
-    value = svalue->jobject_value();
-    // XXX assignability check
-    break;
-
-  default:
-    tty->print_cr("Unhandled type %s", type2name(basic_type));
-    ShouldNotReachHere();
-  }
-
-  const Type *array_type = SharkType::to_arrayType(basic_type);
-  if (value->getType() != array_type)
-    value = builder()->CreateIntCast(value, array_type, basic_type != T_CHAR);
-
-  Value *addr = builder()->CreateArrayAddress(
-    array->jarray_value(), basic_type, index->jint_value(), "addr");
-
-  builder()->CreateStore(value, addr);
-
-  if (basic_type == T_OBJECT) // XXX or T_ARRAY?
-    builder()->CreateUpdateBarrierSet(oopDesc::bs(), addr);
-}
-
-void SharkTopLevelBlock::do_return(BasicType type) {
-  if (target()->intrinsic_id() == vmIntrinsics::_Object_init)
-    call_register_finalizer(local(0)->jobject_value());
-  maybe_add_safepoint();
-  handle_return(type, NULL);
-}
-
-void SharkTopLevelBlock::do_athrow() {
-  SharkValue *exception = pop();
-  check_null(exception);
-  handle_exception(exception->jobject_value(), EX_CHECK_FULL);
-}
-
-void SharkTopLevelBlock::do_goto() {
-  do_branch(ciTypeFlow::GOTO_TARGET);
-}
-
-void SharkTopLevelBlock::do_jsr() {
-  push(SharkValue::address_constant(iter()->next_bci()));
-  do_branch(ciTypeFlow::GOTO_TARGET);
-}
-
-void SharkTopLevelBlock::do_ret() {
-  assert(local(iter()->get_index())->address_value() ==
-         successor(ciTypeFlow::GOTO_TARGET)->start(), "should be");
-  do_branch(ciTypeFlow::GOTO_TARGET);
-}
-
-// All propagation of state from one block to the next (via
-// dest->add_incoming) is handled by these methods:
-//   do_branch
-//   do_if_helper
-//   do_switch
-//   handle_exception
-
-void SharkTopLevelBlock::do_branch(int successor_index) {
-  SharkTopLevelBlock *dest = successor(successor_index);
-  builder()->CreateBr(dest->entry_block());
-  dest->add_incoming(current_state());
-}
-
-void SharkTopLevelBlock::do_if(ICmpInst::Predicate p,
-                               SharkValue*         b,
-                               SharkValue*         a) {
-  Value *llvm_a, *llvm_b;
-  if (a->is_jobject()) {
-    llvm_a = a->intptr_value(builder());
-    llvm_b = b->intptr_value(builder());
-  }
-  else {
-    llvm_a = a->jint_value();
-    llvm_b = b->jint_value();
-  }
-  do_if_helper(p, llvm_b, llvm_a, current_state(), current_state());
-}
-
-void SharkTopLevelBlock::do_if_helper(ICmpInst::Predicate p,
-                                      Value*              b,
-                                      Value*              a,
-                                      SharkState*         if_taken_state,
-                                      SharkState*         not_taken_state) {
-  SharkTopLevelBlock *if_taken  = successor(ciTypeFlow::IF_TAKEN);
-  SharkTopLevelBlock *not_taken = successor(ciTypeFlow::IF_NOT_TAKEN);
-
-  builder()->CreateCondBr(
-    builder()->CreateICmp(p, a, b),
-    if_taken->entry_block(), not_taken->entry_block());
-
-  if_taken->add_incoming(if_taken_state);
-  not_taken->add_incoming(not_taken_state);
-}
-
-void SharkTopLevelBlock::do_switch() {
-  int len = switch_table_length();
-
-  SharkTopLevelBlock *dest_block = successor(ciTypeFlow::SWITCH_DEFAULT);
-  SwitchInst *switchinst = builder()->CreateSwitch(
-    pop()->jint_value(), dest_block->entry_block(), len);
-  dest_block->add_incoming(current_state());
-
-  for (int i = 0; i < len; i++) {
-    int dest_bci = switch_dest(i);
-    if (dest_bci != switch_default_dest()) {
-      dest_block = bci_successor(dest_bci);
-      switchinst->addCase(
-        LLVMValue::jint_constant(switch_key(i)),
-        dest_block->entry_block());
-      dest_block->add_incoming(current_state());
-    }
-  }
-}
-
-ciMethod* SharkTopLevelBlock::improve_virtual_call(ciMethod*   caller,
-                                              ciInstanceKlass* klass,
-                                              ciMethod*        dest_method,
-                                              ciType*          receiver_type) {
-  // If the method is obviously final then we are already done
-  if (dest_method->can_be_statically_bound())
-    return dest_method;
-
-  // Array methods are all inherited from Object and are monomorphic
-  if (receiver_type->is_array_klass() &&
-      dest_method->holder() == java_lang_Object_klass())
-    return dest_method;
-
-#ifdef SHARK_CAN_DEOPTIMIZE_ANYWHERE
-  // This code can replace a virtual call with a direct call if this
-  // class is the only one in the entire set of loaded classes that
-  // implements this method.  This makes the compiled code dependent
-  // on other classes that implement the method not being loaded, a
-  // condition which is enforced by the dependency tracker.  If the
-  // dependency tracker determines a method has become invalid it
-  // will mark it for recompilation, causing running copies to be
-  // deoptimized.  Shark currently can't deoptimize arbitrarily like
-  // that, so this optimization cannot be used.
-  // http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=481
-  
-  // All other interesting cases are instance classes
-  if (!receiver_type->is_instance_klass())
-    return NULL;
-
-  // Attempt to improve the receiver
-  ciInstanceKlass* actual_receiver = klass;
-  ciInstanceKlass *improved_receiver = receiver_type->as_instance_klass();
-  if (improved_receiver->is_loaded() &&
-      improved_receiver->is_initialized() &&
-      !improved_receiver->is_interface() &&
-      improved_receiver->is_subtype_of(actual_receiver)) {
-    actual_receiver = improved_receiver;
-  }
-
-  // Attempt to find a monomorphic target for this call using
-  // class heirachy analysis.
-  ciInstanceKlass *calling_klass = caller->holder();
-  ciMethod* monomorphic_target =
-    dest_method->find_monomorphic_target(calling_klass, klass, actual_receiver);
-  if (monomorphic_target != NULL) {
-    assert(!monomorphic_target->is_abstract(), "shouldn't be");
-
-    // Opto has a bunch of type checking here that I don't
-    // understand.  It's to inhibit casting in one direction,
-    // possibly because objects in Opto can have inexact
-    // types, but I can't even tell which direction it
-    // doesn't like.  For now I'm going to block *any* cast.
-    if (monomorphic_target != dest_method) {
-      if (SharkPerformanceWarnings) {
-        warning("found monomorphic target, but inhibited cast:");
-        tty->print("  dest_method = ");
-        dest_method->print_short_name(tty);
-        tty->cr();
-        tty->print("  monomorphic_target = ");
-        monomorphic_target->print_short_name(tty);
-        tty->cr();
-      }
-      monomorphic_target = NULL;
-    }
-  }
-
-  // Replace the virtual call with a direct one.  This makes
-  // us dependent on that target method not getting overridden
-  // by dynamic class loading.
-  if (monomorphic_target != NULL) {
-    dependencies()->assert_unique_concrete_method(
-      actual_receiver, monomorphic_target);
-    return monomorphic_target;
-  }
-
-  // Because Opto distinguishes exact types from inexact ones
-  // it can perform a further optimization to replace calls
-  // with non-monomorphic targets if the receiver has an exact
-  // type.  We don't mark types this way, so we can't do this.
-
-#endif // SHARK_CAN_DEOPTIMIZE_ANYWHERE
-
-  return NULL;
-}
-
-Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) {
-  return builder()->CreateBitCast(
-    builder()->CreateInlineOop(method),
-    SharkType::methodOop_type(),
-    "callee");
-}
-
-Value *SharkTopLevelBlock::get_virtual_callee(SharkValue* receiver,
-                                              int vtable_index) {
-  Value *klass = builder()->CreateValueOfStructEntry(
-    receiver->jobject_value(),
-    in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::oop_type(),
-    "klass");
-
-  return builder()->CreateLoad(
-    builder()->CreateArrayAddress(
-      klass,
-      SharkType::methodOop_type(),
-      vtableEntry::size() * wordSize,
-      in_ByteSize(instanceKlass::vtable_start_offset() * wordSize),
-      LLVMValue::intptr_constant(vtable_index)),
-    "callee");
-}
-
-Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver,
-                                                ciMethod*   method) {
-  BasicBlock *loop       = function()->CreateBlock("loop");
-  BasicBlock *got_null   = function()->CreateBlock("got_null");
-  BasicBlock *not_null   = function()->CreateBlock("not_null");
-  BasicBlock *next       = function()->CreateBlock("next");
-  BasicBlock *got_entry  = function()->CreateBlock("got_entry");
-
-  // Locate the receiver's itable
-  Value *object_klass = builder()->CreateValueOfStructEntry(
-    receiver->jobject_value(), in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::oop_type(),
-    "object_klass");
-
-  Value *vtable_start = builder()->CreateAdd(
-    builder()->CreatePtrToInt(object_klass, SharkType::intptr_type()),
-    LLVMValue::intptr_constant(
-      instanceKlass::vtable_start_offset() * HeapWordSize),
-    "vtable_start");
-
-  Value *vtable_length = builder()->CreateValueOfStructEntry(
-    object_klass,
-    in_ByteSize(instanceKlass::vtable_length_offset() * HeapWordSize),
-    SharkType::jint_type(),
-    "vtable_length");
-  vtable_length =
-    builder()->CreateIntCast(vtable_length, SharkType::intptr_type(), false);
-
-  bool needs_aligning = HeapWordsPerLong > 1;
-  Value *itable_start = builder()->CreateAdd(
-    vtable_start,
-    builder()->CreateShl(
-      vtable_length,
-      LLVMValue::intptr_constant(exact_log2(vtableEntry::size() * wordSize))),
-    needs_aligning ? "" : "itable_start");
-  if (needs_aligning) {
-    itable_start = builder()->CreateAnd(
-      builder()->CreateAdd(
-        itable_start, LLVMValue::intptr_constant(BytesPerLong - 1)),
-      LLVMValue::intptr_constant(~(BytesPerLong - 1)),
-      "itable_start");
-  }
-
-  // Locate this interface's entry in the table
-  Value *iklass = builder()->CreateInlineOop(method->holder());
-  BasicBlock *loop_entry = builder()->GetInsertBlock();
-  builder()->CreateBr(loop);
-  builder()->SetInsertPoint(loop);
-  PHINode *itable_entry_addr = builder()->CreatePHI(
-    SharkType::intptr_type(), "itable_entry_addr");
-  itable_entry_addr->addIncoming(itable_start, loop_entry);
-
-  Value *itable_entry = builder()->CreateIntToPtr(
-    itable_entry_addr, SharkType::itableOffsetEntry_type(), "itable_entry");
-
-  Value *itable_iklass = builder()->CreateValueOfStructEntry(
-    itable_entry,
-    in_ByteSize(itableOffsetEntry::interface_offset_in_bytes()),
-    SharkType::oop_type(),
-    "itable_iklass");
-
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(itable_iklass, LLVMValue::null()),
-    got_null, not_null);
-
-  // A null entry means that the class doesn't implement the
-  // interface, and wasn't the same as the class checked when
-  // the interface was resolved.
-  builder()->SetInsertPoint(got_null);
-  builder()->CreateUnimplemented(__FILE__, __LINE__);
-  builder()->CreateUnreachable();
-
-  builder()->SetInsertPoint(not_null);
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(itable_iklass, iklass),
-    got_entry, next);
-
-  builder()->SetInsertPoint(next);
-  Value *next_entry = builder()->CreateAdd(
-    itable_entry_addr,
-    LLVMValue::intptr_constant(itableOffsetEntry::size() * wordSize));
-  builder()->CreateBr(loop);
-  itable_entry_addr->addIncoming(next_entry, next);
-
-  // Locate the method pointer
-  builder()->SetInsertPoint(got_entry);
-  Value *offset = builder()->CreateValueOfStructEntry(
-    itable_entry,
-    in_ByteSize(itableOffsetEntry::offset_offset_in_bytes()),
-    SharkType::jint_type(),
-    "offset");
-  offset =
-    builder()->CreateIntCast(offset, SharkType::intptr_type(), false);
-
-  return builder()->CreateLoad(
-    builder()->CreateIntToPtr(
-      builder()->CreateAdd(
-        builder()->CreateAdd(
-          builder()->CreateAdd(
-            builder()->CreatePtrToInt(
-              object_klass, SharkType::intptr_type()),
-            offset),
-          LLVMValue::intptr_constant(
-            method->itable_index() * itableMethodEntry::size() * wordSize)),
-        LLVMValue::intptr_constant(
-          itableMethodEntry::method_offset_in_bytes())),
-      PointerType::getUnqual(SharkType::methodOop_type())),
-    "callee");
-}
-
-void SharkTopLevelBlock::do_call() {
-  // Set frequently used booleans
-  bool is_static = bc() == Bytecodes::_invokestatic;
-  bool is_virtual = bc() == Bytecodes::_invokevirtual;
-  bool is_interface = bc() == Bytecodes::_invokeinterface;
-
-  // Find the method being called
-  bool will_link;
-  ciMethod *dest_method = iter()->get_method(will_link);
-  assert(will_link, "typeflow responsibility");
-  assert(dest_method->is_static() == is_static, "must match bc");
-
-  // Find the class of the method being called.  Note
-  // that the superclass check in the second assertion
-  // is to cope with a hole in the spec that allows for
-  // invokeinterface instructions where the resolved
-  // method is a virtual method in java.lang.Object.
-  // javac doesn't generate code like that, but there's
-  // no reason a compliant Java compiler might not.
-  ciInstanceKlass *holder_klass  = dest_method->holder();
-  assert(holder_klass->is_loaded(), "scan_for_traps responsibility");
-  assert(holder_klass->is_interface() ||
-         holder_klass->super() == NULL ||
-         !is_interface, "must match bc");
-  ciKlass *holder = iter()->get_declared_method_holder();
-  ciInstanceKlass *klass =
-    ciEnv::get_instance_klass_for_declared_method_holder(holder);
-
-  // Find the receiver in the stack.  We do this before
-  // trying to inline because the inliner can only use
-  // zero-checked values, not being able to perform the
-  // check itself.
-  SharkValue *receiver = NULL;
-  if (!is_static) {
-    receiver = xstack(dest_method->arg_size() - 1);
-    check_null(receiver);
-  }
-
-  // Try to improve non-direct calls
-  bool call_is_virtual = is_virtual || is_interface;
-  ciMethod *call_method = dest_method;
-  if (call_is_virtual) {
-    ciMethod *optimized_method = improve_virtual_call(
-      target(), klass, dest_method, receiver->type());
-    if (optimized_method) {
-      call_method = optimized_method;
-      call_is_virtual = false;
-    }
-  }
-
-  // Try to inline the call
-  if (!call_is_virtual) {
-    if (SharkInliner::attempt_inline(call_method, current_state()))
-      return;
-  }
-
-  // Find the method we are calling
-  Value *callee;
-  if (call_is_virtual) {
-    if (is_virtual) {
-      assert(klass->is_linked(), "scan_for_traps responsibility");
-      int vtable_index = call_method->resolve_vtable_index(
-        target()->holder(), klass);
-      assert(vtable_index >= 0, "should be");
-      callee = get_virtual_callee(receiver, vtable_index);
-    }
-    else {
-      assert(is_interface, "should be");
-      callee = get_interface_callee(receiver, call_method);
-    }
-  }
-  else {
-    callee = get_direct_callee(call_method);
-  }
-
-  // Load the SharkEntry from the callee
-  Value *base_pc = builder()->CreateValueOfStructEntry(
-    callee, methodOopDesc::from_interpreted_offset(),
-    SharkType::intptr_type(),
-    "base_pc");
-
-  // Load the entry point from the SharkEntry
-  Value *entry_point = builder()->CreateLoad(
-    builder()->CreateIntToPtr(
-      builder()->CreateAdd(
-        base_pc,
-        LLVMValue::intptr_constant(in_bytes(ZeroEntry::entry_point_offset()))),
-      PointerType::getUnqual(
-        PointerType::getUnqual(SharkType::entry_point_type()))),
-    "entry_point");
-
-  // Make the call
-  decache_for_Java_call(call_method);
-  Value *deoptimized_frames = builder()->CreateCall3(
-    entry_point, callee, base_pc, thread());
-
-  // If the callee got deoptimized then reexecute in the interpreter
-  BasicBlock *reexecute      = function()->CreateBlock("reexecute");
-  BasicBlock *call_completed = function()->CreateBlock("call_completed");
-  builder()->CreateCondBr(
-    builder()->CreateICmpNE(deoptimized_frames, LLVMValue::jint_constant(0)),
-    reexecute, call_completed);
-
-  builder()->SetInsertPoint(reexecute);
-  builder()->CreateCall2(
-    builder()->deoptimized_entry_point(),
-    builder()->CreateSub(deoptimized_frames, LLVMValue::jint_constant(1)),
-    thread());
-  builder()->CreateBr(call_completed);
-
-  // Cache after the call
-  builder()->SetInsertPoint(call_completed);
-  cache_after_Java_call(call_method);
-
-  // Check for pending exceptions
-  check_pending_exception(EX_CHECK_FULL);
-
-  // Mark that a safepoint check has occurred
-  current_state()->set_has_safepointed(true);
-}
-
-bool SharkTopLevelBlock::static_subtype_check(ciKlass* check_klass,
-                                              ciKlass* object_klass) {
-  // If the class we're checking against is java.lang.Object
-  // then this is a no brainer.  Apparently this can happen
-  // in reflective code...
-  if (check_klass == java_lang_Object_klass())
-    return true;
-
-  // Perform a subtype check.  NB in opto's code for this
-  // (GraphKit::static_subtype_check) it says that static
-  // interface types cannot be trusted, and if opto can't
-  // trust them then I assume we can't either.
-  if (object_klass->is_loaded() && !object_klass->is_interface()) {
-    if (object_klass == check_klass)
-      return true;
-
-    if (check_klass->is_loaded() && object_klass->is_subtype_of(check_klass))
-      return true;
-  }
-
-  return false;
-}
-
-void SharkTopLevelBlock::do_instance_check() {
-  // Get the class we're checking against
-  bool will_link;
-  ciKlass *check_klass = iter()->get_klass(will_link);
-
-  // Get the class of the object we're checking
-  ciKlass *object_klass = xstack(0)->type()->as_klass();
-
-  // Can we optimize this check away?
-  if (static_subtype_check(check_klass, object_klass)) {
-    if (bc() == Bytecodes::_instanceof) {
-      pop();
-      push(SharkValue::jint_constant(1));
-    }
-    return;
-  }
-
-  // Need to check this one at runtime
-  if (will_link)
-    do_full_instance_check(check_klass);
-  else
-    do_trapping_instance_check(check_klass);
-}
-
-bool SharkTopLevelBlock::maybe_do_instanceof_if() {
-  // Get the class we're checking against
-  bool will_link;
-  ciKlass *check_klass = iter()->get_klass(will_link);
-
-  // If the class is unloaded then the instanceof
-  // cannot possibly succeed.
-  if (!will_link)
-    return false;
-
-  // Keep a copy of the object we're checking
-  SharkValue *old_object = xstack(0);
-
-  // Get the class of the object we're checking
-  ciKlass *object_klass = old_object->type()->as_klass();
-
-  // If the instanceof can be optimized away at compile time
-  // then any subsequent checkcasts will be too so we handle
-  // it normally.
-  if (static_subtype_check(check_klass, object_klass))
-    return false;
-
-  // Perform the instance check
-  do_full_instance_check(check_klass);
-  Value *result = pop()->jint_value();
-
-  // Create the casted object
-  SharkValue *new_object = SharkValue::create_generic(
-    check_klass, old_object->jobject_value(), old_object->zero_checked());
-
-  // Create two copies of the current state, one with the
-  // original object and one with all instances of the
-  // original object replaced with the new, casted object.
-  SharkState *new_state = current_state();
-  SharkState *old_state = new_state->copy();
-  new_state->replace_all(old_object, new_object);
-
-  // Perform the check-and-branch
-  switch (iter()->next_bc()) {
-  case Bytecodes::_ifeq:
-    // branch if not an instance
-    do_if_helper(
-      ICmpInst::ICMP_EQ,
-      LLVMValue::jint_constant(0), result,
-      old_state, new_state);
-    break;
-
-  case Bytecodes::_ifne:
-    // branch if an instance
-    do_if_helper(
-      ICmpInst::ICMP_NE,
-      LLVMValue::jint_constant(0), result,
-      new_state, old_state);
-    break;
-
-  default:
-    ShouldNotReachHere();
-  }
-
-  return true;
-}
-
-void SharkTopLevelBlock::do_full_instance_check(ciKlass* klass) {
-  BasicBlock *not_null      = function()->CreateBlock("not_null");
-  BasicBlock *subtype_check = function()->CreateBlock("subtype_check");
-  BasicBlock *is_instance   = function()->CreateBlock("is_instance");
-  BasicBlock *not_instance  = function()->CreateBlock("not_instance");
-  BasicBlock *merge1        = function()->CreateBlock("merge1");
-  BasicBlock *merge2        = function()->CreateBlock("merge2");
-
-  enum InstanceCheckStates {
-    IC_IS_NULL,
-    IC_IS_INSTANCE,
-    IC_NOT_INSTANCE,
-  };
-
-  // Pop the object off the stack
-  Value *object = pop()->jobject_value();
-
-  // Null objects aren't instances of anything
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(object, LLVMValue::null()),
-    merge2, not_null);
-  BasicBlock *null_block = builder()->GetInsertBlock();
-
-  // Get the class we're checking against
-  builder()->SetInsertPoint(not_null);
-  Value *check_klass = builder()->CreateInlineOop(klass);
-
-  // Get the class of the object being tested
-  Value *object_klass = builder()->CreateValueOfStructEntry(
-    object, in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::oop_type(),
-    "object_klass");
-
-  // Perform the check
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(check_klass, object_klass),
-    is_instance, subtype_check);
-
-  builder()->SetInsertPoint(subtype_check);
-  builder()->CreateCondBr(
-    builder()->CreateICmpNE(
-      builder()->CreateCall2(
-        builder()->is_subtype_of(), check_klass, object_klass),
-      LLVMValue::jbyte_constant(0)),
-    is_instance, not_instance);
-
-  builder()->SetInsertPoint(is_instance);
-  builder()->CreateBr(merge1);
-
-  builder()->SetInsertPoint(not_instance);
-  builder()->CreateBr(merge1);
-
-  // First merge
-  builder()->SetInsertPoint(merge1);
-  PHINode *nonnull_result = builder()->CreatePHI(
-    SharkType::jint_type(), "nonnull_result");
-  nonnull_result->addIncoming(
-    LLVMValue::jint_constant(IC_IS_INSTANCE), is_instance);
-  nonnull_result->addIncoming(
-    LLVMValue::jint_constant(IC_NOT_INSTANCE), not_instance);
-  BasicBlock *nonnull_block = builder()->GetInsertBlock();
-  builder()->CreateBr(merge2);
-
-  // Second merge
-  builder()->SetInsertPoint(merge2);
-  PHINode *result = builder()->CreatePHI(
-    SharkType::jint_type(), "result");
-  result->addIncoming(LLVMValue::jint_constant(IC_IS_NULL), null_block);
-  result->addIncoming(nonnull_result, nonnull_block);
-
-  // Handle the result
-  if (bc() == Bytecodes::_checkcast) {
-    BasicBlock *failure = function()->CreateBlock("failure");
-    BasicBlock *success = function()->CreateBlock("success");
-
-    builder()->CreateCondBr(
-      builder()->CreateICmpNE(
-        result, LLVMValue::jint_constant(IC_NOT_INSTANCE)),
-      success, failure);
-
-    builder()->SetInsertPoint(failure);
-    SharkState *saved_state = current_state()->copy();
-
-    call_vm(
-      builder()->throw_ClassCastException(),
-      builder()->CreateIntToPtr(
-        LLVMValue::intptr_constant((intptr_t) __FILE__),
-        PointerType::getUnqual(SharkType::jbyte_type())),
-      LLVMValue::jint_constant(__LINE__),
-      EX_CHECK_NONE);
-
-    Value *pending_exception = get_pending_exception();
-    clear_pending_exception();
-    handle_exception(pending_exception, EX_CHECK_FULL);
-
-    set_current_state(saved_state);
-    builder()->SetInsertPoint(success);
-    push(SharkValue::create_generic(klass, object, false));
-  }
-  else {
-    push(
-      SharkValue::create_jint(
-        builder()->CreateIntCast(
-          builder()->CreateICmpEQ(
-            result, LLVMValue::jint_constant(IC_IS_INSTANCE)),
-          SharkType::jint_type(), false), false));
-  }
-}
-
-void SharkTopLevelBlock::do_trapping_instance_check(ciKlass* klass) {
-  BasicBlock *not_null = function()->CreateBlock("not_null");
-  BasicBlock *is_null  = function()->CreateBlock("null");
-
-  // Leave the object on the stack so it's there if we trap
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(xstack(0)->jobject_value(), LLVMValue::null()),
-    is_null, not_null);
-  SharkState *saved_state = current_state()->copy();
-
-  // If it's not null then we need to trap
-  builder()->SetInsertPoint(not_null);
-  set_current_state(saved_state->copy());
-  do_trap(
-    Deoptimization::make_trap_request(
-      Deoptimization::Reason_uninitialized,
-      Deoptimization::Action_reinterpret));
-
-  // If it's null then we're ok
-  builder()->SetInsertPoint(is_null);
-  set_current_state(saved_state);
-  if (bc() == Bytecodes::_checkcast) {
-    push(SharkValue::create_generic(klass, pop()->jobject_value(), false));
-  }
-  else {
-    pop();
-    push(SharkValue::jint_constant(0));
-  }
-}
-
-void SharkTopLevelBlock::do_new() {
-  bool will_link;
-  ciInstanceKlass* klass = iter()->get_klass(will_link)->as_instance_klass();
-  assert(will_link, "typeflow responsibility");
-
-  BasicBlock *got_tlab            = NULL;
-  BasicBlock *heap_alloc          = NULL;
-  BasicBlock *retry               = NULL;
-  BasicBlock *got_heap            = NULL;
-  BasicBlock *initialize          = NULL;
-  BasicBlock *got_fast            = NULL;
-  BasicBlock *slow_alloc_and_init = NULL;
-  BasicBlock *got_slow            = NULL;
-  BasicBlock *push_object         = NULL;
-
-  SharkState *fast_state = NULL;
-
-  Value *tlab_object = NULL;
-  Value *heap_object = NULL;
-  Value *fast_object = NULL;
-  Value *slow_object = NULL;
-  Value *object      = NULL;
-
-  // The fast path
-  if (!Klass::layout_helper_needs_slow_path(klass->layout_helper())) {
-    if (UseTLAB) {
-      got_tlab          = function()->CreateBlock("got_tlab");
-      heap_alloc        = function()->CreateBlock("heap_alloc");
-    }
-    retry               = function()->CreateBlock("retry");
-    got_heap            = function()->CreateBlock("got_heap");
-    initialize          = function()->CreateBlock("initialize");
-    slow_alloc_and_init = function()->CreateBlock("slow_alloc_and_init");
-    push_object         = function()->CreateBlock("push_object");
-
-    size_t size_in_bytes = klass->size_helper() << LogHeapWordSize;
-
-    // Thread local allocation
-    if (UseTLAB) {
-      Value *top_addr = builder()->CreateAddressOfStructEntry(
-        thread(), Thread::tlab_top_offset(),
-        PointerType::getUnqual(SharkType::intptr_type()),
-        "top_addr");
-
-      Value *end = builder()->CreateValueOfStructEntry(
-        thread(), Thread::tlab_end_offset(),
-        SharkType::intptr_type(),
-        "end");
-
-      Value *old_top = builder()->CreateLoad(top_addr, "old_top");
-      Value *new_top = builder()->CreateAdd(
-        old_top, LLVMValue::intptr_constant(size_in_bytes));
-
-      builder()->CreateCondBr(
-        builder()->CreateICmpULE(new_top, end),
-        got_tlab, heap_alloc);
-
-      builder()->SetInsertPoint(got_tlab);
-      tlab_object = builder()->CreateIntToPtr(
-        old_top, SharkType::oop_type(), "tlab_object");
-
-      builder()->CreateStore(new_top, top_addr);
-      builder()->CreateBr(initialize);
-
-      builder()->SetInsertPoint(heap_alloc);
-    }
-
-    // Heap allocation
-    Value *top_addr = builder()->CreateIntToPtr(
-        LLVMValue::intptr_constant((intptr_t) Universe::heap()->top_addr()),
-      PointerType::getUnqual(SharkType::intptr_type()),
-      "top_addr");
-
-    Value *end = builder()->CreateLoad(
-      builder()->CreateIntToPtr(
-        LLVMValue::intptr_constant((intptr_t) Universe::heap()->end_addr()),
-        PointerType::getUnqual(SharkType::intptr_type())),
-      "end");
-
-    builder()->CreateBr(retry);
-    builder()->SetInsertPoint(retry);
-
-    Value *old_top = builder()->CreateLoad(top_addr, "top");
-    Value *new_top = builder()->CreateAdd(
-      old_top, LLVMValue::intptr_constant(size_in_bytes));
-
-    builder()->CreateCondBr(
-      builder()->CreateICmpULE(new_top, end),
-      got_heap, slow_alloc_and_init);
-
-    builder()->SetInsertPoint(got_heap);
-    heap_object = builder()->CreateIntToPtr(
-      old_top, SharkType::oop_type(), "heap_object");
-
-    Value *check = builder()->CreateCmpxchgPtr(new_top, top_addr, old_top);
-    builder()->CreateCondBr(
-      builder()->CreateICmpEQ(old_top, check),
-      initialize, retry);
-
-    // Initialize the object
-    builder()->SetInsertPoint(initialize);
-    if (tlab_object) {
-      PHINode *phi = builder()->CreatePHI(
-        SharkType::oop_type(), "fast_object");
-      phi->addIncoming(tlab_object, got_tlab);
-      phi->addIncoming(heap_object, got_heap);
-      fast_object = phi;
-    }
-    else {
-      fast_object = heap_object;
-    }
-
-    builder()->CreateMemset(
-      builder()->CreateBitCast(
-        fast_object, PointerType::getUnqual(SharkType::jbyte_type())),
-      LLVMValue::jbyte_constant(0),
-      LLVMValue::jint_constant(size_in_bytes),
-      LLVMValue::jint_constant(HeapWordSize));
-
-    Value *mark_addr = builder()->CreateAddressOfStructEntry(
-      fast_object, in_ByteSize(oopDesc::mark_offset_in_bytes()),
-      PointerType::getUnqual(SharkType::intptr_type()),
-      "mark_addr");
-
-    Value *klass_addr = builder()->CreateAddressOfStructEntry(
-      fast_object, in_ByteSize(oopDesc::klass_offset_in_bytes()),
-      PointerType::getUnqual(SharkType::oop_type()),
-      "klass_addr");
-
-    // Set the mark
-    intptr_t mark;
-    if (UseBiasedLocking) {
-      Unimplemented();
-    }
-    else {
-      mark = (intptr_t) markOopDesc::prototype();
-    }
-    builder()->CreateStore(LLVMValue::intptr_constant(mark), mark_addr);
-
-    // Set the class
-    Value *rtklass = builder()->CreateInlineOop(klass);
-    builder()->CreateStore(rtklass, klass_addr);
-    got_fast = builder()->GetInsertBlock();
-
-    builder()->CreateBr(push_object);
-    builder()->SetInsertPoint(slow_alloc_and_init);
-    fast_state = current_state()->copy();
-  }
-
-  // The slow path
-  call_vm(
-    builder()->new_instance(),
-    LLVMValue::jint_constant(iter()->get_klass_index()),
-    EX_CHECK_FULL);
-  slow_object = get_vm_result();
-  got_slow = builder()->GetInsertBlock();
-
-  // Push the object
-  if (push_object) {
-    builder()->CreateBr(push_object);
-    builder()->SetInsertPoint(push_object);
-  }
-  if (fast_object) {
-    PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), "object");
-    phi->addIncoming(fast_object, got_fast);
-    phi->addIncoming(slow_object, got_slow);
-    object = phi;
-    current_state()->merge(fast_state, got_fast, got_slow);
-  }
-  else {
-    object = slow_object;
-  }
-
-  push(SharkValue::create_jobject(object, true));
-}
-
-void SharkTopLevelBlock::do_newarray() {
-  BasicType type = (BasicType) iter()->get_index();
-
-  call_vm(
-    builder()->newarray(),
-    LLVMValue::jint_constant(type),
-    pop()->jint_value(),
-    EX_CHECK_FULL);
-
-  ciArrayKlass *array_klass = ciArrayKlass::make(ciType::make(type));
-  push(SharkValue::create_generic(array_klass, get_vm_result(), true));
-}
-
-void SharkTopLevelBlock::do_anewarray() {
-  bool will_link;
-  ciKlass *klass = iter()->get_klass(will_link);
-  assert(will_link, "typeflow responsibility");
-
-  ciObjArrayKlass *array_klass = ciObjArrayKlass::make(klass);
-  if (!array_klass->is_loaded()) {
-    Unimplemented();
-  }
-
-  call_vm(
-    builder()->anewarray(),
-    LLVMValue::jint_constant(iter()->get_klass_index()),
-    pop()->jint_value(),
-    EX_CHECK_FULL);
-
-  push(SharkValue::create_generic(array_klass, get_vm_result(), true));
-}
-
-void SharkTopLevelBlock::do_multianewarray() {
-  bool will_link;
-  ciArrayKlass *array_klass = iter()->get_klass(will_link)->as_array_klass();
-  assert(will_link, "typeflow responsibility");
-
-  // The dimensions are stack values, so we use their slots for the
-  // dimensions array.  Note that we are storing them in the reverse
-  // of normal stack order.
-  int ndims = iter()->get_dimensions();
-
-  Value *dimensions = stack()->slot_addr(
-    stack()->stack_slots_offset() + max_stack() - xstack_depth(),
-    ArrayType::get(SharkType::jint_type(), ndims),
-    "dimensions");
-
-  for (int i = 0; i < ndims; i++) {
-    builder()->CreateStore(
-      xstack(ndims - 1 - i)->jint_value(),
-      builder()->CreateStructGEP(dimensions, i));
-  }
-
-  call_vm(
-    builder()->multianewarray(),
-    LLVMValue::jint_constant(iter()->get_klass_index()),
-    LLVMValue::jint_constant(ndims),
-    builder()->CreateStructGEP(dimensions, 0),
-    EX_CHECK_FULL);
-
-  // Now we can pop the dimensions off the stack
-  for (int i = 0; i < ndims; i++)
-    pop();
-
-  push(SharkValue::create_generic(array_klass, get_vm_result(), true));
-}
-
-void SharkTopLevelBlock::acquire_method_lock() {
-  Value *lockee;
-  if (target()->is_static())
-    lockee = builder()->CreateInlineOop(target()->holder()->java_mirror());
-  else
-    lockee = local(0)->jobject_value();
-
-  iter()->force_bci(start()); // for the decache in acquire_lock
-  acquire_lock(lockee, EX_CHECK_NO_CATCH);
-}
-
-void SharkTopLevelBlock::do_monitorenter() {
-  SharkValue *lockee = pop();
-  check_null(lockee);
-  acquire_lock(lockee->jobject_value(), EX_CHECK_FULL);
-}
-
-void SharkTopLevelBlock::do_monitorexit() {
-  pop(); // don't need this (monitors are block structured)
-  release_lock(EX_CHECK_NO_CATCH);
-}
-
-void SharkTopLevelBlock::acquire_lock(Value *lockee, int exception_action) {
-  BasicBlock *try_recursive = function()->CreateBlock("try_recursive");
-  BasicBlock *got_recursive = function()->CreateBlock("got_recursive");
-  BasicBlock *not_recursive = function()->CreateBlock("not_recursive");
-  BasicBlock *acquired_fast = function()->CreateBlock("acquired_fast");
-  BasicBlock *lock_acquired = function()->CreateBlock("lock_acquired");
-
-  int monitor = num_monitors();
-  Value *monitor_addr        = stack()->monitor_addr(monitor);
-  Value *monitor_object_addr = stack()->monitor_object_addr(monitor);
-  Value *monitor_header_addr = stack()->monitor_header_addr(monitor);
-
-  // Store the object and mark the slot as live
-  builder()->CreateStore(lockee, monitor_object_addr);
-  set_num_monitors(monitor + 1);
-
-  // Try a simple lock
-  Value *mark_addr = builder()->CreateAddressOfStructEntry(
-    lockee, in_ByteSize(oopDesc::mark_offset_in_bytes()),
-    PointerType::getUnqual(SharkType::intptr_type()),
-    "mark_addr");
-
-  Value *mark = builder()->CreateLoad(mark_addr, "mark");
-  Value *disp = builder()->CreateOr(
-    mark, LLVMValue::intptr_constant(markOopDesc::unlocked_value), "disp");
-  builder()->CreateStore(disp, monitor_header_addr);
-
-  Value *lock = builder()->CreatePtrToInt(
-    monitor_header_addr, SharkType::intptr_type());
-  Value *check = builder()->CreateCmpxchgPtr(lock, mark_addr, disp);
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(disp, check),
-    acquired_fast, try_recursive);
-
-  // Locking failed, but maybe this thread already owns it
-  builder()->SetInsertPoint(try_recursive);
-  Value *addr = builder()->CreateAnd(
-    disp,
-    LLVMValue::intptr_constant(~markOopDesc::lock_mask_in_place));
-
-  // NB we use the entire stack, but JavaThread::is_lock_owned()
-  // uses a more limited range.  I don't think it hurts though...
-  Value *stack_limit = builder()->CreateValueOfStructEntry(
-    thread(), Thread::stack_base_offset(),
-    SharkType::intptr_type(),
-    "stack_limit");
-
-  assert(sizeof(size_t) == sizeof(intptr_t), "should be");
-  Value *stack_size = builder()->CreateValueOfStructEntry(
-    thread(), Thread::stack_size_offset(),
-    SharkType::intptr_type(),
-    "stack_size");
-
-  Value *stack_start =
-    builder()->CreateSub(stack_limit, stack_size, "stack_start");
-
-  builder()->CreateCondBr(
-    builder()->CreateAnd(
-      builder()->CreateICmpUGE(addr, stack_start),
-      builder()->CreateICmpULT(addr, stack_limit)),
-    got_recursive, not_recursive);
-
-  builder()->SetInsertPoint(got_recursive);
-  builder()->CreateStore(LLVMValue::intptr_constant(0), monitor_header_addr);
-  builder()->CreateBr(acquired_fast);
-
-  // Create an edge for the state merge
-  builder()->SetInsertPoint(acquired_fast);
-  SharkState *fast_state = current_state()->copy();
-  builder()->CreateBr(lock_acquired);
-
-  // It's not a recursive case so we need to drop into the runtime
-  builder()->SetInsertPoint(not_recursive);
-  call_vm(
-    builder()->monitorenter(), monitor_addr,
-    exception_action | EAM_MONITOR_FUDGE);
-  BasicBlock *acquired_slow = builder()->GetInsertBlock();
-  builder()->CreateBr(lock_acquired);
-
-  // All done
-  builder()->SetInsertPoint(lock_acquired);
-  current_state()->merge(fast_state, acquired_fast, acquired_slow);
-}
-
-void SharkTopLevelBlock::release_lock(int exception_action) {
-  BasicBlock *not_recursive = function()->CreateBlock("not_recursive");
-  BasicBlock *released_fast = function()->CreateBlock("released_fast");
-  BasicBlock *slow_path     = function()->CreateBlock("slow_path");
-  BasicBlock *lock_released = function()->CreateBlock("lock_released");
-
-  int monitor = num_monitors() - 1;
-  Value *monitor_addr        = stack()->monitor_addr(monitor);
-  Value *monitor_object_addr = stack()->monitor_object_addr(monitor);
-  Value *monitor_header_addr = stack()->monitor_header_addr(monitor);
-
-  // If it is recursive then we're already done
-  Value *disp = builder()->CreateLoad(monitor_header_addr);
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(disp, LLVMValue::intptr_constant(0)),
-    released_fast, not_recursive);
-
-  // Try a simple unlock
-  builder()->SetInsertPoint(not_recursive);
-
-  Value *lock = builder()->CreatePtrToInt(
-    monitor_header_addr, SharkType::intptr_type());
-
-  Value *lockee = builder()->CreateLoad(monitor_object_addr);
-
-  Value *mark_addr = builder()->CreateAddressOfStructEntry(
-    lockee, in_ByteSize(oopDesc::mark_offset_in_bytes()),
-    PointerType::getUnqual(SharkType::intptr_type()),
-    "mark_addr");
-
-  Value *check = builder()->CreateCmpxchgPtr(disp, mark_addr, lock);
-  builder()->CreateCondBr(
-    builder()->CreateICmpEQ(lock, check),
-    released_fast, slow_path);
-
-  // Create an edge for the state merge
-  builder()->SetInsertPoint(released_fast);
-  SharkState *fast_state = current_state()->copy();
-  builder()->CreateBr(lock_released);
-
-  // Need to drop into the runtime to release this one
-  builder()->SetInsertPoint(slow_path);
-  call_vm(builder()->monitorexit(), monitor_addr, exception_action);
-  BasicBlock *released_slow = builder()->GetInsertBlock();
-  builder()->CreateBr(lock_released);
-
-  // All done
-  builder()->SetInsertPoint(lock_released);
-  current_state()->merge(fast_state, released_fast, released_slow);
-
-  // The object slot is now dead
-  set_num_monitors(monitor);
-}
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,430 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkTopLevelBlock : public SharkBlock {
- public:
-  SharkTopLevelBlock(SharkFunction* function, ciTypeFlow::Block* ciblock)
-    : SharkBlock(function),
-      _function(function),
-      _ciblock(ciblock),
-      _entered(false),
-      _has_trap(false),
-      _needs_phis(false),
-      _entry_state(NULL),
-      _entry_block(NULL) {}
-
- private:
-  SharkFunction*     _function;
-  ciTypeFlow::Block* _ciblock;
-
- public:
-  SharkFunction* function() const {
-    return _function;
-  }
-  ciTypeFlow::Block* ciblock() const {
-    return _ciblock;
-  }
-
-  // Function properties
- public:
-  SharkStack* stack() const {
-    return function()->stack();
-  }
-
-  // Typeflow properties
- public:
-  int index() const {
-    return ciblock()->pre_order();
-  }
-  bool is_backedge_copy() const {
-    return ciblock()->is_backedge_copy();
-  }
-  int stack_depth_at_entry() const {
-    return ciblock()->stack_size();
-  }
-  ciType* local_type_at_entry(int index) const {
-    return ciblock()->local_type_at(index);
-  }
-  ciType* stack_type_at_entry(int slot) const {
-    return ciblock()->stack_type_at(slot);
-  }
-  int start() const {
-    return ciblock()->start();
-  }
-  int limit() const {
-    return ciblock()->limit();
-  }
-  bool falls_through() const {
-    return ciblock()->control() == ciBlock::fall_through_bci;
-  }
-  int num_successors() const {
-    return ciblock()->successors()->length();
-  }
-  SharkTopLevelBlock* successor(int index) const {
-    return function()->block(ciblock()->successors()->at(index)->pre_order());
-  }
-  SharkTopLevelBlock* bci_successor(int bci) const;
-
-  // Exceptions
- private:
-  GrowableArray<ciExceptionHandler*>* _exc_handlers;
-  GrowableArray<SharkTopLevelBlock*>* _exceptions;
-
- private:
-  void compute_exceptions();
-
- private:
-  int num_exceptions() const {
-    return _exc_handlers->length();
-  }
-  ciExceptionHandler* exc_handler(int index) const {
-    return _exc_handlers->at(index);
-  }
-  SharkTopLevelBlock* exception(int index) const {
-    return _exceptions->at(index);
-  }
-
-  // Traps
- private:
-  bool _has_trap;
-  int  _trap_request;
-  int  _trap_bci;
-
-  void set_trap(int trap_request, int trap_bci) {
-    assert(!has_trap(), "shouldn't have");
-    _has_trap     = true;
-    _trap_request = trap_request;
-    _trap_bci     = trap_bci;
-  }
-
- private:
-  bool has_trap() {
-    return _has_trap;
-  }
-  int trap_request() {
-    assert(has_trap(), "should have");
-    return _trap_request;
-  }
-  int trap_bci() {
-    assert(has_trap(), "should have");
-    return _trap_bci;
-  }
-
- private:
-  void scan_for_traps();
-
- private:
-  bool static_field_ok_in_clinit(ciField* field);
-
-  // Entry state
- private:
-  bool _entered;
-  bool _needs_phis;
-
- public:
-  bool entered() const {
-    return _entered;
-  }
-  bool needs_phis() const {
-    return _needs_phis;
-  }
-
- private:
-  void enter(SharkTopLevelBlock* predecessor, bool is_exception);
-
- public:
-  void enter() {
-    enter(NULL, false);
-  }
-
- private:
-  SharkState* _entry_state;
-
- private:
-  SharkState* entry_state();
-
- private:
-  llvm::BasicBlock* _entry_block;
-
- public:
-  llvm::BasicBlock* entry_block() const {
-    return _entry_block;
-  }
-
- public:
-  void initialize();
-
- public:
-  void add_incoming(SharkState* incoming_state);
-
-  // Method
- public:
-  llvm::Value* method() {
-    return current_state()->method();
-  }
-
-  // Temporary oop storage
- public:
-  void set_oop_tmp(llvm::Value* value) {
-    assert(value, "value must be non-NULL (will be reset by get_oop_tmp)");
-    assert(!current_state()->oop_tmp(), "oop_tmp gets and sets must match");
-    current_state()->set_oop_tmp(value);
-  }
-  llvm::Value* get_oop_tmp() {
-    llvm::Value* value = current_state()->oop_tmp();
-    assert(value, "oop_tmp gets and sets must match");
-    current_state()->set_oop_tmp(NULL);
-    return value;
-  }
-
-  // Cache and decache
- private:
-  void decache_for_Java_call(ciMethod* callee);
-  void cache_after_Java_call(ciMethod* callee);
-  void decache_for_VM_call();
-  void cache_after_VM_call();
-  void decache_for_trap();
-
-  // Monitors
- private:
-  int num_monitors() {
-    return current_state()->num_monitors();
-  }
-  int set_num_monitors(int num_monitors) {
-    current_state()->set_num_monitors(num_monitors);
-  }
-
-  // Code generation
- public:
-  void emit_IR();
-
-  // Branch helpers
- private:
-  void do_branch(int successor_index);
-
-  // Zero checks
- private:
-  void do_zero_check(SharkValue* value);
-  void zero_check_value(SharkValue* value, llvm::BasicBlock* continue_block);
-
- public:
-  void do_deferred_zero_check(SharkValue*       value,
-                              int               bci,
-                              SharkState*       saved_state,
-                              llvm::BasicBlock* continue_block);
-  // Exceptions
- private:
-  llvm::Value* pending_exception_address() const {
-    return builder()->CreateAddressOfStructEntry(
-      thread(), Thread::pending_exception_offset(),
-      llvm::PointerType::getUnqual(SharkType::oop_type()),
-      "pending_exception_addr");
-  }
-  llvm::LoadInst* get_pending_exception() const {
-    return builder()->CreateLoad(
-      pending_exception_address(), "pending_exception");
-  }
-  void clear_pending_exception() const {
-    builder()->CreateStore(LLVMValue::null(), pending_exception_address());
-  }
- public:
-  enum ExceptionActionMask {
-    // The actual bitmasks that things test against
-    EAM_CHECK         = 1, // whether to check for pending exceptions
-    EAM_HANDLE        = 2, // whether to attempt to handle pending exceptions
-    EAM_MONITOR_FUDGE = 4, // whether the monitor count needs adjusting
-
-    // More convenient values for passing
-    EX_CHECK_NONE     = 0,
-    EX_CHECK_NO_CATCH = EAM_CHECK,
-    EX_CHECK_FULL     = EAM_CHECK | EAM_HANDLE
-  };
-  void check_pending_exception(int action);
-  void handle_exception(llvm::Value* exception, int action);
-  void marshal_exception_fast(int num_options);
-  void marshal_exception_slow(int num_options);
-  llvm::BasicBlock* handler_for_exception(int index);
-
-  // VM calls
- private:
-  llvm::CallInst* call_vm(llvm::Value*  callee,
-                          llvm::Value** args_start,
-                          llvm::Value** args_end,
-                          int           exception_action) {
-    decache_for_VM_call();
-    stack()->CreateSetLastJavaFrame();
-    llvm::CallInst *res = builder()->CreateCall(callee, args_start, args_end);
-    stack()->CreateResetLastJavaFrame();
-    cache_after_VM_call();
-    if (exception_action & EAM_CHECK) {
-      check_pending_exception(exception_action);
-      current_state()->set_has_safepointed(true);
-    }
-    return res;
-  }
-
- public:
-  llvm::CallInst* call_vm(llvm::Value* callee,
-                          int          exception_action) {
-    llvm::Value *args[] = {thread()};
-    return call_vm(callee, args, args + 1, exception_action);
-  }
-  llvm::CallInst* call_vm(llvm::Value* callee,
-                          llvm::Value* arg1,
-                          int          exception_action) {
-    llvm::Value *args[] = {thread(), arg1};
-    return call_vm(callee, args, args + 2, exception_action);
-  }
-  llvm::CallInst* call_vm(llvm::Value* callee,
-                          llvm::Value* arg1,
-                          llvm::Value* arg2,
-                          int          exception_action) {
-    llvm::Value *args[] = {thread(), arg1, arg2};
-    return call_vm(callee, args, args + 3, exception_action);
-  }
-  llvm::CallInst* call_vm(llvm::Value* callee,
-                          llvm::Value* arg1,
-                          llvm::Value* arg2,
-                          llvm::Value* arg3,
-                          int          exception_action) {
-    llvm::Value *args[] = {thread(), arg1, arg2, arg3};
-    return call_vm(callee, args, args + 4, exception_action);
-  }
-
-  // VM call oop return handling
- private:
-  llvm::LoadInst* get_vm_result() const {
-    llvm::Value *addr = builder()->CreateAddressOfStructEntry(
-      thread(), JavaThread::vm_result_offset(),
-      llvm::PointerType::getUnqual(SharkType::oop_type()),
-      "vm_result_addr");
-    llvm::LoadInst *result = builder()->CreateLoad(addr, "vm_result");
-    builder()->CreateStore(LLVMValue::null(), addr);
-    return result;
-  }
-
-  // Synchronization
- private:
-  void acquire_lock(llvm::Value* lockee, int exception_action);
-  void release_lock(int exception_action);
-
- public:
-  void acquire_method_lock();
-
-  // Bounds checks
- private:
-  void check_bounds(SharkValue* array, SharkValue* index);
-
-  // Safepoints
- private:
-  void maybe_add_safepoint();
-  void maybe_add_backedge_safepoint();
-
-  // Loop safepoint removal
- private:
-  bool _can_reach_visited;
-
-  bool can_reach(SharkTopLevelBlock* other);
-  bool can_reach_helper(SharkTopLevelBlock* other);
-
-  // Traps
- private:
-  llvm::BasicBlock* make_trap(int trap_bci, int trap_request);
-  void do_trap(int trap_request);
-
-  // Returns
- private:
-  void call_register_finalizer(llvm::Value* receiver);
-  void handle_return(BasicType type, llvm::Value* exception);
-
-  // arraylength
- private:
-  void do_arraylength();
-
-  // *aload and *astore
- private:
-  void do_aload(BasicType basic_type);
-  void do_astore(BasicType basic_type);
-
-  // *return and athrow
- private:
-  void do_return(BasicType type);
-  void do_athrow();
-
-  // goto*
- private:
-  void do_goto();
-
-  // jsr* and ret
- private:
-  void do_jsr();
-  void do_ret();
-
-  // if*
- private:
-  void do_if_helper(llvm::ICmpInst::Predicate p,
-                    llvm::Value*              b,
-                    llvm::Value*              a,
-                    SharkState*               if_taken_state,
-                    SharkState*               not_taken_state);
-  void do_if(llvm::ICmpInst::Predicate p, SharkValue* b, SharkValue* a);
-
-  // tableswitch and lookupswitch
- private:
-  void do_switch();
-
-  // invoke*
- private:
-  ciMethod* improve_virtual_call(ciMethod*        caller,
-                                 ciInstanceKlass* klass,
-                                 ciMethod*        dest_method,
-                                 ciType*          receiver_type);
-  llvm::Value* get_direct_callee(ciMethod* method);
-  llvm::Value* get_virtual_callee(SharkValue* receiver, int vtable_index);
-  llvm::Value* get_interface_callee(SharkValue* receiver, ciMethod* method);
-
-  void do_call();
-
-  // checkcast and instanceof
- private:
-  bool static_subtype_check(ciKlass* check_klass, ciKlass* object_klass);
-  void do_full_instance_check(ciKlass* klass);
-  void do_trapping_instance_check(ciKlass* klass);
-
-  void do_instance_check();
-  bool maybe_do_instanceof_if();
-
-  // new and *newarray
- private:
-  void do_new();
-  void do_newarray();
-  void do_anewarray();
-  void do_multianewarray();
-
-  // monitorenter and monitorexit
- private:
-  void do_monitorenter();
-  void do_monitorexit();
-};
--- a/ports/hotspot/src/share/vm/shark/sharkType.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-class SharkType : public AllStatic {
- private:
-  static SharkContext& context() {
-    return SharkContext::current();
-  }
-
-  // Basic types
- public:
-  static const llvm::Type* void_type() {
-    return context().void_type();
-  }
-  static const llvm::IntegerType* bit_type() {
-    return context().bit_type();
-  }
-  static const llvm::IntegerType* jbyte_type() {
-    return context().jbyte_type();
-  }
-  static const llvm::IntegerType* jshort_type() {
-    return context().jshort_type();
-  }
-  static const llvm::IntegerType* jint_type() {
-    return context().jint_type();
-  }
-  static const llvm::IntegerType* jlong_type() {
-    return context().jlong_type();
-  }
-  static const llvm::Type* jfloat_type() {
-    return context().jfloat_type();
-  }
-  static const llvm::Type* jdouble_type() {
-    return context().jdouble_type();
-  }
-  static const llvm::IntegerType* intptr_type() {
-    return context().intptr_type();
-  }
-
-  // Compound types
- public:
-  static const llvm::PointerType* itableOffsetEntry_type() {
-    return context().itableOffsetEntry_type();
-  }
-  static const llvm::PointerType* jniEnv_type() {
-    return context().jniEnv_type();
-  }
-  static const llvm::PointerType* jniHandleBlock_type() {
-    return context().jniHandleBlock_type();
-  }
-  static const llvm::PointerType* klass_type() {
-    return context().klass_type();
-  }
-  static const llvm::PointerType* methodOop_type() {
-    return context().methodOop_type();
-  }
-  static const llvm::ArrayType* monitor_type() {
-    return context().monitor_type();
-  }
-  static const llvm::PointerType* oop_type() {
-    return context().oop_type();
-  }
-  static const llvm::PointerType* thread_type() {
-    return context().thread_type();
-  }
-  static const llvm::PointerType* zeroStack_type() {
-    return context().zeroStack_type();
-  }
-  static const llvm::FunctionType* entry_point_type() {
-    return context().entry_point_type();
-  }
-  static const llvm::FunctionType* osr_entry_point_type() {
-    return context().osr_entry_point_type();
-  }
-
-  // Mappings
- public:
-  static const llvm::Type* to_stackType(BasicType type) {
-    return context().to_stackType(type);
-  }
-  static const llvm::Type* to_stackType(ciType* type) {
-    return to_stackType(type->basic_type());
-  }
-  static const llvm::Type* to_arrayType(BasicType type) {
-    return context().to_arrayType(type);
-  }
-  static const llvm::Type* to_arrayType(ciType* type) {
-    return to_arrayType(type->basic_type());
-  }
-};
--- a/ports/hotspot/src/share/vm/shark/sharkValue.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_sharkValue.cpp.incl"
-
-using namespace llvm;
-
-// Cloning
-
-SharkValue* SharkNormalValue::clone() const {
-  return SharkValue::create_generic(type(), generic_value(), zero_checked());
-}
-SharkValue* SharkPHIValue::clone() const {
-  return SharkValue::create_phi(type(), (PHINode *) generic_value(), this);
-}
-SharkValue* SharkAddressValue::clone() const {
-  return SharkValue::address_constant(address_value());
-}
-
-// Casting
-
-bool SharkValue::is_phi() const {
-  return false;
-}
-bool SharkPHIValue::is_phi() const {
-  return true;
-}
-SharkPHIValue* SharkValue::as_phi() {
-  ShouldNotCallThis();
-}
-SharkPHIValue* SharkPHIValue::as_phi() {
-  return this;
-}
-
-// Comparison
-
-bool SharkNormalValue::equal_to(SharkValue *other) const {
-  return (this->type()          == other->type() &&
-          this->generic_value() == other->generic_value() &&
-          this->zero_checked()  == other->zero_checked());
-}
-bool SharkAddressValue::equal_to(SharkValue *other) const {
-  return (this->address_value() == other->address_value());
-}
-
-// Type access
-
-ciType* SharkValue::type() const {
-  ShouldNotCallThis();
-}
-ciType* SharkNormalValue::type() const {
-  return _type;
-}
-
-BasicType SharkNormalValue::basic_type() const {
-  return type()->basic_type();
-}
-BasicType SharkAddressValue::basic_type() const {
-  return T_ADDRESS;
-}
-
-int SharkNormalValue::size() const {
-  return type()->size();
-}
-int SharkAddressValue::size() const {
-  return 1;
-}
-
-bool SharkValue::is_jint() const {
-  return false;
-}
-bool SharkValue::is_jlong() const {
-  return false;
-}
-bool SharkValue::is_jfloat() const {
-  return false;
-}
-bool SharkValue::is_jdouble() const {
-  return false;
-}
-bool SharkValue::is_jobject() const {
-  return false;
-}
-bool SharkValue::is_jarray() const {
-  return false;
-}
-bool SharkValue::is_address() const {
-  return false;
-}
-
-bool SharkNormalValue::is_jint() const {
-  return llvm_value()->getType() == SharkType::jint_type();
-}
-bool SharkNormalValue::is_jlong() const {
-  return llvm_value()->getType() == SharkType::jlong_type();
-}
-bool SharkNormalValue::is_jfloat() const {
-  return llvm_value()->getType() == SharkType::jfloat_type();
-}
-bool SharkNormalValue::is_jdouble() const {
-  return llvm_value()->getType() == SharkType::jdouble_type();
-}
-bool SharkNormalValue::is_jobject() const {
-  return llvm_value()->getType() == SharkType::oop_type();
-}
-bool SharkNormalValue::is_jarray() const {
-  return basic_type() == T_ARRAY;
-}
-bool SharkAddressValue::is_address() const {
-  return true;
-}
-
-// Typed conversions from SharkValues
-
-Value* SharkValue::jint_value() const {
-  ShouldNotCallThis();
-}
-Value* SharkValue::jlong_value() const {
-  ShouldNotCallThis();
-}
-Value* SharkValue::jfloat_value() const {
-  ShouldNotCallThis();
-}
-Value* SharkValue::jdouble_value() const {
-  ShouldNotCallThis();
-}
-Value* SharkValue::jobject_value() const {
-  ShouldNotCallThis();
-}
-Value* SharkValue::jarray_value() const {
-  ShouldNotCallThis();
-}
-int SharkValue::address_value() const {
-  ShouldNotCallThis();
-}
-
-Value* SharkNormalValue::jint_value() const {
-  assert(is_jint(), "should be");
-  return llvm_value();
-}
-Value* SharkNormalValue::jlong_value() const {
-  assert(is_jlong(), "should be");
-  return llvm_value();
-}
-Value* SharkNormalValue::jfloat_value() const {
-  assert(is_jfloat(), "should be");
-  return llvm_value();
-}
-Value* SharkNormalValue::jdouble_value() const {
-  assert(is_jdouble(), "should be");
-  return llvm_value();
-}
-Value* SharkNormalValue::jobject_value() const {
-  assert(is_jobject(), "should be");
-  return llvm_value();
-}
-Value* SharkNormalValue::jarray_value() const {
-  // XXX assert(is_jarray(), "should be");
-  // XXX http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=324
-  assert(is_jobject(), "should be");
-  return llvm_value();
-}
-int SharkAddressValue::address_value() const {
-  return _bci;
-}
-
-// Type-losing conversions -- use with care!
-
-Value* SharkNormalValue::generic_value() const {
-  return llvm_value();
-}
-Value* SharkAddressValue::generic_value() const {
-  return LLVMValue::intptr_constant(address_value());
-}
-
-Value* SharkValue::intptr_value(SharkBuilder* builder) const {
-  ShouldNotCallThis();
-}
-Value* SharkNormalValue::intptr_value(SharkBuilder* builder) const {
-  return builder->CreatePtrToInt(jobject_value(), SharkType::intptr_type());
-}
-
-// Phi-style stuff for SharkPHIState::add_incoming
-
-void SharkValue::addIncoming(SharkValue *value, BasicBlock* block) {
-  ShouldNotCallThis();
-}
-void SharkPHIValue::addIncoming(SharkValue *value, BasicBlock* block) {
-  assert(!is_clone(), "shouldn't be");
-  ((llvm::PHINode *) generic_value())->addIncoming(
-      value->generic_value(), block);
-  if (!value->zero_checked())
-    _all_incomers_zero_checked = false;
-}
-void SharkAddressValue::addIncoming(SharkValue *value, BasicBlock* block) {
-  assert(this->equal_to(value), "should be");
-}
-
-// Phi-style stuff for SharkState::merge
-
-SharkValue* SharkNormalValue::merge(SharkBuilder* builder,
-                                    SharkValue*   other,
-                                    BasicBlock*   other_block,
-                                    BasicBlock*   this_block,
-                                    const char*   name) {
-  assert(type() == other->type(), "should be");
-  assert(zero_checked() == other->zero_checked(), "should be");
-
-  PHINode *phi = builder->CreatePHI(SharkType::to_stackType(type()), name);
-  phi->addIncoming(this->generic_value(), this_block);
-  phi->addIncoming(other->generic_value(), other_block);
-  return SharkValue::create_generic(type(), phi, zero_checked());
-}
-SharkValue* SharkAddressValue::merge(SharkBuilder* builder,
-                                     SharkValue*   other,
-                                     BasicBlock*   other_block,
-                                     BasicBlock*   this_block,
-                                     const char*   name) {
-  assert(this->equal_to(other), "should be");
-  return this;
-}
-
-// Repeated null and divide-by-zero check removal
-
-bool SharkValue::zero_checked() const {
-  ShouldNotCallThis();
-}
-void SharkValue::set_zero_checked(bool zero_checked) {
-  ShouldNotCallThis();
-}
-
-bool SharkNormalValue::zero_checked() const {
-  return _zero_checked;
-}
-void SharkNormalValue::set_zero_checked(bool zero_checked) {
-  _zero_checked = zero_checked;
-}
--- a/ports/hotspot/src/share/vm/shark/sharkValue.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,332 +0,0 @@
-/*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-// Items on the stack and in local variables are tracked using
-// SharkValue objects.
-//
-// All SharkValues are one of two core types, SharkNormalValue
-// and SharkAddressValue, but no code outside this file should
-// ever refer to those directly.  The split is because of the
-// way JSRs are handled: the typeflow pass expands them into
-// multiple copies, so the return addresses pushed by jsr and
-// popped by ret only exist at compile time.  Having separate
-// classes for these allows us to check that our jsr handling
-// is correct, via assertions.
-//
-// There is one more type, SharkPHIValue, which is a subclass
-// of SharkNormalValue with a couple of extra methods.  Use of
-// SharkPHIValue outside of this file is acceptable, so long
-// as it is obtained via SharkValue::as_phi().
-
-class SharkBuilder;
-class SharkPHIValue;
-
-class SharkValue : public ResourceObj {
- protected:
-  SharkValue() {}
-
-  // Cloning
- public:
-  virtual SharkValue* clone() const = 0;
-
-  // Casting
- public:
-  virtual bool           is_phi() const;
-  virtual SharkPHIValue* as_phi();
-
-  // Comparison
- public:
-  virtual bool equal_to(SharkValue* other) const = 0;
-
-  // Type access
- public:
-  virtual BasicType basic_type() const = 0;
-  virtual ciType*   type()       const;
-
-  virtual bool is_jint()    const;
-  virtual bool is_jlong()   const;
-  virtual bool is_jfloat()  const;
-  virtual bool is_jdouble() const;
-  virtual bool is_jobject() const;
-  virtual bool is_jarray()  const;
-  virtual bool is_address() const;
-
-  virtual int size() const = 0;
-
-  bool is_one_word() const {
-    return size() == 1;
-  }
-  bool is_two_word() const {
-    return size() == 2;
-  }
-
-  // Typed conversion from SharkValues
- public:
-  virtual llvm::Value* jint_value()    const;
-  virtual llvm::Value* jlong_value()   const;
-  virtual llvm::Value* jfloat_value()  const;
-  virtual llvm::Value* jdouble_value() const;
-  virtual llvm::Value* jobject_value() const;
-  virtual llvm::Value* jarray_value()  const;
-  virtual int          address_value() const;
-
-  // Typed conversion to SharkValues
- public:
-  static SharkValue* create_jint(llvm::Value* value, bool zero_checked) {
-    assert(value->getType() == SharkType::jint_type(), "should be");
-    return create_generic(ciType::make(T_INT), value, zero_checked);
-  }
-  static SharkValue* create_jlong(llvm::Value* value, bool zero_checked) {
-    assert(value->getType() == SharkType::jlong_type(), "should be");
-    return create_generic(ciType::make(T_LONG), value, zero_checked);
-  }
-  static SharkValue* create_jfloat(llvm::Value* value) {
-    assert(value->getType() == SharkType::jfloat_type(), "should be");
-    return create_generic(ciType::make(T_FLOAT), value, false);
-  }
-  static SharkValue* create_jdouble(llvm::Value* value) {
-    assert(value->getType() == SharkType::jdouble_type(), "should be");
-    return create_generic(ciType::make(T_DOUBLE), value, false);
-  }
-  static SharkValue* create_jobject(llvm::Value* value, bool zero_checked) {
-    assert(value->getType() == SharkType::oop_type(), "should be");
-    return create_generic(ciType::make(T_OBJECT), value, zero_checked);
-  }
-
-  // Typed conversion from constants of various types
- public:
-  static SharkValue* jint_constant(jint value) {
-    return create_jint(LLVMValue::jint_constant(value), value != 0);
-  }
-  static SharkValue* jlong_constant(jlong value) {
-    return create_jlong(LLVMValue::jlong_constant(value), value != 0);
-  }
-  static SharkValue* jfloat_constant(jfloat value) {
-    return create_jfloat(LLVMValue::jfloat_constant(value));
-  }
-  static SharkValue* jdouble_constant(jdouble value) {
-    return create_jdouble(LLVMValue::jdouble_constant(value));
-  }
-  static SharkValue* null() {
-    return create_jobject(LLVMValue::null(), false);
-  }
-  static inline SharkValue* address_constant(int bci);
-
-  // Type-losing conversions -- use with care!
- public:
-  virtual llvm::Value* generic_value() const = 0;
-  virtual llvm::Value* intptr_value(SharkBuilder* builder) const;
-
-  static inline SharkValue* create_generic(ciType*      type,
-                                           llvm::Value* value,
-                                           bool         zero_checked);
-  static inline SharkValue* create_phi(ciType*              type,
-                                       llvm::PHINode*       phi,
-                                       const SharkPHIValue* parent = NULL);
-
-  // Phi-style stuff
- public:
-  virtual void addIncoming(SharkValue* value, llvm::BasicBlock* block);
-  virtual SharkValue* merge(SharkBuilder*     builder,
-                            SharkValue*       other,
-                            llvm::BasicBlock* other_block,
-                            llvm::BasicBlock* this_block,
-                            const char*       name) = 0;
-
-  // Repeated null and divide-by-zero check removal
- public:
-  virtual bool zero_checked() const;
-  virtual void set_zero_checked(bool zero_checked);
-};
-
-class SharkNormalValue : public SharkValue {
-  friend class SharkValue;
-
- protected:
-  SharkNormalValue(ciType* type, llvm::Value* value, bool zero_checked)
-    : _type(type), _llvm_value(value), _zero_checked(zero_checked) {}
-
- private:
-  ciType*      _type;
-  llvm::Value* _llvm_value;
-  bool         _zero_checked;
-
- private:
-  llvm::Value* llvm_value() const {
-    return _llvm_value;
-  }
-
-  // Cloning
- public:
-  SharkValue* clone() const;
-
-  // Comparison
- public:
-  bool equal_to(SharkValue* other) const;
-
-  // Type access
- public:
-  ciType*   type()       const;
-  BasicType basic_type() const;
-  int       size()       const;
-
- public:
-  bool is_jint()    const;
-  bool is_jlong()   const;
-  bool is_jfloat()  const;
-  bool is_jdouble() const;
-  bool is_jobject() const;
-  bool is_jarray()  const;
-
-  // Typed conversions to LLVM values
- public:
-  llvm::Value* jint_value()    const;
-  llvm::Value* jlong_value()   const;
-  llvm::Value* jfloat_value()  const;
-  llvm::Value* jdouble_value() const;
-  llvm::Value* jobject_value() const;
-  llvm::Value* jarray_value()  const;
-
-  // Type-losing conversions, use with care
- public:
-  llvm::Value* generic_value() const;
-  llvm::Value* intptr_value(SharkBuilder* builder) const;
-
-  // Phi-style stuff
- public:
-  SharkValue* merge(SharkBuilder*     builder,
-                    SharkValue*       other,
-                    llvm::BasicBlock* other_block,
-                    llvm::BasicBlock* this_block,
-                    const char*       name);
-
-  // Repeated null and divide-by-zero check removal
- public:
-  bool zero_checked() const;
-  void set_zero_checked(bool zero_checked);
-};
-
-class SharkPHIValue : public SharkNormalValue {
-  friend class SharkValue;
-
- protected:
-  SharkPHIValue(ciType* type, llvm::PHINode* phi, const SharkPHIValue *parent)
-    : SharkNormalValue(type, phi, parent && parent->zero_checked()),
-      _parent(parent),
-      _all_incomers_zero_checked(true) {}
-
- private:
-  const SharkPHIValue* _parent;
-  bool                 _all_incomers_zero_checked;
-
- private:
-  const SharkPHIValue* parent() const {
-    return _parent;
-  }
-  bool is_clone() const {
-    return parent() != NULL;
-  }
-
- public:
-  bool all_incomers_zero_checked() const {
-    if (is_clone())
-      return parent()->all_incomers_zero_checked();
-
-    return _all_incomers_zero_checked;
-  }
-
-  // Cloning
- public:
-  SharkValue* clone() const;
-
-  // Casting
- public:
-  bool           is_phi() const;
-  SharkPHIValue* as_phi();
-
-  // Phi-style stuff
- public:
-  void addIncoming(SharkValue *value, llvm::BasicBlock* block);
-};
-
-class SharkAddressValue : public SharkValue {
-  friend class SharkValue;
-
- protected:
-  SharkAddressValue(int bci)
-    : _bci(bci) {}
-
- private:
-  int _bci;
-
-  // Cloning
- public:
-  SharkValue* clone() const;
-
-  // Comparison
- public:
-  bool equal_to(SharkValue* other) const;
-
-  // Type access
- public:
-  BasicType basic_type() const;
-  int       size()       const;
-  bool      is_address() const;
-
-  // Typed conversion from SharkValues
- public:
-  int address_value() const;
-
-  // Type-losing conversion -- use with care!
- public:
-  llvm::Value* generic_value() const;
-
-  // Phi-style stuff
- public:
-  void addIncoming(SharkValue *value, llvm::BasicBlock* block);
-  SharkValue* merge(SharkBuilder*     builder,
-                    SharkValue*       other,
-                    llvm::BasicBlock* other_block,
-                    llvm::BasicBlock* this_block,
-                    const char*       name);
-};
-
-// SharkValue methods that can't be declared above
-
-inline SharkValue* SharkValue::create_generic(ciType*      type,
-                                              llvm::Value* value,
-                                              bool         zero_checked) {
-  return new SharkNormalValue(type, value, zero_checked);
-}
-
-inline SharkValue* SharkValue::create_phi(ciType*              type,
-                                          llvm::PHINode*       phi,
-                                          const SharkPHIValue* parent) {
-  return new SharkPHIValue(type, phi, parent);
-}
-
-inline SharkValue* SharkValue::address_constant(int bci) {
-  return new SharkAddressValue(bci);
-}
--- a/ports/hotspot/src/share/vm/shark/shark_globals.cpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include "incls/_precompiled.incl"
-#include "incls/_shark_globals.cpp.incl"
-
-SHARK_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
--- a/ports/hotspot/src/share/vm/shark/shark_globals.hpp	Thu Aug 05 14:12:08 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009, 2010 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#define SHARK_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
-                                                                              \
-  product(intx, MaxNodeLimit, 65000,                                          \
-          "Maximum number of nodes")                                          \
-                                                                              \
-  /* inlining */                                                              \
-  product(intx, SharkMaxInlineSize, 32,                                       \
-          "Maximum bytecode size of methods to inline when using Shark")      \
-                                                                              \
-  /* compiler debugging */                                                    \
-  develop(ccstr, SharkPrintTypeflowOf, NULL,                                  \
-          "Print the typeflow of the specified method")                       \
-                                                                              \
-  diagnostic(ccstr, SharkPrintBitcodeOf, NULL,                                \
-          "Print the LLVM bitcode of the specified method")                   \
-                                                                              \
-  diagnostic(ccstr, SharkPrintAsmOf, NULL,                                    \
-          "Print the asm of the specified method")                            \
-                                                                              \
-  develop(bool, SharkTraceBytecodes, false,                                   \
-          "Trace bytecode compilation")                                       \
-                                                                              \
-  diagnostic(bool, SharkTraceInstalls, false,                                 \
-          "Trace method installation")                                        \
-                                                                              \
-  diagnostic(bool, SharkPerformanceWarnings, false,                           \
-          "Warn about things that could be made faster")                      \
-
-SHARK_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)