changeset 1702:6cb729c4a876

Make the normal (non-Zero/Shark) HotSpot original build work. 2010-03-10 Andrew John Hughes <ahughes@redhat.com> Fix the normal (non-Zero/Shark) build with the original HotSpot. * Makefile.am: Move format-warnings, fortify-source, 6791168 and includedb patch to set applied to all HotSpots. Add bytecodeInterpreter XSL fix back for original HotSpot. * patches/hotspot/default/icedtea-explicit-target-arch.patch: Move HotSpot chunk to separate hs14-specific file. * patches/hotspot/original/icedtea-6791168.patch, * patches/hotspot/original/icedtea-explicit-target-arch.patch, * patches/hotspot/original/icedtea-includedb.patch: New variants for original HotSpot (hs11). * patches/hotspot/original/icedtea-shark.patch: Fixed to apply to original HotSpot. * patches/icedtea-bytecodeInterpreterWithChecks.patch: Readded, reverting part of Gary's patch of 2009-05-08. * patches/icedtea-explicit-target-arch.patch: Remove HotSpot chunk and specialise it in HotSpot subdirectories.
author Andrew John Hughes <ahughes@redhat.com>
date Thu, 11 Mar 2010 22:57:54 +0000
parents 7dc4eeee5f69
children b12e1a83a817
files ChangeLog Makefile.am patches/hotspot/default/icedtea-explicit-target-arch.patch patches/hotspot/original/icedtea-6791168.patch patches/hotspot/original/icedtea-explicit-target-arch.patch patches/hotspot/original/icedtea-includedb.patch patches/hotspot/original/icedtea-shark.patch patches/icedtea-bytecodeInterpreterWithChecks.patch patches/icedtea-explicit-target-arch.patch
diffstat 9 files changed, 674 insertions(+), 334 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Mar 11 12:20:10 2010 +0000
+++ b/ChangeLog	Thu Mar 11 22:57:54 2010 +0000
@@ -1,3 +1,25 @@
+2010-03-10  Andrew John Hughes  <ahughes@redhat.com>
+
+	Fix the normal (non-Zero/Shark) build with
+	the original HotSpot.
+	* Makefile.am:
+	Move format-warnings, fortify-source, 6791168 and includedb
+	patch to set applied to all HotSpots.  Add
+	bytecodeInterpreter XSL fix back for original HotSpot.
+	* patches/hotspot/default/icedtea-explicit-target-arch.patch:
+	Move HotSpot chunk to separate hs14-specific file.
+	* patches/hotspot/original/icedtea-6791168.patch,
+	* patches/hotspot/original/icedtea-explicit-target-arch.patch,
+	* patches/hotspot/original/icedtea-includedb.patch:
+	New variants for original HotSpot (hs11).
+	* patches/hotspot/original/icedtea-shark.patch:
+	Fixed to apply to original HotSpot.
+	* patches/icedtea-bytecodeInterpreterWithChecks.patch:
+	Readded, reverting part of Gary's patch of 2009-05-08.
+	* patches/icedtea-explicit-target-arch.patch:
+	Remove HotSpot chunk and specialise it in HotSpot
+	subdirectories.
+
 2010-03-11  Gary Benson  <gbenson@redhat.com>
 
 	* ports/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
@@ -17,7 +39,7 @@
 
 	* NEWS:
 	Add missing dates.
-	
+
 2010-01-15  Andrew John Hughes  <ahughes@redhat.com>
 
 	* acinclude.m4,
--- a/Makefile.am	Thu Mar 11 12:20:10 2010 +0000
+++ b/Makefile.am	Thu Mar 11 22:57:54 2010 +0000
@@ -645,21 +645,22 @@
 	patches/icedtea-jar-misc.patch \
 	patches/icedtea-6897844-xshm.patch \
 	patches/icedtea-linux-separate-debuginfo.patch \
-	patches/openjdk/6822370-reentrantreadwritelock.patch
+	patches/openjdk/6822370-reentrantreadwritelock.patch \
+	patches/icedtea-format-warnings.patch \
+	patches/icedtea-fortify-source.patch \
+	patches/hotspot/$(HSBUILD)/icedtea-6791168.patch \
+	patches/hotspot/$(HSBUILD)/icedtea-includedb.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
-	patches/icedtea-format-warnings.patch \
-	patches/icedtea-fortify-source.patch \
 	patches/hotspot/$(HSBUILD)/icedtea-sparc-buildfixes.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-6791168.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-includedb.patch \
 	patches/hotspot/$(HSBUILD)/icedtea-ignore-unrecognized-options.patch
 endif
 
 if !WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
-	patches/icedtea-sparc.patch
+	patches/icedtea-sparc.patch \
+	patches/icedtea-bytecodeInterpreterWithChecks.patch
 endif
 
 ICEDTEA_PATCHES += \
@@ -725,6 +726,7 @@
 	patches/icedtea-java2d-stroker-internal-close-joint.patch \
 	patches/icedtea-disable-cc-incompatible-sanity-checks.patch \
 	patches/icedtea-explicit-target-arch.patch \
+	patches/hotspot/$(HSBUILD)/icedtea-explicit-target-arch.patch \
 	patches/openjdk/6648816.patch \
 	patches/openjdk/oj100103-debugger-socket-overflow.patch \
 	$(DISTRIBUTION_PATCHES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/icedtea-explicit-target-arch.patch	Thu Mar 11 22:57:54 2010 +0000
@@ -0,0 +1,17 @@
+Index: openjdk/hotspot/make/linux/makefiles/defs.make
+===================================================================
+--- openjdk.orig/hotspot/make/linux/makefiles/defs.make	2009-05-18 14:09:57.812930043 +0200
++++ openjdk/hotspot/make/linux/makefiles/defs.make	2009-05-18 14:30:46.318871170 +0200
+@@ -29,7 +29,11 @@
+ SLASH_JAVA ?= /java
+ 
+ # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
+-ARCH:=$(shell uname -m)
++ifndef CROSS_COMPILATION
++  ARCH:=$(shell uname -m)
++else
++  ARCH:=$(CROSS_TARGET_ARCH)
++endif
+ PATH_SEP = :
+ ifeq ($(LP64), 1)
+   ARCH_DATA_MODEL ?= 64
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/original/icedtea-6791168.patch	Thu Mar 11 22:57:54 2010 +0000
@@ -0,0 +1,189 @@
+diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp openjdk/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp
+--- openjdk.orig/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp	2009-04-24 08:30:53.000000000 +0100
++++ openjdk/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp	2010-03-11 18:15:32.000000000 +0000
+@@ -3612,29 +3612,32 @@
+ 
+   Label slow_case, done;
+ 
+-  // x ?<= pi/4
+-  fld_d(ExternalAddress((address)&pi_4));
+-  fld_s(1);                // Stack:  X  PI/4  X
+-  fabs();                  // Stack: |X| PI/4  X
+-  fcmp(tmp);
+-  jcc(Assembler::above, slow_case);
+-    
+-  // fastest case: -pi/4 <= x <= pi/4
+-  switch(trig) {
+-  case 's':
+-    fsin();
+-    break;
+-  case 'c':
+-    fcos();
+-    break;
+-  case 't':
+-    ftan();
+-    break;
+-  default:
+-    assert(false, "bad intrinsic");
+-    break;
++  ExternalAddress pi4_adr = (address)&pi_4;
++  if (reachable(pi4_adr)) {
++    // x ?<= pi/4
++    fld_d(pi4_adr); // ExternalAddress((address)&pi_4));
++    fld_s(1);                // Stack:  X  PI/4  X
++    fabs();                  // Stack: |X| PI/4  X
++    fcmp(tmp);
++    jcc(Assembler::above, slow_case);
++
++    // fastest case: -pi/4 <= x <= pi/4
++    switch(trig) {
++    case 's':
++      fsin();
++      break;
++    case 'c':
++      fcos();
++      break;
++    case 't':
++      ftan();
++      break;
++    default:
++      assert(false, "bad intrinsic");
++      break;
++    }
++    jmp(done);
+   }
+-  jmp(done);
+ 
+   // slow case: runtime call
+   bind(slow_case);
+diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp openjdk/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp
+--- openjdk.orig/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	2009-04-24 08:30:53.000000000 +0100
++++ openjdk/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	2010-03-11 18:09:57.000000000 +0000
+@@ -216,7 +216,7 @@
+ 
+ inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) {
+   /* it's possible we could catch this special case implicitly */
+-  if (op1 == 0x80000000 && op2 == -1) return op1;
++  if ((juint)op1 == 0x80000000 && op2 == -1) return op1;
+   else return op1 / op2;
+ }
+ 
+@@ -234,7 +234,7 @@
+ 
+ inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) {
+   /* it's possible we could catch this special case implicitly */
+-  if (op1 == 0x80000000 && op2 == -1) return 0;
++  if ((juint)op1 == 0x80000000 && op2 == -1) return 0;
+   else return op1 % op2;
+ }
+ 
+diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp openjdk/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
+--- openjdk.orig/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp	2009-04-24 08:30:53.000000000 +0100
++++ openjdk/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp	2010-03-11 18:14:12.000000000 +0000
+@@ -578,7 +578,7 @@
+   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax);
+ 
+   // for c++ interpreter can rsi really be munged? 
+-  __ leal(rsi, Address(rbp, -sizeof(BytecodeInterpreter)));                                // restore state
++  __ leal(rsi, Address(rbp, -(int)sizeof(BytecodeInterpreter)));                           // restore state
+   __ movl(rbx, Address(rsi, byte_offset_of(BytecodeInterpreter, _method)));                // restore method
+   __ movl(rdi, Address(rsi, byte_offset_of(BytecodeInterpreter, _locals)));                // get locals pointer
+ 
+@@ -644,7 +644,7 @@
+     const Address size_of_stack    (rbx, methodOopDesc::max_stack_offset());
+     // Always give one monitor to allow us to start interp if sync method.
+     // Any additional monitors need a check when moving the expression stack
+-    const one_monitor = frame::interpreter_frame_monitor_size() * wordSize;
++    const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize;
+   __ load_unsigned_word(rax, size_of_stack);                            // get size of expression stack in words
+   __ leal(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor));
+   __ leal(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size));
+@@ -1760,7 +1760,7 @@
+   Label unwind_and_forward;
+ 
+   // restore state pointer.
+-  __ leal(state, Address(rbp,  -sizeof(BytecodeInterpreter)));
++  __ leal(state, Address(rbp,  -(int)sizeof(BytecodeInterpreter)));
+ 
+   __ movl(rbx, STATE(_method));                       // get method
+   __ movl(rcx, STATE(_thread));                       // get thread
+@@ -1804,7 +1804,7 @@
+ 
+   // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases
+   if (UseSSE < 2) {
+-    __ leal(state, Address(rbp,  -sizeof(BytecodeInterpreter)));
++    __ leal(state, Address(rbp,  -(int)sizeof(BytecodeInterpreter)));
+     __ movl(rbx, STATE(_result._to_call._callee));                     // get method just executed 
+     __ movl(rcx, Address(rbx, methodOopDesc::result_index_offset())); 
+     __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT));    // Result stub address array index
+@@ -1853,7 +1853,7 @@
+ 
+   // Restore rsi as compiled code may not preserve it
+ 
+-  __ leal(state, Address(rbp,  -sizeof(BytecodeInterpreter)));
++  __ leal(state, Address(rbp,  -(int)sizeof(BytecodeInterpreter)));
+ 
+   // restore stack to what we had when we left (in case i2c extended it)
+ 
+diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp openjdk/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp
+--- openjdk.orig/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	2009-04-24 08:30:53.000000000 +0100
++++ openjdk/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	2010-03-11 18:09:57.000000000 +0000
+@@ -137,7 +137,7 @@
+ #ifdef CC_INTERP
+ 
+ inline interpreterState frame::get_interpreterState() const {
+-  return ((interpreterState)addr_at( -sizeof(BytecodeInterpreter)/wordSize ));
++  return ((interpreterState)addr_at( -((int)sizeof(BytecodeInterpreter))/wordSize ));
+ }
+ 
+ inline intptr_t*    frame::sender_sp()        const { 
+diff -Nru openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
+--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	2010-03-11 18:00:58.000000000 +0000
++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	2010-03-11 18:09:57.000000000 +0000
+@@ -166,7 +166,7 @@
+ #ifdef USELABELS
+ // Have to do this dispatch this way in C++ because otherwise gcc complains about crossing an
+ // initialization (which is is the initialization of the table pointer...)
+-#define DISPATCH(opcode) goto *dispatch_table[opcode]
++#define DISPATCH(opcode) goto *(void*)dispatch_table[opcode]
+ #define CONTINUE {                              \
+         opcode = *pc;                           \
+         DO_UPDATE_INSTRUCTION_COUNT(opcode);    \
+@@ -344,7 +344,7 @@
+  */
+ #undef CHECK_NULL
+ #define CHECK_NULL(obj_)                                                 \
+-    if ((obj_) == 0) {                                                   \
++    if ((obj_) == NULL) {                                                \
+         VM_JAVA_ERROR(vmSymbols::java_lang_NullPointerException(), "");  \
+     }
+ 
+@@ -1362,7 +1362,7 @@
+ 
+ #define NULL_COMPARISON_NOT_OP(name)                                         \
+       CASE(_if##name): {                                                     \
+-          int skip = (!(STACK_OBJECT(-1) == 0))                              \
++          int skip = (!(STACK_OBJECT(-1) == NULL))                           \
+                       ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3;             \
+           address branch_pc = pc;                                            \
+           UPDATE_PC_AND_TOS(skip, -1);                                       \
+@@ -1372,7 +1372,7 @@
+ 
+ #define NULL_COMPARISON_OP(name)                                             \
+       CASE(_if##name): {                                                     \
+-          int skip = ((STACK_OBJECT(-1) == 0))                               \
++          int skip = ((STACK_OBJECT(-1) == NULL))                            \
+                       ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3;             \
+           address branch_pc = pc;                                            \
+           UPDATE_PC_AND_TOS(skip, -1);                                       \
+diff -Nru openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
+--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	2010-03-11 18:00:57.000000000 +0000
++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	2010-03-11 18:09:57.000000000 +0000
+@@ -68,7 +68,6 @@
+ friend class InterpreterGenerator;
+ friend class InterpreterMacroAssembler;
+ friend class frame;
+-friend class SharedRuntime;
+ friend class VMStructs;
+ 
+ public:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/original/icedtea-explicit-target-arch.patch	Thu Mar 11 22:57:54 2010 +0000
@@ -0,0 +1,17 @@
+Index: openjdk/hotspot/make/linux/makefiles/defs.make
+===================================================================
+--- openjdk.orig/hotspot/build/linux/makefiles/defs.make	2009-05-18 14:09:57.812930043 +0200
++++ openjdk/hotspot/build/linux/makefiles/defs.make	2009-05-18 14:30:46.318871170 +0200
+@@ -29,7 +29,11 @@
+ SLASH_JAVA ?= /java
+ 
+ # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
+-ARCH:=$(shell uname -m)
++ifndef CROSS_COMPILATION
++  ARCH:=$(shell uname -m)
++else
++  ARCH:=$(CROSS_TARGET_ARCH)
++endif
+ PATH_SEP = :
+ ifeq ($(LP64), 1)
+   ARCH_DATA_MODEL ?= 64
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/original/icedtea-includedb.patch	Thu Mar 11 22:57:54 2010 +0000
@@ -0,0 +1,86 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep openjdk/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep	2009-04-24 08:30:55.000000000 +0100
++++ openjdk/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep	2010-03-11 18:19:46.000000000 +0000
+@@ -28,6 +28,7 @@
+ binaryTreeDictionary.cpp                binaryTreeDictionary.hpp
+ binaryTreeDictionary.cpp                globals.hpp
+ binaryTreeDictionary.cpp                ostream.hpp
++binaryTreeDictionary.cpp                space.inline.hpp
+ 
+ binaryTreeDictionary.hpp                freeBlockDictionary.hpp
+ binaryTreeDictionary.hpp                freeList.hpp
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge openjdk/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge	2009-04-24 08:30:55.000000000 +0100
++++ openjdk/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge	2010-03-11 18:19:04.000000000 +0000
+@@ -302,6 +302,8 @@
+ psPermGen.cpp                           psMarkSweepDecorator.hpp
+ psPermGen.cpp                           psParallelCompact.hpp
+ psPermGen.cpp                           psPermGen.hpp
++psPermGen.cpp                           markOop.inline.hpp
++psPermGen.cpp                           markSweep.inline.hpp
+ 
+ psPermGen.hpp                           psOldGen.hpp
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew openjdk/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew	2009-04-24 08:30:55.000000000 +0100
++++ openjdk/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew	2010-03-11 18:20:07.000000000 +0000
+@@ -29,6 +29,8 @@
+ asParNewGeneration.cpp			cmsAdaptiveSizePolicy.hpp
+ asParNewGeneration.cpp                  cmsGCAdaptivePolicyCounters.hpp
+ asParNewGeneration.cpp			defNewGeneration.inline.hpp
++asParNewGeneration.cpp                  markOop.inline.hpp
++asParNewGeneration.cpp                  markSweep.inline.hpp
+ asParNewGeneration.cpp			oop.pcgc.inline.hpp
+ asParNewGeneration.cpp			parNewGeneration.hpp
+ asParNewGeneration.cpp                  referencePolicy.hpp
+@@ -39,7 +41,7 @@
+ parCardTableModRefBS.cpp                java.hpp
+ parCardTableModRefBS.cpp                mutexLocker.hpp
+ parCardTableModRefBS.cpp                sharedHeap.hpp
+-parCardTableModRefBS.cpp                space.hpp
++parCardTableModRefBS.cpp                space.inline.hpp
+ parCardTableModRefBS.cpp                universe.hpp
+ parCardTableModRefBS.cpp                virtualspace.hpp
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/includeDB_compiler2 openjdk/hotspot/src/share/vm/includeDB_compiler2
+--- openjdk.orig/hotspot/src/share/vm/includeDB_compiler2	2009-04-24 08:30:55.000000000 +0100
++++ openjdk/hotspot/src/share/vm/includeDB_compiler2	2010-03-11 18:18:56.000000000 +0000
+@@ -140,6 +140,7 @@
+ c2_globals_<os_family>.hpp              macros.hpp
+ 
+ c2_init_<arch>.cpp                      compile.hpp
++c2_init_<arch>.cpp                      node.hpp
+ 
+ c2compiler.cpp                          ad_<arch_model>.hpp
+ c2compiler.cpp                          c2compiler.hpp
+@@ -833,6 +834,7 @@
+ phase.cpp                               compile.hpp
+ phase.cpp                               compileBroker.hpp
+ phase.cpp                               nmethod.hpp
++phase.cpp                               node.hpp
+ phase.cpp                               phase.hpp
+ 
+ phase.hpp                               port.hpp
+diff -Nru openjdk.orig/hotspot/src/share/vm/includeDB_core openjdk/hotspot/src/share/vm/includeDB_core
+--- openjdk.orig/hotspot/src/share/vm/includeDB_core	2009-04-24 08:30:55.000000000 +0100
++++ openjdk/hotspot/src/share/vm/includeDB_core	2010-03-11 18:19:04.000000000 +0000
+@@ -1304,6 +1304,7 @@
+ cppInterpreter_<arch>.cpp               debug.hpp
+ cppInterpreter_<arch>.cpp               deoptimization.hpp
+ cppInterpreter_<arch>.cpp               frame.inline.hpp
++cppInterpreter_<arch>.cpp               interfaceSupport.hpp
+ cppInterpreter_<arch>.cpp               interpreterRuntime.hpp
+ cppInterpreter_<arch>.cpp               interpreter.hpp
+ cppInterpreter_<arch>.cpp               interpreterGenerator.hpp
+diff -Nru openjdk.orig/hotspot/src/share/vm/includeDB_features openjdk/hotspot/src/share/vm/includeDB_features
+--- openjdk.orig/hotspot/src/share/vm/includeDB_features	2009-04-24 08:30:55.000000000 +0100
++++ openjdk/hotspot/src/share/vm/includeDB_features	2010-03-11 18:19:04.000000000 +0000
+@@ -58,6 +58,8 @@
+ 
+ dump_<arch_model>.cpp                   assembler_<arch_model>.inline.hpp
+ dump_<arch_model>.cpp                   compactingPermGenGen.hpp
++dump_<arch_model>.cpp                   generation.inline.hpp
++dump_<arch_model>.cpp                   space.inline.hpp
+ 
+ forte.cpp                               collectedHeap.inline.hpp
+ forte.cpp                               debugInfoRec.hpp
--- a/patches/hotspot/original/icedtea-shark.patch	Thu Mar 11 12:20:10 2010 +0000
+++ b/patches/hotspot/original/icedtea-shark.patch	Thu Mar 11 22:57:54 2010 +0000
@@ -1,305 +1,7 @@
---- openjdk/hotspot/src/share/vm/oops/methodOop.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/oops/methodOop.cpp	2008-12-03 16:54:59.000000000 +0000
-@@ -730,10 +730,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
- 
- }
- 
---- openjdk/hotspot/src/share/vm/memory/cardTableModRefBS.hpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	2008-12-03 16:54:59.000000000 +0000
-@@ -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;
---- openjdk/hotspot/src/share/vm/runtime/globals.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/globals.cpp	2008-12-03 16:54:59.000000000 +0000
-@@ -158,6 +158,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_NOTPRODUCT_FLAG_STRUCT, RUNTIME_MANAGEABLE_FLAG_STRUCT, RUNTIME_PRODUCT_RW_FLAG_STRUCT)
-@@ -168,6 +180,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_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}
- };
- 
---- openjdk/hotspot/src/share/vm/runtime/vframeArray.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/vframeArray.cpp	2008-12-03 16:54:59.000000000 +0000
-@@ -64,6 +64,11 @@
-       assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased");
-       BasicObjectLock* dest = _monitors->at(index);
-       dest->set_obj(monitor->owner());
-+#ifdef SHARK
-+      // XXX This can be removed when Shark knows
-+      // which monitors are in use.
-+      if (monitor->owner())
-+#endif // SHARK
-       monitor->lock()->move_to(monitor->owner(), dest->lock());
-     }
-   }
-@@ -262,6 +267,11 @@
-     top = iframe()->previous_monitor_in_interpreter_frame(top);
-     BasicObjectLock* src = _monitors->at(index);
-     top->set_obj(src->obj());
-+#ifdef SHARK
-+    // XXX This can be removed when Shark knows
-+    // which monitors are in use.
-+    if (src->obj())
-+#endif // SHARK    
-     src->lock()->move_to(src->obj(), top->lock());
-   }
-   if (ProfileInterpreter) {
---- openjdk/hotspot/src/share/vm/runtime/vm_version.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/vm_version.cpp	2008-12-03 16:54:59.000000000 +0000
-@@ -89,12 +89,16 @@
- #ifdef TIERED
-   #define VMTYPE "Server"
- #else
-+#ifdef SHARK
-+  #define VMTYPE "Shark"
-+#else
- #if defined(COMPILER1) || defined(COMPILER2)
--   #define VMTYPE COMPILER1_PRESENT("Client")   \
--                  COMPILER2_PRESENT("Server")
-+  #define VMTYPE COMPILER1_PRESENT("Client")   \
-+                 COMPILER2_PRESENT("Server")
- #else
-   #define VMTYPE "Core"
- #endif // COMPILER1 || COMPILER2
-+#endif // SHARK
- #endif // TIERED
- 
- #ifndef HOTSPOT_VM_DISTRO
---- openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp	2008-12-03 16:54:59.000000000 +0000
-@@ -217,6 +217,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
-@@ -227,6 +228,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
-@@ -337,7 +342,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,
-@@ -832,7 +839,20 @@
-   // stuff a C2I adapter we can properly fill in the callee-save
-   // register locations.
-   frame caller = fr.sender(reg_map);
-+#ifdef ZERO
-+  int frame_size;
-+  {
-+    // In zero, frame::sp() is the *end* of the frame, so
-+    // caller.sp() - fr.sp() is the size of the *caller*.
-+    RegisterMap dummy_map(thread, false);
-+    frame frame_1 = thread->last_frame();
-+    frame frame_2 = frame_1.sender(&dummy_map);
-+    assert(frame_2.sp() == fr.sp(), "should be");
-+    frame_size = frame_2.sp() - frame_1.sp();
-+  }
-+#else
-   int frame_size = caller.sp() - fr.sp();
-+#endif // ZERO
- 
-   frame sender = caller;
-  
-@@ -999,7 +1019,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()) {
-@@ -1750,7 +1770,7 @@
-     if (xtty != NULL)  xtty->tail("statistics");
-   }
- }
--#else // COMPILER2
-+#else // COMPILER2 || SHARK
- 
- 
- // Stubs for C1 only system.
-@@ -1786,4 +1806,4 @@
-   return buf;
- }
- 
--#endif // COMPILER2
-+#endif // COMPILER2 || SHARK
---- openjdk/hotspot/src/share/vm/runtime/globals.hpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/globals.hpp	2008-12-03 16:55:00.000000000 +0000
-@@ -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);
---- openjdk/hotspot/src/share/vm/code/nmethod.hpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/code/nmethod.hpp	2008-12-03 16:55:00.000000000 +0000
-@@ -290,6 +290,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; }
---- openjdk/hotspot/src/share/vm/code/nmethod.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/code/nmethod.cpp	2008-12-03 16:55:51.000000000 +0000
-@@ -187,6 +187,11 @@
- 
-   add_address_and_handler(pc,handler);
- }
-+bool nmethod::is_compiled_by_shark() const {
-+  if (is_native_method()) return false;
-+  assert(compiler() != NULL, "must be");
-+  return compiler()->is_shark();
-+}
- 
- 
- address ExceptionCache::match(Handle exception, address pc) {
-@@ -1448,6 +1453,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());
-@@ -1455,6 +1461,7 @@
-     symbolOop signature = call->signature();
-     fr.oops_compiled_arguments_do(signature, is_static, reg_map, f);
-   }
-+#endif // !SHARK
- }
- 
- 
-@@ -1883,6 +1890,8 @@
-     tty->print("(c1) ");
-   } else if (is_compiled_by_c2()) {
-     tty->print("(c2) ");
-+  } else if (is_compiled_by_shark()) {
-+    tty->print("(shark) ");
-   } else {
-     assert(is_native_method(), "Who else?");
-     tty->print("(nm) ");
---- openjdk/hotspot/src/share/vm/compiler/compileBroker.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/compiler/compileBroker.cpp	2008-12-03 16:55:00.000000000 +0000
-@@ -554,6 +554,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;
- 
---- openjdk/hotspot/src/share/vm/compiler/abstractCompiler.hpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/compiler/abstractCompiler.hpp	2008-12-03 16:55:00.000000000 +0000
-@@ -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
---- openjdk/hotspot/src/share/vm/ci/ciMethod.hpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/ci/ciMethod.hpp	2008-12-03 16:55:00.000000000 +0000
-@@ -69,7 +69,7 @@
- 
-   // Optional liveness analyzer.
-   MethodLiveness* _liveness;
--#ifdef COMPILER2
-+#if defined(COMPILER2) || defined(SHARK)
-   ciTypeFlow*     _flow;
- #endif
- 
---- openjdk/hotspot/src/share/vm/ci/ciMethod.cpp.orig	2008-12-03 16:54:19.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/ci/ciMethod.cpp	2008-12-03 16:55:00.000000000 +0000
-@@ -56,9 +56,9 @@
+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	2009-04-24 08:30:54.000000000 +0100
++++ openjdk/hotspot/src/share/vm/ci/ciMethod.cpp	2010-03-11 14:42:47.000000000 +0000
+@@ -59,9 +59,9 @@
    _liveness           = NULL;
    _bcea = NULL;
    _method_blocks = NULL;
@@ -311,7 +13,7 @@
  
    if (JvmtiExport::can_hotswap_or_post_breakpoint() && _is_compilable) {
      // 6328518 check hotswap conditions under the right lock.  
-@@ -124,9 +124,9 @@
+@@ -127,9 +127,9 @@
    _bcea = NULL;
    _method_blocks = NULL;
    _method_data = NULL;
@@ -323,7 +25,7 @@
  }
  
  
-@@ -294,34 +294,34 @@
+@@ -297,34 +297,34 @@
  // ------------------------------------------------------------------
  // ciMethod::get_flow_analysis
  ciTypeFlow* ciMethod::get_flow_analysis() {
@@ -364,3 +66,313 @@
  }
  
  // ------------------------------------------------------------------
+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	2009-04-24 08:30:54.000000000 +0100
++++ openjdk/hotspot/src/share/vm/ci/ciMethod.hpp	2010-03-11 14:42:47.000000000 +0000
+@@ -72,7 +72,7 @@
+ 
+   // Optional liveness analyzer.
+   MethodLiveness* _liveness;
+-#ifdef COMPILER2
++#if defined(COMPILER2) || defined(SHARK)
+   ciTypeFlow*     _flow;
+ #endif
+ 
+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	2009-04-24 08:30:54.000000000 +0100
++++ openjdk/hotspot/src/share/vm/code/nmethod.cpp	2010-03-11 14:42:47.000000000 +0000
+@@ -190,6 +190,11 @@
+ 
+   add_address_and_handler(pc,handler);
+ }
++bool nmethod::is_compiled_by_shark() const {
++  if (is_native_method()) return false;
++  assert(compiler() != NULL, "must be");
++  return compiler()->is_shark();
++}
+ 
+ 
+ address ExceptionCache::match(Handle exception, address pc) {
+@@ -1451,6 +1456,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());
+@@ -1458,6 +1464,7 @@
+     symbolOop signature = call->signature();
+     fr.oops_compiled_arguments_do(signature, is_static, reg_map, f);
+   }
++#endif // !SHARK
+ }
+ 
+ 
+@@ -1886,6 +1893,8 @@
+     tty->print("(c1) ");
+   } else if (is_compiled_by_c2()) {
+     tty->print("(c2) ");
++  } else if (is_compiled_by_shark()) {
++    tty->print("(shark) ");
+   } else {
+     assert(is_native_method(), "Who 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	2009-04-24 08:30:54.000000000 +0100
++++ openjdk/hotspot/src/share/vm/code/nmethod.hpp	2010-03-11 14:42:47.000000000 +0000
+@@ -293,6 +293,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	2009-04-24 08:30:54.000000000 +0100
++++ openjdk/hotspot/src/share/vm/compiler/abstractCompiler.hpp	2010-03-11 14:42:47.000000000 +0000
+@@ -48,18 +48,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	2009-04-24 08:30:54.000000000 +0100
++++ openjdk/hotspot/src/share/vm/compiler/compileBroker.cpp	2010-03-11 14:42:47.000000000 +0000
+@@ -557,6 +557,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	2009-04-24 08:30:55.000000000 +0100
++++ openjdk/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	2010-03-11 14:42:47.000000000 +0000
+@@ -47,6 +47,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	2009-04-24 08:30:56.000000000 +0100
++++ openjdk/hotspot/src/share/vm/oops/methodOop.cpp	2010-03-11 14:42:47.000000000 +0000
+@@ -733,10 +733,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	2009-04-24 08:30:56.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp	2010-03-11 14:42:47.000000000 +0000
+@@ -220,6 +220,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
+@@ -230,6 +231,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
+@@ -340,7 +345,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,
+@@ -835,7 +842,20 @@
+   // stuff a C2I adapter we can properly fill in the callee-save
+   // register locations.
+   frame caller = fr.sender(reg_map);
++#ifdef ZERO
++  int frame_size;
++  {
++    // In zero, frame::sp() is the *end* of the frame, so
++    // caller.sp() - fr.sp() is the size of the *caller*.
++    RegisterMap dummy_map(thread, false);
++    frame frame_1 = thread->last_frame();
++    frame frame_2 = frame_1.sender(&dummy_map);
++    assert(frame_2.sp() == fr.sp(), "should be");
++    frame_size = frame_2.sp() - frame_1.sp();
++  }
++#else
+   int frame_size = caller.sp() - fr.sp();
++#endif // ZERO
+ 
+   frame sender = caller;
+  
+@@ -1002,7 +1022,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()) {
+@@ -1753,7 +1773,7 @@
+     if (xtty != NULL)  xtty->tail("statistics");
+   }
+ }
+-#else // COMPILER2
++#else // COMPILER2 || SHARK
+ 
+ 
+ // Stubs for C1 only system.
+@@ -1789,4 +1809,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	2009-04-24 08:30:56.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/globals.cpp	2010-03-11 14:42:47.000000000 +0000
+@@ -161,6 +161,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_NOTPRODUCT_FLAG_STRUCT, RUNTIME_MANAGEABLE_FLAG_STRUCT, RUNTIME_PRODUCT_RW_FLAG_STRUCT)
+@@ -171,6 +183,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_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-03-11 14:37:11.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp	2010-03-11 14:42:47.000000000 +0000
+@@ -25,7 +25,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/vframeArray.cpp openjdk/hotspot/src/share/vm/runtime/vframeArray.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/vframeArray.cpp	2009-04-24 08:30:57.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/vframeArray.cpp	2010-03-11 14:42:47.000000000 +0000
+@@ -67,6 +67,11 @@
+       assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased");
+       BasicObjectLock* dest = _monitors->at(index);
+       dest->set_obj(monitor->owner());
++#ifdef SHARK
++      // XXX This can be removed when Shark knows
++      // which monitors are in use.
++      if (monitor->owner())
++#endif // SHARK
+       monitor->lock()->move_to(monitor->owner(), dest->lock());
+     }
+   }
+@@ -265,6 +270,11 @@
+     top = iframe()->previous_monitor_in_interpreter_frame(top);
+     BasicObjectLock* src = _monitors->at(index);
+     top->set_obj(src->obj());
++#ifdef SHARK
++    // XXX This can be removed when Shark knows
++    // which monitors are in use.
++    if (src->obj())
++#endif // SHARK    
+     src->lock()->move_to(src->obj(), top->lock());
+   }
+   if (ProfileInterpreter) {
+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-03-11 14:37:11.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/vm_version.cpp	2010-03-11 14:43:42.000000000 +0000
+@@ -95,6 +95,9 @@
+ #ifdef TIERED
+   #define VMTYPE "Server"
+ #else
++#ifdef SHARK
++  #define VMTYPE "Shark"
++#else
+ #if defined(COMPILER1) || defined(COMPILER2)
+    #define VMTYPE COMPILER1_PRESENT("Client")   \
+                   COMPILER2_PRESENT("Server")
+@@ -105,6 +108,7 @@
+   #define VMTYPE "Core"
+ #endif // ZERO
+ #endif // COMPILER1 || COMPILER2
++#endif // SHARK
+ #endif // TIERED
+ #endif // KERNEL
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-bytecodeInterpreterWithChecks.patch	Thu Mar 11 22:57:54 2010 +0000
@@ -0,0 +1,18 @@
+--- openjdk.old/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl      2007-10-12 03:46:08.000000000 -0400
++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl      2007-10-29 11:57:33.000000000 -0400
+@@ -6,6 +6,7 @@
+
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
++<xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
+ <xsl:template match="processcode">
+ <xsl:text>
+ #define VM_JVMTI
+@@ -15,7 +16,6 @@
+
+ </xsl:text>
+
+-<xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
+ </xsl:template>
+
+ </xsl:stylesheet>
--- a/patches/icedtea-explicit-target-arch.patch	Thu Mar 11 12:20:10 2010 +0000
+++ b/patches/icedtea-explicit-target-arch.patch	Thu Mar 11 22:57:54 2010 +0000
@@ -1,26 +1,3 @@
-Index: openjdk/hotspot/make/linux/makefiles/defs.make
-===================================================================
---- openjdk.orig/hotspot/make/linux/makefiles/defs.make	2009-05-18 14:09:57.812930043 +0200
-+++ openjdk/hotspot/make/linux/makefiles/defs.make	2009-05-18 14:30:46.318871170 +0200
-@@ -1,4 +1,4 @@
--#
-+
- # Copyright 2006-2008 Sun Microsystems, Inc.  All Rights Reserved.
- # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- #
-@@ -29,7 +29,11 @@
- SLASH_JAVA ?= /java
- 
- # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
--ARCH:=$(shell uname -m)
-+ifndef CROSS_COMPILATION
-+  ARCH:=$(shell uname -m)
-+else
-+  ARCH:=$(CROSS_TARGET_ARCH)
-+endif
- PATH_SEP = :
- ifeq ($(LP64), 1)
-   ARCH_DATA_MODEL ?= 64
 Index: openjdk/jdk/make/common/shared/Platform.gmk
 ===================================================================
 --- openjdk.orig/jdk/make/common/shared/Platform.gmk	2009-05-18 14:09:57.950854863 +0200