changeset 2044:06f017f7daa7

Merge.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Fri, 07 Jan 2011 18:18:08 +0100
parents 00bc9eaf0e24 (current diff) 09d92cbb793b (diff)
children 9c96c873c42b
files make/linux/makefiles/launcher.make make/linux/makefiles/makedeps.make make/linux/makefiles/vm.make make/solaris/makefiles/makedeps.make make/windows/README make/windows/create.bat make/windows/makefiles/makedeps.make make/windows/makefiles/projectcreator.make make/windows/makefiles/vm.make src/cpu/x86/vm/assembler_x86.cpp src/cpu/x86/vm/c1_Runtime1_x86.cpp src/cpu/x86/vm/frame_x86.cpp src/os/linux/launcher/java.c src/os/linux/launcher/java.h src/os/linux/launcher/java_md.c src/os/linux/launcher/java_md.h src/os/linux/vm/hpi_linux.cpp src/os/linux/vm/hpi_linux.hpp src/os/linux/vm/os_linux.cpp src/os/solaris/launcher/java.c src/os/solaris/launcher/java.h src/os/solaris/launcher/java_md.c src/os/solaris/launcher/java_md.h src/os/solaris/vm/hpi_solaris.cpp src/os/solaris/vm/hpi_solaris.hpp src/os/windows/vm/hpi_windows.cpp src/os/windows/vm/hpi_windows.hpp src/os_cpu/linux_x86/vm/os_linux_x86.cpp src/share/tools/MakeDeps/ArgsParser.java src/share/tools/MakeDeps/BuildConfig.java src/share/tools/MakeDeps/Database.java src/share/tools/MakeDeps/DirectoryTree.java src/share/tools/MakeDeps/DirectoryTreeNode.java src/share/tools/MakeDeps/FileFormatException.java src/share/tools/MakeDeps/FileList.java src/share/tools/MakeDeps/FileName.java src/share/tools/MakeDeps/Macro.java src/share/tools/MakeDeps/MacroDefinitions.java src/share/tools/MakeDeps/MakeDeps.java src/share/tools/MakeDeps/MetroWerksMacPlatform.java src/share/tools/MakeDeps/Platform.java src/share/tools/MakeDeps/UnixPlatform.java src/share/tools/MakeDeps/Util.java src/share/tools/MakeDeps/WinGammaPlatform.java src/share/tools/MakeDeps/WinGammaPlatformVC6.java src/share/tools/MakeDeps/WinGammaPlatformVC7.java src/share/tools/MakeDeps/WinGammaPlatformVC8.java src/share/tools/MakeDeps/WinGammaPlatformVC9.java src/share/tools/ProjectCreator/BuildConfig.java src/share/tools/ProjectCreator/ProjectCreator.java src/share/tools/ProjectCreator/Util.java src/share/tools/ProjectCreator/WinGammaPlatformVC6.java src/share/tools/ProjectCreator/WinGammaPlatformVC7.java src/share/tools/ProjectCreator/WinGammaPlatformVC8.java src/share/vm/asm/codeBuffer.cpp src/share/vm/c1/c1_Compiler.cpp src/share/vm/c1/c1_LIRGenerator.cpp src/share/vm/c1/c1_Runtime1.cpp src/share/vm/c1/c1_Runtime1.hpp src/share/vm/c1/c1_globals.hpp src/share/vm/ci/ciEnv.cpp src/share/vm/ci/ciEnv.hpp src/share/vm/ci/ciField.cpp src/share/vm/ci/ciField.hpp src/share/vm/ci/ciInstanceKlass.cpp src/share/vm/ci/ciInstanceKlass.hpp src/share/vm/ci/ciObject.cpp src/share/vm/ci/ciObject.hpp src/share/vm/ci/ciObjectFactory.cpp src/share/vm/ci/ciObjectFactory.hpp src/share/vm/ci/ciSymbol.hpp src/share/vm/classfile/classLoader.cpp src/share/vm/classfile/systemDictionary.cpp src/share/vm/classfile/systemDictionary.hpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/code/compiledIC.cpp src/share/vm/code/nmethod.cpp src/share/vm/code/nmethod.hpp src/share/vm/code/pcDesc.cpp src/share/vm/compiler/abstractCompiler.hpp src/share/vm/compiler/compileBroker.cpp src/share/vm/compiler/compileBroker.hpp src/share/vm/compiler/oopMap.hpp src/share/vm/gc_implementation/g1/heapRegion.cpp src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep src/share/vm/gc_implementation/includeDB_gc_g1 src/share/vm/gc_implementation/includeDB_gc_parNew src/share/vm/gc_implementation/includeDB_gc_parallelScavenge src/share/vm/gc_implementation/includeDB_gc_serial src/share/vm/gc_implementation/includeDB_gc_shared src/share/vm/includeDB_compiler1 src/share/vm/includeDB_compiler2 src/share/vm/includeDB_core src/share/vm/includeDB_features src/share/vm/includeDB_gc src/share/vm/includeDB_gc_parallel src/share/vm/includeDB_jvmti src/share/vm/includeDB_shark src/share/vm/includeDB_zero src/share/vm/interpreter/rewriter.cpp src/share/vm/interpreter/templateTable.cpp src/share/vm/oops/instanceKlass.cpp src/share/vm/oops/klass.cpp src/share/vm/oops/klass.hpp src/share/vm/oops/klassKlass.cpp src/share/vm/oops/oop.inline.hpp src/share/vm/prims/hpi_imported.h src/share/vm/prims/jni.cpp src/share/vm/runtime/arguments.cpp src/share/vm/runtime/arguments.hpp src/share/vm/runtime/deoptimization.cpp src/share/vm/runtime/globals.hpp src/share/vm/runtime/hpi.cpp src/share/vm/runtime/hpi.hpp src/share/vm/runtime/javaCalls.cpp src/share/vm/runtime/javaCalls.hpp src/share/vm/runtime/sharedRuntime.cpp src/share/vm/runtime/stackValue.cpp src/share/vm/runtime/synchronizer.cpp src/share/vm/runtime/thread.cpp src/share/vm/runtime/thread.hpp src/share/vm/runtime/vframe.cpp src/share/vm/runtime/vframeArray.cpp src/share/vm/runtime/vframe_hp.cpp src/share/vm/utilities/exceptions.cpp src/share/vm/utilities/globalDefinitions.hpp
diffstat 1696 files changed, 36297 insertions(+), 29911 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Dec 29 20:06:41 2010 +0100
+++ b/.hgtags	Fri Jan 07 18:18:08 2011 +0100
@@ -131,3 +131,11 @@
 806d0c037e6bbb88dac0699673f4ba55ee8c02da jdk7-b117
 698b7b727e12de44139d8cca6ab9a494ead13253 jdk7-b118
 3ef7426b4deac5dcfd4afb35cabe9ab3d666df91 hs20-b02
+5484e7c53fa7da5e869902437ee08a9ae10c1c69 jdk7-b119
+f5603a6e50422046ebc0d2f1671d55cb8f1bf1e9 jdk7-b120
+3f3653ab7af8dc1ddb9fa75dad56bf94f89e81a8 jdk7-b121
+3a548dc9cb456110ca8fc1514441a8c3bda0014d jdk7-b122
+5484e7c53fa7da5e869902437ee08a9ae10c1c69 hs20-b03
+9669f9b284108a9ee0a0ccbe215c37a130c9dcf5 jdk7-b123
+9669f9b284108a9ee0a0ccbe215c37a130c9dcf5 hs20-b04
+0a8e0d4345b37b71ec49dda08ee03b68c4f1b592 jdk7-b124
--- a/agent/src/os/linux/libproc_impl.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/os/linux/libproc_impl.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/os/linux/ps_core.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/os/linux/ps_core.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/os/linux/ps_proc.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/os/linux/ps_proc.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -121,15 +121,13 @@
 #define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, data, addr)
 #endif
 
-#ifdef _LP64
-#ifdef PTRACE_GETREGS64
+#if defined(_LP64) && defined(PTRACE_GETREGS64)
 #define PTRACE_GETREGS_REQ PTRACE_GETREGS64
+#elif defined(PTRACE_GETREGS)
+#define PTRACE_GETREGS_REQ PTRACE_GETREGS
+#elif defined(PT_GETREGS)
+#define PTRACE_GETREGS_REQ PT_GETREGS
 #endif
-#else
-#if defined(PTRACE_GETREGS) || defined(PT_GETREGS)
-#define PTRACE_GETREGS_REQ PTRACE_GETREGS
-#endif
-#endif /* _LP64 */
 
 #ifdef PTRACE_GETREGS_REQ
  if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) {
--- a/agent/src/os/linux/symtab.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/os/linux/symtab.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/os/linux/symtab.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/os/linux/symtab.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Fri Jan 07 18:18:08 2011 +0100
@@ -60,10 +60,7 @@
     headerSize  = type.getSize();
     elementSize = 0;
     // fetch constants:
-    MULTI_OPERAND_COUNT_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_multi_operand_count_offset").intValue();
-    MULTI_OPERAND_BASE_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_multi_operand_base_offset").intValue();
     INDY_BSM_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_bsm_offset").intValue();
-    INDY_NT_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_nt_offset").intValue();
     INDY_ARGC_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argc_offset").intValue();
     INDY_ARGV_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argv_offset").intValue();
   }
@@ -83,10 +80,7 @@
   private static long headerSize;
   private static long elementSize;
 
-  private static int MULTI_OPERAND_COUNT_OFFSET;
-  private static int MULTI_OPERAND_BASE_OFFSET;
   private static int INDY_BSM_OFFSET;
-  private static int INDY_NT_OFFSET;
   private static int INDY_ARGC_OFFSET;
   private static int INDY_ARGV_OFFSET;
 
@@ -296,20 +290,23 @@
   }
 
   /** Lookup for multi-operand (InvokeDynamic) entries. */
-  public int[] getMultiOperandsAt(int i) {
+  public short[] getBootstrapSpecifierAt(int i) {
     if (Assert.ASSERTS_ENABLED) {
       Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool");
     }
-    int pos = this.getIntAt(i);
-    int countPos = pos + MULTI_OPERAND_COUNT_OFFSET;  // == pos-1
-    int basePos  = pos + MULTI_OPERAND_BASE_OFFSET;   // == pos
-    if (countPos < 0)  return null;  // safety first
+    if (getTagAt(i).value() == JVM_CONSTANT_InvokeDynamicTrans)
+        return null;
+    int bsmSpec = extractLowShortFromInt(this.getIntAt(i));
     TypeArray operands = getOperands();
     if (operands == null)  return null;  // safety first
-    int length = operands.getIntAt(countPos);
-    int[] values = new int[length];
-    for (int j = 0; j < length; j++) {
-        values[j] = operands.getIntAt(basePos+j);
+    int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0),
+                                                operands.getShortAt(bsmSpec * 2 + 1));
+    int argv = basePos + INDY_ARGV_OFFSET;
+    int argc = operands.getShortAt(basePos + INDY_ARGC_OFFSET);
+    int endPos = argv + argc;
+    short[] values = new short[endPos - basePos];
+    for (int j = 0; j < values.length; j++) {
+        values[j] = operands.getShortAt(basePos+j);
     }
     return values;
   }
@@ -334,6 +331,7 @@
     case JVM_CONSTANT_MethodHandle:       return "JVM_CONSTANT_MethodHandle";
     case JVM_CONSTANT_MethodType:         return "JVM_CONSTANT_MethodType";
     case JVM_CONSTANT_InvokeDynamic:      return "JVM_CONSTANT_InvokeDynamic";
+    case JVM_CONSTANT_InvokeDynamicTrans: return "JVM_CONSTANT_InvokeDynamic/transitional";
     case JVM_CONSTANT_Invalid:            return "JVM_CONSTANT_Invalid";
     case JVM_CONSTANT_UnresolvedClass:    return "JVM_CONSTANT_UnresolvedClass";
     case JVM_CONSTANT_UnresolvedClassInError:    return "JVM_CONSTANT_UnresolvedClassInError";
@@ -393,6 +391,7 @@
         case JVM_CONSTANT_MethodHandle:
         case JVM_CONSTANT_MethodType:
         case JVM_CONSTANT_InvokeDynamic:
+        case JVM_CONSTANT_InvokeDynamicTrans:
           visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
           break;
         }
@@ -556,19 +555,16 @@
                   break;
               }
 
+              case JVM_CONSTANT_InvokeDynamicTrans:
               case JVM_CONSTANT_InvokeDynamic: {
                   dos.writeByte(cpConstType);
-                  int[] values = getMultiOperandsAt(ci);
-                  for (int vn = 0; vn < values.length; vn++) {
-                      dos.writeShort(values[vn]);
-                  }
-                  int bootstrapMethodIndex = values[INDY_BSM_OFFSET];
-                  int nameAndTypeIndex = values[INDY_NT_OFFSET];
-                  int argumentCount = values[INDY_ARGC_OFFSET];
-                  assert(INDY_ARGV_OFFSET + argumentCount == values.length);
-                  if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bootstrapMethodIndex
-                                          + ", N&T = " + nameAndTypeIndex
-                                          + ", argc = " + argumentCount);
+                  int value = getIntAt(ci);
+                  short bsmIndex = (short) extractLowShortFromInt(value);
+                  short nameAndTypeIndex = (short) extractHighShortFromInt(value);
+                  dos.writeShort(bsmIndex);
+                  dos.writeShort(nameAndTypeIndex);
+                  if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bsmIndex
+                                          + ", N&T = " + nameAndTypeIndex);
                   break;
               }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Fri Jan 07 18:18:08 2011 +0100
@@ -321,13 +321,16 @@
                      break;
                 }
 
+                case JVM_CONSTANT_InvokeDynamicTrans:
                 case JVM_CONSTANT_InvokeDynamic: {
                      dos.writeByte(cpConstType);
-                     int[] values = cpool.getMultiOperandsAt(ci);
-                     for (int vn = 0; vn < values.length; vn++) {
-                         dos.writeShort(values[vn]);
-                     }
-                     if (DEBUG) debugMessage("CP[" + ci + "] = INDY indexes = " + Arrays.toString(values));
+                     int value = cpool.getIntAt(ci);
+                     short bsmIndex = (short) extractLowShortFromInt(value);
+                     short nameAndTypeIndex = (short) extractHighShortFromInt(value);
+                     dos.writeShort(bsmIndex);
+                     dos.writeShort(nameAndTypeIndex);
+                     if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " +
+                           bsmIndex + ", N&T = " + nameAndTypeIndex);
                      break;
                 }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Fri Jan 07 18:18:08 2011 +0100
@@ -460,7 +460,8 @@
       return buf.toString();
    }
 
-   private String genListOfShort(int[] values) {
+   private String genListOfShort(short[] values) {
+      if (values == null || values.length == 0)  return "";
       Formatter buf = new Formatter(genHTML);
       buf.append('[');
       for (int i = 0; i < values.length; i++) {
@@ -594,9 +595,11 @@
                buf.cell(Integer.toString(cpool.getIntAt(index)));
                break;
 
+            case JVM_CONSTANT_InvokeDynamicTrans:
             case JVM_CONSTANT_InvokeDynamic:
                buf.cell("JVM_CONSTANT_InvokeDynamic");
-               buf.cell(genListOfShort(cpool.getMultiOperandsAt(index)));
+               buf.cell(genLowHighShort(cpool.getIntAt(index)) +
+                        genListOfShort(cpool.getBootstrapSpecifierAt(index)));
                break;
 
             default:
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java	Fri Jan 07 18:18:08 2011 +0100
@@ -40,7 +40,7 @@
   private static int JVM_CONSTANT_NameAndType             = 12;
   private static int JVM_CONSTANT_MethodHandle            = 15;  // JSR 292
   private static int JVM_CONSTANT_MethodType              = 16;  // JSR 292
-  //      static int JVM_CONSTANT_InvokeDynamicTrans      = 17;  // JSR 292, only occurs in old class files
+  private static int JVM_CONSTANT_InvokeDynamicTrans      = 17;  // JSR 292, only occurs in old class files
   private static int JVM_CONSTANT_InvokeDynamic           = 18;  // JSR 292
   private static int JVM_CONSTANT_Invalid                 = 0;   // For bad value initialization
   private static int JVM_CONSTANT_UnresolvedClass         = 100; // Temporary tag until actual use
@@ -67,6 +67,8 @@
     this.tag = tag;
   }
 
+  public int value() { return tag; }
+
   public boolean isKlass()            { return tag == JVM_CONSTANT_Class; }
   public boolean isField ()           { return tag == JVM_CONSTANT_Fieldref; }
   public boolean isMethod()           { return tag == JVM_CONSTANT_Methodref; }
@@ -81,6 +83,7 @@
   public boolean isMethodHandle()     { return tag == JVM_CONSTANT_MethodHandle; }
   public boolean isMethodType()       { return tag == JVM_CONSTANT_MethodType; }
   public boolean isInvokeDynamic()    { return tag == JVM_CONSTANT_InvokeDynamic; }
+  public boolean isInvokeDynamicTrans() { return tag == JVM_CONSTANT_InvokeDynamicTrans; }
 
   public boolean isInvalid()          { return tag == JVM_CONSTANT_Invalid; }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js	Wed Dec 29 20:06:41 2010 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/defs.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/defs.make	Fri Jan 07 18:18:08 2011 +0100
@@ -101,15 +101,14 @@
 endif
 
 ifdef HOTSPOT_BUILD_VERSION
-# specified in command line (PRT build)
+# specified in command line
 else
-  ifdef JPRT_BUILD_VERSION
-# JPR build
-    HOTSPOT_BUILD_VERSION=$(JPRT_BUILD_VERSION)
+  ifdef COOKED_BUILD_NUMBER
+# JRE build
+    HOTSPOT_BUILD_VERSION=
   else
-    ifdef COOKED_BUILD_NUMBER
-# JRE build
-      HOTSPOT_BUILD_VERSION=
+    ifdef USER_RELEASE_SUFFIX
+      HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX)
     else
       HOTSPOT_BUILD_VERSION=internal
     endif
--- a/make/hotspot_distro	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/hotspot_distro	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/hotspot_version	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/hotspot_version	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=20
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=03
+HS_BUILD_NUMBER=05
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/make/jprt.gmk	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/jprt.gmk	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,6 @@
 # JPRT rule to build this workspace
 
 JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
-ifdef JPRT_BUILD_VERSION
-  MILESTONE=$(JPRT_BUILD_VERSION)
-endif
 
 ifeq ($(OSNAME),windows)
   ZIPFLAGS=-q
--- a/make/jprt.properties	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/jprt.properties	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/linux/makefiles/adlc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/adlc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -42,16 +42,14 @@
 SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
 	     $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 
 
-Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
-
 EXEC	= $(OUTDIR)/adlc
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc
+VPATH += $(Src_Dirs_V:%=%:)
 
 # set INCLUDES for C preprocessor
-Src_Dirs_I = ${Src_Dirs} $(GENERATED)
+Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)
 INCLUDES += $(Src_Dirs_I:%=-I%)
 
 # set flags for adlc compilation
--- a/make/linux/makefiles/amd64.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/amd64.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,6 @@
 #  
 #
 
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_x86_64.o
-
 # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
 OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
 # The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
--- a/make/linux/makefiles/build_vm_def.sh	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/build_vm_def.sh	Fri Jan 07 18:18:08 2011 +0100
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # If we're cross compiling use that path for nm
-if [ "$ALT_COMPILER_PATH" != "" ]; then 
+if [ "$CROSS_COMPILE_ARCH" != "" ]; then 
 NM=$ALT_COMPILER_PATH/nm
 else
 NM=nm
--- a/make/linux/makefiles/buildtree.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/buildtree.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
 # HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
-# HOTSPOT_BUILD_VERSION   - internal, PRTjob ID, JPRTjob ID
+# HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
 # Builds the directory trees with makefiles plus some convenience files in
@@ -113,7 +113,7 @@
 COMPILER	= $(shell sed -n 's/^compiler[ 	]*=[ 	]*//p' $(PLATFORM_FILE))
 
 SIMPLE_DIRS	= \
-	$(PLATFORM_DIR)/generated/incls \
+	$(PLATFORM_DIR)/generated/dependencies \
 	$(PLATFORM_DIR)/generated/adfiles \
 	$(PLATFORM_DIR)/generated/jvmtifiles
 
@@ -124,7 +124,7 @@
 BUILDTREE_MAKE	= $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 
 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
-        env.sh env.csh .dbxrc test_gamma
+        env.sh env.csh jdkpath.sh .dbxrc test_gamma
 
 BUILDTREE_VARS	= GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 	ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -197,11 +197,27 @@
 	echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
 	echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
 	echo; \
-	echo "Src_Dirs = \\"; \
+	echo "# Used for platform dispatching"; \
+	echo "TARGET_DEFINES  = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
+	echo "CFLAGS += \$$(TARGET_DEFINES)"; \
+	echo; \
+	echo "Src_Dirs_V = \\"; \
 	sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
 	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
+	echo; \
+	echo "Src_Dirs_I = \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
+	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
 	[ -n "$(CFLAGS_BROWSE)" ] && \
 	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
 	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
@@ -302,6 +318,13 @@
 	sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
 	) > $@
 
+jdkpath.sh: $(BUILDTREE_MAKE)
+	@echo Creating $@ ...
+	$(QUIETLY) ( \
+	$(BUILDTREE_COMMENT); \
+	echo "JDK=${JAVA_HOME}"; \
+	) > $@	   
+
 .dbxrc:  $(BUILDTREE_MAKE)
 	@echo Creating $@ ...
 	$(QUIETLY) ( \
--- a/make/linux/makefiles/core.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/core.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,7 @@
 
 # Sets make macros for making core version of VM
 
-# Note the effect on includeDB lists in top.make:
-# includeDB_compiler* and ad_<arch>.*pp are excluded from the build,
+# Select which files to use (in top.make)
 TYPE=CORE
 
 # There is no "core" directory in JDK. Install core build in server directory.
--- a/make/linux/makefiles/defs.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/defs.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/linux/makefiles/gcc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/gcc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -25,7 +25,9 @@
 #------------------------------------------------------------------------
 # CC, CPP & AS
 
-ifdef ALT_COMPILER_PATH
+# When cross-compiling the ALT_COMPILER_PATH points
+# to the cross-compilation toolset
+ifdef CROSS_COMPILE_ARCH
 CPP = $(ALT_COMPILER_PATH)/g++
 CC  = $(ALT_COMPILER_PATH)/gcc
 else
@@ -42,9 +44,13 @@
 
 # check for precompiled headers support
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
 USE_PRECOMPILED_HEADER=1
 PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
+PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
+PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+endif
 endif
 
 
@@ -144,6 +150,16 @@
 OPT_CFLAGS/mulnode.o += -O0
 endif
 
+# Flags for generating make dependency flags.
+ifneq ("${CC_VER_MAJOR}", "2")
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/make/linux/makefiles/i486.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/i486.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,6 @@
 #
 
 # TLS helper, assembled from .s file
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_x86_32.o
 
 # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
 OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
--- a/make/linux/makefiles/jvmti.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/jvmti.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,11 +37,10 @@
 
 JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims
 InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter
-Src_Dirs += $(JvmtiSrcDir)
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs}
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(JvmtiSrcDir)
+VPATH += $(Src_Dirs_V:%=%:)
 
 JvmtiGeneratedNames = \
         jvmtiEnv.hpp \
--- a/make/linux/makefiles/launcher.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/launcher.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,23 @@
 
 # Rules to build gamma launcher, used by vm.make
 
-# gamma[_g]: launcher
 
+LAUNCHER_SCRIPT = hotspot
 LAUNCHER   = gamma
-LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX)
 
-LAUNCHERDIR   = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher
-LAUNCHERFLAGS = $(ARCHFLAG) \
+LAUNCHERDIR   := $(GAMMADIR)/src/os/posix/launcher
+LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
+LAUNCHERFLAGS := $(ARCHFLAG) \
                 -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
+                -I$(LAUNCHERDIR_SHARE) \
                 -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+                -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+                -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
                 -DARCH=\"$(LIBARCH)\" \
                 -DGAMMA \
                 -DLAUNCHER_TYPE=\"gamma\" \
-                -DLINK_INTO_$(LINK_INTO)
+                -DLINK_INTO_$(LINK_INTO) \
+                $(TARGET_DEFINES)
 
 ifeq ($(LINK_INTO),AOUT)
   LAUNCHER.o                 = launcher.o $(JVM_OBJ_FILES)
@@ -55,22 +59,35 @@
 LINK_LAUNCHER/PRE_HOOK  = $(LINK_LIB.CC/PRE_HOOK)
 LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CC/POST_HOOK)
 
-launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c
-	$(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS)
+LAUNCHER_OUT = launcher
+
+SUFFIXES += .d
+
+SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
+SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
+
+OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
+
+DEPFILES := $(patsubst %.o,%.d,$(OBJS))
+-include $(DEPFILES)
+
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
 
-launcher.c:
-	@echo Generating $@
-	$(QUIETLY) { \
-	echo '#define debug launcher_debug'; \
-	echo '#include "java.c"'; \
-	echo '#include "java_md.c"'; \
-	} > $@
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
 
-$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE)
-	$(QUIETLY) { \
-	    echo Linking launcher...; \
-	    $(LINK_LAUNCHER/PRE_HOOK) \
-	    $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \
-	    $(LINK_LAUNCHER/POST_HOOK) \
-	    #[ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \
-        }
+$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
+	$(QUIETLY) echo Linking launcher...
+	$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
+	$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
+	$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
+
+$(LAUNCHER): $(LAUNCHER_SCRIPT)
+
+$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
+	$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
+	$(QUIETLY) chmod +x $@
+
--- a/make/linux/makefiles/makedeps.make	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 2000, 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#  
-#
-
-include $(GAMMADIR)/make/linux/makefiles/rules.make
-
-COMPILE.JAVAC.FLAGS += -d $(OUTDIR)
-
-MakeDepsSources=\
-	$(GAMMADIR)/src/share/tools/MakeDeps/Database.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java        
-
-MakeDepsOptions=
--- a/make/linux/makefiles/mapfile-vers-debug	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/mapfile-vers-debug	Fri Jan 07 18:18:08 2011 +0100
@@ -3,7 +3,7 @@
 #
 
 #
-# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/linux/makefiles/mapfile-vers-product	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/mapfile-vers-product	Fri Jan 07 18:18:08 2011 +0100
@@ -3,7 +3,7 @@
 #
 
 #
-# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/linux/makefiles/product.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/product.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/linux/makefiles/rules.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/rules.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -151,20 +151,20 @@
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
-	$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
 else
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
 	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
-	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
-	   $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
+	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
 endif
 
 %.o: %.s
 	@echo Assembling $<
 	$(QUIETLY) $(REMOVE_TARGET)
-	$(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE)
+	$(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
 
 %.s: %.cpp
 	@echo Generating assembly for $<
--- a/make/linux/makefiles/saproc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/saproc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -55,10 +55,12 @@
 # if $(AGENT_DIR) does not exist, we don't build SA
 # also, we don't build SA on Itanium, PPC, ARM or zero.
 
-checkAndBuildSA:
-	$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "arm" -a "$(SRCARCH)" != "ppc" -a "$(SRCARCH)" != "zero" ] ; then \
-	   $(MAKE) -f vm.make $(LIBSAPROC); \
-	fi
+ifneq ($(wildcard $(AGENT_DIR)),)
+ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
+  BUILDLIBSAPROC = $(LIBSAPROC)
+endif
+endif
+
 
 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
 
@@ -81,10 +83,10 @@
 	           -lthread_db
 	$(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
 
-install_saproc: checkAndBuildSA
+install_saproc: $(BUILDLIBSAPROC)
 	$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then             \
 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
 	fi
 
-.PHONY: checkAndBuildSA install_saproc
+.PHONY: install_saproc
--- a/make/linux/makefiles/shark.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/shark.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2008, 2010 Red Hat, Inc.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
--- a/make/linux/makefiles/sparc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/sparc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,3 @@
 #  
 #
 
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_sparc.o
-
--- a/make/linux/makefiles/sparcWorks.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/sparcWorks.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -74,6 +74,14 @@
 OPT_CFLAGS+=-xO4
 OPT_CFLAGS/NOOPT=-xO0
 
+# Flags for creating the dependency files.
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/make/linux/makefiles/sparcv9.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/sparcv9.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,10 +21,6 @@
 # questions.
 #  
 
-#
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_sparc.o
-
 # gcc 4.0 miscompiles this code in -m64
 OPT_CFLAGS/macro.o = -O0
 
--- a/make/linux/makefiles/top.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/top.make	Fri Jan 07 18:18:08 2011 +0100
@@ -31,7 +31,7 @@
 #   -generate sa-jdi.jar (JDI binding to core files)
 
 # It assumes the following flags are set:
-# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Obj_Files
+# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files
 
 # -- D. Ungar (5/97) from a file by Bill Bush
 
@@ -45,10 +45,6 @@
 Plat_File   = $(Platform_file)
 CDG         = cd $(GENERATED); 
 
-# Pick up MakeDeps' sources and definitions
-include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
-MakeDepsClass = MakeDeps.class
-
 ifdef USE_PRECOMPILED_HEADER
 PrecompiledOption = -DUSE_PRECOMPILED_HEADER
 UpdatePCH         = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS) 
@@ -57,33 +53,7 @@
 PrecompiledOption = 
 endif
 
-MakeDeps    = $(RUN.JAVA) $(PrecompiledOption) -classpath $(GENERATED) MakeDeps
-
-Include_DBs/GC          = $(VM)/includeDB_gc \
-                          $(VM)/includeDB_gc_parallel \
-                          $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
-                          $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
-                          $(VM)/gc_implementation/includeDB_gc_parNew \
-                          $(VM)/gc_implementation/includeDB_gc_g1     \
-                          $(VM)/gc_implementation/includeDB_gc_serial \
-                          $(VM)/gc_implementation/includeDB_gc_shared
-
-Include_DBs/CORE        = $(VM)/includeDB_core   $(Include_DBs/GC) \
-                          $(VM)/includeDB_jvmti \
-                          $(VM)/includeDB_features
-Include_DBs/COMPILER1   = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
-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
-Cached_db   = $(GENERATED)/includeDB.current
-
-Incremental_Lists = $(Cached_db)
-# list generation also creates $(GENERATED)/$(Cached_plat)
-
 
 AD_Dir   = $(GENERATED)/adfiles
 ADLC     = $(AD_Dir)/adlc
@@ -102,7 +72,7 @@
 MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
 
 
-# default target: make makeDeps, update lists, make vm
+# default target: update lists, make vm
 # done in stages to force sequential order with parallel make
 #
 
@@ -110,39 +80,18 @@
 	@echo All done.
 
 # This is an explicit dependency for the sake of parallel makes.
-vm_build_preliminaries:  checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
+vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff
 	@# We need a null action here, so implicit rules don't get consulted.
 
-# make makeDeps: (and zap the cached db files to force a nonincremental run)
-
-$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
-	@$(REMOTE) $(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources)
-	@echo Removing $(Incremental_Lists) to force regeneration.
-	@rm -f $(Incremental_Lists)
-	@$(CDG) echo >$(Cached_plat)
-
-# make incremental_lists, if cached files out of date, run makeDeps
-
-$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
-	$(CDG) cat $(Include_DBs) > $(GENERATED)/includeDB
-	$(CDG) if [ ! -r incls ] ; then \
-	mkdir incls ; \
-	fi
-	$(CDG) (echo $(CDG) echo $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) $(GENERATED)/includeDB $(MakeDepsOptions)) > makeDeps.sh
-	$(CDG) $(REMOTE) sh $(GENERATED)/makeDeps.sh
-	$(CDG) cp includeDB    $(Cached_db)
+$(Cached_plat): $(Plat_File)
 	$(CDG) cp $(Plat_File) $(Cached_plat)
 
-# symbolic target for command lines
-lists: $(Incremental_Lists)
-	@: lists are now up to date
-
 # make AD files as necessary
-ad_stuff: $(Incremental_Lists) $(adjust-mflags)
+ad_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f adlc.make $(MFLAGS-adjusted)
 
 # generate JVMTI files from the spec
-jvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
+jvmti_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
 
 # generate SA jar files and native header
@@ -169,7 +118,7 @@
 install: the_vm
 	@$(MAKE) -f vm.make install
 
-# next rules support "make foo.[oi]"
+# next rules support "make foo.[ois]"
 
 %.o %.i %.s:
 	$(UpdatePCH) 
@@ -179,7 +128,6 @@
 # this should force everything to be rebuilt
 clean: 
 	rm -f $(GENERATED)/*.class
-	$(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
 	$(MAKE) -f vm.make $(MFLAGS) clean
 
 # just in case it doesn't, this should do it
--- a/make/linux/makefiles/vm.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/vm.make	Fri Jan 07 18:18:08 2011 +0100
@@ -35,9 +35,10 @@
 # Defs
 
 GENERATED     = ../generated
+DEP_DIR       = $(GENERATED)/dependencies
 
-# read a generated file defining the set of .o's and the .o .h dependencies
-include $(GENERATED)/Dependencies
+# reads the generated files defining the set of .o's and the .o .h dependencies
+-include $(DEP_DIR)/*.d
 
 # read machine-specific adjustments (%%% should do this via buildtree.make?)
 ifeq ($(ZERO_BUILD), true)
@@ -47,16 +48,16 @@
 endif
 
 # set VPATH so make knows where to look for source files
-# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
-# The incls directory contains generated header file lists for inclusion.
+# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
 # The adfiles directory contains ad_<arch>.[ch]pp.
 # The jvmtifiles directory contains jvmti*.[ch]pp
-Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
+VPATH += $(Src_Dirs_V:%=%:)
 
-# set INCLUDES for C preprocessor
-Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
-INCLUDES += $(Src_Dirs_I:%=-I%)
+# set INCLUDES for C preprocessor.
+Src_Dirs_I += $(GENERATED)
+# The order is important for the precompiled headers to work.
+INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
 
 ifeq (${VERSION}, debug)
   SYMFLAG = -g
@@ -118,6 +119,64 @@
 LIBJVM   = lib$(JVM).so
 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
 
+CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
+CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
+CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
+CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
+CORE_PATHS += $(GENERATED)/jvmtifiles
+
+COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
+
+COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
+COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
+COMPILER2_PATHS +=  $(GENERATED)/adfiles
+
+# Include dirs per type.
+Src_Dirs/CORE      := $(CORE_PATHS)
+Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
+Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/ZERO      := $(CORE_PATHS)
+Src_Dirs/SHARK     := $(CORE_PATHS)
+Src_Dirs := $(Src_Dirs/$(TYPE))
+
+COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
+COMPILER1_SPECIFIC_FILES := c1_\*
+SHARK_SPECIFIC_FILES     := shark
+ZERO_SPECIFIC_FILES      := zero
+
+# Always exclude these.
+Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+
+# Exclude per type.
+Src_Files_EXCLUDE/CORE      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/TIERED    := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/ZERO      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/SHARK     := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
+
+Src_Files_EXCLUDE +=  $(Src_Files_EXCLUDE/$(TYPE))
+
+# Special handling of arch model.
+ifeq ($(Platform_arch_model), x86_32)
+Src_Files_EXCLUDE += \*x86_64\*
+endif
+ifeq ($(Platform_arch_model), x86_64)
+Src_Files_EXCLUDE += \*x86_32\*
+endif
+
+# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
+define findsrc
+	$(notdir $(shell find $(1)/. ! -name . -prune \
+		-a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
+		-a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
+endef
+
+Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
+
+Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
+
 JVM_OBJ_FILES = $(Obj_Files)
 
 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
@@ -180,10 +239,10 @@
 LINK_VM = $(LINK_LIB.c)
 
 # rule for building precompiled header
-$(PRECOMPILED_HEADER): $(Precompiled_Files)
+$(PRECOMPILED_HEADER):
 	$(QUIETLY) echo Generating precompiled header $@
-	$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls
-	$(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE)
+	$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
+	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
 
 # making the library:
 
@@ -252,7 +311,7 @@
 
 #----------------------------------------------------------------------
 
-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
 
 install: install_jvm install_jsig install_saproc
 
--- a/make/linux/makefiles/zero.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/linux/makefiles/zero.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2009 Red Hat, Inc.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -25,7 +25,7 @@
 
 # Setup for Zero (non-Shark) version of VM
 
-# Select which includeDB files to use (in top.make)
+# Select which files to use (in top.make)
 TYPE = ZERO
 
 # Install libjvm.so, etc in in server directory.
--- a/make/solaris/makefiles/adlc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/adlc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -42,16 +42,14 @@
 SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
 	     $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 
 
-Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
-
 EXEC	= $(OUTDIR)/adlc
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc
+VPATH += $(Src_Dirs_V:%=%:)
 
 # set INCLUDES for C preprocessor
-Src_Dirs_I = ${Src_Dirs} $(GENERATED)
+Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)
 INCLUDES += $(Src_Dirs_I:%=-I%)
 
 # set flags for adlc compilation
--- a/make/solaris/makefiles/amd64.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/amd64.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,6 @@
 # Must also specify if CPU is little endian
 CFLAGS += -DVM_LITTLE_ENDIAN
 
-# Not included in includeDB because it has no dependencies
-Obj_Files += solaris_x86_64.o
-
 #
 # Special case flags for compilers and compiler versions on amd64.
 #
--- a/make/solaris/makefiles/buildtree.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/buildtree.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
 # HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
-# HOTSPOT_BUILD_VERSION   - internal, PRTjob ID, JPRTjob ID
+# HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
 # Builds the directory trees with makefiles plus some convenience files in
@@ -106,7 +106,7 @@
 COMPILER	= $(shell sed -n 's/^compiler[ 	]*=[ 	]*//p' $(PLATFORM_FILE))
 
 SIMPLE_DIRS	= \
-	$(PLATFORM_DIR)/generated/incls \
+	$(PLATFORM_DIR)/generated/dependencies \
 	$(PLATFORM_DIR)/generated/adfiles \
 	$(PLATFORM_DIR)/generated/jvmtifiles
 
@@ -117,7 +117,7 @@
 BUILDTREE_MAKE	= $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 
 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
-        env.ksh env.csh .dbxrc test_gamma
+        env.ksh env.csh jdkpath.sh .dbxrc test_gamma
 
 BUILDTREE_VARS	= GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 	ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -191,11 +191,27 @@
 	echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
 	echo "$(LP64_SETTING/$(DATA_MODE))"; \
 	echo; \
-	echo "Src_Dirs = \\"; \
+	echo "# Used for platform dispatching"; \
+	echo "TARGET_DEFINES  = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
+	echo "CFLAGS += \$$(TARGET_DEFINES)"; \
+	echo; \
+	echo "Src_Dirs_V = \\"; \
 	sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
 	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
+	echo; \
+	echo "Src_Dirs_I = \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
+	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
 	[ -n "$(CFLAGS_BROWSE)" ] && \
 	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
 	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
@@ -298,6 +314,13 @@
 	sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
 	) > $@
 
+jdkpath.sh: $(BUILDTREE_MAKE)
+	@echo Creating $@ ...
+	$(QUIETLY) ( \
+	$(BUILDTREE_COMMENT); \
+	echo "JDK=${JAVA_HOME}"; \
+	) > $@	   
+
 .dbxrc:  $(BUILDTREE_MAKE)
 	@echo Creating $@ ...
 	$(QUIETLY) ( \
--- a/make/solaris/makefiles/core.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/core.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,7 @@
 
 # Sets make macros for making core version of VM
 
-# Note the effect on includeDB lists in top.make:
-# includeDB_compiler* and ad_<arch>.*pp are excluded from the build,
+# Select which files to use (in top.make)
 TYPE=CORE
 
 # There is no "core" directory in JDK. Install core build in server directory.
--- a/make/solaris/makefiles/defs.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/defs.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/solaris/makefiles/dtrace.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/dtrace.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,6 @@
 
 # making libjvm_db
 
-INCLS = $(GENERATED)/incls
-
 # Use mapfile with libjvm_db.so
 LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
 LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
@@ -114,7 +112,7 @@
 endif
 
 lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
-                  $(INCLS)/_vmStructs.cpp.incl $(LIBJVM.o)
+                  $(LIBJVM.o)
 	$(QUIETLY) $(CCC) $(CPPFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
 		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
 
@@ -161,6 +159,27 @@
              $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
 	$(QUIETLY) cat $^ > $@
 
+DTraced_Files = ciEnv.o \
+                classLoadingService.o \
+                compileBroker.o \
+                hashtable.o \
+                instanceKlass.o \
+                java.o \
+                jni.o \
+                jvm.o \
+                memoryManager.o \
+                nmethod.o \
+                objectMonitor.o \
+                runtimeService.o \
+                sharedRuntime.o \
+                synchronizer.o \
+                thread.o \
+                unsafe.o \
+                vmThread.o \
+                vmCMSOperations.o \
+                vmPSOperations.o \
+                vmGCOperations.o \
+
 # Dtrace is available, so we build $(DTRACE.o)  
 $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
 	@echo Compiling $(DTRACE).d
--- a/make/solaris/makefiles/fastdebug.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/fastdebug.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/solaris/makefiles/gcc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/gcc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -47,9 +47,13 @@
 
 # check for precompiled headers support
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
 USE_PRECOMPILED_HEADER=1
 PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
+PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
+PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+endif
 endif
 
 
@@ -131,6 +135,17 @@
 endif
 
 OPT_CFLAGS/NOOPT=-O0
+
+# Flags for generating make dependency flags.
+ifneq ("${CC_VER_MAJOR}", "2")
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/make/solaris/makefiles/i486.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/i486.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@
 CFLAGS += -DVM_LITTLE_ENDIAN
 
 # TLS helper, assembled from .s file
-# Not included in includeDB because it has no dependencies
-Obj_Files += solaris_x86_32.o
 
 #
 # Special case flags for compilers and compiler versions on i486.
--- a/make/solaris/makefiles/jvmti.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/jvmti.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -36,11 +36,10 @@
 
 JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims
 InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter
-Src_Dirs += $(JvmtiSrcDir)
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs}
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(JvmtiSrcDir)
+VPATH += $(Src_Dirs_V:%=%:)
 
 JvmtiGeneratedNames = \
         jvmtiEnv.hpp \
--- a/make/solaris/makefiles/launcher.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/launcher.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,22 @@
 
 # Rules to build gamma launcher, used by vm.make
 
-# gamma[_g]: launcher
+LAUNCHER_SCRIPT = hotspot
 LAUNCHER   = gamma
-LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX)
 
-LAUNCHERDIR   = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher
+LAUNCHERDIR   = $(GAMMADIR)/src/os/posix/launcher
+LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
 LAUNCHERFLAGS = $(ARCHFLAG) \
                 -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
+                -I$(LAUNCHERDIR_SHARE) \
                 -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+                -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+                -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
                 -DARCH=\"$(LIBARCH)\" \
                 -DGAMMA \
                 -DLAUNCHER_TYPE=\"gamma\" \
-                -DLINK_INTO_$(LINK_INTO)
+                -DLINK_INTO_$(LINK_INTO) \
+                $(TARGET_DEFINES)
 
 ifeq ($(LINK_INTO),AOUT)
   LAUNCHER.o                 = launcher.o $(JVM_OBJ_FILES)
@@ -68,24 +72,37 @@
 #LAUNCHERFLAGS += -W0,-noglobal
 endif # Platform_compiler == sparcWorks
 
-launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c
-	$(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS)
+LAUNCHER_OUT = launcher
+
+SUFFIXES += .d
+
+SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
+SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
+
+OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
+
+DEPFILES := $(patsubst %.o,%.d,$(OBJS))
+-include $(DEPFILES)
 
-launcher.c:
-	@echo Generating $@
-	$(QUIETLY) { \
-	echo '#define debug launcher_debug'; \
-	echo '#include "java.c"'; \
-	echo '#include "java_md.c"'; \
-	} > $@
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
 
-$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE)
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
+
+$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
 ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
-	@echo Linking launcher...
+	$(QUIETLY) echo Linking launcher...
 	$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
-	$(QUIETLY) \
-	$(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER)
+	$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
 	$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
-	[ -f $(LAUNCHER_G) ] || ln -s $@ $(LAUNCHER_G)
 endif # filter -sbfast -xsbfast
 
+$(LAUNCHER): $(LAUNCHER_SCRIPT)
+
+$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
+	$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
+	$(QUIETLY) chmod +x $@
+
--- a/make/solaris/makefiles/makedeps.make	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 1999, 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#  
-#
-
-include $(GAMMADIR)/make/solaris/makefiles/rules.make
-
-COMPILE.JAVAC.FLAGS += -d $(OUTDIR)
-
-MakeDepsSources=\
-	$(GAMMADIR)/src/share/tools/MakeDeps/Database.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java
-
-MakeDepsOptions=
--- a/make/solaris/makefiles/optimized.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/optimized.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/solaris/makefiles/product.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/product.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/solaris/makefiles/rules.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/rules.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -151,14 +151,14 @@
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
-	$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
 else
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
 	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
-         $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
-         $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
+	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
 endif
 
 %.o: %.s
--- a/make/solaris/makefiles/saproc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/saproc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -44,10 +44,9 @@
 
 # if $(AGENT_DIR) does not exist, we don't build SA
 
-checkAndBuildSA:
-	$(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \
-	   $(MAKE) -f vm.make $(LIBSAPROC); \
-	fi
+ifneq ($(wildcard $(AGENT_DIR)),)
+  BUILDLIBSAPROC = $(LIBSAPROC)
+endif
 
 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
 
@@ -75,10 +74,10 @@
 	           -ldl -ldemangle -lthread -lc
 	[ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
 
-install_saproc: checkAndBuildSA
+install_saproc: $(BULDLIBSAPROC)
 	$(QUIETLY) if [ -f $(LIBSAPROC) ] ; then             \
 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
 	fi
 
-.PHONY: checkAndBuildSA install_saproc
+.PHONY: install_saproc
--- a/make/solaris/makefiles/sparcWorks.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/sparcWorks.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -145,7 +145,15 @@
 OPT_CFLAGS/O2=-xO2
 OPT_CFLAGS/NOOPT=-xO1
 
-#################################################
+# Flags for creating the dependency files.
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
+################################################
 # Begin current (>=5.9) Forte compiler options #
 #################################################
 
--- a/make/solaris/makefiles/sparcv9.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/sparcv9.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
 #  
 #
 
-Obj_Files += solaris_sparc.o
 ASFLAGS += $(AS_ARCHFLAG)
 
 ifeq ("${Platform_compiler}", "sparcWorks")
--- a/make/solaris/makefiles/top.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/top.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 #   -generate sa-jdi.jar (JDI binding to core files)
 
 # It assumes the following flags are set:
-# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Jvm_Obj_Files
+# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Jvm_Obj_Files
 
 # -- D. Ungar (5/97) from a file by Bill Bush
 
@@ -44,42 +44,7 @@
 Plat_File   = $(Platform_file)
 CDG         = cd $(GENERATED); 
 
-# Pick up MakeDeps' sources and definitions
-include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
-MakeDepsClass = MakeDeps.class
-MakeDeps    = $(RUN.JAVA) -classpath . MakeDeps
-
-Include_DBs/GC     = $(VM)/includeDB_gc \
-                     $(VM)/includeDB_gc_parallel \
-                     $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
-                     $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
-                     $(VM)/gc_implementation/includeDB_gc_parNew \
-                     $(VM)/gc_implementation/includeDB_gc_g1 \
-                     $(VM)/gc_implementation/includeDB_gc_serial \
-                     $(VM)/gc_implementation/includeDB_gc_shared
-
-
-Include_DBs/KERNEL      = $(VM)/includeDB_core $(VM)/includeDB_gc \
-                          $(VM)/gc_implementation/includeDB_gc_serial \
-                          $(VM)/includeDB_jvmti \
-                          $(VM)/includeDB_compiler1
-
-Include_DBs/CORE        = $(VM)/includeDB_core   $(Include_DBs/GC) \
-                          $(VM)/includeDB_jvmti \
-                          $(VM)/includeDB_features
-Include_DBs/COMPILER1   = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
-Include_DBs/COMPILER2   = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
-Include_DBs/TIERED      = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 \
-                          $(VM)/includeDB_compiler2
-
-Include_DBs = $(Include_DBs/$(TYPE))
-
-Cached_plat = platform.current
-Cached_db   = includeDB.current
-
-Incremental_Lists =$(GENERATED)/$(Cached_db)
-# list generation also creates $(GENERATED)/$(Cached_plat)
-
+Cached_plat = $(GENERATED)/platform.current
 
 AD_Dir   = $(GENERATED)/adfiles
 ADLC     = $(AD_Dir)/adlc
@@ -98,7 +63,7 @@
 MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
 
 
-# default target: make makeDeps, update lists, make vm
+# default target: update lists, make vm
 # done in stages to force sequential order with parallel make
 #
 
@@ -106,38 +71,18 @@
 	@echo All done.
 
 # This is an explicit dependency for the sake of parallel makes.
-vm_build_preliminaries:  checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
+vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff
 	@# We need a null action here, so implicit rules don't get consulted.
 
-# make makeDeps: (and zap the cached db files to force a nonincremental run)
-
-$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
-	@$(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources)
-	@echo Removing $(Incremental_Lists) to force regeneration.
-	@rm -f $(Incremental_Lists)
-	@$(CDG) echo >$(Cached_plat)
-
-# make incremental_lists, if cached files out of date, run makeDeps
-
-$(Incremental_Lists):  $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
-	$(CDG)  cat $(Include_DBs) > includeDB
-	$(CDG) if [ ! -r incls ] ; then \
-	mkdir incls ; \
-	fi
-	$(CDG)  $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) includeDB $(MakeDepsOptions)
-	$(CDG)  cp includeDB    $(Cached_db)
-	$(CDG)  cp $(Plat_File) $(Cached_plat)
-
-# symbolic target for command lines
-lists: $(Incremental_Lists)
-	@: lists are now up to date
+$(Cached_plat): $(Plat_File)
+	$(CDG) cp $(Plat_File) $(Cached_plat)
 
 # make AD files as necessary
-ad_stuff: $(Incremental_Lists) $(adjust-mflags)
+ad_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f adlc.make $(MFLAGS-adjusted)
 
 # generate JVMTI files from the spec
-jvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
+jvmti_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
 
 # generate SA jar files and native header
@@ -172,7 +117,6 @@
 # this should force everything to be rebuilt
 clean: 
 	rm -f $(GENERATED)/*.class
-	$(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
 	$(MAKE) -f vm.make $(MFLAGS) clean
 
 # just in case it doesn't, this should do it
--- a/make/solaris/makefiles/vm.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/solaris/makefiles/vm.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -35,23 +35,23 @@
 # Defs
 
 GENERATED     = ../generated
+DEP_DIR       = $(GENERATED)/dependencies
 
-# read a generated file defining the set of .o's and the .o .h dependencies
-include $(GENERATED)/Dependencies
+# reads the generated files defining the set of .o's and the .o .h dependencies
+-include $(DEP_DIR)/*.d
 
 # read machine-specific adjustments (%%% should do this via buildtree.make?)
 include $(MAKEFILES_DIR)/$(BUILDARCH).make
 
 # set VPATH so make knows where to look for source files
-# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
-# The incls directory contains generated header file lists for inclusion.
+# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
 # The adfiles directory contains ad_<arch>.[ch]pp.
 # The jvmtifiles directory contains jvmti*.[ch]pp
-Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
+VPATH += $(Src_Dirs_V:%=%:)
 
 # set INCLUDES for C preprocessor
-Src_Dirs_I = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED) 
+Src_Dirs_I += $(GENERATED)
 INCLUDES += $(Src_Dirs_I:%=-I%)
 
 ifeq (${VERSION}, debug)
@@ -106,17 +106,17 @@
 # Not sure what the 'designed for' comment is referring too above.
 #   The order may not be too significant anymore, but I have placed this
 #   older libm before libCrun, just to make sure it's found and used first.
-LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc
+LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle
 else
 ifeq ($(COMPILER_REV_NUMERIC), 502)
 # SC6.1 has it's own libm.so: specifying anything else provokes a name conflict.
-LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor
+LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle
 else
-LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor
+LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle
 endif # 502
 endif # 505
 else
-LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
+LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle
 endif # sparcWorks
 
 # By default, link the *.o into the library, not the executable.
@@ -135,6 +135,64 @@
 LIBJVM   = lib$(JVM).so
 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
 
+CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
+CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
+CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
+CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
+CORE_PATHS += $(GENERATED)/jvmtifiles
+
+COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
+
+COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
+COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
+COMPILER2_PATHS +=  $(GENERATED)/adfiles
+
+# Include dirs per type.
+Src_Dirs/CORE      := $(CORE_PATHS)
+Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
+Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/ZERO      := $(CORE_PATHS)
+Src_Dirs/SHARK     := $(CORE_PATHS)
+Src_Dirs := $(Src_Dirs/$(TYPE))
+
+COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
+COMPILER1_SPECIFIC_FILES := c1_\*
+SHARK_SPECIFIC_FILES     := shark
+ZERO_SPECIFIC_FILES      := zero
+
+# Always exclude these.
+Src_Files_EXCLUDE := dtrace jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+
+# Exclude per type.
+Src_Files_EXCLUDE/CORE      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/TIERED    := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/ZERO      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/SHARK     := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
+
+Src_Files_EXCLUDE +=  $(Src_Files_EXCLUDE/$(TYPE))
+
+# Special handling of arch model.
+ifeq ($(Platform_arch_model), x86_32)
+Src_Files_EXCLUDE += \*x86_64\*
+endif
+ifeq ($(Platform_arch_model), x86_64)
+Src_Files_EXCLUDE += \*x86_32\*
+endif
+
+# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
+define findsrc
+	$(notdir $(shell find $(1)/. ! -name . -prune \
+		-a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
+		-a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
+endef
+
+Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
+
+Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
+
 JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
 
 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
@@ -205,7 +263,7 @@
 
 #----------------------------------------------------------------------
 
-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) checkAndBuildSA dtraceCheck
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck
 
 install: install_jvm install_jsig install_saproc
 
--- a/make/windows/README	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-Copyright (c) 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.
-  
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
- 
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-  
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
-
-________________________________________________________________________________
-
-__Introduction__________________________________________________________________
-
-This readme file should provide all the information needed to build
-the HotSpot VM for Windows 95/Windows NT from its teamware workspace.
-It is intended as a starting point for people who want to learn how
-to work with the current HotSpot source workspace and who need to
-build the VM locally. It is not intended as a tutorial for licensees.
-
-Last update: 03/28/05
-
-
-__Platform______________________________________________________________________
-
-The VM builds under the following platforms:
-- Windows NT 4.0 on Intel x486 or greater
-- x486 PC (or greater), 32MByte or more
-
-
-__Tools_________________________________________________________________________
-
-For building/testing the following tools need to be available:
-- Microsoft Visual C++ 6.0 (with nmake version 1.62.7022 or greater)
-- MKS Toolkit 6.1 or greater
-  see: /net/reinstall/export/vol0/pc-archive/software/mks6.1 (NFS)
-   or: \\reinstall\pc-archive\software\mks6.1                (NT)
-
-
-__JDK___________________________________________________________________________
-
-The workspace works with the following version of the JDK:
-(NOTE: these are out of date)
-- JDK1.2FCS "V" build
-  see: /usr/local/java/jdk1.2/win32
-
-and the following version(s) of HotJava:
-- hjb1.1.4
-- hjb1.1.5
-  see /usr/local/java/hjb1.1.x/win32
-
-
-__Environment variables_________________________________________________________
-
-The following environment variables need to be set up for the IDE
-build process.  For batch builds these do not need to be set.
-
-HotSpotMksHome     points to the (NFS or PC-local) directory where the MKS
-                   executables (like sh.exe and grep.exe) are installed
-
-Optionally you may set the following variables in your environment and they
-will be picked up by the create.bat script used to generate the vm.vcproj files.
-See the section on building within MS Developer Studio for more details.
-
-HotSpotWorkSpace   points to the (NFS) directory where the workspace is located
-HotSpotBuildSpace  points to the (PC-local) directory where the vm is built
-HotSpotReleaseBinDest points to the (NFS or PC-local) directory where the product DLL is
-		      written
-HotSpotDebugBinDest   points to the (NFS or PC-local) directory where the debug DLL is
-		      written
-
-NOTE: For both batch and IDE builds, java and javac must be in your
-PATH, and the versions found by default must work. (If this turns out
-to be a problem, we can define HotSpotJava and HotSpotJavaC for
-bootstrapping...)
-
-__Building the JVM from the command line________________________________________
-
-1) choose a directory in which you want to build the vm
-   (the build process will create a subdirectory)
-
-2) To build the 'core' version (debug || optimized)
-   %HotSpotWorkSpace%\build\windows\build <flavor> core %HotSpotWorkSpace% <jdk_dir>
-   To build the 'compiler2' version (debug || optimized)
-   %HotSpotWorkSpace%\build\windows\build <flavor> compiler2 %HotSpotWorkSpace% <jdk_dir>
-
-   where <jdk_dir> is a full path to a JDK in which bin/java and
-   bin/javac are present and working.
-
-3) If you have problems with building, first try:
-   vcvars32 <CR> (sets path for VC++)
-
-4) In addition to jvm.dll, the Serviceability Agent (SA) based JDI connector 
-   and command line tools are built if dbgeng.h and dbgeng.lib
-   can be located, and BUILD_WIN_SA=1 is specified.   We look for dbgeng.h here:
-        $(MSVCDIR)\PlatformSDK\Include
-        $(SYSTEMROOT)\..\Program Files\Microsoft SDK\include
-
-  The first directory is part of  Visual Studio VC .NET 2003.
-  The second is used on Windows-amd64.
-
-
-__Building the JVM from within MS Developer Studio______________________________
-
-0) Set environment variables as described above
-
-1) Run the following script:
-   %HotSpotWorkSpace%\build\windows\create <type> { <workspace> <buildspace> <productbindest> <debugbindest> }
-   where type is one of core, compiler1, compiler2.  If you leave off the
-   "<workspace> <buildspace> <productbindest> <debugbindest>" part, the script expects to find their
-   values in the HotSpotWorkSpace, HotSpotBuildSpace, HotSpotReleaseBinDest, and HotSpotDebugBinDest environment
-   variables.  The resulting vm.vcproj does not depend on these values in the environment.
-
-   This will populate the build space with the appropriate makefiles
-   and run nmake in it. This builds and runs makedeps, which now
-   generates the appropriate vm.vcproj into the build space. It also
-   builds and runs adlc.
-
-   To regenerate the .incl and .dsp files after changing the include
-   databases, just run nmake in the build space.
-
-   The build process now relies on java and javac. For the IDE builds,
-   the full path to a JDK (in which bin/java and bin/javac are present
-   and working) can be specified either explicitly with the
-   ALT_BOOTDIR environment variable (like the JDK build process), via
-   the JDK build's default BOOTDIR environment variable, via JAVA_HOME,
-   or implicitly via the PATH.
-
-   (Note that there are now many more command line options to MakeDeps
-   on the Windows platform than before. These have been bundled into
-   makefiles/makedeps.make, but it is still necessary to keep this in
-   sync with the batch makefiles, in vm/generated.)
-
-   If you have problems with building (i.e,. finding nmake), first try:
-   vcvars32 <CR> (sets path for VC++)
-
-2) Double-click the vm.vcproj file in the %HotSpotBuildSpace% directory
-   to open MS Developer Studio.
-
-3) build desired or all versions:
-   menu Build -> Batch Build... -> Build (or Rebuild All)
-
-4) jvm.dll is in the %HotSpotReleaseBinDest% or %HotSpotDebugBinDest% directory
-   depending on which configuration you built (release or debug).
-
-Note: do not edit any of the files (especially the vm.vcproj file) in the
-build space, since they are all either autogenerated or copied from
-the work space. If necessary, modify the original Makefiles in
-%HotSpotWorkSpace%\build\windows\projectfiles, or the shared
-makedeps arguments in
-%HotSpotWorkSpace%\build\windows\makefiles\makedeps.make.
-
-Note that it appears that some options set in the IDE (for example,
-the default executable) show up not in the .dsp file, but in the .opt
-file, so the automatic regeneration of the .dsp file should not
-destroy the project settings. However, makedeps.make should be edited
-to supply per-file compiler options.
-
-To build adlc from within the IDE for debugging purposes:
-
-1) in MS Developer Studio, open ADLCompiler.dsw:
-   menu File -> Open Workspace...
-   select & double-click ADLCompiler.dsw
-
-2) rebuild all (debug mode is enough)
-   menu Build -> Rebuild All (make sure Win32 Debug version is selected)
-
-
-__Testing the VM________________________________________________________________
-
-To test the VM using the Tonga Testsuite, use testlook. testlook is a very
-simple testing framework on top of Tonga which allows us to use one (Tonga)
-test file, that can be extended with attributes.
-
-1) copy %HotSpotWorkSpace%\test\testlook.bat onto PC (preferably
-   %HotSpotBuildSpace%\bin, which should ideally be in the path)
-
-2) run testlook <cr> or testlook help <cr> for details
-
-3) to run testlook you need to have Tonga mounted:
-   net use T: \\tapas\export1\psqe
-
-
-__HotJava under HotSpot_________________________________________________________
-
-To run HotJava, use the .bat file %HotSpotWorkSpace%\test\h.bat. Copy
-it into %HotSpotBuildSpace%/<flavor> (which ideally is in the path) and run
-HotJava: h java <flags> (e.g., h java_g -Xint).
-
-
-__Preferred directory setup under Windows NT____________________________________
-
-Within the HotSpot group we are using the following directory setup:
-
-D:\jdk1.2          - where we install the JDK
-
-The following drives are mounted for testing/putbacks/etc.:
-
-net use T: \\tapas\export1\psqe
-net use Y: \\rschmidt\GammaBase
-net use Z: \\animorphic\animorphic
--- a/make/windows/build.bat	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/build.bat	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 @echo off
 REM
-REM Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+REM Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 REM
 REM This code is free software; you can redistribute it and/or modify it
--- a/make/windows/build_vm_def.sh	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/build_vm_def.sh	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,9 @@
 echo "EXPORTS" > vm1.def
 
 AWK="$MKS_HOME/awk.exe"
+if [ ! -e $AWK ]; then
+    AWK="$MKS_HOME/gawk.exe"
+fi
 GREP="$MKS_HOME/grep.exe"
 SORT="$MKS_HOME/sort.exe"
 UNIQ="$MKS_HOME/uniq.exe"
@@ -57,7 +60,7 @@
 LINK_VER="$1"
 fi
 
-if [ "x$LINK_VER" != "x800" -a  "x$LINK_VER" != "x900" ]; then
+if [ "x$LINK_VER" != "x800" -a  "x$LINK_VER" != "x900" -a "x$LINK_VER" != "x1000" ]; then
 $DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def
 else
 # Can't use pipes when calling cl.exe or link.exe from IDE. Using transit file vm3.def
--- a/make/windows/create.bat	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/create.bat	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 @echo off
 REM
-REM Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+REM Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 REM
 REM This code is free software; you can redistribute it and/or modify it
@@ -26,11 +26,8 @@
 REM This is the interactive build setup script (as opposed to the batch
 REM build execution script). It creates $HotSpotBuildSpace if necessary,
 REM copies the appropriate files out of $HotSpotWorkSpace into it, and
-REM builds and runs MakeDeps in it. This has the side-effect of creating
+REM builds and runs ProjectCreator in it. This has the side-effect of creating
 REM the vm.vcproj file in the buildspace, which is then used in Visual C++.
-REM 
-REM The generated project file depends upon the include databases. If
-REM those are changed then MakeDeps is rerun.
 
 REM
 REM Since we don't have uname and we could be cross-compiling,
@@ -39,6 +36,20 @@
 REM Note: Running this batch file from the Windows command shell requires
 REM that "grep" be accessible on the PATH. An MKS install does this.
 REM 
+
+cl 2>NUL >NUL
+if %errorlevel% == 0 goto nexttest
+echo Make sure cl.exe is in your PATH before running this script.
+goto end
+
+:nexttest
+grep -V 2>NUL >NUL
+if %errorlevel% == 0 goto testit
+echo Make sure grep.exe is in your PATH before running this script. Either cygwin or MKS should work.
+goto end
+
+
+:testit
 cl 2>&1 | grep "IA-64" >NUL
 if %errorlevel% == 0 goto isia64
 cl 2>&1 | grep "AMD64" >NUL
@@ -49,37 +60,40 @@
 set BUILDARCH=i486
 set Platform_arch=x86
 set Platform_arch_model=x86_32
-goto end
+goto done
 :amd64
 set ARCH=x86
 set BUILDARCH=amd64
 set Platform_arch=x86
 set Platform_arch_model=x86_64
-goto end
+goto done
 :isia64
 set ARCH=ia64
 set BUILDARCH=ia64
 set Platform_arch=ia64
 set Platform_arch_model=ia64
-:end
+:done
 
 setlocal
 
 if "%1" == "" goto usage
 
-if not "%4" == "" goto usage
+if not "%2" == "" goto usage
 
-set HotSpotWorkSpace=%1
-set HotSpotBuildSpace=%2
-set HotSpotJDKDist=%3
+REM Set HotSpotWorkSpace to the directy two steps above this script
+for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi)
+set HotSpotBuildRoot=%HotSpotWorkSpace%build
+set HotSpotBuildSpace=%HotSpotBuildRoot%\vs
+set HotSpotJDKDist=%1
+
 
 REM figure out MSC version
 for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i
 
 echo **************************************************************
-set ProjectFile=vm.vcproj
+set ProjectFile=jvm.vcproj
 if "%MSC_VER%" == "1200" (
-set ProjectFile=vm.dsp
+set ProjectFile=jvm.dsp
 echo Will generate VC6 project {unsupported}
 ) else (
 if "%MSC_VER%" == "1400" (
@@ -88,10 +102,16 @@
 if "%MSC_VER%" == "1500" (
 echo Will generate VC9 {Visual Studio 2008}
 ) else (
+if "%MSC_VER%" == "1600" (
+echo Detected Visual Studio 2010, but
+echo will generate VC9 {Visual Studio 2008}
+echo Use conversion wizard in VS 2010.
+) else (
 echo Will generate VC7 project {Visual Studio 2003 .NET}
 )
 )
 )
+)
 echo                            %ProjectFile%
 echo **************************************************************
 
@@ -123,6 +143,8 @@
 
 :test3
 if not "%HOTSPOTMKSHOME%" == "" goto makedir
+if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin
+if not "%HOTSPOTMKSHOME%" == "" goto makedir
 echo Warning: please set variable HOTSPOTMKSHOME to place where 
 echo          your MKS/Cygwin installation is
 echo.
@@ -138,21 +160,24 @@
 REM This is now safe to do.
 :copyfiles
 for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
-if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i
-copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL
+if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
+copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
 )
 
 REM force regneration of ProjectFile
 if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile%
 
 for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
-
-echo # Generated file!                                                 >    %HotSpotBuildSpace%\%%i\local.make
+echo -- %%i --
+echo # Generated file!                                                        >    %HotSpotBuildSpace%\%%i\local.make
 echo # Changing a variable below and then deleting %ProjectFile% will cause  >>    %HotSpotBuildSpace%\%%i\local.make
 echo # %ProjectFile% to be regenerated with the new values.  Changing the    >>    %HotSpotBuildSpace%\%%i\local.make
-echo # version requires rerunning create.bat.                         >>    %HotSpotBuildSpace%\%%i\local.make
+echo # version requires rerunning create.bat.                                >>    %HotSpotBuildSpace%\%%i\local.make
 echo.                                      >>    %HotSpotBuildSpace%\%%i\local.make
+echo Variant=%%i			   >>    %HotSpotBuildSpace%\%%i\local.make
+echo WorkSpace=%HotSpotWorkSpace%   	   >>    %HotSpotBuildSpace%\%%i\local.make
 echo HOTSPOTWORKSPACE=%HotSpotWorkSpace%   >>    %HotSpotBuildSpace%\%%i\local.make
+echo HOTSPOTBUILDROOT=%HotSpotBuildRoot%   >>    %HotSpotBuildSpace%\%%i\local.make
 echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >>    %HotSpotBuildSpace%\%%i\local.make
 echo HOTSPOTJDKDIST=%HotSpotJDKDist%       >>    %HotSpotBuildSpace%\%%i\local.make
 echo ARCH=%ARCH%                           >>    %HotSpotBuildSpace%\%%i\local.make
@@ -160,29 +185,37 @@
 echo Platform_arch=%Platform_arch%         >>    %HotSpotBuildSpace%\%%i\local.make
 echo Platform_arch_model=%Platform_arch_model% >>    %HotSpotBuildSpace%\%%i\local.make
 
-REM build config specific stuff
+for /D %%j in (debug, fastdebug, product) do (
+if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j
+)
 
-pushd %HotSpotBuildSpace%\%%i
+pushd %HotSpotBuildSpace%\%%i\generated
 nmake /nologo
 popd
+
 )
 
+pushd %HotSpotBuildRoot%
+
+REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables
+nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %HotSpotBuildRoot%/%ProjectFile%
+
+popd
+
 goto end
 
 :usage
-echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist
+echo Usage: create HotSpotJDKDist
 echo.
-echo This is the interactive build setup script (as opposed to the batch
-echo build execution script). It creates HotSpotBuildSpace if necessary,
-echo copies the appropriate files out of HotSpotWorkSpace into it, and
-echo builds and runs MakeDeps in it. This has the side-effect of creating
+echo This is the VS build setup script (as opposed to the batch
+echo build execution script). It creates a build directory if necessary,
+echo copies the appropriate files out of the workspace into it, and
+echo builds and runs ProjectCreator in it. This has the side-effect of creating
 echo the %ProjectFile% file in the build space, which is then used in Visual C++.
-echo The HotSpotJDKDist defines place where JVM binaries should be placed.
+echo.
+echo The HotSpotJDKDist defines the JDK that should be used when running the JVM.
 echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection.
 echo.
-echo The generated project file depends upon the include databases. If
-echo those are changed then MakeDeps is rerun.
-echo.
 echo NOTE that it is now NOT safe to modify any of the files in the build
 echo space, since they may be overwritten whenever this script is run or
 echo nmake is run in that directory.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/windows/create_obj_files.sh	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,128 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+set -e
+
+# Note that we currently do not have a way to set HotSpotMksHome in
+# the batch build, but so far this has not seemed to be a problem. The
+# reason this environment variable is necessary is that it seems that
+# Windows truncates very long PATHs when executing shells like MKS's
+# sh, and it has been found that sometimes `which sh` fails.
+
+if [ "x$HotSpotMksHome" != "x" ]; then
+  TOOL_DIR="$HotSpotMksHome"
+else
+  # HotSpotMksHome is not set so use the directory that contains "sh".
+  # This works with both MKS and Cygwin.
+  SH=`which sh`
+  TOOL_DIR=`dirname "$SH"`
+fi
+
+DIRNAME="$TOOL_DIR/dirname"
+FIND="$TOOL_DIR/find"
+
+TYPE=$1
+Platform_arch=$2
+Platform_arch_model=$3
+Platform_os_family=windows
+Platform_os_arch=windows_$Platform_arch
+
+WorkSpace=$4
+GENERATED=$5
+
+BASE_PATHS="` $FIND ${WorkSpace}/src/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/share/vm/gc_implementation/shared"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os/${Platform_os_family}/vm"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/cpu/${Platform_arch}/vm"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os_cpu/${Platform_os_arch}/vm"
+BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles"
+
+CORE_PATHS="${BASE_PATHS}"
+# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
+CORE_PATHS="${CORE_PATHS} `$FIND ${WorkSpace}/src/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
+
+COMPILER1_PATHS="${WorkSpace}/src/share/vm/c1"
+
+COMPILER2_PATHS="${WorkSpace}/src/share/vm/opto"
+COMPILER2_PATHS="${COMPILER2_PATHS} ${WorkSpace}/src/share/vm/libadt"
+COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"
+
+# Include dirs per type.
+case "${TYPE}" in
+    "core")      Src_Dirs="${CORE_PATHS}" ;;
+    "kernel")    Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;
+    "compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;;
+    "compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;;
+    "tiered")    Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
+    "zero")      Src_Dirs="${CORE_PATHS}" ;;
+    "shark")     Src_Dirs="${CORE_PATHS}" ;;
+esac
+
+COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp chaitin* c2_* runtime_*"
+COMPILER1_SPECIFIC_FILES="c1_*"
+SHARK_SPECIFIC_FILES="shark"
+ZERO_SPECIFIC_FILES="zero"
+
+# These files need to be excluded when building the kernel target.
+KERNEL_EXCLUDED_FILES="attachListener.cpp attachListener_windows.cpp dump.cpp dump_${Platform_arch_model}.cpp forte.cpp fprofiler.cpp heapDumper.cpp heapInspection.cpp jniCheck.cpp jvmtiCodeBlobEvents.cpp jvmtiExtensions.cpp jvmtiImpl.cpp jvmtiRawMonitor.cpp jvmtiTagMap.cpp jvmtiTrace.cpp restore.cpp serialize.cpp vmStructs.cpp g1MemoryPool.cpp psMemoryPool.cpp gcAdaptivePolicyCounters.cpp concurrentGCThread.cpp mutableNUMASpace.cpp allocationStats.cpp gSpaceCounters.cpp immutableSpace.cpp mutableSpace.cpp spaceCounters.cpp yieldingWorkgroup.cpp"
+
+# Always exclude these.
+Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp"
+
+# Exclude per type.
+case "${TYPE}" in
+    "core")      Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
+    "kernel")    Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ${KERNEL_EXCLUDED_FILES} ciTypeFlow.cpp" ;;
+    "compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
+    "compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
+    "tiered")    Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
+    "zero")      Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
+    "shark")     Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES}" ;;
+esac
+
+# Special handling of arch model.
+case "${Platform_arch_model}" in
+	"x86_32") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_64*" ;;
+	"x86_64") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_32*" ;;
+esac
+
+# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
+function findsrc {
+    $FIND ${1}/. ! -name . -prune \
+		-a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
+		-a \! \( -name ${Src_Files_EXCLUDE// / -o -name } \) \
+		| sed 's/.*\/\(.*\)/\1/';
+}
+
+Src_Files=
+for e in ${Src_Dirs}; do
+   Src_Files="${Src_Files}`findsrc ${e}` "
+done 
+
+Obj_Files=
+for e in ${Src_Files}; do
+	Obj_Files="${Obj_Files}${e%\.[!.]*}.obj "
+done
+
+echo Obj_Files=${Obj_Files}
--- a/make/windows/get_msc_ver.sh	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/get_msc_ver.sh	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/windows/makefiles/adlc.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/adlc.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
 #  
 #
 
-!include $(WorkSpace)/make/windows/makefiles/compile.make
 
 # Rules for building adlc.exe
 
@@ -46,27 +45,16 @@
 ADLCFLAGS=-q -T -U_LP64
 !endif
 
-CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE  
+ADLC_CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
 
 CPP_INCLUDE_DIRS=\
-  /I "..\generated"                          \
-  /I "$(WorkSpace)\src\share\vm\compiler"    \
-  /I "$(WorkSpace)\src\share\vm\code"        \
-  /I "$(WorkSpace)\src\share\vm\interpreter" \
-  /I "$(WorkSpace)\src\share\vm\classfile"   \
-  /I "$(WorkSpace)\src\share\vm\asm"         \
-  /I "$(WorkSpace)\src\share\vm\memory"      \
-  /I "$(WorkSpace)\src\share\vm\oops"        \
-  /I "$(WorkSpace)\src\share\vm\prims"       \
-  /I "$(WorkSpace)\src\share\vm\runtime"     \
-  /I "$(WorkSpace)\src\share\vm\utilities"   \
-  /I "$(WorkSpace)\src\share\vm\libadt"      \
-  /I "$(WorkSpace)\src\share\vm\opto"        \
-  /I "$(WorkSpace)\src\os\windows\vm"          \
+  /I "..\generated" \
+  /I "$(WorkSpace)\src\share\vm" \
+  /I "$(WorkSpace)\src\os\windows\vm" \
   /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
 
-# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_INCL
-# and MakeDepsIDEOptions in makedeps.make. 
+# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR
+# and ProjectCreatorIDEOptions in projectcreator.make. 
 GENERATED_NAMES=\
   ad_$(Platform_arch_model).cpp \
   ad_$(Platform_arch_model).hpp \
@@ -81,24 +69,24 @@
   dfa_$(Platform_arch_model).cpp
 
 # NOTE! This must be kept in sync with GENERATED_NAMES
-GENERATED_NAMES_IN_INCL=\
-  incls/ad_$(Platform_arch_model).cpp \
-  incls/ad_$(Platform_arch_model).hpp \
-  incls/ad_$(Platform_arch_model)_clone.cpp \
-  incls/ad_$(Platform_arch_model)_expand.cpp \
-  incls/ad_$(Platform_arch_model)_format.cpp \
-  incls/ad_$(Platform_arch_model)_gen.cpp \
-  incls/ad_$(Platform_arch_model)_misc.cpp \
-  incls/ad_$(Platform_arch_model)_peephole.cpp \
-  incls/ad_$(Platform_arch_model)_pipeline.cpp \
-  incls/adGlobals_$(Platform_arch_model).hpp \
-  incls/dfa_$(Platform_arch_model).cpp
+GENERATED_NAMES_IN_DIR=\
+  $(AdlcOutDir)\ad_$(Platform_arch_model).cpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model).hpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model)_clone.cpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model)_expand.cpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model)_format.cpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model)_gen.cpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model)_misc.cpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model)_peephole.cpp \
+  $(AdlcOutDir)\ad_$(Platform_arch_model)_pipeline.cpp \
+  $(AdlcOutDir)\adGlobals_$(Platform_arch_model).hpp \
+  $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
 
 {$(WorkSpace)\src\share\vm\adlc}.cpp.obj::
-        $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
+        $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
 
 {$(WorkSpace)\src\share\vm\opto}.cpp.obj::
-        $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
+        $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
 
 adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \
           forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj
@@ -110,10 +98,12 @@
 	$(MT) /manifest $@.manifest /outputresource:$@;#1
 !endif
 
-$(GENERATED_NAMES_IN_INCL): $(Platform_arch_model).ad adlc.exe includeDB.current 
+$(GENERATED_NAMES_IN_DIR): $(Platform_arch_model).ad adlc.exe
 	rm -f $(GENERATED_NAMES)
+	if exist $(AdlcOutDir) rmdir /s /q $(AdlcOutDir)
+	mkdir $(AdlcOutDir)
 	$(ADLC) $(ADLCFLAGS) $(Platform_arch_model).ad
-	mv $(GENERATED_NAMES) incls/
+	mv $(GENERATED_NAMES) $(AdlcOutDir)/
 
 $(Platform_arch_model).ad: $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad
 	rm -f $(Platform_arch_model).ad
--- a/make/windows/makefiles/compile.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/compile.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,20 @@
 CPP=ARCH_ERROR
 !endif
 
+CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS"
+
+# Must specify this for sharedRuntimeTrig.cpp
+CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN"
+
+# Used for platform dispatching
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_FAMILY_windows
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_$(Platform_arch)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_COMPILER_visCPP
+
+
 # MSC_VER is a 4 digit number that tells us what compiler is being used
 #    and is generated when the local.make file is created by build.make
 #    via the script get_msc_ver.sh
--- a/make/windows/makefiles/debug.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/debug.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,12 @@
 SAWINDBG=sawindbg.dll
 GENERATED=../generated
 
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
 
 !include ../local.make
 !include compile.make
@@ -38,15 +43,15 @@
 !include $(WorkSpace)/make/windows/makefiles/vm.make
 !include local.make
 
-!include $(GENERATED)/Dependencies
-
 HS_BUILD_ID=$(HS_BUILD_VER)-debug
 
 # Force resources to be rebuilt every time
 $(Res_Files): FORCE
 
-$(AOUT): $(Res_Files) $(Obj_Files)
+vm.def: $(Obj_Files)
 	sh $(WorkSpace)/make/windows/build_vm_def.sh
+
+$(AOUT): $(Res_Files) $(Obj_Files) vm.def
 	$(LINK) @<<
   $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
 <<
@@ -59,3 +64,4 @@
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
+!include $(WorkSpace)/make/windows/makefiles/launcher.make
--- a/make/windows/makefiles/defs.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/defs.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/windows/makefiles/fastdebug.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/fastdebug.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,12 @@
 SAWINDBG=sawindbg.dll
 GENERATED=../generated
 
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
 
 !include ../local.make
 !include compile.make
@@ -38,15 +43,15 @@
 !include $(WorkSpace)/make/windows/makefiles/vm.make
 !include local.make
 
-!include $(GENERATED)/Dependencies
-
 HS_BUILD_ID=$(HS_BUILD_VER)-fastdebug
 
 # Force resources to be rebuilt every time
 $(Res_Files): FORCE
 
-$(AOUT): $(Res_Files) $(Obj_Files)
+vm.def: $(Obj_Files)
 	sh $(WorkSpace)/make/windows/build_vm_def.sh
+
+$(AOUT): $(Res_Files) $(Obj_Files) vm.def
 	$(LINK) @<<
   $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
 <<
@@ -57,6 +62,6 @@
 	$(MT) /manifest $@.manifest /outputresource:$@;#2
 !endif
 
-
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
+!include $(WorkSpace)/make/windows/makefiles/launcher.make
--- a/make/windows/makefiles/generated.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/generated.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 #
 
 !include ../local.make
-!include $(WorkSpace)/make/windows/makefiles/makedeps.make
+!include $(WorkSpace)/make/windows/makefiles/projectcreator.make
 !include local.make
 
 # Pick up rules for building JVMTI (JSR-163)
@@ -33,68 +33,25 @@
 # Pick up rules for building SA
 !include $(WorkSpace)/make/windows/makefiles/sa.make
 
-!if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered")
-default:: includeDB.current Dependencies incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp $(JvmtiGeneratedFiles)
-!else
-default:: includeDB.current Dependencies $(JvmtiGeneratedFiles)
-!endif
-
-# core plus serial gc
-IncludeDBs_base=$(WorkSpace)/src/share/vm/includeDB_core \
-           $(WorkSpace)/src/share/vm/includeDB_jvmti \
-           $(WorkSpace)/src/share/vm/includeDB_gc \
-           $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_serial
+AdlcOutDir=adfiles
 
-# parallel gc
-IncludeDBs_gc= $(WorkSpace)/src/share/vm/includeDB_gc_parallel \
-           $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \
-           $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_shared \
-           $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_parNew \
-           $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \
-           $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_g1
-
-IncludeDBs_core=$(IncludeDBs_base) $(IncludeDBs_gc) \
-                $(WorkSpace)/src/share/vm/includeDB_features
-
-!if "$(Variant)" == "core"
-IncludeDBs=$(IncludeDBs_core)
+!if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered")
+default:: $(AdlcOutDir)/ad_$(Platform_arch_model).cpp $(AdlcOutDir)/dfa_$(Platform_arch_model).cpp $(JvmtiGeneratedFiles) buildobjfiles
+!else
+default:: $(JvmtiGeneratedFiles) buildobjfiles
 !endif
 
-!if "$(Variant)" == "kernel"
-IncludeDBs=$(IncludeDBs_base) $(WorkSpace)/src/share/vm/includeDB_compiler1
-!endif
-
-!if "$(Variant)" == "compiler1"
-IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler1
-!endif
-
-
-!if "$(Variant)" == "compiler2"
-IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler2
-!endif
+buildobjfiles:
+	@ sh $(WorkSpace)/make/windows/create_obj_files.sh $(Variant) $(Platform_arch) $(Platform_arch_model) $(WorkSpace) .	> objfiles.make
 
-!if "$(Variant)" == "tiered"
-IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler1 \
-           $(WorkSpace)/src/share/vm/includeDB_compiler2
-!endif
-
-# Note we don't generate a Visual C++ project file using MakeDeps for
-# the batch build.
-includeDB.current Dependencies: classes/MakeDeps.class $(IncludeDBs)
-	cat $(IncludeDBs) > includeDB
-	if exist incls rmdir /s /q incls
-	mkdir incls
-	$(RUN_JAVA) -Djava.class.path=classes MakeDeps WinGammaPlatform$(VcVersion) $(WorkSpace)/make/windows/platform_$(BUILDARCH) includeDB $(MakeDepsOptions)
-	rm -f includeDB.current
-	cp includeDB includeDB.current
-
-classes/MakeDeps.class: $(MakeDepsSources)
+classes/ProjectCreator.class: $(ProjectCreatorSources)
 	if exist classes rmdir /s /q classes
 	mkdir classes
-	$(COMPILE_JAVAC) -classpath $(WorkSpace)\src\share\tools\MakeDeps -d classes $(MakeDepsSources)
+	$(COMPILE_JAVAC) -classpath $(WorkSpace)\src\share\tools\ProjectCreator -d classes $(ProjectCreatorSources)
 
 !if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered")
 
+!include $(WorkSpace)/make/windows/makefiles/compile.make
 !include $(WorkSpace)/make/windows/makefiles/adlc.make
 
 !endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/windows/makefiles/launcher.make	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+
+LAUNCHER_FLAGS=$(CPP_FLAGS) $(ARCHFLAG) \
+	/D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+	/D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+	/D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
+	/D GAMMA \
+	/D LAUNCHER_TYPE=\"gamma\" \
+	/D _CRT_SECURE_NO_WARNINGS \
+	/D _CRT_SECURE_NO_DEPRECATE \
+	/D LINK_INTO_LIBJVM \
+	/I $(WorkSpace)\src\os\windows\launcher \
+	/I $(WorkSpace)\src\share\tools\launcher \
+	/I $(WorkSpace)\src\share\vm\prims \
+	/I $(WorkSpace)\src\share\vm \
+	/I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \
+	/I $(WorkSpace)\src\os\windows\vm
+
+LINK_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console 
+
+!if "$(COMPILER_NAME)" == "VS2005"
+# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
+#    on the link command line, otherwise we get missing __security_check_cookie
+#    externals at link time. Even with /GS-, you need bufferoverflowU.lib.
+BUFFEROVERFLOWLIB = bufferoverflowU.lib
+LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB)
+!endif
+
+LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher
+LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher
+
+OUTDIR = launcher
+
+{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj:
+	-mkdir $(OUTDIR) 2>NUL >NUL
+        $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
+
+{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj:
+	-mkdir $(OUTDIR) 2>NUL >NUL
+        $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
+
+$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h
+
+launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj
+	echo $(JAVA_HOME) > jdkpath.txt  
+	$(LINK) $(LINK_FLAGS) /out:hotspot.exe $**
+
+
--- a/make/windows/makefiles/makedeps.make	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-#
-# Copyright (c) 1999, 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#  
-#
-
-!include $(WorkSpace)/make/windows/makefiles/rules.make
-
-# This is used externally by both batch and IDE builds, so can't
-# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE,
-# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables.
-#
-# NOTE: unfortunately the MakeDepsSources list must be kept
-# synchronized between this and the Solaris version
-# (make/solaris/makefiles/makedeps.make).
-
-MakeDepsSources=\
-        $(WorkSpace)\src\share\tools\MakeDeps\Database.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\DirectoryTree.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\DirectoryTreeNode.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\FileFormatException.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\FileList.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\FileName.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\Macro.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\MacroDefinitions.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\MakeDeps.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\MetroWerksMacPlatform.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\Platform.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\UnixPlatform.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatform.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC6.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC7.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC8.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC9.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\Util.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\BuildConfig.java \
-        $(WorkSpace)\src\share\tools\MakeDeps\ArgsParser.java
-
-# This is only used internally
-MakeDepsIncludesPRIVATE=\
-        -relativeInclude src\share\vm\c1 \
-        -relativeInclude src\share\vm\c1x \
-        -relativeInclude src\share\vm\compiler \
-        -relativeInclude src\share\vm\code \
-        -relativeInclude src\share\vm\interpreter \
-        -relativeInclude src\share\vm\ci \
-        -relativeInclude src\share\vm\classfile \
-        -relativeInclude src\share\vm\gc_implementation\parallelScavenge \
-        -relativeInclude src\share\vm\gc_implementation\shared \
-        -relativeInclude src\share\vm\gc_implementation\parNew \
-        -relativeInclude src\share\vm\gc_implementation\concurrentMarkSweep \
-        -relativeInclude src\share\vm\gc_implementation\g1 \
-        -relativeInclude src\share\vm\gc_interface \
-        -relativeInclude src\share\vm\asm \
-        -relativeInclude src\share\vm\memory \
-        -relativeInclude src\share\vm\oops \
-        -relativeInclude src\share\vm\prims \
-        -relativeInclude src\share\vm\runtime \
-        -relativeInclude src\share\vm\services \
-        -relativeInclude src\share\vm\utilities \
-        -relativeInclude src\share\vm\libadt \
-        -relativeInclude src\share\vm\opto \
-        -relativeInclude src\os\windows\vm \
-        -relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \
-        -relativeInclude src\cpu\$(Platform_arch)\vm
-
-# This is referenced externally by both the IDE and batch builds
-MakeDepsOptions=
-
-# This is used externally, but only by the IDE builds, so we can
-# reference environment variables which aren't defined in the batch
-# build process.
-
-MakeDepsIDEOptions = \
-        -useToGeneratePch  java.cpp \
-        -disablePch        os_windows.cpp \
-        -disablePch        os_windows_$(Platform_arch).cpp \
-        -disablePch        osThread_windows.cpp \
-        -disablePch        bytecodeInterpreter.cpp \
-        -disablePch        bytecodeInterpreterWithChecks.cpp \
-	-disablePch        getThread_windows_$(Platform_arch).cpp \
-        -disablePch_compiler2     opcodes.cpp    
-
-# Common options for the IDE builds for core, c1, and c2
-MakeDepsIDEOptions=\
-        $(MakeDepsIDEOptions) \
-        -sourceBase $(HOTSPOTWORKSPACE) \
-	-buildBase $(HOTSPOTBUILDSPACE)\%f\%b \
-        -startAt src \
-	-compiler $(VcVersion) \
-        -projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \
-        -jdkTargetRoot $(HOTSPOTJDKDIST) \
-        -define ALIGN_STACK_FRAMES \
-        -define VM_LITTLE_ENDIAN \
-        -additionalFile includeDB_compiler1 \
-        -additionalFile includeDB_compiler2 \
-        -additionalFile includeDB_core \
-        -additionalFile includeDB_features \
-        -additionalFile includeDB_jvmti \
-        -additionalFile includeDB_gc \
-        -additionalFile includeDB_gc_parallel \
-        -additionalFile includeDB_gc_parallelScavenge \
-        -additionalFile includeDB_gc_concurrentMarkSweep \
-        -additionalFile includeDB_gc_g1 \
-        -additionalFile includeDB_gc_parNew \
-        -additionalFile includeDB_gc_shared \
-        -additionalFile includeDB_gc_serial \
-        -additionalGeneratedFile $(HOTSPOTBUILDSPACE)\%f\%b vm.def \
-        -prelink  "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b	set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME)	$(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \
-       $(MakeDepsIncludesPRIVATE)
-
-# Add in build-specific options
-!if "$(BUILDARCH)" == "i486"
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) -define IA32
-!endif
-
-##################################################
-# JKERNEL specific options
-##################################################
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -define_kernel KERNEL \
-
-##################################################
-# Client(C1) compiler specific options
-##################################################
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -define_compiler1 COMPILER1 \
-
-##################################################
-# Server(C2) compiler specific options
-##################################################
-#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -define_compiler2 COMPILER2 \
- -absoluteInclude_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls \
- -additionalFile_compiler2 $(Platform_arch_model).ad \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model).cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model).hpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_clone.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_expand.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_format.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_gen.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_misc.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_peephole.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_pipeline.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls adGlobals_$(Platform_arch_model).hpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls dfa_$(Platform_arch_model).cpp 
-
-# Add in the jvmti (JSR-163) options
-# NOTE: do not pull in jvmtiEnvRecommended.cpp.  This file is generated
-#       so the programmer can diff it with jvmtiEnv.cpp to be sure the
-#       code merge was done correctly (@see jvmti.make and jvmtiEnvFill.java).
-#       If so, they would then check it in as a new version of jvmtiEnv.cpp.
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -absoluteInclude $(HOTSPOTBUILDSPACE)/jvmtifiles \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnv.hpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnter.cpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnterTrace.cpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmti.h \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles bytecodeInterpreterWithChecks.cpp 
--- a/make/windows/makefiles/product.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/product.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,12 @@
 AOUT=$(HS_FNAME)
 GENERATED=../generated
 
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
 
 !include ../local.make
 !include compile.make
@@ -41,8 +46,6 @@
 !include $(WorkSpace)/make/windows/makefiles/vm.make
 !include local.make
 
-!include $(GENERATED)/Dependencies
-
 HS_BUILD_ID=$(HS_BUILD_VER)
 
 # Force resources to be rebuilt every time
@@ -55,8 +58,10 @@
   $(LINK_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files)
 <<
 !else
-$(AOUT): $(Res_Files) $(Obj_Files)
+vm.def: $(Obj_Files)
 	sh $(WorkSpace)/make/windows/build_vm_def.sh
+
+$(AOUT): $(Res_Files) $(Obj_Files) vm.def
 	$(LINK) @<<
   $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
 <<
@@ -70,3 +75,4 @@
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
+!include $(WorkSpace)/make/windows/makefiles/launcher.make
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/windows/makefiles/projectcreator.make	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,235 @@
+#
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+!include $(WorkSpace)/make/windows/makefiles/rules.make
+
+# This is used externally by both batch and IDE builds, so can't
+# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE,
+# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables.
+#
+# NOTE: unfortunately the ProjectCreatorSources list must be kept
+# synchronized between this and the Solaris version
+# (make/solaris/makefiles/projectcreator.make).
+
+ProjectCreatorSources=\
+        $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTreeNode.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\FileFormatException.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\Macro.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\MacroDefinitions.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\ProjectCreator.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatform.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC6.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC7.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC8.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC9.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\Util.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\BuildConfig.java \
+        $(WorkSpace)\src\share\tools\ProjectCreator\ArgsParser.java
+
+# This is only used internally
+ProjectCreatorIncludesPRIVATE=\
+        -relativeInclude src\share\vm \
+        -relativeInclude src\share\vm\prims \
+        -relativeInclude src\os\windows\vm \
+        -relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \
+        -relativeInclude src\cpu\$(Platform_arch)\vm \
+        -absoluteInclude $(HOTSPOTBUILDSPACE)/%f/generated \
+        -ignorePath $(HOTSPOTBUILDSPACE)/%f/generated \
+        -ignorePath src\share\vm\adlc \
+        -ignorePath src\share\vm\shark
+
+# This is referenced externally by both the IDE and batch builds
+ProjectCreatorOptions=
+
+# This is used externally, but only by the IDE builds, so we can
+# reference environment variables which aren't defined in the batch
+# build process.
+
+ProjectCreatorIDEOptions = \
+        -useToGeneratePch  java.cpp \
+        -disablePch        os_windows.cpp \
+        -disablePch        os_windows_$(Platform_arch).cpp \
+        -disablePch        osThread_windows.cpp \
+        -disablePch        bytecodeInterpreter.cpp \
+        -disablePch        bytecodeInterpreterWithChecks.cpp \
+        -disablePch        getThread_windows_$(Platform_arch).cpp \
+        -disablePch_compiler2     opcodes.cpp    
+
+# Common options for the IDE builds for core, c1, and c2
+ProjectCreatorIDEOptions=\
+        $(ProjectCreatorIDEOptions) \
+        -sourceBase $(HOTSPOTWORKSPACE) \
+        -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \
+        -startAt src \
+        -compiler $(VcVersion) \
+        -projectFileName $(HOTSPOTBUILDROOT)\$(ProjectFile) \
+        -jdkTargetRoot $(HOTSPOTJDKDIST) \
+        -define ALIGN_STACK_FRAMES \
+        -define VM_LITTLE_ENDIAN \
+        -prelink  "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b	set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME)	$(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \
+        -postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b	set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME)	nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \
+        -ignoreFile jsig.c \
+        -ignoreFile jvmtiEnvRecommended.cpp \
+        -ignoreFile jvmtiEnvStub.cpp \
+        -ignoreFile globalDefinitions_gcc.hpp \
+        -ignoreFile globalDefinitions_sparcWorks.hpp \
+        -ignoreFile version.rc \
+        -ignoreFile Xusage.txt \
+        -define TARGET_ARCH_x86 \
+        -define TARGET_OS_ARCH_windows_x86 \
+        -define TARGET_OS_FAMILY_windows \
+        -define TARGET_COMPILER_visCPP \
+       $(ProjectCreatorIncludesPRIVATE)
+
+# Add in build-specific options
+!if "$(BUILDARCH)" == "i486"
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+        -define IA32 \
+        -ignorePath x86_64 \
+        -define TARGET_ARCH_MODEL_x86_32
+!else
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+        -ignorePath x86_32 \
+        -define TARGET_ARCH_MODEL_x86_64
+!endif
+
+ProjectCreatorIDEOptionsIgnoreCompiler1=\
+ -ignorePath_TARGET c1_
+
+ProjectCreatorIDEOptionsIgnoreCompiler2=\
+ -ignorePath_TARGET src/share/vm/opto \
+ -ignorePath_TARGET src/share/vm/libadt \
+ -ignorePath_TARGET adfiles \
+ -ignoreFile_TARGET bcEscapeAnalyzer.cpp \
+ -ignoreFile_TARGET bcEscapeAnalyzer.hpp \
+ -ignorePath_TARGET chaitin \
+ -ignorePath_TARGET c2_ \
+ -ignorePath_TARGET runtime_ \
+ -ignoreFile_TARGET ciTypeFlow.cpp \
+ -ignoreFile_TARGET ciTypeFlow.hpp \
+ -ignoreFile_TARGET $(Platform_arch_model).ad
+
+##################################################
+# Without compiler(core) specific options
+##################################################
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=core) \
+$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core)
+
+##################################################
+# JKERNEL specific options
+##################################################
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define_kernel KERNEL \
+$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=kernel) \
+ -ignorePath_kernel src/share/vm/gc_implementation/parallelScavenge \
+ -ignorePath_kernel src/share/vm/gc_implementation/parNew \
+ -ignorePath_kernel src/share/vm/gc_implementation/concurrentMarkSweep \
+ -ignorePath_kernel src/share/vm/gc_implementation/g1 \
+ -ignoreFile_kernel attachListener.cpp \
+ -ignoreFile_kernel attachListener_windows.cpp \
+ -ignoreFile_kernel dump.cpp \
+ -ignoreFile_kernel dump_$(Platform_arch_model).cpp \
+ -ignoreFile_kernel forte.cpp \
+ -ignoreFile_kernel fprofiler.cpp \
+ -ignoreFile_kernel heapDumper.cpp \
+ -ignoreFile_kernel heapInspection.cpp \
+ -ignoreFile_kernel jniCheck.cpp \
+ -ignoreFile_kernel jvmtiCodeBlobEvents.cpp \
+ -ignoreFile_kernel jvmtiExtensions.cpp \
+ -ignoreFile_kernel jvmtiImpl.cpp \
+ -ignoreFile_kernel jvmtiRawMonitor.cpp \
+ -ignoreFile_kernel jvmtiTagMap.cpp \
+ -ignoreFile_kernel jvmtiTrace.cpp \
+ -ignoreFile_kernel jvmtiTrace.hpp \
+ -ignoreFile_kernel restore.cpp \
+ -ignoreFile_kernel serialize.cpp \
+ -ignoreFile_kernel vmStructs.cpp \
+ -ignoreFile_kernel g1MemoryPool.cpp \
+ -ignoreFile_kernel g1MemoryPool.hpp \
+ -ignoreFile_kernel psMemoryPool.cpp \
+ -ignoreFile_kernel psMemoryPool.hpp \
+ -ignoreFile_kernel gcAdaptivePolicyCounters.cpp \
+ -ignoreFile_kernel concurrentGCThread.cpp \
+ -ignoreFile_kernel mutableNUMASpace.cpp \
+ -ignoreFile_kernel ciTypeFlow.cpp \
+ -ignoreFile_kernel ciTypeFlow.hpp \
+ -ignoreFile_kernel oop.pcgc.inline.hpp \
+ -ignoreFile_kernel oop.psgc.inline.hpp \
+ -ignoreFile_kernel allocationStats.cpp \
+ -ignoreFile_kernel allocationStats.hpp \
+ -ignoreFile_kernel concurrentGCThread.hpp \
+ -ignoreFile_kernel gSpaceCounters.cpp \
+ -ignoreFile_kernel gSpaceCounters.hpp \
+ -ignoreFile_kernel gcAdaptivePolicyCounters.hpp \
+ -ignoreFile_kernel immutableSpace.cpp \
+ -ignoreFile_kernel mutableNUMASpace.hpp \
+ -ignoreFile_kernel mutableSpace.cpp \
+ -ignoreFile_kernel spaceCounters.cpp \
+ -ignoreFile_kernel spaceCounters.hpp \
+ -ignoreFile_kernel yieldingWorkgroup.cpp \
+ -ignoreFile_kernel yieldingWorkgroup.hpp \
+ -ignorePath_kernel vmStructs_ \
+ -ignoreFile_kernel $(Platform_arch_model).ad \
+ -additionalFile_kernel gcTaskManager.hpp
+
+##################################################
+# Client(C1) compiler specific options
+##################################################
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define_compiler1 COMPILER1 \
+$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
+
+##################################################
+# Server(C2) compiler specific options
+##################################################
+#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define_compiler2 COMPILER2 \
+ -additionalFile_compiler2 $(Platform_arch_model).ad \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).hpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_clone.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_expand.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_format.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_gen.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_misc.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_peephole.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_pipeline.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles adGlobals_$(Platform_arch_model).hpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles dfa_$(Platform_arch_model).cpp \
+ $(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=compiler2)
+
+# Add in the jvmti (JSR-163) options
+# NOTE: do not pull in jvmtiEnvRecommended.cpp.  This file is generated
+#       so the programmer can diff it with jvmtiEnv.cpp to be sure the
+#       code merge was done correctly (@see jvmti.make and jvmtiEnvFill.java).
+#       If so, they would then check it in as a new version of jvmtiEnv.cpp.
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnv.hpp \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnter.cpp \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnterTrace.cpp \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmti.h \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles bytecodeInterpreterWithChecks.cpp
--- a/make/windows/makefiles/rules.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/rules.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
 JAVAC_FLAGS=-g -encoding ascii
 BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
 
-ProjectFile=vm.vcproj
+ProjectFile=jvm.vcproj
 
 !if "$(MSC_VER)" == "1200"
 
@@ -63,6 +63,11 @@
 
 VcVersion=VC9
 
+!elseif "$(MSC_VER)" == "1600"
+
+# for compatibility - we don't yet have a ProjectCreator for VC10
+VcVersion=VC9
+
 !else
 
 VcVersion=VC7
--- a/make/windows/makefiles/sanity.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/sanity.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/windows/makefiles/vm.make	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/makefiles/vm.make	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 # Resource file containing VERSIONINFO
 Res_Files=.\version.res
 
+!include ..\generated\objfiles.make
+
 !ifdef RELEASE 
 !ifdef DEVELOP
 CPP_FLAGS=$(CPP_FLAGS) /D "DEBUG"
@@ -69,10 +71,7 @@
 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\""
 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_VM_DISTRO=\"$(HOTSPOT_VM_DISTRO)\""
 
-CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS" $(CPP_INCLUDE_DIRS)
-
-# Must specify this for sharedRuntimeTrig.cpp
-CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN"
+CPP_FLAGS=$(CPP_FLAGS) $(CPP_INCLUDE_DIRS)
 
 # Define that so jni.h is on correct side
 CPP_FLAGS=$(CPP_FLAGS) /D "_JNI_IMPLEMENTATION_"
@@ -94,6 +93,8 @@
 !endif
 !endif
 
+# If you modify exports below please do the corresponding changes in
+# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java 
 LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \
   /export:JNI_GetDefaultJavaVMInitArgs       \
   /export:JNI_CreateJavaVM                   \
@@ -111,38 +112,24 @@
   /export:JVM_InitAgentProperties
 
 CPP_INCLUDE_DIRS=\
-  /I "..\generated"                          \
-  /I "..\generated\jvmtifiles"               \
-  /I "$(WorkSpace)\src\share\vm\c1"          \
-  /I "$(WorkSpace)\src\share\vm\c1x"         \
-  /I "$(WorkSpace)\src\share\vm\compiler"    \
-  /I "$(WorkSpace)\src\share\vm\code"        \
-  /I "$(WorkSpace)\src\share\vm\interpreter" \
-  /I "$(WorkSpace)\src\share\vm\ci"          \
-  /I "$(WorkSpace)\src\share\vm\classfile"   \
-  /I "$(WorkSpace)\src\share\vm\gc_implementation\parallelScavenge"\
-  /I "$(WorkSpace)\src\share\vm\gc_implementation\shared"\
-  /I "$(WorkSpace)\src\share\vm\gc_implementation\parNew"\
-  /I "$(WorkSpace)\src\share\vm\gc_implementation\concurrentMarkSweep"\
-  /I "$(WorkSpace)\src\share\vm\gc_implementation\g1"\
-  /I "$(WorkSpace)\src\share\vm\gc_interface"\
-  /I "$(WorkSpace)\src\share\vm\asm"         \
-  /I "$(WorkSpace)\src\share\vm\memory"      \
-  /I "$(WorkSpace)\src\share\vm\oops"        \
-  /I "$(WorkSpace)\src\share\vm\prims"       \
-  /I "$(WorkSpace)\src\share\vm\runtime"     \
-  /I "$(WorkSpace)\src\share\vm\services"    \
-  /I "$(WorkSpace)\src\share\vm\utilities"   \
-  /I "$(WorkSpace)\src\share\vm\libadt"      \
-  /I "$(WorkSpace)\src\share\vm\opto"        \
-  /I "$(WorkSpace)\src\os\windows\vm"          \
+  /I "..\generated" \
+  /I "$(WorkSpace)\src\share\vm" \
+  /I "$(WorkSpace)\src\share\vm\prims" \
+  /I "$(WorkSpace)\src\os\windows\vm" \
   /I "$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm" \
   /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
 
-CPP_USE_PCH=/Fp"vm.pch" /Yu"incls/_precompiled.incl"
+CPP_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER
+
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+CPP_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp"
+!else
+CPP_USE_PCH=$(CPP_DONT_USE_PCH)
+!endif
 
 # Where to find the source code for the virtual machine
-VM_PATH=../generated/incls
+VM_PATH=../generated
+VM_PATH=$(VM_PATH);../generated/adfiles
 VM_PATH=$(VM_PATH);../generated/jvmtifiles
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/c1
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/c1x
@@ -175,31 +162,31 @@
 # Special case files not using precompiled header files.
 
 c1_RInfo_$(Platform_arch).obj: $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp 
-	 $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp
+	 $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp
 
 os_windows.obj: $(WorkSpace)\src\os\windows\vm\os_windows.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp
 
 os_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
 
 osThread_windows.obj: $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
 
 conditionVar_windows.obj: $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
 
 getThread_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
 
 opcodes.obj: $(WorkSpace)\src\share\vm\opto\opcodes.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp
 
 bytecodeInterpreter.obj: $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
 
 bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
-        $(CPP) $(CPP_FLAGS) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
 
 # Default rules for the Virtual Machine
 {$(WorkSpace)\src\share\vm\c1}.cpp.obj::
@@ -282,11 +269,14 @@
 {..\generated\incls}.cpp.obj::
         $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
 
+{..\generated\adfiles}.cpp.obj::
+        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
+
 {..\generated\jvmtifiles}.cpp.obj::
         $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
 
 default::
 
 _build_pch_file.obj:
-        @echo #include "incls/_precompiled.incl" > ../generated/_build_pch_file.cpp
-        $(CPP) $(CPP_FLAGS) /Fp"vm.pch" /Yc"incls/_precompiled.incl" /c ../generated/_build_pch_file.cpp
+        @echo #include "precompiled.hpp" > ../generated/_build_pch_file.cpp
+        $(CPP) $(CPP_FLAGS) /Fp"vm.pch" /Yc"precompiled.hpp" /c ../generated/_build_pch_file.cpp
--- a/make/windows/projectfiles/common/Makefile	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/common/Makefile	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
 #  
 #
 
+!ifdef LOCAL_MAKE
+!include $(LOCAL_MAKE)
+!endif
+
+
 WorkSpace=$(HOTSPOTWORKSPACE)
 
 !ifdef ALT_BOOTDIR
@@ -32,74 +37,39 @@
 !else
 !ifdef JAVA_HOME
 BootStrapDir=$(JAVA_HOME)
+!else
+!ifdef HOTSPOTJDKDIST
+BootStrapDir=$(HOTSPOTJDKDIST)
+!endif
 !endif
 !endif
 !endif
 
-!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/makedeps.make
+
+
+!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/projectcreator.make
+!include $(WorkSpace)/make/windows/makefiles/compile.make
 
 # Pick up rules for building JVMTI (JSR-163)
-JvmtiOutDir=$(HOTSPOTBUILDSPACE)\jvmtifiles
+JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles
 !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/jvmti.make
 
 Platform=$(HOTSPOTWORKSPACE)/make/windows/platform_$(BUILDARCH)
 
-default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
-
-IncludeDBs_base=$(HOTSPOTWORKSPACE)/src/share/vm/includeDB_core  \
-                $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_jvmti \
-                $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_gc    \
-                $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_serial
-
-# Parallel gc files
-IncludeDBs_gc=$(HOTSPOTWORKSPACE)/src/share/vm/includeDB_gc_parallel       \
-    $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_shared \
-    $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parNew \
-    $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \
-    $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \
-    $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_g1
-
-
-IncludeDBs_kernel =$(IncludeDBs_base) \
-                    $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1
-
-IncludeDBs_core =$(IncludeDBs_base) $(IncludeDBs_gc) \
-                 $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_features
-
-IncludeDBs_compiler1=$(IncludeDBs_core) \
-                     $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1
-
-IncludeDBs_compiler2=$(IncludeDBs_core) \
-                    $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler2
-
-IncludeDBs_tiered=$(IncludeDBs_core) \
-                    $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1 \
-                    $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler2
-
-
-!if "$(Variant)" == "compiler1"
-IncludeDBs = $(IncludeDBs_compiler1)
-!endif
-
 !if "$(Variant)" == "compiler2"
-IncludeDBs = $(IncludeDBs_compiler2)
 # Pick up rules for building adlc
 !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make
 !endif
 
 !if "$(Variant)" == "tiered"
-IncludeDBs = $(IncludeDBs_tiered)
 # Pick up rules for building adlc
 !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make
 !endif
 
-!if "$(Variant)" == "core"
-IncludeDBs = $(IncludeDBs_core)
-!endif
+HS_INTERNAL_NAME=jvm
+!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/launcher.make
 
-!if "$(Variant)" == "kernel"
-IncludeDBs = $(IncludeDBs_kernel)
-!endif
+default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
 
 !include $(HOTSPOTWORKSPACE)/make/hotspot_version
 
@@ -108,7 +78,11 @@
 !else
 HOTSPOT_RELEASE_VERSION="$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)"
 !endif
+!if "$(USER_RELEASE_SUFFIX)" != ""
+HOTSPOT_BUILD_VERSION$(HOTSPOT_BUILD_VERSION) = internal-$(USER_RELEASE_SUFFIX)
+!else
 HOTSPOT_BUILD_VERSION$(HOTSPOT_BUILD_VERSION) = internal
+!endif
 !if "$(HOTSPOT_BUILD_VERSION)" != ""
 HOTSPOT_RELEASE_VERSION="$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)"
 !endif
@@ -130,55 +104,22 @@
 !endif
 !endif
 
-MakeDepsIDEOptions =       $(MakeDepsIDEOptions) \
-      -includeDB_kernel    $(HOTSPOTBUILDSPACE)\includeDB_kernel \
-      -includeDB_core      $(HOTSPOTBUILDSPACE)\includeDB_core \
-      -includeDB_compiler1 $(HOTSPOTBUILDSPACE)\includeDB_compiler1 \
-      -includeDB_compiler2 $(HOTSPOTBUILDSPACE)\includeDB_compiler2 \
-      -includeDB_tiered    $(HOTSPOTBUILDSPACE)\includeDB_tiered \
+ProjectCreatorIDEOptions =       $(ProjectCreatorIDEOptions) \
       -platform            $(Platform) \
       -define              HOTSPOT_RELEASE_VERSION=\\\"$(HOTSPOT_RELEASE_VERSION)\\\" \
       -define              JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \
       -define              HOTSPOT_VM_DISTRO=\\\"$(HOTSPOT_VM_DISTRO)\\\"
 
-incls:
-	@mkdir incls
-
-includeDB.current $(ProjectFile) Dependencies: local.make $(HOTSPOTBUILDSPACE)/classes/MakeDeps.class \
-                                               $(IncludeDBs) incls
-	@rm -f includeDB $(HOTSPOTBUILDSPACE)\includeDB_kernel \
-                         $(HOTSPOTBUILDSPACE)\includeDB_core \
-                         $(HOTSPOTBUILDSPACE)\includeDB_compiler1 \
-                         $(HOTSPOTBUILDSPACE)\includeDB_compiler2 \
-                         $(HOTSPOTBUILDSPACE)\includeDB_tiered
-	@cat $(IncludeDBs_kernel) > $(HOTSPOTBUILDSPACE)\includeDB_kernel
-	@cat $(IncludeDBs_core) > $(HOTSPOTBUILDSPACE)\includeDB_core
-	@cat $(IncludeDBs_compiler1)   > $(HOTSPOTBUILDSPACE)\includeDB_compiler1
-	@cat $(IncludeDBs_compiler2)   > $(HOTSPOTBUILDSPACE)\includeDB_compiler2
-	@cat $(IncludeDBs_tiered)      > $(HOTSPOTBUILDSPACE)\includeDB_tiered
-	@echo java.cpp jni.h >  includeDB
-	@$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes MakeDeps diffs WinGammaPlatform$(VcVersion) \
-                  $(Platform) includeDB.current $(Platform) includeDB $(MakeDepsOptions) $(MakeDepsIDEOptions)
-	@rm -f includeDB.current
-	@cp includeDB includeDB.current
-
-lists: $(HOTSPOTBUILDSPACE)/classes/MakeDeps.class FORCE
-	@if exist incls rmdir /s /q incls
-	@rm -f includeDB
-	@cat $(IncludeDBs) > includeDB
-	@mkdir incls
-	@$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes MakeDeps WinGammaPlatform$(VcVersion) \
-                 $(Platform) includeDB $(MakeDepsOptions) $(MakeDepsIDEOptions)
-	@rm -f includeDB.current
-	@cp includeDB includeDB.current
+$(HOTSPOTBUILDROOT)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
+	@$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
 
 clean:
-	@rm -rf incls $(HOTSPOTBUILDSPACE)/classes
-	@rm -f includeDB includeDB.current $(ProjectFile) Dependencies
+	@rm -rf $(HOTSPOTBUILDSPACE)/classes
+	@rm -r ../$(ProjectFile)
 
-$(HOTSPOTBUILDSPACE)/classes/MakeDeps.class: $(MakeDepsSources)
+$(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class: $(ProjectCreatorSources)
 	@if exist $(HOTSPOTBUILDSPACE)\classes rmdir /s /q $(HOTSPOTBUILDSPACE)\classes
 	@mkdir $(HOTSPOTBUILDSPACE)\classes
-	@$(COMPILE_JAVAC) -classpath $(HOTSPOTWORKSPACE)\src\share\tools\MakeDeps -d $(HOTSPOTBUILDSPACE)/classes $(MakeDepsSources)
+	@$(COMPILE_JAVAC) -classpath $(HOTSPOTWORKSPACE)\src\share\tools\ProjectCreator -d $(HOTSPOTBUILDSPACE)/classes $(ProjectCreatorSources)
 
 FORCE:
--- a/make/windows/projectfiles/compiler1/Makefile	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/compiler1/Makefile	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
 #  
 #
 
-Variant=compiler1
-!include local.make
+!include ../local.make
 
 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
--- a/make/windows/projectfiles/compiler1/vm.def	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/compiler1/vm.def	Fri Jan 07 18:18:08 2011 +0100
@@ -2,6 +2,6 @@
 ; This .DEF file is a placeholder for one which is automatically
 ; generated during the build process. See
 ; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
 ; options).
 ;
--- a/make/windows/projectfiles/compiler2/Makefile	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/compiler2/Makefile	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
 #  
 #
 
-Variant=compiler2
-!include local.make
-AdditionalTargets=incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp
+!include ../local.make
+AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles
+AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
 
 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
--- a/make/windows/projectfiles/compiler2/vm.def	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/compiler2/vm.def	Fri Jan 07 18:18:08 2011 +0100
@@ -2,6 +2,6 @@
 ; This .DEF file is a placeholder for one which is automatically
 ; generated during the build process. See
 ; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
 ; options).
 ;
--- a/make/windows/projectfiles/core/Makefile	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/core/Makefile	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
 #  
 #
 
-Variant=core
-!include local.make
+!include ../local.make
 
 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
--- a/make/windows/projectfiles/core/vm.def	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/core/vm.def	Fri Jan 07 18:18:08 2011 +0100
@@ -2,6 +2,6 @@
 ; This .DEF file is a placeholder for one which is automatically
 ; generated during the build process. See
 ; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
 ; options).
 ;
--- a/make/windows/projectfiles/kernel/Makefile	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/kernel/Makefile	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2010 Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #   
 # This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
 #  
 #
 
-Variant=compiler1
-!include local.make
+!include ../local.make
 
 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
--- a/make/windows/projectfiles/kernel/vm.def	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/kernel/vm.def	Fri Jan 07 18:18:08 2011 +0100
@@ -2,6 +2,6 @@
 ; This .DEF file is a placeholder for one which is automatically
 ; generated during the build process. See
 ; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
 ; options).
 ;
--- a/make/windows/projectfiles/tiered/Makefile	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/tiered/Makefile	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
 #  
 #
 
-Variant=tiered
-!include local.make
-AdditionalTargets=incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp
+!include ../local.make
+AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles
+AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
 
 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
--- a/make/windows/projectfiles/tiered/vm.def	Wed Dec 29 20:06:41 2010 +0100
+++ b/make/windows/projectfiles/tiered/vm.def	Fri Jan 07 18:18:08 2011 +0100
@@ -2,6 +2,6 @@
 ; This .DEF file is a placeholder for one which is automatically
 ; generated during the build process. See
 ; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
 ; options).
 ;
--- a/src/cpu/sparc/vm/assembler_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/assembler_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,24 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#endif
 
 // Convert the raw encoding form into the form expected by the
 // constructor for Address.
@@ -893,10 +909,10 @@
 #if defined(COMPILER2) && !defined(_LP64)
     // Save & restore possible 64-bit Long arguments in G-regs
     sllx(L0,32,G2);             // Move old high G1 bits high in G2
-    sllx(G1, 0,G1);             // Clear current high G1 bits
+    srl(G1, 0,G1);              // Clear current high G1 bits
     or3 (G1,G2,G1);             // Recover 64-bit G1
     sllx(L6,32,G2);             // Move old high G4 bits high in G2
-    sllx(G4, 0,G4);             // Clear current high G4 bits
+    srl(G4, 0,G4);              // Clear current high G4 bits
     or3 (G4,G2,G4);             // Recover 64-bit G4
 #endif
     restore(O0, 0, G2_thread);
@@ -1427,6 +1443,45 @@
   }
 }
 
+int MacroAssembler::size_of_set64(jlong value) {
+  v9_dep();
+
+  int hi = (int)(value >> 32);
+  int lo = (int)(value & ~0);
+  int count = 0;
+
+  // (Matcher::isSimpleConstant64 knows about the following optimizations.)
+  if (Assembler::is_simm13(lo) && value == lo) {
+    count++;
+  } else if (hi == 0) {
+    count++;
+    if (low10(lo) != 0)
+      count++;
+  }
+  else if (hi == -1) {
+    count += 2;
+  }
+  else if (lo == 0) {
+    if (Assembler::is_simm13(hi)) {
+      count++;
+    } else {
+      count++;
+      if (low10(hi) != 0)
+        count++;
+    }
+    count++;
+  }
+  else {
+    count += 2;
+    if (low10(hi) != 0)
+      count++;
+    if (low10(lo) != 0)
+      count++;
+    count += 2;
+  }
+  return count;
+}
+
 // compute size in bytes of sparc frame, given
 // number of extraWords
 int MacroAssembler::total_frame_size_in_bytes(int extraWords) {
--- a/src/cpu/sparc/vm/assembler_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/assembler_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
+
 class BiasedLockingCounters;
 
 // <sys/trap.h> promises that the system will not use traps 16-31
@@ -1618,6 +1621,10 @@
 
   void sub(    Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | rs2(s2) ); }
   void sub(    Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
+
+  // Note: offset is added to s2.
+  inline void sub(Register s1, RegisterOrConstant s2, Register d, int offset = 0);
+
   void subcc(  Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); }
   void subcc(  Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
   void subc(   Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(subc_op3             ) | rs1(s1) | rs2(s2) ); }
@@ -1795,6 +1802,7 @@
   // branches that use right instruction for v8 vs. v9
   inline void br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
   inline void br( Condition c, bool a, Predict p, Label& L );
+
   inline void fb( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
   inline void fb( Condition c, bool a, Predict p, Label& L );
 
@@ -1891,6 +1899,9 @@
   void patchable_set(intptr_t value, Register d);
   void set64(jlong value, Register d, Register tmp);
 
+  // Compute size of set64.
+  static int size_of_set64(jlong value);
+
   // sign-extend 32 to 64
   inline void signx( Register s, Register d ) { sra( s, G0, d); }
   inline void signx( Register d )             { sra( d, G0, d); }
@@ -2500,3 +2511,5 @@
 // On RISC, there's no benefit to verifying instruction boundaries.
 inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
 #endif
+
+#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
--- a/src/cpu/sparc/vm/assembler_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/assembler_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
+#define CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
+
+#include "asm/assembler.inline.hpp"
+#include "asm/codeBuffer.hpp"
+#include "code/codeCache.hpp"
+#include "runtime/handles.inline.hpp"
+
 inline void MacroAssembler::pd_patch_instruction(address branch, address target) {
   jint& stub_inst = *(jint*) branch;
   stub_inst = patched_branch(target - branch, stub_inst, 0);
@@ -320,6 +328,11 @@
 inline void Assembler::stdcq(  int crd, Register s1, Register s2) { v8_only();  emit_long( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | rs2(s2) ); }
 inline void Assembler::stdcq(  int crd, Register s1, int simm13a) { v8_only();  emit_data( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
 
+inline void Assembler::sub(Register s1, RegisterOrConstant s2, Register d, int offset) {
+  if (s2.is_register())  sub(s1, s2.as_register(),          d);
+  else                 { sub(s1, s2.as_constant() + offset, d); offset = 0; }
+  if (offset != 0)       sub(d,  offset,                    d);
+}
 
 // pp 231
 
@@ -822,3 +835,5 @@
     Assembler::ldstub(SP, 0, G0);
   }
 }
+
+#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
--- a/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,24 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interp_masm_sparc.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/bytecodeInterpreter.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+
 // KILL THIS FILE
--- a/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP
+#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP
+
 // Platform specific for C++ based Interpreter
 #define LOTS_OF_REGS    /* Lets interpreter use plenty of registers */
 
@@ -97,3 +100,5 @@
                                                   ((VMJavaVal64*)(addr))->d)
 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
                                                 ((VMJavaVal64*)(addr))->l)
+
+#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP
--- a/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP
+#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP
+
 // Inline interpreter functions for sparc
 
 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; }
@@ -331,3 +334,5 @@
   }
 };
 #endif /* ALIGN_CONVERTER */
+
+#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP
--- a/src/cpu/sparc/vm/bytecodes_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/bytecodes_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodes_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
 
 
 void Bytecodes::pd_initialize() {
--- a/src/cpu/sparc/vm/bytecodes_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/bytecodes_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_BYTECODES_SPARC_HPP
+#define CPU_SPARC_VM_BYTECODES_SPARC_HPP
+
 #ifdef SPARC
 #define NLOCALS_IN_REGS 6
 #endif
@@ -30,3 +33,5 @@
 // Sparc specific bytecodes
 
 // (none)
+
+#endif // CPU_SPARC_VM_BYTECODES_SPARC_HPP
--- a/src/cpu/sparc/vm/bytes_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/bytes_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_BYTES_SPARC_HPP
+#define CPU_SPARC_VM_BYTES_SPARC_HPP
+
+#include "memory/allocation.hpp"
+
 class Bytes: AllStatic {
  public:
   // Efficient reading and writing of unaligned unsigned data in platform-specific byte ordering
@@ -155,3 +160,5 @@
 // 1.15 98/10/05 16:30:21 bytes_i486.hpp
 // 1.17 99/06/22 16:37:35 bytes_i486.hpp
 //End
+
+#endif // CPU_SPARC_VM_BYTES_SPARC_HPP
--- a/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_CodeStubs_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_CodeStubs.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "nativeInst_sparc.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 #define __ ce->masm()->
 
@@ -424,7 +434,7 @@
 
   Register pre_val_reg = pre_val()->as_register();
 
-  ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false);
+  ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
   if (__ is_in_wdisp16_range(_continuation)) {
     __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt,
                       pre_val_reg, _continuation);
--- a/src/cpu/sparc/vm/c1_Defs_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_Defs_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C1_DEFS_SPARC_HPP
+#define CPU_SPARC_VM_C1_DEFS_SPARC_HPP
+
 // native word offsets from memory address (big endian)
 enum {
   pd_lo_word_offset_in_bytes = BytesPerInt,
@@ -65,3 +68,5 @@
 enum {
   pd_float_saved_as_double = false
 };
+
+#endif // CPU_SPARC_VM_C1_DEFS_SPARC_HPP
--- a/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,10 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "c1/c1_FpuStackSim.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "utilities/array.hpp"
+#include "utilities/ostream.hpp"
+
 // No FPU stack on SPARC
--- a/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,10 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP
+#define CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP
+
 // No FPU stack on SPARC
 class FpuStackSim;
+
+#endif // CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP
--- a/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_FrameMap_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIR.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_sparc.inline.hpp"
 
 
 const int FrameMap::pd_c_runtime_reserved_arg_size = 7;
--- a/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP
+#define CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP
+
  public:
 
   enum {
@@ -151,3 +154,8 @@
 
   static bool is_caller_save_register (LIR_Opr  reg);
   static bool is_caller_save_register (Register r);
+
+  static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; }
+  static int last_cpu_reg()             { return pd_last_cpu_reg;  }
+
+#endif // CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP
--- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRAssembler_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciArrayKlass.hpp"
+#include "ci/ciInstance.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #define __ _masm->
 
@@ -88,6 +100,11 @@
         return false;
       }
 
+      if (UseCompressedOops) {
+        if (dst->is_address() && !dst->is_stack() && (dst->type() == T_OBJECT || dst->type() == T_ARRAY)) return false;
+        if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
+      }
+
       if (dst->is_register()) {
         if (src->is_address() && Assembler::is_simm13(src->as_address_ptr()->disp())) {
           return !PatchALot;
@@ -241,7 +258,7 @@
     int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
     int  count_offset = java_lang_String:: count_offset_in_bytes();
 
-    __ ld_ptr(str0, value_offset, tmp0);
+    __ load_heap_oop(str0, value_offset, tmp0);
     __ ld(str0, offset_offset, tmp2);
     __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
     __ ld(str0, count_offset, str0);
@@ -250,7 +267,7 @@
     // str1 may be null
     add_debug_info_for_null_check_here(info);
 
-    __ ld_ptr(str1, value_offset, tmp1);
+    __ load_heap_oop(str1, value_offset, tmp1);
     __ add(tmp0, tmp2, tmp0);
 
     __ ld(str1, offset_offset, tmp2);
@@ -754,7 +771,7 @@
 
 void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
   add_debug_info_for_null_check_here(op->info());
-  __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), G3_scratch);
+  __ load_klass(O0, G3_scratch);
   if (__ is_simm13(op->vtable_offset())) {
     __ ld_ptr(G3_scratch, op->vtable_offset(), G5_method);
   } else {
@@ -768,138 +785,17 @@
   // the peephole pass fills the delay slot
 }
 
-
-// load with 32-bit displacement
-int LIR_Assembler::load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo *info) {
-  int load_offset = code_offset();
-  if (Assembler::is_simm13(disp)) {
-    if (info != NULL) add_debug_info_for_null_check_here(info);
-    switch(ld_type) {
-      case T_BOOLEAN: // fall through
-      case T_BYTE  : __ ldsb(s, disp, d); break;
-      case T_CHAR  : __ lduh(s, disp, d); break;
-      case T_SHORT : __ ldsh(s, disp, d); break;
-      case T_INT   : __ ld(s, disp, d); break;
-      case T_ADDRESS:// fall through
-      case T_ARRAY : // fall through
-      case T_OBJECT: __ ld_ptr(s, disp, d); break;
-      default      : ShouldNotReachHere();
-    }
-  } else {
-    __ set(disp, O7);
-    if (info != NULL) add_debug_info_for_null_check_here(info);
-    load_offset = code_offset();
-    switch(ld_type) {
-      case T_BOOLEAN: // fall through
-      case T_BYTE  : __ ldsb(s, O7, d); break;
-      case T_CHAR  : __ lduh(s, O7, d); break;
-      case T_SHORT : __ ldsh(s, O7, d); break;
-      case T_INT   : __ ld(s, O7, d); break;
-      case T_ADDRESS:// fall through
-      case T_ARRAY : // fall through
-      case T_OBJECT: __ ld_ptr(s, O7, d); break;
-      default      : ShouldNotReachHere();
-    }
-  }
-  if (ld_type == T_ARRAY || ld_type == T_OBJECT) __ verify_oop(d);
-  return load_offset;
-}
-
-
-// store with 32-bit displacement
-void LIR_Assembler::store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info) {
-  if (Assembler::is_simm13(offset)) {
-    if (info != NULL)  add_debug_info_for_null_check_here(info);
-    switch (type) {
-      case T_BOOLEAN: // fall through
-      case T_BYTE  : __ stb(value, base, offset); break;
-      case T_CHAR  : __ sth(value, base, offset); break;
-      case T_SHORT : __ sth(value, base, offset); break;
-      case T_INT   : __ stw(value, base, offset); break;
-      case T_ADDRESS:// fall through
-      case T_ARRAY : // fall through
-      case T_OBJECT: __ st_ptr(value, base, offset); break;
-      default      : ShouldNotReachHere();
-    }
-  } else {
-    __ set(offset, O7);
-    if (info != NULL) add_debug_info_for_null_check_here(info);
-    switch (type) {
-      case T_BOOLEAN: // fall through
-      case T_BYTE  : __ stb(value, base, O7); break;
-      case T_CHAR  : __ sth(value, base, O7); break;
-      case T_SHORT : __ sth(value, base, O7); break;
-      case T_INT   : __ stw(value, base, O7); break;
-      case T_ADDRESS:// fall through
-      case T_ARRAY : //fall through
-      case T_OBJECT: __ st_ptr(value, base, O7); break;
-      default      : ShouldNotReachHere();
-    }
-  }
-  // Note: Do the store before verification as the code might be patched!
-  if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(value);
-}
-
-
-// load float with 32-bit displacement
-void LIR_Assembler::load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) {
-  FloatRegisterImpl::Width w;
-  switch(ld_type) {
-    case T_FLOAT : w = FloatRegisterImpl::S; break;
-    case T_DOUBLE: w = FloatRegisterImpl::D; break;
-    default      : ShouldNotReachHere();
-  }
-
-  if (Assembler::is_simm13(disp)) {
-    if (info != NULL) add_debug_info_for_null_check_here(info);
-    if (disp % BytesPerLong != 0 && w == FloatRegisterImpl::D) {
-      __ ldf(FloatRegisterImpl::S, s, disp + BytesPerWord, d->successor());
-      __ ldf(FloatRegisterImpl::S, s, disp               , d);
-    } else {
-      __ ldf(w, s, disp, d);
-    }
-  } else {
-    __ set(disp, O7);
-    if (info != NULL) add_debug_info_for_null_check_here(info);
-    __ ldf(w, s, O7, d);
-  }
-}
-
-
-// store float with 32-bit displacement
-void LIR_Assembler::store(FloatRegister value, Register base, int offset, BasicType type, CodeEmitInfo *info) {
-  FloatRegisterImpl::Width w;
-  switch(type) {
-    case T_FLOAT : w = FloatRegisterImpl::S; break;
-    case T_DOUBLE: w = FloatRegisterImpl::D; break;
-    default      : ShouldNotReachHere();
-  }
-
-  if (Assembler::is_simm13(offset)) {
-    if (info != NULL) add_debug_info_for_null_check_here(info);
-    if (w == FloatRegisterImpl::D && offset % BytesPerLong != 0) {
-      __ stf(FloatRegisterImpl::S, value->successor(), base, offset + BytesPerWord);
-      __ stf(FloatRegisterImpl::S, value             , base, offset);
-    } else {
-      __ stf(w, value, base, offset);
-    }
-  } else {
-    __ set(offset, O7);
-    if (info != NULL) add_debug_info_for_null_check_here(info);
-    __ stf(w, value, O7, base);
-  }
-}
-
-
-int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned) {
+int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned) {
   int store_offset;
   if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) {
     assert(!unaligned, "can't handle this");
     // for offsets larger than a simm13 we setup the offset in O7
     __ set(offset, O7);
-    store_offset = store(from_reg, base, O7, type);
+    store_offset = store(from_reg, base, O7, type, wide);
   } else {
-    if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register());
+    if (type == T_ARRAY || type == T_OBJECT) {
+      __ verify_oop(from_reg->as_register());
+    }
     store_offset = code_offset();
     switch (type) {
       case T_BOOLEAN: // fall through
@@ -922,9 +818,22 @@
         __ stw(from_reg->as_register_hi(), base, offset + hi_word_offset_in_bytes);
 #endif
         break;
-      case T_ADDRESS:// fall through
+      case T_ADDRESS:
+        __ st_ptr(from_reg->as_register(), base, offset);
+        break;
       case T_ARRAY : // fall through
-      case T_OBJECT: __ st_ptr(from_reg->as_register(), base, offset); break;
+      case T_OBJECT:
+        {
+          if (UseCompressedOops && !wide) {
+            __ encode_heap_oop(from_reg->as_register(), G3_scratch);
+            store_offset = code_offset();
+            __ stw(G3_scratch, base, offset);
+          } else {
+            __ st_ptr(from_reg->as_register(), base, offset);
+          }
+          break;
+        }
+
       case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, offset); break;
       case T_DOUBLE:
         {
@@ -946,8 +855,10 @@
 }
 
 
-int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type) {
-  if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register());
+int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) {
+  if (type == T_ARRAY || type == T_OBJECT) {
+    __ verify_oop(from_reg->as_register());
+  }
   int store_offset = code_offset();
   switch (type) {
     case T_BOOLEAN: // fall through
@@ -963,9 +874,21 @@
       __ std(from_reg->as_register_hi(), base, disp);
 #endif
       break;
-    case T_ADDRESS:// fall through
+    case T_ADDRESS:
+      __ st_ptr(from_reg->as_register(), base, disp);
+      break;
     case T_ARRAY : // fall through
-    case T_OBJECT: __ st_ptr(from_reg->as_register(), base, disp); break;
+    case T_OBJECT:
+      {
+        if (UseCompressedOops && !wide) {
+          __ encode_heap_oop(from_reg->as_register(), G3_scratch);
+          store_offset = code_offset();
+          __ stw(G3_scratch, base, disp);
+        } else {
+          __ st_ptr(from_reg->as_register(), base, disp);
+        }
+        break;
+      }
     case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, disp); break;
     case T_DOUBLE: __ stf(FloatRegisterImpl::D, from_reg->as_double_reg(), base, disp); break;
     default      : ShouldNotReachHere();
@@ -974,14 +897,14 @@
 }
 
 
-int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned) {
+int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned) {
   int load_offset;
   if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) {
     assert(base != O7, "destroying register");
     assert(!unaligned, "can't handle this");
     // for offsets larger than a simm13 we setup the offset in O7
     __ set(offset, O7);
-    load_offset = load(base, O7, to_reg, type);
+    load_offset = load(base, O7, to_reg, type, wide);
   } else {
     load_offset = code_offset();
     switch(type) {
@@ -1018,9 +941,18 @@
 #endif
         }
         break;
-      case T_ADDRESS:// fall through
+      case T_ADDRESS:  __ ld_ptr(base, offset, to_reg->as_register()); break;
       case T_ARRAY : // fall through
-      case T_OBJECT: __ ld_ptr(base, offset, to_reg->as_register()); break;
+      case T_OBJECT:
+        {
+          if (UseCompressedOops && !wide) {
+            __ lduw(base, offset, to_reg->as_register());
+            __ decode_heap_oop(to_reg->as_register());
+          } else {
+            __ ld_ptr(base, offset, to_reg->as_register());
+          }
+          break;
+        }
       case T_FLOAT:  __ ldf(FloatRegisterImpl::S, base, offset, to_reg->as_float_reg()); break;
       case T_DOUBLE:
         {
@@ -1036,23 +968,34 @@
         }
       default      : ShouldNotReachHere();
     }
-    if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register());
+    if (type == T_ARRAY || type == T_OBJECT) {
+      __ verify_oop(to_reg->as_register());
+    }
   }
   return load_offset;
 }
 
 
-int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type) {
+int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide) {
   int load_offset = code_offset();
   switch(type) {
     case T_BOOLEAN: // fall through
-    case T_BYTE  : __ ldsb(base, disp, to_reg->as_register()); break;
-    case T_CHAR  : __ lduh(base, disp, to_reg->as_register()); break;
-    case T_SHORT : __ ldsh(base, disp, to_reg->as_register()); break;
-    case T_INT   : __ ld(base, disp, to_reg->as_register()); break;
-    case T_ADDRESS:// fall through
+    case T_BYTE  :  __ ldsb(base, disp, to_reg->as_register()); break;
+    case T_CHAR  :  __ lduh(base, disp, to_reg->as_register()); break;
+    case T_SHORT :  __ ldsh(base, disp, to_reg->as_register()); break;
+    case T_INT   :  __ ld(base, disp, to_reg->as_register()); break;
+    case T_ADDRESS: __ ld_ptr(base, disp, to_reg->as_register()); break;
     case T_ARRAY : // fall through
-    case T_OBJECT: __ ld_ptr(base, disp, to_reg->as_register()); break;
+    case T_OBJECT:
+      {
+          if (UseCompressedOops && !wide) {
+            __ lduw(base, disp, to_reg->as_register());
+            __ decode_heap_oop(to_reg->as_register());
+          } else {
+            __ ld_ptr(base, disp, to_reg->as_register());
+          }
+          break;
+      }
     case T_FLOAT:  __ ldf(FloatRegisterImpl::S, base, disp, to_reg->as_float_reg()); break;
     case T_DOUBLE: __ ldf(FloatRegisterImpl::D, base, disp, to_reg->as_double_reg()); break;
     case T_LONG  :
@@ -1066,60 +1009,28 @@
       break;
     default      : ShouldNotReachHere();
   }
-  if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register());
+  if (type == T_ARRAY || type == T_OBJECT) {
+    __ verify_oop(to_reg->as_register());
+  }
   return load_offset;
 }
 
-
-// load/store with an Address
-void LIR_Assembler::load(const Address& a, Register d,  BasicType ld_type, CodeEmitInfo *info, int offset) {
-  load(a.base(), a.disp() + offset, d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(Register value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) {
-  store(value, dest.base(), dest.disp() + offset, type, info);
-}
-
-
-// loadf/storef with an Address
-void LIR_Assembler::load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info, int offset) {
-  load(a.base(), a.disp() + offset, d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(FloatRegister value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) {
-  store(value, dest.base(), dest.disp() + offset, type, info);
-}
-
-
-// load/store with an Address
-void LIR_Assembler::load(LIR_Address* a, Register d,  BasicType ld_type, CodeEmitInfo *info) {
-  load(as_Address(a), d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(Register value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) {
-  store(value, as_Address(dest), type, info);
-}
-
-
-// loadf/storef with an Address
-void LIR_Assembler::load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) {
-  load(as_Address(a), d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(FloatRegister value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) {
-  store(value, as_Address(dest), type, info);
-}
-
-
 void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
   LIR_Const* c = src->as_constant_ptr();
   switch (c->type()) {
     case T_INT:
-    case T_FLOAT:
+    case T_FLOAT: {
+      Register src_reg = O7;
+      int value = c->as_jint_bits();
+      if (value == 0) {
+        src_reg = G0;
+      } else {
+        __ set(value, O7);
+      }
+      Address addr = frame_map()->address_for_slot(dest->single_stack_ix());
+      __ stw(src_reg, addr.base(), addr.disp());
+      break;
+    }
     case T_ADDRESS: {
       Register src_reg = O7;
       int value = c->as_jint_bits();
@@ -1129,7 +1040,7 @@
         __ set(value, O7);
       }
       Address addr = frame_map()->address_for_slot(dest->single_stack_ix());
-      __ stw(src_reg, addr.base(), addr.disp());
+      __ st_ptr(src_reg, addr.base(), addr.disp());
       break;
     }
     case T_OBJECT: {
@@ -1166,14 +1077,12 @@
 }
 
 
-void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) {
+void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) {
   LIR_Const* c = src->as_constant_ptr();
   LIR_Address* addr     = dest->as_address_ptr();
   Register base = addr->base()->as_pointer_register();
-
-  if (info != NULL) {
-    add_debug_info_for_null_check_here(info);
-  }
+  int offset = -1;
+
   switch (c->type()) {
     case T_INT:
     case T_FLOAT:
@@ -1187,10 +1096,10 @@
       }
       if (addr->index()->is_valid()) {
         assert(addr->disp() == 0, "must be zero");
-        store(tmp, base, addr->index()->as_pointer_register(), type);
+        offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide);
       } else {
         assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses");
-        store(tmp, base, addr->disp(), type);
+        offset = store(tmp, base, addr->disp(), type, wide, false);
       }
       break;
     }
@@ -1200,21 +1109,21 @@
       assert(Assembler::is_simm13(addr->disp()) &&
              Assembler::is_simm13(addr->disp() + 4), "can't handle larger addresses");
 
-      Register tmp = O7;
+      LIR_Opr tmp = FrameMap::O7_opr;
       int value_lo = c->as_jint_lo_bits();
       if (value_lo == 0) {
-        tmp = G0;
+        tmp = FrameMap::G0_opr;
       } else {
         __ set(value_lo, O7);
       }
-      store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT);
+      offset = store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT, wide, false);
       int value_hi = c->as_jint_hi_bits();
       if (value_hi == 0) {
-        tmp = G0;
+        tmp = FrameMap::G0_opr;
       } else {
         __ set(value_hi, O7);
       }
-      store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT);
+      offset = store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT, wide, false);
       break;
     }
     case T_OBJECT: {
@@ -1229,10 +1138,10 @@
       // handle either reg+reg or reg+disp address
       if (addr->index()->is_valid()) {
         assert(addr->disp() == 0, "must be zero");
-        store(tmp, base, addr->index()->as_pointer_register(), type);
+        offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide);
       } else {
         assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses");
-        store(tmp, base, addr->disp(), type);
+        offset = store(tmp, base, addr->disp(), type, wide, false);
       }
 
       break;
@@ -1240,6 +1149,10 @@
     default:
       Unimplemented();
   }
+  if (info != NULL) {
+    assert(offset != -1, "offset should've been set");
+    add_debug_info_for_null_check(offset, info);
+  }
 }
 
 
@@ -1324,7 +1237,7 @@
           assert(to_reg->is_single_cpu(), "Must be a cpu register.");
 
           __ set(const_addrlit, O7);
-          load(O7, 0, to_reg->as_register(), T_INT);
+          __ ld(O7, 0, to_reg->as_register());
         }
       }
       break;
@@ -1417,7 +1330,7 @@
 
 
 void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type,
-                            LIR_PatchCode patch_code, CodeEmitInfo* info, bool unaligned) {
+                            LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned) {
 
   LIR_Address* addr = src_opr->as_address_ptr();
   LIR_Opr to_reg = dest;
@@ -1463,16 +1376,15 @@
 
   assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up");
   if (disp_reg == noreg) {
-    offset = load(src, disp_value, to_reg, type, unaligned);
+    offset = load(src, disp_value, to_reg, type, wide, unaligned);
   } else {
     assert(!unaligned, "can't handle this");
-    offset = load(src, disp_reg, to_reg, type);
+    offset = load(src, disp_reg, to_reg, type, wide);
   }
 
   if (patch != NULL) {
     patching_epilog(patch, patch_code, src, info);
   }
-
   if (info != NULL) add_debug_info_for_null_check(offset, info);
 }
 
@@ -1506,7 +1418,7 @@
   }
 
   bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0;
-  load(addr.base(), addr.disp(), dest, dest->type(), unaligned);
+  load(addr.base(), addr.disp(), dest, dest->type(), true /*wide*/, unaligned);
 }
 
 
@@ -1518,7 +1430,7 @@
     addr = frame_map()->address_for_slot(dest->double_stack_ix());
   }
   bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0;
-  store(from_reg, addr.base(), addr.disp(), from_reg->type(), unaligned);
+  store(from_reg, addr.base(), addr.disp(), from_reg->type(), true /*wide*/, unaligned);
 }
 
 
@@ -1566,7 +1478,7 @@
 
 void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
                             LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack,
-                            bool unaligned) {
+                            bool wide, bool unaligned) {
   LIR_Address* addr = dest->as_address_ptr();
 
   Register src = addr->base()->as_pointer_register();
@@ -1610,10 +1522,10 @@
 
   assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up");
   if (disp_reg == noreg) {
-    offset = store(from_reg, src, disp_value, type, unaligned);
+    offset = store(from_reg, src, disp_value, type, wide, unaligned);
   } else {
     assert(!unaligned, "can't handle this");
-    offset = store(from_reg, src, disp_reg, type);
+    offset = store(from_reg, src, disp_reg, type, wide);
   }
 
   if (patch != NULL) {
@@ -2172,13 +2084,13 @@
   // make sure src and dst are non-null and load array length
   if (flags & LIR_OpArrayCopy::src_null_check) {
     __ tst(src);
-    __ br(Assembler::equal, false, Assembler::pn, *stub->entry());
+    __ brx(Assembler::equal, false, Assembler::pn, *stub->entry());
     __ delayed()->nop();
   }
 
   if (flags & LIR_OpArrayCopy::dst_null_check) {
     __ tst(dst);
-    __ br(Assembler::equal, false, Assembler::pn, *stub->entry());
+    __ brx(Assembler::equal, false, Assembler::pn, *stub->entry());
     __ delayed()->nop();
   }
 
@@ -2220,10 +2132,18 @@
   }
 
   if (flags & LIR_OpArrayCopy::type_check) {
-    __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp);
-    __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
-    __ cmp(tmp, tmp2);
-    __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry());
+    if (UseCompressedOops) {
+      // We don't need decode because we just need to compare
+      __ lduw(src, oopDesc::klass_offset_in_bytes(), tmp);
+      __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+      __ cmp(tmp, tmp2);
+      __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry());
+    } else {
+      __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp);
+      __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+      __ cmp(tmp, tmp2);
+      __ brx(Assembler::notEqual, false, Assembler::pt, *stub->entry());
+    }
     __ delayed()->nop();
   }
 
@@ -2238,20 +2158,44 @@
     // but not necessarily exactly of type default_type.
     Label known_ok, halt;
     jobject2reg(op->expected_type()->constant_encoding(), tmp);
-    __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
-    if (basic_type != T_OBJECT) {
-      __ cmp(tmp, tmp2);
-      __ br(Assembler::notEqual, false, Assembler::pn, halt);
-      __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2);
-      __ cmp(tmp, tmp2);
-      __ br(Assembler::equal, false, Assembler::pn, known_ok);
-      __ delayed()->nop();
+    if (UseCompressedOops) {
+      // tmp holds the default type. It currently comes uncompressed after the
+      // load of a constant, so encode it.
+      __ encode_heap_oop(tmp);
+      // load the raw value of the dst klass, since we will be comparing
+      // uncompressed values directly.
+      __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+      if (basic_type != T_OBJECT) {
+        __ cmp(tmp, tmp2);
+        __ br(Assembler::notEqual, false, Assembler::pn, halt);
+        // load the raw value of the src klass.
+        __ delayed()->lduw(src, oopDesc::klass_offset_in_bytes(), tmp2);
+        __ cmp(tmp, tmp2);
+        __ br(Assembler::equal, false, Assembler::pn, known_ok);
+        __ delayed()->nop();
+      } else {
+        __ cmp(tmp, tmp2);
+        __ br(Assembler::equal, false, Assembler::pn, known_ok);
+        __ delayed()->cmp(src, dst);
+        __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+        __ delayed()->nop();
+      }
     } else {
-      __ cmp(tmp, tmp2);
-      __ br(Assembler::equal, false, Assembler::pn, known_ok);
-      __ delayed()->cmp(src, dst);
-      __ br(Assembler::equal, false, Assembler::pn, known_ok);
-      __ delayed()->nop();
+      __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+      if (basic_type != T_OBJECT) {
+        __ cmp(tmp, tmp2);
+        __ brx(Assembler::notEqual, false, Assembler::pn, halt);
+        __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2);
+        __ cmp(tmp, tmp2);
+        __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+        __ delayed()->nop();
+      } else {
+        __ cmp(tmp, tmp2);
+        __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+        __ delayed()->cmp(src, dst);
+        __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+        __ delayed()->nop();
+      }
     }
     __ bind(halt);
     __ stop("incorrect type information in arraycopy");
@@ -2459,7 +2403,7 @@
     Label next_test;
     Address recv_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) -
                       mdo_offset_bias);
-    load(recv_addr, tmp1, T_OBJECT);
+    __ ld_ptr(recv_addr, tmp1);
     __ br_notnull(tmp1, false, Assembler::pt, next_test);
     __ delayed()->nop();
     __ st_ptr(recv, recv_addr);
@@ -2475,11 +2419,8 @@
 
 void LIR_Assembler::setup_md_access(ciMethod* method, int bci,
                                     ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias) {
-  md = method->method_data();
-  if (md == NULL) {
-    bailout("out of memory building methodDataOop");
-    return;
-  }
+  md = method->method_data_or_null();
+  assert(md != NULL, "Sanity");
   data = md->bci_to_data(bci);
   assert(data != NULL,       "need data for checkcast");
   assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
@@ -2551,7 +2492,7 @@
 
   // get object class
   // not a safepoint as obj null check happens earlier
-  load(obj, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL);
+  __ load_klass(obj, klass_RInfo);
   if (op->fast_check()) {
     assert_different_registers(klass_RInfo, k_RInfo);
     __ cmp(k_RInfo, klass_RInfo);
@@ -2593,7 +2534,7 @@
       __ set(mdo_offset_bias, tmp1);
       __ add(mdo, tmp1, mdo);
     }
-    load(Address(obj, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
+    __ load_klass(obj, recv);
     type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, success);
     // Jump over the failure case
     __ ba(false, *success);
@@ -2662,11 +2603,12 @@
       __ br_null(value, false, Assembler::pn, done);
       __ delayed()->nop();
     }
-    load(array, oopDesc::klass_offset_in_bytes(), k_RInfo, T_OBJECT, op->info_for_exception());
-    load(value, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL);
+    add_debug_info_for_null_check_here(op->info_for_exception());
+    __ load_klass(array, k_RInfo);
+    __ load_klass(value, klass_RInfo);
 
     // get instance klass
-    load(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc), k_RInfo, T_OBJECT, NULL);
+    __ ld_ptr(Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)), k_RInfo);
     // perform the fast part of the checking logic
     __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, success_target, failure_target, NULL);
 
@@ -2688,7 +2630,7 @@
         __ set(mdo_offset_bias, tmp1);
         __ add(mdo, tmp1, mdo);
       }
-      load(Address(value, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
+      __ load_klass(value, recv);
       type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &done);
       __ ba(false, done);
       __ delayed()->nop();
@@ -2769,14 +2711,17 @@
     Register t2 = op->tmp2()->as_register();
     __ mov(cmp_value, t1);
     __ mov(new_value, t2);
-#ifdef _LP64
     if (op->code() == lir_cas_obj) {
-      __ casx(addr, t1, t2);
-    } else
-#endif
-      {
+      if (UseCompressedOops) {
+        __ encode_heap_oop(t1);
+        __ encode_heap_oop(t2);
         __ cas(addr, t1, t2);
+      } else {
+        __ cas_ptr(addr, t1, t2);
       }
+    } else {
+      __ cas(addr, t1, t2);
+    }
     __ cmp(t1, t2);
   } else {
     Unimplemented();
@@ -2873,11 +2818,8 @@
   int bci          = op->profiled_bci();
 
   // Update counter for all call types
-  ciMethodData* md = method->method_data();
-  if (md == NULL) {
-    bailout("out of memory building methodDataOop");
-    return;
-  }
+  ciMethodData* md = method->method_data_or_null();
+  assert(md != NULL, "Sanity");
   ciProfileData* data = md->bci_to_data(bci);
   assert(data->is_CounterData(), "need CounterData for calls");
   assert(op->mdo()->is_single_cpu(),  "mdo must be allocated");
@@ -2954,7 +2896,7 @@
         }
       }
     } else {
-      load(Address(recv, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
+      __ load_klass(recv, recv);
       Label update_done;
       type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &update_done);
       // Receiver did not match any saved receiver and there is no empty row for it.
@@ -3148,7 +3090,7 @@
   } else {
     // use normal move for all other volatiles since they don't need
     // special handling to remain atomic.
-    move_op(src, dest, type, lir_patch_none, info, false, false);
+    move_op(src, dest, type, lir_patch_none, info, false, false, false);
   }
 }
 
--- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP
+
  private:
 
   //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -37,33 +40,11 @@
   //       and then a load or store is emitted with ([O7] + [d]).
   //
 
-  // some load/store variants return the code_offset for proper positioning of debug info for null checks
-
-  // load/store with 32 bit displacement
-  int load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo* info = NULL);
-  void store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info = NULL);
-
-  // loadf/storef with 32 bit displacement
-  void load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL);
-  void store(FloatRegister d, Register s1, int disp, BasicType st_type, CodeEmitInfo* info = NULL);
+  int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned);
+  int store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide);
 
-  // convienence methods for calling load/store with an Address
-  void load(const Address& a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0);
-  void store(Register d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0);
-  void load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0);
-  void store(FloatRegister d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0);
-
-  // convienence methods for calling load/store with an LIR_Address
-  void load(LIR_Address* a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL);
-  void store(Register d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL);
-  void load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL);
-  void store(FloatRegister d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL);
-
-  int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned = false);
-  int store(LIR_Opr from_reg, Register base, Register disp, BasicType type);
-
-  int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned = false);
-  int load(Register base, Register disp, LIR_Opr to_reg, BasicType type);
+  int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned);
+  int load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide);
 
   void monitorexit(LIR_Opr obj_opr, LIR_Opr lock_opr, Register hdr, int monitor_no);
 
@@ -90,3 +71,5 @@
 #endif // _LP64
          exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4),
          deopt_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4) };
+
+#endif // CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP
--- a/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRGenerator_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_LIRGenerator.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciArray.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_sparc.inline.hpp"
 
 #ifdef ASSERT
 #define __ gen()->lir(__FILE__, __LINE__)->
--- a/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_LinearScan_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "utilities/bitMap.inline.hpp"
 
 void LinearScan::allocate_fpu_stack() {
   // No FPU stack on SPARC
--- a/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP
+#define CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP
+
 inline bool LinearScan::is_processed_reg_num(int reg_num) {
   return reg_num < 26 || reg_num > 31;
 }
@@ -71,3 +74,5 @@
   }
   return false;
 }
+
+#endif // CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP
--- a/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,15 +22,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_MacroAssembler_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
 
 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
   Label L;
   const Register temp_reg = G3_scratch;
   // Note: needs more testing of out-of-line vs. inline slow case
   verify_oop(receiver);
-  ld_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg);
+  load_klass(receiver, temp_reg);
   cmp(temp_reg, iCache);
   brx(Assembler::equal, true, Assembler::pt, L);
   delayed()->nop();
@@ -175,9 +185,19 @@
   } else {
     set((intx)markOopDesc::prototype(), t1);
   }
-  st_ptr(t1  , obj, oopDesc::mark_offset_in_bytes       ());
-  st_ptr(klass, obj, oopDesc::klass_offset_in_bytes      ());
-  if (len->is_valid()) st(len  , obj, arrayOopDesc::length_offset_in_bytes());
+  st_ptr(t1, obj, oopDesc::mark_offset_in_bytes());
+  if (UseCompressedOops) {
+    // Save klass
+    mov(klass, t1);
+    encode_heap_oop_not_null(t1);
+    stw(t1, obj, oopDesc::klass_offset_in_bytes());
+  } else {
+    st_ptr(klass, obj, oopDesc::klass_offset_in_bytes());
+  }
+  if (len->is_valid()) st(len, obj, arrayOopDesc::length_offset_in_bytes());
+  else if (UseCompressedOops) {
+    store_klass_gap(G0, obj);
+  }
 }
 
 
@@ -225,7 +245,7 @@
   Register t1,                         // temp register
   Register t2                          // temp register
   ) {
-  const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes();
+  const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize;
 
   initialize_header(obj, klass, noreg, t1, t2);
 
--- a/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP
+
   void pd_init() { /* nothing to do */ }
 
  public:
@@ -84,3 +87,5 @@
   // invalidates registers in this window
   void invalidate_registers(bool iregisters, bool lregisters, bool oregisters,
                             Register preserve1 = noreg, Register preserve2 = noreg);
+
+#endif // CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP
--- a/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Runtime1_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Defs.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "register_sparc.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_sparc.inline.hpp"
 
 // Implementation of StubAssembler
 
@@ -600,7 +612,7 @@
         // load the klass and check the has finalizer flag
         Label register_finalizer;
         Register t = O1;
-        __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), t);
+        __ load_klass(O0, t);
         __ ld(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc), t);
         __ set(JVM_ACC_HAS_FINALIZER, G3);
         __ andcc(G3, t, G0);
--- a/src/cpu/sparc/vm/c1_globals_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c1_globals_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP
+#define CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 // Sets the default values for platform dependent flags used by the client compiler.
 // (see c1_globals.hpp)
 
@@ -61,3 +67,5 @@
 define_pd_global(bool, TwoOperandLIRForm,            false);
 
 define_pd_global(intx, SafepointPollOffset,          0    );
+
+#endif // CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP
--- a/src/cpu/sparc/vm/c2_globals_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c2_globals_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP
+#define CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 // Sets the default values for platform dependent flags used by the server compiler.
 // (see c2_globals.hpp).  Alpha-sorted.
 
@@ -88,3 +94,5 @@
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
+
+#endif // CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP
--- a/src/cpu/sparc/vm/c2_init_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/c2_init_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c2_init_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/compile.hpp"
+#include "opto/node.hpp"
 
 // processor dependent initialization for sparc
 
--- a/src/cpu/sparc/vm/codeBuffer_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/codeBuffer_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_CODEBUFFER_SPARC_HPP
+#define CPU_SPARC_VM_CODEBUFFER_SPARC_HPP
+
 private:
   void pd_initialize() {}
 
@@ -32,3 +35,5 @@
   bool is_backward_branch(Label& L) {
     return L.is_bound() && insts_end() <= locator_address(L.loc());
   }
+
+#endif // CPU_SPARC_VM_CODEBUFFER_SPARC_HPP
--- a/src/cpu/sparc/vm/copy_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/copy_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_COPY_SPARC_HPP
+#define CPU_SPARC_VM_COPY_SPARC_HPP
+
 // Inline functions for memory copy and fill.
 
 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
@@ -186,3 +189,5 @@
 static void pd_zero_to_bytes(void* to, size_t count) {
   (void)memset(to, 0, count);
 }
+
+#endif // CPU_SPARC_VM_COPY_SPARC_HPP
--- a/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP
+#define CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP
+
   static address frame_manager_return;
   static address frame_manager_sync_return;
 
@@ -32,3 +35,5 @@
   void generate_compute_interpreter_state(const Register state,
                                           const Register prev_state,
                                           bool native);
+
+#endif // CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP
--- a/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,32 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/cppInterpreter.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+#ifdef SHARK
+#include "shark/shark_globals.hpp"
+#endif
 
 #ifdef CC_INTERP
 
--- a/src/cpu/sparc/vm/cppInterpreter_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/cppInterpreter_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP
+#define CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP
+
   // Size of interpreter code.  Increase if too small.  Interpreter will
   // fail with a guarantee ("not enough space for interpreter generation");
   // if too small.
@@ -37,3 +40,5 @@
 #else
   const static int InterpreterCodeSize = 180 * K;
 #endif
+
+#endif // CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP
--- a/src/cpu/sparc/vm/debug_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/debug_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_debug_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/init.hpp"
+#include "runtime/os.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/top.hpp"
 
 #ifndef PRODUCT
 
--- a/src/cpu/sparc/vm/depChecker_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/depChecker_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_depChecker_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/disassembler.hpp"
+#include "depChecker_sparc.hpp"
 
 // Nothing to do on Sparc
--- a/src/cpu/sparc/vm/depChecker_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/depChecker_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_DEPCHECKER_SPARC_HPP
+#define CPU_SPARC_VM_DEPCHECKER_SPARC_HPP
+
 // Nothing to do on Sparc
+
+#endif // CPU_SPARC_VM_DEPCHECKER_SPARC_HPP
--- a/src/cpu/sparc/vm/disassembler_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/disassembler_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP
+
   static int pd_instruction_alignment() {
     return sizeof(int);
   }
@@ -30,3 +33,5 @@
     return (VM_Version::v9_instructions_work()?
             (VM_Version::v8_instructions_work()? "" : "v9only") : "v8only");
   }
+
+#endif // CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP
--- a/src/cpu/sparc/vm/dump_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/dump_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dump_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
 
 
 
--- a/src/cpu/sparc/vm/frame_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/frame_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,24 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_frame_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#include "runtime/vframeArray.hpp"
+#endif
 
 void RegisterMap::pd_clear() {
   if (_thread->has_last_Java_frame()) {
--- a/src/cpu/sparc/vm/frame_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/frame_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_FRAME_SPARC_HPP
+#define CPU_SPARC_VM_FRAME_SPARC_HPP
+
+#include "runtime/synchronizer.hpp"
+#include "utilities/top.hpp"
+
 // A frame represents a physical stack frame (an activation).  Frames can be
 // C or Java frames, and the Java frames can be interpreted or compiled.
 // In contrast, vframes represent source-level activations, so that one physical frame
@@ -309,3 +315,5 @@
     return reg->is_out() || reg->is_global();
 #endif
   }
+
+#endif // CPU_SPARC_VM_FRAME_SPARC_HPP
--- a/src/cpu/sparc/vm/frame_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/frame_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
+#define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
+
 // Inline functions for SPARC frames:
 
 // Constructors
@@ -295,3 +298,5 @@
 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
   *((oop*) map->location(O0->as_VMReg())) = obj;
 }
+
+#endif // CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
--- a/src/cpu/sparc/vm/globalDefinitions_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/globalDefinitions_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
+#define CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
+
 // Size of Sparc Instructions
 const int BytesPerInstWord = 4;
 
 const int StackAlignmentInBytes = (2*wordSize);
+
+#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
--- a/src/cpu/sparc/vm/globals_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/globals_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_GLOBALS_SPARC_HPP
+#define CPU_SPARC_VM_GLOBALS_SPARC_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 // Sets the default values for platform dependent flags used by the runtime system.
 // (see globals.hpp)
 
@@ -64,3 +70,5 @@
 define_pd_global(bool, RewriteFrequentPairs, true);
 
 define_pd_global(bool, UseMembar,            false);
+
+#endif // CPU_SPARC_VM_GLOBALS_SPARC_HPP
--- a/src/cpu/sparc/vm/icBuffer_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/icBuffer_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icBuffer_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
 #ifdef _LP64
--- a/src/cpu/sparc/vm/icache_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/icache_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icache_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "runtime/icache.hpp"
 
 #define __ _masm->
 
--- a/src/cpu/sparc/vm/icache_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/icache_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_ICACHE_SPARC_HPP
+#define CPU_SPARC_VM_ICACHE_SPARC_HPP
+
 // Interface for updating the instruction cache.  Whenever the VM modifies
 // code, part of the processor instruction cache potentially has to be flushed.
 
@@ -36,3 +39,5 @@
 
   // Use default implementation
 };
+
+#endif // CPU_SPARC_VM_ICACHE_SPARC_HPP
--- a/src/cpu/sparc/vm/interp_masm_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,26 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interp_masm_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interp_masm_sparc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
 
 #ifndef CC_INTERP
 #ifndef FAST_DISPATCH
--- a/src/cpu/sparc/vm/interp_masm_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/interp_masm_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
+#define CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
+
+#include "assembler_sparc.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
 // This file specializes the assember with interpreter-specific macros
 
 REGISTER_DECLARATION(     Register, Otos_i , O0); // tos for ints, etc
@@ -327,3 +333,5 @@
   void restore_return_value(TosState state, bool is_native_call);
 
 };
+
+#endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
--- a/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP
+#define CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP
+
  friend class AbstractInterpreterGenerator;
 
  private:
@@ -39,3 +42,5 @@
 
   void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue);
   void generate_counter_overflow(Label& Lcontinue);
+
+#endif // CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP
--- a/src/cpu/sparc/vm/interpreterRT_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/interpreterRT_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
 
 
 #define __ _masm->
--- a/src/cpu/sparc/vm/interpreterRT_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/interpreterRT_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP
+#define CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP
+
+#include "memory/allocation.hpp"
+
 static int binary_search(int key, LookupswitchPair* array, int n);
 
 static address iload (JavaThread* thread);
@@ -54,3 +59,5 @@
   // Code generation
   void generate( uint64_t fingerprint );
 };
+
+#endif // CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP
--- a/src/cpu/sparc/vm/interpreter_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/interpreter_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,32 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 
 
--- a/src/cpu/sparc/vm/interpreter_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/interpreter_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_INTERPRETER_SPARC_HPP
+#define CPU_SPARC_VM_INTERPRETER_SPARC_HPP
+
  public:
 
   static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; }
@@ -34,3 +37,5 @@
     assert(i <= 0, "local direction already negated");
     return stackElementWords * i;
   }
+
+#endif // CPU_SPARC_VM_INTERPRETER_SPARC_HPP
--- a/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP
+#define CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP
+
 private:
   volatile int _flags;
 
@@ -97,3 +100,5 @@
     _flags |= flushed;
     OrderAccess::fence();
   }
+
+#endif // CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP
--- a/src/cpu/sparc/vm/jniFastGetField_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/jniFastGetField_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jniFastGetField_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
 
 // TSO ensures that loads are blocking and ordered with respect to
 // to earlier loads, so we don't need LoadLoad membars.
--- a/src/cpu/sparc/vm/jniTypes_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/jniTypes_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_JNITYPES_SPARC_HPP
+#define CPU_SPARC_VM_JNITYPES_SPARC_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "prims/jni.h"
+
 // This file holds platform-dependent routines used to write primitive jni
 // types to the array of arguments passed into JavaCalls::call
 
@@ -106,3 +113,5 @@
 #endif
 
 };
+
+#endif // CPU_SPARC_VM_JNITYPES_SPARC_HPP
--- a/src/cpu/sparc/vm/jni_sparc.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/jni_sparc.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/methodHandles_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/methodHandles.hpp"
 
 #define __ _masm->
 
@@ -687,8 +689,8 @@
     {
       // Perform an in-place conversion to int or an int subword.
       __ ldsw(G3_amh_vmargslot, O0_argslot);
+      Address value;
       Address vmarg = __ argument_address(O0_argslot);
-      Address value;
       bool value_left_justified = false;
 
       switch (ek) {
@@ -698,9 +700,21 @@
       case _adapter_opt_l2i:
         {
           // just delete the extra slot
+#ifdef _LP64
+          // In V9, longs are given 2 64-bit slots in the interpreter, but the
+          // data is passed in only 1 slot.
+          // Keep the second slot.
+          __ add(Gargs, __ argument_offset(O0_argslot, -1), O0_argslot);
+          remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch);
+          value = Address(O0_argslot, 4);  // Get least-significant 32-bit of 64-bit value.
+          vmarg = Address(O0_argslot, Interpreter::stackElementSize);
+#else
+          // Keep the first slot.
           __ add(Gargs, __ argument_offset(O0_argslot), O0_argslot);
           remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch);
-          value = vmarg = Address(O0_argslot, 0);
+          value = Address(O0_argslot, 0);
+          vmarg = value;
+#endif
         }
         break;
       case _adapter_opt_unboxi:
--- a/src/cpu/sparc/vm/nativeInst_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/nativeInst_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_nativeInst_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 
 bool NativeInstruction::is_dtrace_trap() {
--- a/src/cpu/sparc/vm/nativeInst_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/nativeInst_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP
+#define CPU_SPARC_VM_NATIVEINST_SPARC_HPP
+
+#include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/os.hpp"
+#include "utilities/top.hpp"
+
 // We have interface for the following instructions:
 // - NativeInstruction
 // - - NativeCall
@@ -913,3 +922,5 @@
   // Insert illegal opcode as specific address
   static void insert(address code_pos);
 };
+
+#endif // CPU_SPARC_VM_NATIVEINST_SPARC_HPP
--- a/src/cpu/sparc/vm/registerMap_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/registerMap_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
+#define CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
+
 // machine-dependent implemention for register maps
   friend class frame;
 
@@ -51,3 +54,5 @@
   void shift_individual_registers();
   // When popping out of compiled frames, we make all IRegs disappear.
   void make_integer_regs_unsaved() { _location_valid[0] = 0; }
+
+#endif // CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
--- a/src/cpu/sparc/vm/register_definitions_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/register_definitions_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -25,8 +25,11 @@
 // make sure the defines don't screw up the declarations later on in this file
 #define DONT_USE_REGISTER_DEFINES
 
-#include "incls/_precompiled.incl"
-#include "incls/_register_definitions_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "asm/register.hpp"
+#include "interp_masm_sparc.hpp"
+#include "register_sparc.hpp"
 
 REGISTER_DEFINITION(Register, noreg);
 
--- a/src/cpu/sparc/vm/register_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/register_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_register_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "register_sparc.hpp"
 
 const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers << 1;
 const int ConcreteRegisterImpl::max_fpr =  ConcreteRegisterImpl::max_gpr + FloatRegisterImpl::number_of_registers;
--- a/src/cpu/sparc/vm/register_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/register_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_REGISTER_SPARC_HPP
+#define CPU_SPARC_VM_REGISTER_SPARC_HPP
+
+#include "asm/register.hpp"
+#include "vm_version_sparc.hpp"
+
 // forward declaration
 class Address;
 class VMRegImpl;
@@ -440,3 +446,5 @@
     return as_FloatRegister( ((encoding & 1) << 5) | (encoding & 0x1c) );
   }
 };
+
+#endif // CPU_SPARC_VM_REGISTER_SPARC_HPP
--- a/src/cpu/sparc/vm/relocInfo_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/relocInfo_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_relocInfo_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.inline.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/relocInfo.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
 
 void Relocation::pd_set_data_value(address x, intptr_t o) {
   NativeInstruction* ip = nativeInstruction_at(addr());
--- a/src/cpu/sparc/vm/relocInfo_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/relocInfo_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_RELOCINFO_SPARC_HPP
+#define CPU_SPARC_VM_RELOCINFO_SPARC_HPP
+
   // machine-dependent parts of class relocInfo
  private:
   enum {
@@ -49,3 +52,5 @@
 // 1.8 99/06/22 16:37:50 relocInfo_i486.hpp
 // 1.9 99/07/16 11:12:11 relocInfo_i486.hpp
 //End
+
+#endif // CPU_SPARC_VM_RELOCINFO_SPARC_HPP
--- a/src/cpu/sparc/vm/runtime_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/runtime_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,22 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_runtime_sparc.cpp.incl"
+#include "precompiled.hpp"
+#ifdef COMPILER2
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/vmreg.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_sparc.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "vmreg_sparc.inline.hpp"
+#endif
 
 
 #define __ masm->
--- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,28 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+#ifdef SHARK
+#include "compiler/compileBroker.hpp"
+#include "shark/sharkCompiler.hpp"
+#endif
 
 #define __ masm->
 
--- a/src/cpu/sparc/vm/sparc.ad	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/sparc.ad	Fri Jan 07 18:18:08 2011 +0100
@@ -667,6 +667,20 @@
   return offset;
 }
 
+static inline jdouble replicate_immI(int con, int count, int width) {
+  // Load a constant replicated "count" times with width "width"
+  int bit_width = width * 8;
+  jlong elt_val = con;
+  elt_val &= (((jlong) 1) << bit_width) - 1;  // mask off sign bits
+  jlong val = elt_val;
+  for (int i = 0; i < count - 1; i++) {
+    val <<= bit_width;
+    val |= elt_val;
+  }
+  jdouble dval = *((jdouble*) &val);  // coerce to double type
+  return dval;
+}
+
 // Standard Sparc opcode form2 field breakdown
 static inline void emit2_19(CodeBuffer &cbuf, int f30, int f29, int f25, int f22, int f20, int f19, int f0 ) {
   f0 &= (1<<19)-1;     // Mask displacement to 19 bits
@@ -1008,6 +1022,90 @@
 
 
 //=============================================================================
+const bool Matcher::constant_table_absolute_addressing = false;
+const RegMask& MachConstantBaseNode::_out_RegMask = PTR_REG_mask;
+
+void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
+  Compile* C = ra_->C;
+  Compile::ConstantTable& constant_table = C->constant_table();
+  MacroAssembler _masm(&cbuf);
+
+  Register r = as_Register(ra_->get_encode(this));
+  CodeSection* cs = __ code()->consts();
+  int consts_size = cs->align_at_start(cs->size());
+
+  if (UseRDPCForConstantTableBase) {
+    // For the following RDPC logic to work correctly the consts
+    // section must be allocated right before the insts section.  This
+    // assert checks for that.  The layout and the SECT_* constants
+    // are defined in src/share/vm/asm/codeBuffer.hpp.
+    assert(CodeBuffer::SECT_CONSTS + 1 == CodeBuffer::SECT_INSTS, "must be");
+    int offset = __ offset();
+    int disp;
+
+    // If the displacement from the current PC to the constant table
+    // base fits into simm13 we set the constant table base to the
+    // current PC.
+    if (__ is_simm13(-(consts_size + offset))) {
+      constant_table.set_table_base_offset(-(consts_size + offset));
+      disp = 0;
+    } else {
+      // If the offset of the top constant (last entry in the table)
+      // fits into simm13 we set the constant table base to the actual
+      // table base.
+      if (__ is_simm13(constant_table.top_offset())) {
+        constant_table.set_table_base_offset(0);
+        disp = consts_size + offset;
+      } else {
+        // Otherwise we set the constant table base in the middle of the
+        // constant table.
+        int half_consts_size = consts_size / 2;
+        assert(half_consts_size * 2 == consts_size, "sanity");
+        constant_table.set_table_base_offset(-half_consts_size);  // table base offset gets added to the load displacement.
+        disp = half_consts_size + offset;
+      }
+    }
+
+    __ rdpc(r);
+
+    if (disp != 0) {
+      assert(r != O7, "need temporary");
+      __ sub(r, __ ensure_simm13_or_reg(disp, O7), r);
+    }
+  }
+  else {
+    // Materialize the constant table base.
+    assert(constant_table.size() == consts_size, err_msg("must be: %d == %d", constant_table.size(), consts_size));
+    address baseaddr = cs->start() + -(constant_table.table_base_offset());
+    RelocationHolder rspec = internal_word_Relocation::spec(baseaddr);
+    AddressLiteral base(baseaddr, rspec);
+    __ set(base, r);
+  }
+}
+
+uint MachConstantBaseNode::size(PhaseRegAlloc*) const {
+  if (UseRDPCForConstantTableBase) {
+    // This is really the worst case but generally it's only 1 instruction.
+    return 4 /*rdpc*/ + 4 /*sub*/ + MacroAssembler::worst_case_size_of_set();
+  } else {
+    return MacroAssembler::worst_case_size_of_set();
+  }
+}
+
+#ifndef PRODUCT
+void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
+  char reg[128];
+  ra_->dump_register(this, reg);
+  if (UseRDPCForConstantTableBase) {
+    st->print("RDPC   %s\t! constant table base", reg);
+  } else {
+    st->print("SET    &constanttable,%s\t! constant table base", reg);
+  }
+}
+#endif
+
+
+//=============================================================================
 
 #ifndef PRODUCT
 void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
@@ -2247,25 +2345,6 @@
     __ delayed()->nop();
   %}
 
-  enc_class jump_enc( iRegX switch_val, o7RegI table) %{
-    MacroAssembler _masm(&cbuf);
-
-    Register switch_reg       = as_Register($switch_val$$reg);
-    Register table_reg        = O7;
-
-    address table_base = __ address_table_constant(_index2label);
-    RelocationHolder rspec = internal_word_Relocation::spec(table_base);
-
-    // Move table address into a register.
-    __ set(table_base, table_reg, rspec);
-
-    // Jump to base address + switch value
-    __ ld_ptr(table_reg, switch_reg, table_reg);
-    __ jmp(table_reg, G0);
-    __ delayed()->nop();
-
-  %}
-
   enc_class enc_ba( Label labl ) %{
     MacroAssembler _masm(&cbuf);
     Label &L = *($labl$$label);
@@ -2384,20 +2463,6 @@
     cbuf.insts()->emit_int32(op);
   %}
 
-  // Utility encoding for loading a 64 bit Pointer into a register
-  // The 64 bit pointer is stored in the generated code stream
-  enc_class SetPtr( immP src, iRegP rd ) %{
-    Register dest = reg_to_register_object($rd$$reg);
-    MacroAssembler _masm(&cbuf);
-    // [RGV] This next line should be generated from ADLC
-    if ( _opnds[1]->constant_is_oop() ) {
-      intptr_t val = $src$$constant;
-      __ set_oop_constant((jobject)val, dest);
-    } else {          // non-oop pointers, e.g. card mark base, heap top
-      __ set($src$$constant, dest);
-    }
-  %}
-
   enc_class Set13( immI13 src, iRegI rd ) %{
     emit3_simm13( cbuf, Assembler::arith_op, $rd$$reg, Assembler::or_op3, 0, $src$$constant );
   %}
@@ -2411,10 +2476,6 @@
     __ set($src$$constant, reg_to_register_object($rd$$reg));
   %}
 
-  enc_class SetNull( iRegI rd ) %{
-    emit3_simm13( cbuf, Assembler::arith_op, $rd$$reg, Assembler::or_op3, 0, 0 );
-  %}
-
   enc_class call_epilog %{
     if( VerifyStackAtCalls ) {
       MacroAssembler _masm(&cbuf);
@@ -2778,35 +2839,6 @@
     __ float_cmp( $primary, -1, Fsrc1, Fsrc2, Rdst);
   %}
 
-  enc_class LdImmL (immL src, iRegL dst, o7RegL tmp) %{   // Load Immediate
-    MacroAssembler _masm(&cbuf);
-    Register dest = reg_to_register_object($dst$$reg);
-    Register temp = reg_to_register_object($tmp$$reg);
-    __ set64( $src$$constant, dest, temp );
-  %}
-
-  enc_class LdReplImmI(immI src, regD dst, o7RegP tmp, int count, int width) %{
-    // Load a constant replicated "count" times with width "width"
-    int bit_width = $width$$constant * 8;
-    jlong elt_val = $src$$constant;
-    elt_val  &= (((jlong)1) << bit_width) - 1; // mask off sign bits
-    jlong val = elt_val;
-    for (int i = 0; i < $count$$constant - 1; i++) {
-        val <<= bit_width;
-        val |= elt_val;
-    }
-    jdouble dval = *(jdouble*)&val; // coerce to double type
-    MacroAssembler _masm(&cbuf);
-    address double_address = __ double_constant(dval);
-    RelocationHolder rspec = internal_word_Relocation::spec(double_address);
-    AddressLiteral addrlit(double_address, rspec);
-
-    __ sethi(addrlit, $tmp$$Register);
-    // XXX This is a quick fix for 6833573.
-    //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
-    __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec);
-  %}
-
   // Compiler ensures base is doubleword aligned and cnt is count of doublewords
   enc_class enc_Clear_Array(iRegX cnt, iRegP base, iRegX temp) %{
     MacroAssembler _masm(&cbuf);
@@ -3521,6 +3553,29 @@
   interface(CONST_INTER);
 %}
 
+// Pointer Immediate: 32 or 64-bit
+operand immP_set() %{
+  predicate(!VM_Version::is_niagara1_plus());
+  match(ConP);
+
+  op_cost(5);
+  // formats are generated automatically for constants and base registers
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
+// Pointer Immediate: 32 or 64-bit
+// From Niagara2 processors on a load should be better than materializing.
+operand immP_load() %{
+  predicate(VM_Version::is_niagara1_plus());
+  match(ConP);
+
+  op_cost(5);
+  // formats are generated automatically for constants and base registers
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
 operand immP13() %{
   predicate((-4096 < n->get_ptr()) && (n->get_ptr() <= 4095));
   match(ConP);
@@ -3616,6 +3671,26 @@
   interface(CONST_INTER);
 %}
 
+// Long Immediate: cheap (materialize in <= 3 instructions)
+operand immL_cheap() %{
+  predicate(!VM_Version::is_niagara1_plus() || MacroAssembler::size_of_set64(n->get_long()) <= 3);
+  match(ConL);
+  op_cost(0);
+
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
+// Long Immediate: expensive (materialize in > 3 instructions)
+operand immL_expensive() %{
+  predicate(VM_Version::is_niagara1_plus() && MacroAssembler::size_of_set64(n->get_long()) > 3);
+  match(ConL);
+  op_cost(0);
+
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
 // Double Immediate
 operand immD() %{
   match(ConD);
@@ -5981,25 +6056,59 @@
   ins_pipe(ialu_imm);
 %}
 
-instruct loadConP(iRegP dst, immP src) %{
-  match(Set dst src);
+#ifndef _LP64
+instruct loadConP(iRegP dst, immP con) %{
+  match(Set dst con);
+  ins_cost(DEFAULT_COST * 3/2);
+  format %{ "SET    $con,$dst\t!ptr" %}
+  ins_encode %{
+    // [RGV] This next line should be generated from ADLC
+    if (_opnds[1]->constant_is_oop()) {
+      intptr_t val = $con$$constant;
+      __ set_oop_constant((jobject) val, $dst$$Register);
+    } else {          // non-oop pointers, e.g. card mark base, heap top
+      __ set($con$$constant, $dst$$Register);
+    }
+  %}
+  ins_pipe(loadConP);
+%}
+#else
+instruct loadConP_set(iRegP dst, immP_set con) %{
+  match(Set dst con);
   ins_cost(DEFAULT_COST * 3/2);
-  format %{ "SET    $src,$dst\t!ptr" %}
-  // This rule does not use "expand" unlike loadConI because then
-  // the result type is not known to be an Oop.  An ADLC
-  // enhancement will be needed to make that work - not worth it!
-
-  ins_encode( SetPtr( src, dst ) );
+  format %{ "SET    $con,$dst\t! ptr" %}
+  ins_encode %{
+    // [RGV] This next line should be generated from ADLC
+    if (_opnds[1]->constant_is_oop()) {
+      intptr_t val = $con$$constant;
+      __ set_oop_constant((jobject) val, $dst$$Register);
+    } else {          // non-oop pointers, e.g. card mark base, heap top
+      __ set($con$$constant, $dst$$Register);
+    }
+  %}
   ins_pipe(loadConP);
-
-%}
+%}
+
+instruct loadConP_load(iRegP dst, immP_load con) %{
+  match(Set dst con);
+  ins_cost(MEMORY_REF_COST);
+  format %{ "LD     [$constanttablebase + $constantoffset],$dst\t! load from constant table: ptr=$con" %}
+  ins_encode %{
+      RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register);
+     __ ld_ptr($constanttablebase, con_offset, $dst$$Register);
+  %}
+  ins_pipe(loadConP);
+%}
+#endif // _LP64
 
 instruct loadConP0(iRegP dst, immP0 src) %{
   match(Set dst src);
 
   size(4);
   format %{ "CLR    $dst\t!ptr" %}
-  ins_encode( SetNull( dst ) );
+  ins_encode %{
+    __ clr($dst$$Register);
+  %}
   ins_pipe(ialu_imm);
 %}
 
@@ -6019,7 +6128,9 @@
 
   size(4);
   format %{ "CLR    $dst\t! compressed NULL ptr" %}
-  ins_encode( SetNull( dst ) );
+  ins_encode %{
+    __ clr($dst$$Register);
+  %}
   ins_pipe(ialu_imm);
 %}
 
@@ -6034,13 +6145,27 @@
   ins_pipe(ialu_hi_lo_reg);
 %}
 
-instruct loadConL(iRegL dst, immL src, o7RegL tmp) %{
-  // %%% maybe this should work like loadConD
-  match(Set dst src);
+// Materialize long value (predicated by immL_cheap).
+instruct loadConL_set64(iRegL dst, immL_cheap con, o7RegL tmp) %{
+  match(Set dst con);
   effect(KILL tmp);
-  ins_cost(DEFAULT_COST * 4);
-  format %{ "SET64   $src,$dst KILL $tmp\t! long" %}
-  ins_encode( LdImmL(src, dst, tmp) );
+  ins_cost(DEFAULT_COST * 3);
+  format %{ "SET64   $con,$dst KILL $tmp\t! cheap long" %}
+  ins_encode %{
+    __ set64($con$$constant, $dst$$Register, $tmp$$Register);
+  %}
+  ins_pipe(loadConL);
+%}
+
+// Load long value from constant table (predicated by immL_expensive).
+instruct loadConL_ldx(iRegL dst, immL_expensive con) %{
+  match(Set dst con);
+  ins_cost(MEMORY_REF_COST);
+  format %{ "LDX     [$constanttablebase + $constantoffset],$dst\t! load from constant table: long=$con" %}
+  ins_encode %{
+      RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register);
+    __ ldx($constanttablebase, con_offset, $dst$$Register);
+  %}
   ins_pipe(loadConL);
 %}
 
@@ -6063,50 +6188,26 @@
   ins_pipe(ialu_imm);
 %}
 
-instruct loadConF(regF dst, immF src, o7RegP tmp) %{
-  match(Set dst src);
+instruct loadConF(regF dst, immF con, o7RegI tmp) %{
+  match(Set dst con);
   effect(KILL tmp);
-
-#ifdef _LP64
-  size(8*4);
-#else
-  size(2*4);
-#endif
-
-  format %{ "SETHI  hi(&$src),$tmp\t!get float $src from table\n\t"
-            "LDF    [$tmp+lo(&$src)],$dst" %}
+  format %{ "LDF    [$constanttablebase + $constantoffset],$dst\t! load from constant table: float=$con" %}
   ins_encode %{
-    address float_address = __ float_constant($src$$constant);
-    RelocationHolder rspec = internal_word_Relocation::spec(float_address);
-    AddressLiteral addrlit(float_address, rspec);
-
-    __ sethi(addrlit, $tmp$$Register);
-    __ ldf(FloatRegisterImpl::S, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
+      RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register);
+    __ ldf(FloatRegisterImpl::S, $constanttablebase, con_offset, $dst$$FloatRegister);
   %}
   ins_pipe(loadConFD);
 %}
 
-instruct loadConD(regD dst, immD src, o7RegP tmp) %{
-  match(Set dst src);
+instruct loadConD(regD dst, immD con, o7RegI tmp) %{
+  match(Set dst con);
   effect(KILL tmp);
-
-#ifdef _LP64
-  size(8*4);
-#else
-  size(2*4);
-#endif
-
-  format %{ "SETHI  hi(&$src),$tmp\t!get double $src from table\n\t"
-            "LDDF   [$tmp+lo(&$src)],$dst" %}
+  format %{ "LDDF   [$constanttablebase + $constantoffset],$dst\t! load from constant table: double=$con" %}
   ins_encode %{
-    address double_address = __ double_constant($src$$constant);
-    RelocationHolder rspec = internal_word_Relocation::spec(double_address);
-    AddressLiteral addrlit(double_address, rspec);
-
-    __ sethi(addrlit, $tmp$$Register);
     // XXX This is a quick fix for 6833573.
-    //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
-    __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec);
+    //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset($con), $dst$$FloatRegister);
+    RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register);
+    __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
   %}
   ins_pipe(loadConFD);
 %}
@@ -8558,16 +8659,16 @@
 %}
 
 // Replicate scalar constant to packed byte values in Double register
-instruct Repl8B_immI(regD dst, immI13 src, o7RegP tmp) %{
-  match(Set dst (Replicate8B src));
-#ifdef _LP64
-  size(36);
-#else
-  size(8);
-#endif
-  format %{ "SETHI  hi(&Repl8($src)),$tmp\t!get Repl8B($src) from table\n\t"
-            "LDDF   [$tmp+lo(&Repl8($src))],$dst" %}
-  ins_encode( LdReplImmI(src, dst, tmp, (8), (1)) );
+instruct Repl8B_immI(regD dst, immI13 con, o7RegI tmp) %{
+  match(Set dst (Replicate8B con));
+  effect(KILL tmp);
+  format %{ "LDDF   [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl8B($con)" %}
+  ins_encode %{
+    // XXX This is a quick fix for 6833573.
+    //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 8, 1)), $dst$$FloatRegister);
+    RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 8, 1)), $tmp$$Register);
+    __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+  %}
   ins_pipe(loadConFD);
 %}
 
@@ -8594,16 +8695,16 @@
 %}
 
 // Replicate scalar constant to packed char values in Double register
-instruct Repl4C_immI(regD dst, immI src, o7RegP tmp) %{
-  match(Set dst (Replicate4C src));
-#ifdef _LP64
-  size(36);
-#else
-  size(8);
-#endif
-  format %{ "SETHI  hi(&Repl4($src)),$tmp\t!get Repl4C($src) from table\n\t"
-            "LDDF   [$tmp+lo(&Repl4($src))],$dst" %}
-  ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) );
+instruct Repl4C_immI(regD dst, immI con, o7RegI tmp) %{
+  match(Set dst (Replicate4C con));
+  effect(KILL tmp);
+  format %{ "LDDF   [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4C($con)" %}
+  ins_encode %{
+    // XXX This is a quick fix for 6833573.
+    //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister);
+    RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register);
+    __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+  %}
   ins_pipe(loadConFD);
 %}
 
@@ -8630,16 +8731,16 @@
 %}
 
 // Replicate scalar constant to packed short values in Double register
-instruct Repl4S_immI(regD dst, immI src, o7RegP tmp) %{
-  match(Set dst (Replicate4S src));
-#ifdef _LP64
-  size(36);
-#else
-  size(8);
-#endif
-  format %{ "SETHI  hi(&Repl4($src)),$tmp\t!get Repl4S($src) from table\n\t"
-            "LDDF   [$tmp+lo(&Repl4($src))],$dst" %}
-  ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) );
+instruct Repl4S_immI(regD dst, immI con, o7RegI tmp) %{
+  match(Set dst (Replicate4S con));
+  effect(KILL tmp);
+  format %{ "LDDF   [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4S($con)" %}
+  ins_encode %{
+    // XXX This is a quick fix for 6833573.
+    //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister);
+    RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register);
+    __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+  %}
   ins_pipe(loadConFD);
 %}
 
@@ -8664,16 +8765,16 @@
 %}
 
 // Replicate scalar zero constant to packed int values in Double register
-instruct Repl2I_immI(regD dst, immI src, o7RegP tmp) %{
-  match(Set dst (Replicate2I src));
-#ifdef _LP64
-  size(36);
-#else
-  size(8);
-#endif
-  format %{ "SETHI  hi(&Repl2($src)),$tmp\t!get Repl2I($src) from table\n\t"
-            "LDDF   [$tmp+lo(&Repl2($src))],$dst" %}
-  ins_encode( LdReplImmI(src, dst, tmp, (2), (4)) );
+instruct Repl2I_immI(regD dst, immI con, o7RegI tmp) %{
+  match(Set dst (Replicate2I con));
+  effect(KILL tmp);
+  format %{ "LDDF   [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl2I($con)" %}
+  ins_encode %{
+    // XXX This is a quick fix for 6833573.
+    //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 2, 4)), $dst$$FloatRegister);
+    RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 2, 4)), $tmp$$Register);
+    __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+  %}
   ins_pipe(loadConFD);
 %}
 
@@ -8929,12 +9030,27 @@
 
   ins_cost(350);
 
-  format %{  "SETHI  [hi(table_base)],O7\n\t"
-             "ADD    O7, lo(table_base), O7\n\t"
-             "LD     [O7+$switch_val], O7\n\t"
+  format %{  "ADD    $constanttablebase, $constantoffset, O7\n\t"
+             "LD     [O7 + $switch_val], O7\n\t"
              "JUMP   O7"
          %}
-  ins_encode( jump_enc( switch_val, table) );
+  ins_encode %{
+    // Calculate table address into a register.
+    Register table_reg;
+    Register label_reg = O7;
+    if (constant_offset() == 0) {
+      table_reg = $constanttablebase;
+    } else {
+      table_reg = O7;
+      RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset, O7);
+      __ add($constanttablebase, con_offset, table_reg);
+    }
+
+    // Jump to base address + switch value
+    __ ld_ptr(table_reg, $switch_val$$Register, label_reg);
+    __ jmp(label_reg, G0);
+    __ delayed()->nop();
+  %}
   ins_pc_relative(1);
   ins_pipe(ialu_reg_reg);
 %}
--- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,31 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // Declaration and definition of StubGenerator (no .hpp file).
 // For a more detailed description of the stub routine structure
--- a/src/cpu/sparc/vm/stubRoutines_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/stubRoutines_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
 
 // Implementation of the platform-specific part of StubRoutines - for
 // a description of how to extend it, see the stubRoutines.hpp file.
--- a/src/cpu/sparc/vm/stubRoutines_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/stubRoutines_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_STUBROUTINES_SPARC_HPP
+#define CPU_SPARC_VM_STUBROUTINES_SPARC_HPP
+
 // This file holds the platform specific parts of the StubRoutines
 // definition. See stubRoutines.hpp for a description on how to
 // extend it.
@@ -100,3 +103,5 @@
 
   static address partial_subtype_check()                  { return _partial_subtype_check; }
 };
+
+#endif // CPU_SPARC_VM_STUBROUTINES_SPARC_HPP
--- a/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP
+#define CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP
+
   protected:
 
   void generate_fixed_frame(bool native_call); // template interpreter only
   void generate_stack_overflow_check(Register Rframe_size, Register Rscratch,
                                      Register Rscratch2);
+
+#endif // CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP
--- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,28 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_templateInterpreter_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
 
 #ifndef CC_INTERP
 #ifndef FAST_DISPATCH
--- a/src/cpu/sparc/vm/templateInterpreter_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/templateInterpreter_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP
+#define CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP
+
 
   protected:
 
@@ -38,3 +41,5 @@
 #else
   const static int InterpreterCodeSize = 180 * K;
 #endif
+
+#endif // CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP
--- a/src/cpu/sparc/vm/templateTable_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/templateTable_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_templateTable_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
 
 #ifndef CC_INTERP
 #define __ _masm->
--- a/src/cpu/sparc/vm/templateTable_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/templateTable_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP
+#define CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP
+
   // helper function
   static void invokevfinal_helper(Register Rcache, Register Rret);
   static void invokeinterface_object_method(Register RklassOop, Register Rcall,
@@ -29,3 +32,5 @@
                                             Register Rflags);
   static void generate_vtable_call(Register Rrecv, Register Rindex, Register Rret);
   static void volatile_barrier(Assembler::Membar_mask_bits order_constraint);
+
+#endif // CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP
--- a/src/cpu/sparc/vm/vmStructs_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/vmStructs_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP
+#define CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP
+
 // These are the CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -97,3 +100,5 @@
   /* NOTE that we do not use the last_entry() macro here; it is used        */
   /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */
   /* be present there)                                                      */
+
+#endif // CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP
--- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/java.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "vm_version_sparc.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
 
 int VM_Version::_features = VM_Version::unknown_m;
 const char* VM_Version::_features_str = "";
--- a/src/cpu/sparc/vm/vm_version_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/vm_version_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_VM_VERSION_SPARC_HPP
+#define CPU_SPARC_VM_VM_VERSION_SPARC_HPP
+
+#include "runtime/globals_extension.hpp"
+#include "runtime/vm_version.hpp"
+
 class VM_Version: public Abstract_VM_Version {
 protected:
   enum Feature_Flag {
@@ -74,9 +80,6 @@
   static bool  is_sparc64(int features) { return (features & fmaf_instructions_m) != 0; }
 
   static int maximum_niagara1_processor_count() { return 32; }
-  // Returns true if the platform is in the niagara line and
-  // newer than the niagara1.
-  static bool is_niagara1_plus();
 
 public:
   // Initialization
@@ -99,6 +102,9 @@
   static bool is_ultra3()               { return (_features & ultra3_m) == ultra3_m; }
   static bool is_sun4v()                { return (_features & sun4v_m) != 0; }
   static bool is_niagara1()             { return is_niagara1(_features); }
+  // Returns true if the platform is in the niagara line and
+  // newer than the niagara1.
+  static bool is_niagara1_plus();
   static bool is_sparc64()              { return is_sparc64(_features); }
 
   static bool has_fast_fxtof()          { return has_v9() && !is_ultra3(); }
@@ -152,3 +158,5 @@
   // Calculates the number of parallel threads
   static unsigned int calc_parallel_worker_threads();
 };
+
+#endif // CPU_SPARC_VM_VM_VERSION_SPARC_HPP
--- a/src/cpu/sparc/vm/vmreg_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/vmreg_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vmreg_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
 
 
 
--- a/src/cpu/sparc/vm/vmreg_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/vmreg_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_VMREG_SPARC_HPP
+#define CPU_SPARC_VM_VMREG_SPARC_HPP
+
   bool is_Register();
   Register as_Register();
 
   bool is_FloatRegister();
   FloatRegister as_FloatRegister();
+
+#endif // CPU_SPARC_VM_VMREG_SPARC_HPP
--- a/src/cpu/sparc/vm/vmreg_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/vmreg_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP
+#define CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP
+
 inline VMReg RegisterImpl::as_VMReg() {
   if( this==noreg ) return VMRegImpl::Bad();
   return VMRegImpl::as_VMReg(encoding() << 1 );
@@ -60,3 +63,5 @@
   assert(false, "what register?");
   return false;
 }
+
+#endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP
--- a/src/cpu/sparc/vm/vtableStubs_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/sparc/vm/vtableStubs_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_sparc.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // machine-dependent part of VtableStubs: create vtableStub of correct size and
 // initialize its code
--- a/src/cpu/x86/vm/assembler_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/assembler_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,24 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#endif
 
 // Implementation of AddressLiteral
 
@@ -2633,6 +2649,37 @@
   emit_byte(0xC0 | encode);
 }
 
+void Assembler::sqrtsd(XMMRegister dst, Address src) {
+  NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+  InstructionMark im(this);
+  emit_byte(0xF2);
+  prefix(src, dst);
+  emit_byte(0x0F);
+  emit_byte(0x51);
+  emit_operand(dst, src);
+}
+
+void Assembler::sqrtss(XMMRegister dst, XMMRegister src) {
+  // HMM Table D-1 says sse2
+  // NOT_LP64(assert(VM_Version::supports_sse(), ""));
+  NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+  emit_byte(0xF3);
+  int encode = prefix_and_encode(dst->encoding(), src->encoding());
+  emit_byte(0x0F);
+  emit_byte(0x51);
+  emit_byte(0xC0 | encode);
+}
+
+void Assembler::sqrtss(XMMRegister dst, Address src) {
+  NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+  InstructionMark im(this);
+  emit_byte(0xF3);
+  prefix(src, dst);
+  emit_byte(0x0F);
+  emit_byte(0x51);
+  emit_operand(dst, src);
+}
+
 void Assembler::stmxcsr( Address dst) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
   InstructionMark im(this);
@@ -4342,16 +4389,6 @@
   emit_byte(0xE8 | encode);
 }
 
-void Assembler::sqrtsd(XMMRegister dst, Address src) {
-  NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionMark im(this);
-  emit_byte(0xF2);
-  prefix(src, dst);
-  emit_byte(0x0F);
-  emit_byte(0x51);
-  emit_operand(dst, src);
-}
-
 void Assembler::subq(Address dst, int32_t imm32) {
   InstructionMark im(this);
   prefixq(dst);
@@ -4913,10 +4950,6 @@
 }
 
 
-void MacroAssembler::movsd(XMMRegister dst, AddressLiteral src) {
-  movsd(dst, as_Address(src));
-}
-
 void MacroAssembler::pop_callee_saved_registers() {
   pop(rcx);
   pop(rdx);
@@ -5523,8 +5556,7 @@
 }
 
 void MacroAssembler::warn(const char* msg) {
-  push(r12);
-  movq(r12, rsp);
+  push(rsp);
   andq(rsp, -16);     // align stack as required by push_CPU_state and call
 
   push_CPU_state();   // keeps alignment at 16 bytes
@@ -5532,9 +5564,7 @@
   mov64(rax, 0);
   call_VM_leaf(CAST_FROM_FN_PTR(address, warning), c_rarg0);
   pop_CPU_state();
-
-  movq(rsp, r12);
-  pop(r12);
+  pop(rsp);
 }
 
 #ifndef PRODUCT
@@ -5846,6 +5876,10 @@
   // debugging support
   assert(number_of_arguments >= 0   , "cannot have negative number of arguments");
   LP64_ONLY(assert(java_thread == r15_thread, "unexpected register"));
+#ifdef ASSERT
+  LP64_ONLY(if (UseCompressedOops) verify_heapbase("call_VM_base");)
+#endif // ASSERT
+
   assert(java_thread != oop_result  , "cannot use the same register for java_thread & oop_result");
   assert(java_thread != last_java_sp, "cannot use the same register for java_thread & last_java_sp");
 
--- a/src/cpu/x86/vm/assembler_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/assembler_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_ASSEMBLER_X86_HPP
+#define CPU_X86_VM_ASSEMBLER_X86_HPP
+
 class BiasedLockingCounters;
 
 // Contains all the definitions needed for x86 assembly code generation.
@@ -132,6 +135,7 @@
 // Using noreg ensures if the dead code is incorrectly live and executed it
 // will cause an assertion failure
 #define rscratch1 noreg
+#define rscratch2 noreg
 
 #endif // _LP64
 
@@ -1349,6 +1353,10 @@
   void sqrtsd(XMMRegister dst, Address src);
   void sqrtsd(XMMRegister dst, XMMRegister src);
 
+  // Compute Square Root of Scalar Single-Precision Floating-Point Value
+  void sqrtss(XMMRegister dst, Address src);
+  void sqrtss(XMMRegister dst, XMMRegister src);
+
   void std() { emit_byte(0xfd); }
 
   void stmxcsr( Address dst );
@@ -2121,6 +2129,9 @@
   void comisd(XMMRegister dst, Address src) { Assembler::comisd(dst, src); }
   void comisd(XMMRegister dst, AddressLiteral src);
 
+  void fadd_s(Address src)        { Assembler::fadd_s(src); }
+  void fadd_s(AddressLiteral src) { Assembler::fadd_s(as_Address(src)); }
+
   void fldcw(Address src) { Assembler::fldcw(src); }
   void fldcw(AddressLiteral src);
 
@@ -2134,6 +2145,9 @@
   void fld_x(Address src) { Assembler::fld_x(src); }
   void fld_x(AddressLiteral src);
 
+  void fmul_s(Address src)        { Assembler::fmul_s(src); }
+  void fmul_s(AddressLiteral src) { Assembler::fmul_s(as_Address(src)); }
+
   void ldmxcsr(Address src) { Assembler::ldmxcsr(src); }
   void ldmxcsr(AddressLiteral src);
 
@@ -2150,10 +2164,50 @@
 
 public:
 
-  void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); }
-  void movsd(Address dst, XMMRegister src)     { Assembler::movsd(dst, src); }
-  void movsd(XMMRegister dst, Address src)     { Assembler::movsd(dst, src); }
-  void movsd(XMMRegister dst, AddressLiteral src);
+  void addsd(XMMRegister dst, XMMRegister src)    { Assembler::addsd(dst, src); }
+  void addsd(XMMRegister dst, Address src)        { Assembler::addsd(dst, src); }
+  void addsd(XMMRegister dst, AddressLiteral src) { Assembler::addsd(dst, as_Address(src)); }
+
+  void addss(XMMRegister dst, XMMRegister src)    { Assembler::addss(dst, src); }
+  void addss(XMMRegister dst, Address src)        { Assembler::addss(dst, src); }
+  void addss(XMMRegister dst, AddressLiteral src) { Assembler::addss(dst, as_Address(src)); }
+
+  void divsd(XMMRegister dst, XMMRegister src)    { Assembler::divsd(dst, src); }
+  void divsd(XMMRegister dst, Address src)        { Assembler::divsd(dst, src); }
+  void divsd(XMMRegister dst, AddressLiteral src) { Assembler::divsd(dst, as_Address(src)); }
+
+  void divss(XMMRegister dst, XMMRegister src)    { Assembler::divss(dst, src); }
+  void divss(XMMRegister dst, Address src)        { Assembler::divss(dst, src); }
+  void divss(XMMRegister dst, AddressLiteral src) { Assembler::divss(dst, as_Address(src)); }
+
+  void movsd(XMMRegister dst, XMMRegister src)    { Assembler::movsd(dst, src); }
+  void movsd(Address dst, XMMRegister src)        { Assembler::movsd(dst, src); }
+  void movsd(XMMRegister dst, Address src)        { Assembler::movsd(dst, src); }
+  void movsd(XMMRegister dst, AddressLiteral src) { Assembler::movsd(dst, as_Address(src)); }
+
+  void mulsd(XMMRegister dst, XMMRegister src)    { Assembler::mulsd(dst, src); }
+  void mulsd(XMMRegister dst, Address src)        { Assembler::mulsd(dst, src); }
+  void mulsd(XMMRegister dst, AddressLiteral src) { Assembler::mulsd(dst, as_Address(src)); }
+
+  void mulss(XMMRegister dst, XMMRegister src)    { Assembler::mulss(dst, src); }
+  void mulss(XMMRegister dst, Address src)        { Assembler::mulss(dst, src); }
+  void mulss(XMMRegister dst, AddressLiteral src) { Assembler::mulss(dst, as_Address(src)); }
+
+  void sqrtsd(XMMRegister dst, XMMRegister src)    { Assembler::sqrtsd(dst, src); }
+  void sqrtsd(XMMRegister dst, Address src)        { Assembler::sqrtsd(dst, src); }
+  void sqrtsd(XMMRegister dst, AddressLiteral src) { Assembler::sqrtsd(dst, as_Address(src)); }
+
+  void sqrtss(XMMRegister dst, XMMRegister src)    { Assembler::sqrtss(dst, src); }
+  void sqrtss(XMMRegister dst, Address src)        { Assembler::sqrtss(dst, src); }
+  void sqrtss(XMMRegister dst, AddressLiteral src) { Assembler::sqrtss(dst, as_Address(src)); }
+
+  void subsd(XMMRegister dst, XMMRegister src)    { Assembler::subsd(dst, src); }
+  void subsd(XMMRegister dst, Address src)        { Assembler::subsd(dst, src); }
+  void subsd(XMMRegister dst, AddressLiteral src) { Assembler::subsd(dst, as_Address(src)); }
+
+  void subss(XMMRegister dst, XMMRegister src)    { Assembler::subss(dst, src); }
+  void subss(XMMRegister dst, Address src)        { Assembler::subss(dst, src); }
+  void subss(XMMRegister dst, AddressLiteral src) { Assembler::subss(dst, as_Address(src)); }
 
   void ucomiss(XMMRegister dst, XMMRegister src) { Assembler::ucomiss(dst, src); }
   void ucomiss(XMMRegister dst, Address src) { Assembler::ucomiss(dst, src); }
@@ -2273,3 +2327,5 @@
 #ifdef ASSERT
 inline bool AbstractAssembler::pd_check_instruction_mark() { return true; }
 #endif
+
+#endif // CPU_X86_VM_ASSEMBLER_X86_HPP
--- a/src/cpu/x86/vm/assembler_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/assembler_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP
+#define CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP
+
+#include "asm/assembler.inline.hpp"
+#include "asm/codeBuffer.hpp"
+#include "code/codeCache.hpp"
+#include "runtime/handles.inline.hpp"
+
 inline void MacroAssembler::pd_patch_instruction(address branch, address target) {
   unsigned char op = branch[0];
   assert(op == 0xE8 /* call */ ||
@@ -85,3 +93,5 @@
   code_section()->set_end(_code_pos);
 }
 #endif // _LP64
+
+#endif // CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP
--- a/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,30 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodeInterpreter_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/bytecodeInterpreter.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "interp_masm_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "interp_masm_x86_64.hpp"
+#endif
 
 #ifdef CC_INTERP
 
--- a/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP
+#define CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP
+
 // Platform specific for C++ based Interpreter
 
 private:
@@ -108,3 +111,5 @@
                                                   ((VMJavaVal64*)(addr))->d)
 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
                                                 ((VMJavaVal64*)(addr))->l)
+
+#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP
--- a/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP
+#define CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP
+
 // Inline interpreter functions for IA32
 
 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; }
@@ -278,3 +281,5 @@
 inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
   return (jbyte) val;
 }
+
+#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP
--- a/src/cpu/x86/vm/bytecodes_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/bytecodes_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodes_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
 
 
 void Bytecodes::pd_initialize() {
--- a/src/cpu/x86/vm/bytecodes_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/bytecodes_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_BYTECODES_X86_HPP
+#define CPU_X86_VM_BYTECODES_X86_HPP
+
 // No i486 specific bytecodes
+
+#endif // CPU_X86_VM_BYTECODES_X86_HPP
--- a/src/cpu/x86/vm/bytes_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/bytes_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef CPU_X86_VM_BYTES_X86_HPP
+#define CPU_X86_VM_BYTES_X86_HPP
+
+#include "memory/allocation.hpp"
+
 class Bytes: AllStatic {
  private:
 #ifndef AMD64
@@ -67,4 +72,15 @@
 
 
 // The following header contains the implementations of swap_u2, swap_u4, and swap_u8[_base]
-#include "incls/_bytes_pd.inline.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "bytes_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "bytes_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "bytes_windows_x86.inline.hpp"
+#endif
+
+
+#endif // CPU_X86_VM_BYTES_X86_HPP
--- a/src/cpu/x86/vm/c1_CodeStubs_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_CodeStubs_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_CodeStubs_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_CodeStubs.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "nativeInst_x86.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 
 #define __ ce->masm()->
@@ -473,7 +483,7 @@
 
   Register pre_val_reg = pre_val()->as_register();
 
-  ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false);
+  ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
 
   __ cmpptr(pre_val_reg, (int32_t) NULL_WORD);
   __ jcc(Assembler::equal, _continuation);
--- a/src/cpu/x86/vm/c1_Defs_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_Defs_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_C1_DEFS_X86_HPP
+#define CPU_X86_VM_C1_DEFS_X86_HPP
+
 // native word offsets from memory address (little endian)
 enum {
   pd_lo_word_offset_in_bytes = 0,
@@ -58,8 +61,8 @@
   pd_nof_xmm_regs_linearscan = pd_nof_xmm_regs_frame_map, // number of registers visible to linear scan
   pd_first_cpu_reg = 0,
   pd_last_cpu_reg = NOT_LP64(5) LP64_ONLY(11),
-  pd_first_byte_reg = 2,
-  pd_last_byte_reg = 5,
+  pd_first_byte_reg = NOT_LP64(2) LP64_ONLY(0),
+  pd_last_byte_reg = NOT_LP64(5) LP64_ONLY(11),
   pd_first_fpu_reg = pd_nof_cpu_regs_frame_map,
   pd_last_fpu_reg =  pd_first_fpu_reg + 7,
   pd_first_xmm_reg = pd_nof_cpu_regs_frame_map + pd_nof_fpu_regs_frame_map,
@@ -71,3 +74,5 @@
 enum {
   pd_float_saved_as_double = true
 };
+
+#endif // CPU_X86_VM_C1_DEFS_X86_HPP
--- a/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_FpuStackSim_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_FpuStackSim.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "utilities/array.hpp"
+#include "utilities/ostream.hpp"
 
 //--------------------------------------------------------
 //               FpuStackSim
--- a/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP
+#define CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP
+
 //  Simulates the FPU stack and maintains mapping [fpu-register -> stack offset]
 //  FPU registers are described as numbers from 0..nof_fpu_regs-1
 
@@ -65,3 +68,5 @@
 
   void print() PRODUCT_RETURN;
 };
+
+#endif // CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP
--- a/src/cpu/x86/vm/c1_FrameMap_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_FrameMap_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_FrameMap_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIR.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
 
 const int FrameMap::pd_c_runtime_reserved_arg_size = 0;
 
@@ -155,9 +158,11 @@
   map_register( 6, r8);    r8_opr = LIR_OprFact::single_cpu(6);
   map_register( 7, r9);    r9_opr = LIR_OprFact::single_cpu(7);
   map_register( 8, r11);  r11_opr = LIR_OprFact::single_cpu(8);
-  map_register( 9, r12);  r12_opr = LIR_OprFact::single_cpu(9);
-  map_register(10, r13);  r13_opr = LIR_OprFact::single_cpu(10);
-  map_register(11, r14);  r14_opr = LIR_OprFact::single_cpu(11);
+  map_register( 9, r13);  r13_opr = LIR_OprFact::single_cpu(9);
+  map_register(10, r14);  r14_opr = LIR_OprFact::single_cpu(10);
+  // r12 is allocated conditionally. With compressed oops it holds
+  // the heapbase value and is not visible to the allocator.
+  map_register(11, r12);  r12_opr = LIR_OprFact::single_cpu(11);
   // The unallocatable registers are at the end
   map_register(12, r10);  r10_opr = LIR_OprFact::single_cpu(12);
   map_register(13, r15);  r15_opr = LIR_OprFact::single_cpu(13);
@@ -188,9 +193,9 @@
   _caller_save_cpu_regs[6]  = r8_opr;
   _caller_save_cpu_regs[7]  = r9_opr;
   _caller_save_cpu_regs[8]  = r11_opr;
-  _caller_save_cpu_regs[9]  = r12_opr;
-  _caller_save_cpu_regs[10] = r13_opr;
-  _caller_save_cpu_regs[11] = r14_opr;
+  _caller_save_cpu_regs[9]  = r13_opr;
+  _caller_save_cpu_regs[10] = r14_opr;
+  _caller_save_cpu_regs[11] = r12_opr;
 #endif // _LP64
 
 
--- a/src/cpu/x86/vm/c1_FrameMap_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_FrameMap_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_C1_FRAMEMAP_X86_HPP
+#define CPU_X86_VM_C1_FRAMEMAP_X86_HPP
+
 //  On i486 the frame looks as follows:
 //
 //  +-----------------------------+---------+----------------------------------------+----------------+-----------
@@ -126,3 +129,16 @@
     assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
     return _caller_save_xmm_regs[i];
   }
+
+  static int adjust_reg_range(int range) {
+    // Reduce the number of available regs (to free r12) in case of compressed oops
+    if (UseCompressedOops) return range - 1;
+    return range;
+  }
+
+  static int nof_caller_save_cpu_regs() { return adjust_reg_range(pd_nof_caller_save_cpu_regs_frame_map); }
+  static int last_cpu_reg()             { return adjust_reg_range(pd_last_cpu_reg);  }
+  static int last_byte_reg()            { return adjust_reg_range(pd_last_byte_reg); }
+
+#endif // CPU_X86_VM_C1_FRAMEMAP_X86_HPP
+
--- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRAssembler_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciArrayKlass.hpp"
+#include "ci/ciInstance.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 
 // These masks are used to provide 128-bit aligned bitmasks to the XMM
@@ -331,8 +343,8 @@
   Register receiver = FrameMap::receiver_opr->as_register();
   Register ic_klass = IC_Klass;
   const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
-
-  if (!VerifyOops) {
+  const bool do_post_padding = VerifyOops || UseCompressedOops;
+  if (!do_post_padding) {
     // insert some nops so that the verified entry point is aligned on CodeEntryAlignment
     while ((__ offset() + ic_cmp_size) % CodeEntryAlignment != 0) {
       __ nop();
@@ -340,8 +352,8 @@
   }
   int offset = __ offset();
   __ inline_cache_check(receiver, IC_Klass);
-  assert(__ offset() % CodeEntryAlignment == 0 || VerifyOops, "alignment must be correct");
-  if (VerifyOops) {
+  assert(__ offset() % CodeEntryAlignment == 0 || do_post_padding, "alignment must be correct");
+  if (do_post_padding) {
     // force alignment after the cache check.
     // It's been verified to be aligned if !VerifyOops
     __ align(CodeEntryAlignment);
@@ -547,16 +559,16 @@
   __ movptr (rax, arg1->as_register());
 
   // Get addresses of first characters from both Strings
-  __ movptr (rsi, Address(rax, java_lang_String::value_offset_in_bytes()));
-  __ movptr (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
-  __ lea    (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  __ load_heap_oop(rsi, Address(rax, java_lang_String::value_offset_in_bytes()));
+  __ movptr       (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
+  __ lea          (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
 
 
   // rbx, may be NULL
   add_debug_info_for_null_check_here(info);
-  __ movptr (rdi, Address(rbx, java_lang_String::value_offset_in_bytes()));
-  __ movptr (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
-  __ lea    (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  __ load_heap_oop(rdi, Address(rbx, java_lang_String::value_offset_in_bytes()));
+  __ movptr       (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
+  __ lea          (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
 
   // compute minimum length (in rax) and difference of lengths (on top of stack)
   if (VM_Version::supports_cmov()) {
@@ -684,10 +696,15 @@
   LIR_Const* c = src->as_constant_ptr();
 
   switch (c->type()) {
-    case T_INT:
+    case T_INT: {
+      assert(patch_code == lir_patch_none, "no patching handled here");
+      __ movl(dest->as_register(), c->as_jint());
+      break;
+    }
+
     case T_ADDRESS: {
       assert(patch_code == lir_patch_none, "no patching handled here");
-      __ movl(dest->as_register(), c->as_jint());
+      __ movptr(dest->as_register(), c->as_jint());
       break;
     }
 
@@ -768,8 +785,11 @@
   switch (c->type()) {
     case T_INT:  // fall through
     case T_FLOAT:
+      __ movl(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits());
+      break;
+
     case T_ADDRESS:
-      __ movl(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits());
+      __ movptr(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits());
       break;
 
     case T_OBJECT:
@@ -794,7 +814,7 @@
   }
 }
 
-void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) {
+void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) {
   assert(src->is_constant(), "should not call otherwise");
   assert(dest->is_address(), "should not call otherwise");
   LIR_Const* c = src->as_constant_ptr();
@@ -804,14 +824,21 @@
   switch (type) {
     case T_INT:    // fall through
     case T_FLOAT:
+      __ movl(as_Address(addr), c->as_jint_bits());
+      break;
+
     case T_ADDRESS:
-      __ movl(as_Address(addr), c->as_jint_bits());
+      __ movptr(as_Address(addr), c->as_jint_bits());
       break;
 
     case T_OBJECT:  // fall through
     case T_ARRAY:
       if (c->as_jobject() == NULL) {
-        __ movptr(as_Address(addr), NULL_WORD);
+        if (UseCompressedOops && !wide) {
+          __ movl(as_Address(addr), (int32_t)NULL_WORD);
+        } else {
+          __ movptr(as_Address(addr), NULL_WORD);
+        }
       } else {
         if (is_literal_address(addr)) {
           ShouldNotReachHere();
@@ -819,8 +846,14 @@
         } else {
 #ifdef _LP64
           __ movoop(rscratch1, c->as_jobject());
-          null_check_here = code_offset();
-          __ movptr(as_Address_lo(addr), rscratch1);
+          if (UseCompressedOops && !wide) {
+            __ encode_heap_oop(rscratch1);
+            null_check_here = code_offset();
+            __ movl(as_Address_lo(addr), rscratch1);
+          } else {
+            null_check_here = code_offset();
+            __ movptr(as_Address_lo(addr), rscratch1);
+          }
 #else
           __ movoop(as_Address(addr), c->as_jobject());
 #endif
@@ -997,22 +1030,28 @@
 }
 
 
-void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool /* unaligned */) {
+void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool wide, bool /* unaligned */) {
   LIR_Address* to_addr = dest->as_address_ptr();
   PatchingStub* patch = NULL;
+  Register compressed_src = rscratch1;
 
   if (type == T_ARRAY || type == T_OBJECT) {
     __ verify_oop(src->as_register());
+#ifdef _LP64
+    if (UseCompressedOops && !wide) {
+      __ movptr(compressed_src, src->as_register());
+      __ encode_heap_oop(compressed_src);
+    }
+#endif
   }
+
   if (patch_code != lir_patch_none) {
     patch = new PatchingStub(_masm, PatchingStub::access_field_id);
     Address toa = as_Address(to_addr);
     assert(toa.disp() != 0, "must have");
   }
-  if (info != NULL) {
-    add_debug_info_for_null_check_here(info);
-  }
-
+
+  int null_check_here = code_offset();
   switch (type) {
     case T_FLOAT: {
       if (src->is_single_xmm()) {
@@ -1038,13 +1077,17 @@
       break;
     }
 
-    case T_ADDRESS: // fall through
     case T_ARRAY:   // fall through
     case T_OBJECT:  // fall through
-#ifdef _LP64
+      if (UseCompressedOops && !wide) {
+        __ movl(as_Address(to_addr), compressed_src);
+      } else {
+        __ movptr(as_Address(to_addr), src->as_register());
+      }
+      break;
+    case T_ADDRESS:
       __ movptr(as_Address(to_addr), src->as_register());
       break;
-#endif // _LP64
     case T_INT:
       __ movl(as_Address(to_addr), src->as_register());
       break;
@@ -1101,6 +1144,9 @@
     default:
       ShouldNotReachHere();
   }
+  if (info != NULL) {
+    add_debug_info_for_null_check(null_check_here, info);
+  }
 
   if (patch_code != lir_patch_none) {
     patching_epilog(patch, patch_code, to_addr->base()->as_register(), info);
@@ -1184,7 +1230,7 @@
 }
 
 
-void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool /* unaligned */) {
+void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool /* unaligned */) {
   assert(src->is_address(), "should not call otherwise");
   assert(dest->is_register(), "should not call otherwise");
 
@@ -1238,13 +1284,18 @@
       break;
     }
 
-    case T_ADDRESS: // fall through
     case T_OBJECT:  // fall through
     case T_ARRAY:   // fall through
-#ifdef _LP64
+      if (UseCompressedOops && !wide) {
+        __ movl(dest->as_register(), from_addr);
+      } else {
+        __ movptr(dest->as_register(), from_addr);
+      }
+      break;
+
+    case T_ADDRESS:
       __ movptr(dest->as_register(), from_addr);
       break;
-#endif // _L64
     case T_INT:
       __ movl(dest->as_register(), from_addr);
       break;
@@ -1339,6 +1390,11 @@
   }
 
   if (type == T_ARRAY || type == T_OBJECT) {
+#ifdef _LP64
+    if (UseCompressedOops && !wide) {
+      __ decode_heap_oop(dest->as_register());
+    }
+#endif
     __ verify_oop(dest->as_register());
   }
 }
@@ -1660,11 +1716,8 @@
     ciMethod* method = op->profiled_method();
     assert(method != NULL, "Should have method");
     int bci = op->profiled_bci();
-    md = method->method_data();
-    if (md == NULL) {
-      bailout("out of memory building methodDataOop");
-      return;
-    }
+    md = method->method_data_or_null();
+    assert(md != NULL, "Sanity");
     data = md->bci_to_data(bci);
     assert(data != NULL,                "need data for type check");
     assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
@@ -1678,7 +1731,7 @@
   } else if (obj == klass_RInfo) {
     klass_RInfo = dst;
   }
-  if (k->is_loaded()) {
+  if (k->is_loaded() && !UseCompressedOops) {
     select_different_registers(obj, dst, k_RInfo, klass_RInfo);
   } else {
     Rtmp1 = op->tmp3()->as_register();
@@ -1715,21 +1768,26 @@
   if (op->fast_check()) {
     // get object class
     // not a safepoint as obj null check happens earlier
-    if (k->is_loaded()) {
 #ifdef _LP64
-      __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
-#else
-      __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding());
-#endif // _LP64
+    if (UseCompressedOops) {
+      __ load_klass(Rtmp1, obj);
+      __ cmpptr(k_RInfo, Rtmp1);
     } else {
       __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
     }
+#else
+    if (k->is_loaded()) {
+      __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding());
+    } else {
+      __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
+    }
+#endif
     __ jcc(Assembler::notEqual, *failure_target);
     // successful cast, fall through to profile or jump
   } else {
     // get object class
     // not a safepoint as obj null check happens earlier
-    __ movptr(klass_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
+    __ load_klass(klass_RInfo, obj);
     if (k->is_loaded()) {
       // See if we get an immediate positive hit
 #ifdef _LP64
@@ -1784,7 +1842,7 @@
     Register mdo  = klass_RInfo, recv = k_RInfo;
     __ bind(profile_cast_success);
     __ movoop(mdo, md->constant_encoding());
-    __ movptr(recv, Address(obj, oopDesc::klass_offset_in_bytes()));
+    __ load_klass(recv, obj);
     Label update_done;
     type_profile_helper(mdo, md, data, recv, success);
     __ jmp(*success);
@@ -1818,11 +1876,8 @@
       ciMethod* method = op->profiled_method();
       assert(method != NULL, "Should have method");
       int bci = op->profiled_bci();
-      md = method->method_data();
-      if (md == NULL) {
-        bailout("out of memory building methodDataOop");
-        return;
-      }
+      md = method->method_data_or_null();
+      assert(md != NULL, "Sanity");
       data = md->bci_to_data(bci);
       assert(data != NULL,                "need data for type check");
       assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
@@ -1848,10 +1903,10 @@
     }
 
     add_debug_info_for_null_check_here(op->info_for_exception());
-    __ movptr(k_RInfo, Address(array, oopDesc::klass_offset_in_bytes()));
-    __ movptr(klass_RInfo, Address(value, oopDesc::klass_offset_in_bytes()));
-
-    // get instance klass
+    __ load_klass(k_RInfo, array);
+    __ load_klass(klass_RInfo, value);
+
+    // get instance klass (it's already uncompressed)
     __ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)));
     // perform the fast part of the checking logic
     __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL);
@@ -1870,7 +1925,7 @@
       Register mdo  = klass_RInfo, recv = k_RInfo;
       __ bind(profile_cast_success);
       __ movoop(mdo, md->constant_encoding());
-      __ movptr(recv, Address(value, oopDesc::klass_offset_in_bytes()));
+      __ load_klass(recv, value);
       Label update_done;
       type_profile_helper(mdo, md, data, recv, &done);
       __ jmpb(done);
@@ -1934,12 +1989,31 @@
     assert(cmpval != newval, "cmp and new values must be in different registers");
     assert(cmpval != addr, "cmp and addr must be in different registers");
     assert(newval != addr, "new value and addr must be in different registers");
-    if (os::is_MP()) {
-      __ lock();
-    }
+
     if ( op->code() == lir_cas_obj) {
-      __ cmpxchgptr(newval, Address(addr, 0));
-    } else if (op->code() == lir_cas_int) {
+#ifdef _LP64
+      if (UseCompressedOops) {
+        __ encode_heap_oop(cmpval);
+        __ mov(rscratch1, newval);
+        __ encode_heap_oop(rscratch1);
+        if (os::is_MP()) {
+          __ lock();
+        }
+        // cmpval (rax) is implicitly used by this instruction
+        __ cmpxchgl(rscratch1, Address(addr, 0));
+      } else
+#endif
+      {
+        if (os::is_MP()) {
+          __ lock();
+        }
+        __ cmpxchgptr(newval, Address(addr, 0));
+      }
+    } else {
+      assert(op->code() == lir_cas_int, "lir_cas_int expected");
+      if (os::is_MP()) {
+        __ lock();
+      }
       __ cmpxchgl(newval, Address(addr, 0));
     }
 #ifdef _LP64
@@ -3181,8 +3255,13 @@
   }
 
   if (flags & LIR_OpArrayCopy::type_check) {
-    __ movptr(tmp, src_klass_addr);
-    __ cmpptr(tmp, dst_klass_addr);
+    if (UseCompressedOops) {
+      __ movl(tmp, src_klass_addr);
+      __ cmpl(tmp, dst_klass_addr);
+    } else {
+      __ movptr(tmp, src_klass_addr);
+      __ cmpptr(tmp, dst_klass_addr);
+    }
     __ jcc(Assembler::notEqual, *stub->entry());
   }
 
@@ -3197,13 +3276,23 @@
     // but not necessarily exactly of type default_type.
     Label known_ok, halt;
     __ movoop(tmp, default_type->constant_encoding());
+#ifdef _LP64
+    if (UseCompressedOops) {
+      __ encode_heap_oop(tmp);
+    }
+#endif
+
     if (basic_type != T_OBJECT) {
-      __ cmpptr(tmp, dst_klass_addr);
+
+      if (UseCompressedOops) __ cmpl(tmp, dst_klass_addr);
+      else                   __ cmpptr(tmp, dst_klass_addr);
       __ jcc(Assembler::notEqual, halt);
-      __ cmpptr(tmp, src_klass_addr);
+      if (UseCompressedOops) __ cmpl(tmp, src_klass_addr);
+      else                   __ cmpptr(tmp, src_klass_addr);
       __ jcc(Assembler::equal, known_ok);
     } else {
-      __ cmpptr(tmp, dst_klass_addr);
+      if (UseCompressedOops) __ cmpl(tmp, dst_klass_addr);
+      else                   __ cmpptr(tmp, dst_klass_addr);
       __ jcc(Assembler::equal, known_ok);
       __ cmpptr(src, dst);
       __ jcc(Assembler::equal, known_ok);
@@ -3277,11 +3366,8 @@
   int bci          = op->profiled_bci();
 
   // Update counter for all call types
-  ciMethodData* md = method->method_data();
-  if (md == NULL) {
-    bailout("out of memory building methodDataOop");
-    return;
-  }
+  ciMethodData* md = method->method_data_or_null();
+  assert(md != NULL, "Sanity");
   ciProfileData* data = md->bci_to_data(bci);
   assert(data->is_CounterData(), "need CounterData for calls");
   assert(op->mdo()->is_single_cpu(),  "mdo must be allocated");
@@ -3332,7 +3418,7 @@
         }
       }
     } else {
-      __ movptr(recv, Address(recv, oopDesc::klass_offset_in_bytes()));
+      __ load_klass(recv, recv);
       Label update_done;
       type_profile_helper(mdo, md, data, recv, &update_done);
       // Receiver did not match any saved receiver and there is no empty row for it.
--- a/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
+#define CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
+
  private:
 
   Address::ScaleFactor array_element_size(BasicType type) const;
@@ -56,3 +59,5 @@
          exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175),
          deopt_handler_size = NOT_LP64(10) LP64_ONLY(17)
        };
+
+#endif // CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
--- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRGenerator_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_LIRGenerator.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciArray.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_x86.inline.hpp"
 
 #ifdef ASSERT
 #define __ gen()->lir(__FILE__, __LINE__)->
@@ -862,6 +874,10 @@
 
 void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
   assert(x->number_of_arguments() == 5, "wrong type");
+
+  // Make all state_for calls early since they can emit code
+  CodeEmitInfo* info = state_for(x, x->state());
+
   LIRItem src(x->argument_at(0), this);
   LIRItem src_pos(x->argument_at(1), this);
   LIRItem dst(x->argument_at(2), this);
@@ -904,7 +920,6 @@
   ciArrayKlass* expected_type;
   arraycopy_helper(x, &flags, &expected_type);
 
-  CodeEmitInfo* info = state_for(x, x->state()); // we may want to have stack (deoptimization?)
   __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint
 }
 
@@ -1139,9 +1154,12 @@
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
   }
   LIR_Opr reg = rlock_result(x);
+  LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
+  if (!x->klass()->is_loaded() || UseCompressedOops) {
+    tmp3 = new_register(objectType);
+  }
   __ checkcast(reg, obj.result(), x->klass(),
-               new_register(objectType), new_register(objectType),
-               !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr,
+               new_register(objectType), new_register(objectType), tmp3,
                x->direct_compare(), info_for_exception, patching_info, stub,
                x->profiled_method(), x->profiled_bci());
 }
@@ -1158,9 +1176,12 @@
     patching_info = state_for(x, x->state_before());
   }
   obj.load_item();
+  LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
+  if (!x->klass()->is_loaded() || UseCompressedOops) {
+    tmp3 = new_register(objectType);
+  }
   __ instanceof(reg, obj.result(), x->klass(),
-                new_register(objectType), new_register(objectType),
-                !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr,
+                new_register(objectType), new_register(objectType), tmp3,
                 x->direct_compare(), patching_info, x->profiled_method(), x->profiled_bci());
 }
 
--- a/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_LinearScan_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "utilities/bitMap.inline.hpp"
 
 
 //----------------------------------------------------------------------
--- a/src/cpu/x86/vm/c1_LinearScan_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_LinearScan_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,24 +22,26 @@
  *
  */
 
+#ifndef CPU_X86_VM_C1_LINEARSCAN_X86_HPP
+#define CPU_X86_VM_C1_LINEARSCAN_X86_HPP
+
 inline bool LinearScan::is_processed_reg_num(int reg_num) {
 #ifndef _LP64
   // rsp and rbp (numbers 6 ancd 7) are ignored
   assert(FrameMap::rsp_opr->cpu_regnr() == 6, "wrong assumption below");
   assert(FrameMap::rbp_opr->cpu_regnr() == 7, "wrong assumption below");
   assert(reg_num >= 0, "invalid reg_num");
-
-  return reg_num < 6 || reg_num > 7;
 #else
-  // rsp and rbp, r10, r15 (numbers 6 ancd 7) are ignored
+  // rsp and rbp, r10, r15 (numbers [12,15]) are ignored
+  // r12 (number 11) is conditional on compressed oops.
+  assert(FrameMap::r12_opr->cpu_regnr() == 11, "wrong assumption below");
   assert(FrameMap::r10_opr->cpu_regnr() == 12, "wrong assumption below");
   assert(FrameMap::r15_opr->cpu_regnr() == 13, "wrong assumption below");
   assert(FrameMap::rsp_opr->cpu_regnrLo() == 14, "wrong assumption below");
   assert(FrameMap::rbp_opr->cpu_regnrLo() == 15, "wrong assumption below");
   assert(reg_num >= 0, "invalid reg_num");
-
-  return reg_num < 12 || reg_num > 15;
 #endif // _LP64
+  return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map;
 }
 
 inline int LinearScan::num_physical_regs(BasicType type) {
@@ -101,7 +103,7 @@
   if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) {
     assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
     _first_reg = pd_first_byte_reg;
-    _last_reg = pd_last_byte_reg;
+    _last_reg = FrameMap::last_byte_reg();
     return true;
   } else if ((UseSSE >= 1 && cur->type() == T_FLOAT) || (UseSSE >= 2 && cur->type() == T_DOUBLE)) {
     _first_reg = pd_first_xmm_reg;
@@ -185,3 +187,5 @@
   FpuStackAllocator(Compilation* compilation, LinearScan* allocator);
   void allocate();
 };
+
+#endif // CPU_X86_VM_C1_LINEARSCAN_X86_HPP
--- a/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_MacroAssembler_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
 
 int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register scratch, Label& slow_case) {
   const int aligned_mask = BytesPerWord -1;
@@ -145,11 +155,26 @@
     // This assumes that all prototype bits fit in an int32_t
     movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype());
   }
+#ifdef _LP64
+  if (UseCompressedOops) { // Take care not to kill klass
+    movptr(t1, klass);
+    encode_heap_oop_not_null(t1);
+    movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
+  } else
+#endif
+  {
+    movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass);
+  }
 
-  movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass);
   if (len->is_valid()) {
     movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len);
   }
+#ifdef _LP64
+  else if (UseCompressedOops) {
+    xorptr(t1, t1);
+    store_klass_gap(obj, t1);
+  }
+#endif
 }
 
 
@@ -220,7 +245,7 @@
 void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2) {
   assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0,
          "con_size_in_bytes is not multiple of alignment");
-  const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes();
+  const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize;
 
   initialize_header(obj, klass, noreg, t1, t2);
 
@@ -307,13 +332,19 @@
   // check against inline cache
   assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check");
   int start_offset = offset();
-  cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes()));
+
+  if (UseCompressedOops) {
+    load_klass(rscratch1, receiver);
+    cmpptr(rscratch1, iCache);
+  } else {
+    cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes()));
+  }
   // if icache check fails, then jump to runtime routine
   // Note: RECEIVER must still contain the receiver!
   jump_cc(Assembler::notEqual,
           RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
   const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
-  assert(offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
+  assert(UseCompressedOops || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
 }
 
 
--- a/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP
+#define CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP
+
 // C1_MacroAssembler contains high-level macros for C1
 
  private:
@@ -113,3 +116,5 @@
   }
 
   void invalidate_registers(bool inv_rax, bool inv_rbx, bool inv_rcx, bool inv_rdx, bool inv_rsi, bool inv_rdi) PRODUCT_RETURN;
+
+#endif // CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP
--- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Runtime1_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Defs.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "register_x86.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_x86.inline.hpp"
 
 
 // Implementation of StubAssembler
@@ -1343,7 +1355,7 @@
         // load the klass and check the has finalizer flag
         Label register_finalizer;
         Register t = rsi;
-        __ movptr(t, Address(rax, oopDesc::klass_offset_in_bytes()));
+        __ load_klass(t, rax);
         __ movl(t, Address(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)));
         __ testl(t, JVM_ACC_HAS_FINALIZER);
         __ jcc(Assembler::notZero, register_finalizer);
--- a/src/cpu/x86/vm/c1_globals_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c1_globals_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_C1_GLOBALS_X86_HPP
+#define CPU_X86_VM_C1_GLOBALS_X86_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 // Sets the default values for platform dependent flags used by the client compiler.
 // (see c1_globals.hpp)
 
@@ -60,3 +66,5 @@
 define_pd_global(bool, TwoOperandLIRForm,            true );
 
 define_pd_global(intx, SafepointPollOffset,          256  );
+
+#endif // CPU_X86_VM_C1_GLOBALS_X86_HPP
--- a/src/cpu/x86/vm/c2_globals_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c2_globals_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_C2_GLOBALS_X86_HPP
+#define CPU_X86_VM_C2_GLOBALS_X86_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 // Sets the default values for platform dependent flags used by the server compiler.
 // (see c2_globals.hpp).  Alpha-sorted.
 
@@ -87,3 +93,5 @@
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
+
+#endif // CPU_X86_VM_C2_GLOBALS_X86_HPP
--- a/src/cpu/x86/vm/c2_init_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/c2_init_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c2_init_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/compile.hpp"
+#include "opto/node.hpp"
 
 // processor dependent initialization for i486
 
--- a/src/cpu/x86/vm/codeBuffer_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/codeBuffer_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef CPU_X86_VM_CODEBUFFER_X86_HPP
+#define CPU_X86_VM_CODEBUFFER_X86_HPP
+
 private:
   void pd_initialize() {}
 
 public:
   void flush_bundle(bool start_new_bundle) {}
+
+#endif // CPU_X86_VM_CODEBUFFER_X86_HPP
--- a/src/cpu/x86/vm/copy_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/copy_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,22 @@
  *
  */
 
+#ifndef CPU_X86_VM_COPY_X86_HPP
+#define CPU_X86_VM_COPY_X86_HPP
+
 // Inline functions for memory copy and fill.
 
 // Contains inline asm implementations
-#include "incls/_copy_pd.inline.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "copy_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "copy_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "copy_windows_x86.inline.hpp"
+#endif
+
 
 static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
 #ifdef AMD64
@@ -58,3 +70,5 @@
 static void pd_zero_to_bytes(void* to, size_t count) {
   (void)memset(to, 0, count);
 }
+
+#endif // CPU_X86_VM_COPY_X86_HPP
--- a/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP
+#define CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP
+
  protected:
 
 #if 0
@@ -45,3 +48,5 @@
                                           const Register prev_state,
                                           const Register sender_sp,
                                           bool native); // C++ interpreter only
+
+#endif // CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP
--- a/src/cpu/x86/vm/cppInterpreter_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/cppInterpreter_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,32 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/cppInterpreter.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+#ifdef SHARK
+#include "shark/shark_globals.hpp"
+#endif
 
 #ifdef CC_INTERP
 
--- a/src/cpu/x86/vm/cppInterpreter_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/cppInterpreter_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_CPPINTERPRETER_X86_HPP
+#define CPU_X86_VM_CPPINTERPRETER_X86_HPP
+
 
   protected:
 
@@ -31,3 +34,5 @@
   // Run with +PrintInterpreter to get the VM to print out the size.
   // Max size with JVMTI
   const static int InterpreterCodeSize = 168 * 1024;
+
+#endif // CPU_X86_VM_CPPINTERPRETER_X86_HPP
--- a/src/cpu/x86/vm/debug_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/debug_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_debug_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/init.hpp"
+#include "runtime/os.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/top.hpp"
 
 void pd_ps(frame f) {}
--- a/src/cpu/x86/vm/depChecker_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/depChecker_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_depChecker_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/disassembler.hpp"
+#include "depChecker_x86.hpp"
 
 // Nothing to do on i486
--- a/src/cpu/x86/vm/depChecker_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/depChecker_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_DEPCHECKER_X86_HPP
+#define CPU_X86_VM_DEPCHECKER_X86_HPP
+
 // Nothing to do on i486
+
+#endif // CPU_X86_VM_DEPCHECKER_X86_HPP
--- a/src/cpu/x86/vm/disassembler_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/disassembler_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_DISASSEMBLER_X86_HPP
+#define CPU_X86_VM_DISASSEMBLER_X86_HPP
+
   static int pd_instruction_alignment() {
     return 1;
   }
@@ -29,3 +32,5 @@
   static const char* pd_cpu_opts() {
     return "";
   }
+
+#endif // CPU_X86_VM_DISASSEMBLER_X86_HPP
--- a/src/cpu/x86/vm/dump_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/dump_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dump_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
 
 
 
--- a/src/cpu/x86/vm/dump_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/dump_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dump_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
 
 
 
--- a/src/cpu/x86/vm/frame_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/frame_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,24 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_frame_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#include "runtime/vframeArray.hpp"
+#endif
 
 #ifdef ASSERT
 void RegisterMap::check_location_valid() {
--- a/src/cpu/x86/vm/frame_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/frame_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_FRAME_X86_HPP
+#define CPU_X86_VM_FRAME_X86_HPP
+
+#include "runtime/synchronizer.hpp"
+#include "utilities/top.hpp"
+
 // A frame represents a physical stack frame (an activation).  Frames can be
 // C or Java frames, and the Java frames can be interpreted or compiled.
 // In contrast, vframes represent source-level activations, so that one physical frame
@@ -199,3 +205,5 @@
 #ifdef CC_INTERP
   inline interpreterState get_interpreterState() const;
 #endif // CC_INTERP
+
+#endif // CPU_X86_VM_FRAME_X86_HPP
--- a/src/cpu/x86/vm/frame_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/frame_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_FRAME_X86_INLINE_HPP
+#define CPU_X86_VM_FRAME_X86_INLINE_HPP
+
 // Inline functions for Intel frames:
 
 // Constructors:
@@ -296,3 +299,5 @@
 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
   *((oop*) map->location(rax->as_VMReg())) = obj;
 }
+
+#endif // CPU_X86_VM_FRAME_X86_INLINE_HPP
--- a/src/cpu/x86/vm/globalDefinitions_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/globalDefinitions_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
+#define CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
+
 const int StackAlignmentInBytes  = 16;
+
+#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
--- a/src/cpu/x86/vm/globals_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/globals_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_GLOBALS_X86_HPP
+#define CPU_X86_VM_GLOBALS_X86_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 // Sets the default values for platform dependent flags used by the runtime system.
 // (see globals.hpp)
 
@@ -65,3 +71,5 @@
 define_pd_global(bool, RewriteFrequentPairs, true);
 
 define_pd_global(bool, UseMembar,            false);
+
+#endif // CPU_X86_VM_GLOBALS_X86_HPP
--- a/src/cpu/x86/vm/icBuffer_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/icBuffer_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icBuffer_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   return NativeMovConstReg::instruction_size +
--- a/src/cpu/x86/vm/icache_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/icache_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icache_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/icache.hpp"
 
 #define __ _masm->
 
--- a/src/cpu/x86/vm/icache_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/icache_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_ICACHE_X86_HPP
+#define CPU_X86_VM_ICACHE_X86_HPP
+
 // Interface for updating the instruction cache.  Whenever the VM modifies
 // code, part of the processor instruction cache potentially has to be flushed.
 
@@ -53,3 +56,5 @@
   };
 #endif // AMD64
 };
+
+#endif // CPU_X86_VM_ICACHE_X86_HPP
--- a/src/cpu/x86/vm/interp_masm_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interp_masm_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,29 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interp_masm_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "interp_masm_x86_32.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 // Implementation of InterpreterMacroAssembler
--- a/src/cpu/x86/vm/interp_masm_x86_32.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interp_masm_x86_32.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_INTERP_MASM_X86_32_HPP
+#define CPU_X86_VM_INTERP_MASM_X86_32_HPP
+
+#include "assembler_x86.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
 // This file specializes the assember with interpreter-specific macros
 
 
@@ -227,3 +233,5 @@
   void notify_method_exit(TosState state, NotifyMethodExitMode mode);
 
 };
+
+#endif // CPU_X86_VM_INTERP_MASM_X86_32_HPP
--- a/src/cpu/x86/vm/interp_masm_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,29 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interp_masm_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "interp_masm_x86_64.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 // Implementation of InterpreterMacroAssembler
@@ -428,10 +449,9 @@
     // JVMTI events, such as single-stepping, are implemented partly by avoiding running
     // compiled code in threads for which the event is enabled.  Check here for
     // interp_only_mode if these events CAN be enabled.
-    get_thread(temp);
     // interp_only is an int, on little endian it is sufficient to test the byte only
-    // Is a cmpl faster (ce
-    cmpb(Address(temp, JavaThread::interp_only_mode_offset()), 0);
+    // Is a cmpl faster?
+    cmpb(Address(r15_thread, JavaThread::interp_only_mode_offset()), 0);
     jcc(Assembler::zero, run_compiled_code);
     jmp(Address(method, methodOopDesc::interpreter_entry_offset()));
     bind(run_compiled_code);
--- a/src/cpu/x86/vm/interp_masm_x86_64.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interp_masm_x86_64.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_INTERP_MASM_X86_64_HPP
+#define CPU_X86_VM_INTERP_MASM_X86_64_HPP
+
+#include "assembler_x86.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
 // This file specializes the assember with interpreter-specific macros
 
 
@@ -243,3 +249,5 @@
   void notify_method_entry();
   void notify_method_exit(TosState state, NotifyMethodExitMode mode);
 };
+
+#endif // CPU_X86_VM_INTERP_MASM_X86_64_HPP
--- a/src/cpu/x86/vm/interpreterGenerator_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interpreterGenerator_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP
+#define CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP
+
 
 // Generation of Interpreter
 //
@@ -41,3 +44,5 @@
 
   void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue);
   void generate_counter_overflow(Label* do_continue);
+
+#endif // CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP
--- a/src/cpu/x86/vm/interpreterRT_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interpreterRT_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef CPU_X86_VM_INTERPRETERRT_X86_HPP
+#define CPU_X86_VM_INTERPRETERRT_X86_HPP
+
+#include "memory/allocation.hpp"
+
 // native method calls
 
 class SignatureHandlerGenerator: public NativeSignatureIterator {
@@ -72,3 +77,5 @@
   static Register to();
   static Register temp();
 };
+
+#endif // CPU_X86_VM_INTERPRETERRT_X86_HPP
--- a/src/cpu/x86/vm/interpreterRT_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interpreterRT_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
 
 
 #define __ _masm->
--- a/src/cpu/x86/vm/interpreterRT_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interpreterRT_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
 
 #define __ _masm->
 
--- a/src/cpu/x86/vm/interpreter_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interpreter_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_INTERPRETER_X86_HPP
+#define CPU_X86_VM_INTERPRETER_X86_HPP
+
  public:
 
   // Sentinel placed in the code for interpreter returns so
@@ -44,3 +47,5 @@
     assert(i <= 0, "local direction already negated");
     return stackElementWords * i;
   }
+
+#endif // CPU_X86_VM_INTERPRETER_X86_HPP
--- a/src/cpu/x86/vm/interpreter_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interpreter_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,32 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 #define __ _masm->
 
--- a/src/cpu/x86/vm/interpreter_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/interpreter_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,32 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 #define __ _masm->
 
--- a/src/cpu/x86/vm/javaFrameAnchor_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/javaFrameAnchor_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP
+#define CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP
+
 private:
 
   // FP value associated with _last_Java_sp:
@@ -79,3 +82,5 @@
   intptr_t*   last_Java_fp(void)                     { return _last_Java_fp; }
   // Assert (last_Java_sp == NULL || fp == NULL)
   void set_last_Java_fp(intptr_t* fp)                { _last_Java_fp = fp; }
+
+#endif // CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP
--- a/src/cpu/x86/vm/jniFastGetField_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/jniFastGetField_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jniFastGetField_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
 
 #define __ masm->
 
--- a/src/cpu/x86/vm/jniFastGetField_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/jniFastGetField_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jniFastGetField_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
 
 #define __ masm->
 
--- a/src/cpu/x86/vm/jniTypes_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/jniTypes_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef CPU_X86_VM_JNITYPES_X86_HPP
+#define CPU_X86_VM_JNITYPES_X86_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "prims/jni.h"
+
 // This file holds platform-dependent routines used to write primitive jni
 // types to the array of arguments passed into JavaCalls::call
 
@@ -122,3 +129,5 @@
   static inline jdouble get_double(intptr_t *from) { return *(jdouble *)(from + _JNI_SLOT_OFFSET); }
 #undef _JNI_SLOT_OFFSET
 };
+
+#endif // CPU_X86_VM_JNITYPES_X86_HPP
--- a/src/cpu/x86/vm/jni_x86.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/jni_x86.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/cpu/x86/vm/methodHandles_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/methodHandles.hpp"
 
 #define __ _masm->
 
--- a/src/cpu/x86/vm/nativeInst_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/nativeInst_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_nativeInst_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 void NativeInstruction::wrote(int offset) {
   ICache::invalidate_word(addr_at(offset));
--- a/src/cpu/x86/vm/nativeInst_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/nativeInst_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef CPU_X86_VM_NATIVEINST_X86_HPP
+#define CPU_X86_VM_NATIVEINST_X86_HPP
+
+#include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/os.hpp"
+#include "utilities/top.hpp"
+
 // We have interfaces for the following instructions:
 // - NativeInstruction
 // - - NativeCall
@@ -547,3 +556,5 @@
   return false;
 #endif // AMD64
 }
+
+#endif // CPU_X86_VM_NATIVEINST_X86_HPP
--- a/src/cpu/x86/vm/registerMap_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/registerMap_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_REGISTERMAP_X86_HPP
+#define CPU_X86_VM_REGISTERMAP_X86_HPP
+
 // machine-dependent implemention for register maps
   friend class frame;
 
@@ -37,3 +40,5 @@
   void pd_clear() {}
   void pd_initialize() {}
   void pd_initialize_from(const RegisterMap* map) {}
+
+#endif // CPU_X86_VM_REGISTERMAP_X86_HPP
--- a/src/cpu/x86/vm/register_definitions_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/register_definitions_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_register_definitions_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "asm/register.hpp"
+#include "register_x86.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "interp_masm_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "interp_masm_x86_64.hpp"
+#endif
 
 REGISTER_DEFINITION(Register, noreg);
 REGISTER_DEFINITION(Register, rax);
--- a/src/cpu/x86/vm/register_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/register_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_register_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "register_x86.hpp"
+
 #ifndef AMD64
 const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers;
 #else
--- a/src/cpu/x86/vm/register_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/register_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_REGISTER_X86_HPP
+#define CPU_X86_VM_REGISTER_X86_HPP
+
+#include "asm/register.hpp"
+#include "vm_version_x86.hpp"
+
 class VMRegImpl;
 typedef VMRegImpl* VMReg;
 
@@ -219,3 +225,5 @@
   static const int max_xmm;
 
 };
+
+#endif // CPU_X86_VM_REGISTER_X86_HPP
--- a/src/cpu/x86/vm/relocInfo_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/relocInfo_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_relocInfo_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.inline.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/relocInfo.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
 
 
 void Relocation::pd_set_data_value(address x, intptr_t o) {
--- a/src/cpu/x86/vm/relocInfo_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/relocInfo_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_RELOCINFO_X86_HPP
+#define CPU_X86_VM_RELOCINFO_X86_HPP
+
   // machine-dependent parts of class relocInfo
  private:
   enum {
@@ -36,3 +39,5 @@
     format_width       =  2
 #endif
   };
+
+#endif // CPU_X86_VM_RELOCINFO_X86_HPP
--- a/src/cpu/x86/vm/runtime_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/runtime_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,9 +22,23 @@
  *
  */
 
+#include "precompiled.hpp"
+#ifdef COMPILER2
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/vmreg.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "vmreg_x86.inline.hpp"
+#endif
 
-#include "incls/_precompiled.incl"
-#include "incls/_runtime_x86_32.cpp.incl"
 
 #define __ masm->
 
--- a/src/cpu/x86/vm/runtime_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/runtime_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,23 @@
  *
  */
 
-#include "incls/_precompiled.incl"
+#include "precompiled.hpp"
+#ifdef COMPILER2
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/vmreg.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "vmreg_x86.inline.hpp"
+#endif
+
 
 // This file should really contain the code for generating the OptoRuntime
 // exception_blob. However that code uses SimpleRuntimeFrame which only
--- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,24 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 #define __ masm->
 #ifdef COMPILER2
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,24 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 DeoptimizationBlob *SharedRuntime::_deopt_blob;
 #ifdef COMPILER2
--- a/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,34 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // Declaration and definition of StubGenerator (no .hpp file).
 // For a more detailed description of the stub routine structure
--- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,34 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // Declaration and definition of StubGenerator (no .hpp file).
 // For a more detailed description of the stub routine structure
@@ -2171,9 +2197,6 @@
 
     __ enter(); // required for proper stackwalking of RuntimeStub frame
 
-    checkcast_copy_entry  = __ pc();
-    BLOCK_COMMENT("Entry:");
-
 #ifdef ASSERT
     // caller guarantees that the arrays really are different
     // otherwise, we would have to make conjoint checks
@@ -2184,26 +2207,28 @@
     }
 #endif //ASSERT
 
-    // allocate spill slots for r13, r14
-    enum {
-      saved_r13_offset,
-      saved_r14_offset,
-      saved_rbp_offset,
-      saved_rip_offset,
-      saved_rarg0_offset
-    };
-    __ subptr(rsp, saved_rbp_offset * wordSize);
-    __ movptr(Address(rsp, saved_r13_offset * wordSize), r13);
-    __ movptr(Address(rsp, saved_r14_offset * wordSize), r14);
     setup_arg_regs(4); // from => rdi, to => rsi, length => rdx
                        // ckoff => rcx, ckval => r8
                        // r9 and r10 may be used to save non-volatile registers
 #ifdef _WIN64
     // last argument (#4) is on stack on Win64
-    const int ckval_offset = saved_rarg0_offset + 4;
-    __ movptr(ckval, Address(rsp, ckval_offset * wordSize));
+    __ movptr(ckval, Address(rsp, 6 * wordSize));
 #endif
 
+    // Caller of this entry point must set up the argument registers.
+    checkcast_copy_entry  = __ pc();
+    BLOCK_COMMENT("Entry:");
+
+    // allocate spill slots for r13, r14
+    enum {
+      saved_r13_offset,
+      saved_r14_offset,
+      saved_rbp_offset
+    };
+    __ subptr(rsp, saved_rbp_offset * wordSize);
+    __ movptr(Address(rsp, saved_r13_offset * wordSize), r13);
+    __ movptr(Address(rsp, saved_r14_offset * wordSize), r14);
+
     // check that int operands are properly extended to size_t
     assert_clean_int(length, rax);
     assert_clean_int(ckoff, rax);
@@ -2417,11 +2442,10 @@
     const Register src_pos    = c_rarg1;  // source position
     const Register dst        = c_rarg2;  // destination array oop
     const Register dst_pos    = c_rarg3;  // destination position
-    // elements count is on stack on Win64
-#ifdef _WIN64
-#define C_RARG4 Address(rsp, 6 * wordSize)
+#ifndef _WIN64
+    const Register length     = c_rarg4;
 #else
-#define C_RARG4 c_rarg4
+    const Address  length(rsp, 6 * wordSize);  // elements count is on stack on Win64
 #endif
 
     { int modulus = CodeEntryAlignment;
@@ -2488,27 +2512,27 @@
     // registers used as temp
     const Register r11_length    = r11; // elements count to copy
     const Register r10_src_klass = r10; // array klass
-    const Register r9_dst_klass  = r9;  // dest array klass
 
     //  if (length < 0) return -1;
-    __ movl(r11_length, C_RARG4);       // length (elements count, 32-bits value)
+    __ movl(r11_length, length);        // length (elements count, 32-bits value)
     __ testl(r11_length, r11_length);
     __ jccb(Assembler::negative, L_failed_0);
 
     __ load_klass(r10_src_klass, src);
 #ifdef ASSERT
     //  assert(src->klass() != NULL);
-    BLOCK_COMMENT("assert klasses not null");
-    { Label L1, L2;
+    {
+      BLOCK_COMMENT("assert klasses not null {");
+      Label L1, L2;
       __ testptr(r10_src_klass, r10_src_klass);
       __ jcc(Assembler::notZero, L2);   // it is broken if klass is NULL
       __ bind(L1);
       __ stop("broken null klass");
       __ bind(L2);
-      __ load_klass(r9_dst_klass, dst);
-      __ cmpq(r9_dst_klass, 0);
+      __ load_klass(rax, dst);
+      __ cmpq(rax, 0);
       __ jcc(Assembler::equal, L1);     // this would be broken also
-      BLOCK_COMMENT("assert done");
+      BLOCK_COMMENT("} assert klasses not null done");
     }
 #endif
 
@@ -2520,34 +2544,36 @@
     //   array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0
     //
 
-    int lh_offset = klassOopDesc::header_size() * HeapWordSize +
-                    Klass::layout_helper_offset_in_bytes();
-
-    const Register rax_lh = rax;  // layout helper
-
-    __ movl(rax_lh, Address(r10_src_klass, lh_offset));
+    const int lh_offset = klassOopDesc::header_size() * HeapWordSize +
+                          Klass::layout_helper_offset_in_bytes();
 
     // Handle objArrays completely differently...
-    jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
-    __ cmpl(rax_lh, objArray_lh);
+    const jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
+    __ cmpl(Address(r10_src_klass, lh_offset), objArray_lh);
     __ jcc(Assembler::equal, L_objArray);
 
     //  if (src->klass() != dst->klass()) return -1;
-    __ load_klass(r9_dst_klass, dst);
-    __ cmpq(r10_src_klass, r9_dst_klass);
+    __ load_klass(rax, dst);
+    __ cmpq(r10_src_klass, rax);
     __ jcc(Assembler::notEqual, L_failed);
 
+    const Register rax_lh = rax;  // layout helper
+    __ movl(rax_lh, Address(r10_src_klass, lh_offset));
+
     //  if (!src->is_Array()) return -1;
     __ cmpl(rax_lh, Klass::_lh_neutral_value);
     __ jcc(Assembler::greaterEqual, L_failed);
 
     // At this point, it is known to be a typeArray (array_tag 0x3).
 #ifdef ASSERT
-    { Label L;
+    {
+      BLOCK_COMMENT("assert primitive array {");
+      Label L;
       __ cmpl(rax_lh, (Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift));
       __ jcc(Assembler::greaterEqual, L);
       __ stop("must be a primitive array");
       __ bind(L);
+      BLOCK_COMMENT("} assert primitive array done");
     }
 #endif
 
@@ -2605,11 +2631,14 @@
 
   __ BIND(L_copy_longs);
 #ifdef ASSERT
-    { Label L;
+    {
+      BLOCK_COMMENT("assert long copy {");
+      Label L;
       __ cmpl(rax_elsize, LogBytesPerLong);
       __ jcc(Assembler::equal, L);
       __ stop("must be long copy, but elsize is wrong");
       __ bind(L);
+      BLOCK_COMMENT("} assert long copy done");
     }
 #endif
     __ lea(from, Address(src, src_pos, Address::times_8, 0));// src_addr
@@ -2619,12 +2648,12 @@
 
     // objArrayKlass
   __ BIND(L_objArray);
-    // live at this point:  r10_src_klass, src[_pos], dst[_pos]
+    // live at this point:  r10_src_klass, r11_length, src[_pos], dst[_pos]
 
     Label L_plain_copy, L_checkcast_copy;
     //  test array classes for subtyping
-    __ load_klass(r9_dst_klass, dst);
-    __ cmpq(r10_src_klass, r9_dst_klass); // usual case is exact equality
+    __ load_klass(rax, dst);
+    __ cmpq(r10_src_klass, rax); // usual case is exact equality
     __ jcc(Assembler::notEqual, L_checkcast_copy);
 
     // Identically typed arrays can be copied without element-wise checks.
@@ -2640,41 +2669,33 @@
     __ jump(RuntimeAddress(oop_copy_entry));
 
   __ BIND(L_checkcast_copy);
-    // live at this point:  r10_src_klass, !r11_length
+    // live at this point:  r10_src_klass, r11_length, rax (dst_klass)
     {
-      // assert(r11_length == C_RARG4); // will reload from here
-      Register r11_dst_klass = r11;
-      __ load_klass(r11_dst_klass, dst);
-
       // Before looking at dst.length, make sure dst is also an objArray.
-      __ cmpl(Address(r11_dst_klass, lh_offset), objArray_lh);
+      __ cmpl(Address(rax, lh_offset), objArray_lh);
       __ jcc(Assembler::notEqual, L_failed);
 
       // It is safe to examine both src.length and dst.length.
-#ifndef _WIN64
-      arraycopy_range_checks(src, src_pos, dst, dst_pos, C_RARG4,
-                             rax, L_failed);
-#else
-      __ movl(r11_length, C_RARG4);     // reload
       arraycopy_range_checks(src, src_pos, dst, dst_pos, r11_length,
                              rax, L_failed);
+
+      const Register r11_dst_klass = r11;
       __ load_klass(r11_dst_klass, dst); // reload
-#endif
 
       // Marshal the base address arguments now, freeing registers.
       __ lea(from, Address(src, src_pos, TIMES_OOP,
                    arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
       __ lea(to,   Address(dst, dst_pos, TIMES_OOP,
                    arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
-      __ movl(count, C_RARG4);          // length (reloaded)
+      __ movl(count, length);           // length (reloaded)
       Register sco_temp = c_rarg3;      // this register is free now
       assert_different_registers(from, to, count, sco_temp,
                                  r11_dst_klass, r10_src_klass);
       assert_clean_int(count, sco_temp);
 
       // Generate the type check.
-      int sco_offset = (klassOopDesc::header_size() * HeapWordSize +
-                        Klass::super_check_offset_offset_in_bytes());
+      const int sco_offset = (klassOopDesc::header_size() * HeapWordSize +
+                              Klass::super_check_offset_offset_in_bytes());
       __ movl(sco_temp, Address(r11_dst_klass, sco_offset));
       assert_clean_int(sco_temp, rax);
       generate_type_check(r10_src_klass, sco_temp, r11_dst_klass, L_plain_copy);
@@ -2683,12 +2704,14 @@
       int ek_offset = (klassOopDesc::header_size() * HeapWordSize +
                        objArrayKlass::element_klass_offset_in_bytes());
       __ movptr(r11_dst_klass, Address(r11_dst_klass, ek_offset));
-      __ movl(sco_temp,      Address(r11_dst_klass, sco_offset));
+      __ movl(  sco_temp,      Address(r11_dst_klass, sco_offset));
       assert_clean_int(sco_temp, rax);
 
       // the checkcast_copy loop needs two extra arguments:
       assert(c_rarg3 == sco_temp, "#3 already in place");
-      __ movptr(C_RARG4, r11_dst_klass);  // dst.klass.element_klass
+      // Set up arguments for checkcast_copy_entry.
+      setup_arg_regs(4);
+      __ movptr(r8, r11_dst_klass);  // dst.klass.element_klass, r8 is c_rarg4 on Linux/Solaris
       __ jump(RuntimeAddress(checkcast_copy_entry));
     }
 
@@ -2701,8 +2724,6 @@
     return start;
   }
 
-#undef length_arg
-
   void generate_arraycopy_stubs() {
     // Call the conjoint generation methods immediately after
     // the disjoint ones so that short branches from the former
--- a/src/cpu/x86/vm/stubRoutines_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/stubRoutines_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 // Implementation of the platform-specific part of StubRoutines - for
 // a description of how to extend it, see the stubRoutines.hpp file.
--- a/src/cpu/x86/vm/stubRoutines_x86_32.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/stubRoutines_x86_32.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_STUBROUTINES_X86_32_HPP
+#define CPU_X86_VM_STUBROUTINES_X86_32_HPP
+
 // This file holds the platform specific parts of the StubRoutines
 // definition. See stubRoutines.hpp for a description on how to
 // extend it.
@@ -60,3 +63,5 @@
 
   static bool    returns_to_call_stub(address return_pc)     { return (return_pc == _call_stub_return_address) ||
                                                                        return_pc == x86::get_call_stub_compiled_return(); }
+
+#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP
--- a/src/cpu/x86/vm/stubRoutines_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/stubRoutines_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 // Implementation of the platform-specific part of StubRoutines - for
 // a description of how to extend it, see the stubRoutines.hpp file.
--- a/src/cpu/x86/vm/stubRoutines_x86_64.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/stubRoutines_x86_64.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_STUBROUTINES_X86_64_HPP
+#define CPU_X86_VM_STUBROUTINES_X86_64_HPP
+
 // This file holds the platform specific parts of the StubRoutines
 // definition. See stubRoutines.hpp for a description on how to
 // extend it.
@@ -113,3 +116,5 @@
     return _mxcsr_std;
   }
 };
+
+#endif // CPU_X86_VM_STUBROUTINES_X86_64_HPP
--- a/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP
+#define CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP
+
  protected:
 
  void generate_fixed_frame(bool native_call);
 
  // address generate_asm_interpreter_entry(bool synchronized);
+
+#endif // CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP
--- a/src/cpu/x86/vm/templateInterpreter_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateInterpreter_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP
+#define CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP
+
 
   protected:
 
@@ -35,3 +38,5 @@
 #else
   const static int InterpreterCodeSize = 168 * 1024;
 #endif // AMD64
+
+#endif // CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP
--- a/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,28 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_templateInterpreter_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
 
 #define __ _masm->
 
--- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,28 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
 
 #define __ _masm->
 
@@ -1049,7 +1069,7 @@
     // runtime call by hand.
     //
     __ mov(c_rarg0, r15_thread);
-    __ mov(r12, rsp); // remember sp
+    __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
     __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
     __ andptr(rsp, -16); // align stack as required by ABI
     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans)));
@@ -1096,7 +1116,7 @@
     __ jcc(Assembler::notEqual, no_reguard);
 
     __ pusha(); // XXX only save smashed registers
-    __ mov(r12, rsp); // remember sp
+    __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
     __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
     __ andptr(rsp, -16); // align stack as required by ABI
     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages)));
@@ -1887,7 +1907,7 @@
 
   assert(Interpreter::trace_code(t->tos_in()) != NULL,
          "entry must have been generated");
-  __ mov(r12, rsp); // remember sp
+  __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
   __ andptr(rsp, -16); // align stack as required by ABI
   __ call(RuntimeAddress(Interpreter::trace_code(t->tos_in())));
   __ mov(rsp, r12); // restore sp
--- a/src/cpu/x86/vm/templateTable_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateTable_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_templateTable_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
 
 #ifndef CC_INTERP
 #define __ _masm->
--- a/src/cpu/x86/vm/templateTable_x86_32.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateTable_x86_32.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_TEMPLATETABLE_X86_32_HPP
+#define CPU_X86_VM_TEMPLATETABLE_X86_32_HPP
+
   static void prepare_invoke(Register method, Register index, int byte_no);
   static void invokevirtual_helper(Register index, Register recv,
                                    Register flags);
@@ -30,3 +33,5 @@
   // Helpers
   static void index_check(Register array, Register index);
   static void index_check_without_pop(Register array, Register index);
+
+#endif // CPU_X86_VM_TEMPLATETABLE_X86_32_HPP
--- a/src/cpu/x86/vm/templateTable_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateTable_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_templateTable_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
 
 #ifndef CC_INTERP
 
@@ -2752,7 +2762,7 @@
     // access constant pool cache entry
     __ get_cache_entry_pointer_at_bcp(c_rarg2, rcx, 1);
     __ verify_oop(rax);
-    __ mov(r12, rax);  // save object pointer before call_VM() clobbers it
+    __ push_ptr(rax);  // save object pointer before call_VM() clobbers it
     __ mov(c_rarg1, rax);
     // c_rarg1: object pointer copied above
     // c_rarg2: cache entry pointer
@@ -2760,8 +2770,7 @@
                CAST_FROM_FN_PTR(address,
                                 InterpreterRuntime::post_field_access),
                c_rarg1, c_rarg2);
-    __ mov(rax, r12); // restore object pointer
-    __ reinit_heapbase();
+    __ pop_ptr(rax); // restore object pointer
     __ bind(L1);
   }
 
@@ -3355,10 +3364,7 @@
           JVM_CONSTANT_Class);
   __ jcc(Assembler::equal, quicked);
   __ push(atos); // save receiver for result, and for GC
-  __ mov(r12, rcx); // save rcx XXX
   call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
-  __ movq(rcx, r12); // restore rcx XXX
-  __ reinit_heapbase();
   __ pop_ptr(rdx); // restore receiver
   __ jmpb(resolved);
 
@@ -3412,11 +3418,9 @@
   __ jcc(Assembler::equal, quicked);
 
   __ push(atos); // save receiver for result, and for GC
-  __ mov(r12, rcx); // save rcx
   call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
-  __ movq(rcx, r12); // restore rcx
-  __ reinit_heapbase();
   __ pop_ptr(rdx); // restore receiver
+  __ verify_oop(rdx);
   __ load_klass(rdx, rdx);
   __ jmpb(resolved);
 
--- a/src/cpu/x86/vm/templateTable_x86_64.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/templateTable_x86_64.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_TEMPLATETABLE_X86_64_HPP
+#define CPU_X86_VM_TEMPLATETABLE_X86_64_HPP
+
   static void prepare_invoke(Register method, Register index, int byte_no);
   static void invokevirtual_helper(Register index, Register recv,
                                    Register flags);
@@ -30,3 +33,5 @@
   // Helpers
   static void index_check(Register array, Register index);
   static void index_check_without_pop(Register array, Register index);
+
+#endif // CPU_X86_VM_TEMPLATETABLE_X86_64_HPP
--- a/src/cpu/x86/vm/vmStructs_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vmStructs_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_VMSTRUCTS_X86_HPP
+#define CPU_X86_VM_VMSTRUCTS_X86_HPP
+
 // These are the CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -60,3 +63,5 @@
   /* NOTE that we do not use the last_entry() macro here; it is used         */
   /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must  */
   /* be present there)                                                       */
+
+#endif // CPU_X86_VM_VMSTRUCTS_X86_HPP
--- a/src/cpu/x86/vm/vm_version_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vm_version_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/java.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "vm_version_x86.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 
 int VM_Version::_cpu;
--- a/src/cpu/x86/vm/vm_version_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vm_version_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef CPU_X86_VM_VM_VERSION_X86_HPP
+#define CPU_X86_VM_VM_VERSION_X86_HPP
+
+#include "runtime/globals_extension.hpp"
+#include "runtime/vm_version.hpp"
+
 class VM_Version : public Abstract_VM_Version {
 public:
   // cpuid result register layouts.  These are all unions of a uint32_t
@@ -520,3 +526,5 @@
     return count >= 0 ? count : 1;
   }
 };
+
+#endif // CPU_X86_VM_VM_VERSION_X86_HPP
--- a/src/cpu/x86/vm/vmreg_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vmreg_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vmreg_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
 
 
 
--- a/src/cpu/x86/vm/vmreg_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vmreg_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_VMREG_X86_HPP
+#define CPU_X86_VM_VMREG_X86_HPP
+
   bool is_Register();
   Register as_Register();
 
@@ -30,3 +33,5 @@
 
   bool is_XMMRegister();
   XMMRegister as_XMMRegister();
+
+#endif // CPU_X86_VM_VMREG_X86_HPP
--- a/src/cpu/x86/vm/vmreg_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vmreg_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_X86_VM_VMREG_X86_INLINE_HPP
+#define CPU_X86_VM_VMREG_X86_INLINE_HPP
+
 inline VMReg RegisterImpl::as_VMReg() {
   if( this==noreg ) return VMRegImpl::Bad();
 #ifdef AMD64
@@ -82,3 +85,5 @@
 #endif // AMD64
   return is_even(value());
 }
+
+#endif // CPU_X86_VM_VMREG_X86_INLINE_HPP
--- a/src/cpu/x86/vm/vtableStubs_x86_32.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vtableStubs_x86_32.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_x86_32.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // machine-dependent part of VtableStubs: create VtableStub of correct size and
 // initialize its code
--- a/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_x86_64.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // machine-dependent part of VtableStubs: create VtableStub of correct size and
 // initialize its code
--- a/src/cpu/x86/vm/x86_32.ad	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/x86_32.ad	Fri Jan 07 18:18:08 2011 +0100
@@ -507,6 +507,25 @@
 
 
 //=============================================================================
+const bool Matcher::constant_table_absolute_addressing = true;
+const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
+
+void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
+  // Empty encoding
+}
+
+uint MachConstantBaseNode::size(PhaseRegAlloc* ra_) const {
+  return 0;
+}
+
+#ifndef PRODUCT
+void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
+  st->print("# MachConstantBaseNode (empty encoding)");
+}
+#endif
+
+
+//=============================================================================
 #ifndef PRODUCT
 void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
   Compile* C = ra_->C;
@@ -1320,29 +1339,6 @@
 }
 
 
-static void emit_double_constant(CodeBuffer& cbuf, double x) {
-  int mark = cbuf.insts()->mark_off();
-  MacroAssembler _masm(&cbuf);
-  address double_address = __ double_constant(x);
-  cbuf.insts()->set_mark_off(mark);  // preserve mark across masm shift
-  emit_d32_reloc(cbuf,
-                 (int)double_address,
-                 internal_word_Relocation::spec(double_address),
-                 RELOC_DISP32);
-}
-
-static void emit_float_constant(CodeBuffer& cbuf, float x) {
-  int mark = cbuf.insts()->mark_off();
-  MacroAssembler _masm(&cbuf);
-  address float_address = __ float_constant(x);
-  cbuf.insts()->set_mark_off(mark);  // preserve mark across masm shift
-  emit_d32_reloc(cbuf,
-                 (int)float_address,
-                 internal_word_Relocation::spec(float_address),
-                 RELOC_DISP32);
-}
-
-
 const bool Matcher::match_rule_supported(int opcode) {
   if (!has_match_rule(opcode))
     return false;
@@ -1354,22 +1350,6 @@
   return regnum - 32; // The FP registers are in the second chunk
 }
 
-bool is_positive_zero_float(jfloat f) {
-  return jint_cast(f) == jint_cast(0.0F);
-}
-
-bool is_positive_one_float(jfloat f) {
-  return jint_cast(f) == jint_cast(1.0F);
-}
-
-bool is_positive_zero_double(jdouble d) {
-  return jlong_cast(d) == jlong_cast(0.0);
-}
-
-bool is_positive_one_double(jdouble d) {
-  return jlong_cast(d) == jlong_cast(1.0);
-}
-
 // This is UltraSparc specific, true just means we have fast l2f conversion
 const bool Matcher::convL2FSupported(void) {
   return true;
@@ -2036,67 +2016,6 @@
   %}
 
 
-  enc_class LdImmD (immD src) %{    // Load Immediate
-    if( is_positive_zero_double($src$$constant)) {
-      // FLDZ
-      emit_opcode(cbuf,0xD9);
-      emit_opcode(cbuf,0xEE);
-    } else if( is_positive_one_double($src$$constant)) {
-      // FLD1
-      emit_opcode(cbuf,0xD9);
-      emit_opcode(cbuf,0xE8);
-    } else {
-      emit_opcode(cbuf,0xDD);
-      emit_rm(cbuf, 0x0, 0x0, 0x5);
-      emit_double_constant(cbuf, $src$$constant);
-    }
-  %}
-
-
-  enc_class LdImmF (immF src) %{    // Load Immediate
-    if( is_positive_zero_float($src$$constant)) {
-      emit_opcode(cbuf,0xD9);
-      emit_opcode(cbuf,0xEE);
-    } else if( is_positive_one_float($src$$constant)) {
-      emit_opcode(cbuf,0xD9);
-      emit_opcode(cbuf,0xE8);
-    } else {
-      $$$emit8$primary;
-      // Load immediate does not have a zero or sign extended version
-      // for 8-bit immediates
-      // First load to TOS, then move to dst
-      emit_rm(cbuf, 0x0, 0x0, 0x5);
-      emit_float_constant(cbuf, $src$$constant);
-    }
-  %}
-
-  enc_class LdImmX (regX dst, immXF con) %{    // Load Immediate
-    emit_rm(cbuf, 0x0, $dst$$reg, 0x5);
-    emit_float_constant(cbuf, $con$$constant);
-  %}
-
-  enc_class LdImmXD (regXD dst, immXD con) %{    // Load Immediate
-    emit_rm(cbuf, 0x0, $dst$$reg, 0x5);
-    emit_double_constant(cbuf, $con$$constant);
-  %}
-
-  enc_class load_conXD (regXD dst, immXD con) %{ // Load double constant
-    // UseXmmLoadAndClearUpper ? movsd(dst, con) : movlpd(dst, con)
-    emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0xF2 : 0x66);
-    emit_opcode(cbuf, 0x0F);
-    emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0x10 : 0x12);
-    emit_rm(cbuf, 0x0, $dst$$reg, 0x5);
-    emit_double_constant(cbuf, $con$$constant);
-  %}
-
-  enc_class Opc_MemImm_F(immF src) %{
-    cbuf.set_insts_mark();
-    $$$emit8$primary;
-    emit_rm(cbuf, 0x0, $secondary, 0x5);
-    emit_float_constant(cbuf, $src$$constant);
-  %}
-
-
   enc_class MovI2X_reg(regX dst, eRegI src) %{
     emit_opcode(cbuf, 0x66 );     // MOVD dst,src
     emit_opcode(cbuf, 0x0F );
@@ -4801,7 +4720,7 @@
   interface(CONST_INTER);
 %}
 
-// Double Immediate
+// Double Immediate one
 operand immD1() %{
   predicate( UseSSE<=1 && n->getd() == 1.0 );
   match(ConD);
@@ -4844,7 +4763,17 @@
 
 // Float Immediate zero
 operand immF0() %{
-  predicate( UseSSE == 0 && n->getf() == 0.0 );
+  predicate(UseSSE == 0 && n->getf() == 0.0F);
+  match(ConF);
+
+  op_cost(5);
+  format %{ %}
+  interface(CONST_INTER);
+%}
+
+// Float Immediate one
+operand immF1() %{
+  predicate(UseSSE == 0 && n->getf() == 1.0F);
   match(ConF);
 
   op_cost(5);
@@ -7215,24 +7144,53 @@
 %}
 
 // The instruction usage is guarded by predicate in operand immF().
-instruct loadConF(regF dst, immF src) %{
-  match(Set dst src);
+instruct loadConF(regF dst, immF con) %{
+  match(Set dst con);
+  ins_cost(125);
+  format %{ "FLD_S  ST,[$constantaddress]\t# load from constant table: float=$con\n\t"
+            "FSTP   $dst" %}
+  ins_encode %{
+    __ fld_s($constantaddress($con));
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immF0().
+instruct loadConF0(regF dst, immF0 con) %{
+  match(Set dst con);
   ins_cost(125);
-
-  format %{ "FLD_S  ST,$src\n\t"
+  format %{ "FLDZ   ST\n\t"
             "FSTP   $dst" %}
-  opcode(0xD9, 0x00);       /* D9 /0 */
-  ins_encode(LdImmF(src), Pop_Reg_F(dst) );
-  ins_pipe( fpu_reg_con );
+  ins_encode %{
+    __ fldz();
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immF1().
+instruct loadConF1(regF dst, immF1 con) %{
+  match(Set dst con);
+  ins_cost(125);
+  format %{ "FLD1   ST\n\t"
+            "FSTP   $dst" %}
+  ins_encode %{
+    __ fld1();
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_con);
 %}
 
 // The instruction usage is guarded by predicate in operand immXF().
 instruct loadConX(regX dst, immXF con) %{
   match(Set dst con);
   ins_cost(125);
-  format %{ "MOVSS  $dst,[$con]" %}
-  ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x10), LdImmX(dst, con));
-  ins_pipe( pipe_slow );
+  format %{ "MOVSS  $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+  ins_encode %{
+    __ movflt($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 // The instruction usage is guarded by predicate in operand immXF0().
@@ -7240,28 +7198,63 @@
   match(Set dst src);
   ins_cost(100);
   format %{ "XORPS  $dst,$dst\t# float 0.0" %}
-  ins_encode( Opcode(0x0F), Opcode(0x57), RegReg(dst,dst));
-  ins_pipe( pipe_slow );
+  ins_encode %{
+    __ xorps($dst$$XMMRegister, $dst$$XMMRegister);
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 // The instruction usage is guarded by predicate in operand immD().
-instruct loadConD(regD dst, immD src) %{
-  match(Set dst src);
+instruct loadConD(regD dst, immD con) %{
+  match(Set dst con);
+  ins_cost(125);
+
+  format %{ "FLD_D  ST,[$constantaddress]\t# load from constant table: double=$con\n\t"
+            "FSTP   $dst" %}
+  ins_encode %{
+    __ fld_d($constantaddress($con));
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immD0().
+instruct loadConD0(regD dst, immD0 con) %{
+  match(Set dst con);
   ins_cost(125);
 
-  format %{ "FLD_D  ST,$src\n\t"
+  format %{ "FLDZ   ST\n\t"
             "FSTP   $dst" %}
-  ins_encode(LdImmD(src), Pop_Reg_D(dst) );
-  ins_pipe( fpu_reg_con );
+  ins_encode %{
+    __ fldz();
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immD1().
+instruct loadConD1(regD dst, immD1 con) %{
+  match(Set dst con);
+  ins_cost(125);
+
+  format %{ "FLD1   ST\n\t"
+            "FSTP   $dst" %}
+  ins_encode %{
+    __ fld1();
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_con);
 %}
 
 // The instruction usage is guarded by predicate in operand immXD().
 instruct loadConXD(regXD dst, immXD con) %{
   match(Set dst con);
   ins_cost(125);
-  format %{ "MOVSD  $dst,[$con]" %}
-  ins_encode(load_conXD(dst, con));
-  ins_pipe( pipe_slow );
+  format %{ "MOVSD  $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+  ins_encode %{
+    __ movdbl($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 // The instruction usage is guarded by predicate in operand immXD0().
@@ -10303,41 +10296,45 @@
   ins_pipe( fpu_reg_mem );
 %}
 
-instruct addD_reg_imm1(regD dst, immD1 src) %{
+instruct addD_reg_imm1(regD dst, immD1 con) %{
   predicate(UseSSE<=1);
-  match(Set dst (AddD dst src));
+  match(Set dst (AddD dst con));
   ins_cost(125);
   format %{ "FLD1\n\t"
             "DADDp  $dst,ST" %}
-  opcode(0xDE, 0x00);
-  ins_encode( LdImmD(src),
-              OpcP, RegOpc(dst) );
-  ins_pipe( fpu_reg );
-%}
-
-instruct addD_reg_imm(regD dst, immD src) %{
+  ins_encode %{
+    __ fld1();
+    __ faddp($dst$$reg);
+  %}
+  ins_pipe(fpu_reg);
+%}
+
+instruct addD_reg_imm(regD dst, immD con) %{
   predicate(UseSSE<=1 && _kids[1]->_leaf->getd() != 0.0 && _kids[1]->_leaf->getd() != 1.0 );
-  match(Set dst (AddD dst src));
+  match(Set dst (AddD dst con));
   ins_cost(200);
-  format %{ "FLD_D  [$src]\n\t"
+  format %{ "FLD_D  [$constantaddress]\t# load from constant table: double=$con\n\t"
             "DADDp  $dst,ST" %}
-  opcode(0xDE, 0x00);       /* DE /0 */
-  ins_encode( LdImmD(src),
-              OpcP, RegOpc(dst));
-  ins_pipe( fpu_reg_mem );
+  ins_encode %{
+    __ fld_d($constantaddress($con));
+    __ faddp($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_mem);
 %}
 
 instruct addD_reg_imm_round(stackSlotD dst, regD src, immD con) %{
   predicate(UseSSE<=1 && _kids[0]->_kids[1]->_leaf->getd() != 0.0 && _kids[0]->_kids[1]->_leaf->getd() != 1.0 );
   match(Set dst (RoundDouble (AddD src con)));
   ins_cost(200);
-  format %{ "FLD_D  [$con]\n\t"
+  format %{ "FLD_D  [$constantaddress]\t# load from constant table: double=$con\n\t"
             "DADD   ST,$src\n\t"
             "FSTP_D $dst\t# D-round" %}
-  opcode(0xD8, 0x00);       /* D8 /0 */
-  ins_encode( LdImmD(con),
-              OpcP, RegOpc(src), Pop_Mem_D(dst));
-  ins_pipe( fpu_mem_reg_con );
+  ins_encode %{
+    __ fld_d($constantaddress($con));
+    __ fadd($src$$reg);
+    __ fstp_d(Address(rsp, $dst$$disp));
+  %}
+  ins_pipe(fpu_mem_reg_con);
 %}
 
 // Add two double precision floating point values in xmm
@@ -10352,9 +10349,11 @@
 instruct addXD_imm(regXD dst, immXD con) %{
   predicate(UseSSE>=2);
   match(Set dst (AddD dst con));
-  format %{ "ADDSD  $dst,[$con]" %}
-  ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x58), LdImmXD(dst, con) );
-  ins_pipe( pipe_slow );
+  format %{ "ADDSD  $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+  ins_encode %{
+    __ addsd($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct addXD_mem(regXD dst, memory mem) %{
@@ -10377,9 +10376,11 @@
 instruct subXD_imm(regXD dst, immXD con) %{
   predicate(UseSSE>=2);
   match(Set dst (SubD dst con));
-  format %{ "SUBSD  $dst,[$con]" %}
-  ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x5C), LdImmXD(dst, con) );
-  ins_pipe( pipe_slow );
+  format %{ "SUBSD  $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+  ins_encode %{
+    __ subsd($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct subXD_mem(regXD dst, memory mem) %{
@@ -10402,9 +10403,11 @@
 instruct mulXD_imm(regXD dst, immXD con) %{
   predicate(UseSSE>=2);
   match(Set dst (MulD dst con));
-  format %{ "MULSD  $dst,[$con]" %}
-  ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x59), LdImmXD(dst, con) );
-  ins_pipe( pipe_slow );
+  format %{ "MULSD  $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+  ins_encode %{
+    __ mulsd($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct mulXD_mem(regXD dst, memory mem) %{
@@ -10428,9 +10431,11 @@
 instruct divXD_imm(regXD dst, immXD con) %{
   predicate(UseSSE>=2);
   match(Set dst (DivD dst con));
-  format %{ "DIVSD  $dst,[$con]" %}
-  ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x5E), LdImmXD(dst, con));
-  ins_pipe( pipe_slow );
+  format %{ "DIVSD  $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+  ins_encode %{
+    __ divsd($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct divXD_mem(regXD dst, memory mem) %{
@@ -10481,16 +10486,17 @@
   ins_pipe( fpu_reg_reg );
 %}
 
-instruct mulD_reg_imm(regD dst, immD src) %{
+instruct mulD_reg_imm(regD dst, immD con) %{
   predicate( UseSSE<=1 && _kids[1]->_leaf->getd() != 0.0 && _kids[1]->_leaf->getd() != 1.0 );
-  match(Set dst (MulD dst src));
+  match(Set dst (MulD dst con));
   ins_cost(200);
-  format %{ "FLD_D  [$src]\n\t"
+  format %{ "FLD_D  [$constantaddress]\t# load from constant table: double=$con\n\t"
             "DMULp  $dst,ST" %}
-  opcode(0xDE, 0x1); /* DE /1 */
-  ins_encode( LdImmD(src),
-              OpcP, RegOpc(dst) );
-  ins_pipe( fpu_reg_mem );
+  ins_encode %{
+    __ fld_d($constantaddress($con));
+    __ fmulp($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_mem);
 %}
 
 
@@ -11224,9 +11230,11 @@
 instruct addX_imm(regX dst, immXF con) %{
   predicate(UseSSE>=1);
   match(Set dst (AddF dst con));
-  format %{ "ADDSS  $dst,[$con]" %}
-  ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x58), LdImmX(dst, con) );
-  ins_pipe( pipe_slow );
+  format %{ "ADDSS  $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+  ins_encode %{
+    __ addss($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct addX_mem(regX dst, memory mem) %{
@@ -11249,9 +11257,11 @@
 instruct subX_imm(regX dst, immXF con) %{
   predicate(UseSSE>=1);
   match(Set dst (SubF dst con));
-  format %{ "SUBSS  $dst,[$con]" %}
-  ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x5C), LdImmX(dst, con) );
-  ins_pipe( pipe_slow );
+  format %{ "SUBSS  $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+  ins_encode %{
+    __ subss($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct subX_mem(regX dst, memory mem) %{
@@ -11274,9 +11284,11 @@
 instruct mulX_imm(regX dst, immXF con) %{
   predicate(UseSSE>=1);
   match(Set dst (MulF dst con));
-  format %{ "MULSS  $dst,[$con]" %}
-  ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x59), LdImmX(dst, con) );
-  ins_pipe( pipe_slow );
+  format %{ "MULSS  $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+  ins_encode %{
+    __ mulss($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct mulX_mem(regX dst, memory mem) %{
@@ -11299,9 +11311,11 @@
 instruct divX_imm(regX dst, immXF con) %{
   predicate(UseSSE>=1);
   match(Set dst (DivF dst con));
-  format %{ "DIVSS  $dst,[$con]" %}
-  ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x5E), LdImmX(dst, con) );
-  ins_pipe( pipe_slow );
+  format %{ "DIVSS  $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+  ins_encode %{
+    __ divss($dst$$XMMRegister, $constantaddress($con));
+  %}
+  ins_pipe(pipe_slow);
 %}
 
 instruct divX_mem(regX dst, memory mem) %{
@@ -11456,31 +11470,33 @@
 
 
 // Spill to obtain 24-bit precision
-instruct addF24_reg_imm(stackSlotF dst, regF src1, immF src2) %{
+instruct addF24_reg_imm(stackSlotF dst, regF src, immF con) %{
   predicate(UseSSE==0 && Compile::current()->select_24_bit_instr());
-  match(Set dst (AddF src1 src2));
-  format %{ "FLD    $src1\n\t"
-            "FADD   $src2\n\t"
+  match(Set dst (AddF src con));
+  format %{ "FLD    $src\n\t"
+            "FADD_S [$constantaddress]\t# load from constant table: float=$con\n\t"
             "FSTP_S $dst"  %}
-  opcode(0xD8, 0x00);       /* D8 /0 */
-  ins_encode( Push_Reg_F(src1),
-              Opc_MemImm_F(src2),
-              Pop_Mem_F(dst));
-  ins_pipe( fpu_mem_reg_con );
+  ins_encode %{
+    __ fld_s($src$$reg - 1);  // FLD ST(i-1)
+    __ fadd_s($constantaddress($con));
+    __ fstp_s(Address(rsp, $dst$$disp));
+  %}
+  ins_pipe(fpu_mem_reg_con);
 %}
 //
 // This instruction does not round to 24-bits
-instruct addF_reg_imm(regF dst, regF src1, immF src2) %{
+instruct addF_reg_imm(regF dst, regF src, immF con) %{
   predicate(UseSSE==0 && !Compile::current()->select_24_bit_instr());
-  match(Set dst (AddF src1 src2));
-  format %{ "FLD    $src1\n\t"
-            "FADD   $src2\n\t"
-            "FSTP_S $dst"  %}
-  opcode(0xD8, 0x00);       /* D8 /0 */
-  ins_encode( Push_Reg_F(src1),
-              Opc_MemImm_F(src2),
-              Pop_Reg_F(dst));
-  ins_pipe( fpu_reg_reg_con );
+  match(Set dst (AddF src con));
+  format %{ "FLD    $src\n\t"
+            "FADD_S [$constantaddress]\t# load from constant table: float=$con\n\t"
+            "FSTP   $dst"  %}
+  ins_encode %{
+    __ fld_s($src$$reg - 1);  // FLD ST(i-1)
+    __ fadd_s($constantaddress($con));
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_reg_con);
 %}
 
 // Spill to obtain 24-bit precision
@@ -11559,29 +11575,35 @@
 %}
 
 // Spill to obtain 24-bit precision
-instruct mulF24_reg_imm(stackSlotF dst, regF src1, immF src2) %{
+instruct mulF24_reg_imm(stackSlotF dst, regF src, immF con) %{
   predicate(UseSSE==0 && Compile::current()->select_24_bit_instr());
-  match(Set dst (MulF src1 src2));
-
-  format %{ "FMULc $dst,$src1,$src2" %}
-  opcode(0xD8, 0x1);  /* D8 /1*/
-  ins_encode( Push_Reg_F(src1),
-              Opc_MemImm_F(src2),
-              Pop_Mem_F(dst));
-  ins_pipe( fpu_mem_reg_con );
+  match(Set dst (MulF src con));
+
+  format %{ "FLD    $src\n\t"
+            "FMUL_S [$constantaddress]\t# load from constant table: float=$con\n\t"
+            "FSTP_S $dst"  %}
+  ins_encode %{
+    __ fld_s($src$$reg - 1);  // FLD ST(i-1)
+    __ fmul_s($constantaddress($con));
+    __ fstp_s(Address(rsp, $dst$$disp));
+  %}
+  ins_pipe(fpu_mem_reg_con);
 %}
 //
 // This instruction does not round to 24-bits
-instruct mulF_reg_imm(regF dst, regF src1, immF src2) %{
+instruct mulF_reg_imm(regF dst, regF src, immF con) %{
   predicate(UseSSE==0 && !Compile::current()->select_24_bit_instr());
-  match(Set dst (MulF src1 src2));
-
-  format %{ "FMULc $dst. $src1, $src2" %}
-  opcode(0xD8, 0x1);  /* D8 /1*/
-  ins_encode( Push_Reg_F(src1),
-              Opc_MemImm_F(src2),
-              Pop_Reg_F(dst));
-  ins_pipe( fpu_reg_reg_con );
+  match(Set dst (MulF src con));
+
+  format %{ "FLD    $src\n\t"
+            "FMUL_S [$constantaddress]\t# load from constant table: float=$con\n\t"
+            "FSTP   $dst"  %}
+  ins_encode %{
+    __ fld_s($src$$reg - 1);  // FLD ST(i-1)
+    __ fmul_s($constantaddress($con));
+    __ fstp_d($dst$$reg);
+  %}
+  ins_pipe(fpu_reg_reg_con);
 %}
 
 
@@ -12939,16 +12961,11 @@
 instruct jumpXtnd(eRegI switch_val) %{
   match(Jump switch_val);
   ins_cost(350);
-
-  format %{  "JMP    [table_base](,$switch_val,1)\n\t" %}
-
-  ins_encode %{
-    address table_base  = __ address_table_constant(_index2label);
-
+  format %{  "JMP    [$constantaddress](,$switch_val,1)\n\t" %}
+  ins_encode %{
     // Jump to Address(table_base + switch_reg)
-    InternalAddress table(table_base);
     Address index(noreg, $switch_val$$Register, Address::times_1);
-    __ jump(ArrayAddress(table, index));
+    __ jump(ArrayAddress($constantaddress, index));
   %}
   ins_pc_relative(1);
   ins_pipe(pipe_jmp);
--- a/src/cpu/x86/vm/x86_64.ad	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/x86/vm/x86_64.ad	Fri Jan 07 18:18:08 2011 +0100
@@ -833,6 +833,25 @@
 
 
 //=============================================================================
+const bool Matcher::constant_table_absolute_addressing = true;
+const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
+
+void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
+  // Empty encoding
+}
+
+uint MachConstantBaseNode::size(PhaseRegAlloc* ra_) const {
+  return 0;
+}
+
+#ifndef PRODUCT
+void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
+  st->print("# MachConstantBaseNode (empty encoding)");
+}
+#endif
+
+
+//=============================================================================
 #ifndef PRODUCT
 void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const
 {
@@ -1922,28 +1941,6 @@
   return offset;
 }
 
-static void emit_double_constant(CodeBuffer& cbuf, double x) {
-  int mark = cbuf.insts()->mark_off();
-  MacroAssembler _masm(&cbuf);
-  address double_address = __ double_constant(x);
-  cbuf.insts()->set_mark_off(mark);  // preserve mark across masm shift
-  emit_d32_reloc(cbuf,
-                 (int) (double_address - cbuf.insts_end() - 4),
-                 internal_word_Relocation::spec(double_address),
-                 RELOC_DISP32);
-}
-
-static void emit_float_constant(CodeBuffer& cbuf, float x) {
-  int mark = cbuf.insts()->mark_off();
-  MacroAssembler _masm(&cbuf);
-  address float_address = __ float_constant(x);
-  cbuf.insts()->set_mark_off(mark);  // preserve mark across masm shift
-  emit_d32_reloc(cbuf,
-                 (int) (float_address - cbuf.insts_end() - 4),
-                 internal_word_Relocation::spec(float_address),
-                 RELOC_DISP32);
-}
-
 
 const bool Matcher::match_rule_supported(int opcode) {
   if (!has_match_rule(opcode))
@@ -2789,43 +2786,6 @@
     }
   %}
 
-  enc_class load_immF(regF dst, immF con)
-  %{
-    // XXX reg_mem doesn't support RIP-relative addressing yet
-    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
-    emit_float_constant(cbuf, $con$$constant);
-  %}
-
-  enc_class load_immD(regD dst, immD con)
-  %{
-    // XXX reg_mem doesn't support RIP-relative addressing yet
-    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
-    emit_double_constant(cbuf, $con$$constant);
-  %}
-
-  enc_class load_conF (regF dst, immF con) %{    // Load float constant
-    emit_opcode(cbuf, 0xF3);
-    if ($dst$$reg >= 8) {
-      emit_opcode(cbuf, Assembler::REX_R);
-    }
-    emit_opcode(cbuf, 0x0F);
-    emit_opcode(cbuf, 0x10);
-    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
-    emit_float_constant(cbuf, $con$$constant);
-  %}
-
-  enc_class load_conD (regD dst, immD con) %{    // Load double constant
-    // UseXmmLoadAndClearUpper ? movsd(dst, con) : movlpd(dst, con)
-    emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0xF2 : 0x66);
-    if ($dst$$reg >= 8) {
-      emit_opcode(cbuf, Assembler::REX_R);
-    }
-    emit_opcode(cbuf, 0x0F);
-    emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0x10 : 0x12);
-    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
-    emit_double_constant(cbuf, $con$$constant);
-  %}
-
   // Encode a reg-reg copy.  If it is useless, then empty encoding.
   enc_class enc_copy(rRegI dst, rRegI src)
   %{
@@ -2926,63 +2886,6 @@
     emit_d32(cbuf, 0x00);
   %}
 
-  enc_class jump_enc(rRegL switch_val, rRegI dest) %{
-    MacroAssembler masm(&cbuf);
-
-    Register switch_reg = as_Register($switch_val$$reg);
-    Register dest_reg   = as_Register($dest$$reg);
-    address table_base  = masm.address_table_constant(_index2label);
-
-    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
-    // to do that and the compiler is using that register as one it can allocate.
-    // So we build it all by hand.
-    // Address index(noreg, switch_reg, Address::times_1);
-    // ArrayAddress dispatch(table, index);
-
-    Address dispatch(dest_reg, switch_reg, Address::times_1);
-
-    masm.lea(dest_reg, InternalAddress(table_base));
-    masm.jmp(dispatch);
-  %}
-
-  enc_class jump_enc_addr(rRegL switch_val, immI2 shift, immL32 offset, rRegI dest) %{
-    MacroAssembler masm(&cbuf);
-
-    Register switch_reg = as_Register($switch_val$$reg);
-    Register dest_reg   = as_Register($dest$$reg);
-    address table_base  = masm.address_table_constant(_index2label);
-
-    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
-    // to do that and the compiler is using that register as one it can allocate.
-    // So we build it all by hand.
-    // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant);
-    // ArrayAddress dispatch(table, index);
-
-    Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant);
-
-    masm.lea(dest_reg, InternalAddress(table_base));
-    masm.jmp(dispatch);
-  %}
-
-  enc_class jump_enc_offset(rRegL switch_val, immI2 shift, rRegI dest) %{
-    MacroAssembler masm(&cbuf);
-
-    Register switch_reg = as_Register($switch_val$$reg);
-    Register dest_reg   = as_Register($dest$$reg);
-    address table_base  = masm.address_table_constant(_index2label);
-
-    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
-    // to do that and the compiler is using that register as one it can allocate.
-    // So we build it all by hand.
-    // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant);
-    // ArrayAddress dispatch(table, index);
-
-    Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant);
-    masm.lea(dest_reg, InternalAddress(table_base));
-    masm.jmp(dispatch);
-
-  %}
-
   enc_class lock_prefix()
   %{
     if (os::is_MP()) {
@@ -6641,12 +6544,11 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct loadConP(rRegP dst, immP src)
-%{
-  match(Set dst src);
-
-  format %{ "movq    $dst, $src\t# ptr" %}
-  ins_encode(load_immP(dst, src));
+instruct loadConP(rRegP dst, immP con) %{
+  match(Set dst con);
+
+  format %{ "movq    $dst, $con\t# ptr" %}
+  ins_encode(load_immP(dst, con));
   ins_pipe(ialu_reg_fat); // XXX
 %}
 
@@ -6673,13 +6575,13 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct loadConF(regF dst, immF src)
-%{
-  match(Set dst src);
+instruct loadConF(regF dst, immF con) %{
+  match(Set dst con);
   ins_cost(125);
-
-  format %{ "movss   $dst, [$src]" %}
-  ins_encode(load_conF(dst, src));
+  format %{ "movss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
+  ins_encode %{
+    __ movflt($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -6721,13 +6623,13 @@
 %}
 
 // Use the same format since predicate() can not be used here.
-instruct loadConD(regD dst, immD src)
-%{
-  match(Set dst src);
+instruct loadConD(regD dst, immD con) %{
+  match(Set dst con);
   ins_cost(125);
-
-  format %{ "movsd   $dst, [$src]" %}
-  ins_encode(load_conD(dst, src));
+  format %{ "movsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
+  ins_encode %{
+    __ movdbl($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -7694,9 +7596,18 @@
   predicate(false);
   effect(TEMP dest);
 
-  format %{ "leaq    $dest, table_base\n\t"
+  format %{ "leaq    $dest, [$constantaddress]\n\t"
             "jmp     [$dest + $switch_val << $shift]\n\t" %}
-  ins_encode(jump_enc_offset(switch_val, shift, dest));
+  ins_encode %{
+    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
+    // to do that and the compiler is using that register as one it can allocate.
+    // So we build it all by hand.
+    // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant);
+    // ArrayAddress dispatch(table, index);
+    Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant);
+    __ lea($dest$$Register, $constantaddress);
+    __ jmp(dispatch);
+  %}
   ins_pipe(pipe_jmp);
   ins_pc_relative(1);
 %}
@@ -7706,9 +7617,18 @@
   ins_cost(350);
   effect(TEMP dest);
 
-  format %{ "leaq    $dest, table_base\n\t"
+  format %{ "leaq    $dest, [$constantaddress]\n\t"
             "jmp     [$dest + $switch_val << $shift + $offset]\n\t" %}
-  ins_encode(jump_enc_addr(switch_val, shift, offset, dest));
+  ins_encode %{
+    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
+    // to do that and the compiler is using that register as one it can allocate.
+    // So we build it all by hand.
+    // Address index(noreg, switch_reg, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant);
+    // ArrayAddress dispatch(table, index);
+    Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant);
+    __ lea($dest$$Register, $constantaddress);
+    __ jmp(dispatch);
+  %}
   ins_pipe(pipe_jmp);
   ins_pc_relative(1);
 %}
@@ -7718,9 +7638,18 @@
   ins_cost(350);
   effect(TEMP dest);
 
-  format %{ "leaq    $dest, table_base\n\t"
+  format %{ "leaq    $dest, [$constantaddress]\n\t"
             "jmp     [$dest + $switch_val]\n\t" %}
-  ins_encode(jump_enc(switch_val, dest));
+  ins_encode %{
+    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
+    // to do that and the compiler is using that register as one it can allocate.
+    // So we build it all by hand.
+    // Address index(noreg, switch_reg, Address::times_1);
+    // ArrayAddress dispatch(table, index);
+    Address dispatch($dest$$Register, $switch_val$$Register, Address::times_1);
+    __ lea($dest$$Register, $constantaddress);
+    __ jmp(dispatch);
+  %}
   ins_pipe(pipe_jmp);
   ins_pc_relative(1);
 %}
@@ -10376,30 +10305,36 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct cmpF_cc_imm(rFlagsRegU cr, regF src1, immF src2)
-%{
-  match(Set cr (CmpF src1 src2));
+instruct cmpF_cc_imm(rFlagsRegU cr, regF src, immF con) %{
+  match(Set cr (CmpF src con));
 
   ins_cost(145);
-  format %{ "ucomiss $src1, $src2\n\t"
+  format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t"
             "jnp,s   exit\n\t"
             "pushfq\t# saw NaN, set CF\n\t"
             "andq    [rsp], #0xffffff2b\n\t"
             "popfq\n"
     "exit:   nop\t# avoid branch to branch" %}
-  opcode(0x0F, 0x2E);
-  ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2),
-             cmpfp_fixup);
-  ins_pipe(pipe_slow);
-%}
-
-instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src1, immF src2) %{
-  match(Set cr (CmpF src1 src2));
-
+  ins_encode %{
+    Label L_exit;
+    __ ucomiss($src$$XMMRegister, $constantaddress($con));
+    __ jcc(Assembler::noParity, L_exit);
+    __ pushf();
+    __ andq(rsp, 0xffffff2b);
+    __ popf();
+    __ bind(L_exit);
+    __ nop();
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src, immF con) %{
+  match(Set cr (CmpF src con));
   ins_cost(100);
-  format %{ "ucomiss $src1, $src2" %}
-  opcode(0x0F, 0x2E);
-  ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2));
+  format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con" %}
+  ins_encode %{
+    __ ucomiss($src$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10458,30 +10393,36 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct cmpD_cc_imm(rFlagsRegU cr, regD src1, immD src2)
-%{
-  match(Set cr (CmpD src1 src2));
+instruct cmpD_cc_imm(rFlagsRegU cr, regD src, immD con) %{
+  match(Set cr (CmpD src con));
 
   ins_cost(145);
-  format %{ "ucomisd $src1, [$src2]\n\t"
+  format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t"
             "jnp,s   exit\n\t"
             "pushfq\t# saw NaN, set CF\n\t"
             "andq    [rsp], #0xffffff2b\n\t"
             "popfq\n"
     "exit:   nop\t# avoid branch to branch" %}
-  opcode(0x66, 0x0F, 0x2E);
-  ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2),
-             cmpfp_fixup);
-  ins_pipe(pipe_slow);
-%}
-
-instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src1, immD src2) %{
-  match(Set cr (CmpD src1 src2));
-
+  ins_encode %{
+    Label L_exit;
+    __ ucomisd($src$$XMMRegister, $constantaddress($con));
+    __ jcc(Assembler::noParity, L_exit);
+    __ pushf();
+    __ andq(rsp, 0xffffff2b);
+    __ popf();
+    __ bind(L_exit);
+    __ nop();
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src, immD con) %{
+  match(Set cr (CmpD src con));
   ins_cost(100);
-  format %{ "ucomisd $src1, [$src2]" %}
-  opcode(0x66, 0x0F, 0x2E);
-  ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2));
+  format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con" %}
+  ins_encode %{
+    __ ucomisd($src$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10528,23 +10469,29 @@
 %}
 
 // Compare into -1,0,1
-instruct cmpF_imm(rRegI dst, regF src1, immF src2, rFlagsReg cr)
-%{
-  match(Set dst (CmpF3 src1 src2));
+instruct cmpF_imm(rRegI dst, regF src, immF con, rFlagsReg cr) %{
+  match(Set dst (CmpF3 src con));
   effect(KILL cr);
 
   ins_cost(275);
-  format %{ "ucomiss $src1, [$src2]\n\t"
+  format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t"
             "movl    $dst, #-1\n\t"
             "jp,s    done\n\t"
             "jb,s    done\n\t"
             "setne   $dst\n\t"
             "movzbl  $dst, $dst\n"
     "done:" %}
-
-  opcode(0x0F, 0x2E);
-  ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2),
-             cmpfp3(dst));
+  ins_encode %{
+    Label L_done;
+    Register Rdst = $dst$$Register;
+    __ ucomiss($src$$XMMRegister, $constantaddress($con));
+    __ movl(Rdst, -1);
+    __ jcc(Assembler::parity, L_done);
+    __ jcc(Assembler::below, L_done);
+    __ setb(Assembler::notEqual, Rdst);
+    __ movzbl(Rdst, Rdst);
+    __ bind(L_done);
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10591,23 +10538,29 @@
 %}
 
 // Compare into -1,0,1
-instruct cmpD_imm(rRegI dst, regD src1, immD src2, rFlagsReg cr)
-%{
-  match(Set dst (CmpD3 src1 src2));
+instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{
+  match(Set dst (CmpD3 src con));
   effect(KILL cr);
 
   ins_cost(275);
-  format %{ "ucomisd $src1, [$src2]\n\t"
+  format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t"
             "movl    $dst, #-1\n\t"
             "jp,s    done\n\t"
             "jb,s    done\n\t"
             "setne   $dst\n\t"
             "movzbl  $dst, $dst\n"
     "done:" %}
-
-  opcode(0x66, 0x0F, 0x2E);
-  ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2),
-             cmpfp3(dst));
+  ins_encode %{
+    Register Rdst = $dst$$Register;
+    Label L_done;
+    __ ucomisd($src$$XMMRegister, $constantaddress($con));
+    __ movl(Rdst, -1);
+    __ jcc(Assembler::parity, L_done);
+    __ jcc(Assembler::below, L_done);
+    __ setb(Assembler::notEqual, Rdst);
+    __ movzbl(Rdst, Rdst);
+    __ bind(L_done);
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10633,14 +10586,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct addF_imm(regF dst, immF src)
-%{
-  match(Set dst (AddF dst src));
-
-  format %{ "addss   $dst, [$src]" %}
+instruct addF_imm(regF dst, immF con) %{
+  match(Set dst (AddF dst con));
+  format %{ "addss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF3, 0x0F, 0x58);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+  ins_encode %{
+    __ addss($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10666,14 +10618,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct addD_imm(regD dst, immD src)
-%{
-  match(Set dst (AddD dst src));
-
-  format %{ "addsd   $dst, [$src]" %}
+instruct addD_imm(regD dst, immD con) %{
+  match(Set dst (AddD dst con));
+  format %{ "addsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF2, 0x0F, 0x58);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+  ins_encode %{
+    __ addsd($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10699,14 +10650,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct subF_imm(regF dst, immF src)
-%{
-  match(Set dst (SubF dst src));
-
-  format %{ "subss   $dst, [$src]" %}
+instruct subF_imm(regF dst, immF con) %{
+  match(Set dst (SubF dst con));
+  format %{ "subss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF3, 0x0F, 0x5C);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+  ins_encode %{
+    __ subss($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10732,14 +10682,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct subD_imm(regD dst, immD src)
-%{
-  match(Set dst (SubD dst src));
-
-  format %{ "subsd   $dst, [$src]" %}
+instruct subD_imm(regD dst, immD con) %{
+  match(Set dst (SubD dst con));
+  format %{ "subsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF2, 0x0F, 0x5C);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+  ins_encode %{
+    __ subsd($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10765,14 +10714,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct mulF_imm(regF dst, immF src)
-%{
-  match(Set dst (MulF dst src));
-
-  format %{ "mulss   $dst, [$src]" %}
+instruct mulF_imm(regF dst, immF con) %{
+  match(Set dst (MulF dst con));
+  format %{ "mulss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF3, 0x0F, 0x59);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+  ins_encode %{
+    __ mulss($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10798,14 +10746,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct mulD_imm(regD dst, immD src)
-%{
-  match(Set dst (MulD dst src));
-
-  format %{ "mulsd   $dst, [$src]" %}
+instruct mulD_imm(regD dst, immD con) %{
+  match(Set dst (MulD dst con));
+  format %{ "mulsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF2, 0x0F, 0x59);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+  ins_encode %{
+    __ mulsd($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10831,14 +10778,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct divF_imm(regF dst, immF src)
-%{
-  match(Set dst (DivF dst src));
-
-  format %{ "divss   $dst, [$src]" %}
+instruct divF_imm(regF dst, immF con) %{
+  match(Set dst (DivF dst con));
+  format %{ "divss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF3, 0x0F, 0x5E);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+  ins_encode %{
+    __ divss($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10864,14 +10810,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct divD_imm(regD dst, immD src)
-%{
-  match(Set dst (DivD dst src));
-
-  format %{ "divsd   $dst, [$src]" %}
+instruct divD_imm(regD dst, immD con) %{
+  match(Set dst (DivD dst con));
+  format %{ "divsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF2, 0x0F, 0x5E);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+  ins_encode %{
+    __ divsd($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10897,14 +10842,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct sqrtF_imm(regF dst, immF src)
-%{
-  match(Set dst (ConvD2F (SqrtD (ConvF2D src))));
-
-  format %{ "sqrtss  $dst, [$src]" %}
+instruct sqrtF_imm(regF dst, immF con) %{
+  match(Set dst (ConvD2F (SqrtD (ConvF2D con))));
+  format %{ "sqrtss  $dst, [$constantaddress]\t# load from constant table: float=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF3, 0x0F, 0x51);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+  ins_encode %{
+    __ sqrtss($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
@@ -10930,14 +10874,13 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct sqrtD_imm(regD dst, immD src)
-%{
-  match(Set dst (SqrtD src));
-
-  format %{ "sqrtsd  $dst, [$src]" %}
+instruct sqrtD_imm(regD dst, immD con) %{
+  match(Set dst (SqrtD con));
+  format %{ "sqrtsd  $dst, [$constantaddress]\t# load from constant table: double=$con" %}
   ins_cost(150); // XXX
-  opcode(0xF2, 0x0F, 0x51);
-  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+  ins_encode %{
+    __ sqrtsd($dst$$XMMRegister, $constantaddress($con));
+  %}
   ins_pipe(pipe_slow);
 %}
 
--- a/src/cpu/zero/vm/assembler_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/assembler_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,24 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#endif
 
 int AbstractAssembler::code_fill_byte() {
   return 0;
--- a/src/cpu/zero/vm/assembler_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/assembler_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_ASSEMBLER_ZERO_HPP
+#define CPU_ZERO_VM_ASSEMBLER_ZERO_HPP
+
 // In normal, CPU-specific ports of HotSpot these two classes are used
 // for generating assembly language.  We don't do any of this in zero,
 // of course, but we do sneak entry points around in CodeBuffers so we
@@ -62,3 +65,5 @@
 
 address ShouldNotCallThisStub();
 address ShouldNotCallThisEntry();
+
+#endif // CPU_ZERO_VM_ASSEMBLER_ZERO_HPP
--- a/src/cpu/zero/vm/assembler_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/assembler_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,14 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP
+
+#include "asm/assembler.inline.hpp"
+#include "asm/codeBuffer.hpp"
+#include "code/codeCache.hpp"
+#include "runtime/handles.inline.hpp"
+
 // This file is intentionally empty
+
+#endif // CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP
--- a/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interp_masm_zero.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/bytecodeInterpreter.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
 
 #ifdef CC_INTERP
 
--- a/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP
+#define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP
+
 // Platform specific for C++ based Interpreter
 
 #if defined(PPC) || defined(SPARC) || defined(IA64)
@@ -146,3 +149,5 @@
                                                   ((VMJavaVal64*)(addr))->d)
 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
                                                 ((VMJavaVal64*)(addr))->l)
+
+#endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP
--- a/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
+
 // Inline interpreter functions for zero
 
 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
@@ -299,3 +302,5 @@
 inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
   return (jbyte) val;
 }
+
+#endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
--- a/src/cpu/zero/vm/bytecodes_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/bytecodes_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodes_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
 
 void Bytecodes::pd_initialize() {
   // No zero specific initialization
--- a/src/cpu/zero/vm/bytecodes_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/bytecodes_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_BYTECODES_ZERO_HPP
+#define CPU_ZERO_VM_BYTECODES_ZERO_HPP
+
 // This file is intentionally empty
+
+#endif // CPU_ZERO_VM_BYTECODES_ZERO_HPP
--- a/src/cpu/zero/vm/bytes_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/bytes_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,11 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_BYTES_ZERO_HPP
+#define CPU_ZERO_VM_BYTES_ZERO_HPP
+
+#include "memory/allocation.hpp"
+
 typedef union unaligned {
   u4 u;
   u2 us;
@@ -160,5 +165,10 @@
 #ifdef VM_LITTLE_ENDIAN
 // The following header contains the implementations of swap_u2,
 // swap_u4, and swap_u8
-#include "incls/_bytes_pd.inline.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "bytes_linux_zero.inline.hpp"
+#endif
+
 #endif // VM_LITTLE_ENDIAN
+
+#endif // CPU_ZERO_VM_BYTES_ZERO_HPP
--- a/src/cpu/zero/vm/codeBuffer_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/codeBuffer_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,5 +23,10 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_CODEBUFFER_ZERO_HPP
+#define CPU_ZERO_VM_CODEBUFFER_ZERO_HPP
+
  private:
   void pd_initialize() {}
+
+#endif // CPU_ZERO_VM_CODEBUFFER_ZERO_HPP
--- a/src/cpu/zero/vm/copy_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/copy_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_COPY_ZERO_HPP
+#define CPU_ZERO_VM_COPY_ZERO_HPP
+
 // Inline functions for memory copy and fill.
 
 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
@@ -176,3 +179,5 @@
 static void pd_zero_to_bytes(void* to, size_t count) {
   memset(to, 0, count);
 }
+
+#endif // CPU_ZERO_VM_COPY_ZERO_HPP
--- a/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP
+#define CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP
+
  protected:
   MacroAssembler* assembler() const {
     return _masm;
@@ -35,3 +38,5 @@
     entry->set_entry_point(entry_point);
     return (address) entry;
   }
+
+#endif // CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,33 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/cppInterpreter.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "stack_zero.inline.hpp"
+#include "utilities/debug.hpp"
+#ifdef SHARK
+#include "shark/shark_globals.hpp"
+#endif
 
 #ifdef CC_INTERP
 
--- a/src/cpu/zero/vm/cppInterpreter_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/cppInterpreter_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP
+#define CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP
+
  protected:
   // Size of interpreter code
   const static int InterpreterCodeSize = 6 * K;
@@ -41,3 +44,5 @@
  private:
   // Fast result type determination
   static BasicType result_type_of(methodOop method);
+
+#endif // CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP
--- a/src/cpu/zero/vm/debug_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/debug_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,14 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_debug_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/init.hpp"
+#include "runtime/os.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/top.hpp"
 
 void pd_ps(frame f) {
   ShouldNotCallThis();
--- a/src/cpu/zero/vm/depChecker_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/depChecker_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,8 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "compiler/disassembler.hpp"
+#include "depChecker_zero.hpp"
+
 // This file is intentionally empty
--- a/src/cpu/zero/vm/depChecker_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/depChecker_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_DEPCHECKER_ZERO_HPP
+#define CPU_ZERO_VM_DEPCHECKER_ZERO_HPP
+
 // This file is intentionally empty
+
+#endif // CPU_ZERO_VM_DEPCHECKER_ZERO_HPP
--- a/src/cpu/zero/vm/disassembler_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/disassembler_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,6 @@
  *
  */
 
+#include "precompiled.hpp"
+
 // This file is intentionally empty
--- a/src/cpu/zero/vm/disassembler_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/disassembler_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP
+#define CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP
+
   static int pd_instruction_alignment() {
     return 1;
   }
@@ -30,3 +33,5 @@
   static const char* pd_cpu_opts() {
     return "";
   }
+
+#endif // CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP
--- a/src/cpu/zero/vm/dump_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/dump_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_dump_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
 
 void CompactingPermGenGen::generate_vtable_methods(void** vtbl_list,
                                                    void** vtable,
--- a/src/cpu/zero/vm/entryFrame_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/entryFrame_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP
+#define CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP
+
+#include "runtime/javaCalls.hpp"
+#include "stack_zero.hpp"
+
 // |  ...               |
 // +--------------------+  ------------------
 // | parameter n-1      |       low addresses
@@ -63,3 +69,5 @@
                      char* valuebuf,
                      int   buflen) const;
 };
+
+#endif // CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP
--- a/src/cpu/zero/vm/entry_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/entry_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_ENTRY_ZERO_HPP
+#define CPU_ZERO_VM_ENTRY_ZERO_HPP
+
 class ZeroEntry {
  public:
   ZeroEntry() {
@@ -72,3 +75,5 @@
     return byte_offset_of(ZeroEntry, _entry_point);
   }
 };
+
+#endif // CPU_ZERO_VM_ENTRY_ZERO_HPP
--- a/src/cpu/zero/vm/fakeStubFrame_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/fakeStubFrame_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,11 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP
+#define CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP
+
+#include "stack_zero.hpp"
+
 // |  ...               |
 // +--------------------+  ------------------
 // | frame_type         |       low addresses
@@ -51,3 +56,5 @@
                      char* valuebuf,
                      int   buflen) const {}
 };
+
+#endif // CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP
--- a/src/cpu/zero/vm/frame_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/frame_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,26 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_frame_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "code/scopeDesc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_zero.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#include "runtime/vframeArray.hpp"
+#endif
 
 #ifdef ASSERT
 void RegisterMap::check_location_valid() {
--- a/src/cpu/zero/vm/frame_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/frame_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_FRAME_ZERO_HPP
+#define CPU_ZERO_VM_FRAME_ZERO_HPP
+
+#include "runtime/synchronizer.hpp"
+#include "utilities/top.hpp"
+
 // A frame represents a physical stack frame on the Zero stack.
 
  public:
@@ -72,3 +78,5 @@
                            outputStream* st,
                            char*         buf,
                            int           buflen) const;
+
+#endif // CPU_ZERO_VM_FRAME_ZERO_HPP
--- a/src/cpu/zero/vm/frame_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/frame_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
+
 // Constructors
 
 inline frame::frame() {
@@ -149,3 +152,5 @@
   else
     return (intptr_t *) -1;
 }
+
+#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
--- a/src/cpu/zero/vm/globalDefinitions_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/globalDefinitions_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP
+#define CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP
+
 #include <ffi.h>
+
+#endif // CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP
--- a/src/cpu/zero/vm/globals_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/globals_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_GLOBALS_ZERO_HPP
+#define CPU_ZERO_VM_GLOBALS_ZERO_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 // Set the default values for platform dependent flags used by the
 // runtime system.  See globals.hpp for details of what they do.
 
@@ -47,3 +53,5 @@
 define_pd_global(bool,  RewriteFrequentPairs, true);
 
 define_pd_global(bool,  UseMembar,            false);
+
+#endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP
--- a/src/cpu/zero/vm/icBuffer_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/icBuffer_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icBuffer_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   // NB set this once the functions below are implemented
--- a/src/cpu/zero/vm/icache_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/icache_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icache_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "runtime/icache.hpp"
 
 void ICacheStubGenerator::generate_icache_flush(
   ICache::flush_icache_stub_t* flush_icache_stub) {
--- a/src/cpu/zero/vm/icache_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/icache_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_ICACHE_ZERO_HPP
+#define CPU_ZERO_VM_ICACHE_ZERO_HPP
+
 // Interface for updating the instruction cache.  Whenever the VM
 // modifies code, part of the processor instruction cache potentially
 // has to be flushed.  This implementation is empty: Zero never deals
@@ -34,3 +37,5 @@
   static void invalidate_word(address addr) {}
   static void invalidate_range(address start, int nbytes) {}
 };
+
+#endif // CPU_ZERO_VM_ICACHE_ZERO_HPP
--- a/src/cpu/zero/vm/interp_masm_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interp_masm_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,22 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "interp_masm_zero.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+
 // This file is intentionally empty
--- a/src/cpu/zero/vm/interp_masm_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interp_masm_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_INTERP_MASM_ZERO_HPP
+#define CPU_ZERO_VM_INTERP_MASM_ZERO_HPP
+
+#include "assembler_zero.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
 // This file specializes the assember with interpreter-specific macros
 
 class InterpreterMacroAssembler : public MacroAssembler {
@@ -36,3 +42,5 @@
     ShouldNotCallThis();
   }
 };
+
+#endif // CPU_ZERO_VM_INTERP_MASM_ZERO_HPP
--- a/src/cpu/zero/vm/interpreterFrame_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interpreterFrame_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,14 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP
+
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/thread.hpp"
+#include "stack_zero.hpp"
+
 #ifdef CC_INTERP
 // |  ...               |
 // +--------------------+  ------------------
@@ -71,3 +79,5 @@
                      int   buflen) const;
 };
 #endif // CC_INTERP
+
+#endif // CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP
--- a/src/cpu/zero/vm/interpreterGenerator_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interpreterGenerator_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP
+
   // Generation of Interpreter
   //
   friend class AbstractInterpreterGenerator;
@@ -35,3 +38,5 @@
   address generate_empty_entry();
   address generate_accessor_entry();
   address generate_method_handle_entry();
+
+#endif // CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP
--- a/src/cpu/zero/vm/interpreterRT_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interpreterRT_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
+#include "stack_zero.inline.hpp"
 
 void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_int() {
   push(T_INT);
--- a/src/cpu/zero/vm/interpreterRT_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interpreterRT_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,11 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP
+
+#include "memory/allocation.hpp"
+
 class SignatureHandler {
  public:
   static SignatureHandler *from_handlerAddr(address handlerAddr) {
@@ -125,3 +130,5 @@
     return (SignatureHandler *) cif();
   }
 };
+
+#endif // CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP
--- a/src/cpu/zero/vm/interpreter_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interpreter_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,32 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 address AbstractInterpreterGenerator::generate_slow_signature_handler() {
   _masm->advance(1);
--- a/src/cpu/zero/vm/interpreter_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/interpreter_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_INTERPRETER_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETER_ZERO_HPP
+
  public:
   static void invoke_method(methodOop method, address entry_point, TRAPS) {
     ((ZeroEntry *) entry_point)->invoke(method, THREAD);
@@ -47,3 +50,5 @@
     assert(i <= 0, "local direction already negated");
     return stackElementWords * i;
   }
+
+#endif // CPU_ZERO_VM_INTERPRETER_ZERO_HPP
--- a/src/cpu/zero/vm/javaFrameAnchor_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/javaFrameAnchor_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP
+#define CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP
+
  private:
   ZeroFrame* volatile _last_Java_fp;
 
@@ -89,3 +92,5 @@
   static ByteSize last_Java_fp_offset() {
     return byte_offset_of(JavaFrameAnchor, _last_Java_fp);
   }
+
+#endif // CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP
--- a/src/cpu/zero/vm/jniFastGetField_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/jniFastGetField_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_jniFastGetField_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
 
 address JNI_FastGetField::generate_fast_get_boolean_field() {
   return (address) -1;
--- a/src/cpu/zero/vm/jniTypes_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/jniTypes_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_JNITYPES_ZERO_HPP
+#define CPU_ZERO_VM_JNITYPES_ZERO_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "prims/jni.h"
+
 // This file holds platform-dependent routines used to write primitive jni
 // types to the array of arguments passed into JavaCalls::call
 
@@ -106,3 +113,5 @@
 #endif
 
 };
+
+#endif // CPU_ZERO_VM_JNITYPES_ZERO_HPP
--- a/src/cpu/zero/vm/jni_zero.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/jni_zero.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
--- a/src/cpu/zero/vm/methodHandles_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/methodHandles_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/methodHandles.hpp"
 
 int MethodHandles::adapter_conversion_ops_supported_mask() {
   ShouldNotCallThis();
--- a/src/cpu/zero/vm/nativeInst_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/nativeInst_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_nativeInst_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 // This method is called by nmethod::make_not_entrant_or_zombie to
 // insert a jump to SharedRuntime::get_handle_wrong_method_stub()
--- a/src/cpu/zero/vm/nativeInst_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/nativeInst_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,15 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_NATIVEINST_ZERO_HPP
+#define CPU_ZERO_VM_NATIVEINST_ZERO_HPP
+
+#include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/os.hpp"
+#include "utilities/top.hpp"
+
 // We have interfaces for the following instructions:
 // - NativeInstruction
 // - - NativeCall
@@ -183,3 +192,5 @@
 inline NativeGeneralJump* nativeGeneralJump_at(address address) {
   ShouldNotCallThis();
 }
+
+#endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP
--- a/src/cpu/zero/vm/registerMap_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/registerMap_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_REGISTERMAP_ZERO_HPP
+#define CPU_ZERO_VM_REGISTERMAP_ZERO_HPP
+
   // machine-dependent implemention for register maps
   friend class frame;
 
@@ -37,3 +40,5 @@
   void pd_clear() {}
   void pd_initialize() {}
   void pd_initialize_from(const RegisterMap* map) {}
+
+#endif // CPU_ZERO_VM_REGISTERMAP_ZERO_HPP
--- a/src/cpu/zero/vm/register_definitions_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/register_definitions_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,10 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "asm/register.hpp"
+#include "interp_masm_zero.hpp"
+#include "register_zero.hpp"
+
 // This file is intentionally empty
--- a/src/cpu/zero/vm/register_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/register_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_register_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "register_zero.hpp"
 
 const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers;
 const int ConcreteRegisterImpl::max_fpr =
--- a/src/cpu/zero/vm/register_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/register_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_REGISTER_ZERO_HPP
+#define CPU_ZERO_VM_REGISTER_ZERO_HPP
+
+#include "asm/register.hpp"
+#include "vm_version_zero.hpp"
+
 class VMRegImpl;
 typedef VMRegImpl* VMReg;
 
@@ -108,3 +114,5 @@
 };
 
 CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1));
+
+#endif // CPU_ZERO_VM_REGISTER_ZERO_HPP
--- a/src/cpu/zero/vm/relocInfo_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/relocInfo_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_relocInfo_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.inline.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/relocInfo.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
 
 void Relocation::pd_set_data_value(address x, intptr_t o) {
   ShouldNotCallThis();
--- a/src/cpu/zero/vm/relocInfo_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/relocInfo_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_RELOCINFO_ZERO_HPP
+#define CPU_ZERO_VM_RELOCINFO_ZERO_HPP
+
   // machine-dependent parts of class relocInfo
  private:
   enum {
@@ -30,3 +33,5 @@
     offset_unit  =  1,
     format_width =  1
   };
+
+#endif // CPU_ZERO_VM_RELOCINFO_ZERO_HPP
--- a/src/cpu/zero/vm/sharedRuntime_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/sharedRuntime_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,28 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_zero.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+#ifdef SHARK
+#include "compiler/compileBroker.hpp"
+#include "shark/sharkCompiler.hpp"
+#endif
 
 DeoptimizationBlob *SharedRuntime::_deopt_blob;
 SafepointBlob      *SharedRuntime::_polling_page_safepoint_handler_blob;
--- a/src/cpu/zero/vm/sharkFrame_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/sharkFrame_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_SHARKFRAME_ZERO_HPP
+#define CPU_ZERO_VM_SHARKFRAME_ZERO_HPP
+
+#include "oops/methodOop.hpp"
+#include "stack_zero.hpp"
+
 // |  ...               |
 // +--------------------+  ------------------
 // | stack slot n-1     |       low addresses
@@ -77,3 +83,5 @@
                      char* valuebuf,
                      int   buflen) const;
 };
+
+#endif // CPU_ZERO_VM_SHARKFRAME_ZERO_HPP
--- a/src/cpu/zero/vm/shark_globals_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/shark_globals_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP
+#define CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP
+
 // Set the default values for platform dependent flags used by the
 // Shark compiler.  See globals.hpp for details of what they do.
 
@@ -60,3 +63,5 @@
 define_pd_global(bool,     NeverActAsServerClassMachine, true );
 define_pd_global(uint64_t, MaxRAM,                       1ULL*G);
 define_pd_global(bool,     CICompileOSR,                 true );
+
+#endif // CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP
--- a/src/cpu/zero/vm/stack_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/stack_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stack_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "stack_zero.hpp"
+#include "stack_zero.inline.hpp"
 
 int ZeroStack::suggest_size(Thread *thread) const {
   assert(needs_setup(), "already set up");
--- a/src/cpu/zero/vm/stack_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/stack_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,11 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_STACK_ZERO_HPP
+#define CPU_ZERO_VM_STACK_ZERO_HPP
+
+#include "utilities/sizes.hpp"
+
 class ZeroStack {
  private:
   intptr_t *_base; // the last available word
@@ -217,3 +222,5 @@
                         char*     fieldbuf,
                         int       buflen) const;
 };
+
+#endif // CPU_ZERO_VM_STACK_ZERO_HPP
--- a/src/cpu/zero/vm/stack_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/stack_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
+
+#include "runtime/thread.hpp"
+#include "stack_zero.hpp"
+
 // This function should match SharkStack::CreateStackOverflowCheck
 inline void ZeroStack::overflow_check(int required_words, TRAPS) {
   // Check the Zero stack
@@ -46,3 +52,5 @@
   int stack_free = thread->stack_size() - stack_used;
   return stack_free - shadow_pages_size();
 }
+
+#endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
--- a/src/cpu/zero/vm/stubGenerator_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/stubGenerator_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,29 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "stack_zero.inline.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // Declaration and definition of StubGenerator (no .hpp file).
 // For a more detailed description of the stub routine structure
--- a/src/cpu/zero/vm/stubRoutines_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/stubRoutines_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
 
 #ifdef IA32
 address StubRoutines::x86::_call_stub_compiled_return = NULL;
--- a/src/cpu/zero/vm/stubRoutines_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/stubRoutines_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_STUBROUTINES_ZERO_HPP
+#define CPU_ZERO_VM_STUBROUTINES_ZERO_HPP
+
   // This file holds the platform specific parts of the StubRoutines
   // definition. See stubRoutines.hpp for a description on how to
   // extend it.
@@ -53,3 +56,5 @@
     static address _call_stub_compiled_return;
   };
 #endif // IA32
+
+#endif // CPU_ZERO_VM_STUBROUTINES_ZERO_HPP
--- a/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP
+#define CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP
+
 // This file is intentionally empty
+
+#endif // CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP
--- a/src/cpu/zero/vm/templateInterpreter_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/templateInterpreter_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,27 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/debug.hpp"
+
 // This file is intentionally empty
--- a/src/cpu/zero/vm/templateInterpreter_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/templateInterpreter_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP
+#define CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP
+
 // This file is intentionally empty
+
+#endif // CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP
--- a/src/cpu/zero/vm/templateTable_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/templateTable_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,17 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+
 // This file is intentionally empty
--- a/src/cpu/zero/vm/templateTable_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/templateTable_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP
+#define CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP
+
 // This file is intentionally empty
+
+#endif // CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP
--- a/src/cpu/zero/vm/vmStructs_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/vmStructs_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP
+#define CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP
+
 // These are the CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -50,3 +53,5 @@
   /* NOTE that we do not use the last_entry() macro here; it is used         */
   /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must  */
   /* be present there)                                                       */
+
+#endif // CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP
--- a/src/cpu/zero/vm/vm_version_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/vm_version_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,14 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/java.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "vm_version_zero.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+
 // This file is intentionally empty
--- a/src/cpu/zero/vm/vm_version_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/vm_version_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,9 +23,17 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_VM_VERSION_ZERO_HPP
+#define CPU_ZERO_VM_VM_VERSION_ZERO_HPP
+
+#include "runtime/globals_extension.hpp"
+#include "runtime/vm_version.hpp"
+
 class VM_Version : public Abstract_VM_Version {
  public:
   static const char* cpu_features() {
     return "";
   }
 };
+
+#endif // CPU_ZERO_VM_VM_VERSION_ZERO_HPP
--- a/src/cpu/zero/vm/vmreg_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/vmreg_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vmreg_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
 
 void VMRegImpl::set_regName() {
   int i = 0;
--- a/src/cpu/zero/vm/vmreg_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/vmreg_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_VMREG_ZERO_HPP
+#define CPU_ZERO_VM_VMREG_ZERO_HPP
+
   bool is_Register();
   Register as_Register();
 
   bool is_FloatRegister();
   FloatRegister as_FloatRegister();
+
+#endif // CPU_ZERO_VM_VMREG_ZERO_HPP
--- a/src/cpu/zero/vm/vmreg_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/vmreg_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP
+
 inline VMReg RegisterImpl::as_VMReg() {
   return VMRegImpl::as_VMReg(encoding());
 }
@@ -30,3 +33,5 @@
 inline VMReg FloatRegisterImpl::as_VMReg() {
   return VMRegImpl::as_VMReg(encoding() + ConcreteRegisterImpl::max_gpr);
 }
+
+#endif // CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP
--- a/src/cpu/zero/vm/vtableStubs_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/cpu/zero/vm/vtableStubs_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_zero.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_zero.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
   ShouldNotCallThis();
--- a/src/os/linux/launcher/java.c	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1842 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- *
- * GAMMA: gamma launcher is much simpler than regular java launcher in that
- *        JVM is either statically linked in or it is installed in the
- *        same directory where the launcher exists, so we don't have to
- *        worry about choosing the right JVM based on command line flag, jar
- *        file and/or ergonomics. Intead of removing unused logic from source
- *        they are commented out with #ifndef GAMMA, hopefully it'll be easier
- *        to maintain this file in sync with regular JDK launcher.
- */
-
-/*
- * Shared source for 'java' command line tool.
- *
- * If JAVA_ARGS is defined, then acts as a launcher for applications. For
- * instance, the JDK command line tools such as javac and javadoc (see
- * makefiles for more details) are built with this program.  Any arguments
- * prefixed with '-J' will be passed directly to the 'java' command.
- */
-
-#ifdef GAMMA
-#  ifdef JAVA_ARGS
-#    error Do NOT define JAVA_ARGS when building gamma launcher
-#  endif
-#  if !defined(LINK_INTO_AOUT) && !defined(LINK_INTO_LIBJVM)
-#    error Either LINK_INTO_AOUT or LINK_INTO_LIBJVM must be defined
-#  endif
-#endif
-
-/*
- * One job of the launcher is to remove command line options which the
- * vm does not understand and will not process.  These options include
- * options which select which style of vm is run (e.g. -client and
- * -server) as well as options which select the data model to use.
- * Additionally, for tools which invoke an underlying vm "-J-foo"
- * options are turned into "-foo" options to the vm.  This option
- * filtering is handled in a number of places in the launcher, some of
- * it in machine-dependent code.  In this file, the function
- * CheckJVMType removes vm style options and TranslateDashJArgs
- * removes "-J" prefixes.  On unix platforms, the
- * CreateExecutionEnvironment function from the unix java_md.c file
- * processes and removes -d<n> options.  However, in case
- * CreateExecutionEnvironment does not need to exec because
- * LD_LIBRARY_PATH is set acceptably and the data model does not need
- * to be changed, ParseArguments will screen out the redundant -d<n>
- * options and prevent them from being passed to the vm; this is done
- * by using the machine-dependent call
- * RemovableMachineDependentOption.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <jni.h>
-#include "java.h"
-
-#ifndef GAMMA
-#include "manifest_info.h"
-#include "version_comp.h"
-#endif
-
-#ifndef FULL_VERSION
-#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
-#endif
-
-/*
- * The following environment variable is used to influence the behavior
- * of the jre exec'd through the SelectVersion routine.  The command line
- * options which specify the version are not passed to the exec'd version,
- * because that jre may be an older version which wouldn't recognize them.
- * This environment variable is known to this (and later) version and serves
- * to suppress the version selection code.  This is not only for efficiency,
- * but also for correctness, since any command line options have been
- * removed which would cause any value found in the manifest to be used.
- * This would be incorrect because the command line options are defined
- * to take precedence.
- *
- * The value associated with this environment variable is the MainClass
- * name from within the executable jar file (if any). This is strictly a
- * performance enhancement to avoid re-reading the jar file manifest.
- *
- * A NOTE TO DEVELOPERS: For performance reasons it is important that
- * the program image remain relatively small until after SelectVersion
- * CreateExecutionEnvironment have finished their possibly recursive
- * processing. Watch everything, but resist all temptations to use Java
- * interfaces.
- */
-#define ENV_ENTRY "_JAVA_VERSION_SET"
-
-static jboolean printVersion = JNI_FALSE; /* print and exit */
-static jboolean showVersion = JNI_FALSE;  /* print but continue */
-static char *progname;
-jboolean _launcher_debug = JNI_FALSE;
-
-/*
- * List of VM options to be specified when the VM is created.
- */
-static JavaVMOption *options;
-static int numOptions, maxOptions;
-
-/*
- * Prototypes for functions internal to launcher.
- */
-static void AddOption(char *str, void *info);
-static void SetClassPath(char *s);
-static void SelectVersion(int argc, char **argv, char **main_class);
-static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile,
-                               char **pclassname, int *pret);
-static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv,
-                              InvocationFunctions *ifn);
-static jstring NewPlatformString(JNIEnv *env, char *s);
-static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc);
-static jclass LoadClass(JNIEnv *env, char *name);
-static jstring GetMainClassName(JNIEnv *env, char *jarname);
-static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv);
-#ifdef GAMMA
-static void SetJavaLauncherProp(void);
-#endif
-
-#ifdef JAVA_ARGS
-static void TranslateDashJArgs(int *pargc, char ***pargv);
-static jboolean AddApplicationOptions(void);
-#endif
-
-static void PrintJavaVersion(JNIEnv *env);
-static void PrintUsage(void);
-static jint PrintXUsage(void);
-
-static void SetPaths(int argc, char **argv);
-
-/* Maximum supported entries from jvm.cfg. */
-#define INIT_MAX_KNOWN_VMS      10
-/* Values for vmdesc.flag */
-#define VM_UNKNOWN              -1
-#define VM_KNOWN                 0
-#define VM_ALIASED_TO            1
-#define VM_WARN                  2
-#define VM_ERROR                 3
-#define VM_IF_SERVER_CLASS       4
-#define VM_IGNORE                5
-struct vmdesc {
-    char *name;
-    int flag;
-    char *alias;
-    char *server_class;
-};
-static struct vmdesc *knownVMs = NULL;
-static int knownVMsCount = 0;
-static int knownVMsLimit = 0;
-
-static void GrowKnownVMs();
-static int  KnownVMIndex(const char* name);
-static void FreeKnownVMs();
-
-jboolean ServerClassMachine();
-
-/* flag which if set suppresses error messages from the launcher */
-static int noExitErrorMessage = 0;
-
-/*
- * Entry point.
- */
-int
-main(int argc, char ** argv)
-{
-    JavaVM *vm = 0;
-    JNIEnv *env = 0;
-    char *jarfile = 0;
-    char *classname = 0;
-    char *s = 0;
-    char *main_class = NULL;
-    jstring mainClassName;
-    jclass mainClass;
-    jmethodID mainID;
-    jobjectArray mainArgs;
-    int ret;
-    InvocationFunctions ifn;
-    jlong start, end;
-    char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
-    char ** original_argv = argv;
-
-    /*
-     * Error message to print or display; by default the message will
-     * only be displayed in a window.
-     */
-    char * message = "Fatal exception occurred.  Program will exit.";
-    jboolean messageDest = JNI_FALSE;
-
-    if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) {
-        _launcher_debug = JNI_TRUE;
-        printf("----_JAVA_LAUNCHER_DEBUG----\n");
-    }
-
-#ifndef GAMMA
-    /*
-     * Make sure the specified version of the JRE is running.
-     *
-     * There are three things to note about the SelectVersion() routine:
-     *  1) If the version running isn't correct, this routine doesn't
-     *     return (either the correct version has been exec'd or an error
-     *     was issued).
-     *  2) Argc and Argv in this scope are *not* altered by this routine.
-     *     It is the responsibility of subsequent code to ignore the
-     *     arguments handled by this routine.
-     *  3) As a side-effect, the variable "main_class" is guaranteed to
-     *     be set (if it should ever be set).  This isn't exactly the
-     *     poster child for structured programming, but it is a small
-     *     price to pay for not processing a jar file operand twice.
-     *     (Note: This side effect has been disabled.  See comment on
-     *     bugid 5030265 below.)
-     */
-    SelectVersion(argc, argv, &main_class);
-#endif /* ifndef GAMMA */
-
-    /* copy original argv */
-    {
-      int i;
-      original_argv = (char**)MemAlloc(sizeof(char*)*(argc+1));
-      for(i = 0; i < argc+1; i++)
-        original_argv[i] = argv[i];
-    }
-
-    CreateExecutionEnvironment(&argc, &argv,
-                               jrepath, sizeof(jrepath),
-                               jvmpath, sizeof(jvmpath),
-                               original_argv);
-    ifn.CreateJavaVM = 0;
-    ifn.GetDefaultJavaVMInitArgs = 0;
-
-    if (_launcher_debug)
-      start = CounterGet();
-    if (!LoadJavaVM(jvmpath, &ifn)) {
-      exit(6);
-    }
-    if (_launcher_debug) {
-      end   = CounterGet();
-      printf("%ld micro seconds to LoadJavaVM\n",
-             (long)(jint)Counter2Micros(end-start));
-    }
-
-#ifdef JAVA_ARGS  /* javac, jar and friends. */
-    progname = "java";
-#else             /* java, oldjava, javaw and friends */
-#ifdef PROGNAME
-    progname = PROGNAME;
-#else
-    progname = *argv;
-    if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
-        progname = s + 1;
-    }
-#endif /* PROGNAME */
-#endif /* JAVA_ARGS */
-    ++argv;
-    --argc;
-
-#ifdef JAVA_ARGS
-    /* Preprocess wrapper arguments */
-    TranslateDashJArgs(&argc, &argv);
-    if (!AddApplicationOptions()) {
-        exit(1);
-    }
-#endif
-
-    /* Set default CLASSPATH */
-    if ((s = getenv("CLASSPATH")) == 0) {
-        s = ".";
-    }
-#ifndef JAVA_ARGS
-    SetClassPath(s);
-#endif
-
-    /*
-     *  Parse command line options; if the return value of
-     *  ParseArguments is false, the program should exit.
-     */
-    if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret)) {
-      exit(ret);
-    }
-
-    /* Override class path if -jar flag was specified */
-    if (jarfile != 0) {
-        SetClassPath(jarfile);
-    }
-
-    /* set the -Dsun.java.command pseudo property */
-    SetJavaCommandLineProp(classname, jarfile, argc, argv);
-
-#ifdef GAMMA
-    /* Set the -Dsun.java.launcher pseudo property */
-    SetJavaLauncherProp();
-#endif
-
-    /*
-     * Done with all command line processing and potential re-execs so
-     * clean up the environment.
-     */
-    (void)UnsetEnv(ENV_ENTRY);
-
-    /* Initialize the virtual machine */
-
-    if (_launcher_debug)
-        start = CounterGet();
-    if (!InitializeJVM(&vm, &env, &ifn)) {
-        ReportErrorMessage("Could not create the Java virtual machine.",
-                           JNI_TRUE);
-        exit(1);
-    }
-
-    if (printVersion || showVersion) {
-        PrintJavaVersion(env);
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-        if (printVersion) {
-            ret = 0;
-            message = NULL;
-            goto leave;
-        }
-        if (showVersion) {
-            fprintf(stderr, "\n");
-        }
-    }
-
-    /* If the user specified neither a class name nor a JAR file */
-    if (jarfile == 0 && classname == 0) {
-        PrintUsage();
-        message = NULL;
-        goto leave;
-    }
-
-#ifndef GAMMA
-    FreeKnownVMs();  /* after last possible PrintUsage() */
-#endif
-
-    if (_launcher_debug) {
-        end   = CounterGet();
-        printf("%ld micro seconds to InitializeJVM\n",
-               (long)(jint)Counter2Micros(end-start));
-    }
-
-    /* At this stage, argc/argv have the applications' arguments */
-    if (_launcher_debug) {
-        int i = 0;
-        printf("Main-Class is '%s'\n", classname ? classname : "");
-        printf("Apps' argc is %d\n", argc);
-        for (; i < argc; i++) {
-            printf("    argv[%2d] = '%s'\n", i, argv[i]);
-        }
-    }
-
-    ret = 1;
-
-    /*
-     * Get the application's main class.
-     *
-     * See bugid 5030265.  The Main-Class name has already been parsed
-     * from the manifest, but not parsed properly for UTF-8 support.
-     * Hence the code here ignores the value previously extracted and
-     * uses the pre-existing code to reextract the value.  This is
-     * possibly an end of release cycle expedient.  However, it has
-     * also been discovered that passing some character sets through
-     * the environment has "strange" behavior on some variants of
-     * Windows.  Hence, maybe the manifest parsing code local to the
-     * launcher should never be enhanced.
-     *
-     * Hence, future work should either:
-     *     1)   Correct the local parsing code and verify that the
-     *          Main-Class attribute gets properly passed through
-     *          all environments,
-     *     2)   Remove the vestages of maintaining main_class through
-     *          the environment (and remove these comments).
-     */
-    if (jarfile != 0) {
-        mainClassName = GetMainClassName(env, jarfile);
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-        if (mainClassName == NULL) {
-          const char * format = "Failed to load Main-Class manifest "
-                                "attribute from\n%s";
-          message = (char*)MemAlloc((strlen(format) + strlen(jarfile)) *
-                                    sizeof(char));
-          sprintf(message, format, jarfile);
-          messageDest = JNI_TRUE;
-          goto leave;
-        }
-        classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
-        if (classname == NULL) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-        mainClass = LoadClass(env, classname);
-        if(mainClass == NULL) { /* exception occurred */
-            ReportExceptionDescription(env);
-            message = "Could not find the main class.  Program will exit.";
-            goto leave;
-        }
-        (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
-    } else {
-      mainClassName = NewPlatformString(env, classname);
-      if (mainClassName == NULL) {
-        const char * format = "Failed to load Main Class: %s";
-        message = (char *)MemAlloc((strlen(format) + strlen(classname)) *
-                                   sizeof(char) );
-        sprintf(message, format, classname);
-        messageDest = JNI_TRUE;
-        goto leave;
-      }
-      classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
-      if (classname == NULL) {
-        ReportExceptionDescription(env);
-        goto leave;
-      }
-      mainClass = LoadClass(env, classname);
-      if(mainClass == NULL) { /* exception occurred */
-        ReportExceptionDescription(env);
-        message = "Could not find the main class. Program will exit.";
-        goto leave;
-      }
-      (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
-    }
-
-    /* Get the application's main method */
-    mainID = (*env)->GetStaticMethodID(env, mainClass, "main",
-                                       "([Ljava/lang/String;)V");
-    if (mainID == NULL) {
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-        } else {
-          message = "No main method found in specified class.";
-          messageDest = JNI_TRUE;
-        }
-        goto leave;
-    }
-
-    {    /* Make sure the main method is public */
-        jint mods;
-        jmethodID mid;
-        jobject obj = (*env)->ToReflectedMethod(env, mainClass,
-                                                mainID, JNI_TRUE);
-
-        if( obj == NULL) { /* exception occurred */
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-
-        mid =
-          (*env)->GetMethodID(env,
-                              (*env)->GetObjectClass(env, obj),
-                              "getModifiers", "()I");
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-
-        mods = (*env)->CallIntMethod(env, obj, mid);
-        if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */
-            message = "Main method not public.";
-            messageDest = JNI_TRUE;
-            goto leave;
-        }
-    }
-
-    /* Build argument array */
-    mainArgs = NewPlatformStringArray(env, argv, argc);
-    if (mainArgs == NULL) {
-        ReportExceptionDescription(env);
-        goto leave;
-    }
-
-    /* Invoke main method. */
-    (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
-
-    /*
-     * The launcher's exit code (in the absence of calls to
-     * System.exit) will be non-zero if main threw an exception.
-     */
-    ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
-
-    /*
-     * Detach the main thread so that it appears to have ended when
-     * the application's main method exits.  This will invoke the
-     * uncaught exception handler machinery if main threw an
-     * exception.  An uncaught exception handler cannot change the
-     * launcher's return code except by calling System.exit.
-     */
-    if ((*vm)->DetachCurrentThread(vm) != 0) {
-        message = "Could not detach main thread.";
-        messageDest = JNI_TRUE;
-        ret = 1;
-        goto leave;
-    }
-
-    message = NULL;
-
- leave:
-    /*
-     * Wait for all non-daemon threads to end, then destroy the VM.
-     * This will actually create a trivial new Java waiter thread
-     * named "DestroyJavaVM", but this will be seen as a different
-     * thread from the one that executed main, even though they are
-     * the same C thread.  This allows mainThread.join() and
-     * mainThread.isAlive() to work as expected.
-     */
-    (*vm)->DestroyJavaVM(vm);
-
-    if(message != NULL && !noExitErrorMessage)
-      ReportErrorMessage(message, messageDest);
-    return ret;
-}
-
-
-#ifndef GAMMA
-/*
- * Checks the command line options to find which JVM type was
- * specified.  If no command line option was given for the JVM type,
- * the default type is used.  The environment variable
- * JDK_ALTERNATE_VM and the command line option -XXaltjvm= are also
- * checked as ways of specifying which JVM type to invoke.
- */
-char *
-CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
-    int i, argi;
-    int argc;
-    char **newArgv;
-    int newArgvIdx = 0;
-    int isVMType;
-    int jvmidx = -1;
-    char *jvmtype = getenv("JDK_ALTERNATE_VM");
-
-    argc = *pargc;
-
-    /* To make things simpler we always copy the argv array */
-    newArgv = MemAlloc((argc + 1) * sizeof(char *));
-
-    /* The program name is always present */
-    newArgv[newArgvIdx++] = (*argv)[0];
-
-    for (argi = 1; argi < argc; argi++) {
-        char *arg = (*argv)[argi];
-        isVMType = 0;
-
-#ifdef JAVA_ARGS
-        if (arg[0] != '-') {
-            newArgv[newArgvIdx++] = arg;
-            continue;
-        }
-#else
-        if (strcmp(arg, "-classpath") == 0 ||
-            strcmp(arg, "-cp") == 0) {
-            newArgv[newArgvIdx++] = arg;
-            argi++;
-            if (argi < argc) {
-                newArgv[newArgvIdx++] = (*argv)[argi];
-            }
-            continue;
-        }
-        if (arg[0] != '-') break;
-#endif
-
-        /* Did the user pass an explicit VM type? */
-        i = KnownVMIndex(arg);
-        if (i >= 0) {
-            jvmtype = knownVMs[jvmidx = i].name + 1; /* skip the - */
-            isVMType = 1;
-            *pargc = *pargc - 1;
-        }
-
-        /* Did the user specify an "alternate" VM? */
-        else if (strncmp(arg, "-XXaltjvm=", 10) == 0 || strncmp(arg, "-J-XXaltjvm=", 12) == 0) {
-            isVMType = 1;
-            jvmtype = arg+((arg[1]=='X')? 10 : 12);
-            jvmidx = -1;
-        }
-
-        if (!isVMType) {
-            newArgv[newArgvIdx++] = arg;
-        }
-    }
-
-    /*
-     * Finish copying the arguments if we aborted the above loop.
-     * NOTE that if we aborted via "break" then we did NOT copy the
-     * last argument above, and in addition argi will be less than
-     * argc.
-     */
-    while (argi < argc) {
-        newArgv[newArgvIdx++] = (*argv)[argi];
-        argi++;
-    }
-
-    /* argv is null-terminated */
-    newArgv[newArgvIdx] = 0;
-
-    /* Copy back argv */
-    *argv = newArgv;
-    *pargc = newArgvIdx;
-
-    /* use the default VM type if not specified (no alias processing) */
-    if (jvmtype == NULL) {
-      char* result = knownVMs[0].name+1;
-      /* Use a different VM type if we are on a server class machine? */
-      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
-          (ServerClassMachine() == JNI_TRUE)) {
-        result = knownVMs[0].server_class+1;
-      }
-      if (_launcher_debug) {
-        printf("Default VM: %s\n", result);
-      }
-      return result;
-    }
-
-    /* if using an alternate VM, no alias processing */
-    if (jvmidx < 0)
-      return jvmtype;
-
-    /* Resolve aliases first */
-    {
-      int loopCount = 0;
-      while (knownVMs[jvmidx].flag == VM_ALIASED_TO) {
-        int nextIdx = KnownVMIndex(knownVMs[jvmidx].alias);
-
-        if (loopCount > knownVMsCount) {
-          if (!speculative) {
-            ReportErrorMessage("Error: Corrupt jvm.cfg file; cycle in alias list.",
-                               JNI_TRUE);
-            exit(1);
-          } else {
-            return "ERROR";
-            /* break; */
-          }
-        }
-
-        if (nextIdx < 0) {
-          if (!speculative) {
-            ReportErrorMessage2("Error: Unable to resolve VM alias %s",
-                                knownVMs[jvmidx].alias, JNI_TRUE);
-            exit(1);
-          } else {
-            return "ERROR";
-          }
-        }
-        jvmidx = nextIdx;
-        jvmtype = knownVMs[jvmidx].name+1;
-        loopCount++;
-      }
-    }
-
-    switch (knownVMs[jvmidx].flag) {
-    case VM_WARN:
-        if (!speculative) {
-            fprintf(stderr, "Warning: %s VM not supported; %s VM will be used\n",
-                    jvmtype, knownVMs[0].name + 1);
-        }
-        /* fall through */
-    case VM_IGNORE:
-        jvmtype = knownVMs[jvmidx=0].name + 1;
-        /* fall through */
-    case VM_KNOWN:
-        break;
-    case VM_ERROR:
-        if (!speculative) {
-            ReportErrorMessage2("Error: %s VM not supported", jvmtype, JNI_TRUE);
-            exit(1);
-        } else {
-            return "ERROR";
-        }
-    }
-
-    return jvmtype;
-}
-#endif /* ifndef GAMMA */
-
-/*
- * Adds a new VM option with the given given name and value.
- */
-static void
-AddOption(char *str, void *info)
-{
-    /*
-     * Expand options array if needed to accommodate at least one more
-     * VM option.
-     */
-    if (numOptions >= maxOptions) {
-        if (options == 0) {
-            maxOptions = 4;
-            options = MemAlloc(maxOptions * sizeof(JavaVMOption));
-        } else {
-            JavaVMOption *tmp;
-            maxOptions *= 2;
-            tmp = MemAlloc(maxOptions * sizeof(JavaVMOption));
-            memcpy(tmp, options, numOptions * sizeof(JavaVMOption));
-            free(options);
-            options = tmp;
-        }
-    }
-    options[numOptions].optionString = str;
-    options[numOptions++].extraInfo = info;
-}
-
-static void
-SetClassPath(char *s)
-{
-    char *def = MemAlloc(strlen(s) + 40);
-    sprintf(def, "-Djava.class.path=%s", s);
-    AddOption(def, NULL);
-}
-
-#ifndef GAMMA
-/*
- * The SelectVersion() routine ensures that an appropriate version of
- * the JRE is running.  The specification for the appropriate version
- * is obtained from either the manifest of a jar file (preferred) or
- * from command line options.
- */
-static void
-SelectVersion(int argc, char **argv, char **main_class)
-{
-    char    *arg;
-    char    **new_argv;
-    char    **new_argp;
-    char    *operand;
-    char    *version = NULL;
-    char    *jre = NULL;
-    int     jarflag = 0;
-    int     restrict_search = -1;               /* -1 implies not known */
-    manifest_info info;
-    char    env_entry[MAXNAMELEN + 24] = ENV_ENTRY "=";
-    char    *env_in;
-    int     res;
-
-    /*
-     * If the version has already been selected, set *main_class
-     * with the value passed through the environment (if any) and
-     * simply return.
-     */
-    if ((env_in = getenv(ENV_ENTRY)) != NULL) {
-        if (*env_in != '\0')
-            *main_class = strdup(env_in);
-        return;
-    }
-
-    /*
-     * Scan through the arguments for options relevant to multiple JRE
-     * support.  For reference, the command line syntax is defined as:
-     *
-     * SYNOPSIS
-     *      java [options] class [argument...]
-     *
-     *      java [options] -jar file.jar [argument...]
-     *
-     * As the scan is performed, make a copy of the argument list with
-     * the version specification options (new to 1.5) removed, so that
-     * a version less than 1.5 can be exec'd.
-     */
-    new_argv = MemAlloc((argc + 1) * sizeof(char*));
-    new_argv[0] = argv[0];
-    new_argp = &new_argv[1];
-    argc--;
-    argv++;
-    while ((arg = *argv) != 0 && *arg == '-') {
-        if (strncmp(arg, "-version:", 9) == 0) {
-            version = arg + 9;
-        } else if (strcmp(arg, "-jre-restrict-search") == 0) {
-            restrict_search = 1;
-        } else if (strcmp(arg, "-no-jre-restrict-search") == 0) {
-            restrict_search = 0;
-        } else {
-            if (strcmp(arg, "-jar") == 0)
-                jarflag = 1;
-            /* deal with "unfortunate" classpath syntax */
-            if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) &&
-              (argc >= 2)) {
-                *new_argp++ = arg;
-                argc--;
-                argv++;
-                arg = *argv;
-            }
-            *new_argp++ = arg;
-        }
-        argc--;
-        argv++;
-    }
-    if (argc <= 0) {    /* No operand? Possibly legit with -[full]version */
-        operand = NULL;
-    } else {
-        argc--;
-        *new_argp++ = operand = *argv++;
-    }
-    while (argc-- > 0)  /* Copy over [argument...] */
-        *new_argp++ = *argv++;
-    *new_argp = NULL;
-
-    /*
-     * If there is a jar file, read the manifest. If the jarfile can't be
-     * read, the manifest can't be read from the jar file, or the manifest
-     * is corrupt, issue the appropriate error messages and exit.
-     *
-     * Even if there isn't a jar file, construct a manifest_info structure
-     * containing the command line information.  It's a convenient way to carry
-     * this data around.
-     */
-    if (jarflag && operand) {
-        if ((res = parse_manifest(operand, &info)) != 0) {
-            if (res == -1)
-                ReportErrorMessage2("Unable to access jarfile %s",
-                  operand, JNI_TRUE);
-            else
-                ReportErrorMessage2("Invalid or corrupt jarfile %s",
-                  operand, JNI_TRUE);
-            exit(1);
-        }
-    } else {
-        info.manifest_version = NULL;
-        info.main_class = NULL;
-        info.jre_version = NULL;
-        info.jre_restrict_search = 0;
-    }
-
-    /*
-     * The JRE-Version and JRE-Restrict-Search values (if any) from the
-     * manifest are overwritten by any specified on the command line.
-     */
-    if (version != NULL)
-        info.jre_version = version;
-    if (restrict_search != -1)
-        info.jre_restrict_search = restrict_search;
-
-    /*
-     * "Valid" returns (other than unrecoverable errors) follow.  Set
-     * main_class as a side-effect of this routine.
-     */
-    if (info.main_class != NULL)
-        *main_class = strdup(info.main_class);
-
-    /*
-     * If no version selection information is found either on the command
-     * line or in the manifest, simply return.
-     */
-    if (info.jre_version == NULL) {
-        free_manifest();
-        free(new_argv);
-        return;
-    }
-
-    /*
-     * Check for correct syntax of the version specification (JSR 56).
-     */
-    if (!valid_version_string(info.jre_version)) {
-        ReportErrorMessage2("Syntax error in version specification \"%s\"",
-          info.jre_version, JNI_TRUE);
-        exit(1);
-    }
-
-    /*
-     * Find the appropriate JVM on the system. Just to be as forgiving as
-     * possible, if the standard algorithms don't locate an appropriate
-     * jre, check to see if the one running will satisfy the requirements.
-     * This can happen on systems which haven't been set-up for multiple
-     * JRE support.
-     */
-    jre = LocateJRE(&info);
-    if (_launcher_debug)
-        printf("JRE-Version = %s, JRE-Restrict-Search = %s Selected = %s\n",
-          (info.jre_version?info.jre_version:"null"),
-          (info.jre_restrict_search?"true":"false"), (jre?jre:"null"));
-    if (jre == NULL) {
-        if (acceptable_release(FULL_VERSION, info.jre_version)) {
-            free_manifest();
-            free(new_argv);
-            return;
-        } else {
-            ReportErrorMessage2(
-              "Unable to locate JRE meeting specification \"%s\"",
-              info.jre_version, JNI_TRUE);
-            exit(1);
-        }
-    }
-
-    /*
-     * If I'm not the chosen one, exec the chosen one.  Returning from
-     * ExecJRE indicates that I am indeed the chosen one.
-     *
-     * The private environment variable _JAVA_VERSION_SET is used to
-     * prevent the chosen one from re-reading the manifest file and
-     * using the values found within to override the (potential) command
-     * line flags stripped from argv (because the target may not
-     * understand them).  Passing the MainClass value is an optimization
-     * to avoid locating, expanding and parsing the manifest extra
-     * times.
-     */
-    if (info.main_class != NULL)
-        (void)strcat(env_entry, info.main_class);
-    (void)putenv(env_entry);
-    ExecJRE(jre, new_argv);
-    free_manifest();
-    free(new_argv);
-    return;
-}
-#endif /* ifndef GAMMA */
-
-/*
- * Parses command line arguments.  Returns JNI_FALSE if launcher
- * should exit without starting vm (e.g. certain version and usage
- * options); returns JNI_TRUE if vm needs to be started to process
- * given options.  *pret (the launcher process return value) is set to
- * 0 for a normal exit.
- */
-static jboolean
-ParseArguments(int *pargc, char ***pargv, char **pjarfile,
-                       char **pclassname, int *pret)
-{
-    int argc = *pargc;
-    char **argv = *pargv;
-    jboolean jarflag = JNI_FALSE;
-    char *arg;
-
-    *pret = 1;
-    while ((arg = *argv) != 0 && *arg == '-') {
-        argv++; --argc;
-        if (strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) {
-            if (argc < 1) {
-                ReportErrorMessage2("%s requires class path specification",
-                                    arg, JNI_TRUE);
-                PrintUsage();
-                return JNI_FALSE;
-            }
-            SetClassPath(*argv);
-            argv++; --argc;
-        } else if (strcmp(arg, "-jar") == 0) {
-            jarflag = JNI_TRUE;
-        } else if (strcmp(arg, "-help") == 0 ||
-                   strcmp(arg, "-h") == 0 ||
-                   strcmp(arg, "-?") == 0) {
-            PrintUsage();
-            *pret = 0;
-            return JNI_FALSE;
-        } else if (strcmp(arg, "-version") == 0) {
-            printVersion = JNI_TRUE;
-            return JNI_TRUE;
-        } else if (strcmp(arg, "-showversion") == 0) {
-            showVersion = JNI_TRUE;
-        } else if (strcmp(arg, "-X") == 0) {
-            *pret = PrintXUsage();
-            return JNI_FALSE;
-/*
- * The following case provide backward compatibility with old-style
- * command line options.
- */
-        } else if (strcmp(arg, "-fullversion") == 0) {
-            fprintf(stderr, "%s full version \"%s\"\n", progname,
-                    FULL_VERSION);
-            *pret = 0;
-            return JNI_FALSE;
-        } else if (strcmp(arg, "-verbosegc") == 0) {
-            AddOption("-verbose:gc", NULL);
-        } else if (strcmp(arg, "-t") == 0) {
-            AddOption("-Xt", NULL);
-        } else if (strcmp(arg, "-tm") == 0) {
-            AddOption("-Xtm", NULL);
-        } else if (strcmp(arg, "-debug") == 0) {
-            AddOption("-Xdebug", NULL);
-        } else if (strcmp(arg, "-noclassgc") == 0) {
-            AddOption("-Xnoclassgc", NULL);
-        } else if (strcmp(arg, "-Xfuture") == 0) {
-            AddOption("-Xverify:all", NULL);
-        } else if (strcmp(arg, "-verify") == 0) {
-            AddOption("-Xverify:all", NULL);
-        } else if (strcmp(arg, "-verifyremote") == 0) {
-            AddOption("-Xverify:remote", NULL);
-        } else if (strcmp(arg, "-noverify") == 0) {
-            AddOption("-Xverify:none", NULL);
-        } else if (strcmp(arg, "-XXsuppressExitMessage") == 0) {
-            noExitErrorMessage = 1;
-        } else if (strncmp(arg, "-prof", 5) == 0) {
-            char *p = arg + 5;
-            char *tmp = MemAlloc(strlen(arg) + 50);
-            if (*p) {
-                sprintf(tmp, "-Xrunhprof:cpu=old,file=%s", p + 1);
-            } else {
-                sprintf(tmp, "-Xrunhprof:cpu=old,file=java.prof");
-            }
-            AddOption(tmp, NULL);
-        } else if (strncmp(arg, "-ss", 3) == 0 ||
-                   strncmp(arg, "-oss", 4) == 0 ||
-                   strncmp(arg, "-ms", 3) == 0 ||
-                   strncmp(arg, "-mx", 3) == 0) {
-            char *tmp = MemAlloc(strlen(arg) + 6);
-            sprintf(tmp, "-X%s", arg + 1); /* skip '-' */
-            AddOption(tmp, NULL);
-        } else if (strcmp(arg, "-checksource") == 0 ||
-                   strcmp(arg, "-cs") == 0 ||
-                   strcmp(arg, "-noasyncgc") == 0) {
-            /* No longer supported */
-            fprintf(stderr,
-                    "Warning: %s option is no longer supported.\n",
-                    arg);
-        } else if (strncmp(arg, "-version:", 9) == 0 ||
-                   strcmp(arg, "-no-jre-restrict-search") == 0 ||
-                   strcmp(arg, "-jre-restrict-search") == 0) {
-            ; /* Ignore machine independent options already handled */
-        } else if (RemovableMachineDependentOption(arg) ) {
-            ; /* Do not pass option to vm. */
-        }
-        else {
-            AddOption(arg, NULL);
-        }
-    }
-
-    if (--argc >= 0) {
-        if (jarflag) {
-            *pjarfile = *argv++;
-            *pclassname = 0;
-        } else {
-            *pjarfile = 0;
-            *pclassname = *argv++;
-        }
-        *pargc = argc;
-        *pargv = argv;
-    }
-
-    return JNI_TRUE;
-}
-
-/*
- * Initializes the Java Virtual Machine. Also frees options array when
- * finished.
- */
-static jboolean
-InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn)
-{
-    JavaVMInitArgs args;
-    jint r;
-
-    memset(&args, 0, sizeof(args));
-    args.version  = JNI_VERSION_1_2;
-    args.nOptions = numOptions;
-    args.options  = options;
-    args.ignoreUnrecognized = JNI_FALSE;
-
-    if (_launcher_debug) {
-        int i = 0;
-        printf("JavaVM args:\n    ");
-        printf("version 0x%08lx, ", (long)args.version);
-        printf("ignoreUnrecognized is %s, ",
-               args.ignoreUnrecognized ? "JNI_TRUE" : "JNI_FALSE");
-        printf("nOptions is %ld\n", (long)args.nOptions);
-        for (i = 0; i < numOptions; i++)
-            printf("    option[%2d] = '%s'\n",
-                   i, args.options[i].optionString);
-    }
-
-    r = ifn->CreateJavaVM(pvm, (void **)penv, &args);
-    free(options);
-    return r == JNI_OK;
-}
-
-
-#define NULL_CHECK0(e) if ((e) == 0) return 0
-#define NULL_CHECK(e) if ((e) == 0) return
-
-/*
- * Returns a pointer to a block of at least 'size' bytes of memory.
- * Prints error message and exits if the memory could not be allocated.
- */
-void *
-MemAlloc(size_t size)
-{
-    void *p = malloc(size);
-    if (p == 0) {
-        perror("malloc");
-        exit(1);
-    }
-    return p;
-}
-
-static jstring platformEncoding = NULL;
-static jstring getPlatformEncoding(JNIEnv *env) {
-    if (platformEncoding == NULL) {
-        jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding");
-        if (propname) {
-            jclass cls;
-            jmethodID mid;
-            NULL_CHECK0 (cls = FindBootStrapClass(env, "java/lang/System"));
-            NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
-                                   env, cls,
-                                   "getProperty",
-                                   "(Ljava/lang/String;)Ljava/lang/String;"));
-            platformEncoding = (*env)->CallStaticObjectMethod (
-                                    env, cls, mid, propname);
-        }
-    }
-    return platformEncoding;
-}
-
-static jboolean isEncodingSupported(JNIEnv *env, jstring enc) {
-    jclass cls;
-    jmethodID mid;
-    NULL_CHECK0 (cls = FindBootStrapClass(env, "java/nio/charset/Charset"));
-    NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
-                           env, cls,
-                           "isSupported",
-                           "(Ljava/lang/String;)Z"));
-    return (*env)->CallStaticBooleanMethod (env, cls, mid, enc);
-}
-
-/*
- * Returns a new Java string object for the specified platform string.
- */
-static jstring
-NewPlatformString(JNIEnv *env, char *s)
-{
-    int len = (int)strlen(s);
-    jclass cls;
-    jmethodID mid;
-    jbyteArray ary;
-    jstring enc;
-
-    if (s == NULL)
-        return 0;
-    enc = getPlatformEncoding(env);
-
-    ary = (*env)->NewByteArray(env, len);
-    if (ary != 0) {
-        jstring str = 0;
-        (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s);
-        if (!(*env)->ExceptionOccurred(env)) {
-#ifdef GAMMA
-            /* We support running JVM with older JDK, so here we have to deal */
-            /* with the case that sun.jnu.encoding is undefined (enc == NULL) */
-            if (enc != NULL && isEncodingSupported(env, enc) == JNI_TRUE) {
-#else
-            if (isEncodingSupported(env, enc) == JNI_TRUE) {
-#endif
-                NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
-                NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
-                                          "([BLjava/lang/String;)V"));
-                str = (*env)->NewObject(env, cls, mid, ary, enc);
-            } else {
-                /*If the encoding specified in sun.jnu.encoding is not
-                  endorsed by "Charset.isSupported" we have to fall back
-                  to use String(byte[]) explicitly here without specifying
-                  the encoding name, in which the StringCoding class will
-                  pickup the iso-8859-1 as the fallback converter for us.
-                */
-                NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
-                NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
-                                          "([B)V"));
-                str = (*env)->NewObject(env, cls, mid, ary);
-            }
-            (*env)->DeleteLocalRef(env, ary);
-            return str;
-        }
-    }
-    return 0;
-}
-
-/*
- * Returns a new array of Java string objects for the specified
- * array of platform strings.
- */
-static jobjectArray
-NewPlatformStringArray(JNIEnv *env, char **strv, int strc)
-{
-    jarray cls;
-    jarray ary;
-    int i;
-
-    NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
-    NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0));
-    for (i = 0; i < strc; i++) {
-        jstring str = NewPlatformString(env, *strv++);
-        NULL_CHECK0(str);
-        (*env)->SetObjectArrayElement(env, ary, i, str);
-        (*env)->DeleteLocalRef(env, str);
-    }
-    return ary;
-}
-
-/*
- * Loads a class, convert the '.' to '/'.
- */
-static jclass
-LoadClass(JNIEnv *env, char *name)
-{
-    char *buf = MemAlloc(strlen(name) + 1);
-    char *s = buf, *t = name, c;
-    jclass cls;
-    jlong start, end;
-
-    if (_launcher_debug)
-        start = CounterGet();
-
-    do {
-        c = *t++;
-        *s++ = (c == '.') ? '/' : c;
-    } while (c != '\0');
-    // use the application class loader for main-class
-    cls = (*env)->FindClass(env, buf);
-    free(buf);
-
-    if (_launcher_debug) {
-        end   = CounterGet();
-        printf("%ld micro seconds to load main class\n",
-               (long)(jint)Counter2Micros(end-start));
-        printf("----_JAVA_LAUNCHER_DEBUG----\n");
-    }
-
-    return cls;
-}
-
-
-/*
- * Returns the main class name for the specified jar file.
- */
-static jstring
-GetMainClassName(JNIEnv *env, char *jarname)
-{
-#define MAIN_CLASS "Main-Class"
-    jclass cls;
-    jmethodID mid;
-    jobject jar, man, attr;
-    jstring str, result = 0;
-
-    NULL_CHECK0(cls = FindBootStrapClass(env, "java/util/jar/JarFile"));
-    NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
-                                          "(Ljava/lang/String;)V"));
-    NULL_CHECK0(str = NewPlatformString(env, jarname));
-    NULL_CHECK0(jar = (*env)->NewObject(env, cls, mid, str));
-    NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "getManifest",
-                                          "()Ljava/util/jar/Manifest;"));
-    man = (*env)->CallObjectMethod(env, jar, mid);
-    if (man != 0) {
-        NULL_CHECK0(mid = (*env)->GetMethodID(env,
-                                    (*env)->GetObjectClass(env, man),
-                                    "getMainAttributes",
-                                    "()Ljava/util/jar/Attributes;"));
-        attr = (*env)->CallObjectMethod(env, man, mid);
-        if (attr != 0) {
-            NULL_CHECK0(mid = (*env)->GetMethodID(env,
-                                    (*env)->GetObjectClass(env, attr),
-                                    "getValue",
-                                    "(Ljava/lang/String;)Ljava/lang/String;"));
-            NULL_CHECK0(str = NewPlatformString(env, MAIN_CLASS));
-            result = (*env)->CallObjectMethod(env, attr, mid, str);
-        }
-    }
-    return result;
-}
-
-#ifdef JAVA_ARGS
-static char *java_args[] = JAVA_ARGS;
-static char *app_classpath[] = APP_CLASSPATH;
-
-/*
- * For tools convert 'javac -J-ms32m' to 'java -ms32m ...'
- */
-static void
-TranslateDashJArgs(int *pargc, char ***pargv)
-{
-    const int NUM_ARGS = (sizeof(java_args) / sizeof(char *));
-    int argc = *pargc;
-    char **argv = *pargv;
-    int nargc = argc + NUM_ARGS;
-    char **nargv = MemAlloc((nargc + 1) * sizeof(char *));
-    int i;
-
-    *pargc = nargc;
-    *pargv = nargv;
-
-    /* Copy the VM arguments (i.e. prefixed with -J) */
-    for (i = 0; i < NUM_ARGS; i++) {
-        char *arg = java_args[i];
-        if (arg[0] == '-' && arg[1] == 'J') {
-            *nargv++ = arg + 2;
-        }
-    }
-
-    for (i = 0; i < argc; i++) {
-        char *arg = argv[i];
-        if (arg[0] == '-' && arg[1] == 'J') {
-            if (arg[2] == '\0') {
-                ReportErrorMessage("Error: the -J option should not be "
-                                   "followed by a space.", JNI_TRUE);
-                exit(1);
-            }
-            *nargv++ = arg + 2;
-        }
-    }
-
-    /* Copy the rest of the arguments */
-    for (i = 0; i < NUM_ARGS; i++) {
-        char *arg = java_args[i];
-        if (arg[0] != '-' || arg[1] != 'J') {
-            *nargv++ = arg;
-        }
-    }
-    for (i = 0; i < argc; i++) {
-        char *arg = argv[i];
-        if (arg[0] != '-' || arg[1] != 'J') {
-            *nargv++ = arg;
-        }
-    }
-    *nargv = 0;
-}
-
-/*
- * For our tools, we try to add 3 VM options:
- *      -Denv.class.path=<envcp>
- *      -Dapplication.home=<apphome>
- *      -Djava.class.path=<appcp>
- * <envcp>   is the user's setting of CLASSPATH -- for instance the user
- *           tells javac where to find binary classes through this environment
- *           variable.  Notice that users will be able to compile against our
- *           tools classes (sun.tools.javac.Main) only if they explicitly add
- *           tools.jar to CLASSPATH.
- * <apphome> is the directory where the application is installed.
- * <appcp>   is the classpath to where our apps' classfiles are.
- */
-static jboolean
-AddApplicationOptions()
-{
-    const int NUM_APP_CLASSPATH = (sizeof(app_classpath) / sizeof(char *));
-    char *s, *envcp, *appcp, *apphome;
-    char home[MAXPATHLEN]; /* application home */
-    char separator[] = { PATH_SEPARATOR, '\0' };
-    int size, i;
-    int strlenHome;
-
-    s = getenv("CLASSPATH");
-    if (s) {
-        /* 40 for -Denv.class.path= */
-        envcp = (char *)MemAlloc(strlen(s) + 40);
-        sprintf(envcp, "-Denv.class.path=%s", s);
-        AddOption(envcp, NULL);
-    }
-
-    if (!GetApplicationHome(home, sizeof(home))) {
-        ReportErrorMessage("Can't determine application home", JNI_TRUE);
-        return JNI_FALSE;
-    }
-
-    /* 40 for '-Dapplication.home=' */
-    apphome = (char *)MemAlloc(strlen(home) + 40);
-    sprintf(apphome, "-Dapplication.home=%s", home);
-    AddOption(apphome, NULL);
-
-    /* How big is the application's classpath? */
-    size = 40;                                 /* 40: "-Djava.class.path=" */
-    strlenHome = (int)strlen(home);
-    for (i = 0; i < NUM_APP_CLASSPATH; i++) {
-        size += strlenHome + (int)strlen(app_classpath[i]) + 1; /* 1: separator */
-    }
-    appcp = (char *)MemAlloc(size + 1);
-    strcpy(appcp, "-Djava.class.path=");
-    for (i = 0; i < NUM_APP_CLASSPATH; i++) {
-        strcat(appcp, home);                    /* c:\program files\myapp */
-        strcat(appcp, app_classpath[i]);        /* \lib\myapp.jar         */
-        strcat(appcp, separator);               /* ;                      */
-    }
-    appcp[strlen(appcp)-1] = '\0';  /* remove trailing path separator */
-    AddOption(appcp, NULL);
-    return JNI_TRUE;
-}
-#endif
-
-/*
- * inject the -Dsun.java.command pseudo property into the args structure
- * this pseudo property is used in the HotSpot VM to expose the
- * Java class name and arguments to the main method to the VM. The
- * HotSpot VM uses this pseudo property to store the Java class name
- * (or jar file name) and the arguments to the class's main method
- * to the instrumentation memory region. The sun.java.command pseudo
- * property is not exported by HotSpot to the Java layer.
- */
-void
-SetJavaCommandLineProp(char *classname, char *jarfile,
-                       int argc, char **argv)
-{
-
-    int i = 0;
-    size_t len = 0;
-    char* javaCommand = NULL;
-    char* dashDstr = "-Dsun.java.command=";
-
-    if (classname == NULL && jarfile == NULL) {
-        /* unexpected, one of these should be set. just return without
-         * setting the property
-         */
-        return;
-    }
-
-    /* if the class name is not set, then use the jarfile name */
-    if (classname == NULL) {
-        classname = jarfile;
-    }
-
-    /* determine the amount of memory to allocate assuming
-     * the individual components will be space separated
-     */
-    len = strlen(classname);
-    for (i = 0; i < argc; i++) {
-        len += strlen(argv[i]) + 1;
-    }
-
-    /* allocate the memory */
-    javaCommand = (char*) MemAlloc(len + strlen(dashDstr) + 1);
-
-    /* build the -D string */
-    *javaCommand = '\0';
-    strcat(javaCommand, dashDstr);
-    strcat(javaCommand, classname);
-
-    for (i = 0; i < argc; i++) {
-        /* the components of the string are space separated. In
-         * the case of embedded white space, the relationship of
-         * the white space separated components to their true
-         * positional arguments will be ambiguous. This issue may
-         * be addressed in a future release.
-         */
-        strcat(javaCommand, " ");
-        strcat(javaCommand, argv[i]);
-    }
-
-    AddOption(javaCommand, NULL);
-}
-
-/*
- * JVM wants to know launcher type, so tell it.
- */
-#ifdef GAMMA
-void SetJavaLauncherProp() {
-  AddOption("-Dsun.java.launcher=" LAUNCHER_TYPE, NULL);
-}
-#endif
-
-/*
- * Prints the version information from the java.version and other properties.
- */
-static void
-PrintJavaVersion(JNIEnv *env)
-{
-    jclass ver;
-    jmethodID print;
-
-    NULL_CHECK(ver = FindBootStrapClass(env, "sun/misc/Version"));
-    NULL_CHECK(print = (*env)->GetStaticMethodID(env, ver, "print", "()V"));
-
-    (*env)->CallStaticVoidMethod(env, ver, print);
-}
-
-/*
- * Prints default usage message.
- */
-static void
-PrintUsage(void)
-{
-    int i;
-
-    fprintf(stdout,
-        "Usage: %s [-options] class [args...]\n"
-        "           (to execute a class)\n"
-        "   or  %s [-options] -jar jarfile [args...]\n"
-        "           (to execute a jar file)\n"
-        "\n"
-        "where options include:\n",
-        progname,
-        progname);
-
-#ifndef GAMMA
-    PrintMachineDependentOptions();
-
-    if ((knownVMs[0].flag == VM_KNOWN) ||
-        (knownVMs[0].flag == VM_IF_SERVER_CLASS)) {
-      fprintf(stdout, "    %s\t  to select the \"%s\" VM\n",
-              knownVMs[0].name, knownVMs[0].name+1);
-    }
-    for (i=1; i<knownVMsCount; i++) {
-        if (knownVMs[i].flag == VM_KNOWN)
-            fprintf(stdout, "    %s\t  to select the \"%s\" VM\n",
-                    knownVMs[i].name, knownVMs[i].name+1);
-    }
-    for (i=1; i<knownVMsCount; i++) {
-        if (knownVMs[i].flag == VM_ALIASED_TO)
-            fprintf(stdout, "    %s\t  is a synonym for "
-                    "the \"%s\" VM  [deprecated]\n",
-                    knownVMs[i].name, knownVMs[i].alias+1);
-    }
-
-    /* The first known VM is the default */
-    {
-      const char* defaultVM   = knownVMs[0].name+1;
-      const char* punctuation = ".";
-      const char* reason      = "";
-      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
-          (ServerClassMachine() == JNI_TRUE)) {
-        defaultVM = knownVMs[0].server_class+1;
-        punctuation = ", ";
-        reason = "because you are running on a server-class machine.\n";
-      }
-      fprintf(stdout, "                  The default VM is %s%s\n",
-              defaultVM, punctuation);
-      fprintf(stdout, "                  %s\n",
-              reason);
-    }
-#endif /* ifndef GAMMA */
-
-    fprintf(stdout,
-"    -cp <class search path of directories and zip/jar files>\n"
-"    -classpath <class search path of directories and zip/jar files>\n"
-"                  A %c separated list of directories, JAR archives,\n"
-"                  and ZIP archives to search for class files.\n"
-"    -D<name>=<value>\n"
-"                  set a system property\n"
-"    -verbose[:class|gc|jni]\n"
-"                  enable verbose output\n"
-"    -version      print product version and exit\n"
-"    -version:<value>\n"
-"                  require the specified version to run\n"
-"    -showversion  print product version and continue\n"
-"    -jre-restrict-search | -jre-no-restrict-search\n"
-"                  include/exclude user private JREs in the version search\n"
-"    -? -help      print this help message\n"
-"    -X            print help on non-standard options\n"
-"    -ea[:<packagename>...|:<classname>]\n"
-"    -enableassertions[:<packagename>...|:<classname>]\n"
-"                  enable assertions\n"
-"    -da[:<packagename>...|:<classname>]\n"
-"    -disableassertions[:<packagename>...|:<classname>]\n"
-"                  disable assertions\n"
-"    -esa | -enablesystemassertions\n"
-"                  enable system assertions\n"
-"    -dsa | -disablesystemassertions\n"
-"                  disable system assertions\n"
-"    -agentlib:<libname>[=<options>]\n"
-"                  load native agent library <libname>, e.g. -agentlib:hprof\n"
-"                    see also, -agentlib:jdwp=help and -agentlib:hprof=help\n"
-"    -agentpath:<pathname>[=<options>]\n"
-"                  load native agent library by full pathname\n"
-"    -javaagent:<jarpath>[=<options>]\n"
-"                  load Java programming language agent, see java.lang.instrument\n"
-
-            ,PATH_SEPARATOR);
-}
-
-/*
- * Print usage message for -X options.
- */
-static jint
-PrintXUsage(void)
-{
-    char path[MAXPATHLEN];
-    char buf[128];
-    size_t n;
-    FILE *fp;
-
-    GetXUsagePath(path, sizeof(path));
-    fp = fopen(path, "r");
-    if (fp == 0) {
-        fprintf(stderr, "Can't open %s\n", path);
-        return 1;
-    }
-    while ((n = fread(buf, 1, sizeof(buf), fp)) != 0) {
-        fwrite(buf, 1, n, stdout);
-    }
-    fclose(fp);
-    return 0;
-}
-
-#ifndef GAMMA
-
-/*
- * Read the jvm.cfg file and fill the knownJVMs[] array.
- *
- * The functionality of the jvm.cfg file is subject to change without
- * notice and the mechanism will be removed in the future.
- *
- * The lexical structure of the jvm.cfg file is as follows:
- *
- *     jvmcfg         :=  { vmLine }
- *     vmLine         :=  knownLine
- *                    |   aliasLine
- *                    |   warnLine
- *                    |   ignoreLine
- *                    |   errorLine
- *                    |   predicateLine
- *                    |   commentLine
- *     knownLine      :=  flag  "KNOWN"                  EOL
- *     warnLine       :=  flag  "WARN"                   EOL
- *     ignoreLine     :=  flag  "IGNORE"                 EOL
- *     errorLine      :=  flag  "ERROR"                  EOL
- *     aliasLine      :=  flag  "ALIASED_TO"       flag  EOL
- *     predicateLine  :=  flag  "IF_SERVER_CLASS"  flag  EOL
- *     commentLine    :=  "#" text                       EOL
- *     flag           :=  "-" identifier
- *
- * The semantics are that when someone specifies a flag on the command line:
- * - if the flag appears on a knownLine, then the identifier is used as
- *   the name of the directory holding the JVM library (the name of the JVM).
- * - if the flag appears as the first flag on an aliasLine, the identifier
- *   of the second flag is used as the name of the JVM.
- * - if the flag appears on a warnLine, the identifier is used as the
- *   name of the JVM, but a warning is generated.
- * - if the flag appears on an ignoreLine, the identifier is recognized as the
- *   name of a JVM, but the identifier is ignored and the default vm used
- * - if the flag appears on an errorLine, an error is generated.
- * - if the flag appears as the first flag on a predicateLine, and
- *   the machine on which you are running passes the predicate indicated,
- *   then the identifier of the second flag is used as the name of the JVM,
- *   otherwise the identifier of the first flag is used as the name of the JVM.
- * If no flag is given on the command line, the first vmLine of the jvm.cfg
- * file determines the name of the JVM.
- * PredicateLines are only interpreted on first vmLine of a jvm.cfg file,
- * since they only make sense if someone hasn't specified the name of the
- * JVM on the command line.
- *
- * The intent of the jvm.cfg file is to allow several JVM libraries to
- * be installed in different subdirectories of a single JRE installation,
- * for space-savings and convenience in testing.
- * The intent is explicitly not to provide a full aliasing or predicate
- * mechanism.
- */
-jint
-ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative)
-{
-    FILE *jvmCfg;
-    char jvmCfgName[MAXPATHLEN+20];
-    char line[MAXPATHLEN+20];
-    int cnt = 0;
-    int lineno = 0;
-    jlong start, end;
-    int vmType;
-    char *tmpPtr;
-    char *altVMName;
-    char *serverClassVMName;
-    static char *whiteSpace = " \t";
-    if (_launcher_debug) {
-        start = CounterGet();
-    }
-
-    strcpy(jvmCfgName, jrepath);
-    strcat(jvmCfgName, FILESEP "lib" FILESEP);
-    strcat(jvmCfgName, arch);
-    strcat(jvmCfgName, FILESEP "jvm.cfg");
-
-    jvmCfg = fopen(jvmCfgName, "r");
-    if (jvmCfg == NULL) {
-      if (!speculative) {
-        ReportErrorMessage2("Error: could not open `%s'", jvmCfgName,
-                            JNI_TRUE);
-        exit(1);
-      } else {
-        return -1;
-      }
-    }
-    while (fgets(line, sizeof(line), jvmCfg) != NULL) {
-        vmType = VM_UNKNOWN;
-        lineno++;
-        if (line[0] == '#')
-            continue;
-        if (line[0] != '-') {
-            fprintf(stderr, "Warning: no leading - on line %d of `%s'\n",
-                    lineno, jvmCfgName);
-        }
-        if (cnt >= knownVMsLimit) {
-            GrowKnownVMs(cnt);
-        }
-        line[strlen(line)-1] = '\0'; /* remove trailing newline */
-        tmpPtr = line + strcspn(line, whiteSpace);
-        if (*tmpPtr == 0) {
-            fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
-                    lineno, jvmCfgName);
-        } else {
-            /* Null-terminate this string for strdup below */
-            *tmpPtr++ = 0;
-            tmpPtr += strspn(tmpPtr, whiteSpace);
-            if (*tmpPtr == 0) {
-                fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
-                        lineno, jvmCfgName);
-            } else {
-                if (!strncmp(tmpPtr, "KNOWN", strlen("KNOWN"))) {
-                    vmType = VM_KNOWN;
-                } else if (!strncmp(tmpPtr, "ALIASED_TO", strlen("ALIASED_TO"))) {
-                    tmpPtr += strcspn(tmpPtr, whiteSpace);
-                    if (*tmpPtr != 0) {
-                        tmpPtr += strspn(tmpPtr, whiteSpace);
-                    }
-                    if (*tmpPtr == 0) {
-                        fprintf(stderr, "Warning: missing VM alias on line %d of `%s'\n",
-                                lineno, jvmCfgName);
-                    } else {
-                        /* Null terminate altVMName */
-                        altVMName = tmpPtr;
-                        tmpPtr += strcspn(tmpPtr, whiteSpace);
-                        *tmpPtr = 0;
-                        vmType = VM_ALIASED_TO;
-                    }
-                } else if (!strncmp(tmpPtr, "WARN", strlen("WARN"))) {
-                    vmType = VM_WARN;
-                } else if (!strncmp(tmpPtr, "IGNORE", strlen("IGNORE"))) {
-                    vmType = VM_IGNORE;
-                } else if (!strncmp(tmpPtr, "ERROR", strlen("ERROR"))) {
-                    vmType = VM_ERROR;
-                } else if (!strncmp(tmpPtr,
-                                    "IF_SERVER_CLASS",
-                                    strlen("IF_SERVER_CLASS"))) {
-                    tmpPtr += strcspn(tmpPtr, whiteSpace);
-                    if (*tmpPtr != 0) {
-                        tmpPtr += strspn(tmpPtr, whiteSpace);
-                    }
-                    if (*tmpPtr == 0) {
-                        fprintf(stderr, "Warning: missing server class VM on line %d of `%s'\n",
-                                lineno, jvmCfgName);
-                    } else {
-                        /* Null terminate server class VM name */
-                        serverClassVMName = tmpPtr;
-                        tmpPtr += strcspn(tmpPtr, whiteSpace);
-                        *tmpPtr = 0;
-                        vmType = VM_IF_SERVER_CLASS;
-                    }
-                } else {
-                    fprintf(stderr, "Warning: unknown VM type on line %d of `%s'\n",
-                            lineno, &jvmCfgName[0]);
-                    vmType = VM_KNOWN;
-                }
-            }
-        }
-
-        if (_launcher_debug)
-            printf("jvm.cfg[%d] = ->%s<-\n", cnt, line);
-        if (vmType != VM_UNKNOWN) {
-            knownVMs[cnt].name = strdup(line);
-            knownVMs[cnt].flag = vmType;
-            switch (vmType) {
-            default:
-                break;
-            case VM_ALIASED_TO:
-                knownVMs[cnt].alias = strdup(altVMName);
-                if (_launcher_debug) {
-                    printf("    name: %s  vmType: %s  alias: %s\n",
-                           knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias);
-                }
-                break;
-            case VM_IF_SERVER_CLASS:
-                knownVMs[cnt].server_class = strdup(serverClassVMName);
-                if (_launcher_debug) {
-                    printf("    name: %s  vmType: %s  server_class: %s\n",
-                           knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class);
-                }
-                break;
-            }
-            cnt++;
-        }
-    }
-    fclose(jvmCfg);
-    knownVMsCount = cnt;
-
-    if (_launcher_debug) {
-        end   = CounterGet();
-        printf("%ld micro seconds to parse jvm.cfg\n",
-               (long)(jint)Counter2Micros(end-start));
-    }
-
-    return cnt;
-}
-
-
-static void
-GrowKnownVMs(int minimum)
-{
-    struct vmdesc* newKnownVMs;
-    int newMax;
-
-    newMax = (knownVMsLimit == 0 ? INIT_MAX_KNOWN_VMS : (2 * knownVMsLimit));
-    if (newMax <= minimum) {
-        newMax = minimum;
-    }
-    newKnownVMs = (struct vmdesc*) MemAlloc(newMax * sizeof(struct vmdesc));
-    if (knownVMs != NULL) {
-        memcpy(newKnownVMs, knownVMs, knownVMsLimit * sizeof(struct vmdesc));
-    }
-    free(knownVMs);
-    knownVMs = newKnownVMs;
-    knownVMsLimit = newMax;
-}
-
-
-/* Returns index of VM or -1 if not found */
-static int
-KnownVMIndex(const char* name)
-{
-    int i;
-    if (strncmp(name, "-J", 2) == 0) name += 2;
-    for (i = 0; i < knownVMsCount; i++) {
-        if (!strcmp(name, knownVMs[i].name)) {
-            return i;
-        }
-    }
-    return -1;
-}
-
-static void
-FreeKnownVMs()
-{
-    int i;
-    for (i = 0; i < knownVMsCount; i++) {
-        free(knownVMs[i].name);
-        knownVMs[i].name = NULL;
-    }
-    free(knownVMs);
-}
-
-#endif /* ifndef GAMMA */
--- a/src/os/linux/launcher/java.h	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#ifndef _JAVA_H_
-#define _JAVA_H_
-
-/*
- * Get system specific defines.
- */
-#include "jni.h"
-#include "java_md.h"
-
-/*
- * Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
- */
-typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
-typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
-
-typedef struct {
-    CreateJavaVM_t CreateJavaVM;
-    GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs;
-} InvocationFunctions;
-
-/*
- * Prototypes for launcher functions in the system specific java_md.c.
- */
-
-jboolean
-LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn);
-
-void
-GetXUsagePath(char *buf, jint bufsize);
-
-jboolean
-GetApplicationHome(char *buf, jint bufsize);
-
-const char *
-GetArch();
-
-void CreateExecutionEnvironment(int *_argc,
-                                       char ***_argv,
-                                       char jrepath[],
-                                       jint so_jrepath,
-                                       char jvmpath[],
-                                       jint so_jvmpath,
-                                       char **original_argv);
-
-/*
- * Report an error message to stderr or a window as appropriate.  The
- * flag always is set to JNI_TRUE if message is to be reported to both
- * strerr and windows and set to JNI_FALSE if the message should only
- * be sent to a window.
- */
-void ReportErrorMessage(char * message, jboolean always);
-void ReportErrorMessage2(char * format, char * string, jboolean always);
-
-/*
- * Report an exception which terminates the vm to stderr or a window
- * as appropriate.
- */
-void ReportExceptionDescription(JNIEnv * env);
-
-jboolean RemovableMachineDependentOption(char * option);
-void PrintMachineDependentOptions();
-
-/*
- * Functions defined in java.c and used in java_md.c.
- */
-jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative);
-char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
-void* MemAlloc(size_t size);
-
-/*
- * Make launcher spit debug output.
- */
-extern jboolean _launcher_debug;
-/*
- * This allows for finding classes from the VM's bootstrap class loader
- * directly, FindClass uses the application class loader internally, this will
- * cause unnecessary searching of the classpath for the required classes.
- */
-typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env,
-                                                const char *name,
-                                                jboolean throwError));
-
-jclass FindBootStrapClass(JNIEnv *env, const char *classname);
-
-#endif /* _JAVA_H_ */
--- a/src/os/linux/launcher/java_md.c	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1852 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#include "java.h"
-#include <dirent.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#ifndef GAMMA
-#include "manifest_info.h"
-#include "version_comp.h"
-#endif
-
-#define JVM_DLL "libjvm.so"
-#define JAVA_DLL "libjava.so"
-
-#ifndef GAMMA   /* launcher.make defines ARCH */
-
-/*
- * If a processor / os combination has the ability to run binaries of
- * two data models and cohabitation of jre/jdk bits with both data
- * models is supported, then DUAL_MODE is defined.  When DUAL_MODE is
- * defined, the architecture names for the narrow and wide version of
- * the architecture are defined in BIG_ARCH and SMALL_ARCH.  Currently
- * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux
- * i586/amd64 could be defined as DUAL_MODE but that is not the
- * current policy.
- */
-
-#ifdef _LP64
-
-#  ifdef ia64
-#    define ARCH "ia64"
-#  elif defined(amd64)
-#    define ARCH "amd64"
-#  elif defined(__sparc)
-#    define ARCH "sparcv9"
-#  else
-#    define ARCH "unknown" /* unknown 64-bit architecture */
-#  endif
-
-#else /* 32-bit data model */
-
-#  ifdef i586
-#    define ARCH "i386"
-#  elif defined(__sparc)
-#    define ARCH "sparc"
-#  elif defined(arm)
-#    define ARCH "arm"
-#  elif defined(PPC)
-#    define ARCH "ppc"
-#  endif
-
-#endif /* _LP64 */
-
-#ifdef __sun
-#  define DUAL_MODE
-#  ifdef __sparc
-#    define BIG_ARCH "sparcv9"
-#    define SMALL_ARCH "sparc"
-#  else
-#    define BIG_ARCH "amd64"
-#    define SMALL_ARCH "i386"
-#  endif
-#  include <sys/systeminfo.h>
-#  include <sys/elf.h>
-#  include <stdio.h>
-#else
-#  ifndef ARCH
-#    include <sys/systeminfo.h>
-#  endif
-#endif
-
-#endif /* ifndef GAMMA */
-
-/* pointer to environment */
-extern char **environ;
-
-#ifndef GAMMA
-
-/*
- *      A collection of useful strings. One should think of these as #define
- *      entries, but actual strings can be more efficient (with many compilers).
- */
-#ifdef __linux__
-static const char *system_dir   = "/usr/java";
-static const char *user_dir     = "/java";
-#else /* Solaris */
-static const char *system_dir   = "/usr/jdk";
-static const char *user_dir     = "/jdk";
-#endif
-
-#endif  /* ifndef GAMMA */
-
-/*
- * Flowchart of launcher execs and options processing on unix
- *
- * The selection of the proper vm shared library to open depends on
- * several classes of command line options, including vm "flavor"
- * options (-client, -server) and the data model options, -d32  and
- * -d64, as well as a version specification which may have come from
- * the command line or from the manifest of an executable jar file.
- * The vm selection options are not passed to the running
- * virtual machine; they must be screened out by the launcher.
- *
- * The version specification (if any) is processed first by the
- * platform independent routine SelectVersion.  This may result in
- * the exec of the specified launcher version.
- *
- * Typically, the launcher execs at least once to ensure a suitable
- * LD_LIBRARY_PATH is in effect for the process.  The first exec
- * screens out all the data model options; leaving the choice of data
- * model implicit in the binary selected to run.  However, in case no
- * exec is done, the data model options are screened out before the vm
- * is invoked.
- *
- *  incoming argv ------------------------------
- *  |                                          |
- * \|/                                         |
- * CheckJVMType                                |
- * (removes -client, -server, etc.)            |
- *                                            \|/
- *                                            CreateExecutionEnvironment
- *                                            (removes -d32 and -d64,
- *                                             determines desired data model,
- *                                             sets up LD_LIBRARY_PATH,
- *                                             and exec's)
- *                                             |
- *  --------------------------------------------
- *  |
- * \|/
- * exec child 1 incoming argv -----------------
- *  |                                          |
- * \|/                                         |
- * CheckJVMType                                |
- * (removes -client, -server, etc.)            |
- *  |                                         \|/
- *  |                                          CreateExecutionEnvironment
- *  |                                          (verifies desired data model
- *  |                                           is running and acceptable
- *  |                                           LD_LIBRARY_PATH;
- *  |                                           no-op in child)
- *  |
- * \|/
- * TranslateDashJArgs...
- * (Prepare to pass args to vm)
- *  |
- *  |
- *  |
- * \|/
- * ParseArguments
- * (ignores -d32 and -d64,
- *  processes version options,
- *  creates argument list for vm,
- *  etc.)
- *
- */
-
-static char *SetExecname(char **argv);
-static char * GetExecname();
-static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
-                           char *jvmpath, jint jvmpathsize, char * arch);
-static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative);
-
-const char *
-GetArch()
-{
-    static char *arch = NULL;
-    static char buf[12];
-    if (arch) {
-        return arch;
-    }
-
-#ifdef ARCH
-    strcpy(buf, ARCH);
-#else
-    sysinfo(SI_ARCHITECTURE, buf, sizeof(buf));
-#endif
-    arch = buf;
-    return arch;
-}
-
-void
-CreateExecutionEnvironment(int *_argcp,
-                           char ***_argvp,
-                           char jrepath[],
-                           jint so_jrepath,
-                           char jvmpath[],
-                           jint so_jvmpath,
-                           char **original_argv) {
-  /*
-   * First, determine if we are running the desired data model.  If we
-   * are running the desired data model, all the error messages
-   * associated with calling GetJREPath, ReadKnownVMs, etc. should be
-   * output.  However, if we are not running the desired data model,
-   * some of the errors should be suppressed since it is more
-   * informative to issue an error message based on whether or not the
-   * os/processor combination has dual mode capabilities.
-   */
-
-    char *execname = NULL;
-    int original_argc = *_argcp;
-    jboolean jvmpathExists;
-
-    /* Compute the name of the executable */
-    execname = SetExecname(*_argvp);
-
-#ifndef GAMMA
-    /* Set the LD_LIBRARY_PATH environment variable, check data model
-       flags, and exec process, if needed */
-    {
-      char *arch        = (char *)GetArch(); /* like sparc or sparcv9 */
-      char * jvmtype    = NULL;
-      int argc          = *_argcp;
-      char **argv       = original_argv;
-
-      char *runpath     = NULL; /* existing effective LD_LIBRARY_PATH
-                                   setting */
-
-      int running       =       /* What data model is being ILP32 =>
-                                   32 bit vm; LP64 => 64 bit vm */
-#ifdef _LP64
-        64;
-#else
-      32;
-#endif
-
-      int wanted        = running;      /* What data mode is being
-                                           asked for? Current model is
-                                           fine unless another model
-                                           is asked for */
-
-      char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */
-      char* newpath     = NULL; /* path on new LD_LIBRARY_PATH */
-      char* lastslash   = NULL;
-
-      char** newenvp    = NULL; /* current environment */
-
-      char** newargv    = NULL;
-      int    newargc    = 0;
-#ifdef __sun
-      char*  dmpath     = NULL;  /* data model specific LD_LIBRARY_PATH,
-                                    Solaris only */
-#endif
-
-      /*
-       * Starting in 1.5, all unix platforms accept the -d32 and -d64
-       * options.  On platforms where only one data-model is supported
-       * (e.g. ia-64 Linux), using the flag for the other data model is
-       * an error and will terminate the program.
-       */
-
-      { /* open new scope to declare local variables */
-        int i;
-
-        newargv = (char **)MemAlloc((argc+1) * sizeof(*newargv));
-        newargv[newargc++] = argv[0];
-
-        /* scan for data model arguments and remove from argument list;
-           last occurrence determines desired data model */
-        for (i=1; i < argc; i++) {
-
-          if (strcmp(argv[i], "-J-d64") == 0 || strcmp(argv[i], "-d64") == 0) {
-            wanted = 64;
-            continue;
-          }
-          if (strcmp(argv[i], "-J-d32") == 0 || strcmp(argv[i], "-d32") == 0) {
-            wanted = 32;
-            continue;
-          }
-          newargv[newargc++] = argv[i];
-
-#ifdef JAVA_ARGS
-          if (argv[i][0] != '-')
-            continue;
-#else
-          if (strcmp(argv[i], "-classpath") == 0 || strcmp(argv[i], "-cp") == 0) {
-            i++;
-            if (i >= argc) break;
-            newargv[newargc++] = argv[i];
-            continue;
-          }
-          if (argv[i][0] != '-') { i++; break; }
-#endif
-        }
-
-        /* copy rest of args [i .. argc) */
-        while (i < argc) {
-          newargv[newargc++] = argv[i++];
-        }
-        newargv[newargc] = NULL;
-
-        /*
-         * newargv has all proper arguments here
-         */
-
-        argc = newargc;
-        argv = newargv;
-      }
-
-      /* If the data model is not changing, it is an error if the
-         jvmpath does not exist */
-      if (wanted == running) {
-        /* Find out where the JRE is that we will be using. */
-        if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
-          fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
-          exit(2);
-        }
-
-        /* Find the specified JVM type */
-        if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) {
-          fprintf(stderr, "Error: no known VMs. (check for corrupt jvm.cfg file)\n");
-          exit(1);
-        }
-
-        jvmpath[0] = '\0';
-        jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE);
-
-        if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) {
-          fprintf(stderr, "Error: no `%s' JVM at `%s'.\n", jvmtype, jvmpath);
-          exit(4);
-        }
-      } else {  /* do the same speculatively or exit */
-#ifdef DUAL_MODE
-        if (running != wanted) {
-          /* Find out where the JRE is that we will be using. */
-          if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE)) {
-            goto EndDataModelSpeculate;
-          }
-
-          /*
-           * Read in jvm.cfg for target data model and process vm
-           * selection options.
-           */
-          if (ReadKnownVMs(jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE) < 1) {
-            goto EndDataModelSpeculate;
-          }
-          jvmpath[0] = '\0';
-          jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE);
-          /* exec child can do error checking on the existence of the path */
-          jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath,
-                                     ((wanted==64)?BIG_ARCH:SMALL_ARCH));
-
-        }
-      EndDataModelSpeculate: /* give up and let other code report error message */
-        ;
-#else
-        fprintf(stderr, "Running a %d-bit JVM is not supported on this platform.\n", wanted);
-        exit(1);
-#endif
-      }
-
-      /*
-       * We will set the LD_LIBRARY_PATH as follows:
-       *
-       *     o          $JVMPATH (directory portion only)
-       *     o          $JRE/lib/$ARCH
-       *     o          $JRE/../lib/$ARCH
-       *
-       * followed by the user's previous effective LD_LIBRARY_PATH, if
-       * any.
-       */
-
-#ifdef __sun
-      /*
-       * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH
-       * variables:
-       *
-       * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if
-       * data-model specific variables are not set.
-       *
-       * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH
-       * for 64-bit binaries.
-       *
-       * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH
-       * for 32-bit binaries.
-       *
-       * The vm uses LD_LIBRARY_PATH to set the java.library.path system
-       * property.  To shield the vm from the complication of multiple
-       * LD_LIBRARY_PATH variables, if the appropriate data model
-       * specific variable is set, we will act as if LD_LIBRARY_PATH had
-       * the value of the data model specific variant and the data model
-       * specific variant will be unset.  Note that the variable for the
-       * *wanted* data model must be used (if it is set), not simply the
-       * current running data model.
-       */
-
-      switch(wanted) {
-      case 0:
-        if(running == 32) {
-          dmpath = getenv("LD_LIBRARY_PATH_32");
-          wanted = 32;
-        }
-        else {
-          dmpath = getenv("LD_LIBRARY_PATH_64");
-          wanted = 64;
-        }
-        break;
-
-      case 32:
-        dmpath = getenv("LD_LIBRARY_PATH_32");
-        break;
-
-      case 64:
-        dmpath = getenv("LD_LIBRARY_PATH_64");
-        break;
-
-      default:
-        fprintf(stderr, "Improper value at line %d.", __LINE__);
-        exit(1); /* unknown value in wanted */
-        break;
-      }
-
-      /*
-       * If dmpath is NULL, the relevant data model specific variable is
-       * not set and normal LD_LIBRARY_PATH should be used.
-       */
-      if( dmpath == NULL) {
-        runpath = getenv("LD_LIBRARY_PATH");
-      }
-      else {
-        runpath = dmpath;
-      }
-#else
-      /*
-       * If not on Solaris, assume only a single LD_LIBRARY_PATH
-       * variable.
-       */
-      runpath = getenv("LD_LIBRARY_PATH");
-#endif /* __sun */
-
-#ifdef __linux
-      /*
-       * On linux, if a binary is running as sgid or suid, glibc sets
-       * LD_LIBRARY_PATH to the empty string for security purposes.  (In
-       * contrast, on Solaris the LD_LIBRARY_PATH variable for a
-       * privileged binary does not lose its settings; but the dynamic
-       * linker does apply more scrutiny to the path.) The launcher uses
-       * the value of LD_LIBRARY_PATH to prevent an exec loop.
-       * Therefore, if we are running sgid or suid, this function's
-       * setting of LD_LIBRARY_PATH will be ineffective and we should
-       * return from the function now.  Getting the right libraries to
-       * be found must be handled through other mechanisms.
-       */
-      if((getgid() != getegid()) || (getuid() != geteuid()) ) {
-        return;
-      }
-#endif
-
-      /* runpath contains current effective LD_LIBRARY_PATH setting */
-
-      jvmpath = strdup(jvmpath);
-      new_runpath = MemAlloc( ((runpath!=NULL)?strlen(runpath):0) +
-                              2*strlen(jrepath) + 2*strlen(arch) +
-                              strlen(jvmpath) + 52);
-      newpath = new_runpath + strlen("LD_LIBRARY_PATH=");
-
-
-      /*
-       * Create desired LD_LIBRARY_PATH value for target data model.
-       */
-      {
-        /* remove the name of the .so from the JVM path */
-        lastslash = strrchr(jvmpath, '/');
-        if (lastslash)
-          *lastslash = '\0';
-
-
-        /* jvmpath, ((running != wanted)?((wanted==64)?"/"BIG_ARCH:"/.."):""), */
-
-        sprintf(new_runpath, "LD_LIBRARY_PATH="
-                "%s:"
-                "%s/lib/%s:"
-                "%s/../lib/%s",
-                jvmpath,
-#ifdef DUAL_MODE
-                jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH),
-                jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH)
-#else
-                jrepath, arch,
-                jrepath, arch
-#endif
-                );
-
-
-        /*
-         * Check to make sure that the prefix of the current path is the
-         * desired environment variable setting.
-         */
-        if (runpath != NULL &&
-            strncmp(newpath, runpath, strlen(newpath))==0 &&
-            (runpath[strlen(newpath)] == 0 || runpath[strlen(newpath)] == ':') &&
-            (running == wanted) /* data model does not have to be changed */
-#ifdef __sun
-            && (dmpath == NULL)    /* data model specific variables not set  */
-#endif
-            ) {
-
-          return;
-
-        }
-      }
-
-      /*
-       * Place the desired environment setting onto the prefix of
-       * LD_LIBRARY_PATH.  Note that this prevents any possible infinite
-       * loop of execv() because we test for the prefix, above.
-       */
-      if (runpath != 0) {
-        strcat(new_runpath, ":");
-        strcat(new_runpath, runpath);
-      }
-
-      if( putenv(new_runpath) != 0) {
-        exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set
-                    properly */
-      }
-
-      /*
-       * Unix systems document that they look at LD_LIBRARY_PATH only
-       * once at startup, so we have to re-exec the current executable
-       * to get the changed environment variable to have an effect.
-       */
-
-#ifdef __sun
-      /*
-       * If dmpath is not NULL, remove the data model specific string
-       * in the environment for the exec'ed child.
-       */
-
-      if( dmpath != NULL)
-        (void)UnsetEnv((wanted==32)?"LD_LIBRARY_PATH_32":"LD_LIBRARY_PATH_64");
-#endif
-
-      newenvp = environ;
-
-      {
-        char *newexec = execname;
-#ifdef DUAL_MODE
-        /*
-         * If the data model is being changed, the path to the
-         * executable must be updated accordingly; the executable name
-         * and directory the executable resides in are separate.  In the
-         * case of 32 => 64, the new bits are assumed to reside in, e.g.
-         * "olddir/BIGARCH/execname"; in the case of 64 => 32,
-         * the bits are assumed to be in "olddir/../execname".  For example,
-         *
-         * olddir/sparcv9/execname
-         * olddir/amd64/execname
-         *
-         * for Solaris SPARC and Linux amd64, respectively.
-         */
-
-        if (running != wanted) {
-          char *oldexec = strcpy(MemAlloc(strlen(execname) + 1), execname);
-          char *olddir = oldexec;
-          char *oldbase = strrchr(oldexec, '/');
-
-
-          newexec = MemAlloc(strlen(execname) + 20);
-          *oldbase++ = 0;
-          sprintf(newexec, "%s/%s/%s", olddir,
-                  ((wanted==64) ? BIG_ARCH : ".."), oldbase);
-          argv[0] = newexec;
-        }
-#endif
-
-        execve(newexec, argv, newenvp);
-        perror("execve()");
-
-        fprintf(stderr, "Error trying to exec %s.\n", newexec);
-        fprintf(stderr, "Check if file exists and permissions are set correctly.\n");
-
-#ifdef DUAL_MODE
-        if (running != wanted) {
-          fprintf(stderr, "Failed to start a %d-bit JVM process from a %d-bit JVM.\n",
-                  wanted, running);
-#  ifdef __sun
-
-#    ifdef __sparc
-          fprintf(stderr, "Verify all necessary J2SE components have been installed.\n" );
-          fprintf(stderr,
-                  "(Solaris SPARC 64-bit components must be installed after 32-bit components.)\n" );
-#    else
-          fprintf(stderr, "Either 64-bit processes are not supported by this platform\n");
-          fprintf(stderr, "or the 64-bit components have not been installed.\n");
-#    endif
-        }
-#  endif
-#endif
-
-      }
-
-      exit(1);
-    }
-
-#else  /* ifndef GAMMA */
-
-  /* gamma launcher is simpler in that it doesn't handle VM flavors, data  */
-  /* model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly  */
-  /* all we need to do here is to return correct path names. See also      */
-  /* GetJVMPath() and GetApplicationHome().                                */
-
-  { char *arch = (char *)GetArch(); /* like sparc or sparcv9 */
-    char *p;
-
-    if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
-      fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
-      exit(2);
-    }
-
-    if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath, arch )) {
-      fprintf(stderr, "Error: no JVM at `%s'.\n", jvmpath);
-      exit(4);
-    }
-  }
-
-#endif  /* ifndef GAMMA */
-}
-
-
-/*
- * On Solaris VM choosing is done by the launcher (java.c).
- */
-static jboolean
-GetJVMPath(const char *jrepath, const char *jvmtype,
-           char *jvmpath, jint jvmpathsize, char * arch)
-{
-    struct stat s;
-
-#ifndef GAMMA
-    if (strchr(jvmtype, '/')) {
-        sprintf(jvmpath, "%s/" JVM_DLL, jvmtype);
-    } else {
-        sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype);
-    }
-#else
-    /* For gamma launcher, JVM is either built-in or in the same directory. */
-    /* Either way we return "<exe_path>/libjvm.so" where <exe_path> is the  */
-    /* directory where gamma launcher is located.                           */
-
-    char *p;
-
-    snprintf(jvmpath, jvmpathsize, "%s", GetExecname());
-    p = strrchr(jvmpath, '/');
-    if (p) {
-       /* replace executable name with libjvm.so */
-       snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL);
-    } else {
-       /* this case shouldn't happen */
-       snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL);
-    }
-#endif
-
-    if (_launcher_debug)
-      printf("Does `%s' exist ... ", jvmpath);
-
-    if (stat(jvmpath, &s) == 0) {
-        if (_launcher_debug)
-          printf("yes.\n");
-        return JNI_TRUE;
-    } else {
-        if (_launcher_debug)
-          printf("no.\n");
-        return JNI_FALSE;
-    }
-}
-
-/*
- * Find path to JRE based on .exe's location or registry settings.
- */
-static jboolean
-GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative)
-{
-    char libjava[MAXPATHLEN];
-
-    if (GetApplicationHome(path, pathsize)) {
-        /* Is JRE co-located with the application? */
-        sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch);
-        if (access(libjava, F_OK) == 0) {
-            goto found;
-        }
-
-        /* Does the app ship a private JRE in <apphome>/jre directory? */
-        sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch);
-        if (access(libjava, F_OK) == 0) {
-            strcat(path, "/jre");
-            goto found;
-        }
-    }
-
-    if (!speculative)
-      fprintf(stderr, "Error: could not find " JAVA_DLL "\n");
-    return JNI_FALSE;
-
- found:
-    if (_launcher_debug)
-      printf("JRE path is %s\n", path);
-    return JNI_TRUE;
-}
-
-jboolean
-LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
-{
-#ifdef GAMMA
-    /* JVM is directly linked with gamma launcher; no dlopen() */
-    ifn->CreateJavaVM = JNI_CreateJavaVM;
-    ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
-    return JNI_TRUE;
-#else
-    Dl_info dlinfo;
-    void *libjvm;
-
-    if (_launcher_debug) {
-        printf("JVM path is %s\n", jvmpath);
-    }
-
-    libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL);
-    if (libjvm == NULL) {
-#if defined(__sparc) && !defined(_LP64) /* i.e. 32-bit sparc */
-      FILE * fp;
-      Elf32_Ehdr elf_head;
-      int count;
-      int location;
-
-      fp = fopen(jvmpath, "r");
-      if(fp == NULL)
-        goto error;
-
-      /* read in elf header */
-      count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp);
-      fclose(fp);
-      if(count < 1)
-        goto error;
-
-      /*
-       * Check for running a server vm (compiled with -xarch=v8plus)
-       * on a stock v8 processor.  In this case, the machine type in
-       * the elf header would not be included the architecture list
-       * provided by the isalist command, which is turn is gotten from
-       * sysinfo.  This case cannot occur on 64-bit hardware and thus
-       * does not have to be checked for in binaries with an LP64 data
-       * model.
-       */
-      if(elf_head.e_machine == EM_SPARC32PLUS) {
-        char buf[257];  /* recommended buffer size from sysinfo man
-                           page */
-        long length;
-        char* location;
-
-        length = sysinfo(SI_ISALIST, buf, 257);
-        if(length > 0) {
-          location = strstr(buf, "sparcv8plus ");
-          if(location == NULL) {
-            fprintf(stderr, "SPARC V8 processor detected; Server compiler requires V9 or better.\n");
-            fprintf(stderr, "Use Client compiler on V8 processors.\n");
-            fprintf(stderr, "Could not create the Java virtual machine.\n");
-            return JNI_FALSE;
-          }
-        }
-      }
-#endif
-      fprintf(stderr, "dl failure on line %d", __LINE__);
-      goto error;
-    }
-
-    ifn->CreateJavaVM = (CreateJavaVM_t)
-      dlsym(libjvm, "JNI_CreateJavaVM");
-    if (ifn->CreateJavaVM == NULL)
-        goto error;
-
-    ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
-        dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
-    if (ifn->GetDefaultJavaVMInitArgs == NULL)
-      goto error;
-
-    return JNI_TRUE;
-
-error:
-    fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror());
-    return JNI_FALSE;
-#endif /* GAMMA */
-}
-
-/*
- * Get the path to the file that has the usage message for -X options.
- */
-void
-GetXUsagePath(char *buf, jint bufsize)
-{
-    static const char Xusage_txt[] = "/Xusage.txt";
-    Dl_info dlinfo;
-
-    /* we use RTLD_NOW because of problems with ld.so.1 and green threads */
-    dladdr(dlsym(dlopen(JVM_DLL, RTLD_NOW), "JNI_CreateJavaVM"), &dlinfo);
-    strncpy(buf, (char *)dlinfo.dli_fname, bufsize - sizeof(Xusage_txt));
-
-    buf[bufsize-1] = '\0';
-    strcpy(strrchr(buf, '/'), Xusage_txt);
-}
-
-/*
- * If app is "/foo/bin/javac", or "/foo/bin/sparcv9/javac" then put
- * "/foo" into buf.
- */
-jboolean
-GetApplicationHome(char *buf, jint bufsize)
-{
-#ifdef __linux__
-    char *execname = GetExecname();
-    if (execname) {
-        strncpy(buf, execname, bufsize-1);
-        buf[bufsize-1] = '\0';
-    } else {
-        return JNI_FALSE;
-    }
-#else
-    Dl_info dlinfo;
-
-    dladdr((void *)GetApplicationHome, &dlinfo);
-    if (realpath(dlinfo.dli_fname, buf) == NULL) {
-        fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname);
-        return JNI_FALSE;
-    }
-#endif
-
-#ifdef GAMMA
-    {
-      /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */
-      char* java_home_var = getenv("JAVA_HOME");
-      if (java_home_var == NULL) {
-        printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
-        return JNI_FALSE;
-      }
-      snprintf(buf, bufsize, "%s", java_home_var);
-    }
-#else
-    if (strrchr(buf, '/') == 0) {
-        buf[0] = '\0';
-        return JNI_FALSE;
-    }
-    *(strrchr(buf, '/')) = '\0';        /* executable file      */
-    if (strlen(buf) < 4 || strrchr(buf, '/') == 0) {
-        buf[0] = '\0';
-        return JNI_FALSE;
-    }
-    if (strcmp("/bin", buf + strlen(buf) - 4) != 0)
-        *(strrchr(buf, '/')) = '\0';    /* sparcv9 or amd64     */
-    if (strlen(buf) < 4 || strcmp("/bin", buf + strlen(buf) - 4) != 0) {
-        buf[0] = '\0';
-        return JNI_FALSE;
-    }
-    *(strrchr(buf, '/')) = '\0';        /* bin                  */
-#endif /* GAMMA */
-
-    return JNI_TRUE;
-}
-
-
-/*
- * Return true if the named program exists
- */
-static int
-ProgramExists(char *name)
-{
-    struct stat sb;
-    if (stat(name, &sb) != 0) return 0;
-    if (S_ISDIR(sb.st_mode)) return 0;
-    return (sb.st_mode & S_IEXEC) != 0;
-}
-
-
-/*
- * Find a command in a directory, returning the path.
- */
-static char *
-Resolve(char *indir, char *cmd)
-{
-    char name[PATH_MAX + 2], *real;
-
-    if ((strlen(indir) + strlen(cmd) + 1)  > PATH_MAX) return 0;
-    sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd);
-    if (!ProgramExists(name)) return 0;
-    real = MemAlloc(PATH_MAX + 2);
-    if (!realpath(name, real))
-        strcpy(real, name);
-    return real;
-}
-
-
-/*
- * Find a path for the executable
- */
-static char *
-FindExecName(char *program)
-{
-    char cwdbuf[PATH_MAX+2];
-    char *path;
-    char *tmp_path;
-    char *f;
-    char *result = NULL;
-
-    /* absolute path? */
-    if (*program == FILE_SEPARATOR ||
-        (FILE_SEPARATOR=='\\' && strrchr(program, ':')))
-        return Resolve("", program+1);
-
-    /* relative path? */
-    if (strrchr(program, FILE_SEPARATOR) != 0) {
-        char buf[PATH_MAX+2];
-        return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program);
-    }
-
-    /* from search path? */
-    path = getenv("PATH");
-    if (!path || !*path) path = ".";
-    tmp_path = MemAlloc(strlen(path) + 2);
-    strcpy(tmp_path, path);
-
-    for (f=tmp_path; *f && result==0; ) {
-        char *s = f;
-        while (*f && (*f != PATH_SEPARATOR)) ++f;
-        if (*f) *f++ = 0;
-        if (*s == FILE_SEPARATOR)
-            result = Resolve(s, program);
-        else {
-            /* relative path element */
-            char dir[2*PATH_MAX];
-            sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)),
-                    FILE_SEPARATOR, s);
-            result = Resolve(dir, program);
-        }
-        if (result != 0) break;
-    }
-
-    free(tmp_path);
-    return result;
-}
-
-
-/* Store the name of the executable once computed */
-static char *execname = NULL;
-
-/*
- * Compute the name of the executable
- *
- * In order to re-exec securely we need the absolute path of the
- * executable. On Solaris getexecname(3c) may not return an absolute
- * path so we use dladdr to get the filename of the executable and
- * then use realpath to derive an absolute path. From Solaris 9
- * onwards the filename returned in DL_info structure from dladdr is
- * an absolute pathname so technically realpath isn't required.
- * On Linux we read the executable name from /proc/self/exe.
- * As a fallback, and for platforms other than Solaris and Linux,
- * we use FindExecName to compute the executable name.
- */
-static char *
-SetExecname(char **argv)
-{
-    char* exec_path = NULL;
-
-    if (execname != NULL)       /* Already determined */
-        return (execname);
-
-#if defined(__sun)
-    {
-        Dl_info dlinfo;
-        if (dladdr((void*)&SetExecname, &dlinfo)) {
-            char *resolved = (char*)MemAlloc(PATH_MAX+1);
-            if (resolved != NULL) {
-                exec_path = realpath(dlinfo.dli_fname, resolved);
-                if (exec_path == NULL) {
-                    free(resolved);
-                }
-            }
-        }
-    }
-#elif defined(__linux__)
-    {
-        const char* self = "/proc/self/exe";
-        char buf[PATH_MAX+1];
-        int len = readlink(self, buf, PATH_MAX);
-        if (len >= 0) {
-            buf[len] = '\0';            /* readlink doesn't nul terminate */
-            exec_path = strdup(buf);
-        }
-    }
-#else /* !__sun && !__linux */
-    {
-        /* Not implemented */
-    }
-#endif
-
-    if (exec_path == NULL) {
-        exec_path = FindExecName(argv[0]);
-    }
-    execname = exec_path;
-    return exec_path;
-}
-
-/*
- * Return the name of the executable.  Used in java_md.c to find the JRE area.
- */
-static char *
-GetExecname() {
-  return execname;
-}
-
-void ReportErrorMessage(char * message, jboolean always) {
-  if (always) {
-    fprintf(stderr, "%s\n", message);
-  }
-}
-
-void ReportErrorMessage2(char * format, char * string, jboolean always) {
-  if (always) {
-    fprintf(stderr, format, string);
-    fprintf(stderr, "\n");
-  }
-}
-
-void  ReportExceptionDescription(JNIEnv * env) {
-  (*env)->ExceptionDescribe(env);
-}
-
-/*
- * Return JNI_TRUE for an option string that has no effect but should
- * _not_ be passed on to the vm; return JNI_FALSE otherwise.  On
- * Solaris SPARC, this screening needs to be done if:
- * 1) LD_LIBRARY_PATH does _not_ need to be reset and
- * 2) -d32 or -d64 is passed to a binary with a matching data model
- *    (the exec in SetLibraryPath removes -d<n> options and points the
- *    exec to the proper binary).  When this exec is not done, these options
- *    would end up getting passed onto the vm.
- */
-jboolean RemovableMachineDependentOption(char * option) {
-  /*
-   * Unconditionally remove both -d32 and -d64 options since only
-   * the last such options has an effect; e.g.
-   * java -d32 -d64 -d32 -version
-   * is equivalent to
-   * java -d32 -version
-   */
-
-  if( (strcmp(option, "-d32")  == 0 ) ||
-      (strcmp(option, "-d64")  == 0 ))
-    return JNI_TRUE;
-  else
-    return JNI_FALSE;
-}
-
-void PrintMachineDependentOptions() {
-      fprintf(stdout,
-        "    -d32          use a 32-bit data model if available\n"
-        "\n"
-        "    -d64          use a 64-bit data model if available\n");
-      return;
-}
-
-#ifndef GAMMA  /* gamma launcher does not have ergonomics */
-
-/*
- * The following methods (down to ServerClassMachine()) answer
- * the question about whether a machine is a "server-class"
- * machine.  A server-class machine is loosely defined as one
- * with 2 or more processors and 2 gigabytes or more physical
- * memory.  The definition of a processor is a physical package,
- * not a hyperthreaded chip masquerading as a multi-processor.
- * The definition of memory is also somewhat fuzzy, since x86
- * machines seem not to report all the memory in their DIMMs, we
- * think because of memory mapping of graphics cards, etc.
- *
- * This code is somewhat more confused with #ifdef's than we'd
- * like because this file is used by both Solaris and Linux
- * platforms, and so needs to be parameterized for SPARC and
- * i586 hardware.  The other Linux platforms (amd64 and ia64)
- * don't even ask this question, because they only come with
- * server JVMs.  */
-
-# define KB (1024UL)
-# define MB (1024UL * KB)
-# define GB (1024UL * MB)
-
-/* Compute physical memory by asking the OS */
-uint64_t
-physical_memory(void) {
-  const uint64_t pages     = (uint64_t) sysconf(_SC_PHYS_PAGES);
-  const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE);
-  const uint64_t result    = pages * page_size;
-# define UINT64_FORMAT "%" PRIu64
-
-  if (_launcher_debug) {
-    printf("pages: " UINT64_FORMAT
-           "  page_size: " UINT64_FORMAT
-           "  physical memory: " UINT64_FORMAT " (%.3fGB)\n",
-           pages, page_size, result, result / (double) GB);
-  }
-  return result;
-}
-
-#if defined(__sun) && defined(__sparc)
-
-/* Methods for solaris-sparc: these are easy. */
-
-/* Ask the OS how many processors there are. */
-unsigned long
-physical_processors(void) {
-  const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-
-  if (_launcher_debug) {
-    printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
-  }
-  return sys_processors;
-}
-
-/* The solaris-sparc version of the "server-class" predicate. */
-jboolean
-solaris_sparc_ServerClassMachine(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;
-    }
-  }
-  if (_launcher_debug) {
-    printf("solaris_" ARCH "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
-  }
-  return result;
-}
-
-#endif /* __sun && __sparc */
-
-#if defined(__sun) && defined(i586)
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of linux-i586
- * because the compilers are different.
- */
-void
-get_cpuid(uint32_t arg,
-          uint32_t* eaxp,
-          uint32_t* ebxp,
-          uint32_t* ecxp,
-          uint32_t* edxp) {
-#ifdef _LP64
-  asm(
-  /* rbx is a callee-saved register */
-      " movq    %rbx, %r11  \n"
-  /* rdx and rcx are 3rd and 4th argument registers */
-      " movq    %rdx, %r10  \n"
-      " movq    %rcx, %r9   \n"
-      " movl    %edi, %eax  \n"
-      " cpuid               \n"
-      " movl    %eax, (%rsi)\n"
-      " movl    %ebx, (%r10)\n"
-      " movl    %ecx, (%r9) \n"
-      " movl    %edx, (%r8) \n"
-  /* Restore rbx */
-      " movq    %r11, %rbx");
-#else
-  /* EBX is a callee-saved register */
-  asm(" pushl   %ebx");
-  /* Need ESI for storing through arguments */
-  asm(" pushl   %esi");
-  asm(" movl    8(%ebp), %eax   \n"
-      " cpuid                   \n"
-      " movl    12(%ebp), %esi  \n"
-      " movl    %eax, (%esi)    \n"
-      " movl    16(%ebp), %esi  \n"
-      " movl    %ebx, (%esi)    \n"
-      " movl    20(%ebp), %esi  \n"
-      " movl    %ecx, (%esi)    \n"
-      " movl    24(%ebp), %esi  \n"
-      " movl    %edx, (%esi)      ");
-  /* Restore ESI and EBX */
-  asm(" popl    %esi");
-  /* Restore EBX */
-  asm(" popl    %ebx");
-#endif
-}
-
-#endif /* __sun && i586 */
-
-#if defined(__linux__) && defined(i586)
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of solaris-i586
- * because the compilers are different.
- */
-void
-get_cpuid(uint32_t arg,
-          uint32_t* eaxp,
-          uint32_t* ebxp,
-          uint32_t* ecxp,
-          uint32_t* edxp) {
-#ifdef _LP64
-  __asm__ volatile (/* Instructions */
-                    "   movl    %4, %%eax  \n"
-                    "   cpuid              \n"
-                    "   movl    %%eax, (%0)\n"
-                    "   movl    %%ebx, (%1)\n"
-                    "   movl    %%ecx, (%2)\n"
-                    "   movl    %%edx, (%3)\n"
-                    : /* Outputs */
-                    : /* Inputs */
-                    "r" (eaxp),
-                    "r" (ebxp),
-                    "r" (ecxp),
-                    "r" (edxp),
-                    "r" (arg)
-                    : /* Clobbers */
-                    "%rax", "%rbx", "%rcx", "%rdx", "memory"
-                    );
-#else
-  uint32_t value_of_eax = 0;
-  uint32_t value_of_ebx = 0;
-  uint32_t value_of_ecx = 0;
-  uint32_t value_of_edx = 0;
-  __asm__ volatile (/* Instructions */
-                        /* ebx is callee-save, so push it */
-                        /* even though it's in the clobbers section */
-                    "   pushl   %%ebx      \n"
-                    "   movl    %4, %%eax  \n"
-                    "   cpuid              \n"
-                    "   movl    %%eax, %0  \n"
-                    "   movl    %%ebx, %1  \n"
-                    "   movl    %%ecx, %2  \n"
-                    "   movl    %%edx, %3  \n"
-                        /* restore ebx */
-                    "   popl    %%ebx      \n"
-
-                    : /* Outputs */
-                    "=m" (value_of_eax),
-                    "=m" (value_of_ebx),
-                    "=m" (value_of_ecx),
-                    "=m" (value_of_edx)
-                    : /* Inputs */
-                    "m" (arg)
-                    : /* Clobbers */
-                    "%eax", "%ebx", "%ecx", "%edx"
-                    );
-  *eaxp = value_of_eax;
-  *ebxp = value_of_ebx;
-  *ecxp = value_of_ecx;
-  *edxp = value_of_edx;
-#endif
-}
-
-#endif /* __linux__ && i586 */
-
-#ifdef i586
-/*
- * Routines shared by solaris-i586 and linux-i586.
- */
-
-enum HyperThreadingSupport_enum {
-  hts_supported        =  1,
-  hts_too_soon_to_tell =  0,
-  hts_not_supported    = -1,
-  hts_not_pentium4     = -2,
-  hts_not_intel        = -3
-};
-typedef enum HyperThreadingSupport_enum HyperThreadingSupport;
-
-/* Determine if hyperthreading is supported */
-HyperThreadingSupport
-hyperthreading_support(void) {
-  HyperThreadingSupport result = hts_too_soon_to_tell;
-  /* Bits 11 through 8 is family processor id */
-# define FAMILY_ID_SHIFT 8
-# define FAMILY_ID_MASK 0xf
-  /* Bits 23 through 20 is extended family processor id */
-# define EXT_FAMILY_ID_SHIFT 20
-# define EXT_FAMILY_ID_MASK 0xf
-  /* Pentium 4 family processor id */
-# define PENTIUM4_FAMILY_ID 0xf
-  /* Bit 28 indicates Hyper-Threading Technology support */
-# define HT_BIT_SHIFT 28
-# define HT_BIT_MASK 1
-  uint32_t vendor_id[3] = { 0U, 0U, 0U };
-  uint32_t value_of_eax = 0U;
-  uint32_t value_of_edx = 0U;
-  uint32_t dummy        = 0U;
-
-  /* Yes, this is supposed to be [0], [2], [1] */
-  get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]);
-  if (_launcher_debug) {
-    printf("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n",
-           ((vendor_id[0] >>  0) & 0xff),
-           ((vendor_id[0] >>  8) & 0xff),
-           ((vendor_id[0] >> 16) & 0xff),
-           ((vendor_id[0] >> 24) & 0xff),
-           ((vendor_id[1] >>  0) & 0xff),
-           ((vendor_id[1] >>  8) & 0xff),
-           ((vendor_id[1] >> 16) & 0xff),
-           ((vendor_id[1] >> 24) & 0xff),
-           ((vendor_id[2] >>  0) & 0xff),
-           ((vendor_id[2] >>  8) & 0xff),
-           ((vendor_id[2] >> 16) & 0xff),
-           ((vendor_id[2] >> 24) & 0xff));
-  }
-  get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx);
-  if (_launcher_debug) {
-    printf("value_of_eax: 0x%x  value_of_edx: 0x%x\n",
-           value_of_eax, value_of_edx);
-  }
-  if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) ||
-      (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) {
-    if ((((vendor_id[0] >>  0) & 0xff) == 'G') &&
-        (((vendor_id[0] >>  8) & 0xff) == 'e') &&
-        (((vendor_id[0] >> 16) & 0xff) == 'n') &&
-        (((vendor_id[0] >> 24) & 0xff) == 'u') &&
-        (((vendor_id[1] >>  0) & 0xff) == 'i') &&
-        (((vendor_id[1] >>  8) & 0xff) == 'n') &&
-        (((vendor_id[1] >> 16) & 0xff) == 'e') &&
-        (((vendor_id[1] >> 24) & 0xff) == 'I') &&
-        (((vendor_id[2] >>  0) & 0xff) == 'n') &&
-        (((vendor_id[2] >>  8) & 0xff) == 't') &&
-        (((vendor_id[2] >> 16) & 0xff) == 'e') &&
-        (((vendor_id[2] >> 24) & 0xff) == 'l')) {
-      if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) {
-        if (_launcher_debug) {
-          printf("Hyperthreading supported\n");
-        }
-        result = hts_supported;
-      } else {
-        if (_launcher_debug) {
-          printf("Hyperthreading not supported\n");
-        }
-        result = hts_not_supported;
-      }
-    } else {
-      if (_launcher_debug) {
-        printf("Not GenuineIntel\n");
-      }
-      result = hts_not_intel;
-    }
-  } else {
-    if (_launcher_debug) {
-      printf("not Pentium 4 or extended\n");
-    }
-    result = hts_not_pentium4;
-  }
-  return result;
-}
-
-/* Determine how many logical processors there are per CPU */
-unsigned int
-logical_processors_per_package(void) {
-  /*
-   * After CPUID with EAX==1, register EBX bits 23 through 16
-   * indicate the number of logical processors per package
-   */
-# define NUM_LOGICAL_SHIFT 16
-# define NUM_LOGICAL_MASK 0xff
-  unsigned int result                        = 1U;
-  const HyperThreadingSupport hyperthreading = hyperthreading_support();
-
-  if (hyperthreading == hts_supported) {
-    uint32_t value_of_ebx = 0U;
-    uint32_t dummy        = 0U;
-
-    get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy);
-    result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK;
-    if (_launcher_debug) {
-      printf("logical processors per package: %u\n", result);
-    }
-  }
-  return result;
-}
-
-/* Compute the number of physical processors, not logical processors */
-unsigned long
-physical_processors(void) {
-  const long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-  unsigned long result      = sys_processors;
-
-  if (_launcher_debug) {
-    printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
-  }
-  if (sys_processors > 1) {
-    unsigned int logical_processors = logical_processors_per_package();
-    if (logical_processors > 1) {
-      result = (unsigned long) sys_processors / logical_processors;
-    }
-  }
-  if (_launcher_debug) {
-    printf("physical processors: %lu\n", result);
-  }
-  return result;
-}
-
-#endif /* i586 */
-
-#if defined(__sun) && defined(i586)
-
-/* The definition of a server-class machine for solaris-i586/amd64 */
-jboolean
-solaris_i586_ServerClassMachine(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;
-  /*
-   * We seem not to get our full complement of memory.
-   *     We allow some part (1/8?) of the memory to be "missing",
-   *     based on the sizes of DIMMs, and maybe graphics cards.
-   */
-  const uint64_t      missing_memory    = 256UL * MB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= (server_memory - missing_memory)) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  if (_launcher_debug) {
-    printf("solaris_" ARCH "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  }
-  return result;
-}
-
-#endif /* __sun && i586 */
-
-#if defined(__linux__) && defined(i586)
-
-/* The definition of a server-class machine for linux-i586 */
-jboolean
-linux_i586_ServerClassMachine(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;
-  /*
-   * We seem not to get our full complement of memory.
-   *     We allow some part (1/8?) of the memory to be "missing",
-   *     based on the sizes of DIMMs, and maybe graphics cards.
-   */
-  const uint64_t      missing_memory    = 256UL * MB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= (server_memory - missing_memory)) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  if (_launcher_debug) {
-    printf("linux_" ARCH "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  }
-  return result;
-}
-
-#endif /* __linux__ && i586 */
-
-/* Dispatch to the platform-specific definition of "server-class" */
-jboolean
-ServerClassMachine(void) {
-  jboolean result = JNI_FALSE;
-#if   defined(__sun) && defined(__sparc)
-  result = solaris_sparc_ServerClassMachine();
-#elif defined(__sun) && defined(i586)
-  result = solaris_i586_ServerClassMachine();
-#elif defined(__linux__) && defined(i586)
-  result = linux_i586_ServerClassMachine();
-#else
-  if (_launcher_debug) {
-    printf("ServerClassMachine: returns default value of %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  }
-#endif
-  return result;
-}
-
-#endif /* ifndef GAMMA */
-
-#ifndef GAMMA /* gamma launcher does not choose JDK/JRE/JVM */
-
-/*
- *      Since using the file system as a registry is a bit risky, perform
- *      additional sanity checks on the identified directory to validate
- *      it as a valid jre/sdk.
- *
- *      Return 0 if the tests fail; otherwise return non-zero (true).
- *
- *      Note that checking for anything more than the existence of an
- *      executable object at bin/java relative to the path being checked
- *      will break the regression tests.
- */
-static int
-CheckSanity(char *path, char *dir)
-{
-    char    buffer[PATH_MAX];
-
-    if (strlen(path) + strlen(dir) + 11 > PATH_MAX)
-        return (0);     /* Silently reject "impossibly" long paths */
-
-    (void)strcat(strcat(strcat(strcpy(buffer, path), "/"), dir), "/bin/java");
-    return ((access(buffer, X_OK) == 0) ? 1 : 0);
-}
-
-/*
- *      Determine if there is an acceptable JRE in the directory dirname.
- *      Upon locating the "best" one, return a fully qualified path to
- *      it. "Best" is defined as the most advanced JRE meeting the
- *      constraints contained in the manifest_info. If no JRE in this
- *      directory meets the constraints, return NULL.
- *
- *      Note that we don't check for errors in reading the directory
- *      (which would be done by checking errno).  This is because it
- *      doesn't matter if we get an error reading the directory, or
- *      we just don't find anything interesting in the directory.  We
- *      just return NULL in either case.
- *
- *      The historical names of j2sdk and j2re were changed to jdk and
- *      jre respecively as part of the 1.5 rebranding effort.  Since the
- *      former names are legacy on Linux, they must be recognized for
- *      all time.  Fortunately, this is a minor cost.
- */
-static char
-*ProcessDir(manifest_info *info, char *dirname)
-{
-    DIR     *dirp;
-    struct dirent *dp;
-    char    *best = NULL;
-    int     offset;
-    int     best_offset = 0;
-    char    *ret_str = NULL;
-    char    buffer[PATH_MAX];
-
-    if ((dirp = opendir(dirname)) == NULL)
-        return (NULL);
-
-    do {
-        if ((dp = readdir(dirp)) != NULL) {
-            offset = 0;
-            if ((strncmp(dp->d_name, "jre", 3) == 0) ||
-                (strncmp(dp->d_name, "jdk", 3) == 0))
-                offset = 3;
-            else if (strncmp(dp->d_name, "j2re", 4) == 0)
-                offset = 4;
-            else if (strncmp(dp->d_name, "j2sdk", 5) == 0)
-                offset = 5;
-            if (offset > 0) {
-                if ((acceptable_release(dp->d_name + offset,
-                    info->jre_version)) && CheckSanity(dirname, dp->d_name))
-                    if ((best == NULL) || (exact_version_id(
-                      dp->d_name + offset, best + best_offset) > 0)) {
-                        if (best != NULL)
-                            free(best);
-                        best = strdup(dp->d_name);
-                        best_offset = offset;
-                    }
-            }
-        }
-    } while (dp != NULL);
-    (void) closedir(dirp);
-    if (best == NULL)
-        return (NULL);
-    else {
-        ret_str = MemAlloc(strlen(dirname) + strlen(best) + 2);
-        ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best);
-        free(best);
-        return (ret_str);
-    }
-}
-
-/*
- *      This is the global entry point. It examines the host for the optimal
- *      JRE to be used by scanning a set of directories.  The set of directories
- *      is platform dependent and can be overridden by the environment
- *      variable JAVA_VERSION_PATH.
- *
- *      This routine itself simply determines the set of appropriate
- *      directories before passing control onto ProcessDir().
- */
-char*
-LocateJRE(manifest_info* info)
-{
-    char        *path;
-    char        *home;
-    char        *target = NULL;
-    char        *dp;
-    char        *cp;
-
-    /*
-     * Start by getting JAVA_VERSION_PATH
-     */
-    if (info->jre_restrict_search)
-        path = strdup(system_dir);
-    else if ((path = getenv("JAVA_VERSION_PATH")) != NULL)
-        path = strdup(path);
-    else
-        if ((home = getenv("HOME")) != NULL) {
-            path = (char *)MemAlloc(strlen(home) + 13);
-            path = strcat(strcat(strcat(strcpy(path, home),
-                user_dir), ":"), system_dir);
-        } else
-            path = strdup(system_dir);
-
-    /*
-     * Step through each directory on the path. Terminate the scan with
-     * the first directory with an acceptable JRE.
-     */
-    cp = dp = path;
-    while (dp != NULL) {
-        cp = strchr(dp, (int)':');
-        if (cp != NULL)
-            *cp = (char)NULL;
-        if ((target = ProcessDir(info, dp)) != NULL)
-            break;
-        dp = cp;
-        if (dp != NULL)
-            dp++;
-    }
-    free(path);
-    return (target);
-}
-
-/*
- * Given a path to a jre to execute, this routine checks if this process
- * is indeed that jre.  If not, it exec's that jre.
- *
- * We want to actually check the paths rather than just the version string
- * built into the executable, so that given version specification (and
- * JAVA_VERSION_PATH) will yield the exact same Java environment, regardless
- * of the version of the arbitrary launcher we start with.
- */
-void
-ExecJRE(char *jre, char **argv)
-{
-    char    wanted[PATH_MAX];
-    char    *execname;
-    char    *progname;
-
-    /*
-     * Resolve the real path to the directory containing the selected JRE.
-     */
-    if (realpath(jre, wanted) == NULL) {
-        fprintf(stderr, "Unable to resolve %s\n", jre);
-        exit(1);
-    }
-
-    /*
-     * Resolve the real path to the currently running launcher.
-     */
-    execname = SetExecname(argv);
-    if (execname == NULL) {
-        fprintf(stderr, "Unable to resolve current executable\n");
-        exit(1);
-    }
-
-    /*
-     * If the path to the selected JRE directory is a match to the initial
-     * portion of the path to the currently executing JRE, we have a winner!
-     * If so, just return.
-     */
-    if (strncmp(wanted, execname, strlen(wanted)) == 0)
-        return;                 /* I am the droid you were looking for */
-
-    /*
-     * If this isn't the selected version, exec the selected version.
-     */
-#ifdef JAVA_ARGS  /* javac, jar and friends. */
-    progname = "java";
-#else             /* java, oldjava, javaw and friends */
-#ifdef PROGNAME
-    progname = PROGNAME;
-#else
-    progname = *argv;
-    if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
-        progname = s + 1;
-    }
-#endif /* PROGNAME */
-#endif /* JAVA_ARGS */
-
-    /*
-     * This should never happen (because of the selection code in SelectJRE),
-     * but check for "impossibly" long path names just because buffer overruns
-     * can be so deadly.
-     */
-    if (strlen(wanted) + strlen(progname) + 6 > PATH_MAX) {
-        fprintf(stderr, "Path length exceeds maximum length (PATH_MAX)\n");
-        exit(1);
-    }
-
-    /*
-     * Construct the path and exec it.
-     */
-    (void)strcat(strcat(wanted, "/bin/"), progname);
-    argv[0] = progname;
-    if (_launcher_debug) {
-        int i;
-        printf("execv(\"%s\"", wanted);
-        for (i = 0; argv[i] != NULL; i++)
-            printf(", \"%s\"", argv[i]);
-        printf(")\n");
-    }
-    execv(wanted, argv);
-    fprintf(stderr, "Exec of %s failed\n", wanted);
-    exit(1);
-}
-
-#endif /* ifndef GAMMA */
-
-/*
- * "Borrowed" from Solaris 10 where the unsetenv() function is being added
- * to libc thanks to SUSv3 (Standard Unix Specification, version 3). As
- * such, in the fullness of time this will appear in libc on all relevant
- * Solaris/Linux platforms and maybe even the Windows platform.  At that
- * time, this stub can be removed.
- *
- * This implementation removes the environment locking for multithreaded
- * applications.  (We don't have access to these mutexes within libc and
- * the launcher isn't multithreaded.)  Note that what remains is platform
- * independent, because it only relies on attributes that a POSIX environment
- * defines.
- *
- * Returns 0 on success, -1 on failure.
- *
- * Also removed was the setting of errno.  The only value of errno set
- * was EINVAL ("Invalid Argument").
- */
-
-/*
- * s1(environ) is name=value
- * s2(name) is name(not the form of name=value).
- * if names match, return value of 1, else return 0
- */
-static int
-match_noeq(const char *s1, const char *s2)
-{
-        while (*s1 == *s2++) {
-                if (*s1++ == '=')
-                        return (1);
-        }
-        if (*s1 == '=' && s2[-1] == '\0')
-                return (1);
-        return (0);
-}
-
-/*
- * added for SUSv3 standard
- *
- * Delete entry from environ.
- * Do not free() memory!  Other threads may be using it.
- * Keep it around forever.
- */
-static int
-borrowed_unsetenv(const char *name)
-{
-        long    idx;            /* index into environ */
-
-        if (name == NULL || *name == '\0' ||
-            strchr(name, '=') != NULL) {
-                return (-1);
-        }
-
-        for (idx = 0; environ[idx] != NULL; idx++) {
-                if (match_noeq(environ[idx], name))
-                        break;
-        }
-        if (environ[idx] == NULL) {
-                /* name not found but still a success */
-                return (0);
-        }
-        /* squeeze up one entry */
-        do {
-                environ[idx] = environ[idx+1];
-        } while (environ[++idx] != NULL);
-
-        return (0);
-}
-/* --- End of "borrowed" code --- */
-
-/*
- * Wrapper for unsetenv() function.
- */
-int
-UnsetEnv(char *name)
-{
-    return(borrowed_unsetenv(name));
-}
-/*
- * The implementation for finding classes from the bootstrap
- * class loader, refer to java.h
- */
-static FindClassFromBootLoader_t *findBootClass = NULL;
-
-jclass
-FindBootStrapClass(JNIEnv *env, const char* classname)
-{
-   if (findBootClass == NULL) {
-       findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT,
-          "JVM_FindClassFromBootLoader");
-       if (findBootClass == NULL) {
-           fprintf(stderr, "Error: could load method JVM_FindClassFromBootLoader");
-           return NULL;
-       }
-   }
-   return findBootClass(env, classname, JNI_FALSE);
-}
-
--- a/src/os/linux/launcher/java_md.h	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#ifndef JAVA_MD_H
-#define JAVA_MD_H
-
-#include <limits.h>
-#include <unistd.h>
-#include <sys/param.h>
-#ifndef GAMMA
-#include "manifest_info.h"
-#endif
-
-#define PATH_SEPARATOR          ':'
-#define FILESEP                 "/"
-#define FILE_SEPARATOR          '/'
-#ifndef MAXNAMELEN
-#define MAXNAMELEN              PATH_MAX
-#endif
-
-#ifdef JAVA_ARGS
-/*
- * ApplicationHome is prepended to each of these entries; the resulting
- * strings are concatenated (separated by PATH_SEPARATOR) and used as the
- * value of -cp option to the launcher.
- */
-#ifndef APP_CLASSPATH
-#define APP_CLASSPATH        { "/lib/tools.jar", "/classes" }
-#endif
-#endif
-
-#ifdef HAVE_GETHRTIME
-/*
- * Support for doing cheap, accurate interval timing.
- */
-#include <sys/time.h>
-#define CounterGet()              (gethrtime()/1000)
-#define Counter2Micros(counts)    (counts)
-#else
-#define CounterGet()              (0)
-#define Counter2Micros(counts)    (1)
-#endif /* HAVE_GETHRTIME */
-
-/*
- * Function prototypes.
- */
-#ifndef GAMMA
-char *LocateJRE(manifest_info* info);
-void ExecJRE(char *jre, char **argv);
-#endif
-int UnsetEnv(char *name);
-
-#endif
--- a/src/os/linux/vm/attachListener_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/attachListener_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_attachListener_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/os.hpp"
+#include "services/attachListener.hpp"
+#include "services/dtraceAttacher.hpp"
 
 #include <unistd.h>
 #include <signal.h>
--- a/src/os/linux/vm/c1_globals_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/c1_globals_linux.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
+#ifndef OS_LINUX_VM_C1_GLOBALS_LINUX_HPP
+#define OS_LINUX_VM_C1_GLOBALS_LINUX_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 //
 // Sets the default values for operating system dependent flags used by the
 // client compiler. (see c1_globals.hpp)
 //
+
+#endif // OS_LINUX_VM_C1_GLOBALS_LINUX_HPP
--- a/src/os/linux/vm/c2_globals_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/c2_globals_linux.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
+#ifndef OS_LINUX_VM_C2_GLOBALS_LINUX_HPP
+#define OS_LINUX_VM_C2_GLOBALS_LINUX_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 //
 // Sets the default values for operating system dependent flags used by the
 // server compiler. (see c2_globals.hpp)
 //
+
+#endif // OS_LINUX_VM_C2_GLOBALS_LINUX_HPP
--- a/src/os/linux/vm/chaitin_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/chaitin_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_chaitin_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/machnode.hpp"
 
 void PhaseRegAlloc::pd_preallocate_hook() {
   // no action
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/linux/vm/decoder_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "prims/jvm.h"
+#include "utilities/decoder.hpp"
+
+#include <cxxabi.h>
+
+bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
+  int   status;
+  char* result;
+  size_t size = (size_t)buflen;
+
+  // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small,
+  // __cxa_demangle will call system "realloc" for additional memory, which
+  // may use different malloc/realloc mechanism that allocates 'buf'.
+  if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) {
+    jio_snprintf(buf, buflen, "%s", result);
+      // call c library's free
+      ::free(result);
+      return true;
+  }
+  return false;
+}
--- a/src/os/linux/vm/dtraceJSDT_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/dtraceJSDT_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_dtraceJSDT_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 int DTraceJSDT::pd_activate(
     void* baseAddress, jstring module,
--- a/src/os/linux/vm/globals_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/globals_linux.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_LINUX_VM_GLOBALS_LINUX_HPP
+#define OS_LINUX_VM_GLOBALS_LINUX_HPP
+
 //
 // Defines Linux specific flags. They are not available on other platforms.
 //
@@ -42,3 +45,5 @@
 define_pd_global(bool, UseLargePagesIndividualAllocation, false);
 define_pd_global(bool, UseOSErrorReporting, false);
 define_pd_global(bool, UseThreadPriorities, true) ;
+
+#endif // OS_LINUX_VM_GLOBALS_LINUX_HPP
--- a/src/os/linux/vm/hpi_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1999, 2006, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-# include "incls/_precompiled.incl"
-# include "incls/_hpi_linux.cpp.incl"
-
-# include <sys/param.h>
-# include <dlfcn.h>
-
-typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
-
-void hpi::initialize_get_interface(vm_calls_t *callbacks) {
-    char buf[JVM_MAXPATHLEN];
-    void *hpi_handle;
-    GetInterfaceFunc& getintf = _get_interface;
-    jint (JNICALL * DLL_Initialize)(GetInterfaceFunc *, void *);
-
-    if (HPILibPath && HPILibPath[0]) {
-      strncpy(buf, HPILibPath, JVM_MAXPATHLEN - 1);
-      buf[JVM_MAXPATHLEN - 1] = '\0';
-    } else {
-      const char *thread_type = "native_threads";
-
-      os::jvm_path(buf, JVM_MAXPATHLEN);
-
-#ifdef PRODUCT
-      const char * hpi_lib = "/libhpi.so";
-#else
-      char * ptr = strrchr(buf, '/');
-      assert(strstr(ptr, "/libjvm") == ptr, "invalid library name");
-      const char * hpi_lib = strstr(ptr, "_g") ? "/libhpi_g.so" : "/libhpi.so";
-#endif
-
-      *(strrchr(buf, '/')) = '\0';  /* get rid of /libjvm.so */
-      char* p = strrchr(buf, '/');
-      if (p != NULL) p[1] = '\0';   /* get rid of hotspot    */
-      strcat(buf, thread_type);
-      strcat(buf, hpi_lib);
-    }
-
-    if (TraceHPI) tty->print_cr("Loading HPI %s ", buf);
-#ifdef SPARC
-    // On 64-bit Ubuntu Sparc RTLD_NOW leads to unresolved deps in libpthread.so
-#   define OPEN_MODE RTLD_LAZY
-#else
-    // We use RTLD_NOW because of bug 4032715
-#   define OPEN_MODE RTLD_NOW
-#endif
-    hpi_handle = dlopen(buf, OPEN_MODE);
-#undef OPEN_MODE
-
-    if (hpi_handle == NULL) {
-        if (TraceHPI) tty->print_cr("HPI dlopen failed: %s", dlerror());
-        return;
-    }
-    DLL_Initialize = CAST_TO_FN_PTR(jint (JNICALL *)(GetInterfaceFunc *, void *),
-                                    dlsym(hpi_handle, "DLL_Initialize"));
-    if (TraceHPI && DLL_Initialize == NULL) tty->print_cr("HPI dlsym of DLL_Initialize failed: %s", dlerror());
-    if (DLL_Initialize == NULL ||
-        (*DLL_Initialize)(&getintf, callbacks) < 0) {
-        if (TraceHPI) tty->print_cr("HPI DLL_Initialize failed");
-        return;
-    }
-    if (TraceHPI)  tty->print_cr("HPI loaded successfully");
-}
--- a/src/os/linux/vm/hpi_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-//
-// Because the interruptible IO has been dropped for HotSpot/Linux,
-// the following HPI interface is very different from HotSparc.
-//
-
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/poll.h>
-#include <sys/ioctl.h>
-#include <netdb.h>
-
-// HPI_FileInterface
-
-inline int hpi::close(int fd) {
-  return ::close(fd);
-}
-
-inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
-  size_t res;
-  RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);
-  return res;
-}
-
-inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) {
-  size_t res;
-  RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
-  return res;
-}
-
-
-// HPI_SocketInterface
-
-inline int hpi::socket_close(int fd) {
-  return ::close(fd);
-}
-
-inline int hpi::socket(int domain, int type, int protocol) {
-  return ::socket(domain, type, protocol);
-}
-
-inline int hpi::recv(int fd, char *buf, int nBytes, int flags) {
-  RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags));
-}
-
-inline int hpi::send(int fd, char *buf, int nBytes, int flags) {
-  RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags));
-}
-
-inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) {
-  return send(fd, buf, nBytes, flags);
-}
-
-inline int hpi::timeout(int fd, long timeout) {
-  julong prevtime,newtime;
-  struct timeval t;
-
-  gettimeofday(&t, NULL);
-  prevtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec / 1000;
-
-  for(;;) {
-    struct pollfd pfd;
-
-    pfd.fd = fd;
-    pfd.events = POLLIN | POLLERR;
-
-    int res = ::poll(&pfd, 1, timeout);
-
-    if (res == OS_ERR && errno == EINTR) {
-
-      // On Linux any value < 0 means "forever"
-
-      if(timeout >= 0) {
-        gettimeofday(&t, NULL);
-        newtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec / 1000;
-        timeout -= newtime - prevtime;
-        if(timeout <= 0)
-          return OS_OK;
-        prevtime = newtime;
-      }
-    } else
-      return res;
-  }
-}
-
-inline int hpi::listen(int fd, int count) {
-  return ::listen(fd, count);
-}
-
-inline int hpi::connect(int fd, struct sockaddr *him, int len) {
-  RESTARTABLE_RETURN_INT(::connect(fd, him, len));
-}
-
-inline int hpi::accept(int fd, struct sockaddr *him, int *len) {
-  // This cast is from int to unsigned int on linux.  Since we
-  // only pass the parameter "len" around the vm and don't try to
-  // fetch it's value, this cast is safe for now. The java.net group
-  // may need and want to change this interface someday if socklen_t goes
-  // to 64 bits on some platform that we support.
-  // Linux doc says this can't return EINTR, unlike accept() on Solaris
-
-  return ::accept(fd, him, (socklen_t *)len);
-}
-
-inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags,
-                         sockaddr *from, int *fromlen) {
-  RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen));
-}
-
-inline int hpi::sendto(int fd, char *buf, int len, int flags,
-                        struct sockaddr *to, int tolen) {
-  RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen));
-}
-
-inline int hpi::socket_available(int fd, jint *pbytes) {
-  // Linux doc says EINTR not returned, unlike Solaris
-  int ret = ::ioctl(fd, FIONREAD, pbytes);
-
-  //%% note ioctl can return 0 when successful, JVM_SocketAvailable
-  // is expected to return 0 on failure and 1 on success to the jdk.
-  return (ret < 0) ? 0 : 1;
-}
-
-
-// following methods have been updated to avoid problems in
-// hpi's sockets calls based on sys_api_td.c (JDK1.3)
-
-/*
-HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown,
-        int, "%d",
-        (int fd, int howto),
-        ("fd = %d, howto = %d", fd, howto),
-        (fd, howto));
-        */
-inline int hpi::socket_shutdown(int fd, int howto){
-  return ::shutdown(fd, howto);
-}
-
-/*
-HPIDECL(bind, "bind", _socket, Bind,
-        int, "%d",
-        (int fd, struct sockaddr *him, int len),
-        ("fd = %d, him = %p, len = %d",
-         fd, him, len),
-        (fd, him, len));
-*/
-inline int hpi::bind(int fd, struct sockaddr *him, int len){
-  return ::bind(fd, him, len);
-}
-
-/*
-HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName,
-        int, "%d",
-        (int fd, struct sockaddr *him, int *len),
-        ("fd = %d, him = %p, len = %p",
-         fd, him, len),
-        (fd, him, len));
-        */
-inline int hpi::get_sock_name(int fd, struct sockaddr *him, int *len){
-  return ::getsockname(fd, him, (socklen_t *)len);
-}
-
-/*
-HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d",
-        (char *hostname, int namelen),
-        ("hostname = %p, namelen = %d",
-         hostname, namelen),
-        (hostname, namelen));
-        */
-inline int hpi::get_host_name(char* name, int namelen){
-  return ::gethostname(name, namelen);
-}
-
-/*
-HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d",
-        (int fd, int level, int optname, char *optval, int* optlen),
-        ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p",
-         fd, level, optname, optval, optlen),
-        (fd, level, optname, optval, optlen));
-        */
-inline int hpi::get_sock_opt(int fd, int level, int optname,
-                             char *optval, int* optlen){
-  return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen);
-}
-
-/*
-HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
-        (int fd, int level, int optname, const char *optval, int optlen),
-        ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
-         fd, level, optname, optval, optlen),
-        (fd, level, optname, optval, optlen));
-        */
-inline int hpi::set_sock_opt(int fd, int level, int optname,
-                             const char *optval, int optlen){
-  return ::setsockopt(fd, level, optname, optval, optlen);
-}
-
-
-// Reconciliation History
-// hpi_solaris.hpp      1.9 99/08/30 16:31:23
-// End
--- a/src/os/linux/vm/interfaceSupport_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/interfaceSupport_linux.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP
+#define OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP
+
 // Contains inlined functions for class InterfaceSupport
 
 static inline void serialize_memory(JavaThread *thread) {
   os::write_memory_serialize_page(thread);
 }
+
+#endif // OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP
--- a/src/os/linux/vm/jsig.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/jsig.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/os/linux/vm/jvm_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/jvm_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_jvm_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/osThread.hpp"
 
 #include <signal.h>
 
--- a/src/os/linux/vm/jvm_linux.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/jvm_linux.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_LINUX_VM_JVM_LINUX_H
+#define OS_LINUX_VM_JVM_LINUX_H
+
 /*
 // HotSpot integration note:
 //
@@ -95,3 +98,5 @@
 // Reconciliation History
 // jvm_solaris.h        1.6 99/06/22 16:38:47
 // End
+
+#endif // OS_LINUX_VM_JVM_LINUX_H
--- a/src/os/linux/vm/mutex_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/mutex_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_mutex_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "mutex_linux.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutex.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
 
 // put OS-includes here
 # include <signal.h>
--- a/src/os/linux/vm/mutex_linux.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/mutex_linux.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,16 @@
  *
  */
 
+#ifndef OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
+#define OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
+
+#include "os_linux.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "thread_linux.inline.hpp"
+
 
 // Reconciliation History
 // mutex_solaris.inline.hpp     1.5 99/06/22 16:38:49
 // End
+
+#endif // OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
--- a/src/os/linux/vm/osThread_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/osThread_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,23 @@
  *
  */
 
-// do not include  precompiled  header file
-# include "incls/_osThread_linux.cpp.incl"
+// no precompiled headers
+#include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+#endif
 
 
 void OSThread::pd_initialize() {
--- a/src/os/linux/vm/osThread_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/osThread_linux.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_LINUX_VM_OSTHREAD_LINUX_HPP
+#define OS_LINUX_VM_OSTHREAD_LINUX_HPP
+
  private:
   int _thread_type;
 
@@ -139,3 +142,5 @@
 // Reconciliation History
 // osThread_solaris.hpp 1.24 99/08/27 13:11:54
 // End
+
+#endif // OS_LINUX_VM_OSTHREAD_LINUX_HPP
--- a/src/os/linux/vm/os_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/os_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -24,8 +24,64 @@
 
 # define __STDC_FORMAT_MACROS
 
-// do not include  precompiled  header file
-# include "incls/_os_linux.cpp.incl"
+// no precompiled headers
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
+#include "mutex_linux.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/timer.hpp"
+#include "services/attachListener.hpp"
+#include "services/runtimeService.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+# include "nativeInst_zero.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // put OS-includes here
 # include <sys/types.h>
@@ -59,6 +115,7 @@
 # include <link.h>
 # include <stdint.h>
 # include <inttypes.h>
+# include <sys/ioctl.h>
 
 #define MAX_PATH    (2 * K)
 
@@ -1509,6 +1566,24 @@
 // unused on linux for now.
 void os::set_error_file(const char *logfile) {}
 
+
+// This method is a copy of JDK's sysGetLastErrorString
+// from src/solaris/hpi/src/system_md.c
+
+size_t os::lasterror(char *buf, size_t len) {
+
+  if (errno == 0)  return 0;
+
+  const char *s = ::strerror(errno);
+  size_t n = ::strlen(s);
+  if (n >= len) {
+    n = len - 1;
+  }
+  ::strncpy(buf, s, n);
+  buf[n] = '\0';
+  return n;
+}
+
 intx os::current_thread_id() { return (intx)pthread_self(); }
 int os::current_process_id() {
 
@@ -1615,14 +1690,23 @@
   Dl_info dlinfo;
 
   if (dladdr((void*)addr, &dlinfo) && dlinfo.dli_sname != NULL) {
-    if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
-    if (offset) *offset = addr - (address)dlinfo.dli_saddr;
+    if (buf != NULL) {
+      if(!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
+        jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
+      }
+    }
+    if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
     return true;
-  } else {
-    if (buf) buf[0] = '\0';
-    if (offset) *offset = -1;
-    return false;
+  } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
+    if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+       dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
+       return true;
+    }
   }
+
+  if (buf != NULL) buf[0] = '\0';
+  if (offset != NULL) *offset = -1;
+  return false;
 }
 
 struct _address_to_library_name {
@@ -1873,19 +1957,19 @@
 }
 
 
-bool _print_ascii_file(const char* filename, outputStream* st) {
-  int fd = open(filename, O_RDONLY);
+static bool _print_ascii_file(const char* filename, outputStream* st) {
+  int fd = ::open(filename, O_RDONLY);
   if (fd == -1) {
      return false;
   }
 
   char buf[32];
   int bytes;
-  while ((bytes = read(fd, buf, sizeof(buf))) > 0) {
+  while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
     st->print_raw(buf, bytes);
   }
 
-  close(fd);
+  ::close(fd);
 
   return true;
 }
@@ -2163,8 +2247,6 @@
           // Use current module name "libjvm[_g].so" instead of
           // "libjvm"debug_only("_g")".so" since for fastdebug version
           // we should have "libjvm.so" but debug_only("_g") adds "_g"!
-          // It is used when we are choosing the HPI library's name
-          // "libhpi[_g].so" in hpi::initialize_get_interface().
           len = strlen(buf);
           snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
         } else {
@@ -2348,18 +2430,18 @@
            os::get_temp_directory(), os::current_process_id(), num);
   unlink(buf);
 
-  int fd = open(buf, O_CREAT | O_RDWR, S_IRWXU);
+  int fd = ::open(buf, O_CREAT | O_RDWR, S_IRWXU);
 
   if (fd != -1) {
-    off_t rv = lseek(fd, size-2, SEEK_SET);
+    off_t rv = ::lseek(fd, size-2, SEEK_SET);
     if (rv != (off_t)-1) {
-      if (write(fd, "", 1) == 1) {
+      if (::write(fd, "", 1) == 1) {
         mmap(base, size,
              PROT_READ|PROT_WRITE|PROT_EXEC,
              MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE, fd, 0);
       }
     }
-    close(fd);
+    ::close(fd);
     unlink(buf);
   }
 }
@@ -3998,13 +4080,6 @@
   // Initialize lock used to serialize thread creation (see os::create_thread)
   Linux::set_createThread_lock(new Mutex(Mutex::leaf, "createThread_lock", false));
 
-  // Initialize HPI.
-  jint hpi_result = hpi::initialize();
-  if (hpi_result != JNI_OK) {
-    tty->print_cr("There was an error trying to initialize the HPI library.");
-    return hpi_result;
-  }
-
   // at-exit methods are called in the reverse order of their registration.
   // atexit functions are called on return from main or as a result of a
   // call to exit(3C). There can be only 32 of these functions registered
@@ -4202,7 +4277,7 @@
     errno = ENAMETOOLONG;
     return -1;
   }
-  hpi::native_path(strcpy(pathbuf, path));
+  os::native_path(strcpy(pathbuf, path));
   return ::stat(pathbuf, sbuf);
 }
 
@@ -4234,6 +4309,85 @@
   return result;
 }
 
+// This code originates from JDK's sysOpen and open64_w
+// from src/solaris/hpi/src/system_md.c
+
+#ifndef O_DELETE
+#define O_DELETE 0x10000
+#endif
+
+// Open a file. Unlink the file immediately after open returns
+// if the specified oflag has the O_DELETE flag set.
+// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
+
+int os::open(const char *path, int oflag, int mode) {
+
+  if (strlen(path) > MAX_PATH - 1) {
+    errno = ENAMETOOLONG;
+    return -1;
+  }
+  int fd;
+  int o_delete = (oflag & O_DELETE);
+  oflag = oflag & ~O_DELETE;
+
+  fd = ::open64(path, oflag, mode);
+  if (fd == -1) return -1;
+
+  //If the open succeeded, the file might still be a directory
+  {
+    struct stat64 buf64;
+    int ret = ::fstat64(fd, &buf64);
+    int st_mode = buf64.st_mode;
+
+    if (ret != -1) {
+      if ((st_mode & S_IFMT) == S_IFDIR) {
+        errno = EISDIR;
+        ::close(fd);
+        return -1;
+      }
+    } else {
+      ::close(fd);
+      return -1;
+    }
+  }
+
+    /*
+     * All file descriptors that are opened in the JVM and not
+     * specifically destined for a subprocess should have the
+     * close-on-exec flag set.  If we don't set it, then careless 3rd
+     * party native code might fork and exec without closing all
+     * appropriate file descriptors (e.g. as we do in closeDescriptors in
+     * UNIXProcess.c), and this in turn might:
+     *
+     * - cause end-of-file to fail to be detected on some file
+     *   descriptors, resulting in mysterious hangs, or
+     *
+     * - might cause an fopen in the subprocess to fail on a system
+     *   suffering from bug 1085341.
+     *
+     * (Yes, the default setting of the close-on-exec flag is a Unix
+     * design flaw)
+     *
+     * See:
+     * 1085341: 32-bit stdio routines should support file descriptors >255
+     * 4843136: (process) pipe file descriptor from Runtime.exec not being closed
+     * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9
+     */
+#ifdef FD_CLOEXEC
+    {
+        int flags = ::fcntl(fd, F_GETFD);
+        if (flags != -1)
+            ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+    }
+#endif
+
+  if (o_delete != 0) {
+    ::unlink(path);
+  }
+  return fd;
+}
+
+
 // create binary file, rewriting existing file if required
 int os::create_binary_file(const char* path, bool rewrite_existing) {
   int oflags = O_WRONLY | O_CREAT;
@@ -4253,6 +4407,49 @@
   return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET);
 }
 
+// This code originates from JDK's sysAvailable
+// from src/solaris/hpi/src/native_threads/src/sys_api_td.c
+
+int os::available(int fd, jlong *bytes) {
+  jlong cur, end;
+  int mode;
+  struct stat64 buf64;
+
+  if (::fstat64(fd, &buf64) >= 0) {
+    mode = buf64.st_mode;
+    if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) {
+      /*
+      * XXX: is the following call interruptible? If so, this might
+      * need to go through the INTERRUPT_IO() wrapper as for other
+      * blocking, interruptible calls in this file.
+      */
+      int n;
+      if (::ioctl(fd, FIONREAD, &n) >= 0) {
+        *bytes = n;
+        return 1;
+      }
+    }
+  }
+  if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) {
+    return 0;
+  } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) {
+    return 0;
+  } else if (::lseek64(fd, cur, SEEK_SET) == -1) {
+    return 0;
+  }
+  *bytes = end - cur;
+  return 1;
+}
+
+int os::socket_available(int fd, jint *pbytes) {
+  // Linux doc says EINTR not returned, unlike Solaris
+  int ret = ::ioctl(fd, FIONREAD, pbytes);
+
+  //%% note ioctl can return 0 when successful, JVM_SocketAvailable
+  // is expected to return 0 on failure and 1 on success to the jdk.
+  return (ret < 0) ? 0 : 1;
+}
+
 // Map a block of memory.
 char* os::map_memory(int fd, const char* file_name, size_t file_offset,
                      char *addr, size_t bytes, bool read_only,
@@ -4479,7 +4676,7 @@
   int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
   if (fd != -1) {
     struct stat buf;
-    close(fd);
+    ::close(fd);
     while (::stat(filename, &buf) == 0) {
       (void)::poll(NULL, 0, 100);
     }
--- a/src/os/linux/vm/os_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/os_linux.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_LINUX_VM_OS_LINUX_HPP
+#define OS_LINUX_VM_OS_LINUX_HPP
+
 // Linux_OS defines the interface to Linux operating systems
 
 /* pthread_getattr_np comes with LinuxThreads-0.9-7 on RedHat 7.1 */
@@ -328,3 +331,5 @@
       assert_status(status == 0, status, "mutex_init");
     }
 } ;
+
+#endif // OS_LINUX_VM_OS_LINUX_HPP
--- a/src/os/linux/vm/os_linux.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/os_linux.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,31 @@
  *
  */
 
+#ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
+#define OS_LINUX_VM_OS_LINUX_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "atomic_linux_x86.inline.hpp"
+# include "orderAccess_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "atomic_linux_sparc.inline.hpp"
+# include "orderAccess_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "atomic_linux_zero.inline.hpp"
+# include "orderAccess_linux_zero.inline.hpp"
+#endif
+
+// System includes
+
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/poll.h>
+#include <netdb.h>
+
 inline void* os::thread_local_storage_at(int index) {
   return pthread_getspecific((pthread_key_t)index);
 }
@@ -75,6 +100,12 @@
 inline void os::bang_stack_shadow_pages() {
 }
 
+inline void os::dll_unload(void *lib) {
+  ::dlclose(lib);
+}
+
+inline const int os::default_file_open_flags() { return 0;}
+
 inline DIR* os::opendir(const char* dirname)
 {
   assert(dirname != NULL, "just checking");
@@ -86,6 +117,22 @@
   return NAME_MAX + sizeof(dirent) + 1;
 }
 
+inline jlong os::lseek(int fd, jlong offset, int whence) {
+  return (jlong) ::lseek64(fd, offset, whence);
+}
+
+inline int os::fsync(int fd) {
+  return ::fsync(fd);
+}
+
+inline char* os::native_path(char *path) {
+  return path;
+}
+
+inline int os::ftruncate(int fd, jlong length) {
+  return ::ftruncate64(fd, length);
+}
+
 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
 {
   dirent* p;
@@ -103,9 +150,8 @@
     return p;
 }
 
-inline int os::closedir(DIR *dirp)
-{
-  assert(dirp != NULL, "just checking");
+inline int os::closedir(DIR *dirp) {
+  assert(dirp != NULL, "argument is NULL");
   return ::closedir(dirp);
 }
 
@@ -123,3 +169,130 @@
 
 inline bool os::numa_has_static_binding()   { return true; }
 inline bool os::numa_has_group_homing()     { return false;  }
+
+inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
+  size_t res;
+  RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);
+  return res;
+}
+
+inline size_t os::write(int fd, const void *buf, unsigned int nBytes) {
+  size_t res;
+  RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
+  return res;
+}
+
+inline int os::close(int fd) {
+  return ::close(fd);
+}
+
+inline int os::socket_close(int fd) {
+  return ::close(fd);
+}
+
+inline int os::socket(int domain, int type, int protocol) {
+  return ::socket(domain, type, protocol);
+}
+
+inline int os::recv(int fd, char *buf, int nBytes, int flags) {
+  RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags));
+}
+
+inline int os::send(int fd, char *buf, int nBytes, int flags) {
+  RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags));
+}
+
+inline int os::raw_send(int fd, char *buf, int nBytes, int flags) {
+  return os::send(fd, buf, nBytes, flags);
+}
+
+inline int os::timeout(int fd, long timeout) {
+  julong prevtime,newtime;
+  struct timeval t;
+
+  gettimeofday(&t, NULL);
+  prevtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec / 1000;
+
+  for(;;) {
+    struct pollfd pfd;
+
+    pfd.fd = fd;
+    pfd.events = POLLIN | POLLERR;
+
+    int res = ::poll(&pfd, 1, timeout);
+
+    if (res == OS_ERR && errno == EINTR) {
+
+      // On Linux any value < 0 means "forever"
+
+      if(timeout >= 0) {
+        gettimeofday(&t, NULL);
+        newtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec / 1000;
+        timeout -= newtime - prevtime;
+        if(timeout <= 0)
+          return OS_OK;
+        prevtime = newtime;
+      }
+    } else
+      return res;
+  }
+}
+
+inline int os::listen(int fd, int count) {
+  return ::listen(fd, count);
+}
+
+inline int os::connect(int fd, struct sockaddr *him, int len) {
+  RESTARTABLE_RETURN_INT(::connect(fd, him, len));
+}
+
+inline int os::accept(int fd, struct sockaddr *him, int *len) {
+  // This cast is from int to unsigned int on linux.  Since we
+  // only pass the parameter "len" around the vm and don't try to
+  // fetch it's value, this cast is safe for now. The java.net group
+  // may need and want to change this interface someday if socklen_t goes
+  // to 64 bits on some platform that we support.
+  // Linux doc says this can't return EINTR, unlike accept() on Solaris
+
+  return ::accept(fd, him, (socklen_t *)len);
+}
+
+inline int os::recvfrom(int fd, char *buf, int nBytes, int flags,
+                         sockaddr *from, int *fromlen) {
+  RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen));
+}
+
+inline int os::sendto(int fd, char *buf, int len, int flags,
+                        struct sockaddr *to, int tolen) {
+  RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen));
+}
+
+inline int os::socket_shutdown(int fd, int howto){
+  return ::shutdown(fd, howto);
+}
+
+inline int os::bind(int fd, struct sockaddr *him, int len){
+  return ::bind(fd, him, len);
+}
+
+inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){
+  return ::getsockname(fd, him, (socklen_t *)len);
+}
+
+inline int os::get_host_name(char* name, int namelen){
+  return ::gethostname(name, namelen);
+}
+
+inline struct hostent*  os::get_host_by_name(char* name) {
+  return ::gethostbyname(name);
+}
+inline int os::get_sock_opt(int fd, int level, int optname,
+                             char *optval, int* optlen){
+  return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen);
+}
+
+inline int os::set_sock_opt(int fd, int level, int optname,
+                             const char *optval, int optlen){
+  return ::setsockopt(fd, level, optname, optval, optlen);
+}
+#endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP
--- a/src/os/linux/vm/os_share_linux.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/os_share_linux.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_LINUX_VM_OS_SHARE_LINUX_HPP
+#define OS_LINUX_VM_OS_SHARE_LINUX_HPP
+
 // misc
 void signalHandler(int, siginfo_t*, ucontext_t*);
 void handle_unexpected_exception(Thread* thread, int sig, siginfo_t* info, address pc, address adjusted_pc);
@@ -30,3 +33,5 @@
 #endif
 
 #define PROCFILE_LENGTH 128
+
+#endif // OS_LINUX_VM_OS_SHARE_LINUX_HPP
--- a/src/os/linux/vm/perfMemory_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/perfMemory_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_perfMemory_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_linux.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/perfMemory.hpp"
+#include "utilities/exceptions.hpp"
 
 // put OS-includes here
 # include <sys/types.h>
--- a/src/os/linux/vm/stubRoutines_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/stubRoutines_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,7 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
+
--- a/src/os/linux/vm/threadCritical_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/threadCritical_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadCritical_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadCritical.hpp"
+#include "thread_linux.inline.hpp"
 
 // put OS-includes here
 # include <pthread.h>
--- a/src/os/linux/vm/thread_linux.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/thread_linux.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,31 @@
  *
  */
 
+#ifndef OS_LINUX_VM_THREAD_LINUX_INLINE_HPP
+#define OS_LINUX_VM_THREAD_LINUX_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/prefetch.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "atomic_linux_x86.inline.hpp"
+# include "orderAccess_linux_x86.inline.hpp"
+# include "prefetch_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "atomic_linux_sparc.inline.hpp"
+# include "orderAccess_linux_sparc.inline.hpp"
+# include "prefetch_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "atomic_linux_zero.inline.hpp"
+# include "orderAccess_linux_zero.inline.hpp"
+# include "prefetch_linux_zero.inline.hpp"
+#endif
+
 // Contains inlined functions for class Thread and ThreadLocalStorage
 
 inline void ThreadLocalStorage::pd_invalidate_all() {} // nothing to do
+
+#endif // OS_LINUX_VM_THREAD_LINUX_INLINE_HPP
--- a/src/os/linux/vm/vmError_linux.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/linux/vm/vmError_linux.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmError_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/vmError.hpp"
 
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -41,11 +44,11 @@
     jio_snprintf(p, buflen - len,
                "\n\n"
                "Do you want to debug the problem?\n\n"
-               "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT "\n"
+               "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT " (" INTPTR_FORMAT ")\n"
                "Enter 'yes' to launch gdb automatically (PATH must include gdb)\n"
                "Otherwise, press RETURN to abort...",
                os::current_process_id(), os::current_process_id(),
-               os::current_thread_id());
+               os::current_thread_id(), os::current_thread_id());
 
     yes = os::message_box("Unexpected Error", buf);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/posix/launcher/java_md.c	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,1876 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+
+#include "java.h"
+#include <dirent.h>
+#include <dlfcn.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#ifndef GAMMA
+#include "manifest_info.h"
+#include "version_comp.h"
+#endif
+
+#ifdef __linux__
+#include <pthread.h>
+#else
+#include <thread.h>
+#endif
+
+#define JVM_DLL "libjvm.so"
+#define JAVA_DLL "libjava.so"
+
+#ifndef GAMMA   /* launcher.make defines ARCH */
+/*
+ * If a processor / os combination has the ability to run binaries of
+ * two data models and cohabitation of jre/jdk bits with both data
+ * models is supported, then DUAL_MODE is defined.  When DUAL_MODE is
+ * defined, the architecture names for the narrow and wide version of
+ * the architecture are defined in LIBARCH64NAME and LIBARCH32NAME.  Currently
+ * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux
+ * i586/amd64 could be defined as DUAL_MODE but that is not the
+ * current policy.
+ */
+
+#ifndef LIBARCHNAME
+#  error "The macro LIBARCHNAME was not defined on the compile line"
+#endif
+
+#ifdef __sun
+#  define DUAL_MODE
+#  ifndef LIBARCH32NAME
+#    error "The macro LIBARCH32NAME was not defined on the compile line"
+#  endif
+#  ifndef LIBARCH64NAME
+#    error "The macro LIBARCH64NAME was not defined on the compile line"
+#  endif
+#  include <sys/systeminfo.h>
+#  include <sys/elf.h>
+#  include <stdio.h>
+#endif
+
+#endif /* ifndef GAMMA */
+
+/* pointer to environment */
+extern char **environ;
+
+#ifndef GAMMA
+/*
+ *      A collection of useful strings. One should think of these as #define
+ *      entries, but actual strings can be more efficient (with many compilers).
+ */
+#ifdef __linux__
+static const char *system_dir   = "/usr/java";
+static const char *user_dir     = "/java";
+#else /* Solaris */
+static const char *system_dir   = "/usr/jdk";
+static const char *user_dir     = "/jdk";
+#endif
+
+#endif /* ifndef GAMMA */
+
+/*
+ * Flowchart of launcher execs and options processing on unix
+ *
+ * The selection of the proper vm shared library to open depends on
+ * several classes of command line options, including vm "flavor"
+ * options (-client, -server) and the data model options, -d32  and
+ * -d64, as well as a version specification which may have come from
+ * the command line or from the manifest of an executable jar file.
+ * The vm selection options are not passed to the running
+ * virtual machine; they must be screened out by the launcher.
+ *
+ * The version specification (if any) is processed first by the
+ * platform independent routine SelectVersion.  This may result in
+ * the exec of the specified launcher version.
+ *
+ * Typically, the launcher execs at least once to ensure a suitable
+ * LD_LIBRARY_PATH is in effect for the process.  The first exec
+ * screens out all the data model options; leaving the choice of data
+ * model implicit in the binary selected to run.  However, in case no
+ * exec is done, the data model options are screened out before the vm
+ * is invoked.
+ *
+ *  incoming argv ------------------------------
+ *  |                                          |
+ * \|/                                         |
+ * CheckJVMType                                |
+ * (removes -client, -server, etc.)            |
+ *                                            \|/
+ *                                            CreateExecutionEnvironment
+ *                                            (removes -d32 and -d64,
+ *                                             determines desired data model,
+ *                                             sets up LD_LIBRARY_PATH,
+ *                                             and exec's)
+ *                                             |
+ *  --------------------------------------------
+ *  |
+ * \|/
+ * exec child 1 incoming argv -----------------
+ *  |                                          |
+ * \|/                                         |
+ * CheckJVMType                                |
+ * (removes -client, -server, etc.)            |
+ *  |                                         \|/
+ *  |                                          CreateExecutionEnvironment
+ *  |                                          (verifies desired data model
+ *  |                                           is running and acceptable
+ *  |                                           LD_LIBRARY_PATH;
+ *  |                                           no-op in child)
+ *  |
+ * \|/
+ * TranslateDashJArgs...
+ * (Prepare to pass args to vm)
+ *  |
+ *  |
+ *  |
+ * \|/
+ * ParseArguments
+ * (ignores -d32 and -d64,
+ *  processes version options,
+ *  creates argument list for vm,
+ *  etc.)
+ *
+ */
+
+static char *SetExecname(char **argv);
+static char * GetExecname();
+static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
+                           char *jvmpath, jint jvmpathsize, char * arch);
+static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative);
+
+#ifndef GAMMA
+const char *
+GetArch()
+{
+    return LIBARCHNAME;
+}
+#endif /* ifndef GAMMA */
+
+void
+CreateExecutionEnvironment(int *_argcp,
+                           char ***_argvp,
+                           char jrepath[],
+                           jint so_jrepath,
+                           char jvmpath[],
+                           jint so_jvmpath,
+                           char **original_argv) {
+  /*
+   * First, determine if we are running the desired data model.  If we
+   * are running the desired data model, all the error messages
+   * associated with calling GetJREPath, ReadKnownVMs, etc. should be
+   * output.  However, if we are not running the desired data model,
+   * some of the errors should be suppressed since it is more
+   * informative to issue an error message based on whether or not the
+   * os/processor combination has dual mode capabilities.
+   */
+
+    char *execname = NULL;
+    int original_argc = *_argcp;
+    jboolean jvmpathExists;
+
+    /* Compute the name of the executable */
+    execname = SetExecname(*_argvp);
+
+#ifndef GAMMA
+    /* Set the LD_LIBRARY_PATH environment variable, check data model
+       flags, and exec process, if needed */
+    {
+      char *arch        = (char *)GetArch(); /* like sparc or sparcv9 */
+      char * jvmtype    = NULL;
+      int argc          = *_argcp;
+      char **argv       = original_argv;
+
+      char *runpath     = NULL; /* existing effective LD_LIBRARY_PATH
+                                   setting */
+
+      int running       =       /* What data model is being ILP32 =>
+                                   32 bit vm; LP64 => 64 bit vm */
+#ifdef _LP64
+        64;
+#else
+      32;
+#endif
+
+      int wanted        = running;      /* What data mode is being
+                                           asked for? Current model is
+                                           fine unless another model
+                                           is asked for */
+
+      char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */
+      char* newpath     = NULL; /* path on new LD_LIBRARY_PATH */
+      char* lastslash   = NULL;
+
+      char** newenvp    = NULL; /* current environment */
+
+      char** newargv    = NULL;
+      int    newargc    = 0;
+#ifdef __sun
+      char*  dmpath     = NULL;  /* data model specific LD_LIBRARY_PATH,
+                                    Solaris only */
+#endif
+
+      /*
+       * Starting in 1.5, all unix platforms accept the -d32 and -d64
+       * options.  On platforms where only one data-model is supported
+       * (e.g. ia-64 Linux), using the flag for the other data model is
+       * an error and will terminate the program.
+       */
+
+      { /* open new scope to declare local variables */
+        int i;
+
+        newargv = (char **)JLI_MemAlloc((argc+1) * sizeof(*newargv));
+        newargv[newargc++] = argv[0];
+
+        /* scan for data model arguments and remove from argument list;
+           last occurrence determines desired data model */
+        for (i=1; i < argc; i++) {
+
+          if (strcmp(argv[i], "-J-d64") == 0 || strcmp(argv[i], "-d64") == 0) {
+            wanted = 64;
+            continue;
+          }
+          if (strcmp(argv[i], "-J-d32") == 0 || strcmp(argv[i], "-d32") == 0) {
+            wanted = 32;
+            continue;
+          }
+          newargv[newargc++] = argv[i];
+
+#ifdef JAVA_ARGS
+          if (argv[i][0] != '-')
+            continue;
+#else
+          if (strcmp(argv[i], "-classpath") == 0 || strcmp(argv[i], "-cp") == 0) {
+            i++;
+            if (i >= argc) break;
+            newargv[newargc++] = argv[i];
+            continue;
+          }
+          if (argv[i][0] != '-') { i++; break; }
+#endif
+        }
+
+        /* copy rest of args [i .. argc) */
+        while (i < argc) {
+          newargv[newargc++] = argv[i++];
+        }
+        newargv[newargc] = NULL;
+
+        /*
+         * newargv has all proper arguments here
+         */
+
+        argc = newargc;
+        argv = newargv;
+      }
+
+      /* If the data model is not changing, it is an error if the
+         jvmpath does not exist */
+      if (wanted == running) {
+        /* Find out where the JRE is that we will be using. */
+        if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
+          fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
+          exit(2);
+        }
+
+        /* Find the specified JVM type */
+        if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) {
+          fprintf(stderr, "Error: no known VMs. (check for corrupt jvm.cfg file)\n");
+          exit(1);
+        }
+
+        jvmpath[0] = '\0';
+        jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE);
+
+        if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) {
+          fprintf(stderr, "Error: no `%s' JVM at `%s'.\n", jvmtype, jvmpath);
+          exit(4);
+        }
+      } else {  /* do the same speculatively or exit */
+#ifdef DUAL_MODE
+        if (running != wanted) {
+          /* Find out where the JRE is that we will be using. */
+          if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE)) {
+            goto EndDataModelSpeculate;
+          }
+
+          /*
+           * Read in jvm.cfg for target data model and process vm
+           * selection options.
+           */
+          if (ReadKnownVMs(jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE) < 1) {
+            goto EndDataModelSpeculate;
+          }
+          jvmpath[0] = '\0';
+          jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE);
+          /* exec child can do error checking on the existence of the path */
+          jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath,
+                                     ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME));
+
+        }
+      EndDataModelSpeculate: /* give up and let other code report error message */
+        ;
+#else
+        fprintf(stderr, "Running a %d-bit JVM is not supported on this platform.\n", wanted);
+        exit(1);
+#endif
+      }
+
+      /*
+       * We will set the LD_LIBRARY_PATH as follows:
+       *
+       *     o          $JVMPATH (directory portion only)
+       *     o          $JRE/lib/$LIBARCHNAME
+       *     o          $JRE/../lib/$LIBARCHNAME
+       *
+       * followed by the user's previous effective LD_LIBRARY_PATH, if
+       * any.
+       */
+
+#ifdef __sun
+      /*
+       * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH
+       * variables:
+       *
+       * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if
+       * data-model specific variables are not set.
+       *
+       * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH
+       * for 64-bit binaries.
+       *
+       * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH
+       * for 32-bit binaries.
+       *
+       * The vm uses LD_LIBRARY_PATH to set the java.library.path system
+       * property.  To shield the vm from the complication of multiple
+       * LD_LIBRARY_PATH variables, if the appropriate data model
+       * specific variable is set, we will act as if LD_LIBRARY_PATH had
+       * the value of the data model specific variant and the data model
+       * specific variant will be unset.  Note that the variable for the
+       * *wanted* data model must be used (if it is set), not simply the
+       * current running data model.
+       */
+
+      switch(wanted) {
+      case 0:
+        if(running == 32) {
+          dmpath = getenv("LD_LIBRARY_PATH_32");
+          wanted = 32;
+        }
+        else {
+          dmpath = getenv("LD_LIBRARY_PATH_64");
+          wanted = 64;
+        }
+        break;
+
+      case 32:
+        dmpath = getenv("LD_LIBRARY_PATH_32");
+        break;
+
+      case 64:
+        dmpath = getenv("LD_LIBRARY_PATH_64");
+        break;
+
+      default:
+        fprintf(stderr, "Improper value at line %d.", __LINE__);
+        exit(1); /* unknown value in wanted */
+        break;
+      }
+
+      /*
+       * If dmpath is NULL, the relevant data model specific variable is
+       * not set and normal LD_LIBRARY_PATH should be used.
+       */
+      if( dmpath == NULL) {
+        runpath = getenv("LD_LIBRARY_PATH");
+      }
+      else {
+        runpath = dmpath;
+      }
+#else
+      /*
+       * If not on Solaris, assume only a single LD_LIBRARY_PATH
+       * variable.
+       */
+      runpath = getenv("LD_LIBRARY_PATH");
+#endif /* __sun */
+
+#ifdef __linux
+      /*
+       * On linux, if a binary is running as sgid or suid, glibc sets
+       * LD_LIBRARY_PATH to the empty string for security purposes.  (In
+       * contrast, on Solaris the LD_LIBRARY_PATH variable for a
+       * privileged binary does not lose its settings; but the dynamic
+       * linker does apply more scrutiny to the path.) The launcher uses
+       * the value of LD_LIBRARY_PATH to prevent an exec loop.
+       * Therefore, if we are running sgid or suid, this function's
+       * setting of LD_LIBRARY_PATH will be ineffective and we should
+       * return from the function now.  Getting the right libraries to
+       * be found must be handled through other mechanisms.
+       */
+      if((getgid() != getegid()) || (getuid() != geteuid()) ) {
+        return;
+      }
+#endif
+
+      /* runpath contains current effective LD_LIBRARY_PATH setting */
+
+      jvmpath = JLI_StringDup(jvmpath);
+      new_runpath = JLI_MemAlloc( ((runpath!=NULL)?strlen(runpath):0) +
+                              2*strlen(jrepath) + 2*strlen(arch) +
+                              strlen(jvmpath) + 52);
+      newpath = new_runpath + strlen("LD_LIBRARY_PATH=");
+
+
+      /*
+       * Create desired LD_LIBRARY_PATH value for target data model.
+       */
+      {
+        /* remove the name of the .so from the JVM path */
+        lastslash = strrchr(jvmpath, '/');
+        if (lastslash)
+          *lastslash = '\0';
+
+
+        /* jvmpath, ((running != wanted)?((wanted==64)?"/"LIBARCH64NAME:"/.."):""), */
+
+        sprintf(new_runpath, "LD_LIBRARY_PATH="
+                "%s:"
+                "%s/lib/%s:"
+                "%s/../lib/%s",
+                jvmpath,
+#ifdef DUAL_MODE
+                jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME),
+                jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME)
+#else
+                jrepath, arch,
+                jrepath, arch
+#endif
+                );
+
+
+        /*
+         * Check to make sure that the prefix of the current path is the
+         * desired environment variable setting.
+         */
+        if (runpath != NULL &&
+            strncmp(newpath, runpath, strlen(newpath))==0 &&
+            (runpath[strlen(newpath)] == 0 || runpath[strlen(newpath)] == ':') &&
+            (running == wanted) /* data model does not have to be changed */
+#ifdef __sun
+            && (dmpath == NULL)    /* data model specific variables not set  */
+#endif
+            ) {
+
+          return;
+
+        }
+      }
+
+      /*
+       * Place the desired environment setting onto the prefix of
+       * LD_LIBRARY_PATH.  Note that this prevents any possible infinite
+       * loop of execv() because we test for the prefix, above.
+       */
+      if (runpath != 0) {
+        strcat(new_runpath, ":");
+        strcat(new_runpath, runpath);
+      }
+
+      if( putenv(new_runpath) != 0) {
+        exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set
+                    properly */
+      }
+
+      /*
+       * Unix systems document that they look at LD_LIBRARY_PATH only
+       * once at startup, so we have to re-exec the current executable
+       * to get the changed environment variable to have an effect.
+       */
+
+#ifdef __sun
+      /*
+       * If dmpath is not NULL, remove the data model specific string
+       * in the environment for the exec'ed child.
+       */
+
+      if( dmpath != NULL)
+        (void)UnsetEnv((wanted==32)?"LD_LIBRARY_PATH_32":"LD_LIBRARY_PATH_64");
+#endif
+
+      newenvp = environ;
+
+      {
+        char *newexec = execname;
+#ifdef DUAL_MODE
+        /*
+         * If the data model is being changed, the path to the
+         * executable must be updated accordingly; the executable name
+         * and directory the executable resides in are separate.  In the
+         * case of 32 => 64, the new bits are assumed to reside in, e.g.
+         * "olddir/LIBARCH64NAME/execname"; in the case of 64 => 32,
+         * the bits are assumed to be in "olddir/../execname".  For example,
+         *
+         * olddir/sparcv9/execname
+         * olddir/amd64/execname
+         *
+         * for Solaris SPARC and Linux amd64, respectively.
+         */
+
+        if (running != wanted) {
+          char *oldexec = strcpy(JLI_MemAlloc(strlen(execname) + 1), execname);
+          char *olddir = oldexec;
+          char *oldbase = strrchr(oldexec, '/');
+
+
+          newexec = JLI_MemAlloc(strlen(execname) + 20);
+          *oldbase++ = 0;
+          sprintf(newexec, "%s/%s/%s", olddir,
+                  ((wanted==64) ? LIBARCH64NAME : ".."), oldbase);
+          argv[0] = newexec;
+        }
+#endif
+
+        (void)fflush(stdout);
+        (void)fflush(stderr);
+        execve(newexec, argv, newenvp);
+        perror("execve()");
+
+        fprintf(stderr, "Error trying to exec %s.\n", newexec);
+        fprintf(stderr, "Check if file exists and permissions are set correctly.\n");
+
+#ifdef DUAL_MODE
+        if (running != wanted) {
+          fprintf(stderr, "Failed to start a %d-bit JVM process from a %d-bit JVM.\n",
+                  wanted, running);
+#  ifdef __sun
+
+#    ifdef __sparc
+          fprintf(stderr, "Verify all necessary J2SE components have been installed.\n" );
+          fprintf(stderr,
+                  "(Solaris SPARC 64-bit components must be installed after 32-bit components.)\n" );
+#    else
+          fprintf(stderr, "Either 64-bit processes are not supported by this platform\n");
+          fprintf(stderr, "or the 64-bit components have not been installed.\n");
+#    endif
+        }
+#  endif
+#endif
+
+      }
+
+      exit(1);
+    }
+
+#else  /* ifndef GAMMA */
+
+  /*
+   * gamma launcher is simpler in that it doesn't handle VM flavors, data
+   * model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly
+   * all we need to do here is to return correct path names. See also
+   * GetJVMPath() and GetApplicationHome().
+   */
+
+  { char *arch = (char *) ARCH; /* like sparc or sparcv9 */
+    char *p;
+
+    if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
+      fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
+      exit(2);
+    }
+
+    if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath, arch )) {
+      fprintf(stderr, "Error: no JVM at `%s'.\n", jvmpath);
+      exit(4);
+    }
+  }
+
+#endif  /* ifndef GAMMA */
+}
+
+
+/*
+ * On Solaris VM choosing is done by the launcher (java.c).
+ */
+static jboolean
+GetJVMPath(const char *jrepath, const char *jvmtype,
+           char *jvmpath, jint jvmpathsize, char * arch)
+{
+    struct stat s;
+
+#ifndef GAMMA
+    if (strchr(jvmtype, '/')) {
+        sprintf(jvmpath, "%s/" JVM_DLL, jvmtype);
+    } else {
+        sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype);
+    }
+#else
+    /*
+     * For gamma launcher, JVM is either built-in or in the same directory.
+     * Either way we return "<exe_path>/libjvm.so" where <exe_path> is the
+     * directory where gamma launcher is located.
+     */
+
+    char *p;
+
+    snprintf(jvmpath, jvmpathsize, "%s", GetExecname());
+    p = strrchr(jvmpath, '/');
+    if (p) {
+       /* replace executable name with libjvm.so */
+       snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL);
+    } else {
+       /* this case shouldn't happen */
+       snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL);
+    }
+#endif /* ifndef GAMMA */
+
+    if (_launcher_debug)
+      printf("Does `%s' exist ... ", jvmpath);
+
+    if (stat(jvmpath, &s) == 0) {
+        if (_launcher_debug)
+          printf("yes.\n");
+        return JNI_TRUE;
+    } else {
+        if (_launcher_debug)
+          printf("no.\n");
+        return JNI_FALSE;
+    }
+}
+
+/*
+ * Find path to JRE based on .exe's location or registry settings.
+ */
+static jboolean
+GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative)
+{
+    char libjava[MAXPATHLEN];
+
+    if (GetApplicationHome(path, pathsize)) {
+        /* Is JRE co-located with the application? */
+        sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch);
+        if (access(libjava, F_OK) == 0) {
+            goto found;
+        }
+
+        /* Does the app ship a private JRE in <apphome>/jre directory? */
+        sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch);
+        if (access(libjava, F_OK) == 0) {
+            strcat(path, "/jre");
+            goto found;
+        }
+    }
+
+    if (!speculative)
+      fprintf(stderr, "Error: could not find " JAVA_DLL "\n");
+    return JNI_FALSE;
+
+ found:
+    if (_launcher_debug)
+      printf("JRE path is %s\n", path);
+    return JNI_TRUE;
+}
+
+jboolean
+LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
+{
+#ifdef GAMMA
+    /* JVM is directly linked with gamma launcher; no dlopen() */
+    ifn->CreateJavaVM = JNI_CreateJavaVM;
+    ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
+    return JNI_TRUE;
+#else
+   Dl_info dlinfo;
+    void *libjvm;
+
+    if (_launcher_debug) {
+        printf("JVM path is %s\n", jvmpath);
+    }
+
+    libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL);
+    if (libjvm == NULL) {
+#if defined(__sparc) && !defined(_LP64) /* i.e. 32-bit sparc */
+      FILE * fp;
+      Elf32_Ehdr elf_head;
+      int count;
+      int location;
+
+      fp = fopen(jvmpath, "r");
+      if(fp == NULL)
+        goto error;
+
+      /* read in elf header */
+      count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp);
+      fclose(fp);
+      if(count < 1)
+        goto error;
+
+      /*
+       * Check for running a server vm (compiled with -xarch=v8plus)
+       * on a stock v8 processor.  In this case, the machine type in
+       * the elf header would not be included the architecture list
+       * provided by the isalist command, which is turn is gotten from
+       * sysinfo.  This case cannot occur on 64-bit hardware and thus
+       * does not have to be checked for in binaries with an LP64 data
+       * model.
+       */
+      if(elf_head.e_machine == EM_SPARC32PLUS) {
+        char buf[257];  /* recommended buffer size from sysinfo man
+                           page */
+        long length;
+        char* location;
+
+        length = sysinfo(SI_ISALIST, buf, 257);
+        if(length > 0) {
+          location = strstr(buf, "sparcv8plus ");
+          if(location == NULL) {
+            fprintf(stderr, "SPARC V8 processor detected; Server compiler requires V9 or better.\n");
+            fprintf(stderr, "Use Client compiler on V8 processors.\n");
+            fprintf(stderr, "Could not create the Java virtual machine.\n");
+            return JNI_FALSE;
+          }
+        }
+      }
+#endif
+      fprintf(stderr, "dl failure on line %d", __LINE__);
+      goto error;
+    }
+
+    ifn->CreateJavaVM = (CreateJavaVM_t)
+      dlsym(libjvm, "JNI_CreateJavaVM");
+    if (ifn->CreateJavaVM == NULL)
+        goto error;
+
+    ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
+        dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
+    if (ifn->GetDefaultJavaVMInitArgs == NULL)
+      goto error;
+
+    return JNI_TRUE;
+
+error:
+    fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror());
+    return JNI_FALSE;
+#endif /* ifndef GAMMA */
+}
+
+/*
+ * If app is "/foo/bin/javac", or "/foo/bin/sparcv9/javac" then put
+ * "/foo" into buf.
+ */
+jboolean
+GetApplicationHome(char *buf, jint bufsize)
+{
+#ifdef __linux__
+    char *execname = GetExecname();
+    if (execname) {
+        strncpy(buf, execname, bufsize-1);
+        buf[bufsize-1] = '\0';
+    } else {
+        return JNI_FALSE;
+    }
+#else
+    Dl_info dlinfo;
+
+    dladdr((void *)GetApplicationHome, &dlinfo);
+    if (realpath(dlinfo.dli_fname, buf) == NULL) {
+        fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname);
+        return JNI_FALSE;
+    }
+#endif
+
+#ifdef GAMMA
+    {
+       /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */
+       char* java_home_var = getenv("JAVA_HOME");
+       if (java_home_var == NULL) {
+          printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
+          return JNI_FALSE;
+       }
+       snprintf(buf, bufsize, "%s", java_home_var);
+    }
+#else
+    if (strrchr(buf, '/') == 0) {
+        buf[0] = '\0';
+        return JNI_FALSE;
+    }
+    *(strrchr(buf, '/')) = '\0';        /* executable file      */
+    if (strlen(buf) < 4 || strrchr(buf, '/') == 0) {
+        buf[0] = '\0';
+        return JNI_FALSE;
+    }
+    if (strcmp("/bin", buf + strlen(buf) - 4) != 0)
+        *(strrchr(buf, '/')) = '\0';    /* sparcv9 or amd64     */
+    if (strlen(buf) < 4 || strcmp("/bin", buf + strlen(buf) - 4) != 0) {
+        buf[0] = '\0';
+        return JNI_FALSE;
+    }
+    *(strrchr(buf, '/')) = '\0';        /* bin                  */
+#endif /* ifndef GAMMA */
+
+    return JNI_TRUE;
+}
+
+
+/*
+ * Return true if the named program exists
+ */
+static int
+ProgramExists(char *name)
+{
+    struct stat sb;
+    if (stat(name, &sb) != 0) return 0;
+    if (S_ISDIR(sb.st_mode)) return 0;
+    return (sb.st_mode & S_IEXEC) != 0;
+}
+
+
+/*
+ * Find a command in a directory, returning the path.
+ */
+static char *
+Resolve(char *indir, char *cmd)
+{
+    char name[PATH_MAX + 2], *real;
+
+    if ((strlen(indir) + strlen(cmd) + 1)  > PATH_MAX) return 0;
+    sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd);
+    if (!ProgramExists(name)) return 0;
+    real = JLI_MemAlloc(PATH_MAX + 2);
+    if (!realpath(name, real))
+        strcpy(real, name);
+    return real;
+}
+
+
+/*
+ * Find a path for the executable
+ */
+static char *
+FindExecName(char *program)
+{
+    char cwdbuf[PATH_MAX+2];
+    char *path;
+    char *tmp_path;
+    char *f;
+    char *result = NULL;
+
+    /* absolute path? */
+    if (*program == FILE_SEPARATOR ||
+        (FILE_SEPARATOR=='\\' && strrchr(program, ':')))
+        return Resolve("", program+1);
+
+    /* relative path? */
+    if (strrchr(program, FILE_SEPARATOR) != 0) {
+        char buf[PATH_MAX+2];
+        return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program);
+    }
+
+    /* from search path? */
+    path = getenv("PATH");
+    if (!path || !*path) path = ".";
+    tmp_path = JLI_MemAlloc(strlen(path) + 2);
+    strcpy(tmp_path, path);
+
+    for (f=tmp_path; *f && result==0; ) {
+        char *s = f;
+        while (*f && (*f != PATH_SEPARATOR)) ++f;
+        if (*f) *f++ = 0;
+        if (*s == FILE_SEPARATOR)
+            result = Resolve(s, program);
+        else {
+            /* relative path element */
+            char dir[2*PATH_MAX];
+            sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)),
+                    FILE_SEPARATOR, s);
+            result = Resolve(dir, program);
+        }
+        if (result != 0) break;
+    }
+
+    JLI_MemFree(tmp_path);
+    return result;
+}
+
+
+/* Store the name of the executable once computed */
+static char *execname = NULL;
+
+/*
+ * Compute the name of the executable
+ *
+ * In order to re-exec securely we need the absolute path of the
+ * executable. On Solaris getexecname(3c) may not return an absolute
+ * path so we use dladdr to get the filename of the executable and
+ * then use realpath to derive an absolute path. From Solaris 9
+ * onwards the filename returned in DL_info structure from dladdr is
+ * an absolute pathname so technically realpath isn't required.
+ * On Linux we read the executable name from /proc/self/exe.
+ * As a fallback, and for platforms other than Solaris and Linux,
+ * we use FindExecName to compute the executable name.
+ */
+static char *
+SetExecname(char **argv)
+{
+    char* exec_path = NULL;
+
+    if (execname != NULL)       /* Already determined */
+        return (execname);
+
+#if defined(__sun)
+    {
+        Dl_info dlinfo;
+        if (dladdr((void*)&SetExecname, &dlinfo)) {
+            char *resolved = (char*)JLI_MemAlloc(PATH_MAX+1);
+            if (resolved != NULL) {
+                exec_path = realpath(dlinfo.dli_fname, resolved);
+                if (exec_path == NULL) {
+                    JLI_MemFree(resolved);
+                }
+            }
+        }
+    }
+#elif defined(__linux__)
+    {
+        const char* self = "/proc/self/exe";
+        char buf[PATH_MAX+1];
+        int len = readlink(self, buf, PATH_MAX);
+        if (len >= 0) {
+            buf[len] = '\0';            /* readlink doesn't nul terminate */
+            exec_path = JLI_StringDup(buf);
+        }
+    }
+#else /* !__sun && !__linux */
+    {
+        /* Not implemented */
+    }
+#endif
+
+    if (exec_path == NULL) {
+        exec_path = FindExecName(argv[0]);
+    }
+    execname = exec_path;
+    return exec_path;
+}
+
+/*
+ * Return the name of the executable.  Used in java_md.c to find the JRE area.
+ */
+static char *
+GetExecname() {
+  return execname;
+}
+
+void ReportErrorMessage(char * message, jboolean always) {
+  if (always) {
+    fprintf(stderr, "%s\n", message);
+  }
+}
+
+void ReportErrorMessage2(char * format, char * string, jboolean always) {
+  if (always) {
+    fprintf(stderr, format, string);
+    fprintf(stderr, "\n");
+  }
+}
+
+void  ReportExceptionDescription(JNIEnv * env) {
+  (*env)->ExceptionDescribe(env);
+}
+
+/*
+ * Return JNI_TRUE for an option string that has no effect but should
+ * _not_ be passed on to the vm; return JNI_FALSE otherwise.  On
+ * Solaris SPARC, this screening needs to be done if:
+ * 1) LD_LIBRARY_PATH does _not_ need to be reset and
+ * 2) -d32 or -d64 is passed to a binary with a matching data model
+ *    (the exec in SetLibraryPath removes -d<n> options and points the
+ *    exec to the proper binary).  When this exec is not done, these options
+ *    would end up getting passed onto the vm.
+ */
+jboolean RemovableMachineDependentOption(char * option) {
+  /*
+   * Unconditionally remove both -d32 and -d64 options since only
+   * the last such options has an effect; e.g.
+   * java -d32 -d64 -d32 -version
+   * is equivalent to
+   * java -d32 -version
+   */
+
+  if( (strcmp(option, "-d32")  == 0 ) ||
+      (strcmp(option, "-d64")  == 0 ))
+    return JNI_TRUE;
+  else
+    return JNI_FALSE;
+}
+
+void PrintMachineDependentOptions() {
+      fprintf(stdout,
+        "    -d32          use a 32-bit data model if available\n"
+        "\n"
+        "    -d64          use a 64-bit data model if available\n");
+      return;
+}
+
+#ifndef GAMMA
+/*
+ * The following methods (down to ServerClassMachine()) answer
+ * the question about whether a machine is a "server-class"
+ * machine.  A server-class machine is loosely defined as one
+ * with 2 or more processors and 2 gigabytes or more physical
+ * memory.  The definition of a processor is a physical package,
+ * not a hyperthreaded chip masquerading as a multi-processor.
+ * The definition of memory is also somewhat fuzzy, since x86
+ * machines seem not to report all the memory in their DIMMs, we
+ * think because of memory mapping of graphics cards, etc.
+ *
+ * This code is somewhat more confused with #ifdef's than we'd
+ * like because this file is used by both Solaris and Linux
+ * platforms, and so needs to be parameterized for SPARC and
+ * i586 hardware.  The other Linux platforms (amd64 and ia64)
+ * don't even ask this question, because they only come with
+ * server JVMs.  */
+
+# define KB (1024UL)
+# define MB (1024UL * KB)
+# define GB (1024UL * MB)
+
+/* Compute physical memory by asking the OS */
+uint64_t
+physical_memory(void) {
+  const uint64_t pages     = (uint64_t) sysconf(_SC_PHYS_PAGES);
+  const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE);
+  const uint64_t result    = pages * page_size;
+# define UINT64_FORMAT "%" PRIu64
+
+  if (_launcher_debug) {
+    printf("pages: " UINT64_FORMAT
+           "  page_size: " UINT64_FORMAT
+           "  physical memory: " UINT64_FORMAT " (%.3fGB)\n",
+           pages, page_size, result, result / (double) GB);
+  }
+  return result;
+}
+
+#if defined(__sun) && defined(__sparc)
+
+/* Methods for solaris-sparc: these are easy. */
+
+/* Ask the OS how many processors there are. */
+unsigned long
+physical_processors(void) {
+  const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
+
+  if (_launcher_debug) {
+    printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
+  }
+  return sys_processors;
+}
+
+/* The solaris-sparc version of the "server-class" predicate. */
+jboolean
+solaris_sparc_ServerClassMachine(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;
+    }
+  }
+  if (_launcher_debug) {
+    printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n",
+           (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
+  }
+  return result;
+}
+
+#endif /* __sun && __sparc */
+
+#if defined(__sun) && defined(i586)
+
+/*
+ * A utility method for asking the CPU about itself.
+ * There's a corresponding version of linux-i586
+ * because the compilers are different.
+ */
+void
+get_cpuid(uint32_t arg,
+          uint32_t* eaxp,
+          uint32_t* ebxp,
+          uint32_t* ecxp,
+          uint32_t* edxp) {
+#ifdef _LP64
+  asm(
+  /* rbx is a callee-saved register */
+      " movq    %rbx, %r11  \n"
+  /* rdx and rcx are 3rd and 4th argument registers */
+      " movq    %rdx, %r10  \n"
+      " movq    %rcx, %r9   \n"
+      " movl    %edi, %eax  \n"
+      " cpuid               \n"
+      " movl    %eax, (%rsi)\n"
+      " movl    %ebx, (%r10)\n"
+      " movl    %ecx, (%r9) \n"
+      " movl    %edx, (%r8) \n"
+  /* Restore rbx */
+      " movq    %r11, %rbx");
+#else
+  /* EBX is a callee-saved register */
+  asm(" pushl   %ebx");
+  /* Need ESI for storing through arguments */
+  asm(" pushl   %esi");
+  asm(" movl    8(%ebp), %eax   \n"
+      " cpuid                   \n"
+      " movl    12(%ebp), %esi  \n"
+      " movl    %eax, (%esi)    \n"
+      " movl    16(%ebp), %esi  \n"
+      " movl    %ebx, (%esi)    \n"
+      " movl    20(%ebp), %esi  \n"
+      " movl    %ecx, (%esi)    \n"
+      " movl    24(%ebp), %esi  \n"
+      " movl    %edx, (%esi)      ");
+  /* Restore ESI and EBX */
+  asm(" popl    %esi");
+  /* Restore EBX */
+  asm(" popl    %ebx");
+#endif
+}
+
+#endif /* __sun && i586 */
+
+#if defined(__linux__) && defined(i586)
+
+/*
+ * A utility method for asking the CPU about itself.
+ * There's a corresponding version of solaris-i586
+ * because the compilers are different.
+ */
+void
+get_cpuid(uint32_t arg,
+          uint32_t* eaxp,
+          uint32_t* ebxp,
+          uint32_t* ecxp,
+          uint32_t* edxp) {
+#ifdef _LP64
+  __asm__ volatile (/* Instructions */
+                    "   movl    %4, %%eax  \n"
+                    "   cpuid              \n"
+                    "   movl    %%eax, (%0)\n"
+                    "   movl    %%ebx, (%1)\n"
+                    "   movl    %%ecx, (%2)\n"
+                    "   movl    %%edx, (%3)\n"
+                    : /* Outputs */
+                    : /* Inputs */
+                    "r" (eaxp),
+                    "r" (ebxp),
+                    "r" (ecxp),
+                    "r" (edxp),
+                    "r" (arg)
+                    : /* Clobbers */
+                    "%rax", "%rbx", "%rcx", "%rdx", "memory"
+                    );
+#else
+  uint32_t value_of_eax = 0;
+  uint32_t value_of_ebx = 0;
+  uint32_t value_of_ecx = 0;
+  uint32_t value_of_edx = 0;
+  __asm__ volatile (/* Instructions */
+                        /* ebx is callee-save, so push it */
+                    "   pushl   %%ebx      \n"
+                    "   movl    %4, %%eax  \n"
+                    "   cpuid              \n"
+                    "   movl    %%eax, %0  \n"
+                    "   movl    %%ebx, %1  \n"
+                    "   movl    %%ecx, %2  \n"
+                    "   movl    %%edx, %3  \n"
+                        /* restore ebx */
+                    "   popl    %%ebx      \n"
+
+                    : /* Outputs */
+                    "=m" (value_of_eax),
+                    "=m" (value_of_ebx),
+                    "=m" (value_of_ecx),
+                    "=m" (value_of_edx)
+                    : /* Inputs */
+                    "m" (arg)
+                    : /* Clobbers */
+                    "%eax", "%ecx", "%edx"
+                    );
+  *eaxp = value_of_eax;
+  *ebxp = value_of_ebx;
+  *ecxp = value_of_ecx;
+  *edxp = value_of_edx;
+#endif
+}
+
+#endif /* __linux__ && i586 */
+
+#ifdef i586
+/*
+ * Routines shared by solaris-i586 and linux-i586.
+ */
+
+enum HyperThreadingSupport_enum {
+  hts_supported        =  1,
+  hts_too_soon_to_tell =  0,
+  hts_not_supported    = -1,
+  hts_not_pentium4     = -2,
+  hts_not_intel        = -3
+};
+typedef enum HyperThreadingSupport_enum HyperThreadingSupport;
+
+/* Determine if hyperthreading is supported */
+HyperThreadingSupport
+hyperthreading_support(void) {
+  HyperThreadingSupport result = hts_too_soon_to_tell;
+  /* Bits 11 through 8 is family processor id */
+# define FAMILY_ID_SHIFT 8
+# define FAMILY_ID_MASK 0xf
+  /* Bits 23 through 20 is extended family processor id */
+# define EXT_FAMILY_ID_SHIFT 20
+# define EXT_FAMILY_ID_MASK 0xf
+  /* Pentium 4 family processor id */
+# define PENTIUM4_FAMILY_ID 0xf
+  /* Bit 28 indicates Hyper-Threading Technology support */
+# define HT_BIT_SHIFT 28
+# define HT_BIT_MASK 1
+  uint32_t vendor_id[3] = { 0U, 0U, 0U };
+  uint32_t value_of_eax = 0U;
+  uint32_t value_of_edx = 0U;
+  uint32_t dummy        = 0U;
+
+  /* Yes, this is supposed to be [0], [2], [1] */
+  get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]);
+  if (_launcher_debug) {
+    printf("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n",
+           ((vendor_id[0] >>  0) & 0xff),
+           ((vendor_id[0] >>  8) & 0xff),
+           ((vendor_id[0] >> 16) & 0xff),
+           ((vendor_id[0] >> 24) & 0xff),
+           ((vendor_id[1] >>  0) & 0xff),
+           ((vendor_id[1] >>  8) & 0xff),
+           ((vendor_id[1] >> 16) & 0xff),
+           ((vendor_id[1] >> 24) & 0xff),
+           ((vendor_id[2] >>  0) & 0xff),
+           ((vendor_id[2] >>  8) & 0xff),
+           ((vendor_id[2] >> 16) & 0xff),
+           ((vendor_id[2] >> 24) & 0xff));
+  }
+  get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx);
+  if (_launcher_debug) {
+    printf("value_of_eax: 0x%x  value_of_edx: 0x%x\n",
+           value_of_eax, value_of_edx);
+  }
+  if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) ||
+      (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) {
+    if ((((vendor_id[0] >>  0) & 0xff) == 'G') &&
+        (((vendor_id[0] >>  8) & 0xff) == 'e') &&
+        (((vendor_id[0] >> 16) & 0xff) == 'n') &&
+        (((vendor_id[0] >> 24) & 0xff) == 'u') &&
+        (((vendor_id[1] >>  0) & 0xff) == 'i') &&
+        (((vendor_id[1] >>  8) & 0xff) == 'n') &&
+        (((vendor_id[1] >> 16) & 0xff) == 'e') &&
+        (((vendor_id[1] >> 24) & 0xff) == 'I') &&
+        (((vendor_id[2] >>  0) & 0xff) == 'n') &&
+        (((vendor_id[2] >>  8) & 0xff) == 't') &&
+        (((vendor_id[2] >> 16) & 0xff) == 'e') &&
+        (((vendor_id[2] >> 24) & 0xff) == 'l')) {
+      if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) {
+        if (_launcher_debug) {
+          printf("Hyperthreading supported\n");
+        }
+        result = hts_supported;
+      } else {
+        if (_launcher_debug) {
+          printf("Hyperthreading not supported\n");
+        }
+        result = hts_not_supported;
+      }
+    } else {
+      if (_launcher_debug) {
+        printf("Not GenuineIntel\n");
+      }
+      result = hts_not_intel;
+    }
+  } else {
+    if (_launcher_debug) {
+      printf("not Pentium 4 or extended\n");
+    }
+    result = hts_not_pentium4;
+  }
+  return result;
+}
+
+/* Determine how many logical processors there are per CPU */
+unsigned int
+logical_processors_per_package(void) {
+  /*
+   * After CPUID with EAX==1, register EBX bits 23 through 16
+   * indicate the number of logical processors per package
+   */
+# define NUM_LOGICAL_SHIFT 16
+# define NUM_LOGICAL_MASK 0xff
+  unsigned int result                        = 1U;
+  const HyperThreadingSupport hyperthreading = hyperthreading_support();
+
+  if (hyperthreading == hts_supported) {
+    uint32_t value_of_ebx = 0U;
+    uint32_t dummy        = 0U;
+
+    get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy);
+    result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK;
+    if (_launcher_debug) {
+      printf("logical processors per package: %u\n", result);
+    }
+  }
+  return result;
+}
+
+/* Compute the number of physical processors, not logical processors */
+unsigned long
+physical_processors(void) {
+  const long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
+  unsigned long result      = sys_processors;
+
+  if (_launcher_debug) {
+    printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
+  }
+  if (sys_processors > 1) {
+    unsigned int logical_processors = logical_processors_per_package();
+    if (logical_processors > 1) {
+      result = (unsigned long) sys_processors / logical_processors;
+    }
+  }
+  if (_launcher_debug) {
+    printf("physical processors: %lu\n", result);
+  }
+  return result;
+}
+
+#endif /* i586 */
+
+#if defined(__sun) && defined(i586)
+
+/* The definition of a server-class machine for solaris-i586/amd64 */
+jboolean
+solaris_i586_ServerClassMachine(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;
+  /*
+   * We seem not to get our full complement of memory.
+   *     We allow some part (1/8?) of the memory to be "missing",
+   *     based on the sizes of DIMMs, and maybe graphics cards.
+   */
+  const uint64_t      missing_memory    = 256UL * MB;
+  const uint64_t      actual_memory     = physical_memory();
+
+  /* Is this a server class machine? */
+  if (actual_memory >= (server_memory - missing_memory)) {
+    const unsigned long actual_processors = physical_processors();
+    if (actual_processors >= server_processors) {
+      result = JNI_TRUE;
+    }
+  }
+  if (_launcher_debug) {
+    printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n",
+           (result == JNI_TRUE ? "true" : "false"));
+  }
+  return result;
+}
+
+#endif /* __sun && i586 */
+
+#if defined(__linux__) && defined(i586)
+
+/* The definition of a server-class machine for linux-i586 */
+jboolean
+linux_i586_ServerClassMachine(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;
+  /*
+   * We seem not to get our full complement of memory.
+   *     We allow some part (1/8?) of the memory to be "missing",
+   *     based on the sizes of DIMMs, and maybe graphics cards.
+   */
+  const uint64_t      missing_memory    = 256UL * MB;
+  const uint64_t      actual_memory     = physical_memory();
+
+  /* Is this a server class machine? */
+  if (actual_memory >= (server_memory - missing_memory)) {
+    const unsigned long actual_processors = physical_processors();
+    if (actual_processors >= server_processors) {
+      result = JNI_TRUE;
+    }
+  }
+  if (_launcher_debug) {
+    printf("linux_" LIBARCHNAME "_ServerClassMachine: %s\n",
+           (result == JNI_TRUE ? "true" : "false"));
+  }
+  return result;
+}
+
+#endif /* __linux__ && i586 */
+
+/* Dispatch to the platform-specific definition of "server-class" */
+jboolean
+ServerClassMachine(void) {
+  jboolean result = JNI_FALSE;
+#if   defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE)
+  result = JNI_FALSE;
+#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE)
+  result = JNI_TRUE;
+#elif defined(__sun) && defined(__sparc)
+  result = solaris_sparc_ServerClassMachine();
+#elif defined(__sun) && defined(i586)
+  result = solaris_i586_ServerClassMachine();
+#elif defined(__linux__) && defined(i586)
+  result = linux_i586_ServerClassMachine();
+#else
+  if (_launcher_debug) {
+    printf("ServerClassMachine: returns default value of %s\n",
+           (result == JNI_TRUE ? "true" : "false"));
+  }
+#endif
+  return result;
+}
+
+/*
+ *      Since using the file system as a registry is a bit risky, perform
+ *      additional sanity checks on the identified directory to validate
+ *      it as a valid jre/sdk.
+ *
+ *      Return 0 if the tests fail; otherwise return non-zero (true).
+ *
+ *      Note that checking for anything more than the existence of an
+ *      executable object at bin/java relative to the path being checked
+ *      will break the regression tests.
+ */
+static int
+CheckSanity(char *path, char *dir)
+{
+    char    buffer[PATH_MAX];
+
+    if (strlen(path) + strlen(dir) + 11 > PATH_MAX)
+        return (0);     /* Silently reject "impossibly" long paths */
+
+    (void)strcat(strcat(strcat(strcpy(buffer, path), "/"), dir), "/bin/java");
+    return ((access(buffer, X_OK) == 0) ? 1 : 0);
+}
+
+/*
+ *      Determine if there is an acceptable JRE in the directory dirname.
+ *      Upon locating the "best" one, return a fully qualified path to
+ *      it. "Best" is defined as the most advanced JRE meeting the
+ *      constraints contained in the manifest_info. If no JRE in this
+ *      directory meets the constraints, return NULL.
+ *
+ *      Note that we don't check for errors in reading the directory
+ *      (which would be done by checking errno).  This is because it
+ *      doesn't matter if we get an error reading the directory, or
+ *      we just don't find anything interesting in the directory.  We
+ *      just return NULL in either case.
+ *
+ *      The historical names of j2sdk and j2re were changed to jdk and
+ *      jre respecively as part of the 1.5 rebranding effort.  Since the
+ *      former names are legacy on Linux, they must be recognized for
+ *      all time.  Fortunately, this is a minor cost.
+ */
+static char
+*ProcessDir(manifest_info *info, char *dirname)
+{
+    DIR     *dirp;
+    struct dirent *dp;
+    char    *best = NULL;
+    int     offset;
+    int     best_offset = 0;
+    char    *ret_str = NULL;
+    char    buffer[PATH_MAX];
+
+    if ((dirp = opendir(dirname)) == NULL)
+        return (NULL);
+
+    do {
+        if ((dp = readdir(dirp)) != NULL) {
+            offset = 0;
+            if ((strncmp(dp->d_name, "jre", 3) == 0) ||
+                (strncmp(dp->d_name, "jdk", 3) == 0))
+                offset = 3;
+            else if (strncmp(dp->d_name, "j2re", 4) == 0)
+                offset = 4;
+            else if (strncmp(dp->d_name, "j2sdk", 5) == 0)
+                offset = 5;
+            if (offset > 0) {
+                if ((JLI_AcceptableRelease(dp->d_name + offset,
+                    info->jre_version)) && CheckSanity(dirname, dp->d_name))
+                    if ((best == NULL) || (JLI_ExactVersionId(
+                      dp->d_name + offset, best + best_offset) > 0)) {
+                        if (best != NULL)
+                            JLI_MemFree(best);
+                        best = JLI_StringDup(dp->d_name);
+                        best_offset = offset;
+                    }
+            }
+        }
+    } while (dp != NULL);
+    (void) closedir(dirp);
+    if (best == NULL)
+        return (NULL);
+    else {
+        ret_str = JLI_MemAlloc(strlen(dirname) + strlen(best) + 2);
+        ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best);
+        JLI_MemFree(best);
+        return (ret_str);
+    }
+}
+
+/*
+ *      This is the global entry point. It examines the host for the optimal
+ *      JRE to be used by scanning a set of directories.  The set of directories
+ *      is platform dependent and can be overridden by the environment
+ *      variable JAVA_VERSION_PATH.
+ *
+ *      This routine itself simply determines the set of appropriate
+ *      directories before passing control onto ProcessDir().
+ */
+char*
+LocateJRE(manifest_info* info)
+{
+    char        *path;
+    char        *home;
+    char        *target = NULL;
+    char        *dp;
+    char        *cp;
+
+    /*
+     * Start by getting JAVA_VERSION_PATH
+     */
+    if (info->jre_restrict_search)
+        path = JLI_StringDup(system_dir);
+    else if ((path = getenv("JAVA_VERSION_PATH")) != NULL)
+        path = JLI_StringDup(path);
+    else
+        if ((home = getenv("HOME")) != NULL) {
+            path = (char *)JLI_MemAlloc(strlen(home) + strlen(system_dir) +
+                strlen(user_dir) + 2);
+            path = strcat(strcat(strcat(strcpy(path, home),
+                user_dir), ":"), system_dir);
+        } else
+            path = JLI_StringDup(system_dir);
+
+    /*
+     * Step through each directory on the path. Terminate the scan with
+     * the first directory with an acceptable JRE.
+     */
+    cp = dp = path;
+    while (dp != NULL) {
+        cp = strchr(dp, (int)':');
+        if (cp != NULL)
+            *cp = (char)NULL;
+        if ((target = ProcessDir(info, dp)) != NULL)
+            break;
+        dp = cp;
+        if (dp != NULL)
+            dp++;
+    }
+    JLI_MemFree(path);
+    return (target);
+}
+
+/*
+ * Given a path to a jre to execute, this routine checks if this process
+ * is indeed that jre.  If not, it exec's that jre.
+ *
+ * We want to actually check the paths rather than just the version string
+ * built into the executable, so that given version specification (and
+ * JAVA_VERSION_PATH) will yield the exact same Java environment, regardless
+ * of the version of the arbitrary launcher we start with.
+ */
+void
+ExecJRE(char *jre, char **argv)
+{
+    char    wanted[PATH_MAX];
+    char    *execname;
+    char    *progname;
+
+    /*
+     * Resolve the real path to the directory containing the selected JRE.
+     */
+    if (realpath(jre, wanted) == NULL) {
+        fprintf(stderr, "Unable to resolve %s\n", jre);
+        exit(1);
+    }
+
+    /*
+     * Resolve the real path to the currently running launcher.
+     */
+    execname = SetExecname(argv);
+    if (execname == NULL) {
+        fprintf(stderr, "Unable to resolve current executable\n");
+        exit(1);
+    }
+
+    /*
+     * If the path to the selected JRE directory is a match to the initial
+     * portion of the path to the currently executing JRE, we have a winner!
+     * If so, just return.
+     */
+    if (strncmp(wanted, execname, strlen(wanted)) == 0)
+        return;                 /* I am the droid you were looking for */
+
+    /*
+     * If this isn't the selected version, exec the selected version.
+     */
+#ifdef JAVA_ARGS  /* javac, jar and friends. */
+    progname = "java";
+#else             /* java, oldjava, javaw and friends */
+#ifdef PROGNAME
+    progname = PROGNAME;
+#else
+    progname = *argv;
+    if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
+        progname = s + 1;
+    }
+#endif /* PROGNAME */
+#endif /* JAVA_ARGS */
+
+    /*
+     * This should never happen (because of the selection code in SelectJRE),
+     * but check for "impossibly" long path names just because buffer overruns
+     * can be so deadly.
+     */
+    if (strlen(wanted) + strlen(progname) + 6 > PATH_MAX) {
+        fprintf(stderr, "Path length exceeds maximum length (PATH_MAX)\n");
+        exit(1);
+    }
+
+    /*
+     * Construct the path and exec it.
+     */
+    (void)strcat(strcat(wanted, "/bin/"), progname);
+    argv[0] = progname;
+    if (_launcher_debug) {
+        int i;
+        printf("ReExec Command: %s (%s)\n", wanted, argv[0]);
+        printf("ReExec Args:");
+        for (i = 1; argv[i] != NULL; i++)
+            printf(" %s", argv[i]);
+        printf("\n");
+    }
+    (void)fflush(stdout);
+    (void)fflush(stderr);
+    execv(wanted, argv);
+    perror("execv()");
+    fprintf(stderr, "Exec of %s failed\n", wanted);
+    exit(1);
+}
+#endif /* ifndef GAMMA */
+
+/*
+ * "Borrowed" from Solaris 10 where the unsetenv() function is being added
+ * to libc thanks to SUSv3 (Standard Unix Specification, version 3). As
+ * such, in the fullness of time this will appear in libc on all relevant
+ * Solaris/Linux platforms and maybe even the Windows platform.  At that
+ * time, this stub can be removed.
+ *
+ * This implementation removes the environment locking for multithreaded
+ * applications.  (We don't have access to these mutexes within libc and
+ * the launcher isn't multithreaded.)  Note that what remains is platform
+ * independent, because it only relies on attributes that a POSIX environment
+ * defines.
+ *
+ * Returns 0 on success, -1 on failure.
+ *
+ * Also removed was the setting of errno.  The only value of errno set
+ * was EINVAL ("Invalid Argument").
+ */
+
+/*
+ * s1(environ) is name=value
+ * s2(name) is name(not the form of name=value).
+ * if names match, return value of 1, else return 0
+ */
+static int
+match_noeq(const char *s1, const char *s2)
+{
+        while (*s1 == *s2++) {
+                if (*s1++ == '=')
+                        return (1);
+        }
+        if (*s1 == '=' && s2[-1] == '\0')
+                return (1);
+        return (0);
+}
+
+/*
+ * added for SUSv3 standard
+ *
+ * Delete entry from environ.
+ * Do not free() memory!  Other threads may be using it.
+ * Keep it around forever.
+ */
+static int
+borrowed_unsetenv(const char *name)
+{
+        long    idx;            /* index into environ */
+
+        if (name == NULL || *name == '\0' ||
+            strchr(name, '=') != NULL) {
+                return (-1);
+        }
+
+        for (idx = 0; environ[idx] != NULL; idx++) {
+                if (match_noeq(environ[idx], name))
+                        break;
+        }
+        if (environ[idx] == NULL) {
+                /* name not found but still a success */
+                return (0);
+        }
+        /* squeeze up one entry */
+        do {
+                environ[idx] = environ[idx+1];
+        } while (environ[++idx] != NULL);
+
+        return (0);
+}
+/* --- End of "borrowed" code --- */
+
+/*
+ * Wrapper for unsetenv() function.
+ */
+int
+UnsetEnv(char *name)
+{
+    return(borrowed_unsetenv(name));
+}
+
+/* --- Splash Screen shared library support --- */
+
+static const char* SPLASHSCREEN_SO = "libsplashscreen.so";
+
+static void* hSplashLib = NULL;
+
+void* SplashProcAddress(const char* name) {
+    if (!hSplashLib) {
+        hSplashLib = dlopen(SPLASHSCREEN_SO, RTLD_LAZY | RTLD_GLOBAL);
+    }
+    if (hSplashLib) {
+        void* sym = dlsym(hSplashLib, name);
+        return sym;
+    } else {
+        return NULL;
+    }
+}
+
+void SplashFreeLibrary() {
+    if (hSplashLib) {
+        dlclose(hSplashLib);
+        hSplashLib = NULL;
+    }
+}
+
+const char *
+jlong_format_specifier() {
+    return "%lld";
+}
+
+/*
+ * Block current thread and continue execution in a new thread
+ */
+int
+ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) {
+    int rslt;
+#ifdef __linux__
+    pthread_t tid;
+    pthread_attr_t attr;
+    pthread_attr_init(&attr);
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+
+    if (stack_size > 0) {
+      pthread_attr_setstacksize(&attr, stack_size);
+    }
+
+    if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
+      void * tmp;
+      pthread_join(tid, &tmp);
+      rslt = (int)(intptr_t)tmp;
+    } else {
+     /*
+      * Continue execution in current thread if for some reason (e.g. out of
+      * memory/LWP)  a new thread can't be created. This will likely fail
+      * later in continuation as JNI_CreateJavaVM needs to create quite a
+      * few new threads, anyway, just give it a try..
+      */
+      rslt = continuation(args);
+    }
+
+    pthread_attr_destroy(&attr);
+#else
+    thread_t tid;
+    long flags = 0;
+    if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) {
+      void * tmp;
+      thr_join(tid, NULL, &tmp);
+      rslt = (int)(intptr_t)tmp;
+    } else {
+      /* See above. Continue in current thread if thr_create() failed */
+      rslt = continuation(args);
+    }
+#endif
+    return rslt;
+}
+
+/* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */
+#define MAX_PID_STR_SZ   20
+
+void SetJavaLauncherPlatformProps() {
+   /* Linux only */
+#ifdef __linux__
+    const char *substr = "-Dsun.java.launcher.pid=";
+    char *pid_prop_str = (char *)JLI_MemAlloc(strlen(substr) + MAX_PID_STR_SZ + 1);
+    sprintf(pid_prop_str, "%s%d", substr, getpid());
+    AddOption(pid_prop_str, NULL);
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/posix/launcher/java_md.h	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef JAVA_MD_H
+#define JAVA_MD_H
+
+#include <limits.h>
+#include <unistd.h>
+#include <sys/param.h>
+#ifndef GAMMA
+#include "manifest_info.h"
+#endif
+#include "jli_util.h"
+
+#define PATH_SEPARATOR          ':'
+#define FILESEP                 "/"
+#define FILE_SEPARATOR          '/'
+#define IS_FILE_SEPARATOR(c) ((c) == '/')
+#ifndef MAXNAMELEN
+#define MAXNAMELEN              PATH_MAX
+#endif
+
+#ifdef JAVA_ARGS
+/*
+ * ApplicationHome is prepended to each of these entries; the resulting
+ * strings are concatenated (separated by PATH_SEPARATOR) and used as the
+ * value of -cp option to the launcher.
+ */
+#ifndef APP_CLASSPATH
+#define APP_CLASSPATH        { "/lib/tools.jar", "/classes" }
+#endif
+#endif
+
+#ifdef HAVE_GETHRTIME
+/*
+ * Support for doing cheap, accurate interval timing.
+ */
+#include <sys/time.h>
+#define CounterGet()              (gethrtime()/1000)
+#define Counter2Micros(counts)    (counts)
+#else
+#define CounterGet()              (0)
+#define Counter2Micros(counts)    (1)
+#endif /* HAVE_GETHRTIME */
+
+/*
+ * Function prototypes.
+ */
+#ifndef GAMMA
+char *LocateJRE(manifest_info *info);
+void ExecJRE(char *jre, char **argv);
+#endif
+int UnsetEnv(char *name);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/posix/launcher/launcher.script	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,212 @@
+#!/bin/bash
+
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+
+
+# This script launches HotSpot.
+#
+# If the first parameter is either "-gdb" or "-gud", HotSpot will be
+# launched inside gdb. "-gud" means "open an Emacs window and run gdb
+# inside Emacs".
+#
+# If the first parameter is "-dbx", HotSpot will be launched inside dbx.
+# 
+# If the first parameter is "-valgrind", HotSpot will be launched
+# inside Valgrind (http://valgrind.kde.org) using the Memcheck skin,
+# and with memory leak detection enabled.  This currently (2005jan19)
+# requires at least Valgrind 2.3.0.  -Xmx16m will also be passed as
+# the first parameter to HotSpot, since lowering HotSpot's memory
+# consumption makes execution inside of Valgrind *a lot* faster.
+#
+
+
+#
+# User changeable parameters ------------------------------------------------
+#
+
+# This is the name of the gdb binary to use
+if [ ! "$GDB" ]
+then 
+    GDB=gdb
+fi
+
+# This is the name of the gdb binary to use
+if [ ! "$DBX" ]
+then 
+    DBX=dbx
+fi
+
+# This is the name of the Valgrind binary to use
+if [ ! "$VALGRIND" ]
+then 
+    VALGRIND=valgrind
+fi
+
+# This is the name of Emacs for running GUD
+EMACS=emacs
+
+#
+# End of user changeable parameters -----------------------------------------
+#
+
+# Make sure the paths are fully specified, i.e. they must begin with /.
+SCRIPT=$(cd $(dirname $0) && pwd)/$(basename $0)
+RUNDIR=$(pwd)
+
+# Look whether the user wants to run inside gdb
+case "$1" in
+    -gdb)
+        MODE=gdb
+        shift
+        ;;
+    -gud)
+        MODE=gud
+        shift
+        ;;
+    -dbx)
+        MODE=dbx
+        shift
+        ;;
+    -valgrind)
+        MODE=valgrind
+        shift
+        ;;
+    *)
+        MODE=run
+        ;;
+esac
+
+# Find out the absolute path to this script
+MYDIR=$(cd $(dirname $SCRIPT) && pwd)
+
+JDK=
+if [ "${ALT_JAVA_HOME}" = "" ]; then
+    source ${MYDIR}/jdkpath.sh
+else 
+    JDK=${ALT_JAVA_HOME%%/jre};
+fi
+
+if [ "${JDK}" = "" ]; then
+    echo Failed to find JDK. ALT_JAVA_HOME is not set or ./jdkpath.sh is empty or not found.
+    exit 1
+fi
+
+# We will set the LD_LIBRARY_PATH as follows:
+#     o		$JVMPATH (directory portion only)
+#     o		$JRE/lib/$ARCH
+# followed by the user's previous effective LD_LIBRARY_PATH, if
+# any.
+JRE=$JDK/jre
+JAVA_HOME=$JDK
+ARCH=@@LIBARCH@@
+
+# Find out the absolute path to this script
+MYDIR=$(cd $(dirname $SCRIPT) && pwd)
+
+SBP=${MYDIR}:${JRE}/lib/${ARCH}
+
+# Set up a suitable LD_LIBRARY_PATH
+
+if [ -z "$LD_LIBRARY_PATH" ]
+then
+    LD_LIBRARY_PATH="$SBP"
+else
+    LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH"
+fi
+
+export LD_LIBRARY_PATH
+export JAVA_HOME
+
+JPARMS="$@ $JAVA_ARGS";
+
+# Locate the gamma development launcher
+LAUNCHER=${MYDIR}/gamma
+if [ ! -x $LAUNCHER ] ; then
+    echo Error: Cannot find the gamma development launcher \"$LAUNCHER\"
+    exit 1
+fi
+
+GDBSRCDIR=$MYDIR
+BASEDIR=$(cd $MYDIR/../../.. && pwd)
+
+init_gdb() {
+# Create a gdb script in case we should run inside gdb
+    GDBSCR=/tmp/hsl.$$
+    rm -f $GDBSCR
+    cat >>$GDBSCR <<EOF
+cd `pwd`
+handle SIGUSR1 nostop noprint
+handle SIGUSR2 nostop noprint
+set args $JPARMS
+file $LAUNCHER
+directory $GDBSRCDIR
+# Get us to a point where we can set breakpoints in libjvm.so
+break InitializeJVM
+run
+# Stop in InitializeJVM
+delete 1
+# We can now set breakpoints wherever we like
+EOF
+}
+
+
+case "$MODE" in
+    gdb)
+	init_gdb
+        $GDB -x $GDBSCR
+	rm -f $GDBSCR
+        ;;
+    gud)
+	init_gdb
+# First find out what emacs version we're using, so that we can
+# use the new pretty GDB mode if emacs -version >= 22.1
+	case $($EMACS -version 2> /dev/null) in
+	    *GNU\ Emacs\ 2[23]*)
+	    emacs_gud_cmd="gdba"
+	    emacs_gud_args="--annotate=3"
+	    ;;
+	    *)
+		emacs_gud_cmd="gdb"
+		emacs_gud_args=
+		;;
+	esac
+        $EMACS --eval "($emacs_gud_cmd \"$GDB $emacs_gud_args -x $GDBSCR\")";
+	rm -f $GDBSCR
+        ;;
+    dbx)
+        $DBX -s $MYDIR/.dbxrc $LAUNCHER $JPARAMS
+        ;;
+    valgrind)
+        echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap
+        echo
+        $VALGRIND --tool=memcheck --leak-check=yes --num-callers=50 $LAUNCHER -Xmx16m $JPARMS
+        ;;
+    run)
+        LD_PRELOAD=$PRELOADING exec $LAUNCHER $JPARMS
+        ;;
+    *)
+        echo Error: Internal error, unknown launch mode \"$MODE\"
+        exit 1
+        ;;
+esac
+RETVAL=$?
+exit $RETVAL
--- a/src/os/solaris/dtrace/generateJvmOffsets.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/dtrace/generateJvmOffsets.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -38,9 +38,22 @@
 #define protected public
 
 #include <proc_service.h>
-#include "incls/_precompiled.incl"
-#include "incls/_vmStructs.cpp.incl"
-
+#include "code/codeBlob.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/heap.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/universe.hpp"
+#include "oops/constMethodOop.hpp"
+#include "oops/klass.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/virtualspace.hpp"
+#include "runtime/vmStructs.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/globalDefinitions.hpp"
 #ifdef COMPILER1
 #if defined(DEBUG) || defined(FASTDEBUG)
 
--- a/src/os/solaris/dtrace/generateJvmOffsets.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/dtrace/generateJvmOffsets.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H
+#define OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H
+
 #include <stdio.h>
 #include <strings.h>
 
@@ -36,3 +39,5 @@
         void gen_prologue(GEN_variant gen_var);
         void gen_epilogue(GEN_variant gen_var);
 }
+
+#endif // OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H
--- a/src/os/solaris/dtrace/generateJvmOffsetsMain.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/dtrace/generateJvmOffsetsMain.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/os/solaris/dtrace/hotspot.d	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/dtrace/hotspot.d	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/os/solaris/dtrace/jvm_dtrace.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/dtrace/jvm_dtrace.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/os/solaris/dtrace/jvm_dtrace.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/dtrace/jvm_dtrace.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/os/solaris/dtrace/libjvm_db.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/dtrace/libjvm_db.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_SOLARIS_DTRACE_LIBJVM_DB_H
+#define OS_SOLARIS_DTRACE_LIBJVM_DB_H
+
 #include <proc_service.h>
 
 #ifdef __cplusplus
@@ -61,3 +64,5 @@
 #ifdef __cplusplus
 } /* extern "C" */
 #endif /* __cplusplus */
+
+#endif // OS_SOLARIS_DTRACE_LIBJVM_DB_H
--- a/src/os/solaris/launcher/java.c	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1842 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- *
- * GAMMA: gamma launcher is much simpler than regular java launcher in that
- *        JVM is either statically linked in or it is installed in the
- *        same directory where the launcher exists, so we don't have to
- *        worry about choosing the right JVM based on command line flag, jar
- *        file and/or ergonomics. Intead of removing unused logic from source
- *        they are commented out with #ifndef GAMMA, hopefully it'll be easier
- *        to maintain this file in sync with regular JDK launcher.
- */
-
-/*
- * Shared source for 'java' command line tool.
- *
- * If JAVA_ARGS is defined, then acts as a launcher for applications. For
- * instance, the JDK command line tools such as javac and javadoc (see
- * makefiles for more details) are built with this program.  Any arguments
- * prefixed with '-J' will be passed directly to the 'java' command.
- */
-
-#ifdef GAMMA
-#  ifdef JAVA_ARGS
-#    error Do NOT define JAVA_ARGS when building gamma launcher
-#  endif
-#  if !defined(LINK_INTO_AOUT) && !defined(LINK_INTO_LIBJVM)
-#    error Either LINK_INTO_AOUT or LINK_INTO_LIBJVM must be defined
-#  endif
-#endif
-
-/*
- * One job of the launcher is to remove command line options which the
- * vm does not understand and will not process.  These options include
- * options which select which style of vm is run (e.g. -client and
- * -server) as well as options which select the data model to use.
- * Additionally, for tools which invoke an underlying vm "-J-foo"
- * options are turned into "-foo" options to the vm.  This option
- * filtering is handled in a number of places in the launcher, some of
- * it in machine-dependent code.  In this file, the function
- * CheckJVMType removes vm style options and TranslateDashJArgs
- * removes "-J" prefixes.  On unix platforms, the
- * CreateExecutionEnvironment function from the unix java_md.c file
- * processes and removes -d<n> options.  However, in case
- * CreateExecutionEnvironment does not need to exec because
- * LD_LIBRARY_PATH is set acceptably and the data model does not need
- * to be changed, ParseArguments will screen out the redundant -d<n>
- * options and prevent them from being passed to the vm; this is done
- * by using the machine-dependent call
- * RemovableMachineDependentOption.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <jni.h>
-#include "java.h"
-
-#ifndef GAMMA
-#include "manifest_info.h"
-#include "version_comp.h"
-#endif
-
-#ifndef FULL_VERSION
-#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
-#endif
-
-/*
- * The following environment variable is used to influence the behavior
- * of the jre exec'd through the SelectVersion routine.  The command line
- * options which specify the version are not passed to the exec'd version,
- * because that jre may be an older version which wouldn't recognize them.
- * This environment variable is known to this (and later) version and serves
- * to suppress the version selection code.  This is not only for efficiency,
- * but also for correctness, since any command line options have been
- * removed which would cause any value found in the manifest to be used.
- * This would be incorrect because the command line options are defined
- * to take precedence.
- *
- * The value associated with this environment variable is the MainClass
- * name from within the executable jar file (if any). This is strictly a
- * performance enhancement to avoid re-reading the jar file manifest.
- *
- * A NOTE TO DEVELOPERS: For performance reasons it is important that
- * the program image remain relatively small until after SelectVersion
- * CreateExecutionEnvironment have finished their possibly recursive
- * processing. Watch everything, but resist all temptations to use Java
- * interfaces.
- */
-#define ENV_ENTRY "_JAVA_VERSION_SET"
-
-static jboolean printVersion = JNI_FALSE; /* print and exit */
-static jboolean showVersion = JNI_FALSE;  /* print but continue */
-static char *progname;
-jboolean _launcher_debug = JNI_FALSE;
-
-/*
- * List of VM options to be specified when the VM is created.
- */
-static JavaVMOption *options;
-static int numOptions, maxOptions;
-
-/*
- * Prototypes for functions internal to launcher.
- */
-static void AddOption(char *str, void *info);
-static void SetClassPath(char *s);
-static void SelectVersion(int argc, char **argv, char **main_class);
-static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile,
-                               char **pclassname, int *pret);
-static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv,
-                              InvocationFunctions *ifn);
-static jstring NewPlatformString(JNIEnv *env, char *s);
-static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc);
-static jclass LoadClass(JNIEnv *env, char *name);
-static jstring GetMainClassName(JNIEnv *env, char *jarname);
-static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv);
-#ifdef GAMMA
-static void SetJavaLauncherProp(void);
-#endif
-
-#ifdef JAVA_ARGS
-static void TranslateDashJArgs(int *pargc, char ***pargv);
-static jboolean AddApplicationOptions(void);
-#endif
-
-static void PrintJavaVersion(JNIEnv *env);
-static void PrintUsage(void);
-static jint PrintXUsage(void);
-
-static void SetPaths(int argc, char **argv);
-
-/* Maximum supported entries from jvm.cfg. */
-#define INIT_MAX_KNOWN_VMS      10
-/* Values for vmdesc.flag */
-#define VM_UNKNOWN              -1
-#define VM_KNOWN                 0
-#define VM_ALIASED_TO            1
-#define VM_WARN                  2
-#define VM_ERROR                 3
-#define VM_IF_SERVER_CLASS       4
-#define VM_IGNORE                5
-struct vmdesc {
-    char *name;
-    int flag;
-    char *alias;
-    char *server_class;
-};
-static struct vmdesc *knownVMs = NULL;
-static int knownVMsCount = 0;
-static int knownVMsLimit = 0;
-
-static void GrowKnownVMs();
-static int  KnownVMIndex(const char* name);
-static void FreeKnownVMs();
-
-jboolean ServerClassMachine();
-
-/* flag which if set suppresses error messages from the launcher */
-static int noExitErrorMessage = 0;
-
-/*
- * Entry point.
- */
-int
-main(int argc, char ** argv)
-{
-    JavaVM *vm = 0;
-    JNIEnv *env = 0;
-    char *jarfile = 0;
-    char *classname = 0;
-    char *s = 0;
-    char *main_class = NULL;
-    jstring mainClassName;
-    jclass mainClass;
-    jmethodID mainID;
-    jobjectArray mainArgs;
-    int ret;
-    InvocationFunctions ifn;
-    jlong start, end;
-    char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
-    char ** original_argv = argv;
-
-    /*
-     * Error message to print or display; by default the message will
-     * only be displayed in a window.
-     */
-    char * message = "Fatal exception occurred.  Program will exit.";
-    jboolean messageDest = JNI_FALSE;
-
-    if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) {
-        _launcher_debug = JNI_TRUE;
-        printf("----_JAVA_LAUNCHER_DEBUG----\n");
-    }
-
-#ifndef GAMMA
-    /*
-     * Make sure the specified version of the JRE is running.
-     *
-     * There are three things to note about the SelectVersion() routine:
-     *  1) If the version running isn't correct, this routine doesn't
-     *     return (either the correct version has been exec'd or an error
-     *     was issued).
-     *  2) Argc and Argv in this scope are *not* altered by this routine.
-     *     It is the responsibility of subsequent code to ignore the
-     *     arguments handled by this routine.
-     *  3) As a side-effect, the variable "main_class" is guaranteed to
-     *     be set (if it should ever be set).  This isn't exactly the
-     *     poster child for structured programming, but it is a small
-     *     price to pay for not processing a jar file operand twice.
-     *     (Note: This side effect has been disabled.  See comment on
-     *     bugid 5030265 below.)
-     */
-    SelectVersion(argc, argv, &main_class);
-#endif /* ifndef GAMMA */
-
-    /* copy original argv */
-    {
-      int i;
-      original_argv = (char**)MemAlloc(sizeof(char*)*(argc+1));
-      for(i = 0; i < argc+1; i++)
-        original_argv[i] = argv[i];
-    }
-
-    CreateExecutionEnvironment(&argc, &argv,
-                               jrepath, sizeof(jrepath),
-                               jvmpath, sizeof(jvmpath),
-                               original_argv);
-    ifn.CreateJavaVM = 0;
-    ifn.GetDefaultJavaVMInitArgs = 0;
-
-    if (_launcher_debug)
-      start = CounterGet();
-    if (!LoadJavaVM(jvmpath, &ifn)) {
-      exit(6);
-    }
-    if (_launcher_debug) {
-      end   = CounterGet();
-      printf("%ld micro seconds to LoadJavaVM\n",
-             (long)(jint)Counter2Micros(end-start));
-    }
-
-#ifdef JAVA_ARGS  /* javac, jar and friends. */
-    progname = "java";
-#else             /* java, oldjava, javaw and friends */
-#ifdef PROGNAME
-    progname = PROGNAME;
-#else
-    progname = *argv;
-    if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
-        progname = s + 1;
-    }
-#endif /* PROGNAME */
-#endif /* JAVA_ARGS */
-    ++argv;
-    --argc;
-
-#ifdef JAVA_ARGS
-    /* Preprocess wrapper arguments */
-    TranslateDashJArgs(&argc, &argv);
-    if (!AddApplicationOptions()) {
-        exit(1);
-    }
-#endif
-
-    /* Set default CLASSPATH */
-    if ((s = getenv("CLASSPATH")) == 0) {
-        s = ".";
-    }
-#ifndef JAVA_ARGS
-    SetClassPath(s);
-#endif
-
-    /*
-     *  Parse command line options; if the return value of
-     *  ParseArguments is false, the program should exit.
-     */
-    if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret)) {
-      exit(ret);
-    }
-
-    /* Override class path if -jar flag was specified */
-    if (jarfile != 0) {
-        SetClassPath(jarfile);
-    }
-
-    /* set the -Dsun.java.command pseudo property */
-    SetJavaCommandLineProp(classname, jarfile, argc, argv);
-
-#ifdef GAMMA
-    /* Set the -Dsun.java.launcher pseudo property */
-    SetJavaLauncherProp();
-#endif
-
-    /*
-     * Done with all command line processing and potential re-execs so
-     * clean up the environment.
-     */
-    (void)UnsetEnv(ENV_ENTRY);
-
-    /* Initialize the virtual machine */
-
-    if (_launcher_debug)
-        start = CounterGet();
-    if (!InitializeJVM(&vm, &env, &ifn)) {
-        ReportErrorMessage("Could not create the Java virtual machine.",
-                           JNI_TRUE);
-        exit(1);
-    }
-
-    if (printVersion || showVersion) {
-        PrintJavaVersion(env);
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-        if (printVersion) {
-            ret = 0;
-            message = NULL;
-            goto leave;
-        }
-        if (showVersion) {
-            fprintf(stderr, "\n");
-        }
-    }
-
-    /* If the user specified neither a class name nor a JAR file */
-    if (jarfile == 0 && classname == 0) {
-        PrintUsage();
-        message = NULL;
-        goto leave;
-    }
-
-#ifndef GAMMA
-    FreeKnownVMs();  /* after last possible PrintUsage() */
-#endif
-
-    if (_launcher_debug) {
-        end   = CounterGet();
-        printf("%ld micro seconds to InitializeJVM\n",
-               (long)(jint)Counter2Micros(end-start));
-    }
-
-    /* At this stage, argc/argv have the applications' arguments */
-    if (_launcher_debug) {
-        int i = 0;
-        printf("Main-Class is '%s'\n", classname ? classname : "");
-        printf("Apps' argc is %d\n", argc);
-        for (; i < argc; i++) {
-            printf("    argv[%2d] = '%s'\n", i, argv[i]);
-        }
-    }
-
-    ret = 1;
-
-    /*
-     * Get the application's main class.
-     *
-     * See bugid 5030265.  The Main-Class name has already been parsed
-     * from the manifest, but not parsed properly for UTF-8 support.
-     * Hence the code here ignores the value previously extracted and
-     * uses the pre-existing code to reextract the value.  This is
-     * possibly an end of release cycle expedient.  However, it has
-     * also been discovered that passing some character sets through
-     * the environment has "strange" behavior on some variants of
-     * Windows.  Hence, maybe the manifest parsing code local to the
-     * launcher should never be enhanced.
-     *
-     * Hence, future work should either:
-     *     1)   Correct the local parsing code and verify that the
-     *          Main-Class attribute gets properly passed through
-     *          all environments,
-     *     2)   Remove the vestages of maintaining main_class through
-     *          the environment (and remove these comments).
-     */
-    if (jarfile != 0) {
-        mainClassName = GetMainClassName(env, jarfile);
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-        if (mainClassName == NULL) {
-          const char * format = "Failed to load Main-Class manifest "
-                                "attribute from\n%s";
-          message = (char*)MemAlloc((strlen(format) + strlen(jarfile)) *
-                                    sizeof(char));
-          sprintf(message, format, jarfile);
-          messageDest = JNI_TRUE;
-          goto leave;
-        }
-        classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
-        if (classname == NULL) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-        mainClass = LoadClass(env, classname);
-        if(mainClass == NULL) { /* exception occurred */
-            ReportExceptionDescription(env);
-            message = "Could not find the main class.  Program will exit.";
-            goto leave;
-        }
-        (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
-    } else {
-      mainClassName = NewPlatformString(env, classname);
-      if (mainClassName == NULL) {
-        const char * format = "Failed to load Main Class: %s";
-        message = (char *)MemAlloc((strlen(format) + strlen(classname)) *
-                                   sizeof(char) );
-        sprintf(message, format, classname);
-        messageDest = JNI_TRUE;
-        goto leave;
-      }
-      classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
-      if (classname == NULL) {
-        ReportExceptionDescription(env);
-        goto leave;
-      }
-      mainClass = LoadClass(env, classname);
-      if(mainClass == NULL) { /* exception occurred */
-        ReportExceptionDescription(env);
-        message = "Could not find the main class. Program will exit.";
-        goto leave;
-      }
-      (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
-    }
-
-    /* Get the application's main method */
-    mainID = (*env)->GetStaticMethodID(env, mainClass, "main",
-                                       "([Ljava/lang/String;)V");
-    if (mainID == NULL) {
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-        } else {
-          message = "No main method found in specified class.";
-          messageDest = JNI_TRUE;
-        }
-        goto leave;
-    }
-
-    {    /* Make sure the main method is public */
-        jint mods;
-        jmethodID mid;
-        jobject obj = (*env)->ToReflectedMethod(env, mainClass,
-                                                mainID, JNI_TRUE);
-
-        if( obj == NULL) { /* exception occurred */
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-
-        mid =
-          (*env)->GetMethodID(env,
-                              (*env)->GetObjectClass(env, obj),
-                              "getModifiers", "()I");
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-
-        mods = (*env)->CallIntMethod(env, obj, mid);
-        if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */
-            message = "Main method not public.";
-            messageDest = JNI_TRUE;
-            goto leave;
-        }
-    }
-
-    /* Build argument array */
-    mainArgs = NewPlatformStringArray(env, argv, argc);
-    if (mainArgs == NULL) {
-        ReportExceptionDescription(env);
-        goto leave;
-    }
-
-    /* Invoke main method. */
-    (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
-
-    /*
-     * The launcher's exit code (in the absence of calls to
-     * System.exit) will be non-zero if main threw an exception.
-     */
-    ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
-
-    /*
-     * Detach the main thread so that it appears to have ended when
-     * the application's main method exits.  This will invoke the
-     * uncaught exception handler machinery if main threw an
-     * exception.  An uncaught exception handler cannot change the
-     * launcher's return code except by calling System.exit.
-     */
-    if ((*vm)->DetachCurrentThread(vm) != 0) {
-        message = "Could not detach main thread.";
-        messageDest = JNI_TRUE;
-        ret = 1;
-        goto leave;
-    }
-
-    message = NULL;
-
- leave:
-    /*
-     * Wait for all non-daemon threads to end, then destroy the VM.
-     * This will actually create a trivial new Java waiter thread
-     * named "DestroyJavaVM", but this will be seen as a different
-     * thread from the one that executed main, even though they are
-     * the same C thread.  This allows mainThread.join() and
-     * mainThread.isAlive() to work as expected.
-     */
-    (*vm)->DestroyJavaVM(vm);
-
-    if(message != NULL && !noExitErrorMessage)
-      ReportErrorMessage(message, messageDest);
-    return ret;
-}
-
-
-#ifndef GAMMA
-/*
- * Checks the command line options to find which JVM type was
- * specified.  If no command line option was given for the JVM type,
- * the default type is used.  The environment variable
- * JDK_ALTERNATE_VM and the command line option -XXaltjvm= are also
- * checked as ways of specifying which JVM type to invoke.
- */
-char *
-CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
-    int i, argi;
-    int argc;
-    char **newArgv;
-    int newArgvIdx = 0;
-    int isVMType;
-    int jvmidx = -1;
-    char *jvmtype = getenv("JDK_ALTERNATE_VM");
-
-    argc = *pargc;
-
-    /* To make things simpler we always copy the argv array */
-    newArgv = MemAlloc((argc + 1) * sizeof(char *));
-
-    /* The program name is always present */
-    newArgv[newArgvIdx++] = (*argv)[0];
-
-    for (argi = 1; argi < argc; argi++) {
-        char *arg = (*argv)[argi];
-        isVMType = 0;
-
-#ifdef JAVA_ARGS
-        if (arg[0] != '-') {
-            newArgv[newArgvIdx++] = arg;
-            continue;
-        }
-#else
-        if (strcmp(arg, "-classpath") == 0 ||
-            strcmp(arg, "-cp") == 0) {
-            newArgv[newArgvIdx++] = arg;
-            argi++;
-            if (argi < argc) {
-                newArgv[newArgvIdx++] = (*argv)[argi];
-            }
-            continue;
-        }
-        if (arg[0] != '-') break;
-#endif
-
-        /* Did the user pass an explicit VM type? */
-        i = KnownVMIndex(arg);
-        if (i >= 0) {
-            jvmtype = knownVMs[jvmidx = i].name + 1; /* skip the - */
-            isVMType = 1;
-            *pargc = *pargc - 1;
-        }
-
-        /* Did the user specify an "alternate" VM? */
-        else if (strncmp(arg, "-XXaltjvm=", 10) == 0 || strncmp(arg, "-J-XXaltjvm=", 12) == 0) {
-            isVMType = 1;
-            jvmtype = arg+((arg[1]=='X')? 10 : 12);
-            jvmidx = -1;
-        }
-
-        if (!isVMType) {
-            newArgv[newArgvIdx++] = arg;
-        }
-    }
-
-    /*
-     * Finish copying the arguments if we aborted the above loop.
-     * NOTE that if we aborted via "break" then we did NOT copy the
-     * last argument above, and in addition argi will be less than
-     * argc.
-     */
-    while (argi < argc) {
-        newArgv[newArgvIdx++] = (*argv)[argi];
-        argi++;
-    }
-
-    /* argv is null-terminated */
-    newArgv[newArgvIdx] = 0;
-
-    /* Copy back argv */
-    *argv = newArgv;
-    *pargc = newArgvIdx;
-
-    /* use the default VM type if not specified (no alias processing) */
-    if (jvmtype == NULL) {
-      char* result = knownVMs[0].name+1;
-      /* Use a different VM type if we are on a server class machine? */
-      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
-          (ServerClassMachine() == JNI_TRUE)) {
-        result = knownVMs[0].server_class+1;
-      }
-      if (_launcher_debug) {
-        printf("Default VM: %s\n", result);
-      }
-      return result;
-    }
-
-    /* if using an alternate VM, no alias processing */
-    if (jvmidx < 0)
-      return jvmtype;
-
-    /* Resolve aliases first */
-    {
-      int loopCount = 0;
-      while (knownVMs[jvmidx].flag == VM_ALIASED_TO) {
-        int nextIdx = KnownVMIndex(knownVMs[jvmidx].alias);
-
-        if (loopCount > knownVMsCount) {
-          if (!speculative) {
-            ReportErrorMessage("Error: Corrupt jvm.cfg file; cycle in alias list.",
-                               JNI_TRUE);
-            exit(1);
-          } else {
-            return "ERROR";
-            /* break; */
-          }
-        }
-
-        if (nextIdx < 0) {
-          if (!speculative) {
-            ReportErrorMessage2("Error: Unable to resolve VM alias %s",
-                                knownVMs[jvmidx].alias, JNI_TRUE);
-            exit(1);
-          } else {
-            return "ERROR";
-          }
-        }
-        jvmidx = nextIdx;
-        jvmtype = knownVMs[jvmidx].name+1;
-        loopCount++;
-      }
-    }
-
-    switch (knownVMs[jvmidx].flag) {
-    case VM_WARN:
-        if (!speculative) {
-            fprintf(stderr, "Warning: %s VM not supported; %s VM will be used\n",
-                    jvmtype, knownVMs[0].name + 1);
-        }
-        /* fall through */
-    case VM_IGNORE:
-        jvmtype = knownVMs[jvmidx=0].name + 1;
-        /* fall through */
-    case VM_KNOWN:
-        break;
-    case VM_ERROR:
-        if (!speculative) {
-            ReportErrorMessage2("Error: %s VM not supported", jvmtype, JNI_TRUE);
-            exit(1);
-        } else {
-            return "ERROR";
-        }
-    }
-
-    return jvmtype;
-}
-#endif /* ifndef GAMMA */
-
-/*
- * Adds a new VM option with the given given name and value.
- */
-static void
-AddOption(char *str, void *info)
-{
-    /*
-     * Expand options array if needed to accommodate at least one more
-     * VM option.
-     */
-    if (numOptions >= maxOptions) {
-        if (options == 0) {
-            maxOptions = 4;
-            options = MemAlloc(maxOptions * sizeof(JavaVMOption));
-        } else {
-            JavaVMOption *tmp;
-            maxOptions *= 2;
-            tmp = MemAlloc(maxOptions * sizeof(JavaVMOption));
-            memcpy(tmp, options, numOptions * sizeof(JavaVMOption));
-            free(options);
-            options = tmp;
-        }
-    }
-    options[numOptions].optionString = str;
-    options[numOptions++].extraInfo = info;
-}
-
-static void
-SetClassPath(char *s)
-{
-    char *def = MemAlloc(strlen(s) + 40);
-    sprintf(def, "-Djava.class.path=%s", s);
-    AddOption(def, NULL);
-}
-
-#ifndef GAMMA
-/*
- * The SelectVersion() routine ensures that an appropriate version of
- * the JRE is running.  The specification for the appropriate version
- * is obtained from either the manifest of a jar file (preferred) or
- * from command line options.
- */
-static void
-SelectVersion(int argc, char **argv, char **main_class)
-{
-    char    *arg;
-    char    **new_argv;
-    char    **new_argp;
-    char    *operand;
-    char    *version = NULL;
-    char    *jre = NULL;
-    int     jarflag = 0;
-    int     restrict_search = -1;               /* -1 implies not known */
-    manifest_info info;
-    char    env_entry[MAXNAMELEN + 24] = ENV_ENTRY "=";
-    char    *env_in;
-    int     res;
-
-    /*
-     * If the version has already been selected, set *main_class
-     * with the value passed through the environment (if any) and
-     * simply return.
-     */
-    if ((env_in = getenv(ENV_ENTRY)) != NULL) {
-        if (*env_in != '\0')
-            *main_class = strdup(env_in);
-        return;
-    }
-
-    /*
-     * Scan through the arguments for options relevant to multiple JRE
-     * support.  For reference, the command line syntax is defined as:
-     *
-     * SYNOPSIS
-     *      java [options] class [argument...]
-     *
-     *      java [options] -jar file.jar [argument...]
-     *
-     * As the scan is performed, make a copy of the argument list with
-     * the version specification options (new to 1.5) removed, so that
-     * a version less than 1.5 can be exec'd.
-     */
-    new_argv = MemAlloc((argc + 1) * sizeof(char*));
-    new_argv[0] = argv[0];
-    new_argp = &new_argv[1];
-    argc--;
-    argv++;
-    while ((arg = *argv) != 0 && *arg == '-') {
-        if (strncmp(arg, "-version:", 9) == 0) {
-            version = arg + 9;
-        } else if (strcmp(arg, "-jre-restrict-search") == 0) {
-            restrict_search = 1;
-        } else if (strcmp(arg, "-no-jre-restrict-search") == 0) {
-            restrict_search = 0;
-        } else {
-            if (strcmp(arg, "-jar") == 0)
-                jarflag = 1;
-            /* deal with "unfortunate" classpath syntax */
-            if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) &&
-              (argc >= 2)) {
-                *new_argp++ = arg;
-                argc--;
-                argv++;
-                arg = *argv;
-            }
-            *new_argp++ = arg;
-        }
-        argc--;
-        argv++;
-    }
-    if (argc <= 0) {    /* No operand? Possibly legit with -[full]version */
-        operand = NULL;
-    } else {
-        argc--;
-        *new_argp++ = operand = *argv++;
-    }
-    while (argc-- > 0)  /* Copy over [argument...] */
-        *new_argp++ = *argv++;
-    *new_argp = NULL;
-
-    /*
-     * If there is a jar file, read the manifest. If the jarfile can't be
-     * read, the manifest can't be read from the jar file, or the manifest
-     * is corrupt, issue the appropriate error messages and exit.
-     *
-     * Even if there isn't a jar file, construct a manifest_info structure
-     * containing the command line information.  It's a convenient way to carry
-     * this data around.
-     */
-    if (jarflag && operand) {
-        if ((res = parse_manifest(operand, &info)) != 0) {
-            if (res == -1)
-                ReportErrorMessage2("Unable to access jarfile %s",
-                  operand, JNI_TRUE);
-            else
-                ReportErrorMessage2("Invalid or corrupt jarfile %s",
-                  operand, JNI_TRUE);
-            exit(1);
-        }
-    } else {
-        info.manifest_version = NULL;
-        info.main_class = NULL;
-        info.jre_version = NULL;
-        info.jre_restrict_search = 0;
-    }
-
-    /*
-     * The JRE-Version and JRE-Restrict-Search values (if any) from the
-     * manifest are overwritten by any specified on the command line.
-     */
-    if (version != NULL)
-        info.jre_version = version;
-    if (restrict_search != -1)
-        info.jre_restrict_search = restrict_search;
-
-    /*
-     * "Valid" returns (other than unrecoverable errors) follow.  Set
-     * main_class as a side-effect of this routine.
-     */
-    if (info.main_class != NULL)
-        *main_class = strdup(info.main_class);
-
-    /*
-     * If no version selection information is found either on the command
-     * line or in the manifest, simply return.
-     */
-    if (info.jre_version == NULL) {
-        free_manifest();
-        free(new_argv);
-        return;
-    }
-
-    /*
-     * Check for correct syntax of the version specification (JSR 56).
-     */
-    if (!valid_version_string(info.jre_version)) {
-        ReportErrorMessage2("Syntax error in version specification \"%s\"",
-          info.jre_version, JNI_TRUE);
-        exit(1);
-    }
-
-    /*
-     * Find the appropriate JVM on the system. Just to be as forgiving as
-     * possible, if the standard algorithms don't locate an appropriate
-     * jre, check to see if the one running will satisfy the requirements.
-     * This can happen on systems which haven't been set-up for multiple
-     * JRE support.
-     */
-    jre = LocateJRE(&info);
-    if (_launcher_debug)
-        printf("JRE-Version = %s, JRE-Restrict-Search = %s Selected = %s\n",
-          (info.jre_version?info.jre_version:"null"),
-          (info.jre_restrict_search?"true":"false"), (jre?jre:"null"));
-    if (jre == NULL) {
-        if (acceptable_release(FULL_VERSION, info.jre_version)) {
-            free_manifest();
-            free(new_argv);
-            return;
-        } else {
-            ReportErrorMessage2(
-              "Unable to locate JRE meeting specification \"%s\"",
-              info.jre_version, JNI_TRUE);
-            exit(1);
-        }
-    }
-
-    /*
-     * If I'm not the chosen one, exec the chosen one.  Returning from
-     * ExecJRE indicates that I am indeed the chosen one.
-     *
-     * The private environment variable _JAVA_VERSION_SET is used to
-     * prevent the chosen one from re-reading the manifest file and
-     * using the values found within to override the (potential) command
-     * line flags stripped from argv (because the target may not
-     * understand them).  Passing the MainClass value is an optimization
-     * to avoid locating, expanding and parsing the manifest extra
-     * times.
-     */
-    if (info.main_class != NULL)
-        (void)strcat(env_entry, info.main_class);
-    (void)putenv(env_entry);
-    ExecJRE(jre, new_argv);
-    free_manifest();
-    free(new_argv);
-    return;
-}
-#endif /* ifndef GAMMA */
-
-/*
- * Parses command line arguments.  Returns JNI_FALSE if launcher
- * should exit without starting vm (e.g. certain version and usage
- * options); returns JNI_TRUE if vm needs to be started to process
- * given options.  *pret (the launcher process return value) is set to
- * 0 for a normal exit.
- */
-static jboolean
-ParseArguments(int *pargc, char ***pargv, char **pjarfile,
-                       char **pclassname, int *pret)
-{
-    int argc = *pargc;
-    char **argv = *pargv;
-    jboolean jarflag = JNI_FALSE;
-    char *arg;
-
-    *pret = 1;
-    while ((arg = *argv) != 0 && *arg == '-') {
-        argv++; --argc;
-        if (strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) {
-            if (argc < 1) {
-                ReportErrorMessage2("%s requires class path specification",
-                                    arg, JNI_TRUE);
-                PrintUsage();
-                return JNI_FALSE;
-            }
-            SetClassPath(*argv);
-            argv++; --argc;
-        } else if (strcmp(arg, "-jar") == 0) {
-            jarflag = JNI_TRUE;
-        } else if (strcmp(arg, "-help") == 0 ||
-                   strcmp(arg, "-h") == 0 ||
-                   strcmp(arg, "-?") == 0) {
-            PrintUsage();
-            *pret = 0;
-            return JNI_FALSE;
-        } else if (strcmp(arg, "-version") == 0) {
-            printVersion = JNI_TRUE;
-            return JNI_TRUE;
-        } else if (strcmp(arg, "-showversion") == 0) {
-            showVersion = JNI_TRUE;
-        } else if (strcmp(arg, "-X") == 0) {
-            *pret = PrintXUsage();
-            return JNI_FALSE;
-/*
- * The following case provide backward compatibility with old-style
- * command line options.
- */
-        } else if (strcmp(arg, "-fullversion") == 0) {
-            fprintf(stderr, "%s full version \"%s\"\n", progname,
-                    FULL_VERSION);
-            *pret = 0;
-            return JNI_FALSE;
-        } else if (strcmp(arg, "-verbosegc") == 0) {
-            AddOption("-verbose:gc", NULL);
-        } else if (strcmp(arg, "-t") == 0) {
-            AddOption("-Xt", NULL);
-        } else if (strcmp(arg, "-tm") == 0) {
-            AddOption("-Xtm", NULL);
-        } else if (strcmp(arg, "-debug") == 0) {
-            AddOption("-Xdebug", NULL);
-        } else if (strcmp(arg, "-noclassgc") == 0) {
-            AddOption("-Xnoclassgc", NULL);
-        } else if (strcmp(arg, "-Xfuture") == 0) {
-            AddOption("-Xverify:all", NULL);
-        } else if (strcmp(arg, "-verify") == 0) {
-            AddOption("-Xverify:all", NULL);
-        } else if (strcmp(arg, "-verifyremote") == 0) {
-            AddOption("-Xverify:remote", NULL);
-        } else if (strcmp(arg, "-noverify") == 0) {
-            AddOption("-Xverify:none", NULL);
-        } else if (strcmp(arg, "-XXsuppressExitMessage") == 0) {
-            noExitErrorMessage = 1;
-        } else if (strncmp(arg, "-prof", 5) == 0) {
-            char *p = arg + 5;
-            char *tmp = MemAlloc(strlen(arg) + 50);
-            if (*p) {
-                sprintf(tmp, "-Xrunhprof:cpu=old,file=%s", p + 1);
-            } else {
-                sprintf(tmp, "-Xrunhprof:cpu=old,file=java.prof");
-            }
-            AddOption(tmp, NULL);
-        } else if (strncmp(arg, "-ss", 3) == 0 ||
-                   strncmp(arg, "-oss", 4) == 0 ||
-                   strncmp(arg, "-ms", 3) == 0 ||
-                   strncmp(arg, "-mx", 3) == 0) {
-            char *tmp = MemAlloc(strlen(arg) + 6);
-            sprintf(tmp, "-X%s", arg + 1); /* skip '-' */
-            AddOption(tmp, NULL);
-        } else if (strcmp(arg, "-checksource") == 0 ||
-                   strcmp(arg, "-cs") == 0 ||
-                   strcmp(arg, "-noasyncgc") == 0) {
-            /* No longer supported */
-            fprintf(stderr,
-                    "Warning: %s option is no longer supported.\n",
-                    arg);
-        } else if (strncmp(arg, "-version:", 9) == 0 ||
-                   strcmp(arg, "-no-jre-restrict-search") == 0 ||
-                   strcmp(arg, "-jre-restrict-search") == 0) {
-            ; /* Ignore machine independent options already handled */
-        } else if (RemovableMachineDependentOption(arg) ) {
-            ; /* Do not pass option to vm. */
-        }
-        else {
-            AddOption(arg, NULL);
-        }
-    }
-
-    if (--argc >= 0) {
-        if (jarflag) {
-            *pjarfile = *argv++;
-            *pclassname = 0;
-        } else {
-            *pjarfile = 0;
-            *pclassname = *argv++;
-        }
-        *pargc = argc;
-        *pargv = argv;
-    }
-
-    return JNI_TRUE;
-}
-
-/*
- * Initializes the Java Virtual Machine. Also frees options array when
- * finished.
- */
-static jboolean
-InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn)
-{
-    JavaVMInitArgs args;
-    jint r;
-
-    memset(&args, 0, sizeof(args));
-    args.version  = JNI_VERSION_1_2;
-    args.nOptions = numOptions;
-    args.options  = options;
-    args.ignoreUnrecognized = JNI_FALSE;
-
-    if (_launcher_debug) {
-        int i = 0;
-        printf("JavaVM args:\n    ");
-        printf("version 0x%08lx, ", (long)args.version);
-        printf("ignoreUnrecognized is %s, ",
-               args.ignoreUnrecognized ? "JNI_TRUE" : "JNI_FALSE");
-        printf("nOptions is %ld\n", (long)args.nOptions);
-        for (i = 0; i < numOptions; i++)
-            printf("    option[%2d] = '%s'\n",
-                   i, args.options[i].optionString);
-    }
-
-    r = ifn->CreateJavaVM(pvm, (void **)penv, &args);
-    free(options);
-    return r == JNI_OK;
-}
-
-
-#define NULL_CHECK0(e) if ((e) == 0) return 0
-#define NULL_CHECK(e) if ((e) == 0) return
-
-/*
- * Returns a pointer to a block of at least 'size' bytes of memory.
- * Prints error message and exits if the memory could not be allocated.
- */
-void *
-MemAlloc(size_t size)
-{
-    void *p = malloc(size);
-    if (p == 0) {
-        perror("malloc");
-        exit(1);
-    }
-    return p;
-}
-
-static jstring platformEncoding = NULL;
-static jstring getPlatformEncoding(JNIEnv *env) {
-    if (platformEncoding == NULL) {
-        jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding");
-        if (propname) {
-            jclass cls;
-            jmethodID mid;
-            NULL_CHECK0 (cls = FindBootStrapClass(env, "java/lang/System"));
-            NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
-                                   env, cls,
-                                   "getProperty",
-                                   "(Ljava/lang/String;)Ljava/lang/String;"));
-            platformEncoding = (*env)->CallStaticObjectMethod (
-                                    env, cls, mid, propname);
-        }
-    }
-    return platformEncoding;
-}
-
-static jboolean isEncodingSupported(JNIEnv *env, jstring enc) {
-    jclass cls;
-    jmethodID mid;
-    NULL_CHECK0 (cls = FindBootStrapClass(env, "java/nio/charset/Charset"));
-    NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
-                           env, cls,
-                           "isSupported",
-                           "(Ljava/lang/String;)Z"));
-    return (jboolean)(*env)->CallStaticObjectMethod (env, cls, mid, enc);
-}
-
-/*
- * Returns a new Java string object for the specified platform string.
- */
-static jstring
-NewPlatformString(JNIEnv *env, char *s)
-{
-    int len = (int)strlen(s);
-    jclass cls;
-    jmethodID mid;
-    jbyteArray ary;
-    jstring enc;
-
-    if (s == NULL)
-        return 0;
-    enc = getPlatformEncoding(env);
-
-    ary = (*env)->NewByteArray(env, len);
-    if (ary != 0) {
-        jstring str = 0;
-        (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s);
-        if (!(*env)->ExceptionOccurred(env)) {
-#ifdef GAMMA
-            /* We support running JVM with older JDK, so here we have to deal */
-            /* with the case that sun.jnu.encoding is undefined (enc == NULL) */
-            if (enc != NULL && isEncodingSupported(env, enc) == JNI_TRUE) {
-#else
-            if (isEncodingSupported(env, enc) == JNI_TRUE) {
-#endif
-                NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
-                NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
-                                          "([BLjava/lang/String;)V"));
-                str = (*env)->NewObject(env, cls, mid, ary, enc);
-            } else {
-                /*If the encoding specified in sun.jnu.encoding is not
-                  endorsed by "Charset.isSupported" we have to fall back
-                  to use String(byte[]) explicitly here without specifying
-                  the encoding name, in which the StringCoding class will
-                  pickup the iso-8859-1 as the fallback converter for us.
-                */
-                NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
-                NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
-                                          "([B)V"));
-                str = (*env)->NewObject(env, cls, mid, ary);
-            }
-            (*env)->DeleteLocalRef(env, ary);
-            return str;
-        }
-    }
-    return 0;
-}
-
-/*
- * Returns a new array of Java string objects for the specified
- * array of platform strings.
- */
-static jobjectArray
-NewPlatformStringArray(JNIEnv *env, char **strv, int strc)
-{
-    jarray cls;
-    jarray ary;
-    int i;
-
-    NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
-    NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0));
-    for (i = 0; i < strc; i++) {
-        jstring str = NewPlatformString(env, *strv++);
-        NULL_CHECK0(str);
-        (*env)->SetObjectArrayElement(env, ary, i, str);
-        (*env)->DeleteLocalRef(env, str);
-    }
-    return ary;
-}
-
-/*
- * Loads a class, convert the '.' to '/'.
- */
-static jclass
-LoadClass(JNIEnv *env, char *name)
-{
-    char *buf = MemAlloc(strlen(name) + 1);
-    char *s = buf, *t = name, c;
-    jclass cls;
-    jlong start, end;
-
-    if (_launcher_debug)
-        start = CounterGet();
-
-    do {
-        c = *t++;
-        *s++ = (c == '.') ? '/' : c;
-    } while (c != '\0');
-    // use the application class loader for the main-class
-    cls = (*env)->FindClass(env, buf);
-    free(buf);
-
-    if (_launcher_debug) {
-        end   = CounterGet();
-        printf("%ld micro seconds to load main class\n",
-               (long)(jint)Counter2Micros(end-start));
-        printf("----_JAVA_LAUNCHER_DEBUG----\n");
-    }
-
-    return cls;
-}
-
-
-/*
- * Returns the main class name for the specified jar file.
- */
-static jstring
-GetMainClassName(JNIEnv *env, char *jarname)
-{
-#define MAIN_CLASS "Main-Class"
-    jclass cls;
-    jmethodID mid;
-    jobject jar, man, attr;
-    jstring str, result = 0;
-
-    NULL_CHECK0(cls = FindBootStrapClass(env, "java/util/jar/JarFile"));
-    NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
-                                          "(Ljava/lang/String;)V"));
-    NULL_CHECK0(str = NewPlatformString(env, jarname));
-    NULL_CHECK0(jar = (*env)->NewObject(env, cls, mid, str));
-    NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "getManifest",
-                                          "()Ljava/util/jar/Manifest;"));
-    man = (*env)->CallObjectMethod(env, jar, mid);
-    if (man != 0) {
-        NULL_CHECK0(mid = (*env)->GetMethodID(env,
-                                    (*env)->GetObjectClass(env, man),
-                                    "getMainAttributes",
-                                    "()Ljava/util/jar/Attributes;"));
-        attr = (*env)->CallObjectMethod(env, man, mid);
-        if (attr != 0) {
-            NULL_CHECK0(mid = (*env)->GetMethodID(env,
-                                    (*env)->GetObjectClass(env, attr),
-                                    "getValue",
-                                    "(Ljava/lang/String;)Ljava/lang/String;"));
-            NULL_CHECK0(str = NewPlatformString(env, MAIN_CLASS));
-            result = (*env)->CallObjectMethod(env, attr, mid, str);
-        }
-    }
-    return result;
-}
-
-#ifdef JAVA_ARGS
-static char *java_args[] = JAVA_ARGS;
-static char *app_classpath[] = APP_CLASSPATH;
-
-/*
- * For tools convert 'javac -J-ms32m' to 'java -ms32m ...'
- */
-static void
-TranslateDashJArgs(int *pargc, char ***pargv)
-{
-    const int NUM_ARGS = (sizeof(java_args) / sizeof(char *));
-    int argc = *pargc;
-    char **argv = *pargv;
-    int nargc = argc + NUM_ARGS;
-    char **nargv = MemAlloc((nargc + 1) * sizeof(char *));
-    int i;
-
-    *pargc = nargc;
-    *pargv = nargv;
-
-    /* Copy the VM arguments (i.e. prefixed with -J) */
-    for (i = 0; i < NUM_ARGS; i++) {
-        char *arg = java_args[i];
-        if (arg[0] == '-' && arg[1] == 'J') {
-            *nargv++ = arg + 2;
-        }
-    }
-
-    for (i = 0; i < argc; i++) {
-        char *arg = argv[i];
-        if (arg[0] == '-' && arg[1] == 'J') {
-            if (arg[2] == '\0') {
-                ReportErrorMessage("Error: the -J option should not be "
-                                   "followed by a space.", JNI_TRUE);
-                exit(1);
-            }
-            *nargv++ = arg + 2;
-        }
-    }
-
-    /* Copy the rest of the arguments */
-    for (i = 0; i < NUM_ARGS; i++) {
-        char *arg = java_args[i];
-        if (arg[0] != '-' || arg[1] != 'J') {
-            *nargv++ = arg;
-        }
-    }
-    for (i = 0; i < argc; i++) {
-        char *arg = argv[i];
-        if (arg[0] != '-' || arg[1] != 'J') {
-            *nargv++ = arg;
-        }
-    }
-    *nargv = 0;
-}
-
-/*
- * For our tools, we try to add 3 VM options:
- *      -Denv.class.path=<envcp>
- *      -Dapplication.home=<apphome>
- *      -Djava.class.path=<appcp>
- * <envcp>   is the user's setting of CLASSPATH -- for instance the user
- *           tells javac where to find binary classes through this environment
- *           variable.  Notice that users will be able to compile against our
- *           tools classes (sun.tools.javac.Main) only if they explicitly add
- *           tools.jar to CLASSPATH.
- * <apphome> is the directory where the application is installed.
- * <appcp>   is the classpath to where our apps' classfiles are.
- */
-static jboolean
-AddApplicationOptions()
-{
-    const int NUM_APP_CLASSPATH = (sizeof(app_classpath) / sizeof(char *));
-    char *s, *envcp, *appcp, *apphome;
-    char home[MAXPATHLEN]; /* application home */
-    char separator[] = { PATH_SEPARATOR, '\0' };
-    int size, i;
-    int strlenHome;
-
-    s = getenv("CLASSPATH");
-    if (s) {
-        /* 40 for -Denv.class.path= */
-        envcp = (char *)MemAlloc(strlen(s) + 40);
-        sprintf(envcp, "-Denv.class.path=%s", s);
-        AddOption(envcp, NULL);
-    }
-
-    if (!GetApplicationHome(home, sizeof(home))) {
-        ReportErrorMessage("Can't determine application home", JNI_TRUE);
-        return JNI_FALSE;
-    }
-
-    /* 40 for '-Dapplication.home=' */
-    apphome = (char *)MemAlloc(strlen(home) + 40);
-    sprintf(apphome, "-Dapplication.home=%s", home);
-    AddOption(apphome, NULL);
-
-    /* How big is the application's classpath? */
-    size = 40;                                 /* 40: "-Djava.class.path=" */
-    strlenHome = (int)strlen(home);
-    for (i = 0; i < NUM_APP_CLASSPATH; i++) {
-        size += strlenHome + (int)strlen(app_classpath[i]) + 1; /* 1: separator */
-    }
-    appcp = (char *)MemAlloc(size + 1);
-    strcpy(appcp, "-Djava.class.path=");
-    for (i = 0; i < NUM_APP_CLASSPATH; i++) {
-        strcat(appcp, home);                    /* c:\program files\myapp */
-        strcat(appcp, app_classpath[i]);        /* \lib\myapp.jar         */
-        strcat(appcp, separator);               /* ;                      */
-    }
-    appcp[strlen(appcp)-1] = '\0';  /* remove trailing path separator */
-    AddOption(appcp, NULL);
-    return JNI_TRUE;
-}
-#endif
-
-/*
- * inject the -Dsun.java.command pseudo property into the args structure
- * this pseudo property is used in the HotSpot VM to expose the
- * Java class name and arguments to the main method to the VM. The
- * HotSpot VM uses this pseudo property to store the Java class name
- * (or jar file name) and the arguments to the class's main method
- * to the instrumentation memory region. The sun.java.command pseudo
- * property is not exported by HotSpot to the Java layer.
- */
-void
-SetJavaCommandLineProp(char *classname, char *jarfile,
-                       int argc, char **argv)
-{
-
-    int i = 0;
-    size_t len = 0;
-    char* javaCommand = NULL;
-    char* dashDstr = "-Dsun.java.command=";
-
-    if (classname == NULL && jarfile == NULL) {
-        /* unexpected, one of these should be set. just return without
-         * setting the property
-         */
-        return;
-    }
-
-    /* if the class name is not set, then use the jarfile name */
-    if (classname == NULL) {
-        classname = jarfile;
-    }
-
-    /* determine the amount of memory to allocate assuming
-     * the individual components will be space separated
-     */
-    len = strlen(classname);
-    for (i = 0; i < argc; i++) {
-        len += strlen(argv[i]) + 1;
-    }
-
-    /* allocate the memory */
-    javaCommand = (char*) MemAlloc(len + strlen(dashDstr) + 1);
-
-    /* build the -D string */
-    *javaCommand = '\0';
-    strcat(javaCommand, dashDstr);
-    strcat(javaCommand, classname);
-
-    for (i = 0; i < argc; i++) {
-        /* the components of the string are space separated. In
-         * the case of embedded white space, the relationship of
-         * the white space separated components to their true
-         * positional arguments will be ambiguous. This issue may
-         * be addressed in a future release.
-         */
-        strcat(javaCommand, " ");
-        strcat(javaCommand, argv[i]);
-    }
-
-    AddOption(javaCommand, NULL);
-}
-
-/*
- * JVM wants to know launcher type, so tell it.
- */
-#ifdef GAMMA
-void SetJavaLauncherProp() {
-  AddOption("-Dsun.java.launcher=" LAUNCHER_TYPE, NULL);
-}
-#endif
-
-/*
- * Prints the version information from the java.version and other properties.
- */
-static void
-PrintJavaVersion(JNIEnv *env)
-{
-    jclass ver;
-    jmethodID print;
-
-    NULL_CHECK(ver = FindBootStrapClass(env, "sun/misc/Version"));
-    NULL_CHECK(print = (*env)->GetStaticMethodID(env, ver, "print", "()V"));
-
-    (*env)->CallStaticVoidMethod(env, ver, print);
-}
-
-/*
- * Prints default usage message.
- */
-static void
-PrintUsage(void)
-{
-    int i;
-
-    fprintf(stdout,
-        "Usage: %s [-options] class [args...]\n"
-        "           (to execute a class)\n"
-        "   or  %s [-options] -jar jarfile [args...]\n"
-        "           (to execute a jar file)\n"
-        "\n"
-        "where options include:\n",
-        progname,
-        progname);
-
-#ifndef GAMMA
-    PrintMachineDependentOptions();
-
-    if ((knownVMs[0].flag == VM_KNOWN) ||
-        (knownVMs[0].flag == VM_IF_SERVER_CLASS)) {
-      fprintf(stdout, "    %s\t  to select the \"%s\" VM\n",
-              knownVMs[0].name, knownVMs[0].name+1);
-    }
-    for (i=1; i<knownVMsCount; i++) {
-        if (knownVMs[i].flag == VM_KNOWN)
-            fprintf(stdout, "    %s\t  to select the \"%s\" VM\n",
-                    knownVMs[i].name, knownVMs[i].name+1);
-    }
-    for (i=1; i<knownVMsCount; i++) {
-        if (knownVMs[i].flag == VM_ALIASED_TO)
-            fprintf(stdout, "    %s\t  is a synonym for "
-                    "the \"%s\" VM  [deprecated]\n",
-                    knownVMs[i].name, knownVMs[i].alias+1);
-    }
-
-    /* The first known VM is the default */
-    {
-      const char* defaultVM   = knownVMs[0].name+1;
-      const char* punctuation = ".";
-      const char* reason      = "";
-      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
-          (ServerClassMachine() == JNI_TRUE)) {
-        defaultVM = knownVMs[0].server_class+1;
-        punctuation = ", ";
-        reason = "because you are running on a server-class machine.\n";
-      }
-      fprintf(stdout, "                  The default VM is %s%s\n",
-              defaultVM, punctuation);
-      fprintf(stdout, "                  %s\n",
-              reason);
-    }
-#endif /* ifndef GAMMA */
-
-    fprintf(stdout,
-"    -cp <class search path of directories and zip/jar files>\n"
-"    -classpath <class search path of directories and zip/jar files>\n"
-"                  A %c separated list of directories, JAR archives,\n"
-"                  and ZIP archives to search for class files.\n"
-"    -D<name>=<value>\n"
-"                  set a system property\n"
-"    -verbose[:class|gc|jni]\n"
-"                  enable verbose output\n"
-"    -version      print product version and exit\n"
-"    -version:<value>\n"
-"                  require the specified version to run\n"
-"    -showversion  print product version and continue\n"
-"    -jre-restrict-search | -jre-no-restrict-search\n"
-"                  include/exclude user private JREs in the version search\n"
-"    -? -help      print this help message\n"
-"    -X            print help on non-standard options\n"
-"    -ea[:<packagename>...|:<classname>]\n"
-"    -enableassertions[:<packagename>...|:<classname>]\n"
-"                  enable assertions\n"
-"    -da[:<packagename>...|:<classname>]\n"
-"    -disableassertions[:<packagename>...|:<classname>]\n"
-"                  disable assertions\n"
-"    -esa | -enablesystemassertions\n"
-"                  enable system assertions\n"
-"    -dsa | -disablesystemassertions\n"
-"                  disable system assertions\n"
-"    -agentlib:<libname>[=<options>]\n"
-"                  load native agent library <libname>, e.g. -agentlib:hprof\n"
-"                    see also, -agentlib:jdwp=help and -agentlib:hprof=help\n"
-"    -agentpath:<pathname>[=<options>]\n"
-"                  load native agent library by full pathname\n"
-"    -javaagent:<jarpath>[=<options>]\n"
-"                  load Java programming language agent, see java.lang.instrument\n"
-
-            ,PATH_SEPARATOR);
-}
-
-/*
- * Print usage message for -X options.
- */
-static jint
-PrintXUsage(void)
-{
-    char path[MAXPATHLEN];
-    char buf[128];
-    size_t n;
-    FILE *fp;
-
-    GetXUsagePath(path, sizeof(path));
-    fp = fopen(path, "r");
-    if (fp == 0) {
-        fprintf(stderr, "Can't open %s\n", path);
-        return 1;
-    }
-    while ((n = fread(buf, 1, sizeof(buf), fp)) != 0) {
-        fwrite(buf, 1, n, stdout);
-    }
-    fclose(fp);
-    return 0;
-}
-
-#ifndef GAMMA
-
-/*
- * Read the jvm.cfg file and fill the knownJVMs[] array.
- *
- * The functionality of the jvm.cfg file is subject to change without
- * notice and the mechanism will be removed in the future.
- *
- * The lexical structure of the jvm.cfg file is as follows:
- *
- *     jvmcfg         :=  { vmLine }
- *     vmLine         :=  knownLine
- *                    |   aliasLine
- *                    |   warnLine
- *                    |   ignoreLine
- *                    |   errorLine
- *                    |   predicateLine
- *                    |   commentLine
- *     knownLine      :=  flag  "KNOWN"                  EOL
- *     warnLine       :=  flag  "WARN"                   EOL
- *     ignoreLine     :=  flag  "IGNORE"                 EOL
- *     errorLine      :=  flag  "ERROR"                  EOL
- *     aliasLine      :=  flag  "ALIASED_TO"       flag  EOL
- *     predicateLine  :=  flag  "IF_SERVER_CLASS"  flag  EOL
- *     commentLine    :=  "#" text                       EOL
- *     flag           :=  "-" identifier
- *
- * The semantics are that when someone specifies a flag on the command line:
- * - if the flag appears on a knownLine, then the identifier is used as
- *   the name of the directory holding the JVM library (the name of the JVM).
- * - if the flag appears as the first flag on an aliasLine, the identifier
- *   of the second flag is used as the name of the JVM.
- * - if the flag appears on a warnLine, the identifier is used as the
- *   name of the JVM, but a warning is generated.
- * - if the flag appears on an ignoreLine, the identifier is recognized as the
- *   name of a JVM, but the identifier is ignored and the default vm used
- * - if the flag appears on an errorLine, an error is generated.
- * - if the flag appears as the first flag on a predicateLine, and
- *   the machine on which you are running passes the predicate indicated,
- *   then the identifier of the second flag is used as the name of the JVM,
- *   otherwise the identifier of the first flag is used as the name of the JVM.
- * If no flag is given on the command line, the first vmLine of the jvm.cfg
- * file determines the name of the JVM.
- * PredicateLines are only interpreted on first vmLine of a jvm.cfg file,
- * since they only make sense if someone hasn't specified the name of the
- * JVM on the command line.
- *
- * The intent of the jvm.cfg file is to allow several JVM libraries to
- * be installed in different subdirectories of a single JRE installation,
- * for space-savings and convenience in testing.
- * The intent is explicitly not to provide a full aliasing or predicate
- * mechanism.
- */
-jint
-ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative)
-{
-    FILE *jvmCfg;
-    char jvmCfgName[MAXPATHLEN+20];
-    char line[MAXPATHLEN+20];
-    int cnt = 0;
-    int lineno = 0;
-    jlong start, end;
-    int vmType;
-    char *tmpPtr;
-    char *altVMName;
-    char *serverClassVMName;
-    static char *whiteSpace = " \t";
-    if (_launcher_debug) {
-        start = CounterGet();
-    }
-
-    strcpy(jvmCfgName, jrepath);
-    strcat(jvmCfgName, FILESEP "lib" FILESEP);
-    strcat(jvmCfgName, arch);
-    strcat(jvmCfgName, FILESEP "jvm.cfg");
-
-    jvmCfg = fopen(jvmCfgName, "r");
-    if (jvmCfg == NULL) {
-      if (!speculative) {
-        ReportErrorMessage2("Error: could not open `%s'", jvmCfgName,
-                            JNI_TRUE);
-        exit(1);
-      } else {
-        return -1;
-      }
-    }
-    while (fgets(line, sizeof(line), jvmCfg) != NULL) {
-        vmType = VM_UNKNOWN;
-        lineno++;
-        if (line[0] == '#')
-            continue;
-        if (line[0] != '-') {
-            fprintf(stderr, "Warning: no leading - on line %d of `%s'\n",
-                    lineno, jvmCfgName);
-        }
-        if (cnt >= knownVMsLimit) {
-            GrowKnownVMs(cnt);
-        }
-        line[strlen(line)-1] = '\0'; /* remove trailing newline */
-        tmpPtr = line + strcspn(line, whiteSpace);
-        if (*tmpPtr == 0) {
-            fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
-                    lineno, jvmCfgName);
-        } else {
-            /* Null-terminate this string for strdup below */
-            *tmpPtr++ = 0;
-            tmpPtr += strspn(tmpPtr, whiteSpace);
-            if (*tmpPtr == 0) {
-                fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
-                        lineno, jvmCfgName);
-            } else {
-                if (!strncmp(tmpPtr, "KNOWN", strlen("KNOWN"))) {
-                    vmType = VM_KNOWN;
-                } else if (!strncmp(tmpPtr, "ALIASED_TO", strlen("ALIASED_TO"))) {
-                    tmpPtr += strcspn(tmpPtr, whiteSpace);
-                    if (*tmpPtr != 0) {
-                        tmpPtr += strspn(tmpPtr, whiteSpace);
-                    }
-                    if (*tmpPtr == 0) {
-                        fprintf(stderr, "Warning: missing VM alias on line %d of `%s'\n",
-                                lineno, jvmCfgName);
-                    } else {
-                        /* Null terminate altVMName */
-                        altVMName = tmpPtr;
-                        tmpPtr += strcspn(tmpPtr, whiteSpace);
-                        *tmpPtr = 0;
-                        vmType = VM_ALIASED_TO;
-                    }
-                } else if (!strncmp(tmpPtr, "WARN", strlen("WARN"))) {
-                    vmType = VM_WARN;
-                } else if (!strncmp(tmpPtr, "IGNORE", strlen("IGNORE"))) {
-                    vmType = VM_IGNORE;
-                } else if (!strncmp(tmpPtr, "ERROR", strlen("ERROR"))) {
-                    vmType = VM_ERROR;
-                } else if (!strncmp(tmpPtr,
-                                    "IF_SERVER_CLASS",
-                                    strlen("IF_SERVER_CLASS"))) {
-                    tmpPtr += strcspn(tmpPtr, whiteSpace);
-                    if (*tmpPtr != 0) {
-                        tmpPtr += strspn(tmpPtr, whiteSpace);
-                    }
-                    if (*tmpPtr == 0) {
-                        fprintf(stderr, "Warning: missing server class VM on line %d of `%s'\n",
-                                lineno, jvmCfgName);
-                    } else {
-                        /* Null terminate server class VM name */
-                        serverClassVMName = tmpPtr;
-                        tmpPtr += strcspn(tmpPtr, whiteSpace);
-                        *tmpPtr = 0;
-                        vmType = VM_IF_SERVER_CLASS;
-                    }
-                } else {
-                    fprintf(stderr, "Warning: unknown VM type on line %d of `%s'\n",
-                            lineno, &jvmCfgName[0]);
-                    vmType = VM_KNOWN;
-                }
-            }
-        }
-
-        if (_launcher_debug)
-            printf("jvm.cfg[%d] = ->%s<-\n", cnt, line);
-        if (vmType != VM_UNKNOWN) {
-            knownVMs[cnt].name = strdup(line);
-            knownVMs[cnt].flag = vmType;
-            switch (vmType) {
-            default:
-                break;
-            case VM_ALIASED_TO:
-                knownVMs[cnt].alias = strdup(altVMName);
-                if (_launcher_debug) {
-                    printf("    name: %s  vmType: %s  alias: %s\n",
-                           knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias);
-                }
-                break;
-            case VM_IF_SERVER_CLASS:
-                knownVMs[cnt].server_class = strdup(serverClassVMName);
-                if (_launcher_debug) {
-                    printf("    name: %s  vmType: %s  server_class: %s\n",
-                           knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class);
-                }
-                break;
-            }
-            cnt++;
-        }
-    }
-    fclose(jvmCfg);
-    knownVMsCount = cnt;
-
-    if (_launcher_debug) {
-        end   = CounterGet();
-        printf("%ld micro seconds to parse jvm.cfg\n",
-               (long)(jint)Counter2Micros(end-start));
-    }
-
-    return cnt;
-}
-
-
-static void
-GrowKnownVMs(int minimum)
-{
-    struct vmdesc* newKnownVMs;
-    int newMax;
-
-    newMax = (knownVMsLimit == 0 ? INIT_MAX_KNOWN_VMS : (2 * knownVMsLimit));
-    if (newMax <= minimum) {
-        newMax = minimum;
-    }
-    newKnownVMs = (struct vmdesc*) MemAlloc(newMax * sizeof(struct vmdesc));
-    if (knownVMs != NULL) {
-        memcpy(newKnownVMs, knownVMs, knownVMsLimit * sizeof(struct vmdesc));
-    }
-    free(knownVMs);
-    knownVMs = newKnownVMs;
-    knownVMsLimit = newMax;
-}
-
-
-/* Returns index of VM or -1 if not found */
-static int
-KnownVMIndex(const char* name)
-{
-    int i;
-    if (strncmp(name, "-J", 2) == 0) name += 2;
-    for (i = 0; i < knownVMsCount; i++) {
-        if (!strcmp(name, knownVMs[i].name)) {
-            return i;
-        }
-    }
-    return -1;
-}
-
-static void
-FreeKnownVMs()
-{
-    int i;
-    for (i = 0; i < knownVMsCount; i++) {
-        free(knownVMs[i].name);
-        knownVMs[i].name = NULL;
-    }
-    free(knownVMs);
-}
-
-#endif /* ifndef GAMMA */
--- a/src/os/solaris/launcher/java.h	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#ifndef _JAVA_H_
-#define _JAVA_H_
-
-/*
- * Get system specific defines.
- */
-#include "jni.h"
-#include "java_md.h"
-
-/*
- * Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
- */
-typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
-typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
-
-typedef struct {
-    CreateJavaVM_t CreateJavaVM;
-    GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs;
-} InvocationFunctions;
-
-/*
- * Prototypes for launcher functions in the system specific java_md.c.
- */
-
-jboolean
-LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn);
-
-void
-GetXUsagePath(char *buf, jint bufsize);
-
-jboolean
-GetApplicationHome(char *buf, jint bufsize);
-
-const char *
-GetArch();
-
-void CreateExecutionEnvironment(int *_argc,
-                                       char ***_argv,
-                                       char jrepath[],
-                                       jint so_jrepath,
-                                       char jvmpath[],
-                                       jint so_jvmpath,
-                                       char **original_argv);
-
-/*
- * Report an error message to stderr or a window as appropriate.  The
- * flag always is set to JNI_TRUE if message is to be reported to both
- * strerr and windows and set to JNI_FALSE if the message should only
- * be sent to a window.
- */
-void ReportErrorMessage(char * message, jboolean always);
-void ReportErrorMessage2(char * format, char * string, jboolean always);
-
-/*
- * Report an exception which terminates the vm to stderr or a window
- * as appropriate.
- */
-void ReportExceptionDescription(JNIEnv * env);
-
-jboolean RemovableMachineDependentOption(char * option);
-void PrintMachineDependentOptions();
-
-/*
- * Functions defined in java.c and used in java_md.c.
- */
-jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative);
-char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
-void* MemAlloc(size_t size);
-
-/*
- * Make launcher spit debug output.
- */
-extern jboolean _launcher_debug;
-
-/*
- * This allows for finding classes from the VM's bootstrap class loader
- * directly, FindClass uses the application class loader internally, this will
- * cause unnecessary searching of the classpath for the required classes.
- */
-typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env,
-                                                const char *name,
-                                                jboolean throwError));
-
-jclass FindBootStrapClass(JNIEnv *env, const char *classname);
-
-#endif /* _JAVA_H_ */
--- a/src/os/solaris/launcher/java_md.c	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1849 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#include "java.h"
-#include <dirent.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#ifndef GAMMA
-#include "manifest_info.h"
-#include "version_comp.h"
-#endif
-
-#define JVM_DLL "libjvm.so"
-#define JAVA_DLL "libjava.so"
-
-#ifndef GAMMA   /* launcher.make defines ARCH */
-
-/*
- * If a processor / os combination has the ability to run binaries of
- * two data models and cohabitation of jre/jdk bits with both data
- * models is supported, then DUAL_MODE is defined.  When DUAL_MODE is
- * defined, the architecture names for the narrow and wide version of
- * the architecture are defined in BIG_ARCH and SMALL_ARCH.  Currently
- * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux
- * i586/amd64 could be defined as DUAL_MODE but that is not the
- * current policy.
- */
-
-#ifdef _LP64
-
-#  ifdef ia64
-#    define ARCH "ia64"
-#  elif defined(amd64)
-#    define ARCH "amd64"
-#  elif defined(__sparc)
-#    define ARCH "sparcv9"
-#  else
-#    define ARCH "unknown" /* unknown 64-bit architecture */
-#  endif
-
-#else /* 32-bit data model */
-
-#  ifdef i586
-#    define ARCH "i386"
-#  elif defined(__sparc)
-#    define ARCH "sparc"
-#  endif
-
-#endif /* _LP64 */
-
-#ifdef __sun
-#  define DUAL_MODE
-#  ifdef __sparc
-#    define BIG_ARCH "sparcv9"
-#    define SMALL_ARCH "sparc"
-#  else
-#    define BIG_ARCH "amd64"
-#    define SMALL_ARCH "i386"
-#  endif
-#  include <sys/systeminfo.h>
-#  include <sys/elf.h>
-#  include <stdio.h>
-#else
-#  ifndef ARCH
-#    include <sys/systeminfo.h>
-#  endif
-#endif
-
-#endif /* ifndef GAMMA */
-
-/* pointer to environment */
-extern char **environ;
-
-#ifndef GAMMA
-
-/*
- *      A collection of useful strings. One should think of these as #define
- *      entries, but actual strings can be more efficient (with many compilers).
- */
-#ifdef __linux__
-static const char *system_dir   = "/usr/java";
-static const char *user_dir     = "/java";
-#else /* Solaris */
-static const char *system_dir   = "/usr/jdk";
-static const char *user_dir     = "/jdk";
-#endif
-
-#endif  /* ifndef GAMMA */
-
-/*
- * Flowchart of launcher execs and options processing on unix
- *
- * The selection of the proper vm shared library to open depends on
- * several classes of command line options, including vm "flavor"
- * options (-client, -server) and the data model options, -d32  and
- * -d64, as well as a version specification which may have come from
- * the command line or from the manifest of an executable jar file.
- * The vm selection options are not passed to the running
- * virtual machine; they must be screened out by the launcher.
- *
- * The version specification (if any) is processed first by the
- * platform independent routine SelectVersion.  This may result in
- * the exec of the specified launcher version.
- *
- * Typically, the launcher execs at least once to ensure a suitable
- * LD_LIBRARY_PATH is in effect for the process.  The first exec
- * screens out all the data model options; leaving the choice of data
- * model implicit in the binary selected to run.  However, in case no
- * exec is done, the data model options are screened out before the vm
- * is invoked.
- *
- *  incoming argv ------------------------------
- *  |                                          |
- * \|/                                         |
- * CheckJVMType                                |
- * (removes -client, -server, etc.)            |
- *                                            \|/
- *                                            CreateExecutionEnvironment
- *                                            (removes -d32 and -d64,
- *                                             determines desired data model,
- *                                             sets up LD_LIBRARY_PATH,
- *                                             and exec's)
- *                                             |
- *  --------------------------------------------
- *  |
- * \|/
- * exec child 1 incoming argv -----------------
- *  |                                          |
- * \|/                                         |
- * CheckJVMType                                |
- * (removes -client, -server, etc.)            |
- *  |                                         \|/
- *  |                                          CreateExecutionEnvironment
- *  |                                          (verifies desired data model
- *  |                                           is running and acceptable
- *  |                                           LD_LIBRARY_PATH;
- *  |                                           no-op in child)
- *  |
- * \|/
- * TranslateDashJArgs...
- * (Prepare to pass args to vm)
- *  |
- *  |
- *  |
- * \|/
- * ParseArguments
- * (ignores -d32 and -d64,
- *  processes version options,
- *  creates argument list for vm,
- *  etc.)
- *
- */
-
-static char *SetExecname(char **argv);
-static char * GetExecname();
-static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
-                           char *jvmpath, jint jvmpathsize, char * arch);
-static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative);
-
-const char *
-GetArch()
-{
-    static char *arch = NULL;
-    static char buf[12];
-    if (arch) {
-        return arch;
-    }
-
-#ifdef ARCH
-    strcpy(buf, ARCH);
-#else
-    sysinfo(SI_ARCHITECTURE, buf, sizeof(buf));
-#endif
-    arch = buf;
-    return arch;
-}
-
-void
-CreateExecutionEnvironment(int *_argcp,
-                           char ***_argvp,
-                           char jrepath[],
-                           jint so_jrepath,
-                           char jvmpath[],
-                           jint so_jvmpath,
-                           char **original_argv) {
-  /*
-   * First, determine if we are running the desired data model.  If we
-   * are running the desired data model, all the error messages
-   * associated with calling GetJREPath, ReadKnownVMs, etc. should be
-   * output.  However, if we are not running the desired data model,
-   * some of the errors should be suppressed since it is more
-   * informative to issue an error message based on whether or not the
-   * os/processor combination has dual mode capabilities.
-   */
-
-    char *execname = NULL;
-    int original_argc = *_argcp;
-    jboolean jvmpathExists;
-
-    /* Compute the name of the executable */
-    execname = SetExecname(*_argvp);
-
-#ifndef GAMMA
-    /* Set the LD_LIBRARY_PATH environment variable, check data model
-       flags, and exec process, if needed */
-    {
-      char *arch        = (char *)GetArch(); /* like sparc or sparcv9 */
-      char * jvmtype    = NULL;
-      int argc          = *_argcp;
-      char **argv       = original_argv;
-
-      char *runpath     = NULL; /* existing effective LD_LIBRARY_PATH
-                                   setting */
-
-      int running       =       /* What data model is being ILP32 =>
-                                   32 bit vm; LP64 => 64 bit vm */
-#ifdef _LP64
-        64;
-#else
-      32;
-#endif
-
-      int wanted        = running;      /* What data mode is being
-                                           asked for? Current model is
-                                           fine unless another model
-                                           is asked for */
-
-      char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */
-      char* newpath     = NULL; /* path on new LD_LIBRARY_PATH */
-      char* lastslash   = NULL;
-
-      char** newenvp    = NULL; /* current environment */
-
-      char** newargv    = NULL;
-      int    newargc    = 0;
-#ifdef __sun
-      char*  dmpath     = NULL;  /* data model specific LD_LIBRARY_PATH,
-                                    Solaris only */
-#endif
-
-      /*
-       * Starting in 1.5, all unix platforms accept the -d32 and -d64
-       * options.  On platforms where only one data-model is supported
-       * (e.g. ia-64 Linux), using the flag for the other data model is
-       * an error and will terminate the program.
-       */
-
-      { /* open new scope to declare local variables */
-        int i;
-
-        newargv = (char **)MemAlloc((argc+1) * sizeof(*newargv));
-        newargv[newargc++] = argv[0];
-
-        /* scan for data model arguments and remove from argument list;
-           last occurrence determines desired data model */
-        for (i=1; i < argc; i++) {
-
-          if (strcmp(argv[i], "-J-d64") == 0 || strcmp(argv[i], "-d64") == 0) {
-            wanted = 64;
-            continue;
-          }
-          if (strcmp(argv[i], "-J-d32") == 0 || strcmp(argv[i], "-d32") == 0) {
-            wanted = 32;
-            continue;
-          }
-          newargv[newargc++] = argv[i];
-
-#ifdef JAVA_ARGS
-          if (argv[i][0] != '-')
-            continue;
-#else
-          if (strcmp(argv[i], "-classpath") == 0 || strcmp(argv[i], "-cp") == 0) {
-            i++;
-            if (i >= argc) break;
-            newargv[newargc++] = argv[i];
-            continue;
-          }
-          if (argv[i][0] != '-') { i++; break; }
-#endif
-        }
-
-        /* copy rest of args [i .. argc) */
-        while (i < argc) {
-          newargv[newargc++] = argv[i++];
-        }
-        newargv[newargc] = NULL;
-
-        /*
-         * newargv has all proper arguments here
-         */
-
-        argc = newargc;
-        argv = newargv;
-      }
-
-      /* If the data model is not changing, it is an error if the
-         jvmpath does not exist */
-      if (wanted == running) {
-        /* Find out where the JRE is that we will be using. */
-        if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
-          fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
-          exit(2);
-        }
-
-        /* Find the specified JVM type */
-        if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) {
-          fprintf(stderr, "Error: no known VMs. (check for corrupt jvm.cfg file)\n");
-          exit(1);
-        }
-
-        jvmpath[0] = '\0';
-        jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE);
-
-        if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) {
-          fprintf(stderr, "Error: no `%s' JVM at `%s'.\n", jvmtype, jvmpath);
-          exit(4);
-        }
-      } else {  /* do the same speculatively or exit */
-#ifdef DUAL_MODE
-        if (running != wanted) {
-          /* Find out where the JRE is that we will be using. */
-          if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE)) {
-            goto EndDataModelSpeculate;
-          }
-
-          /*
-           * Read in jvm.cfg for target data model and process vm
-           * selection options.
-           */
-          if (ReadKnownVMs(jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE) < 1) {
-            goto EndDataModelSpeculate;
-          }
-          jvmpath[0] = '\0';
-          jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE);
-          /* exec child can do error checking on the existence of the path */
-          jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath,
-                                     ((wanted==64)?BIG_ARCH:SMALL_ARCH));
-
-        }
-      EndDataModelSpeculate: /* give up and let other code report error message */
-        ;
-#else
-        fprintf(stderr, "Running a %d-bit JVM is not supported on this platform.\n", wanted);
-        exit(1);
-#endif
-      }
-
-      /*
-       * We will set the LD_LIBRARY_PATH as follows:
-       *
-       *     o          $JVMPATH (directory portion only)
-       *     o          $JRE/lib/$ARCH
-       *     o          $JRE/../lib/$ARCH
-       *
-       * followed by the user's previous effective LD_LIBRARY_PATH, if
-       * any.
-       */
-
-#ifdef __sun
-      /*
-       * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH
-       * variables:
-       *
-       * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if
-       * data-model specific variables are not set.
-       *
-       * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH
-       * for 64-bit binaries.
-       *
-       * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH
-       * for 32-bit binaries.
-       *
-       * The vm uses LD_LIBRARY_PATH to set the java.library.path system
-       * property.  To shield the vm from the complication of multiple
-       * LD_LIBRARY_PATH variables, if the appropriate data model
-       * specific variable is set, we will act as if LD_LIBRARY_PATH had
-       * the value of the data model specific variant and the data model
-       * specific variant will be unset.  Note that the variable for the
-       * *wanted* data model must be used (if it is set), not simply the
-       * current running data model.
-       */
-
-      switch(wanted) {
-      case 0:
-        if(running == 32) {
-          dmpath = getenv("LD_LIBRARY_PATH_32");
-          wanted = 32;
-        }
-        else {
-          dmpath = getenv("LD_LIBRARY_PATH_64");
-          wanted = 64;
-        }
-        break;
-
-      case 32:
-        dmpath = getenv("LD_LIBRARY_PATH_32");
-        break;
-
-      case 64:
-        dmpath = getenv("LD_LIBRARY_PATH_64");
-        break;
-
-      default:
-        fprintf(stderr, "Improper value at line %d.", __LINE__);
-        exit(1); /* unknown value in wanted */
-        break;
-      }
-
-      /*
-       * If dmpath is NULL, the relevant data model specific variable is
-       * not set and normal LD_LIBRARY_PATH should be used.
-       */
-      if( dmpath == NULL) {
-        runpath = getenv("LD_LIBRARY_PATH");
-      }
-      else {
-        runpath = dmpath;
-      }
-#else
-      /*
-       * If not on Solaris, assume only a single LD_LIBRARY_PATH
-       * variable.
-       */
-      runpath = getenv("LD_LIBRARY_PATH");
-#endif /* __sun */
-
-#ifdef __linux
-      /*
-       * On linux, if a binary is running as sgid or suid, glibc sets
-       * LD_LIBRARY_PATH to the empty string for security purposes.  (In
-       * contrast, on Solaris the LD_LIBRARY_PATH variable for a
-       * privileged binary does not lose its settings; but the dynamic
-       * linker does apply more scrutiny to the path.) The launcher uses
-       * the value of LD_LIBRARY_PATH to prevent an exec loop.
-       * Therefore, if we are running sgid or suid, this function's
-       * setting of LD_LIBRARY_PATH will be ineffective and we should
-       * return from the function now.  Getting the right libraries to
-       * be found must be handled through other mechanisms.
-       */
-      if((getgid() != getegid()) || (getuid() != geteuid()) ) {
-        return;
-      }
-#endif
-
-      /* runpath contains current effective LD_LIBRARY_PATH setting */
-
-      jvmpath = strdup(jvmpath);
-      new_runpath = MemAlloc( ((runpath!=NULL)?strlen(runpath):0) +
-                              2*strlen(jrepath) + 2*strlen(arch) +
-                              strlen(jvmpath) + 52);
-      newpath = new_runpath + strlen("LD_LIBRARY_PATH=");
-
-
-      /*
-       * Create desired LD_LIBRARY_PATH value for target data model.
-       */
-      {
-        /* remove the name of the .so from the JVM path */
-        lastslash = strrchr(jvmpath, '/');
-        if (lastslash)
-          *lastslash = '\0';
-
-
-        /* jvmpath, ((running != wanted)?((wanted==64)?"/"BIG_ARCH:"/.."):""), */
-
-        sprintf(new_runpath, "LD_LIBRARY_PATH="
-                "%s:"
-                "%s/lib/%s:"
-                "%s/../lib/%s",
-                jvmpath,
-#ifdef DUAL_MODE
-                jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH),
-                jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH)
-#else
-                jrepath, arch,
-                jrepath, arch
-#endif
-                );
-
-
-        /*
-         * Check to make sure that the prefix of the current path is the
-         * desired environment variable setting.
-         */
-        if (runpath != NULL &&
-            strncmp(newpath, runpath, strlen(newpath))==0 &&
-            (runpath[strlen(newpath)] == 0 || runpath[strlen(newpath)] == ':') &&
-            (running == wanted) /* data model does not have to be changed */
-#ifdef __sun
-            && (dmpath == NULL)    /* data model specific variables not set  */
-#endif
-            ) {
-
-          return;
-
-        }
-      }
-
-      /*
-       * Place the desired environment setting onto the prefix of
-       * LD_LIBRARY_PATH.  Note that this prevents any possible infinite
-       * loop of execv() because we test for the prefix, above.
-       */
-      if (runpath != 0) {
-        strcat(new_runpath, ":");
-        strcat(new_runpath, runpath);
-      }
-
-      if( putenv(new_runpath) != 0) {
-        exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set
-                    properly */
-      }
-
-      /*
-       * Unix systems document that they look at LD_LIBRARY_PATH only
-       * once at startup, so we have to re-exec the current executable
-       * to get the changed environment variable to have an effect.
-       */
-
-#ifdef __sun
-      /*
-       * If dmpath is not NULL, remove the data model specific string
-       * in the environment for the exec'ed child.
-       */
-
-      if( dmpath != NULL)
-        (void)UnsetEnv((wanted==32)?"LD_LIBRARY_PATH_32":"LD_LIBRARY_PATH_64");
-#endif
-
-      newenvp = environ;
-
-      {
-        char *newexec = execname;
-#ifdef DUAL_MODE
-        /*
-         * If the data model is being changed, the path to the
-         * executable must be updated accordingly; the executable name
-         * and directory the executable resides in are separate.  In the
-         * case of 32 => 64, the new bits are assumed to reside in, e.g.
-         * "olddir/BIGARCH/execname"; in the case of 64 => 32,
-         * the bits are assumed to be in "olddir/../execname".  For example,
-         *
-         * olddir/sparcv9/execname
-         * olddir/amd64/execname
-         *
-         * for Solaris SPARC and Linux amd64, respectively.
-         */
-
-        if (running != wanted) {
-          char *oldexec = strcpy(MemAlloc(strlen(execname) + 1), execname);
-          char *olddir = oldexec;
-          char *oldbase = strrchr(oldexec, '/');
-
-
-          newexec = MemAlloc(strlen(execname) + 20);
-          *oldbase++ = 0;
-          sprintf(newexec, "%s/%s/%s", olddir,
-                  ((wanted==64) ? BIG_ARCH : ".."), oldbase);
-          argv[0] = newexec;
-        }
-#endif
-
-        execve(newexec, argv, newenvp);
-        perror("execve()");
-
-        fprintf(stderr, "Error trying to exec %s.\n", newexec);
-        fprintf(stderr, "Check if file exists and permissions are set correctly.\n");
-
-#ifdef DUAL_MODE
-        if (running != wanted) {
-          fprintf(stderr, "Failed to start a %d-bit JVM process from a %d-bit JVM.\n",
-                  wanted, running);
-#  ifdef __sun
-
-#    ifdef __sparc
-          fprintf(stderr, "Verify all necessary J2SE components have been installed.\n" );
-          fprintf(stderr,
-                  "(Solaris SPARC 64-bit components must be installed after 32-bit components.)\n" );
-#    else
-          fprintf(stderr, "Either 64-bit processes are not supported by this platform\n");
-          fprintf(stderr, "or the 64-bit components have not been installed.\n");
-#    endif
-        }
-#  endif
-#endif
-
-      }
-
-      exit(1);
-    }
-
-#else  /* ifndef GAMMA */
-
-  /* gamma launcher is simpler in that it doesn't handle VM flavors, data  */
-  /* model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly  */
-  /* all we need to do here is to return correct path names. See also      */
-  /* GetJVMPath() and GetApplicationHome().                                */
-
-  { char *arch = (char *)GetArch(); /* like sparc or sparcv9 */
-    char *p;
-
-    if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
-      fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
-      exit(2);
-    }
-
-    if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath, arch )) {
-      fprintf(stderr, "Error: no JVM at `%s'.\n", jvmpath);
-      exit(4);
-    }
-  }
-
-#endif  /* ifndef GAMMA */
-}
-
-
-/*
- * On Solaris VM choosing is done by the launcher (java.c).
- */
-static jboolean
-GetJVMPath(const char *jrepath, const char *jvmtype,
-           char *jvmpath, jint jvmpathsize, char * arch)
-{
-    struct stat s;
-
-#ifndef GAMMA
-    if (strchr(jvmtype, '/')) {
-        sprintf(jvmpath, "%s/" JVM_DLL, jvmtype);
-    } else {
-        sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype);
-    }
-#else
-    /* For gamma launcher, JVM is either built-in or in the same directory. */
-    /* Either way we return "<exe_path>/libjvm.so" where <exe_path> is the  */
-    /* directory where gamma launcher is located.                           */
-
-    char *p;
-
-    snprintf(jvmpath, jvmpathsize, "%s", GetExecname());
-    p = strrchr(jvmpath, '/');
-    if (p) {
-       /* replace executable name with libjvm.so */
-       snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL);
-    } else {
-       /* this case shouldn't happen */
-       snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL);
-    }
-#endif
-
-    if (_launcher_debug)
-      printf("Does `%s' exist ... ", jvmpath);
-
-    if (stat(jvmpath, &s) == 0) {
-        if (_launcher_debug)
-          printf("yes.\n");
-        return JNI_TRUE;
-    } else {
-        if (_launcher_debug)
-          printf("no.\n");
-        return JNI_FALSE;
-    }
-}
-
-/*
- * Find path to JRE based on .exe's location or registry settings.
- */
-static jboolean
-GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative)
-{
-    char libjava[MAXPATHLEN];
-
-    if (GetApplicationHome(path, pathsize)) {
-        /* Is JRE co-located with the application? */
-        sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch);
-        if (access(libjava, F_OK) == 0) {
-            goto found;
-        }
-
-        /* Does the app ship a private JRE in <apphome>/jre directory? */
-        sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch);
-        if (access(libjava, F_OK) == 0) {
-            strcat(path, "/jre");
-            goto found;
-        }
-    }
-
-    if (!speculative)
-      fprintf(stderr, "Error: could not find " JAVA_DLL "\n");
-    return JNI_FALSE;
-
- found:
-    if (_launcher_debug)
-      printf("JRE path is %s\n", path);
-    return JNI_TRUE;
-}
-
-jboolean
-LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
-{
-#ifdef GAMMA
-    /* JVM is directly linked with gamma launcher; no dlopen() */
-    ifn->CreateJavaVM = JNI_CreateJavaVM;
-    ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
-    return JNI_TRUE;
-#else
-    Dl_info dlinfo;
-    void *libjvm;
-
-    if (_launcher_debug) {
-        printf("JVM path is %s\n", jvmpath);
-    }
-
-    libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL);
-    if (libjvm == NULL) {
-#if defined(__sparc) && !defined(_LP64) /* i.e. 32-bit sparc */
-      FILE * fp;
-      Elf32_Ehdr elf_head;
-      int count;
-      int location;
-
-      fp = fopen(jvmpath, "r");
-      if(fp == NULL)
-        goto error;
-
-      /* read in elf header */
-      count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp);
-      fclose(fp);
-      if(count < 1)
-        goto error;
-
-      /*
-       * Check for running a server vm (compiled with -xarch=v8plus)
-       * on a stock v8 processor.  In this case, the machine type in
-       * the elf header would not be included the architecture list
-       * provided by the isalist command, which is turn is gotten from
-       * sysinfo.  This case cannot occur on 64-bit hardware and thus
-       * does not have to be checked for in binaries with an LP64 data
-       * model.
-       */
-      if(elf_head.e_machine == EM_SPARC32PLUS) {
-        char buf[257];  /* recommended buffer size from sysinfo man
-                           page */
-        long length;
-        char* location;
-
-        length = sysinfo(SI_ISALIST, buf, 257);
-        if(length > 0) {
-          location = strstr(buf, "sparcv8plus ");
-          if(location == NULL) {
-            fprintf(stderr, "SPARC V8 processor detected; Server compiler requires V9 or better.\n");
-            fprintf(stderr, "Use Client compiler on V8 processors.\n");
-            fprintf(stderr, "Could not create the Java virtual machine.\n");
-            return JNI_FALSE;
-          }
-        }
-      }
-#endif
-      fprintf(stderr, "dl failure on line %d", __LINE__);
-      goto error;
-    }
-
-    ifn->CreateJavaVM = (CreateJavaVM_t)
-      dlsym(libjvm, "JNI_CreateJavaVM");
-    if (ifn->CreateJavaVM == NULL)
-        goto error;
-
-    ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
-        dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
-    if (ifn->GetDefaultJavaVMInitArgs == NULL)
-      goto error;
-
-    return JNI_TRUE;
-
-error:
-    fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror());
-    return JNI_FALSE;
-#endif /* GAMMA */
-}
-
-/*
- * Get the path to the file that has the usage message for -X options.
- */
-void
-GetXUsagePath(char *buf, jint bufsize)
-{
-    static const char Xusage_txt[] = "/Xusage.txt";
-    Dl_info dlinfo;
-
-    /* we use RTLD_NOW because of problems with ld.so.1 and green threads */
-    dladdr(dlsym(dlopen(JVM_DLL, RTLD_NOW), "JNI_CreateJavaVM"), &dlinfo);
-    strncpy(buf, (char *)dlinfo.dli_fname, bufsize - sizeof(Xusage_txt));
-
-    buf[bufsize-1] = '\0';
-    strcpy(strrchr(buf, '/'), Xusage_txt);
-}
-
-/*
- * If app is "/foo/bin/javac", or "/foo/bin/sparcv9/javac" then put
- * "/foo" into buf.
- */
-jboolean
-GetApplicationHome(char *buf, jint bufsize)
-{
-#ifdef __linux__
-    char *execname = GetExecname();
-    if (execname) {
-        strncpy(buf, execname, bufsize-1);
-        buf[bufsize-1] = '\0';
-    } else {
-        return JNI_FALSE;
-    }
-#else
-    Dl_info dlinfo;
-
-    dladdr((void *)GetApplicationHome, &dlinfo);
-    if (realpath(dlinfo.dli_fname, buf) == NULL) {
-        fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname);
-        return JNI_FALSE;
-    }
-#endif
-
-#ifdef GAMMA
-    {
-      /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */
-      char* java_home_var = getenv("JAVA_HOME");
-      if (java_home_var == NULL) {
-        printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
-        return JNI_FALSE;
-      }
-      snprintf(buf, bufsize, "%s", java_home_var);
-    }
-#else
-    if (strrchr(buf, '/') == 0) {
-        buf[0] = '\0';
-        return JNI_FALSE;
-    }
-    *(strrchr(buf, '/')) = '\0';        /* executable file      */
-    if (strlen(buf) < 4 || strrchr(buf, '/') == 0) {
-        buf[0] = '\0';
-        return JNI_FALSE;
-    }
-    if (strcmp("/bin", buf + strlen(buf) - 4) != 0)
-        *(strrchr(buf, '/')) = '\0';    /* sparcv9 or amd64     */
-    if (strlen(buf) < 4 || strcmp("/bin", buf + strlen(buf) - 4) != 0) {
-        buf[0] = '\0';
-        return JNI_FALSE;
-    }
-    *(strrchr(buf, '/')) = '\0';        /* bin                  */
-#endif /* GAMMA */
-
-    return JNI_TRUE;
-}
-
-
-/*
- * Return true if the named program exists
- */
-static int
-ProgramExists(char *name)
-{
-    struct stat sb;
-    if (stat(name, &sb) != 0) return 0;
-    if (S_ISDIR(sb.st_mode)) return 0;
-    return (sb.st_mode & S_IEXEC) != 0;
-}
-
-
-/*
- * Find a command in a directory, returning the path.
- */
-static char *
-Resolve(char *indir, char *cmd)
-{
-    char name[PATH_MAX + 2], *real;
-
-    if ((strlen(indir) + strlen(cmd) + 1)  > PATH_MAX) return 0;
-    sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd);
-    if (!ProgramExists(name)) return 0;
-    real = MemAlloc(PATH_MAX + 2);
-    if (!realpath(name, real))
-        strcpy(real, name);
-    return real;
-}
-
-
-/*
- * Find a path for the executable
- */
-static char *
-FindExecName(char *program)
-{
-    char cwdbuf[PATH_MAX+2];
-    char *path;
-    char *tmp_path;
-    char *f;
-    char *result = NULL;
-
-    /* absolute path? */
-    if (*program == FILE_SEPARATOR ||
-        (FILE_SEPARATOR=='\\' && strrchr(program, ':')))
-        return Resolve("", program+1);
-
-    /* relative path? */
-    if (strrchr(program, FILE_SEPARATOR) != 0) {
-        char buf[PATH_MAX+2];
-        return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program);
-    }
-
-    /* from search path? */
-    path = getenv("PATH");
-    if (!path || !*path) path = ".";
-    tmp_path = MemAlloc(strlen(path) + 2);
-    strcpy(tmp_path, path);
-
-    for (f=tmp_path; *f && result==0; ) {
-        char *s = f;
-        while (*f && (*f != PATH_SEPARATOR)) ++f;
-        if (*f) *f++ = 0;
-        if (*s == FILE_SEPARATOR)
-            result = Resolve(s, program);
-        else {
-            /* relative path element */
-            char dir[2*PATH_MAX];
-            sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)),
-                    FILE_SEPARATOR, s);
-            result = Resolve(dir, program);
-        }
-        if (result != 0) break;
-    }
-
-    free(tmp_path);
-    return result;
-}
-
-
-/* Store the name of the executable once computed */
-static char *execname = NULL;
-
-/*
- * Compute the name of the executable
- *
- * In order to re-exec securely we need the absolute path of the
- * executable. On Solaris getexecname(3c) may not return an absolute
- * path so we use dladdr to get the filename of the executable and
- * then use realpath to derive an absolute path. From Solaris 9
- * onwards the filename returned in DL_info structure from dladdr is
- * an absolute pathname so technically realpath isn't required.
- * On Linux we read the executable name from /proc/self/exe.
- * As a fallback, and for platforms other than Solaris and Linux,
- * we use FindExecName to compute the executable name.
- */
-static char *
-SetExecname(char **argv)
-{
-    char* exec_path = NULL;
-
-    if (execname != NULL)       /* Already determined */
-        return (execname);
-
-#if defined(__sun)
-    {
-        Dl_info dlinfo;
-        if (dladdr((void*)&SetExecname, &dlinfo)) {
-            char *resolved = (char*)MemAlloc(PATH_MAX+1);
-            if (resolved != NULL) {
-                exec_path = realpath(dlinfo.dli_fname, resolved);
-                if (exec_path == NULL) {
-                    free(resolved);
-                }
-            }
-        }
-    }
-#elif defined(__linux__)
-    {
-        const char* self = "/proc/self/exe";
-        char buf[PATH_MAX+1];
-        int len = readlink(self, buf, PATH_MAX);
-        if (len >= 0) {
-            buf[len] = '\0';            /* readlink doesn't nul terminate */
-            exec_path = strdup(buf);
-        }
-    }
-#else /* !__sun && !__linux */
-    {
-        /* Not implemented */
-    }
-#endif
-
-    if (exec_path == NULL) {
-        exec_path = FindExecName(argv[0]);
-    }
-    execname = exec_path;
-    return exec_path;
-}
-
-/*
- * Return the name of the executable.  Used in java_md.c to find the JRE area.
- */
-static char *
-GetExecname() {
-  return execname;
-}
-
-void ReportErrorMessage(char * message, jboolean always) {
-  if (always) {
-    fprintf(stderr, "%s\n", message);
-  }
-}
-
-void ReportErrorMessage2(char * format, char * string, jboolean always) {
-  if (always) {
-    fprintf(stderr, format, string);
-    fprintf(stderr, "\n");
-  }
-}
-
-void  ReportExceptionDescription(JNIEnv * env) {
-  (*env)->ExceptionDescribe(env);
-}
-
-/*
- * Return JNI_TRUE for an option string that has no effect but should
- * _not_ be passed on to the vm; return JNI_FALSE otherwise.  On
- * Solaris SPARC, this screening needs to be done if:
- * 1) LD_LIBRARY_PATH does _not_ need to be reset and
- * 2) -d32 or -d64 is passed to a binary with a matching data model
- *    (the exec in SetLibraryPath removes -d<n> options and points the
- *    exec to the proper binary).  When this exec is not done, these options
- *    would end up getting passed onto the vm.
- */
-jboolean RemovableMachineDependentOption(char * option) {
-  /*
-   * Unconditionally remove both -d32 and -d64 options since only
-   * the last such options has an effect; e.g.
-   * java -d32 -d64 -d32 -version
-   * is equivalent to
-   * java -d32 -version
-   */
-
-  if( (strcmp(option, "-d32")  == 0 ) ||
-      (strcmp(option, "-d64")  == 0 ))
-    return JNI_TRUE;
-  else
-    return JNI_FALSE;
-}
-
-void PrintMachineDependentOptions() {
-      fprintf(stdout,
-        "    -d32          use a 32-bit data model if available\n"
-        "\n"
-        "    -d64          use a 64-bit data model if available\n");
-      return;
-}
-
-#ifndef GAMMA  /* gamma launcher does not have ergonomics */
-
-/*
- * The following methods (down to ServerClassMachine()) answer
- * the question about whether a machine is a "server-class"
- * machine.  A server-class machine is loosely defined as one
- * with 2 or more processors and 2 gigabytes or more physical
- * memory.  The definition of a processor is a physical package,
- * not a hyperthreaded chip masquerading as a multi-processor.
- * The definition of memory is also somewhat fuzzy, since x86
- * machines seem not to report all the memory in their DIMMs, we
- * think because of memory mapping of graphics cards, etc.
- *
- * This code is somewhat more confused with #ifdef's than we'd
- * like because this file is used by both Solaris and Linux
- * platforms, and so needs to be parameterized for SPARC and
- * i586 hardware.  The other Linux platforms (amd64 and ia64)
- * don't even ask this question, because they only come with
- * server JVMs.  */
-
-# define KB (1024UL)
-# define MB (1024UL * KB)
-# define GB (1024UL * MB)
-
-/* Compute physical memory by asking the OS */
-uint64_t
-physical_memory(void) {
-  const uint64_t pages     = (uint64_t) sysconf(_SC_PHYS_PAGES);
-  const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE);
-  const uint64_t result    = pages * page_size;
-# define UINT64_FORMAT "%" PRIu64
-
-  if (_launcher_debug) {
-    printf("pages: " UINT64_FORMAT
-           "  page_size: " UINT64_FORMAT
-           "  physical memory: " UINT64_FORMAT " (%.3fGB)\n",
-           pages, page_size, result, result / (double) GB);
-  }
-  return result;
-}
-
-#if defined(__sun) && defined(__sparc)
-
-/* Methods for solaris-sparc: these are easy. */
-
-/* Ask the OS how many processors there are. */
-unsigned long
-physical_processors(void) {
-  const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-
-  if (_launcher_debug) {
-    printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
-  }
-  return sys_processors;
-}
-
-/* The solaris-sparc version of the "server-class" predicate. */
-jboolean
-solaris_sparc_ServerClassMachine(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;
-    }
-  }
-  if (_launcher_debug) {
-    printf("solaris_" ARCH "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
-  }
-  return result;
-}
-
-#endif /* __sun && __sparc */
-
-#if defined(__sun) && defined(i586)
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of linux-i586
- * because the compilers are different.
- */
-void
-get_cpuid(uint32_t arg,
-          uint32_t* eaxp,
-          uint32_t* ebxp,
-          uint32_t* ecxp,
-          uint32_t* edxp) {
-#ifdef _LP64
-  asm(
-  /* rbx is a callee-saved register */
-      " movq    %rbx, %r11  \n"
-  /* rdx and rcx are 3rd and 4th argument registers */
-      " movq    %rdx, %r10  \n"
-      " movq    %rcx, %r9   \n"
-      " movl    %edi, %eax  \n"
-      " cpuid               \n"
-      " movl    %eax, (%rsi)\n"
-      " movl    %ebx, (%r10)\n"
-      " movl    %ecx, (%r9) \n"
-      " movl    %edx, (%r8) \n"
-  /* Restore rbx */
-      " movq    %r11, %rbx");
-#else
-  /* EBX is a callee-saved register */
-  asm(" pushl   %ebx");
-  /* Need ESI for storing through arguments */
-  asm(" pushl   %esi");
-  asm(" movl    8(%ebp), %eax   \n"
-      " cpuid                   \n"
-      " movl    12(%ebp), %esi  \n"
-      " movl    %eax, (%esi)    \n"
-      " movl    16(%ebp), %esi  \n"
-      " movl    %ebx, (%esi)    \n"
-      " movl    20(%ebp), %esi  \n"
-      " movl    %ecx, (%esi)    \n"
-      " movl    24(%ebp), %esi  \n"
-      " movl    %edx, (%esi)      ");
-  /* Restore ESI and EBX */
-  asm(" popl    %esi");
-  /* Restore EBX */
-  asm(" popl    %ebx");
-#endif
-}
-
-#endif /* __sun && i586 */
-
-#if defined(__linux__) && defined(i586)
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of solaris-i586
- * because the compilers are different.
- */
-void
-get_cpuid(uint32_t arg,
-          uint32_t* eaxp,
-          uint32_t* ebxp,
-          uint32_t* ecxp,
-          uint32_t* edxp) {
-#ifdef _LP64
-  __asm__ volatile (/* Instructions */
-                    "   movl    %4, %%eax  \n"
-                    "   cpuid              \n"
-                    "   movl    %%eax, (%0)\n"
-                    "   movl    %%ebx, (%1)\n"
-                    "   movl    %%ecx, (%2)\n"
-                    "   movl    %%edx, (%3)\n"
-                    : /* Outputs */
-                    : /* Inputs */
-                    "r" (eaxp),
-                    "r" (ebxp),
-                    "r" (ecxp),
-                    "r" (edxp),
-                    "r" (arg)
-                    : /* Clobbers */
-                    "%rax", "%rbx", "%rcx", "%rdx", "memory"
-                    );
-#else
-  uint32_t value_of_eax = 0;
-  uint32_t value_of_ebx = 0;
-  uint32_t value_of_ecx = 0;
-  uint32_t value_of_edx = 0;
-  __asm__ volatile (/* Instructions */
-                        /* ebx is callee-save, so push it */
-                        /* even though it's in the clobbers section */
-                    "   pushl   %%ebx      \n"
-                    "   movl    %4, %%eax  \n"
-                    "   cpuid              \n"
-                    "   movl    %%eax, %0  \n"
-                    "   movl    %%ebx, %1  \n"
-                    "   movl    %%ecx, %2  \n"
-                    "   movl    %%edx, %3  \n"
-                        /* restore ebx */
-                    "   popl    %%ebx      \n"
-
-                    : /* Outputs */
-                    "=m" (value_of_eax),
-                    "=m" (value_of_ebx),
-                    "=m" (value_of_ecx),
-                    "=m" (value_of_edx)
-                    : /* Inputs */
-                    "m" (arg)
-                    : /* Clobbers */
-                    "%eax", "%ebx", "%ecx", "%edx"
-                    );
-  *eaxp = value_of_eax;
-  *ebxp = value_of_ebx;
-  *ecxp = value_of_ecx;
-  *edxp = value_of_edx;
-#endif
-}
-
-#endif /* __linux__ && i586 */
-
-#ifdef i586
-/*
- * Routines shared by solaris-i586 and linux-i586.
- */
-
-enum HyperThreadingSupport_enum {
-  hts_supported        =  1,
-  hts_too_soon_to_tell =  0,
-  hts_not_supported    = -1,
-  hts_not_pentium4     = -2,
-  hts_not_intel        = -3
-};
-typedef enum HyperThreadingSupport_enum HyperThreadingSupport;
-
-/* Determine if hyperthreading is supported */
-HyperThreadingSupport
-hyperthreading_support(void) {
-  HyperThreadingSupport result = hts_too_soon_to_tell;
-  /* Bits 11 through 8 is family processor id */
-# define FAMILY_ID_SHIFT 8
-# define FAMILY_ID_MASK 0xf
-  /* Bits 23 through 20 is extended family processor id */
-# define EXT_FAMILY_ID_SHIFT 20
-# define EXT_FAMILY_ID_MASK 0xf
-  /* Pentium 4 family processor id */
-# define PENTIUM4_FAMILY_ID 0xf
-  /* Bit 28 indicates Hyper-Threading Technology support */
-# define HT_BIT_SHIFT 28
-# define HT_BIT_MASK 1
-  uint32_t vendor_id[3] = { 0U, 0U, 0U };
-  uint32_t value_of_eax = 0U;
-  uint32_t value_of_edx = 0U;
-  uint32_t dummy        = 0U;
-
-  /* Yes, this is supposed to be [0], [2], [1] */
-  get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]);
-  if (_launcher_debug) {
-    printf("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n",
-           ((vendor_id[0] >>  0) & 0xff),
-           ((vendor_id[0] >>  8) & 0xff),
-           ((vendor_id[0] >> 16) & 0xff),
-           ((vendor_id[0] >> 24) & 0xff),
-           ((vendor_id[1] >>  0) & 0xff),
-           ((vendor_id[1] >>  8) & 0xff),
-           ((vendor_id[1] >> 16) & 0xff),
-           ((vendor_id[1] >> 24) & 0xff),
-           ((vendor_id[2] >>  0) & 0xff),
-           ((vendor_id[2] >>  8) & 0xff),
-           ((vendor_id[2] >> 16) & 0xff),
-           ((vendor_id[2] >> 24) & 0xff));
-  }
-  get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx);
-  if (_launcher_debug) {
-    printf("value_of_eax: 0x%x  value_of_edx: 0x%x\n",
-           value_of_eax, value_of_edx);
-  }
-  if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) ||
-      (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) {
-    if ((((vendor_id[0] >>  0) & 0xff) == 'G') &&
-        (((vendor_id[0] >>  8) & 0xff) == 'e') &&
-        (((vendor_id[0] >> 16) & 0xff) == 'n') &&
-        (((vendor_id[0] >> 24) & 0xff) == 'u') &&
-        (((vendor_id[1] >>  0) & 0xff) == 'i') &&
-        (((vendor_id[1] >>  8) & 0xff) == 'n') &&
-        (((vendor_id[1] >> 16) & 0xff) == 'e') &&
-        (((vendor_id[1] >> 24) & 0xff) == 'I') &&
-        (((vendor_id[2] >>  0) & 0xff) == 'n') &&
-        (((vendor_id[2] >>  8) & 0xff) == 't') &&
-        (((vendor_id[2] >> 16) & 0xff) == 'e') &&
-        (((vendor_id[2] >> 24) & 0xff) == 'l')) {
-      if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) {
-        if (_launcher_debug) {
-          printf("Hyperthreading supported\n");
-        }
-        result = hts_supported;
-      } else {
-        if (_launcher_debug) {
-          printf("Hyperthreading not supported\n");
-        }
-        result = hts_not_supported;
-      }
-    } else {
-      if (_launcher_debug) {
-        printf("Not GenuineIntel\n");
-      }
-      result = hts_not_intel;
-    }
-  } else {
-    if (_launcher_debug) {
-      printf("not Pentium 4 or extended\n");
-    }
-    result = hts_not_pentium4;
-  }
-  return result;
-}
-
-/* Determine how many logical processors there are per CPU */
-unsigned int
-logical_processors_per_package(void) {
-  /*
-   * After CPUID with EAX==1, register EBX bits 23 through 16
-   * indicate the number of logical processors per package
-   */
-# define NUM_LOGICAL_SHIFT 16
-# define NUM_LOGICAL_MASK 0xff
-  unsigned int result                        = 1U;
-  const HyperThreadingSupport hyperthreading = hyperthreading_support();
-
-  if (hyperthreading == hts_supported) {
-    uint32_t value_of_ebx = 0U;
-    uint32_t dummy        = 0U;
-
-    get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy);
-    result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK;
-    if (_launcher_debug) {
-      printf("logical processors per package: %u\n", result);
-    }
-  }
-  return result;
-}
-
-/* Compute the number of physical processors, not logical processors */
-unsigned long
-physical_processors(void) {
-  const long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-  unsigned long result      = sys_processors;
-
-  if (_launcher_debug) {
-    printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
-  }
-  if (sys_processors > 1) {
-    unsigned int logical_processors = logical_processors_per_package();
-    if (logical_processors > 1) {
-      result = (unsigned long) sys_processors / logical_processors;
-    }
-  }
-  if (_launcher_debug) {
-    printf("physical processors: %lu\n", result);
-  }
-  return result;
-}
-
-#endif /* i586 */
-
-#if defined(__sun) && defined(i586)
-
-/* The definition of a server-class machine for solaris-i586/amd64 */
-jboolean
-solaris_i586_ServerClassMachine(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;
-  /*
-   * We seem not to get our full complement of memory.
-   *     We allow some part (1/8?) of the memory to be "missing",
-   *     based on the sizes of DIMMs, and maybe graphics cards.
-   */
-  const uint64_t      missing_memory    = 256UL * MB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= (server_memory - missing_memory)) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  if (_launcher_debug) {
-    printf("solaris_" ARCH "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  }
-  return result;
-}
-
-#endif /* __sun && i586 */
-
-#if defined(__linux__) && defined(i586)
-
-/* The definition of a server-class machine for linux-i586 */
-jboolean
-linux_i586_ServerClassMachine(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;
-  /*
-   * We seem not to get our full complement of memory.
-   *     We allow some part (1/8?) of the memory to be "missing",
-   *     based on the sizes of DIMMs, and maybe graphics cards.
-   */
-  const uint64_t      missing_memory    = 256UL * MB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= (server_memory - missing_memory)) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  if (_launcher_debug) {
-    printf("linux_" ARCH "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  }
-  return result;
-}
-
-#endif /* __linux__ && i586 */
-
-/* Dispatch to the platform-specific definition of "server-class" */
-jboolean
-ServerClassMachine(void) {
-  jboolean result = JNI_FALSE;
-#if   defined(__sun) && defined(__sparc)
-  result = solaris_sparc_ServerClassMachine();
-#elif defined(__sun) && defined(i586)
-  result = solaris_i586_ServerClassMachine();
-#elif defined(__linux__) && defined(i586)
-  result = linux_i586_ServerClassMachine();
-#else
-  if (_launcher_debug) {
-    printf("ServerClassMachine: returns default value of %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  }
-#endif
-  return result;
-}
-
-#endif /* ifndef GAMMA */
-
-#ifndef GAMMA /* gamma launcher does not choose JDK/JRE/JVM */
-
-/*
- *      Since using the file system as a registry is a bit risky, perform
- *      additional sanity checks on the identified directory to validate
- *      it as a valid jre/sdk.
- *
- *      Return 0 if the tests fail; otherwise return non-zero (true).
- *
- *      Note that checking for anything more than the existence of an
- *      executable object at bin/java relative to the path being checked
- *      will break the regression tests.
- */
-static int
-CheckSanity(char *path, char *dir)
-{
-    char    buffer[PATH_MAX];
-
-    if (strlen(path) + strlen(dir) + 11 > PATH_MAX)
-        return (0);     /* Silently reject "impossibly" long paths */
-
-    (void)strcat(strcat(strcat(strcpy(buffer, path), "/"), dir), "/bin/java");
-    return ((access(buffer, X_OK) == 0) ? 1 : 0);
-}
-
-/*
- *      Determine if there is an acceptable JRE in the directory dirname.
- *      Upon locating the "best" one, return a fully qualified path to
- *      it. "Best" is defined as the most advanced JRE meeting the
- *      constraints contained in the manifest_info. If no JRE in this
- *      directory meets the constraints, return NULL.
- *
- *      Note that we don't check for errors in reading the directory
- *      (which would be done by checking errno).  This is because it
- *      doesn't matter if we get an error reading the directory, or
- *      we just don't find anything interesting in the directory.  We
- *      just return NULL in either case.
- *
- *      The historical names of j2sdk and j2re were changed to jdk and
- *      jre respecively as part of the 1.5 rebranding effort.  Since the
- *      former names are legacy on Linux, they must be recognized for
- *      all time.  Fortunately, this is a minor cost.
- */
-static char
-*ProcessDir(manifest_info *info, char *dirname)
-{
-    DIR     *dirp;
-    struct dirent *dp;
-    char    *best = NULL;
-    int     offset;
-    int     best_offset = 0;
-    char    *ret_str = NULL;
-    char    buffer[PATH_MAX];
-
-    if ((dirp = opendir(dirname)) == NULL)
-        return (NULL);
-
-    do {
-        if ((dp = readdir(dirp)) != NULL) {
-            offset = 0;
-            if ((strncmp(dp->d_name, "jre", 3) == 0) ||
-                (strncmp(dp->d_name, "jdk", 3) == 0))
-                offset = 3;
-            else if (strncmp(dp->d_name, "j2re", 4) == 0)
-                offset = 4;
-            else if (strncmp(dp->d_name, "j2sdk", 5) == 0)
-                offset = 5;
-            if (offset > 0) {
-                if ((acceptable_release(dp->d_name + offset,
-                    info->jre_version)) && CheckSanity(dirname, dp->d_name))
-                    if ((best == NULL) || (exact_version_id(
-                      dp->d_name + offset, best + best_offset) > 0)) {
-                        if (best != NULL)
-                            free(best);
-                        best = strdup(dp->d_name);
-                        best_offset = offset;
-                    }
-            }
-        }
-    } while (dp != NULL);
-    (void) closedir(dirp);
-    if (best == NULL)
-        return (NULL);
-    else {
-        ret_str = MemAlloc(strlen(dirname) + strlen(best) + 2);
-        ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best);
-        free(best);
-        return (ret_str);
-    }
-}
-
-/*
- *      This is the global entry point. It examines the host for the optimal
- *      JRE to be used by scanning a set of directories.  The set of directories
- *      is platform dependent and can be overridden by the environment
- *      variable JAVA_VERSION_PATH.
- *
- *      This routine itself simply determines the set of appropriate
- *      directories before passing control onto ProcessDir().
- */
-char*
-LocateJRE(manifest_info* info)
-{
-    char        *path;
-    char        *home;
-    char        *target = NULL;
-    char        *dp;
-    char        *cp;
-
-    /*
-     * Start by getting JAVA_VERSION_PATH
-     */
-    if (info->jre_restrict_search)
-        path = strdup(system_dir);
-    else if ((path = getenv("JAVA_VERSION_PATH")) != NULL)
-        path = strdup(path);
-    else
-        if ((home = getenv("HOME")) != NULL) {
-            path = (char *)MemAlloc(strlen(home) + 13);
-            path = strcat(strcat(strcat(strcpy(path, home),
-                user_dir), ":"), system_dir);
-        } else
-            path = strdup(system_dir);
-
-    /*
-     * Step through each directory on the path. Terminate the scan with
-     * the first directory with an acceptable JRE.
-     */
-    cp = dp = path;
-    while (dp != NULL) {
-        cp = strchr(dp, (int)':');
-        if (cp != NULL)
-            *cp = (char)NULL;
-        if ((target = ProcessDir(info, dp)) != NULL)
-            break;
-        dp = cp;
-        if (dp != NULL)
-            dp++;
-    }
-    free(path);
-    return (target);
-}
-
-/*
- * Given a path to a jre to execute, this routine checks if this process
- * is indeed that jre.  If not, it exec's that jre.
- *
- * We want to actually check the paths rather than just the version string
- * built into the executable, so that given version specification (and
- * JAVA_VERSION_PATH) will yield the exact same Java environment, regardless
- * of the version of the arbitrary launcher we start with.
- */
-void
-ExecJRE(char *jre, char **argv)
-{
-    char    wanted[PATH_MAX];
-    char    *execname;
-    char    *progname;
-
-    /*
-     * Resolve the real path to the directory containing the selected JRE.
-     */
-    if (realpath(jre, wanted) == NULL) {
-        fprintf(stderr, "Unable to resolve %s\n", jre);
-        exit(1);
-    }
-
-    /*
-     * Resolve the real path to the currently running launcher.
-     */
-    execname = SetExecname(argv);
-    if (execname == NULL) {
-        fprintf(stderr, "Unable to resolve current executable\n");
-        exit(1);
-    }
-
-    /*
-     * If the path to the selected JRE directory is a match to the initial
-     * portion of the path to the currently executing JRE, we have a winner!
-     * If so, just return.
-     */
-    if (strncmp(wanted, execname, strlen(wanted)) == 0)
-        return;                 /* I am the droid you were looking for */
-
-    /*
-     * If this isn't the selected version, exec the selected version.
-     */
-#ifdef JAVA_ARGS  /* javac, jar and friends. */
-    progname = "java";
-#else             /* java, oldjava, javaw and friends */
-#ifdef PROGNAME
-    progname = PROGNAME;
-#else
-    progname = *argv;
-    if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
-        progname = s + 1;
-    }
-#endif /* PROGNAME */
-#endif /* JAVA_ARGS */
-
-    /*
-     * This should never happen (because of the selection code in SelectJRE),
-     * but check for "impossibly" long path names just because buffer overruns
-     * can be so deadly.
-     */
-    if (strlen(wanted) + strlen(progname) + 6 > PATH_MAX) {
-        fprintf(stderr, "Path length exceeds maximum length (PATH_MAX)\n");
-        exit(1);
-    }
-
-    /*
-     * Construct the path and exec it.
-     */
-    (void)strcat(strcat(wanted, "/bin/"), progname);
-    argv[0] = progname;
-    if (_launcher_debug) {
-        int i;
-        printf("execv(\"%s\"", wanted);
-        for (i = 0; argv[i] != NULL; i++)
-            printf(", \"%s\"", argv[i]);
-        printf(")\n");
-    }
-    execv(wanted, argv);
-    fprintf(stderr, "Exec of %s failed\n", wanted);
-    exit(1);
-}
-
-#endif /* ifndef GAMMA */
-
-/*
- * "Borrowed" from Solaris 10 where the unsetenv() function is being added
- * to libc thanks to SUSv3 (Standard Unix Specification, version 3). As
- * such, in the fullness of time this will appear in libc on all relevant
- * Solaris/Linux platforms and maybe even the Windows platform.  At that
- * time, this stub can be removed.
- *
- * This implementation removes the environment locking for multithreaded
- * applications.  (We don't have access to these mutexes within libc and
- * the launcher isn't multithreaded.)  Note that what remains is platform
- * independent, because it only relies on attributes that a POSIX environment
- * defines.
- *
- * Returns 0 on success, -1 on failure.
- *
- * Also removed was the setting of errno.  The only value of errno set
- * was EINVAL ("Invalid Argument").
- */
-
-/*
- * s1(environ) is name=value
- * s2(name) is name(not the form of name=value).
- * if names match, return value of 1, else return 0
- */
-static int
-match_noeq(const char *s1, const char *s2)
-{
-        while (*s1 == *s2++) {
-                if (*s1++ == '=')
-                        return (1);
-        }
-        if (*s1 == '=' && s2[-1] == '\0')
-                return (1);
-        return (0);
-}
-
-/*
- * added for SUSv3 standard
- *
- * Delete entry from environ.
- * Do not free() memory!  Other threads may be using it.
- * Keep it around forever.
- */
-static int
-borrowed_unsetenv(const char *name)
-{
-        long    idx;            /* index into environ */
-
-        if (name == NULL || *name == '\0' ||
-            strchr(name, '=') != NULL) {
-                return (-1);
-        }
-
-        for (idx = 0; environ[idx] != NULL; idx++) {
-                if (match_noeq(environ[idx], name))
-                        break;
-        }
-        if (environ[idx] == NULL) {
-                /* name not found but still a success */
-                return (0);
-        }
-        /* squeeze up one entry */
-        do {
-                environ[idx] = environ[idx+1];
-        } while (environ[++idx] != NULL);
-
-        return (0);
-}
-/* --- End of "borrowed" code --- */
-
-/*
- * Wrapper for unsetenv() function.
- */
-int
-UnsetEnv(char *name)
-{
-    return(borrowed_unsetenv(name));
-}
-
-/*
- * The implementation for finding classes from the bootstrap
- * class loader, refer to java.h
- */
-static FindClassFromBootLoader_t *findBootClass = NULL;
-
-jclass
-FindBootStrapClass(JNIEnv *env, const char* classname)
-{
-   if (findBootClass == NULL) {
-       findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT,
-          "JVM_FindClassFromBootLoader");
-       if (findBootClass == NULL) {
-           fprintf(stderr, "Error: could not load method JVM_FindClassFromBootLoader");
-           return NULL;
-       }
-   }
-   return findBootClass(env, classname, JNI_FALSE);
-}
-
--- a/src/os/solaris/launcher/java_md.h	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#ifndef JAVA_MD_H
-#define JAVA_MD_H
-
-#include <limits.h>
-#include <unistd.h>
-#include <sys/param.h>
-#ifndef GAMMA
-#include "manifest_info.h"
-#endif
-
-#define PATH_SEPARATOR          ':'
-#define FILESEP                 "/"
-#define FILE_SEPARATOR          '/'
-#ifndef MAXNAMELEN
-#define MAXNAMELEN              PATH_MAX
-#endif
-
-#ifdef JAVA_ARGS
-/*
- * ApplicationHome is prepended to each of these entries; the resulting
- * strings are concatenated (separated by PATH_SEPARATOR) and used as the
- * value of -cp option to the launcher.
- */
-#ifndef APP_CLASSPATH
-#define APP_CLASSPATH        { "/lib/tools.jar", "/classes" }
-#endif
-#endif
-
-#ifdef HAVE_GETHRTIME
-/*
- * Support for doing cheap, accurate interval timing.
- */
-#include <sys/time.h>
-#define CounterGet()              (gethrtime()/1000)
-#define Counter2Micros(counts)    (counts)
-#else
-#define CounterGet()              (0)
-#define Counter2Micros(counts)    (1)
-#endif /* HAVE_GETHRTIME */
-
-/*
- * Function prototypes.
- */
-#ifndef GAMMA
-char *LocateJRE(manifest_info* info);
-void ExecJRE(char *jre, char **argv);
-#endif
-int UnsetEnv(char *name);
-
-#endif
--- a/src/os/solaris/vm/attachListener_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/attachListener_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_attachListener_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/os.hpp"
+#include "services/attachListener.hpp"
+#include "services/dtraceAttacher.hpp"
 
 #include <door.h>
 #include <string.h>
--- a/src/os/solaris/vm/c1_globals_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/c1_globals_solaris.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP
+#define OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 //
 // Sets the default values for operating system dependent flags used by the
 // client compiler. (see c1_globals.hpp)
 //
+
+#endif // OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP
--- a/src/os/solaris/vm/c2_globals_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/c2_globals_solaris.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP
+#define OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 //
 // Sets the default values for operating system dependent flags used by the
 // server compiler. (see c2_globals.hpp)
 //
+
+#endif // OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP
--- a/src/os/solaris/vm/chaitin_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/chaitin_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_chaitin_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/machnode.hpp"
 
 void PhaseRegAlloc::pd_preallocate_hook() {
   // no action
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/solaris/vm/decoder_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "utilities/decoder.hpp"
+
+#include <demangle.h>
+
+bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
+  return !cplus_demangle(symbol, buf, (size_t)buflen);
+}
--- a/src/os/solaris/vm/dtraceJSDT_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/dtraceJSDT_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_dtraceJSDT_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 #ifdef HAVE_DTRACE_H
 
--- a/src/os/solaris/vm/globals_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/globals_solaris.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP
+#define OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP
+
 //
 // Defines Solaris specific flags. They are not available on other platforms.
 //
@@ -47,3 +50,5 @@
 define_pd_global(bool, UseLargePagesIndividualAllocation, false);
 define_pd_global(bool, UseOSErrorReporting, false);
 define_pd_global(bool, UseThreadPriorities, false);
+
+#endif // OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP
--- a/src/os/solaris/vm/hpi_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-# include "incls/_precompiled.incl"
-# include "incls/_hpi_solaris.cpp.incl"
-
-# include <sys/param.h>
-# include <dlfcn.h>
-
-typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
-
-void hpi::initialize_get_interface(vm_calls_t *callbacks)
-{
-    char buf[JVM_MAXPATHLEN];
-    void *hpi_handle;
-    GetInterfaceFunc& getintf = _get_interface;
-    jint (JNICALL * DLL_Initialize)(GetInterfaceFunc *, void *);
-
-    if (HPILibPath && HPILibPath[0]) {
-      strncpy(buf, HPILibPath, JVM_MAXPATHLEN - 1);
-      buf[JVM_MAXPATHLEN - 1] = '\0';
-    } else {
-      const char *thread_type = "native_threads";
-
-      os::jvm_path(buf, JVM_MAXPATHLEN);
-
-#ifdef PRODUCT
-      const char * hpi_lib = "/libhpi.so";
-#else
-      char * ptr = strrchr(buf, '/');
-      assert(strstr(ptr, "/libjvm") == ptr, "invalid library name");
-      const char * hpi_lib = strstr(ptr, "_g") ? "/libhpi_g.so" : "/libhpi.so";
-#endif
-
-      *(strrchr(buf, '/')) = '\0';  /* get rid of /libjvm.so */
-      char* p = strrchr(buf, '/');
-      if (p != NULL) p[1] = '\0';   /* get rid of hotspot    */
-      strcat(buf, thread_type);
-      strcat(buf, hpi_lib);
-    }
-    /* we use RTLD_NOW because of bug 4032715 */
-    if (TraceHPI)  tty->print_cr("Loading HPI %s ", buf);
-    hpi_handle = dlopen(buf, RTLD_NOW);
-    if (hpi_handle == NULL) {
-        if (TraceHPI) tty->print_cr("HPI dlopen failed: %s", dlerror());
-        return;
-    }
-    DLL_Initialize = CAST_TO_FN_PTR(jint (JNICALL *)(GetInterfaceFunc *, void *),
-                                    dlsym(hpi_handle, "DLL_Initialize"));
-    if (TraceHPI && DLL_Initialize == NULL) tty->print_cr("HPI dlsym of DLL_Initialize failed: %s", dlerror());
-    if (DLL_Initialize == NULL ||
-        (*DLL_Initialize)(&getintf, callbacks) < 0) {
-        if (TraceHPI) tty->print_cr("HPI DLL_Initialize failed");
-        return;
-    }
-    if (TraceHPI)  tty->print_cr("HPI loaded successfully");
-}
--- a/src/os/solaris/vm/hpi_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-//
-// Parts of the HPI interface for which the HotSparc does not use the
-// HPI (because the interruptible IO mechanims used are different).
-//
-
-#include <sys/socket.h>
-#include <sys/poll.h>
-#include <sys/filio.h>
-#include <unistd.h>
-#include <netdb.h>
-#include <setjmp.h>
-
-// HPI_FileInterface
-
-// Many system calls can be interrupted by signals and must be restarted.
-// Restart support was added without disturbing the extent of thread
-// interruption support.
-
-inline int    hpi::close(int fd) {
-  RESTARTABLE_RETURN_INT(::close(fd));
-}
-
-inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
-  INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
-}
-
-inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) {
-  INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
-}
-
-
-// HPI_SocketInterface
-
-inline int    hpi::socket_close(int fd) {
-  RESTARTABLE_RETURN_INT(::close(fd));
-}
-
-inline int    hpi::socket(int domain, int type, int protocol) {
-  return ::socket(domain, type, protocol);
-}
-
-inline int    hpi::recv(int fd, char *buf, int nBytes, int flags) {
-  INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
-}
-
-inline int    hpi::send(int fd, char *buf, int nBytes, int flags) {
-  INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
-}
-
-inline int    hpi::raw_send(int fd, char *buf, int nBytes, int flags) {
-  RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
-}
-
-// As both poll and select can be interrupted by signals, we have to be
-// prepared to restart the system call after updating the timeout, unless
-// a poll() is done with timeout == -1, in which case we repeat with this
-// "wait forever" value.
-
-inline int    hpi::timeout(int fd, long timeout) {
-  int res;
-  struct timeval t;
-  julong prevtime, newtime;
-  static const char* aNull = 0;
-
-  struct pollfd pfd;
-  pfd.fd = fd;
-  pfd.events = POLLIN;
-
-  gettimeofday(&t, &aNull);
-  prevtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec / 1000;
-
-  for(;;) {
-    INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted);
-    if(res == OS_ERR && errno == EINTR) {
-        if(timeout != -1) {
-            gettimeofday(&t, &aNull);
-            newtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec /1000;
-            timeout -= newtime - prevtime;
-            if(timeout <= 0)
-              return OS_OK;
-            prevtime = newtime;
-        }
-    } else
-      return res;
-  }
-}
-
-inline int    hpi::listen(int fd, int count) {
-  if (fd < 0)
-    return OS_ERR;
-
-  return ::listen(fd, count);
-}
-
-inline int
-hpi::connect(int fd, struct sockaddr *him, int len) {
-  do {
-    int _result;
-    INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result,
-                            os::Solaris::clear_interrupted);
-
-    // Depending on when thread interruption is reset, _result could be
-    // one of two values when errno == EINTR
-
-    if (((_result == OS_INTRPT) || (_result == OS_ERR)) && (errno == EINTR)) {
-      /* restarting a connect() changes its errno semantics */
-      INTERRUPTIBLE(::connect(fd, him, len), _result,
-                      os::Solaris::clear_interrupted);
-      /* undo these changes */
-      if (_result == OS_ERR) {
-        if (errno == EALREADY) errno = EINPROGRESS; /* fall through */
-        else if (errno == EISCONN) { errno = 0; return OS_OK; }
-      }
-    }
-    return _result;
-  } while(false);
-}
-
-inline int    hpi::accept(int fd, struct sockaddr *him, int *len) {
-  if (fd < 0)
-    return OS_ERR;
-  INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him, (socklen_t*) len), os::Solaris::clear_interrupted);
-}
-
-inline int    hpi::recvfrom(int fd, char *buf, int nBytes, int flags,
-                            sockaddr *from, int *fromlen) {
-  //%%note jvm_r11
-  INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen), os::Solaris::clear_interrupted);
-}
-
-inline int    hpi::sendto(int fd, char *buf, int len, int flags,
-                          struct sockaddr *to, int tolen) {
-  //%%note jvm_r11
-  INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, (unsigned int) flags, to, tolen),os::Solaris::clear_interrupted);
-}
-
-inline int    hpi::socket_available(int fd, jint *pbytes) {
-  if (fd < 0)
-    return OS_OK;
-
-  int ret;
-
-  RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret);
-
-  //%% note ioctl can return 0 when successful, JVM_SocketAvailable
-  // is expected to return 0 on failure and 1 on success to the jdk.
-
-  return (ret == OS_ERR) ? 0 : 1;
-}
-
-
-/*
-HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown,
-        int, "%d",
-        (int fd, int howto),
-        ("fd = %d, howto = %d", fd, howto),
-        (fd, howto));
-        */
-inline int hpi::socket_shutdown(int fd, int howto){
-  return ::shutdown(fd, howto);
-}
-
-/*
-HPIDECL(bind, "bind", _socket, Bind,
-        int, "%d",
-        (int fd, struct sockaddr *him, int len),
-        ("fd = %d, him = %p, len = %d",
-         fd, him, len),
-        (fd, him, len));
-*/
-inline int hpi::bind(int fd, struct sockaddr *him, int len){
-  INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),os::Solaris::clear_interrupted);
-}
-
-/*
-HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName,
-        int, "%d",
-        (int fd, struct sockaddr *him, int *len),
-        ("fd = %d, him = %p, len = %p",
-         fd, him, len),
-        (fd, him, len));
-        */
-inline int hpi::get_sock_name(int fd, struct sockaddr *him, int *len){
-  return ::getsockname(fd, him, (socklen_t*) len);
-}
-
-/*
-HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d",
-        (char *hostname, int namelen),
-        ("hostname = %p, namelen = %d",
-         hostname, namelen),
-        (hostname, namelen));
-        */
-inline int hpi::get_host_name(char* name, int namelen){
-  return ::gethostname(name, namelen);
-}
-
-/*
-HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d",
-        (int fd, int level, int optname, char *optval, int* optlen),
-        ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p",
-         fd, level, optname, optval, optlen),
-        (fd, level, optname, optval, optlen));
-        */
-inline int hpi::get_sock_opt(int fd, int level, int optname,
-                             char *optval, int* optlen){
-  return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen);
-}
-
-/*
-HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
-        (int fd, int level, int optname, const char *optval, int optlen),
-        ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
-         fd, level, optname, optval, optlen),
-        (fd, level, optname, optval, optlen));
-        */
-inline int hpi::set_sock_opt(int fd, int level, int optname,
-                             const char *optval, int optlen){
-  return ::setsockopt(fd, level, optname, optval, optlen);
-}
-
-//Reconciliation History
-// 1.3 98/10/21 18:17:14 hpi_win32.hpp
-// 1.6 99/06/28 11:01:36 hpi_win32.hpp
-//End
--- a/src/os/solaris/vm/interfaceSupport_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/interfaceSupport_solaris.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP
+#define OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP
+
 // Contains inlined functions for class InterfaceSupport
 
 static inline void serialize_memory(JavaThread *thread) {
   os::write_memory_serialize_page(thread);
 }
+
+#endif // OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP
--- a/src/os/solaris/vm/jsig.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/jsig.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/os/solaris/vm/jvm_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/jvm_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_jvm_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/osThread.hpp"
 
 #include <signal.h>
 
--- a/src/os/solaris/vm/jvm_solaris.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/jvm_solaris.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_JVM_SOLARIS_H
+#define OS_SOLARIS_VM_JVM_SOLARIS_H
+
 /*
 // HotSpot integration note:
 //
@@ -98,3 +101,5 @@
 #define JSIG_VERSION_1_4_1   0x30140100
 
 #endif /* JVM_MD_H */
+
+#endif // OS_SOLARIS_VM_JVM_SOLARIS_H
--- a/src/os/solaris/vm/mutex_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/mutex_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_mutex_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutex.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/events.hpp"
 
 // Solaris-specific include, therefore not in includeDB_*
 # include "os_share_solaris.hpp"
--- a/src/os/solaris/vm/mutex_solaris.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/mutex_solaris.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,3 +21,12 @@
  * questions.
  *
  */
+
+#ifndef OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
+#define OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
+
+#include "os_solaris.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "thread_solaris.inline.hpp"
+
+#endif // OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
--- a/src/os/solaris/vm/osThread_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/osThread_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-// do not include  precompiled  header file
-# include "incls/_osThread_solaris.cpp.incl"
+// no precompiled headers
+#include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+
 # include <signal.h>
 
  // ***************************************************************
--- a/src/os/solaris/vm/osThread_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/osThread_solaris.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
+#define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
+
 // This is embedded via include into the class OSThread
 
  private:
@@ -149,3 +152,5 @@
 
   void pd_initialize();
   void pd_destroy();
+
+#endif // OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
--- a/src/os/solaris/vm/os_share_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/os_share_solaris.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP
+#define OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP
+
 // Defines the interfaces to Solaris operating systems that vary across platforms
 
 
@@ -65,3 +68,5 @@
 #endif
 
 #define PROCFILE_LENGTH 128
+
+#endif // OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP
--- a/src/os/solaris/vm/os_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/os_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,60 @@
  *
  */
 
-// do not include  precompiled  header file
-# include "incls/_os_solaris.cpp.incl"
+// no precompiled headers
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_solaris.h"
+#include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_share_solaris.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/timer.hpp"
+#include "services/attachListener.hpp"
+#include "services/runtimeService.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // put OS-includes here
 # include <dlfcn.h>
@@ -63,6 +115,7 @@
 # include <sys/iapriocntl.h>
 # include <sys/loadavg.h>
 # include <string.h>
+# include <stdio.h>
 
 # define _STRUCTURED_PROC 1  //  this gets us the new structured proc interfaces of 5.6 & later
 # include <sys/procfs.h>     //  see comment in <sys/procfs.h>
@@ -167,6 +220,9 @@
 // System parameters used internally
 static clock_t clock_tics_per_sec = 100;
 
+// Track if we have called enable_extended_FILE_stdio (on Solaris 10u4+)
+static bool enabled_extended_FILE_stdio = false;
+
 // For diagnostics to print a message once. see run_periodic_checks
 static bool check_addr0_done = false;
 static sigset_t check_signal_done;
@@ -334,7 +390,7 @@
 // The saved state is used to restore the thread to
 // its former state whether or not an interrupt is received.
 // Used by classloader os::read
-// hpi calls skip this layer and stay in _thread_in_native
+// os::restartable_read calls skip this layer and stay in _thread_in_native
 
 void os::Solaris::setup_interruptible(JavaThread* thread) {
 
@@ -1698,13 +1754,13 @@
 bool os::supports_vtime() { return true; }
 
 bool os::enable_vtime() {
-  int fd = open("/proc/self/ctl", O_WRONLY);
+  int fd = ::open("/proc/self/ctl", O_WRONLY);
   if (fd == -1)
     return false;
 
   long cmd[] = { PCSET, PR_MSACCT };
-  int res = write(fd, cmd, sizeof(long) * 2);
-  close(fd);
+  int res = ::write(fd, cmd, sizeof(long) * 2);
+  ::close(fd);
   if (res != sizeof(long) * 2)
     return false;
 
@@ -1712,13 +1768,13 @@
 }
 
 bool os::vtime_enabled() {
-  int fd = open("/proc/self/status", O_RDONLY);
+  int fd = ::open("/proc/self/status", O_RDONLY);
   if (fd == -1)
     return false;
 
   pstatus_t status;
-  int res = read(fd, (void*) &status, sizeof(pstatus_t));
-  close(fd);
+  int res = os::read(fd, (void*) &status, sizeof(pstatus_t));
+  ::close(fd);
   if (res != sizeof(pstatus_t))
     return false;
 
@@ -1834,7 +1890,6 @@
 
 void os::dll_build_name(char* buffer, size_t buflen,
                         const char* pname, const char* fname) {
-  // Copied from libhpi
   const size_t pnamelen = pname ? strlen(pname) : 0;
 
   // Quietly truncate on buffer overflow.  Should be an error.
@@ -1915,27 +1970,42 @@
       Sym * info;
       if (dladdr1_func((void *)addr, &dlinfo, (void **)&info,
                        RTLD_DL_SYMENT)) {
-          if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
-          if (offset) *offset = addr - (address)dlinfo.dli_saddr;
-
-          // check if the returned symbol really covers addr
-          return ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr);
-      } else {
-          if (buf) buf[0] = '\0';
-          if (offset) *offset  = -1;
-          return false;
+        if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) {
+          if (buf != NULL) {
+            if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen))
+              jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
+            }
+            if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
+            return true;
+        }
       }
+      if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
+        if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+          dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
+          return true;
+        }
+      }
+      if (buf != NULL) buf[0] = '\0';
+      if (offset != NULL) *offset  = -1;
+      return false;
   } else {
       // no, only dladdr is available
-      if(dladdr((void *)addr, &dlinfo)) {
-          if (buf) jio_snprintf(buf, buflen, dlinfo.dli_sname);
-          if (offset) *offset = addr - (address)dlinfo.dli_saddr;
+      if (dladdr((void *)addr, &dlinfo)) {
+        if (buf != NULL) {
+          if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen))
+            jio_snprintf(buf, buflen, dlinfo.dli_sname);
+        }
+        if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
+        return true;
+      } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
+        if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+          dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
           return true;
-      } else {
-          if (buf) buf[0] = '\0';
-          if (offset) *offset  = -1;
-          return false;
+        }
       }
+      if (buf != NULL) buf[0] = '\0';
+      if (offset != NULL) *offset  = -1;
+      return false;
   }
 }
 
@@ -2130,20 +2200,29 @@
   return dlsym(handle, name);
 }
 
-
-bool _print_ascii_file(const char* filename, outputStream* st) {
-  int fd = open(filename, O_RDONLY);
+int os::stat(const char *path, struct stat *sbuf) {
+  char pathbuf[MAX_PATH];
+  if (strlen(path) > MAX_PATH - 1) {
+    errno = ENAMETOOLONG;
+    return -1;
+  }
+  os::native_path(strcpy(pathbuf, path));
+  return ::stat(pathbuf, sbuf);
+}
+
+static bool _print_ascii_file(const char* filename, outputStream* st) {
+  int fd = ::open(filename, O_RDONLY);
   if (fd == -1) {
      return false;
   }
 
   char buf[32];
   int bytes;
-  while ((bytes = read(fd, buf, sizeof(buf))) > 0) {
+  while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
     st->print_raw(buf, bytes);
   }
 
-  close(fd);
+  ::close(fd);
 
   return true;
 }
@@ -2206,10 +2285,10 @@
 
 static bool check_addr0(outputStream* st) {
   jboolean status = false;
-  int fd = open("/proc/self/map",O_RDONLY);
+  int fd = ::open("/proc/self/map",O_RDONLY);
   if (fd >= 0) {
     prmap_t p;
-    while(read(fd, &p, sizeof(p)) > 0) {
+    while(::read(fd, &p, sizeof(p)) > 0) {
       if (p.pr_vaddr == 0x0) {
         st->print("Warning: Address: 0x%x, Size: %dK, ",p.pr_vaddr, p.pr_size/1024, p.pr_mapname);
         st->print("Mapped file: %s, ", p.pr_mapname[0] == '\0' ? "None" : p.pr_mapname);
@@ -2220,7 +2299,7 @@
         st->cr();
         status = true;
       }
-      close(fd);
+      ::close(fd);
     }
   }
   return status;
@@ -2468,8 +2547,6 @@
           // Use current module name "libjvm[_g].so" instead of
           // "libjvm"debug_only("_g")".so" since for fastdebug version
           // we should have "libjvm.so" but debug_only("_g") adds "_g"!
-          // It is used when we are choosing the HPI library's name
-          // "libhpi[_g].so" in hpi::initialize_get_interface().
           len = strlen(buf);
           snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
         } else {
@@ -2493,6 +2570,23 @@
   // no suffix required
 }
 
+// This method is a copy of JDK's sysGetLastErrorString
+// from src/solaris/hpi/src/system_md.c
+
+size_t os::lasterror(char *buf, size_t len) {
+
+  if (errno == 0)  return 0;
+
+  const char *s = ::strerror(errno);
+  size_t n = ::strlen(s);
+  if (n >= len) {
+    n = len - 1;
+  }
+  ::strncpy(buf, s, n);
+  buf[n] = '\0';
+  return n;
+}
+
 
 // sun.misc.Signal
 
@@ -3375,7 +3469,12 @@
     // INTERRUPTIBLE_NORESTART_VM_ALWAYS returns res == OS_INTRPT for
     // thread.Interrupt.
 
-    if((res == OS_ERR) && (errno == EINTR)) {
+    // See c/r 6751923. Poll can return 0 before time
+    // has elapsed if time is set via clock_settime (as NTP does).
+    // res == 0 if poll timed out (see man poll RETURN VALUES)
+    // using the logic below checks that we really did
+    // sleep at least "millis" if not we'll sleep again.
+    if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) {
       newtime = getTimeMillis();
       assert(newtime >= prevtime, "time moving backwards");
     /* Doing prevtime and newtime in microseconds doesn't help precision,
@@ -3397,6 +3496,10 @@
   INTERRUPTIBLE_RETURN_INT_VM(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
 }
 
+size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
+  INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
+}
+
 int os::sleep(Thread* thread, jlong millis, bool interruptible) {
   assert(thread == Thread::current(),  "thread consistency check");
 
@@ -4566,16 +4669,16 @@
 #define ADR(x)  ((uintptr_t)(x))
 #define LWPINDEX(ary,ix)   ((lwpstatus_t *)(((ary)->pr_entsize * (ix)) + (ADR((ary) + 1))))
 
-  lwpFile = open("/proc/self/lstatus", O_RDONLY, 0);
+  lwpFile = ::open("/proc/self/lstatus", O_RDONLY, 0);
   if (lwpFile < 0) {
       if (ThreadPriorityVerbose) warning ("Couldn't open /proc/self/lstatus\n");
       return false;
   }
   lwpSize = 16*1024;
   for (;;) {
-    lseek (lwpFile, 0, SEEK_SET);
+    ::lseek64 (lwpFile, 0, SEEK_SET);
     lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize);
-    if (read(lwpFile, lwpArray, lwpSize) < 0) {
+    if (::read(lwpFile, lwpArray, lwpSize) < 0) {
       if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n");
       break;
     }
@@ -4596,7 +4699,7 @@
   }
 
   FREE_C_HEAP_ARRAY(char, lwpArray);
-  close (lwpFile);
+  ::close (lwpFile);
   if (ThreadPriorityVerbose) {
     if (isT2) tty->print_cr("We are running with a T2 libthread\n");
     else tty->print_cr("We are not running with a T2 libthread\n");
@@ -4792,7 +4895,7 @@
   // if we need them.
   Solaris::misc_sym_init();
 
-  int fd = open("/dev/zero", O_RDWR);
+  int fd = ::open("/dev/zero", O_RDWR);
   if (fd < 0) {
     fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno)));
   } else {
@@ -4962,13 +5065,6 @@
     }
   }
 
-  // Initialize HPI.
-  jint hpi_result = hpi::initialize();
-  if (hpi_result != JNI_OK) {
-    tty->print_cr("There was an error trying to initialize the HPI library.");
-    return hpi_result;
-  }
-
   // Calculate theoretical max. size of Threads to guard gainst
   // artifical out-of-memory situations, where all available address-
   // space has been reserved by thread stacks. Default stack size is 1Mb.
@@ -5028,17 +5124,6 @@
 
 // OS interface.
 
-int os::stat(const char *path, struct stat *sbuf) {
-  char pathbuf[MAX_PATH];
-  if (strlen(path) > MAX_PATH - 1) {
-    errno = ENAMETOOLONG;
-    return -1;
-  }
-  hpi::native_path(strcpy(pathbuf, path));
-  return ::stat(pathbuf, sbuf);
-}
-
-
 bool os::check_heap(bool force) { return true; }
 
 typedef int (*vsnprintf_t)(char* buf, size_t count, const char* fmt, va_list argptr);
@@ -5083,6 +5168,125 @@
   return result;
 }
 
+// This code originates from JDK's sysOpen and open64_w
+// from src/solaris/hpi/src/system_md.c
+
+#ifndef O_DELETE
+#define O_DELETE 0x10000
+#endif
+
+// Open a file. Unlink the file immediately after open returns
+// if the specified oflag has the O_DELETE flag set.
+// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
+
+int os::open(const char *path, int oflag, int mode) {
+  if (strlen(path) > MAX_PATH - 1) {
+    errno = ENAMETOOLONG;
+    return -1;
+  }
+  int fd;
+  int o_delete = (oflag & O_DELETE);
+  oflag = oflag & ~O_DELETE;
+
+  fd = ::open(path, oflag, mode);
+  if (fd == -1) return -1;
+
+  //If the open succeeded, the file might still be a directory
+  {
+    struct stat64 buf64;
+    int ret = ::fstat64(fd, &buf64);
+    int st_mode = buf64.st_mode;
+
+    if (ret != -1) {
+      if ((st_mode & S_IFMT) == S_IFDIR) {
+        errno = EISDIR;
+        ::close(fd);
+        return -1;
+      }
+    } else {
+      ::close(fd);
+      return -1;
+    }
+  }
+    /*
+     * 32-bit Solaris systems suffer from:
+     *
+     * - an historical default soft limit of 256 per-process file
+     *   descriptors that is too low for many Java programs.
+     *
+     * - a design flaw where file descriptors created using stdio
+     *   fopen must be less than 256, _even_ when the first limit above
+     *   has been raised.  This can cause calls to fopen (but not calls to
+     *   open, for example) to fail mysteriously, perhaps in 3rd party
+     *   native code (although the JDK itself uses fopen).  One can hardly
+     *   criticize them for using this most standard of all functions.
+     *
+     * We attempt to make everything work anyways by:
+     *
+     * - raising the soft limit on per-process file descriptors beyond
+     *   256
+     *
+     * - As of Solaris 10u4, we can request that Solaris raise the 256
+     *   stdio fopen limit by calling function enable_extended_FILE_stdio.
+     *   This is done in init_2 and recorded in enabled_extended_FILE_stdio
+     *
+     * - If we are stuck on an old (pre 10u4) Solaris system, we can
+     *   workaround the bug by remapping non-stdio file descriptors below
+     *   256 to ones beyond 256, which is done below.
+     *
+     * See:
+     * 1085341: 32-bit stdio routines should support file descriptors >255
+     * 6533291: Work around 32-bit Solaris stdio limit of 256 open files
+     * 6431278: Netbeans crash on 32 bit Solaris: need to call
+     *          enable_extended_FILE_stdio() in VM initialisation
+     * Giri Mandalika's blog
+     * http://technopark02.blogspot.com/2005_05_01_archive.html
+     */
+#ifndef  _LP64
+     if ((!enabled_extended_FILE_stdio) && fd < 256) {
+         int newfd = ::fcntl(fd, F_DUPFD, 256);
+         if (newfd != -1) {
+             ::close(fd);
+             fd = newfd;
+         }
+     }
+#endif // 32-bit Solaris
+    /*
+     * All file descriptors that are opened in the JVM and not
+     * specifically destined for a subprocess should have the
+     * close-on-exec flag set.  If we don't set it, then careless 3rd
+     * party native code might fork and exec without closing all
+     * appropriate file descriptors (e.g. as we do in closeDescriptors in
+     * UNIXProcess.c), and this in turn might:
+     *
+     * - cause end-of-file to fail to be detected on some file
+     *   descriptors, resulting in mysterious hangs, or
+     *
+     * - might cause an fopen in the subprocess to fail on a system
+     *   suffering from bug 1085341.
+     *
+     * (Yes, the default setting of the close-on-exec flag is a Unix
+     * design flaw)
+     *
+     * See:
+     * 1085341: 32-bit stdio routines should support file descriptors >255
+     * 4843136: (process) pipe file descriptor from Runtime.exec not being closed
+     * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9
+     */
+#ifdef FD_CLOEXEC
+    {
+        int flags = ::fcntl(fd, F_GETFD);
+        if (flags != -1)
+            ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+    }
+#endif
+
+  if (o_delete != 0) {
+    ::unlink(path);
+  }
+  return fd;
+}
+
 // create binary file, rewriting existing file if required
 int os::create_binary_file(const char* path, bool rewrite_existing) {
   int oflags = O_WRONLY | O_CREAT;
@@ -5102,6 +5306,55 @@
   return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET);
 }
 
+jlong os::lseek(int fd, jlong offset, int whence) {
+  return (jlong) ::lseek64(fd, offset, whence);
+}
+
+char * os::native_path(char *path) {
+  return path;
+}
+
+int os::ftruncate(int fd, jlong length) {
+  return ::ftruncate64(fd, length);
+}
+
+int os::fsync(int fd)  {
+  RESTARTABLE_RETURN_INT(::fsync(fd));
+}
+
+int os::available(int fd, jlong *bytes) {
+  jlong cur, end;
+  int mode;
+  struct stat64 buf64;
+
+  if (::fstat64(fd, &buf64) >= 0) {
+    mode = buf64.st_mode;
+    if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) {
+      /*
+      * XXX: is the following call interruptible? If so, this might
+      * need to go through the INTERRUPT_IO() wrapper as for other
+      * blocking, interruptible calls in this file.
+      */
+      int n,ioctl_return;
+
+      INTERRUPTIBLE(::ioctl(fd, FIONREAD, &n),ioctl_return,os::Solaris::clear_interrupted);
+      if (ioctl_return>= 0) {
+          *bytes = n;
+        return 1;
+      }
+    }
+  }
+  if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) {
+    return 0;
+  } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) {
+    return 0;
+  } else if (::lseek64(fd, cur, SEEK_SET) == -1) {
+    return 0;
+  }
+  *bytes = end - cur;
+  return 1;
+}
+
 // Map a block of memory.
 char* os::map_memory(int fd, const char* file_name, size_t file_offset,
                      char *addr, size_t bytes, bool read_only,
@@ -5160,7 +5413,7 @@
   int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
   if (fd != -1) {
     struct stat buf;
-    close(fd);
+    ::close(fd);
     while (::stat(filename, &buf) == 0) {
       (void)::poll(NULL, 0, 100);
     }
@@ -5357,16 +5610,16 @@
   sprintf(proc_name, "/proc/%d/lwp/%d/lwpusage",
                      getpid(),
                      thread->osthread()->lwp_id());
-  fd = open(proc_name, O_RDONLY);
+  fd = ::open(proc_name, O_RDONLY);
   if ( fd == -1 ) return -1;
 
   do {
-    count = pread(fd,
+    count = ::pread(fd,
                   (void *)&prusage.pr_utime,
                   thr_time_size,
                   thr_time_off);
   } while (count < 0 && errno == EINTR);
-  close(fd);
+  ::close(fd);
   if ( count < 0 ) return -1;
 
   if (user_sys_cpu_time) {
@@ -6038,4 +6291,127 @@
     return true;
 }
 
-
+size_t os::write(int fd, const void *buf, unsigned int nBytes) {
+  INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
+}
+
+int os::close(int fd) {
+  RESTARTABLE_RETURN_INT(::close(fd));
+}
+
+int os::socket_close(int fd) {
+  RESTARTABLE_RETURN_INT(::close(fd));
+}
+
+int os::recv(int fd, char *buf, int nBytes, int flags) {
+  INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
+}
+
+
+int os::send(int fd, char *buf, int nBytes, int flags) {
+  INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
+}
+
+int os::raw_send(int fd, char *buf, int nBytes, int flags) {
+  RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
+}
+
+// As both poll and select can be interrupted by signals, we have to be
+// prepared to restart the system call after updating the timeout, unless
+// a poll() is done with timeout == -1, in which case we repeat with this
+// "wait forever" value.
+
+int os::timeout(int fd, long timeout) {
+  int res;
+  struct timeval t;
+  julong prevtime, newtime;
+  static const char* aNull = 0;
+  struct pollfd pfd;
+  pfd.fd = fd;
+  pfd.events = POLLIN;
+
+  gettimeofday(&t, &aNull);
+  prevtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec / 1000;
+
+  for(;;) {
+    INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted);
+    if(res == OS_ERR && errno == EINTR) {
+        if(timeout != -1) {
+          gettimeofday(&t, &aNull);
+          newtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec /1000;
+          timeout -= newtime - prevtime;
+          if(timeout <= 0)
+            return OS_OK;
+          prevtime = newtime;
+        }
+    } else return res;
+  }
+}
+
+int os::connect(int fd, struct sockaddr *him, int len) {
+  int _result;
+  INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result,
+                          os::Solaris::clear_interrupted);
+
+  // Depending on when thread interruption is reset, _result could be
+  // one of two values when errno == EINTR
+
+  if (((_result == OS_INTRPT) || (_result == OS_ERR))
+                                        && (errno == EINTR)) {
+     /* restarting a connect() changes its errno semantics */
+     INTERRUPTIBLE(::connect(fd, him, len), _result,
+                     os::Solaris::clear_interrupted);
+     /* undo these changes */
+     if (_result == OS_ERR) {
+       if (errno == EALREADY) {
+         errno = EINPROGRESS; /* fall through */
+       } else if (errno == EISCONN) {
+         errno = 0;
+         return OS_OK;
+       }
+     }
+   }
+   return _result;
+ }
+
+int os::accept(int fd, struct sockaddr *him, int *len) {
+  if (fd < 0)
+   return OS_ERR;
+  INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him,\
+    (socklen_t*) len), os::Solaris::clear_interrupted);
+ }
+
+int os::recvfrom(int fd, char *buf, int nBytes, int flags,
+                             sockaddr *from, int *fromlen) {
+   //%%note jvm_r11
+  INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes,\
+    flags, from, fromlen), os::Solaris::clear_interrupted);
+}
+
+int os::sendto(int fd, char *buf, int len, int flags,
+                           struct sockaddr *to, int tolen) {
+  //%%note jvm_r11
+  INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, flags,\
+    to, tolen), os::Solaris::clear_interrupted);
+}
+
+int os::socket_available(int fd, jint *pbytes) {
+   if (fd < 0)
+     return OS_OK;
+
+   int ret;
+
+   RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret);
+
+   //%% note ioctl can return 0 when successful, JVM_SocketAvailable
+   // is expected to return 0 on failure and 1 on success to the jdk.
+
+   return (ret == OS_ERR) ? 0 : 1;
+}
+
+
+int os::bind(int fd, struct sockaddr *him, int len) {
+   INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),\
+     os::Solaris::clear_interrupted);
+}
+
--- a/src/os/solaris/vm/os_solaris.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/os_solaris.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_OS_SOLARIS_HPP
+#define OS_SOLARIS_VM_OS_SOLARIS_HPP
+
 // Solaris_OS defines the interface to Solaris operating systems
 
 class Solaris {
@@ -394,3 +397,5 @@
       assert_status(status == 0, status, "mutex_init");
     }
 } ;
+
+#endif // OS_SOLARIS_VM_OS_SOLARIS_HPP
--- a/src/os/solaris/vm/os_solaris.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/os_solaris.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,30 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
+#define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "atomic_solaris_x86.inline.hpp"
+# include "orderAccess_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "atomic_solaris_sparc.inline.hpp"
+# include "orderAccess_solaris_sparc.inline.hpp"
+#endif
+
+// System includes
+#include <sys/param.h>
+#include <dlfcn.h>
+#include <sys/socket.h>
+#include <sys/poll.h>
+#include <sys/filio.h>
+#include <unistd.h>
+#include <netdb.h>
+#include <setjmp.h>
+
 inline const char* os::file_separator() { return "/"; }
 inline const char* os::line_separator() { return "\n"; }
 inline const char* os::path_separator() { return ":"; }
@@ -55,21 +79,19 @@
 // Bang the shadow pages if they need to be touched to be mapped.
 inline void os::bang_stack_shadow_pages() {
 }
+inline void os::dll_unload(void *lib) { ::dlclose(lib); }
 
-inline DIR* os::opendir(const char* dirname)
-{
+inline DIR* os::opendir(const char* dirname) {
   assert(dirname != NULL, "just checking");
   return ::opendir(dirname);
 }
 
-inline int os::readdir_buf_size(const char *path)
-{
+inline int os::readdir_buf_size(const char *path) {
   int size = pathconf(path, _PC_NAME_MAX);
   return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1;
 }
 
-inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf)
-{
+inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) {
   assert(dirp != NULL, "just checking");
 #if defined(_LP64) || defined(_GNU_SOURCE)
   dirent* p;
@@ -85,9 +107,8 @@
 #endif // defined(_LP64) || defined(_GNU_SOURCE)
 }
 
-inline int os::closedir(DIR *dirp)
-{
-  assert(dirp != NULL, "just checking");
+inline int os::closedir(DIR *dirp) {
+  assert(dirp != NULL, "argument is NULL");
   return ::closedir(dirp);
 }
 
@@ -207,3 +228,39 @@
 
 inline bool os::numa_has_static_binding()   { return false; }
 inline bool os::numa_has_group_homing()     { return true;  }
+
+inline int    os::socket(int domain, int type, int protocol) {
+  return ::socket(domain, type, protocol);
+}
+
+inline int    os::listen(int fd, int count) {
+  if (fd < 0) return OS_ERR;
+
+  return ::listen(fd, count);
+}
+
+inline int os::socket_shutdown(int fd, int howto){
+  return ::shutdown(fd, howto);
+}
+
+inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){
+  return ::getsockname(fd, him, (socklen_t*) len);
+}
+
+inline int os::get_host_name(char* name, int namelen){
+  return ::gethostname(name, namelen);
+}
+
+inline struct hostent*  os::get_host_by_name(char* name) {
+  return ::gethostbyname(name);
+}
+inline int os::get_sock_opt(int fd, int level, int optname,
+                             char *optval, int* optlen){
+  return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen);
+}
+
+inline int os::set_sock_opt(int fd, int level, int optname,
+                             const char *optval, int optlen){
+  return ::setsockopt(fd, level, optname, optval, optlen);
+}
+#endif // OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
--- a/src/os/solaris/vm/perfMemory_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/perfMemory_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_perfMemory_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_solaris.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/perfMemory.hpp"
+#include "utilities/exceptions.hpp"
 
 // put OS-includes here
 # include <sys/types.h>
--- a/src/os/solaris/vm/stubRoutines_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/stubRoutines_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,7 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
+
--- a/src/os/solaris/vm/threadCritical_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/threadCritical_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadCritical_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadCritical.hpp"
+#include "thread_solaris.inline.hpp"
 
 // OS-includes here
 #include <thread.h>
--- a/src/os/solaris/vm/thread_solaris.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/thread_solaris.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,24 @@
  *
  */
 
+#ifndef OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP
+#define OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/prefetch.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "atomic_solaris_x86.inline.hpp"
+# include "orderAccess_solaris_x86.inline.hpp"
+# include "prefetch_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "atomic_solaris_sparc.inline.hpp"
+# include "orderAccess_solaris_sparc.inline.hpp"
+# include "prefetch_solaris_sparc.inline.hpp"
+#endif
+
 // Thread::current is "hot" it's called > 128K times in the 1st 500 msecs of
 // startup.
 // ThreadLocalStorage::thread is warm -- it's called > 16K times in the same
@@ -43,3 +61,5 @@
     return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix);
   }
 }
+
+#endif // OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP
--- a/src/os/solaris/vm/vmError_solaris.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/solaris/vm/vmError_solaris.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmError_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/vmError.hpp"
 
 #include <sys/types.h>
 #include <sys/wait.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/windows/launcher/java_md.c	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,1512 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include <ctype.h>
+#include <windows.h>
+#include <io.h>
+#include <process.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <jni.h>
+#include "java.h"
+#ifndef GAMMA
+#include "version_comp.h"
+#endif
+
+#define JVM_DLL "jvm.dll"
+#define JAVA_DLL "java.dll"
+#define CRT_DLL "msvcr71.dll"
+
+/*
+ * Prototypes.
+ */
+static jboolean GetPublicJREHome(char *path, jint pathsize);
+static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
+                           char *jvmpath, jint jvmpathsize);
+static jboolean GetJREPath(char *path, jint pathsize);
+static void EnsureJreInstallation(const char *jrepath);
+
+/* We supports warmup for UI stack that is performed in parallel
+ * to VM initialization.
+ * This helps to improve startup of UI application as warmup phase
+ * might be long due to initialization of OS or hardware resources.
+ * It is not CPU bound and therefore it does not interfere with VM init.
+ * Obviously such warmup only has sense for UI apps and therefore it needs
+ * to be explicitly requested by passing -Dsun.awt.warmup=true property
+ * (this is always the case for plugin/javaws).
+ *
+ * Implementation launches new thread after VM starts and use it to perform
+ * warmup code (platform dependent).
+ * This thread is later reused as AWT toolkit thread as graphics toolkit
+ * often assume that they are used from the same thread they were launched on.
+ *
+ * At the moment we only support warmup for D3D. It only possible on windows
+ * and only if other flags do not prohibit this (e.g. OpenGL support requested).
+ */
+#undef ENABLE_AWT_PRELOAD
+#ifndef JAVA_ARGS /* turn off AWT preloading for javac, jar, etc */
+  #ifdef _X86_ /* for now disable AWT preloading for 64bit */
+    #define ENABLE_AWT_PRELOAD
+  #endif
+#endif
+
+#ifdef ENABLE_AWT_PRELOAD
+/* "AWT was preloaded" flag;
+ * Turned on by AWTPreload().
+ */
+int awtPreloaded = 0;
+
+/* Calls a function with the name specified.
+ * The function must be int(*fn)(void).
+ */
+int AWTPreload(const char *funcName);
+/* Stops AWT preloading. */
+void AWTPreloadStop();
+
+/* D3D preloading */
+/* -1: not initialized; 0: OFF, 1: ON */
+int awtPreloadD3D = -1;
+/* Command line parameter to swith D3D preloading on. */
+#define PARAM_PRELOAD_D3D "-Dsun.awt.warmup"
+/* D3D/OpenGL management parameters (may disable D3D preloading) */
+#define PARAM_NODDRAW "-Dsun.java2d.noddraw"
+#define PARAM_D3D "-Dsun.java2d.d3d"
+#define PARAM_OPENGL "-Dsun.java2d.opengl"
+/* funtion in awt.dll (src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp) */
+#define D3D_PRELOAD_FUNC "preloadD3D"
+
+
+/* Extracts value of a parameter with the specified name
+ * from command line argument (returns pointer in the argument).
+ * Returns NULL if the argument does not contains the parameter.
+ * e.g.:
+ * GetParamValue("theParam", "theParam=value") returns pointer to "value".
+ */
+const char * GetParamValue(const char *paramName, const char *arg) {
+    int nameLen = strlen(paramName);
+    if (strncmp(paramName, arg, nameLen) == 0) {
+        // arg[nameLen] is valid (may contain final NULL)
+        if (arg[nameLen] == '=') {
+            return arg + nameLen + 1;
+        }
+    }
+    return NULL;
+}
+
+/* Checks if commandline argument contains property specified
+ * and analyze it as boolean property (true/false).
+ * Returns -1 if the argument does not contain the parameter;
+ * Returns 1 if the argument contains the parameter and its value is "true";
+ * Returns 0 if the argument contains the parameter and its value is "false".
+ */
+int GetBoolParamValue(const char *paramName, const char *arg) {
+    const char * paramValue = GetParamValue(paramName, arg);
+    if (paramValue != NULL) {
+        if (stricmp(paramValue, "true") == 0) {
+            return 1;
+        }
+        if (stricmp(paramValue, "false") == 0) {
+            return 0;
+        }
+    }
+    return -1;
+}
+#endif /* ENABLE_AWT_PRELOAD */
+
+
+const char *
+GetArch()
+{
+
+#ifdef _M_AMD64
+    return "amd64";
+#elif defined(_M_IA64)
+    return "ia64";
+#else
+    return "i386";
+#endif
+}
+
+/*
+ *
+ */
+void
+CreateExecutionEnvironment(int *_argc,
+                           char ***_argv,
+                           char jrepath[],
+                           jint so_jrepath,
+                           char jvmpath[],
+                           jint so_jvmpath,
+                           char **original_argv) {
+#ifndef GAMMA
+   char * jvmtype;
+
+    /* Find out where the JRE is that we will be using. */
+    if (!GetJREPath(jrepath, so_jrepath)) {
+        ReportErrorMessage("Error: could not find Java SE Runtime Environment.",
+                           JNI_TRUE);
+        exit(2);
+    }
+
+    /* Do this before we read jvm.cfg */
+    EnsureJreInstallation(jrepath);
+
+    /* Find the specified JVM type */
+    if (ReadKnownVMs(jrepath, (char*)GetArch(), JNI_FALSE) < 1) {
+        ReportErrorMessage("Error: no known VMs. (check for corrupt jvm.cfg file)",
+                           JNI_TRUE);
+        exit(1);
+    }
+    jvmtype = CheckJvmType(_argc, _argv, JNI_FALSE);
+
+    jvmpath[0] = '\0';
+    if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath)) {
+        char * message=NULL;
+        const char * format = "Error: no `%s' JVM at `%s'.";
+        message = (char *)JLI_MemAlloc((strlen(format)+strlen(jvmtype)+
+                                    strlen(jvmpath)) * sizeof(char));
+        sprintf(message,format, jvmtype, jvmpath);
+        ReportErrorMessage(message, JNI_TRUE);
+        exit(4);
+    }
+    /* If we got here, jvmpath has been correctly initialized. */
+
+#else  /* ifndef GAMMA */
+
+    /*
+     * gamma launcher is simpler in that it doesn't handle VM flavors, data
+     * model, etc. Assuming everything is set-up correctly
+     * all we need to do here is to return correct path names. See also
+     * GetJVMPath() and GetApplicationHome().
+     */
+
+  {
+    if (!GetJREPath(jrepath, so_jrepath) ) {
+       ReportErrorMessage("Error: could not find Java SE Runtime Environment.",
+                          JNI_TRUE);
+       exit(2);
+    }
+
+    if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath)) {
+       char * message=NULL;
+       const char * format = "Error: no JVM at `%s'.";
+       message = (char *)JLI_MemAlloc((strlen(format)+
+                                       strlen(jvmpath)) * sizeof(char));
+       sprintf(message, format, jvmpath);
+       ReportErrorMessage(message, JNI_TRUE);
+       exit(4);
+    }
+  }
+
+#endif  /* ifndef GAMMA */
+
+}
+
+
+static jboolean
+LoadMSVCRT()
+{
+    // Only do this once
+    static int loaded = 0;
+    char crtpath[MAXPATHLEN];
+
+    if (!loaded) {
+        /*
+         * The Microsoft C Runtime Library needs to be loaded first.  A copy is
+         * assumed to be present in the "JRE path" directory.  If it is not found
+         * there (or "JRE path" fails to resolve), skip the explicit load and let
+         * nature take its course, which is likely to be a failure to execute.
+         */
+        if (GetJREPath(crtpath, MAXPATHLEN)) {
+            (void)strcat(crtpath, "\\bin\\" CRT_DLL);   /* Add crt dll */
+            if (_launcher_debug) {
+                printf("CRT path is %s\n", crtpath);
+            }
+            if (_access(crtpath, 0) == 0) {
+                if (LoadLibrary(crtpath) == 0) {
+                    ReportErrorMessage2("Error loading: %s", crtpath, JNI_TRUE);
+                    return JNI_FALSE;
+                }
+            }
+        }
+        loaded = 1;
+    }
+    return JNI_TRUE;
+}
+
+/*
+ * The preJVMStart is a function in the jkernel.dll, which
+ * performs the final step of synthesizing back the decomposed
+ * modules  (partial install) to the full JRE. Any tool which
+ * uses the  JRE must peform this step to ensure the complete synthesis.
+ * The EnsureJreInstallation function calls preJVMStart based on
+ * the conditions outlined below, noting that the operation
+ * will fail silently if any of conditions are not met.
+ * NOTE: this call must be made before jvm.dll is loaded, or jvm.cfg
+ * is read, since jvm.cfg will be modified by the preJVMStart.
+ * 1. Are we on a supported platform.
+ * 2. Find the location of the JRE or the Kernel JRE.
+ * 3. check existence of JREHOME/lib/bundles
+ * 4. check jkernel.dll and invoke the entry-point
+ */
+typedef VOID (WINAPI *PREJVMSTART)();
+
+static void
+EnsureJreInstallation(const char* jrepath)
+{
+    HINSTANCE handle;
+    char tmpbuf[MAXPATHLEN];
+    PREJVMSTART PreJVMStart;
+    struct stat s;
+
+    /* 32 bit windows only please */
+    if (strcmp(GetArch(), "i386") != 0 ) {
+        if (_launcher_debug) {
+            printf("EnsureJreInstallation:unsupported platform\n");
+        }
+        return;
+    }
+    /* Does our bundle directory exist ? */
+    strcpy(tmpbuf, jrepath);
+    strcat(tmpbuf, "\\lib\\bundles");
+    if (stat(tmpbuf, &s) != 0) {
+        if (_launcher_debug) {
+            printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf);
+        }
+        return;
+    }
+    /* Does our jkernel dll exist ? */
+    strcpy(tmpbuf, jrepath);
+    strcat(tmpbuf, "\\bin\\jkernel.dll");
+    if (stat(tmpbuf, &s) != 0) {
+        if (_launcher_debug) {
+            printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf);
+        }
+        return;
+    }
+    /* The Microsoft C Runtime Library needs to be loaded first. */
+    if (!LoadMSVCRT()) {
+        if (_launcher_debug) {
+            printf("EnsureJreInstallation:could not load C runtime DLL\n");
+        }
+        return;
+    }
+    /* Load the jkernel.dll */
+    if ((handle = LoadLibrary(tmpbuf)) == 0) {
+        if (_launcher_debug) {
+            printf("EnsureJreInstallation:%s:load failed\n", tmpbuf);
+        }
+        return;
+    }
+    /* Get the function address */
+    PreJVMStart = (PREJVMSTART)GetProcAddress(handle, "preJVMStart");
+    if (PreJVMStart == NULL) {
+        if (_launcher_debug) {
+            printf("EnsureJreInstallation:preJVMStart:function lookup failed\n");
+        }
+        FreeLibrary(handle);
+        return;
+    }
+    PreJVMStart();
+    if (_launcher_debug) {
+        printf("EnsureJreInstallation:preJVMStart:called\n");
+    }
+    FreeLibrary(handle);
+    return;
+}
+
+/*
+ * Find path to JRE based on .exe's location or registry settings.
+ */
+jboolean
+GetJREPath(char *path, jint pathsize)
+{
+    char javadll[MAXPATHLEN];
+    struct stat s;
+
+    if (GetApplicationHome(path, pathsize)) {
+        /* Is JRE co-located with the application? */
+        sprintf(javadll, "%s\\bin\\" JAVA_DLL, path);
+        if (stat(javadll, &s) == 0) {
+            goto found;
+        }
+
+        /* Does this app ship a private JRE in <apphome>\jre directory? */
+        sprintf(javadll, "%s\\jre\\bin\\" JAVA_DLL, path);
+        if (stat(javadll, &s) == 0) {
+            strcat(path, "\\jre");
+            goto found;
+        }
+    }
+
+#ifndef GAMMA
+    /* Look for a public JRE on this machine. */
+    if (GetPublicJREHome(path, pathsize)) {
+        goto found;
+    }
+#endif
+
+    fprintf(stderr, "Error: could not find " JAVA_DLL "\n");
+    return JNI_FALSE;
+
+ found:
+    if (_launcher_debug)
+      printf("JRE path is %s\n", path);
+    return JNI_TRUE;
+}
+
+/*
+ * Given a JRE location and a JVM type, construct what the name the
+ * JVM shared library will be.  Return true, if such a library
+ * exists, false otherwise.
+ */
+static jboolean
+GetJVMPath(const char *jrepath, const char *jvmtype,
+           char *jvmpath, jint jvmpathsize)
+{
+    struct stat s;
+
+#ifndef GAMMA
+    if (strchr(jvmtype, '/') || strchr(jvmtype, '\\')) {
+        sprintf(jvmpath, "%s\\" JVM_DLL, jvmtype);
+    } else {
+        sprintf(jvmpath, "%s\\bin\\%s\\" JVM_DLL, jrepath, jvmtype);
+    }
+#else
+    /*
+     * For gamma launcher, JVM is either built-in or in the same directory.
+     * Either way we return "<exe_path>/jvm.dll" where <exe_path> is the
+     * directory where gamma launcher is located.
+     */
+
+    char *p;
+    GetModuleFileName(0, jvmpath, jvmpathsize);
+
+    p = strrchr(jvmpath, '\\');
+    if (p) {
+       /* replace executable name with libjvm.so */
+       snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL);
+    } else {
+       /* this case shouldn't happen */
+       snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL);
+    }
+#endif /* ifndef GAMMA */
+
+    if (stat(jvmpath, &s) == 0) {
+        return JNI_TRUE;
+    } else {
+        return JNI_FALSE;
+    }
+}
+
+/*
+ * Load a jvm from "jvmpath" and initialize the invocation functions.
+ */
+jboolean
+LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
+{
+#ifdef GAMMA
+    /* JVM is directly linked with gamma launcher; no Loadlibrary() */
+    ifn->CreateJavaVM = JNI_CreateJavaVM;
+    ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
+    return JNI_TRUE;
+#else
+    HINSTANCE handle;
+
+    if (_launcher_debug) {
+        printf("JVM path is %s\n", jvmpath);
+    }
+
+    /* The Microsoft C Runtime Library needs to be loaded first. */
+    LoadMSVCRT();
+
+    /* Load the Java VM DLL */
+    if ((handle = LoadLibrary(jvmpath)) == 0) {
+        ReportErrorMessage2("Error loading: %s", (char *)jvmpath, JNI_TRUE);
+        return JNI_FALSE;
+    }
+
+    /* Now get the function addresses */
+    ifn->CreateJavaVM =
+        (void *)GetProcAddress(handle, "JNI_CreateJavaVM");
+    ifn->GetDefaultJavaVMInitArgs =
+        (void *)GetProcAddress(handle, "JNI_GetDefaultJavaVMInitArgs");
+    if (ifn->CreateJavaVM == 0 || ifn->GetDefaultJavaVMInitArgs == 0) {
+        ReportErrorMessage2("Error: can't find JNI interfaces in: %s",
+                            (char *)jvmpath, JNI_TRUE);
+        return JNI_FALSE;
+    }
+
+    return JNI_TRUE;
+#endif /* ifndef GAMMA */
+}
+
+/*
+ * If app is "c:\foo\bin\javac", then put "c:\foo" into buf.
+ */
+jboolean
+GetApplicationHome(char *buf, jint bufsize)
+{
+#ifndef GAMMA
+    char *cp;
+    GetModuleFileName(0, buf, bufsize);
+    *strrchr(buf, '\\') = '\0'; /* remove .exe file name */
+    if ((cp = strrchr(buf, '\\')) == 0) {
+        /* This happens if the application is in a drive root, and
+         * there is no bin directory. */
+        buf[0] = '\0';
+        return JNI_FALSE;
+    }
+    *cp = '\0';  /* remove the bin\ part */
+    return JNI_TRUE;
+
+#else /* ifndef GAMMA */
+
+    char env[MAXPATHLEN + 1];
+
+    /* gamma launcher uses ALT_JAVA_HOME environment variable or jdkpath.txt file to find JDK/JRE */
+
+    if (getenv("ALT_JAVA_HOME") != NULL) {
+       snprintf(buf, bufsize, "%s", getenv("ALT_JAVA_HOME"));
+    }
+    else {
+       char path[MAXPATHLEN + 1];
+       char* p;
+       int len;
+       FILE* fp;
+
+       // find the path to the currect executable
+       len = GetModuleFileName(NULL, path, MAXPATHLEN + 1);
+       if (len == 0 || len > MAXPATHLEN) {
+          printf("Could not get directory of current executable.");
+          return JNI_FALSE;
+       }
+       // remove last path component ("hotspot.exe")
+       p = strrchr(path, '\\');
+       if (p == NULL) {
+          printf("Could not parse directory of current executable.\n");
+          return JNI_FALSE;
+       }
+       *p = '\0';
+
+       // open jdkpath.txt and read JAVA_HOME from it
+       if (strlen(path) + strlen("\\jdkpath.txt") + 1 >= MAXPATHLEN) {
+          printf("Path too long: %s\n", path);
+          return JNI_FALSE;
+       }
+       strcat(path, "\\jdkpath.txt");
+       fp = fopen(path, "r");
+       if (fp == NULL) {
+          printf("Could not open file %s to get path to JDK.\n", path);
+          return JNI_FALSE;
+       }
+
+       if (fgets(buf, bufsize, fp) == NULL) {
+          printf("Could not read from file %s to get path to JDK.\n", path);
+          fclose(fp);
+          return JNI_FALSE;
+       }
+       // trim the buffer
+       p = buf + strlen(buf) - 1;
+       while(isspace(*p)) {
+          *p = '\0';
+          p--;
+       }
+       fclose(fp);
+    }
+
+    _snprintf(env, MAXPATHLEN, "JAVA_HOME=%s", buf);
+    _putenv(env);
+
+    return JNI_TRUE;
+#endif /* ifndef GAMMA */
+}
+
+#ifdef JAVAW
+__declspec(dllimport) char **__initenv;
+
+int WINAPI
+WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow)
+{
+    int   ret;
+
+    __initenv = _environ;
+    ret = main(__argc, __argv);
+
+    return ret;
+}
+#endif
+
+#ifndef GAMMA
+
+/*
+ * Helpers to look in the registry for a public JRE.
+ */
+                    /* Same for 1.5.0, 1.5.1, 1.5.2 etc. */
+#define DOTRELEASE  JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
+#define JRE_KEY     "Software\\JavaSoft\\Java Runtime Environment"
+
+static jboolean
+GetStringFromRegistry(HKEY key, const char *name, char *buf, jint bufsize)
+{
+    DWORD type, size;
+
+    if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0
+        && type == REG_SZ
+        && (size < (unsigned int)bufsize)) {
+        if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0) {
+            return JNI_TRUE;
+        }
+    }
+    return JNI_FALSE;
+}
+
+static jboolean
+GetPublicJREHome(char *buf, jint bufsize)
+{
+    HKEY key, subkey;
+    char version[MAXPATHLEN];
+
+    /*
+     * Note: There is a very similar implementation of the following
+     * registry reading code in the Windows java control panel (javacp.cpl).
+     * If there are bugs here, a similar bug probably exists there.  Hence,
+     * changes here require inspection there.
+     */
+
+    /* Find the current version of the JRE */
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY, 0, KEY_READ, &key) != 0) {
+        fprintf(stderr, "Error opening registry key '" JRE_KEY "'\n");
+        return JNI_FALSE;
+    }
+
+    if (!GetStringFromRegistry(key, "CurrentVersion",
+                               version, sizeof(version))) {
+        fprintf(stderr, "Failed reading value of registry key:\n\t"
+                JRE_KEY "\\CurrentVersion\n");
+        RegCloseKey(key);
+        return JNI_FALSE;
+    }
+
+    if (strcmp(version, DOTRELEASE) != 0) {
+        fprintf(stderr, "Registry key '" JRE_KEY "\\CurrentVersion'\nhas "
+                "value '%s', but '" DOTRELEASE "' is required.\n", version);
+        RegCloseKey(key);
+        return JNI_FALSE;
+    }
+
+    /* Find directory where the current version is installed. */
+    if (RegOpenKeyEx(key, version, 0, KEY_READ, &subkey) != 0) {
+        fprintf(stderr, "Error opening registry key '"
+                JRE_KEY "\\%s'\n", version);
+        RegCloseKey(key);
+        return JNI_FALSE;
+    }
+
+    if (!GetStringFromRegistry(subkey, "JavaHome", buf, bufsize)) {
+        fprintf(stderr, "Failed reading value of registry key:\n\t"
+                JRE_KEY "\\%s\\JavaHome\n", version);
+        RegCloseKey(key);
+        RegCloseKey(subkey);
+        return JNI_FALSE;
+    }
+
+    if (_launcher_debug) {
+        char micro[MAXPATHLEN];
+        if (!GetStringFromRegistry(subkey, "MicroVersion", micro,
+                                   sizeof(micro))) {
+            printf("Warning: Can't read MicroVersion\n");
+            micro[0] = '\0';
+        }
+        printf("Version major.minor.micro = %s.%s\n", version, micro);
+    }
+
+    RegCloseKey(key);
+    RegCloseKey(subkey);
+    return JNI_TRUE;
+}
+
+#endif /* ifndef GAMMA */
+
+/*
+ * Support for doing cheap, accurate interval timing.
+ */
+static jboolean counterAvailable = JNI_FALSE;
+static jboolean counterInitialized = JNI_FALSE;
+static LARGE_INTEGER counterFrequency;
+
+jlong CounterGet()
+{
+    LARGE_INTEGER count;
+
+    if (!counterInitialized) {
+        counterAvailable = QueryPerformanceFrequency(&counterFrequency);
+        counterInitialized = JNI_TRUE;
+    }
+    if (!counterAvailable) {
+        return 0;
+    }
+    QueryPerformanceCounter(&count);
+    return (jlong)(count.QuadPart);
+}
+
+jlong Counter2Micros(jlong counts)
+{
+    if (!counterAvailable || !counterInitialized) {
+        return 0;
+    }
+    return (counts * 1000 * 1000)/counterFrequency.QuadPart;
+}
+
+void ReportErrorMessage(char * message, jboolean always) {
+#ifdef JAVAW
+  if (message != NULL) {
+    MessageBox(NULL, message, "Java Virtual Machine Launcher",
+               (MB_OK|MB_ICONSTOP|MB_APPLMODAL));
+  }
+#else
+  if (always) {
+    fprintf(stderr, "%s\n", message);
+  }
+#endif
+}
+
+void ReportErrorMessage2(char * format, char * string, jboolean always) {
+  /*
+   * The format argument must be a printf format string with one %s
+   * argument, which is passed the string argument.
+   */
+#ifdef JAVAW
+  size_t size;
+  char * message;
+  size = strlen(format) + strlen(string);
+  message = (char*)JLI_MemAlloc(size*sizeof(char));
+  sprintf(message, (const char *)format, string);
+
+  if (message != NULL) {
+    MessageBox(NULL, message, "Java Virtual Machine Launcher",
+               (MB_OK|MB_ICONSTOP|MB_APPLMODAL));
+    JLI_MemFree(message);
+  }
+#else
+  if (always) {
+    fprintf(stderr, (const char *)format, string);
+    fprintf(stderr, "\n");
+  }
+#endif
+}
+
+/*
+ * As ReportErrorMessage2 (above) except the system message (if any)
+ * associated with this error is written to a second %s format specifier
+ * in the format argument.
+ */
+void ReportSysErrorMessage2(char * format, char * string, jboolean always) {
+  int   save_errno = errno;
+  DWORD errval;
+  int   freeit = 0;
+  char  *errtext = NULL;
+
+  if ((errval = GetLastError()) != 0) {         /* Platform SDK / DOS Error */
+    int n = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|
+      FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_ALLOCATE_BUFFER,
+      NULL, errval, 0, (LPTSTR)&errtext, 0, NULL);
+    if (errtext == NULL || n == 0) {            /* Paranoia check */
+      errtext = "";
+      n = 0;
+    } else {
+      freeit = 1;
+      if (n > 2) {                              /* Drop final CR, LF */
+        if (errtext[n - 1] == '\n') n--;
+        if (errtext[n - 1] == '\r') n--;
+        errtext[n] = '\0';
+      }
+    }
+  } else        /* C runtime error that has no corresponding DOS error code */
+    errtext = strerror(save_errno);
+
+#ifdef JAVAW
+  {
+    size_t size;
+    char * message;
+    size = strlen(format) + strlen(string) + strlen(errtext);
+    message = (char*)JLI_MemAlloc(size*sizeof(char));
+    sprintf(message, (const char *)format, string, errtext);
+
+    if (message != NULL) {
+      MessageBox(NULL, message, "Java Virtual Machine Launcher",
+               (MB_OK|MB_ICONSTOP|MB_APPLMODAL));
+      JLI_MemFree(message);
+    }
+  }
+#else
+  if (always) {
+    fprintf(stderr, (const char *)format, string, errtext);
+    fprintf(stderr, "\n");
+  }
+#endif
+  if (freeit)
+    (void)LocalFree((HLOCAL)errtext);
+}
+
+void  ReportExceptionDescription(JNIEnv * env) {
+#ifdef JAVAW
+  /*
+   * This code should be replaced by code which opens a window with
+   * the exception detail message.
+   */
+  (*env)->ExceptionDescribe(env);
+#else
+  (*env)->ExceptionDescribe(env);
+#endif
+}
+
+
+/*
+ * Return JNI_TRUE for an option string that has no effect but should
+ * _not_ be passed on to the vm; return JNI_FALSE otherwise. On
+ * windows, there are no options that should be screened in this
+ * manner.
+ */
+jboolean RemovableMachineDependentOption(char * option) {
+#ifdef ENABLE_AWT_PRELOAD
+    if (awtPreloadD3D < 0) {
+        /* Tests the command line parameter only if not set yet. */
+        if (GetBoolParamValue(PARAM_PRELOAD_D3D, option) == 1) {
+            awtPreloadD3D = 1;
+        }
+    }
+    if (awtPreloadD3D != 0) {
+        /* Don't test the command line parameters if already disabled. */
+        if (GetBoolParamValue(PARAM_NODDRAW, option) == 1
+            || GetBoolParamValue(PARAM_D3D, option) == 0
+            || GetBoolParamValue(PARAM_OPENGL, option) == 1)
+        {
+            awtPreloadD3D = 0;
+        }
+    }
+#endif /* ENABLE_AWT_PRELOAD */
+
+    return JNI_FALSE;
+}
+
+void PrintMachineDependentOptions() {
+  return;
+}
+
+#ifndef GAMMA
+
+jboolean
+ServerClassMachine() {
+  jboolean result = JNI_FALSE;
+#if   defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE)
+  result = JNI_FALSE;
+#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE)
+  result = JNI_TRUE;
+#endif
+  return result;
+}
+
+/*
+ * Determine if there is an acceptable JRE in the registry directory top_key.
+ * Upon locating the "best" one, return a fully qualified path to it.
+ * "Best" is defined as the most advanced JRE meeting the constraints
+ * contained in the manifest_info. If no JRE in this directory meets the
+ * constraints, return NULL.
+ *
+ * It doesn't matter if we get an error reading the registry, or we just
+ * don't find anything interesting in the directory.  We just return NULL
+ * in either case.
+ */
+static char *
+ProcessDir(manifest_info* info, HKEY top_key) {
+    DWORD   index = 0;
+    HKEY    ver_key;
+    char    name[MAXNAMELEN];
+    int     len;
+    char    *best = NULL;
+
+    /*
+     * Enumerate "<top_key>/SOFTWARE/JavaSoft/Java Runtime Environment"
+     * searching for the best available version.
+     */
+    while (RegEnumKey(top_key, index, name, MAXNAMELEN) == ERROR_SUCCESS) {
+        index++;
+        if (JLI_AcceptableRelease(name, info->jre_version))
+            if ((best == NULL) || (JLI_ExactVersionId(name, best) > 0)) {
+                if (best != NULL)
+                    JLI_MemFree(best);
+                best = JLI_StringDup(name);
+            }
+    }
+
+    /*
+     * Extract "JavaHome" from the "best" registry directory and return
+     * that path.  If no appropriate version was located, or there is an
+     * error in extracting the "JavaHome" string, return null.
+     */
+    if (best == NULL)
+        return (NULL);
+    else {
+        if (RegOpenKeyEx(top_key, best, 0, KEY_READ, &ver_key)
+          != ERROR_SUCCESS) {
+            JLI_MemFree(best);
+            if (ver_key != NULL)
+                RegCloseKey(ver_key);
+            return (NULL);
+        }
+        JLI_MemFree(best);
+        len = MAXNAMELEN;
+        if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name, &len)
+          != ERROR_SUCCESS) {
+            if (ver_key != NULL)
+                RegCloseKey(ver_key);
+            return (NULL);
+        }
+        if (ver_key != NULL)
+            RegCloseKey(ver_key);
+        return (JLI_StringDup(name));
+    }
+}
+
+/*
+ * This is the global entry point. It examines the host for the optimal
+ * JRE to be used by scanning a set of registry entries.  This set of entries
+ * is hardwired on Windows as "Software\JavaSoft\Java Runtime Environment"
+ * under the set of roots "{ HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }".
+ *
+ * This routine simply opens each of these registry directories before passing
+ * control onto ProcessDir().
+ */
+char *
+LocateJRE(manifest_info* info) {
+    HKEY    key = NULL;
+    char    *path;
+    int     key_index;
+    HKEY    root_keys[2] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE };
+
+    for (key_index = 0; key_index <= 1; key_index++) {
+        if (RegOpenKeyEx(root_keys[key_index], JRE_KEY, 0, KEY_READ, &key)
+          == ERROR_SUCCESS)
+            if ((path = ProcessDir(info, key)) != NULL) {
+                if (key != NULL)
+                    RegCloseKey(key);
+                return (path);
+            }
+        if (key != NULL)
+            RegCloseKey(key);
+    }
+    return NULL;
+}
+
+
+/*
+ * Local helper routine to isolate a single token (option or argument)
+ * from the command line.
+ *
+ * This routine accepts a pointer to a character pointer.  The first
+ * token (as defined by MSDN command-line argument syntax) is isolated
+ * from that string.
+ *
+ * Upon return, the input character pointer pointed to by the parameter s
+ * is updated to point to the remainding, unscanned, portion of the string,
+ * or to a null character if the entire string has been consummed.
+ *
+ * This function returns a pointer to a null-terminated string which
+ * contains the isolated first token, or to the null character if no
+ * token could be isolated.
+ *
+ * Note the side effect of modifying the input string s by the insertion
+ * of a null character, making it two strings.
+ *
+ * See "Parsing C Command-Line Arguments" in the MSDN Library for the
+ * parsing rule details.  The rule summary from that specification is:
+ *
+ *  * Arguments are delimited by white space, which is either a space or a tab.
+ *
+ *  * A string surrounded by double quotation marks is interpreted as a single
+ *    argument, regardless of white space contained within. A quoted string can
+ *    be embedded in an argument. Note that the caret (^) is not recognized as
+ *    an escape character or delimiter.
+ *
+ *  * A double quotation mark preceded by a backslash, \", is interpreted as a
+ *    literal double quotation mark (").
+ *
+ *  * Backslashes are interpreted literally, unless they immediately precede a
+ *    double quotation mark.
+ *
+ *  * If an even number of backslashes is followed by a double quotation mark,
+ *    then one backslash (\) is placed in the argv array for every pair of
+ *    backslashes (\\), and the double quotation mark (") is interpreted as a
+ *    string delimiter.
+ *
+ *  * If an odd number of backslashes is followed by a double quotation mark,
+ *    then one backslash (\) is placed in the argv array for every pair of
+ *    backslashes (\\) and the double quotation mark is interpreted as an
+ *    escape sequence by the remaining backslash, causing a literal double
+ *    quotation mark (") to be placed in argv.
+ */
+static char*
+nextarg(char** s) {
+    char    *p = *s;
+    char    *head;
+    int     slashes = 0;
+    int     inquote = 0;
+
+    /*
+     * Strip leading whitespace, which MSDN defines as only space or tab.
+     * (Hence, no locale specific "isspace" here.)
+     */
+    while (*p != (char)0 && (*p == ' ' || *p == '\t'))
+        p++;
+    head = p;                   /* Save the start of the token to return */
+
+    /*
+     * Isolate a token from the command line.
+     */
+    while (*p != (char)0 && (inquote || !(*p == ' ' || *p == '\t'))) {
+        if (*p == '\\' && *(p+1) == '"' && slashes % 2 == 0)
+            p++;
+        else if (*p == '"')
+            inquote = !inquote;
+        slashes = (*p++ == '\\') ? slashes + 1 : 0;
+    }
+
+    /*
+     * If the token isolated isn't already terminated in a "char zero",
+     * then replace the whitespace character with one and move to the
+     * next character.
+     */
+    if (*p != (char)0)
+        *p++ = (char)0;
+
+    /*
+     * Update the parameter to point to the head of the remaining string
+     * reflecting the command line and return a pointer to the leading
+     * token which was isolated from the command line.
+     */
+    *s = p;
+    return (head);
+}
+
+/*
+ * Local helper routine to return a string equivalent to the input string
+ * s, but with quotes removed so the result is a string as would be found
+ * in argv[].  The returned string should be freed by a call to JLI_MemFree().
+ *
+ * The rules for quoting (and escaped quotes) are:
+ *
+ *  1 A double quotation mark preceded by a backslash, \", is interpreted as a
+ *    literal double quotation mark (").
+ *
+ *  2 Backslashes are interpreted literally, unless they immediately precede a
+ *    double quotation mark.
+ *
+ *  3 If an even number of backslashes is followed by a double quotation mark,
+ *    then one backslash (\) is placed in the argv array for every pair of
+ *    backslashes (\\), and the double quotation mark (") is interpreted as a
+ *    string delimiter.
+ *
+ *  4 If an odd number of backslashes is followed by a double quotation mark,
+ *    then one backslash (\) is placed in the argv array for every pair of
+ *    backslashes (\\) and the double quotation mark is interpreted as an
+ *    escape sequence by the remaining backslash, causing a literal double
+ *    quotation mark (") to be placed in argv.
+ */
+static char*
+unquote(const char *s) {
+    const char *p = s;          /* Pointer to the tail of the original string */
+    char *un = (char*)JLI_MemAlloc(strlen(s) + 1);  /* Ptr to unquoted string */
+    char *pun = un;             /* Pointer to the tail of the unquoted string */
+
+    while (*p != '\0') {
+        if (*p == '"') {
+            p++;
+        } else if (*p == '\\') {
+            const char *q = p + strspn(p,"\\");
+            if (*q == '"')
+                do {
+                    *pun++ = '\\';
+                    p += 2;
+                 } while (*p == '\\' && p < q);
+            else
+                while (p < q)
+                    *pun++ = *p++;
+        } else {
+            *pun++ = *p++;
+        }
+    }
+    *pun = '\0';
+    return un;
+}
+
+/*
+ * Given a path to a jre to execute, this routine checks if this process
+ * is indeed that jre.  If not, it exec's that jre.
+ *
+ * We want to actually check the paths rather than just the version string
+ * built into the executable, so that given version specification will yield
+ * the exact same Java environment, regardless of the version of the arbitrary
+ * launcher we start with.
+ */
+void
+ExecJRE(char *jre, char **argv) {
+    int     len;
+    char    *progname;
+    char    path[MAXPATHLEN + 1];
+
+    /*
+     * Determine the executable we are building (or in the rare case, running).
+     */
+#ifdef JAVA_ARGS  /* javac, jar and friends. */
+    progname = "java";
+#else             /* java, oldjava, javaw and friends */
+#ifdef PROGNAME
+    progname = PROGNAME;
+#else
+    {
+        char *s;
+        progname = *argv;
+        if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
+            progname = s + 1;
+        }
+    }
+#endif /* PROGNAME */
+#endif /* JAVA_ARGS */
+
+    /*
+     * Resolve the real path to the currently running launcher.
+     */
+    len = GetModuleFileName(NULL, path, MAXPATHLEN + 1);
+    if (len == 0 || len > MAXPATHLEN) {
+        ReportSysErrorMessage2(
+          "Unable to resolve path to current %s executable: %s",
+          progname, JNI_TRUE);
+        exit(1);
+    }
+
+    if (_launcher_debug) {
+        printf("ExecJRE: old: %s\n", path);
+        printf("ExecJRE: new: %s\n", jre);
+    }
+
+    /*
+     * If the path to the selected JRE directory is a match to the initial
+     * portion of the path to the currently executing JRE, we have a winner!
+     * If so, just return. (strnicmp() is the Windows equiv. of strncasecmp().)
+     */
+    if (strnicmp(jre, path, strlen(jre)) == 0)
+        return;                 /* I am the droid you were looking for */
+
+    /*
+     * If this isn't the selected version, exec the selected version.
+     */
+    (void)strcat(strcat(strcpy(path, jre), "\\bin\\"), progname);
+    (void)strcat(path, ".exe");
+
+    /*
+     * Although Windows has an execv() entrypoint, it doesn't actually
+     * overlay a process: it can only create a new process and terminate
+     * the old process.  Therefore, any processes waiting on the initial
+     * process wake up and they shouldn't.  Hence, a chain of pseudo-zombie
+     * processes must be retained to maintain the proper wait semantics.
+     * Fortunately the image size of the launcher isn't too large at this
+     * time.
+     *
+     * If it weren't for this semantic flaw, the code below would be ...
+     *
+     *     execv(path, argv);
+     *     ReportErrorMessage2("Exec of %s failed\n", path, JNI_TRUE);
+     *     exit(1);
+     *
+     * The incorrect exec semantics could be addressed by:
+     *
+     *     exit((int)spawnv(_P_WAIT, path, argv));
+     *
+     * Unfortunately, a bug in Windows spawn/exec impementation prevents
+     * this from completely working.  All the Windows POSIX process creation
+     * interfaces are implemented as wrappers around the native Windows
+     * function CreateProcess().  CreateProcess() takes a single string
+     * to specify command line options and arguments, so the POSIX routine
+     * wrappers build a single string from the argv[] array and in the
+     * process, any quoting information is lost.
+     *
+     * The solution to this to get the original command line, to process it
+     * to remove the new multiple JRE options (if any) as was done for argv
+     * in the common SelectVersion() routine and finally to pass it directly
+     * to the native CreateProcess() Windows process control interface.
+     */
+    {
+        char    *cmdline;
+        char    *p;
+        char    *np;
+        char    *ocl;
+        char    *ccl;
+        char    *unquoted;
+        DWORD   exitCode;
+        STARTUPINFO si;
+        PROCESS_INFORMATION pi;
+
+        /*
+         * The following code block gets and processes the original command
+         * line, replacing the argv[0] equivalent in the command line with
+         * the path to the new executable and removing the appropriate
+         * Multiple JRE support options. Note that similar logic exists
+         * in the platform independent SelectVersion routine, but is
+         * replicated here due to the syntax of CreateProcess().
+         *
+         * The magic "+ 4" characters added to the command line length are
+         * 2 possible quotes around the path (argv[0]), a space after the
+         * path and a terminating null character.
+         */
+        ocl = GetCommandLine();
+        np = ccl = JLI_StringDup(ocl);
+        p = nextarg(&np);               /* Discard argv[0] */
+        cmdline = (char *)JLI_MemAlloc(strlen(path) + strlen(np) + 4);
+        if (strchr(path, (int)' ') == NULL && strchr(path, (int)'\t') == NULL)
+            cmdline = strcpy(cmdline, path);
+        else
+            cmdline = strcat(strcat(strcpy(cmdline, "\""), path), "\"");
+
+        while (*np != (char)0) {                /* While more command-line */
+            p = nextarg(&np);
+            if (*p != (char)0) {                /* If a token was isolated */
+                unquoted = unquote(p);
+                if (*unquoted == '-') {         /* Looks like an option */
+                    if (strcmp(unquoted, "-classpath") == 0 ||
+                      strcmp(unquoted, "-cp") == 0) {   /* Unique cp syntax */
+                        cmdline = strcat(strcat(cmdline, " "), p);
+                        p = nextarg(&np);
+                        if (*p != (char)0)      /* If a token was isolated */
+                            cmdline = strcat(strcat(cmdline, " "), p);
+                    } else if (strncmp(unquoted, "-version:", 9) != 0 &&
+                      strcmp(unquoted, "-jre-restrict-search") != 0 &&
+                      strcmp(unquoted, "-no-jre-restrict-search") != 0) {
+                        cmdline = strcat(strcat(cmdline, " "), p);
+                    }
+                } else {                        /* End of options */
+                    cmdline = strcat(strcat(cmdline, " "), p);
+                    cmdline = strcat(strcat(cmdline, " "), np);
+                    JLI_MemFree((void *)unquoted);
+                    break;
+                }
+                JLI_MemFree((void *)unquoted);
+            }
+        }
+        JLI_MemFree((void *)ccl);
+
+        if (_launcher_debug) {
+            np = ccl = JLI_StringDup(cmdline);
+            p = nextarg(&np);
+            printf("ReExec Command: %s (%s)\n", path, p);
+            printf("ReExec Args: %s\n", np);
+            JLI_MemFree((void *)ccl);
+        }
+        (void)fflush(stdout);
+        (void)fflush(stderr);
+
+        /*
+         * The following code is modeled after a model presented in the
+         * Microsoft Technical Article "Moving Unix Applications to
+         * Windows NT" (March 6, 1994) and "Creating Processes" on MSDN
+         * (Februrary 2005).  It approximates UNIX spawn semantics with
+         * the parent waiting for termination of the child.
+         */
+        memset(&si, 0, sizeof(si));
+        si.cb =sizeof(STARTUPINFO);
+        memset(&pi, 0, sizeof(pi));
+
+        if (!CreateProcess((LPCTSTR)path,       /* executable name */
+          (LPTSTR)cmdline,                      /* command line */
+          (LPSECURITY_ATTRIBUTES)NULL,          /* process security attr. */
+          (LPSECURITY_ATTRIBUTES)NULL,          /* thread security attr. */
+          (BOOL)TRUE,                           /* inherits system handles */
+          (DWORD)0,                             /* creation flags */
+          (LPVOID)NULL,                         /* environment block */
+          (LPCTSTR)NULL,                        /* current directory */
+          (LPSTARTUPINFO)&si,                   /* (in) startup information */
+          (LPPROCESS_INFORMATION)&pi)) {        /* (out) process information */
+            ReportSysErrorMessage2("CreateProcess(%s, ...) failed: %s",
+              path, JNI_TRUE);
+              exit(1);
+        }
+
+        if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) {
+            if (GetExitCodeProcess(pi.hProcess, &exitCode) == FALSE)
+                exitCode = 1;
+        } else {
+            ReportErrorMessage("WaitForSingleObject() failed.", JNI_TRUE);
+            exitCode = 1;
+        }
+
+        CloseHandle(pi.hThread);
+        CloseHandle(pi.hProcess);
+
+        exit(exitCode);
+    }
+
+}
+
+#endif /* ifndef GAMMA */
+
+
+/*
+ * Wrapper for platform dependent unsetenv function.
+ */
+int
+UnsetEnv(char *name)
+{
+    int ret;
+    char *buf = JLI_MemAlloc(strlen(name) + 2);
+    buf = strcat(strcpy(buf, name), "=");
+    ret = _putenv(buf);
+    JLI_MemFree(buf);
+    return (ret);
+}
+
+/* --- Splash Screen shared library support --- */
+
+static const char* SPLASHSCREEN_SO = "\\bin\\splashscreen.dll";
+
+static HMODULE hSplashLib = NULL;
+
+void* SplashProcAddress(const char* name) {
+    char libraryPath[MAXPATHLEN]; /* some extra space for strcat'ing SPLASHSCREEN_SO */
+
+    if (!GetJREPath(libraryPath, MAXPATHLEN)) {
+        return NULL;
+    }
+    if (strlen(libraryPath)+strlen(SPLASHSCREEN_SO) >= MAXPATHLEN) {
+        return NULL;
+    }
+    strcat(libraryPath, SPLASHSCREEN_SO);
+
+    if (!hSplashLib) {
+        hSplashLib = LoadLibrary(libraryPath);
+    }
+    if (hSplashLib) {
+        return GetProcAddress(hSplashLib, name);
+    } else {
+        return NULL;
+    }
+}
+
+void SplashFreeLibrary() {
+    if (hSplashLib) {
+        FreeLibrary(hSplashLib);
+        hSplashLib = NULL;
+    }
+}
+
+const char *
+jlong_format_specifier() {
+    return "%I64d";
+}
+
+/*
+ * Block current thread and continue execution in a new thread
+ */
+int
+ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) {
+    int rslt = 0;
+    unsigned thread_id;
+
+#ifndef STACK_SIZE_PARAM_IS_A_RESERVATION
+#define STACK_SIZE_PARAM_IS_A_RESERVATION  (0x10000)
+#endif
+
+    /*
+     * STACK_SIZE_PARAM_IS_A_RESERVATION is what we want, but it's not
+     * supported on older version of Windows. Try first with the flag; and
+     * if that fails try again without the flag. See MSDN document or HotSpot
+     * source (os_win32.cpp) for details.
+     */
+    HANDLE thread_handle =
+      (HANDLE)_beginthreadex(NULL,
+                             (unsigned)stack_size,
+                             continuation,
+                             args,
+                             STACK_SIZE_PARAM_IS_A_RESERVATION,
+                             &thread_id);
+    if (thread_handle == NULL) {
+      thread_handle =
+      (HANDLE)_beginthreadex(NULL,
+                             (unsigned)stack_size,
+                             continuation,
+                             args,
+                             0,
+                             &thread_id);
+    }
+
+    /* AWT preloading (AFTER main thread start) */
+#ifdef ENABLE_AWT_PRELOAD
+    /* D3D preloading */
+    if (awtPreloadD3D != 0) {
+        char *envValue;
+        /* D3D routines checks env.var J2D_D3D if no appropriate
+         * command line params was specified
+         */
+        envValue = getenv("J2D_D3D");
+        if (envValue != NULL && stricmp(envValue, "false") == 0) {
+            awtPreloadD3D = 0;
+        }
+        /* Test that AWT preloading isn't disabled by J2D_D3D_PRELOAD env.var */
+        envValue = getenv("J2D_D3D_PRELOAD");
+        if (envValue != NULL && stricmp(envValue, "false") == 0) {
+            awtPreloadD3D = 0;
+        }
+        if (awtPreloadD3D < 0) {
+            /* If awtPreloadD3D is still undefined (-1), test
+             * if it is turned on by J2D_D3D_PRELOAD env.var.
+             * By default it's turned OFF.
+             */
+            awtPreloadD3D = 0;
+            if (envValue != NULL && stricmp(envValue, "true") == 0) {
+                awtPreloadD3D = 1;
+            }
+        }
+    }
+    if (awtPreloadD3D) {
+        AWTPreload(D3D_PRELOAD_FUNC);
+    }
+#endif /* ENABLE_AWT_PRELOAD */
+
+    if (thread_handle) {
+      WaitForSingleObject(thread_handle, INFINITE);
+      GetExitCodeThread(thread_handle, &rslt);
+      CloseHandle(thread_handle);
+    } else {
+      rslt = continuation(args);
+    }
+
+#ifdef ENABLE_AWT_PRELOAD
+    if (awtPreloaded) {
+        AWTPreloadStop();
+    }
+#endif /* ENABLE_AWT_PRELOAD */
+
+    return rslt;
+}
+
+/* Linux only, empty on windows. */
+void SetJavaLauncherPlatformProps() {}
+
+
+//==============================
+// AWT preloading
+#ifdef ENABLE_AWT_PRELOAD
+
+typedef int FnPreloadStart(void);
+typedef void FnPreloadStop(void);
+static FnPreloadStop *fnPreloadStop = NULL;
+static HMODULE hPreloadAwt = NULL;
+
+/*
+ * Starts AWT preloading
+ */
+int AWTPreload(const char *funcName)
+{
+    int result = -1;
+
+    // load AWT library once (if several preload function should be called)
+    if (hPreloadAwt == NULL) {
+        // awt.dll is not loaded yet
+        char libraryPath[MAXPATHLEN];
+        int jrePathLen = 0;
+        HMODULE hJava = NULL;
+        HMODULE hVerify = NULL;
+
+        while (1) {
+            // awt.dll depends on jvm.dll & java.dll;
+            // jvm.dll is already loaded, so we need only java.dll;
+            // java.dll depends on MSVCRT lib & verify.dll.
+            if (!GetJREPath(libraryPath, MAXPATHLEN)) {
+                break;
+            }
+
+            // save path length
+            jrePathLen = strlen(libraryPath);
+
+            // load msvcrt 1st
+            LoadMSVCRT();
+
+            // load verify.dll
+            strcat(libraryPath, "\\bin\\verify.dll");
+            hVerify = LoadLibrary(libraryPath);
+            if (hVerify == NULL) {
+                break;
+            }
+
+            // restore jrePath
+            libraryPath[jrePathLen] = 0;
+            // load java.dll
+            strcat(libraryPath, "\\bin\\" JAVA_DLL);
+            hJava = LoadLibrary(libraryPath);
+            if (hJava == NULL) {
+                break;
+            }
+
+            // restore jrePath
+            libraryPath[jrePathLen] = 0;
+            // load awt.dll
+            strcat(libraryPath, "\\bin\\awt.dll");
+            hPreloadAwt = LoadLibrary(libraryPath);
+            if (hPreloadAwt == NULL) {
+                break;
+            }
+
+            // get "preloadStop" func ptr
+            fnPreloadStop = (FnPreloadStop *)GetProcAddress(hPreloadAwt, "preloadStop");
+
+            break;
+        }
+    }
+
+    if (hPreloadAwt != NULL) {
+        FnPreloadStart *fnInit = (FnPreloadStart *)GetProcAddress(hPreloadAwt, funcName);
+        if (fnInit != NULL) {
+            // don't forget to stop preloading
+            awtPreloaded = 1;
+
+            result = fnInit();
+        }
+    }
+
+    return result;
+}
+
+/*
+ * Terminates AWT preloading
+ */
+void AWTPreloadStop() {
+    if (fnPreloadStop != NULL) {
+        fnPreloadStop();
+    }
+}
+
+#endif /* ENABLE_AWT_PRELOAD */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/windows/launcher/java_md.h	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef JAVA_MD_H
+#define JAVA_MD_H
+
+#include <jni.h>
+#include <windows.h>
+#include <io.h>
+#ifndef GAMMA
+#include "manifest_info.h"
+#endif
+#include "jli_util.h"
+
+#ifdef GAMMA
+#define stricmp _stricmp
+#define strnicmp _strnicmp
+#define snprintf _snprintf
+#define strdup _strdup
+#endif
+
+#define PATH_SEPARATOR  ';'
+#define FILESEP         "\\"
+#define FILE_SEPARATOR  '\\'
+#define IS_FILE_SEPARATOR(c) ((c) == '\\' || (c) == '/')
+#define MAXPATHLEN      MAX_PATH
+#define MAXNAMELEN      MAX_PATH
+
+#ifdef JAVA_ARGS
+/*
+ * ApplicationHome is prepended to each of these entries; the resulting
+ * strings are concatenated (separated by PATH_SEPARATOR) and used as the
+ * value of -cp option to the launcher.
+ */
+#ifndef APP_CLASSPATH
+#define APP_CLASSPATH        { "\\lib\\tools.jar", "\\classes" }
+#endif
+#endif
+
+/*
+ * Support for doing cheap, accurate interval timing.
+ */
+extern jlong CounterGet(void);
+extern jlong Counter2Micros(jlong counts);
+
+#ifdef JAVAW
+#define main _main
+extern int _main(int argc, char **argv);
+#endif
+
+/*
+ * Function prototypes.
+ */
+#ifndef GAMMA
+char *LocateJRE(manifest_info *info);
+void ExecJRE(char *jre, char **argv);
+#endif
+int UnsetEnv(char *name);
+
+#endif
--- a/src/os/windows/vm/attachListener_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/attachListener_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_attachListener_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/os.hpp"
+#include "services/attachListener.hpp"
+#include "services/dtraceAttacher.hpp"
 
 #include <windows.h>
 #include <signal.h>             // SIGBREAK
--- a/src/os/windows/vm/c1_globals_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/c1_globals_windows.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP
+#define OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 //
 // Sets the default values for operating system dependent flags used by the
 // client compiler. (see c1_globals.hpp)
 //
+
+#endif // OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP
--- a/src/os/windows/vm/c2_globals_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/c2_globals_windows.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP
+#define OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
 //
 // Sets the default values for operating system dependent flags used by the
 // server compiler. (see c2_globals.hpp)
 //
+
+#endif // OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP
--- a/src/os/windows/vm/chaitin_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/chaitin_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_chaitin_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/machnode.hpp"
 
 // Disallow the use of the frame pointer (EBP) for implicit null exceptions
 // on win95/98.  If we do not do this, the OS gets confused and gives a stack
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/windows/vm/decoder_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "utilities/decoder.hpp"
+
+HMODULE                   Decoder::_dbghelp_handle = NULL;
+bool                      Decoder::_can_decode_in_vm = false;
+pfn_SymGetSymFromAddr64   Decoder::_pfnSymGetSymFromAddr64 = NULL;
+pfn_UndecorateSymbolName  Decoder::_pfnUndecorateSymbolName = NULL;
+
+void Decoder::initialize() {
+  if (!_initialized) {
+    _initialized = true;
+
+    HMODULE handle = ::LoadLibrary("dbghelp.dll");
+    if (!handle) {
+      _decoder_status = helper_not_found;
+        return;
+    }
+
+    _dbghelp_handle = handle;
+
+    pfn_SymSetOptions _pfnSymSetOptions = (pfn_SymSetOptions)::GetProcAddress(handle, "SymSetOptions");
+    pfn_SymInitialize _pfnSymInitialize = (pfn_SymInitialize)::GetProcAddress(handle, "SymInitialize");
+    _pfnSymGetSymFromAddr64 = (pfn_SymGetSymFromAddr64)::GetProcAddress(handle, "SymGetSymFromAddr64");
+    _pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)GetProcAddress(handle, "UnDecorateSymbolName");
+
+    if (_pfnSymSetOptions == NULL || _pfnSymInitialize == NULL || _pfnSymGetSymFromAddr64 == NULL) {
+      _pfnSymGetSymFromAddr64 = NULL;
+      _pfnUndecorateSymbolName = NULL;
+      ::FreeLibrary(handle);
+      _dbghelp_handle = NULL;
+      _decoder_status = helper_func_error;
+      return;
+    }
+
+    _pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS);
+    if (!_pfnSymInitialize(GetCurrentProcess(), NULL, TRUE)) {
+      _pfnSymGetSymFromAddr64 = NULL;
+      _pfnUndecorateSymbolName = NULL;
+      ::FreeLibrary(handle);
+      _dbghelp_handle = NULL;
+      _decoder_status = helper_init_error;
+      return;
+    }
+
+     // find out if jvm.dll contains private symbols, by decoding
+     // current function and comparing the result
+     address addr = (address)Decoder::initialize;
+     char buf[MAX_PATH];
+     if (decode(addr, buf, sizeof(buf), NULL) == no_error) {
+       _can_decode_in_vm = !strcmp(buf, "Decoder::initialize");
+     }
+  }
+}
+
+void Decoder::uninitialize() {
+  assert(_initialized, "Decoder not yet initialized");
+  _pfnSymGetSymFromAddr64 = NULL;
+  _pfnUndecorateSymbolName = NULL;
+  if (_dbghelp_handle != NULL) {
+    ::FreeLibrary(_dbghelp_handle);
+  }
+  _initialized = false;
+}
+
+bool Decoder::can_decode_C_frame_in_vm() {
+  initialize();
+  return  _can_decode_in_vm;
+}
+
+
+Decoder::decoder_status Decoder::decode(address addr, char *buf, int buflen, int *offset) {
+  assert(_initialized, "Decoder not yet initialized");
+  if (_pfnSymGetSymFromAddr64 != NULL) {
+    PIMAGEHLP_SYMBOL64 pSymbol;
+    char symbolInfo[MAX_PATH + sizeof(IMAGEHLP_SYMBOL64)];
+    pSymbol = (PIMAGEHLP_SYMBOL64)symbolInfo;
+    pSymbol->MaxNameLength = MAX_PATH;
+    pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
+    DWORD64 displacement;
+    if (_pfnSymGetSymFromAddr64(::GetCurrentProcess(), (DWORD64)addr, &displacement, pSymbol)) {
+      if (buf != NULL) {
+        if (!demangle(pSymbol->Name, buf, buflen)) {
+          jio_snprintf(buf, buflen, "%s", pSymbol->Name);
+        }
+      }
+      if (offset != NULL) *offset = (int)displacement;
+      return no_error;
+    }
+  }
+  return helper_not_found;
+}
+
+bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
+  assert(_initialized, "Decoder not yet initialized");
+  return _pfnUndecorateSymbolName != NULL &&
+         _pfnUndecorateSymbolName(symbol, buf, buflen, UNDNAME_COMPLETE);
+}
+
--- a/src/os/windows/vm/dtraceJSDT_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/dtraceJSDT_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_dtraceJSDT_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 int DTraceJSDT::pd_activate(
     void* baseAddress, jstring module,
--- a/src/os/windows/vm/globals_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/globals_windows.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP
+#define OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP
+
 //
 // Defines Windows specific flags. They are not available on other platforms.
 //
@@ -40,3 +43,5 @@
 define_pd_global(bool, UseLargePagesIndividualAllocation, true);
 define_pd_global(bool, UseOSErrorReporting, false);  // for now.
 define_pd_global(bool, UseThreadPriorities, true) ;
+
+#endif // OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP
--- a/src/os/windows/vm/hpi_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-# include "incls/_precompiled.incl"
-# include "incls/_hpi_windows.cpp.incl"
-
-typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
-
-void hpi::initialize_get_interface(vm_calls_t *callbacks)
-{
-  // Build name of HPI.
-  char lib_name[JVM_MAXPATHLEN];
-
-  if (HPILibPath && HPILibPath[0]) {
-    strncpy(lib_name, HPILibPath, JVM_MAXPATHLEN - 1);
-    lib_name[JVM_MAXPATHLEN - 1] = '\0';
-  } else {
-    os::jvm_path(lib_name, sizeof lib_name);
-
-#ifdef PRODUCT
-    const char *hpi_lib = "\\hpi.dll";
-#else
-    char *ptr = strrchr(lib_name, '\\');
-    //  On Win98 GetModuleFileName() returns the path in the upper case.
-    assert(_strnicmp(ptr, "\\jvm",4) == 0, "invalid library name");
-    const char *hpi_lib = (_strnicmp(ptr, "\\jvm_g",6) == 0) ? "\\hpi_g.dll" : "\\hpi.dll";
-#endif
-
-    *(::strrchr(lib_name, '\\')) = '\0';  /* get rid of "\\jvm.dll" */
-    char *p = ::strrchr(lib_name, '\\');
-    if (p != NULL) *p = '\0';             /* get rid of "\\hotspot" */
-    strcat(lib_name, hpi_lib);
-  }
-
-  // Load it.
-  if (TraceHPI) tty->print_cr("Loading HPI %s ", lib_name);
-  HINSTANCE lib_handle = LoadLibrary(lib_name);
-  if (lib_handle == NULL) {
-    if (TraceHPI) tty->print_cr("LoadLibrary failed, code = %d", GetLastError());
-    return;
-  }
-
-  // Find hpi initializer.
-  init_t initer = (init_t)GetProcAddress(lib_handle, "DLL_Initialize");
-  if (initer == NULL) {
-    if (TraceHPI) tty->print_cr("GetProcAddress failed, errcode = %d", GetLastError());
-    return;
-  }
-
-  // Call initializer.
-  jint init_result = (*initer)(&_get_interface, callbacks);
-  if (init_result < 0) {
-    if (TraceHPI) tty->print_cr("DLL_Initialize failed, returned %ld", init_result);
-    return;
-  }
-
-  if (TraceHPI) tty->print_cr("success");
-  return;
-}
--- a/src/os/windows/vm/hpi_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-// Win32 delegates these to the HPI.  Solaris provides its own
-// implementation without using the HPI (for Interrupitble I/O).
-
-// HPI_FileInterface
-
-HPIDECL(close, "close", _file, Close, int, "%d",
-        (int fd),
-        ("fd = %d", fd),
-        (fd));
-
-HPIDECL(read, "read", _file, Read, size_t, "%ld",
-        (int fd, void *buf, unsigned int nBytes),
-        ("fd = %d, buf = %p, nBytes = %u", fd, buf, nBytes),
-        (fd, buf, nBytes));
-
-HPIDECL(write, "write", _file, Write, size_t, "%ld",
-        (int fd, const void *buf, unsigned int nBytes),
-        ("fd = %d, buf = %p, nBytes = %u", fd, buf, nBytes),
-        (fd, buf, nBytes));
-
-
-// HPI_SocketInterface
-
-HPIDECL(socket_close, "socket_close", _socket, Close, int, "%d",
-        (int fd),
-        ("fd = %d", fd),
-        (fd));
-
-HPIDECL(socket_available, "socket_available", _socket, Available,
-        int, "%d",
-        (int fd, jint *pbytes),
-        ("fd = %d, pbytes = %p", fd, pbytes),
-        (fd, pbytes));
-
-HPIDECL(socket, "socket", _socket, Socket, int, "%d",
-        (int domain, int type, int protocol),
-        ("domain = %d, type = %d, protocol = %d", domain, type, protocol),
-        (domain, type, protocol));
-
-HPIDECL(listen, "listen", _socket, Listen, int, "%d",
-        (int fd, int count),
-        ("fd = %d, count = %d", fd, count),
-        (fd, count));
-
-HPIDECL(connect, "connect", _socket, Connect, int, "%d",
-        (int fd, struct sockaddr *him, int len),
-        ("fd = %d, him = %p, len = %d", fd, him, len),
-        (fd, him, len));
-
-HPIDECL(accept, "accept", _socket, Accept, int, "%d",
-        (int fd, struct sockaddr *him, int *len),
-        ("fd = %d, him = %p, len = %p", fd, him, len),
-        (fd, him, len));
-
-HPIDECL(sendto, "sendto", _socket, SendTo, int, "%d",
-        (int fd, char *buf, int len, int flags,
-         struct sockaddr *to, int tolen),
-        ("fd = %d, buf = %p, len = %d, flags = %d, to = %p, tolen = %d",
-         fd, buf, len, flags, to, tolen),
-        (fd, buf, len, flags, to, tolen));
-
-HPIDECL(recvfrom, "recvfrom", _socket, RecvFrom, int, "%d",
-        (int fd, char *buf, int nbytes, int flags,
-         struct sockaddr *from, int *fromlen),
-        ("fd = %d, buf = %p, len = %d, flags = %d, frm = %p, frmlen = %d",
-         fd, buf, nbytes, flags, from, fromlen),
-        (fd, buf, nbytes, flags, from, fromlen));
-
-HPIDECL(recv, "recv", _socket, Recv, int, "%d",
-        (int fd, char *buf, int nBytes, int flags),
-        ("fd = %d, buf = %p, nBytes = %d, flags = %d",
-         fd, buf, nBytes, flags),
-        (fd, buf, nBytes, flags));
-
-HPIDECL(send, "send", _socket, Send, int, "%d",
-        (int fd, char *buf, int nBytes, int flags),
-        ("fd = %d, buf = %p, nBytes = %d, flags = %d",
-         fd, buf, nBytes, flags),
-        (fd, buf, nBytes, flags));
-
-inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) {
-  return send(fd, buf, nBytes, flags);
-}
-
-HPIDECL(timeout, "timeout", _socket, Timeout, int, "%d",
-        (int fd, long timeout),
-        ("fd = %d, timeout = %ld", fd, timeout),
-        (fd, timeout));
-
-HPIDECL(get_host_by_name, "get_host_by_name", _socket, GetHostByName,
-        struct hostent *, "(struct hostent *)%p",
-        (char *name),
-        ("%s", name),
-        (name));
-
-HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown,
-        int, "%d",
-        (int fd, int howto),
-        ("fd = %d, howto = %d", fd, howto),
-        (fd, howto));
-
-HPIDECL(bind, "bind", _socket, Bind,
-        int, "%d",
-        (int fd, struct sockaddr *him, int len),
-        ("fd = %d, him = %p, len = %d",
-         fd, him, len),
-        (fd, him, len));
-
-HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName,
-        int, "%d",
-        (int fd, struct sockaddr *him, int *len),
-        ("fd = %d, him = %p, len = %p",
-         fd, him, len),
-        (fd, him, len));
-
-HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d",
-        (char *hostname, int namelen),
-        ("hostname = %p, namelen = %d",
-         hostname, namelen),
-        (hostname, namelen));
-
-HPIDECL(get_host_by_addr, "get_host_by_addr", _socket, GetHostByAddr,
-        struct hostent *, "(struct hostent *)%p",
-        (const char* name, int len, int type),
-        ("name = %p, len = %d, type = %d",
-         name, len, type),
-        (name, len, type));
-
-HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d",
-        (int fd, int level, int optname, char *optval, int* optlen),
-        ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p",
-         fd, level, optname, optval, optlen),
-        (fd, level, optname, optval, optlen));
-
-HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
-        (int fd, int level, int optname, const char *optval, int optlen),
-        ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
-         fd, level, optname, optval, optlen),
-        (fd, level, optname, optval, optlen));
-
-HPIDECL(get_proto_by_name, "get_proto_by_name", _socket, GetProtoByName,
-        struct protoent *, "(struct protoent *)%p",
-        (char* name),
-        ("name = %p",
-         name),
-        (name));
--- a/src/os/windows/vm/interfaceSupport_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/interfaceSupport_windows.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP
+#define OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP
+
 // Contains inlined functions for class InterfaceSupport
 
 static inline void serialize_memory(JavaThread *thread) {
@@ -39,3 +42,5 @@
               serialize_fault_filter((_EXCEPTION_POINTERS*)_exception_info()))
     {}
 }
+
+#endif // OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP
--- a/src/os/windows/vm/jvm_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/jvm_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_jvm_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/osThread.hpp"
 
 #include <signal.h>
 
--- a/src/os/windows/vm/jvm_windows.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/jvm_windows.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/os/windows/vm/mutex_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/mutex_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_mutex_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "mutex_windows.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutex.hpp"
+#include "thread_windows.inline.hpp"
+#include "utilities/events.hpp"
 
 // put OS-includes here
 # include <windows.h>
--- a/src/os/windows/vm/mutex_windows.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/mutex_windows.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,3 +21,12 @@
  * questions.
  *
  */
+
+#ifndef OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
+#define OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
+
+#include "os_windows.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "thread_windows.inline.hpp"
+
+#endif // OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
--- a/src/os/windows/vm/osThread_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/osThread_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,17 @@
  *
  */
 
-#include "incls/_osThread_windows.cpp.incl"
+// no precompiled headers
+#include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
 
 void OSThread::pd_initialize() {
   set_thread_handle(NULL);
--- a/src/os/windows/vm/osThread_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/osThread_windows.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
+#define OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
+
 typedef void* HANDLE;
 
  private:
@@ -64,3 +67,5 @@
  private:
   void pd_initialize();
   void pd_destroy();
+
+#endif // OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
--- a/src/os/windows/vm/os_share_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/os_share_windows.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,9 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP
+#define OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP
+
 // Defines the interfaces to Windows operating system that vary across platforms
+
+#endif // OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP
--- a/src/os/windows/vm/os_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/os_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -27,8 +27,56 @@
 #define _WIN32_WINNT 0x500
 #endif
 
-// do not include precompiled header file
-# include "incls/_os_windows.cpp.incl"
+// no precompiled headers
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_windows.h"
+#include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
+#include "mutex_windows.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_share_windows.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/timer.hpp"
+#include "services/attachListener.hpp"
+#include "services/runtimeService.hpp"
+#include "thread_windows.inline.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 #ifdef _DEBUG
 #include <crtdbg.h>
@@ -996,8 +1044,6 @@
     return 0;
 }
 
-const char* os::dll_file_extension() { return ".dll"; }
-
 const char* os::get_temp_directory() {
   const char *prop = Arguments::get_property("java.io.tmpdir");
   if (prop != 0) return prop;
@@ -1019,7 +1065,6 @@
 
 void os::dll_build_name(char *buffer, size_t buflen,
                         const char* pname, const char* fname) {
-  // Copied from libhpi
   const size_t pnamelen = pname ? strlen(pname) : 0;
   const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0;
 
@@ -1321,19 +1366,14 @@
 
 bool os::dll_address_to_function_name(address addr, char *buf,
                                       int buflen, int *offset) {
-  // Unimplemented on Windows - in order to use SymGetSymFromAddr(),
-  // we need to initialize imagehlp/dbghelp, then load symbol table
-  // for every module. That's too much work to do after a fatal error.
-  // For an example on how to implement this function, see 1.4.2.
-  if (offset)  *offset  = -1;
-  if (buf) buf[0] = '\0';
+  if (Decoder::decode(addr, buf, buflen, offset) == Decoder::no_error) {
+    return true;
+  }
+  if (offset != NULL)  *offset  = -1;
+  if (buf != NULL) buf[0] = '\0';
   return false;
 }
 
-void* os::dll_lookup(void* handle, const char* name) {
-  return GetProcAddress((HMODULE)handle, name);
-}
-
 // save the start and end address of jvm.dll into param[0] and param[1]
 static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,
                     unsigned size, void * param) {
@@ -1668,7 +1708,34 @@
     return;
   }
 
+  buf[0] = '\0';
+  if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
+     // Support for the gamma launcher. Check for an
+     // JAVA_HOME environment variable
+     // and fix up the path so it looks like
+     // libjvm.so is installed there (append a fake suffix
+     // hotspot/libjvm.so).
+     char* java_home_var = ::getenv("JAVA_HOME");
+     if (java_home_var != NULL && java_home_var[0] != 0) {
+
+        strncpy(buf, java_home_var, buflen);
+
+        // determine if this is a legacy image or modules image
+        // modules image doesn't have "jre" subdirectory
+        size_t len = strlen(buf);
+        char* jrebin_p = buf + len;
+        jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\");
+        if (0 != _access(buf, 0)) {
+          jio_snprintf(jrebin_p, buflen-len, "\\bin\\");
+        }
+        len = strlen(buf);
+        jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll");
+     }
+  }
+
+  if(buf[0] == '\0') {
   GetModuleFileName(vm_lib_handle, buf, buflen);
+  }
   strcpy(saved_jvm_path, buf);
 }
 
@@ -1686,6 +1753,44 @@
 #endif
 }
 
+// This method is a copy of JDK's sysGetLastErrorString
+// from src/windows/hpi/src/system_md.c
+
+size_t os::lasterror(char *buf, size_t len) {
+  long errval;
+
+  if ((errval = GetLastError()) != 0) {
+      /* DOS error */
+    int n = (int)FormatMessage(
+          FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+          NULL,
+          errval,
+          0,
+          buf,
+          (DWORD)len,
+          NULL);
+    if (n > 3) {
+      /* Drop final '.', CR, LF */
+      if (buf[n - 1] == '\n') n--;
+      if (buf[n - 1] == '\r') n--;
+      if (buf[n - 1] == '.') n--;
+      buf[n] = '\0';
+    }
+    return n;
+  }
+
+  if (errno != 0) {
+    /* C runtime error that has no corresponding DOS error code */
+    const char *s = strerror(errno);
+    size_t n = strlen(s);
+    if (n >= len) n = len - 1;
+    strncpy(buf, s, n);
+    buf[n] = '\0';
+    return n;
+  }
+  return 0;
+}
+
 // sun.misc.Signal
 // NOTE that this is a workaround for an apparent kernel bug where if
 // a signal handler for SIGBREAK is installed then that signal handler
@@ -2893,10 +2998,6 @@
   assert(ret != SYS_THREAD_ERROR, "StartThread failed"); // should propagate back
 }
 
-size_t os::read(int fd, void *buf, unsigned int nBytes) {
-  return ::read(fd, buf, nBytes);
-}
-
 class HighResolutionInterval {
   // The default timer resolution seems to be 10 milliseconds.
   // (Where is this written down?)
@@ -3375,10 +3476,6 @@
 #endif
   }
 
-  // Initialize HPI.
-  jint hpi_result = hpi::initialize();
-  if (hpi_result != JNI_OK) { return hpi_result; }
-
   // If stack_commit_size is 0, windows will reserve the default size,
   // but only commit a small portion of it.
   size_t stack_commit_size = round_to(ThreadStackSize*K, os::vm_page_size());
@@ -3483,7 +3580,7 @@
     errno = ENAMETOOLONG;
     return -1;
   }
-  hpi::native_path(strcpy(pathbuf, path));
+  os::native_path(strcpy(pathbuf, path));
   int ret = ::stat(pathbuf, sbuf);
   if (sbuf != NULL && UseUTCFileTimestamp) {
     // Fix for 6539723.  st_mtime returned from stat() is dependent on
@@ -3627,6 +3724,20 @@
   return DontYieldALot;
 }
 
+// This method is a slightly reworked copy of JDK's sysOpen
+// from src/windows/hpi/src/sys_api_md.c
+
+int os::open(const char *path, int oflag, int mode) {
+  char pathbuf[MAX_PATH];
+
+  if (strlen(path) > MAX_PATH - 1) {
+    errno = ENAMETOOLONG;
+          return -1;
+  }
+  os::native_path(strcpy(pathbuf, path));
+  return ::open(pathbuf, oflag | O_BINARY | O_NOINHERIT, mode);
+}
+
 // Is a (classpath) directory empty?
 bool os::dir_is_empty(const char* path) {
   WIN32_FIND_DATA fd;
@@ -3658,6 +3769,297 @@
 }
 
 
+jlong os::lseek(int fd, jlong offset, int whence) {
+  return (jlong) ::_lseeki64(fd, offset, whence);
+}
+
+// This method is a slightly reworked copy of JDK's sysNativePath
+// from src/windows/hpi/src/path_md.c
+
+/* Convert a pathname to native format.  On win32, this involves forcing all
+   separators to be '\\' rather than '/' (both are legal inputs, but Win95
+   sometimes rejects '/') and removing redundant separators.  The input path is
+   assumed to have been converted into the character encoding used by the local
+   system.  Because this might be a double-byte encoding, care is taken to
+   treat double-byte lead characters correctly.
+
+   This procedure modifies the given path in place, as the result is never
+   longer than the original.  There is no error return; this operation always
+   succeeds. */
+char * os::native_path(char *path) {
+  char *src = path, *dst = path, *end = path;
+  char *colon = NULL;           /* If a drive specifier is found, this will
+                                        point to the colon following the drive
+                                        letter */
+
+  /* Assumption: '/', '\\', ':', and drive letters are never lead bytes */
+  assert(((!::IsDBCSLeadByte('/'))
+    && (!::IsDBCSLeadByte('\\'))
+    && (!::IsDBCSLeadByte(':'))),
+    "Illegal lead byte");
+
+  /* Check for leading separators */
+#define isfilesep(c) ((c) == '/' || (c) == '\\')
+  while (isfilesep(*src)) {
+    src++;
+  }
+
+  if (::isalpha(*src) && !::IsDBCSLeadByte(*src) && src[1] == ':') {
+    /* Remove leading separators if followed by drive specifier.  This
+      hack is necessary to support file URLs containing drive
+      specifiers (e.g., "file://c:/path").  As a side effect,
+      "/c:/path" can be used as an alternative to "c:/path". */
+    *dst++ = *src++;
+    colon = dst;
+    *dst++ = ':';
+    src++;
+  } else {
+    src = path;
+    if (isfilesep(src[0]) && isfilesep(src[1])) {
+      /* UNC pathname: Retain first separator; leave src pointed at
+         second separator so that further separators will be collapsed
+         into the second separator.  The result will be a pathname
+         beginning with "\\\\" followed (most likely) by a host name. */
+      src = dst = path + 1;
+      path[0] = '\\';     /* Force first separator to '\\' */
+    }
+  }
+
+  end = dst;
+
+  /* Remove redundant separators from remainder of path, forcing all
+      separators to be '\\' rather than '/'. Also, single byte space
+      characters are removed from the end of the path because those
+      are not legal ending characters on this operating system.
+  */
+  while (*src != '\0') {
+    if (isfilesep(*src)) {
+      *dst++ = '\\'; src++;
+      while (isfilesep(*src)) src++;
+      if (*src == '\0') {
+        /* Check for trailing separator */
+        end = dst;
+        if (colon == dst - 2) break;                      /* "z:\\" */
+        if (dst == path + 1) break;                       /* "\\" */
+        if (dst == path + 2 && isfilesep(path[0])) {
+          /* "\\\\" is not collapsed to "\\" because "\\\\" marks the
+            beginning of a UNC pathname.  Even though it is not, by
+            itself, a valid UNC pathname, we leave it as is in order
+            to be consistent with the path canonicalizer as well
+            as the win32 APIs, which treat this case as an invalid
+            UNC pathname rather than as an alias for the root
+            directory of the current drive. */
+          break;
+        }
+        end = --dst;  /* Path does not denote a root directory, so
+                                    remove trailing separator */
+        break;
+      }
+      end = dst;
+    } else {
+      if (::IsDBCSLeadByte(*src)) { /* Copy a double-byte character */
+        *dst++ = *src++;
+        if (*src) *dst++ = *src++;
+        end = dst;
+      } else {         /* Copy a single-byte character */
+        char c = *src++;
+        *dst++ = c;
+        /* Space is not a legal ending character */
+        if (c != ' ') end = dst;
+      }
+    }
+  }
+
+  *end = '\0';
+
+  /* For "z:", add "." to work around a bug in the C runtime library */
+  if (colon == dst - 1) {
+          path[2] = '.';
+          path[3] = '\0';
+  }
+
+  #ifdef DEBUG
+    jio_fprintf(stderr, "sysNativePath: %s\n", path);
+  #endif DEBUG
+  return path;
+}
+
+// This code is a copy of JDK's sysSetLength
+// from src/windows/hpi/src/sys_api_md.c
+
+int os::ftruncate(int fd, jlong length) {
+  HANDLE h = (HANDLE)::_get_osfhandle(fd);
+  long high = (long)(length >> 32);
+  DWORD ret;
+
+  if (h == (HANDLE)(-1)) {
+    return -1;
+  }
+
+  ret = ::SetFilePointer(h, (long)(length), &high, FILE_BEGIN);
+  if ((ret == 0xFFFFFFFF) && (::GetLastError() != NO_ERROR)) {
+      return -1;
+  }
+
+  if (::SetEndOfFile(h) == FALSE) {
+    return -1;
+  }
+
+  return 0;
+}
+
+
+// This code is a copy of JDK's sysSync
+// from src/windows/hpi/src/sys_api_md.c
+// except for the legacy workaround for a bug in Win 98
+
+int os::fsync(int fd) {
+  HANDLE handle = (HANDLE)::_get_osfhandle(fd);
+
+  if ( (!::FlushFileBuffers(handle)) &&
+         (GetLastError() != ERROR_ACCESS_DENIED) ) {
+    /* from winerror.h */
+    return -1;
+  }
+  return 0;
+}
+
+static int nonSeekAvailable(int, long *);
+static int stdinAvailable(int, long *);
+
+#define S_ISCHR(mode)   (((mode) & _S_IFCHR) == _S_IFCHR)
+#define S_ISFIFO(mode)  (((mode) & _S_IFIFO) == _S_IFIFO)
+
+// This code is a copy of JDK's sysAvailable
+// from src/windows/hpi/src/sys_api_md.c
+
+int os::available(int fd, jlong *bytes) {
+  jlong cur, end;
+  struct _stati64 stbuf64;
+
+  if (::_fstati64(fd, &stbuf64) >= 0) {
+    int mode = stbuf64.st_mode;
+    if (S_ISCHR(mode) || S_ISFIFO(mode)) {
+      int ret;
+      long lpbytes;
+      if (fd == 0) {
+        ret = stdinAvailable(fd, &lpbytes);
+      } else {
+        ret = nonSeekAvailable(fd, &lpbytes);
+      }
+      (*bytes) = (jlong)(lpbytes);
+      return ret;
+    }
+    if ((cur = ::_lseeki64(fd, 0L, SEEK_CUR)) == -1) {
+      return FALSE;
+    } else if ((end = ::_lseeki64(fd, 0L, SEEK_END)) == -1) {
+      return FALSE;
+    } else if (::_lseeki64(fd, cur, SEEK_SET) == -1) {
+      return FALSE;
+    }
+    *bytes = end - cur;
+    return TRUE;
+  } else {
+    return FALSE;
+  }
+}
+
+// This code is a copy of JDK's nonSeekAvailable
+// from src/windows/hpi/src/sys_api_md.c
+
+static int nonSeekAvailable(int fd, long *pbytes) {
+  /* This is used for available on non-seekable devices
+    * (like both named and anonymous pipes, such as pipes
+    *  connected to an exec'd process).
+    * Standard Input is a special case.
+    *
+    */
+  HANDLE han;
+
+  if ((han = (HANDLE) ::_get_osfhandle(fd)) == (HANDLE)(-1)) {
+    return FALSE;
+  }
+
+  if (! ::PeekNamedPipe(han, NULL, 0, NULL, (LPDWORD)pbytes, NULL)) {
+        /* PeekNamedPipe fails when at EOF.  In that case we
+         * simply make *pbytes = 0 which is consistent with the
+         * behavior we get on Solaris when an fd is at EOF.
+         * The only alternative is to raise an Exception,
+         * which isn't really warranted.
+         */
+    if (::GetLastError() != ERROR_BROKEN_PIPE) {
+      return FALSE;
+    }
+    *pbytes = 0;
+  }
+  return TRUE;
+}
+
+#define MAX_INPUT_EVENTS 2000
+
+// This code is a copy of JDK's stdinAvailable
+// from src/windows/hpi/src/sys_api_md.c
+
+static int stdinAvailable(int fd, long *pbytes) {
+  HANDLE han;
+  DWORD numEventsRead = 0;      /* Number of events read from buffer */
+  DWORD numEvents = 0;  /* Number of events in buffer */
+  DWORD i = 0;          /* Loop index */
+  DWORD curLength = 0;  /* Position marker */
+  DWORD actualLength = 0;       /* Number of bytes readable */
+  BOOL error = FALSE;         /* Error holder */
+  INPUT_RECORD *lpBuffer;     /* Pointer to records of input events */
+
+  if ((han = ::GetStdHandle(STD_INPUT_HANDLE)) == INVALID_HANDLE_VALUE) {
+        return FALSE;
+  }
+
+  /* Construct an array of input records in the console buffer */
+  error = ::GetNumberOfConsoleInputEvents(han, &numEvents);
+  if (error == 0) {
+    return nonSeekAvailable(fd, pbytes);
+  }
+
+  /* lpBuffer must fit into 64K or else PeekConsoleInput fails */
+  if (numEvents > MAX_INPUT_EVENTS) {
+    numEvents = MAX_INPUT_EVENTS;
+  }
+
+  lpBuffer = (INPUT_RECORD *)os::malloc(numEvents * sizeof(INPUT_RECORD));
+  if (lpBuffer == NULL) {
+    return FALSE;
+  }
+
+  error = ::PeekConsoleInput(han, lpBuffer, numEvents, &numEventsRead);
+  if (error == 0) {
+    os::free(lpBuffer);
+    return FALSE;
+  }
+
+  /* Examine input records for the number of bytes available */
+  for(i=0; i<numEvents; i++) {
+    if (lpBuffer[i].EventType == KEY_EVENT) {
+
+      KEY_EVENT_RECORD *keyRecord = (KEY_EVENT_RECORD *)
+                                      &(lpBuffer[i].Event);
+      if (keyRecord->bKeyDown == TRUE) {
+        CHAR *keyPressed = (CHAR *) &(keyRecord->uChar);
+        curLength++;
+        if (*keyPressed == '\r') {
+          actualLength = curLength;
+        }
+      }
+    }
+  }
+
+  if(lpBuffer != NULL) {
+    os::free(lpBuffer);
+  }
+
+  *pbytes = (long) actualLength;
+  return TRUE;
+}
+
 // Map a block of memory.
 char* os::map_memory(int fd, const char* file_name, size_t file_offset,
                      char *addr, size_t bytes, bool read_only,
@@ -3823,7 +4225,7 @@
   int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
   if (fd != -1) {
     struct stat buf;
-    close(fd);
+    ::close(fd);
     while (::stat(filename, &buf) == 0) {
       Sleep(100);
     }
@@ -4184,3 +4586,164 @@
 // We don't build a headless jre for Windows
 bool os::is_headless_jre() { return false; }
 
+// OS_SocketInterface
+// Not used on Windows
+
+// OS_SocketInterface
+typedef struct hostent * (PASCAL FAR *ws2_ifn_ptr_t)(...);
+ws2_ifn_ptr_t *get_host_by_name_fn = NULL;
+
+typedef CRITICAL_SECTION mutex_t;
+#define mutexInit(m)    InitializeCriticalSection(m)
+#define mutexDestroy(m) DeleteCriticalSection(m)
+#define mutexLock(m)    EnterCriticalSection(m)
+#define mutexUnlock(m)  LeaveCriticalSection(m)
+
+static bool sockfnptrs_initialized = FALSE;
+static mutex_t sockFnTableMutex;
+
+/* is Winsock2 loaded? better to be explicit than to rely on sockfnptrs */
+static bool winsock2Available = FALSE;
+
+
+static void initSockFnTable() {
+  int (PASCAL FAR* WSAStartupPtr)(WORD, LPWSADATA);
+  WSADATA wsadata;
+
+  ::mutexInit(&sockFnTableMutex);
+  ::mutexLock(&sockFnTableMutex);
+
+  if (sockfnptrs_initialized == FALSE) {
+        HMODULE hWinsock;
+
+          /* try to load Winsock2, and if that fails, load Winsock */
+    hWinsock = ::LoadLibrary("ws2_32.dll");
+
+    if (hWinsock == NULL) {
+      jio_fprintf(stderr, "Could not load Winsock 2 (error: %d)\n",
+      ::GetLastError());
+      return;
+    }
+
+    /* If we loaded a DLL, then we might as well initialize it.  */
+    WSAStartupPtr = (int (PASCAL FAR *)(WORD, LPWSADATA))
+    ::GetProcAddress(hWinsock, "WSAStartup");
+
+    if (WSAStartupPtr(MAKEWORD(1,1), &wsadata) != 0) {
+        jio_fprintf(stderr, "Could not initialize Winsock\n");
+    }
+
+    get_host_by_name_fn
+        = (ws2_ifn_ptr_t*) GetProcAddress(hWinsock, "gethostbyname");
+  }
+
+  assert(get_host_by_name_fn != NULL,
+    "gethostbyname function not found");
+  sockfnptrs_initialized = TRUE;
+  ::mutexUnlock(&sockFnTableMutex);
+}
+
+struct hostent*  os::get_host_by_name(char* name) {
+  if (!sockfnptrs_initialized) {
+    initSockFnTable();
+  }
+
+  assert(sockfnptrs_initialized == TRUE && get_host_by_name_fn != NULL,
+    "sockfnptrs is not initialized or pointer to gethostbyname function is NULL");
+  return (*get_host_by_name_fn)(name);
+}
+
+
+int os::socket_close(int fd) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::socket_available(int fd, jint *pbytes) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::socket(int domain, int type, int protocol) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::listen(int fd, int count) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::connect(int fd, struct sockaddr *him, int len) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::accept(int fd, struct sockaddr *him, int *len) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::sendto(int fd, char *buf, int len, int flags,
+                        struct sockaddr *to, int tolen) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::recvfrom(int fd, char *buf, int nBytes, int flags,
+                         sockaddr *from, int *fromlen) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::recv(int fd, char *buf, int nBytes, int flags) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::send(int fd, char *buf, int nBytes, int flags) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::raw_send(int fd, char *buf, int nBytes, int flags) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::timeout(int fd, long timeout) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::get_host_name(char* name, int namelen) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::socket_shutdown(int fd, int howto) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::bind(int fd, struct sockaddr *him, int len) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::get_sock_name(int fd, struct sockaddr *him, int *len) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::get_sock_opt(int fd, int level, int optname,
+                             char *optval, int* optlen) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+int os::set_sock_opt(int fd, int level, int optname,
+                             const char *optval, int optlen) {
+  ShouldNotReachHere();
+  return 0;
+}
--- a/src/os/windows/vm/os_windows.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/os_windows.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_OS_WINDOWS_HPP
+#define OS_WINDOWS_VM_OS_WINDOWS_HPP
+
 // Win32_OS defines the interface to windows operating systems
 
 class win32 {
@@ -124,3 +127,5 @@
     }
 
 } ;
+
+#endif // OS_WINDOWS_VM_OS_WINDOWS_HPP
--- a/src/os/windows/vm/os_windows.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/os_windows.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,18 +22,39 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
+#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "atomic_windows_x86.inline.hpp"
+# include "orderAccess_windows_x86.inline.hpp"
+#endif
+
 inline const char* os::file_separator()                { return "\\"; }
 inline const char* os::line_separator()                { return "\r\n"; }
 inline const char* os::path_separator()                { return ";"; }
+inline const char* os::dll_file_extension()            { return ".dll"; }
 
 inline const char* os::jlong_format_specifier()        { return "%I64d"; }
 inline const char* os::julong_format_specifier()       { return "%I64u"; }
 
+inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;}
+
 // File names are case-insensitive on windows only
 inline int os::file_name_strcmp(const char* s, const char* t) {
   return _stricmp(s, t);
 }
 
+inline void  os::dll_unload(void *lib) {
+  ::FreeLibrary((HMODULE)lib);
+}
+
+inline void* os::dll_lookup(void *lib, const char *name) {
+  return (void*)::GetProcAddress((HMODULE)lib, name);
+}
+
 // Used to improve time-sharing on some systems
 inline void os::loop_breaker(int attempts) {}
 
@@ -72,3 +93,20 @@
 
 inline bool os::numa_has_static_binding()   { return true;   }
 inline bool os::numa_has_group_homing()     { return false;  }
+
+inline size_t os::read(int fd, void *buf, unsigned int nBytes) {
+  return ::read(fd, buf, nBytes);
+}
+
+inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
+  return ::read(fd, buf, nBytes);
+}
+
+inline size_t os::write(int fd, const void *buf, unsigned int nBytes) {
+  return ::write(fd, buf, nBytes);
+}
+
+inline int os::close(int fd) {
+  return ::close(fd);
+}
+#endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
--- a/src/os/windows/vm/perfMemory_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/perfMemory_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_perfMemory_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_windows.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/perfMemory.hpp"
+#include "utilities/exceptions.hpp"
 
 #include <windows.h>
 #include <sys/types.h>
@@ -889,6 +896,7 @@
   DWORD newACLsize = aclinfo.AclBytesInUse +
                         (sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) * ace_count;
   for (int i = 0; i < ace_count; i++) {
+     assert(aces[i].pSid != 0, "pSid should not be 0");
      newACLsize += GetLengthSid(aces[i].pSid);
   }
 
@@ -1084,6 +1092,9 @@
   aces[0].pSid = get_user_sid(GetCurrentProcess());
   aces[0].mask = umask;
 
+  if (aces[0].pSid == 0)
+    return NULL;
+
   // get the well known SID for BUILTIN\Administrators
   PSID administratorsSid = NULL;
   SID_IDENTIFIER_AUTHORITY SIDAuthAdministrators = SECURITY_NT_AUTHORITY;
--- a/src/os/windows/vm/stubRoutines_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/stubRoutines_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,7 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
+
--- a/src/os/windows/vm/threadCritical_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/threadCritical_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_threadCritical_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadCritical.hpp"
+#include "thread_windows.inline.hpp"
 
 // OS-includes here
 # include <windows.h>
--- a/src/os/windows/vm/thread_windows.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/thread_windows.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP
+#define OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/prefetch.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "atomic_windows_x86.inline.hpp"
+# include "orderAccess_windows_x86.inline.hpp"
+# include "prefetch_windows_x86.inline.hpp"
+#endif
+
 // Contains inlined functions for class Thread and ThreadLocalStorage
 
 inline void ThreadLocalStorage::pd_invalidate_all()            { return; }
+
+#endif // OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP
--- a/src/os/windows/vm/vmError_windows.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os/windows/vm/vmError_windows.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmError_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/vmError.hpp"
 
 
 void VMError::show_message_box(char *buf, int buflen) {
--- a/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
 
 #include <asm-sparc/traps.h>
 
--- a/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
+#define OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
+
+#include "orderAccess_linux_sparc.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
+
 // Implementation of class atomic
 
 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
@@ -204,3 +212,5 @@
 inline void*    Atomic::cmpxchg_ptr(void*    exchange_value, volatile void*     dest, void*    compare_value) {
   return (void*)cmpxchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest, (intptr_t)compare_value);
 }
+
+#endif // OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
--- a/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
+
 //
 // Sets the default values for platform dependent flags used by the
 // runtime system.  (see globals.hpp)
@@ -34,3 +37,5 @@
 define_pd_global(uintx, HeapBaseMinAddress,      4*G);
 // Only used on 64 bit Windows platforms
 define_pd_global(bool, UseVectoredExceptions, false);
+
+#endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
--- a/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
+#define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_sparc.hpp"
+
 // Implementation of class OrderAccess.
 
 // Assume TSO.
@@ -100,3 +106,5 @@
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); }
 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) { *(void* volatile *)p = v; fence(); }
+
+#endif // OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
--- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,9 +22,43 @@
  *
  */
 
-// do not include  precompiled  header file
+// no precompiled headers
+#include "assembler_sparc.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_linux.inline.hpp"
+#include "nativeInst_sparc.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
-#include "incls/_os_linux_sparc.cpp.incl"
 
 // Linux/Sparc has rather obscure naming of registers in sigcontext
 // different between 32 and 64 bits
--- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP
+
   //
   // NOTE: we are back in class os here, not Linux
   //
@@ -42,3 +45,5 @@
   // Used to register dynamic code cache area with the OS
   // Note: Currently only used in 64 bit Windows implementations
   static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP
--- a/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP
+#define OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
 #if defined(COMPILER2) || defined(_LP64)
 
 inline void Prefetch::read(void *loc, intx interval) {
@@ -38,3 +43,5 @@
 inline void Prefetch::write(void *loc, intx interval) {}
 
 #endif
+
+#endif // OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP
--- a/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_linux.inline.hpp"
 
 void ThreadLocalStorage::generate_code_for_get_thread() {
 }
--- a/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,12 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP
+
 public:
   static Thread* thread() {
     return (Thread*) os::thread_local_storage_at(thread_index());
   }
+
+#endif // OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP
--- a/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_thread_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_linux.inline.hpp"
 
 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
 // currently interrupted by SIGPROF
--- a/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP
+
 private:
 
   void pd_initialize() {
@@ -96,3 +99,5 @@
   static bool register_stack_overflow() { return false; }
   static void enable_register_stack_guard() {}
   static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP
--- a/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP
+
 // These are the OS and CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -67,3 +70,5 @@
                                                                         \
   /* This must be the last entry, and must be present */                \
   last_entry()
+
+#endif // OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP
--- a/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
 
 static bool detect_niagara() {
   char cpu[128];
--- a/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
 
 #ifndef _LP64
 void MacroAssembler::int3() {
--- a/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
+
+#include "orderAccess_linux_x86.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
 // Implementation of class atomic
 
 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
@@ -193,3 +201,5 @@
   return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value);
 }
 #endif // AMD64
+
+#endif // OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
--- a/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP
+
 #include <byteswap.h>
 
 // Efficient swapping of data bytes from Java byte
@@ -83,3 +86,5 @@
   return swap_u8_base(*(u4*)&x, *(((u4*)&x)+1));
 }
 #endif // !AMD64
+
+#endif // OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP
--- a/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
+
 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
 #ifdef AMD64
   (void)memmove(to, from, count * HeapWordSize);
@@ -302,3 +305,5 @@
   pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
 #endif // AMD64
 }
+
+#endif // OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
--- a/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
+
 // Sets the default values for platform dependent flags used by the runtime system.
 // (see globals.hpp)
 
@@ -45,3 +48,5 @@
 define_pd_global(uintx,HeapBaseMinAddress,       2*G);
 // Only used on 64 bit Windows platforms
 define_pd_global(bool, UseVectoredExceptions,    false);
+
+#endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
--- a/src/os_cpu/linux_x86/vm/linux_x86_32.s	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/linux_x86_32.s	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_x86.hpp"
+
 // Implementation of class OrderAccess.
 
 inline void OrderAccess::loadload()   { acquire(); }
@@ -204,3 +210,5 @@
   release_store_fence((volatile jint*)p, (jint)v);
 #endif // AMD64
 }
+
+#endif // OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,42 @@
  *
  */
 
-// do not include  precompiled  header file
-# include "incls/_os_linux_x86.cpp.incl"
+// no precompiled headers
+#include "assembler_x86.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_linux.inline.hpp"
+#include "nativeInst_x86.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // put OS-includes here
 # include <sys/types.h>
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP
+
   static void setup_fpu();
   static bool supports_sse();
 
@@ -30,3 +33,5 @@
   // Used to register dynamic code cache area with the OS
   // Note: Currently only used in 64 bit Windows implementations
   static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP
--- a/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
 
 inline void Prefetch::read (void *loc, intx interval) {
 #ifdef AMD64
@@ -38,3 +43,5 @@
 
 #endif // AMD64
 }
+
+#endif // OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP
--- a/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_linux.inline.hpp"
 
 // Map stack pointer (%esp) to thread pointer for faster TLS access
 //
--- a/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP
+
   // Processor dependent parts of ThreadLocalStorage
 
 #ifndef AMD64
@@ -47,3 +50,5 @@
     return _sp_map[sp >> PAGE_SHIFT];
 #endif // AMD64
   }
+
+#endif // OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP
--- a/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_thread_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_linux.inline.hpp"
 
 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
 // currently interrupted by SIGPROF
--- a/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP
+
  private:
   void pd_initialize() {
     _anchor.clear();
@@ -63,3 +66,5 @@
   static bool register_stack_overflow() { return false; }
   static void enable_register_stack_guard() {}
   static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP
--- a/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP
+
 // These are the OS and CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -58,3 +61,5 @@
                                                                         \
   /* This must be the last entry, and must be present */                \
   last_entry()
+
+#endif // OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP
--- a/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,7 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
--- a/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,10 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
+
 // This file is intentionally empty
--- a/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,14 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
+
+#include "orderAccess_linux_zero.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_zero.hpp"
+
 // Implementation of class atomic
 
 #ifdef M68K
@@ -291,3 +299,5 @@
                               (volatile intptr_t*) dest,
                               (intptr_t) compare_value);
 }
+
+#endif // OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
--- a/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP
+
 // Efficient swapping of data bytes from Java byte
 // ordering to native byte ordering and vice versa.
 
@@ -38,3 +41,5 @@
 inline u8 Bytes::swap_u8(u8 x) {
   return bswap_64(x);
 }
+
+#endif // OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP
--- a/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
+
 //
 // Set the default values for platform dependent flags used by the
 // runtime system.  See globals.hpp for details of what they do.
@@ -42,3 +45,5 @@
 define_pd_global(bool,  UseVectoredExceptions,   false);
 // Only used on 64 bit platforms
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+
+#endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
--- a/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_zero.hpp"
+
 #ifdef ARM
 
 /*
@@ -165,3 +171,5 @@
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { release_store_ptr(p, v); fence(); }
 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) { release_store_ptr(p, v); fence(); }
+
+#endif // OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,42 @@
  *
  */
 
-// do not include precompiled header file
-#include "incls/_os_linux_zero.cpp.incl"
+// no precompiled headers
+#include "assembler_zero.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_linux.inline.hpp"
+#include "nativeInst_zero.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 address os::current_stack_pointer() {
   address dummy = (address) &dummy;
@@ -370,6 +404,10 @@
   ShouldNotCallThis();
 }
 
+void os::print_register_info(outputStream *st, void *context) {
+  ShouldNotCallThis();
+}
+
 /////////////////////////////////////////////////////////////////////////////
 // Stubs for things that would be in linux_zero.s if it existed.
 // You probably want to disassemble these monkeys to check they're ok.
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
+
   static void setup_fpu() {}
 
   static bool is_allocatable(size_t bytes);
@@ -49,3 +52,5 @@
     *(jlong *) dst = *(jlong *) src;
 #endif
   }
+
+#endif // OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
--- a/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,15 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
 inline void Prefetch::read(void* loc, intx interval) {
 }
 
 inline void Prefetch::write(void* loc, intx interval) {
 }
+
+#endif // OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP
--- a/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_linux_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_linux.inline.hpp"
 
 void ThreadLocalStorage::generate_code_for_get_thread() {
   // nothing to do
--- a/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,14 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP
+
 // Processor dependent parts of ThreadLocalStorage
 
  public:
   static Thread* thread() {
     return (Thread*) os::thread_local_storage_at(thread_index());
   }
+
+#endif // OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP
--- a/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_thread_linux_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_linux.inline.hpp"
 
 void JavaThread::cache_global_variables() {
   // nothing to do
--- a/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP
+
  private:
   ZeroStack  _zero_stack;
   ZeroFrame* _top_zero_frame;
@@ -114,3 +117,5 @@
   static bool register_stack_overflow() { return false; }
   static void enable_register_stack_guard() {}
   static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP
--- a/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP
+
 // These are the OS and CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -43,3 +46,5 @@
 #define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
   /* This must be the last entry, and must be present */                \
   last_entry()
+
+#endif // OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP
--- a/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,4 +23,8 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_zero.hpp"
+
 // This file is intentionally empty
--- a/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_solaris_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
 
 #include <sys/trap.h>          // For trap numbers
 #include <v9/sys/psr_compat.h> // For V8 compatibility
--- a/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
+
+#include "orderAccess_solaris_sparc.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
+
 // Implementation of class atomic
 
 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
@@ -342,3 +350,5 @@
 #endif // _LP64 || COMPILER2
 
 #endif // _GNU_SOURCE
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
--- a/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP
+
 //
 // Sets the default values for platform dependent flags used by the runtime system.
 // (see globals.hpp)
@@ -36,3 +39,5 @@
 define_pd_global(bool, UseVectoredExceptions,    false);
 
 
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP
--- a/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_sparc.hpp"
+
 // Implementation of class OrderAccess.
 
 // Assume TSO.
@@ -124,3 +130,5 @@
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); }
 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) { *(void* volatile *)p = v; fence(); }
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,12 +22,46 @@
  *
  */
 
-// do not include  precompiled  header file
+// no precompiled headers
+#include "assembler_sparc.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_solaris.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "nativeInst_sparc.hpp"
+#include "os_share_solaris.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+
 
 # include <signal.h>        // needed first to avoid name collision for "std" with SC 5.0
 
-# include "incls/_os_solaris_sparc.cpp.incl"
-
 // put OS-includes here
 # include <sys/types.h>
 # include <sys/mman.h>
@@ -254,17 +288,17 @@
   if (*flags == TRS_LWPID) {
     sprintf(lwpstatusfile, "/proc/%d/lwp/%d/lwpstatus", getpid(),
             *lwp);
-    if ((lwpfd = open(lwpstatusfile, O_RDONLY)) < 0) {
+    if ((lwpfd = ::open(lwpstatusfile, O_RDONLY)) < 0) {
       perror("thr_mutator_status: open lwpstatus");
       return (EINVAL);
     }
     if (pread(lwpfd, lwpstatus, sizeof (lwpstatus_t), (off_t)0) !=
         sizeof (lwpstatus_t)) {
       perror("thr_mutator_status: read lwpstatus");
-      (void) close(lwpfd);
+      (void) ::close(lwpfd);
       return (EINVAL);
     }
-    (void) close(lwpfd);
+    (void) ::close(lwpfd);
   }
   return (0);
 }
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP
+
   //
   // NOTE: we are back in class os here, not Solaris
   //
@@ -42,3 +45,5 @@
   // Used to register dynamic code cache area with the OS
   // Note: Currently only used in 64 bit Windows implementations
   static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP
--- a/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
 #if defined(COMPILER2) || defined(_LP64)
 
 // For Sun Studio inplementation is in solaris_sparc.il
@@ -56,3 +61,5 @@
 inline void Prefetch::write(void *loc, intx interval) {}
 
 #endif // defined(COMPILER2) || defined(_LP64)
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP
--- a/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,15 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_solaris.inline.hpp"
+
 // Provides an entry point we can link against and
 // a buffer we can emit code into. The buffer is
 // filled by ThreadLocalStorage::generate_code_for_get_thread
 // and called from ThreadLocalStorage::thread()
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_solaris_sparc.cpp.incl"
 #include <sys/systeminfo.h>
 
 // The portable TLS mechanism (get_thread_via_cache) is enough on SPARC.
--- a/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP
+
 public:
   // Java Thread  - force inlining
   static inline Thread* thread() ;
@@ -64,3 +67,5 @@
     uintptr_t ix = (int) (((raw_id >> 9) ^ (raw_id >> 20)) % _pd_cache_size);
     return ix;
   }
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP
--- a/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_thread_solaris_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_solaris.inline.hpp"
 
 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
 // currently interrupted by SIGPROF
--- a/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,9 @@
  * questions.
  *
  */
+
+#ifndef OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP
 private:
 
   void pd_initialize() {
@@ -95,3 +98,5 @@
   static bool register_stack_overflow() { return false; }
   static void enable_register_stack_guard() {}
   static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP
--- a/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP
+
 // These are the OS and CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -65,3 +68,5 @@
                                                                         \
   /* This must be the last entry, and must be present */                \
   last_entry()
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP
--- a/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_solaris_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
 
 # include <sys/auxv.h>
 # include <sys/auxv_SPARC.h>
--- a/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
 
 
 void MacroAssembler::int3() {
--- a/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
+
+#include "orderAccess_solaris_x86.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
 inline void Atomic::store    (jshort   store_value, jshort*   dest) { *dest = store_value; }
 inline void Atomic::store    (jint     store_value, jint*     dest) { *dest = store_value; }
@@ -245,3 +253,5 @@
 #undef LOCK_IF_MP
 
 #endif // _GNU_SOURCE
+
+#endif // OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
--- a/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP
+
 // For Sun Studio - implementation is in solaris_i486.il.
 // For gcc - implementation is just below.
 extern "C" u2 _raw_swap_u2(u2 x);
@@ -109,3 +112,5 @@
 #endif // AMD64
 }
 #endif  //_GNU_SOURCE
+
+#endif // OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP
--- a/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP
+
 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
   (void)memmove(to, from, count * HeapWordSize);
 }
@@ -136,3 +139,5 @@
   _Copy_arrayof_conjoint_jints(from, to, count);
 #endif // AMD64
 }
+
+#endif // OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP
--- a/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
+
 // Sets the default values for platform dependent flags used by the runtime system.
 // (see globals.hpp)
 
@@ -44,3 +47,5 @@
 define_pd_global(uintx,HeapBaseMinAddress,       256*M);
 // Only used on 64 bit Windows platforms
 define_pd_global(bool, UseVectoredExceptions,    false);
+
+#endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
--- a/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_x86.hpp"
+
 // Implementation of class OrderAccess.
 
 // For Sun Studio - implementation is in solaris_i486.il.
@@ -127,3 +133,5 @@
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); }
 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) { *(void* volatile *)p = v; fence(); }
+
+#endif // OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
--- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,42 @@
  *
  */
 
-// do not include  precompiled  header file
-# include "incls/_os_solaris_x86.cpp.incl"
+// no precompiled headers
+#include "assembler_x86.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_solaris.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "nativeInst_x86.hpp"
+#include "os_share_solaris.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // put OS-includes here
 # include <sys/types.h>
--- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP
+
   //
   // NOTE: we are back in class os here, not Solaris
   //
@@ -48,3 +51,5 @@
   // Used to register dynamic code cache area with the OS
   // Note: Currently only used in 64 bit Windows implementations
   static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP
--- a/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
 extern "C" {
   void _Prefetch_read (void *loc, intx interval);
   void _Prefetch_write(void *loc, intx interval);
@@ -39,3 +44,5 @@
   _Prefetch_write(loc, interval);
 #endif // AMD64
 }
+
+#endif // OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP
--- a/src/os_cpu/solaris_x86/vm/solaris_x86_32.il	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/solaris_x86_32.il	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
--- a/src/os_cpu/solaris_x86/vm/solaris_x86_32.s	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/solaris_x86_32.s	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
--- a/src/os_cpu/solaris_x86/vm/solaris_x86_64.il	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/solaris_x86_64.il	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
--- a/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_solaris.inline.hpp"
 
 #ifdef AMD64
 extern "C" Thread*  fs_load(ptrdiff_t tlsOffset);
--- a/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP
+
 // Processor dependent parts of ThreadLocalStorage
 
 private:
@@ -78,3 +81,5 @@
 
   // Java Thread
   static inline Thread* thread();
+
+#endif // OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP
--- a/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_thread_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_solaris.inline.hpp"
 
 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
 // currently interrupted by SIGPROF
--- a/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP
+
  private:
   void pd_initialize()                           { _anchor.clear(); }
 
@@ -57,3 +60,5 @@
   static bool register_stack_overflow() { return false; }
   static void enable_register_stack_guard() {}
   static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP
--- a/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP
+
 // These are the OS and CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -57,3 +60,5 @@
                                                                         \
   /* This must be the last entry, and must be present */                \
   last_entry()
+
+#endif // OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP
--- a/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,7 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
--- a/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_windows_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
 
 
 void MacroAssembler::int3() {
--- a/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
+
+#include "orderAccess_windows_x86.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
 // The following alternative implementations are needed because
 // Windows 95 doesn't support (some of) the corresponding Windows NT
 // calls. Furthermore, these versions allow inlining in the caller.
@@ -249,3 +257,5 @@
 #endif // AMD64
 
 #pragma warning(default: 4035) // Enables warnings reporting missing return statement
+
+#endif // OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
--- a/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
+
 #pragma warning(disable: 4035) // Disable warning 4035: no return value
 
 // Efficient swapping of data bytes from Java byte
@@ -80,3 +83,5 @@
 #endif // AMD64
 
 #pragma warning(default: 4035) // Enable warning 4035: no return value
+
+#endif // OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
--- a/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
+
 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
   (void)memmove(to, from, count * HeapWordSize);
 }
@@ -164,3 +167,5 @@
 static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
   pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
 }
+
+#endif // OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
--- a/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
+
 // Sets the default values for platform dependent flags used by the runtime system.
 // (see globals.hpp)
 
@@ -46,3 +49,5 @@
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 // Only used on 64 bit Windows platforms
 define_pd_global(bool, UseVectoredExceptions,    false);
+
+#endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
--- a/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_x86.hpp"
+
 #pragma warning(disable: 4035) // Disables warnings reporting missing return statement
 
 // Implementation of class OrderAccess.
@@ -208,3 +214,5 @@
 }
 
 #pragma warning(default: 4035) // Enables warnings reporting missing return statement
+
+#endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
--- a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,43 @@
  *
  */
 
-// do not include  precompiled  header file
-# include "incls/_os_windows_x86.cpp.incl"
+// no precompiled headers
+#include "assembler_x86.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_windows.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_windows.inline.hpp"
+#include "nativeInst_x86.hpp"
+#include "os_share_windows.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_windows.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+
 # include "unwind_windows_x86.hpp"
 #undef REG_SP
 #undef REG_FP
--- a/src/os_cpu/windows_x86/vm/os_windows_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/os_windows_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP
+
   //
   // NOTE: we are back in class os here, not win32
   //
@@ -56,3 +59,5 @@
   static bool supports_sse() { return true; }
 
   static bool      register_code_area(char *low, char *high);
+
+#endif // OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP
--- a/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,12 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
 inline void Prefetch::read (void *loc, intx interval) {}
 inline void Prefetch::write(void *loc, intx interval) {}
+
+#endif // OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP
--- a/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,15 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_windows.inline.hpp"
+
 // Provides an entry point we can link against and
 // a buffer we can emit code into. The buffer is
 // filled by ThreadLocalStorage::generate_code_for_get_thread
 // and called from ThreadLocalStorage::thread()
 
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_windows_x86.cpp.incl"
-
 int ThreadLocalStorage::_thread_ptr_offset = 0;
 
 static void call_wrapper_dummy() {}
--- a/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP
+
 // Processor dependent parts of ThreadLocalStorage
 
 protected:
@@ -42,3 +45,5 @@
   static inline void set_thread_ptr_offset( int offset ) { _thread_ptr_offset = offset; }
 
   static inline int get_thread_ptr_offset() { return _thread_ptr_offset; }
+
+#endif // OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP
--- a/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_thread_windows_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_windows.inline.hpp"
 
 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
 // currently interrupted by SIGPROF
--- a/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
+
  private:
   void pd_initialize() {
     _anchor.clear();
@@ -60,3 +63,5 @@
   static bool register_stack_overflow() { return false; }
   static void enable_register_stack_guard() {}
   static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
--- a/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP
+
 
 #ifdef AMD64
 typedef unsigned char UBYTE;
@@ -81,3 +84,5 @@
 #endif
 
 #endif // AMD64
+
+#endif // OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP
--- a/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP
+
 // These are the OS and CPU-specific fields, types and integer
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
@@ -52,3 +55,5 @@
                                                                         \
   /* This must be the last entry, and must be present */                \
   last_entry()
+
+#endif // OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP
--- a/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,7 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_windows_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
--- a/src/share/tools/MakeDeps/ArgsParser.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-class ArgIterator {
-    String[] args;
-    int i;
-    ArgIterator(String[] args) {
-        this.args = args;
-        this.i = 0;
-    }
-    String get() { return args[i]; }
-    boolean hasMore() { return args != null && i  < args.length; }
-    boolean next() { return ++i < args.length; }
-}
-
-abstract class ArgHandler {
-    public abstract void handle(ArgIterator it);
-
-}
-
-class ArgRule {
-    String arg;
-    ArgHandler handler;
-    ArgRule(String arg, ArgHandler handler) {
-        this.arg = arg;
-        this.handler = handler;
-    }
-
-    boolean process(ArgIterator it) {
-        if (match(it.get(), arg)) {
-            handler.handle(it);
-            return true;
-        }
-        return false;
-    }
-    boolean match(String rule_pattern, String arg) {
-        return arg.equals(rule_pattern);
-    }
-}
-
-class ArgsParser {
-    ArgsParser(String[] args,
-               ArgRule[] rules,
-               ArgHandler defaulter) {
-        ArgIterator ai = new ArgIterator(args);
-        while (ai.hasMore()) {
-            boolean processed = false;
-            for (int i=0; i<rules.length; i++) {
-                processed |= rules[i].process(ai);
-                if (processed) {
-                    break;
-                }
-            }
-            if (!processed) {
-                if (defaulter != null) {
-                    defaulter.handle(ai);
-                } else {
-                    System.err.println("ERROR: unparsed \""+ai.get()+"\"");
-                    ai.next();
-                }
-            }
-        }
-    }
-}
--- a/src/share/tools/MakeDeps/BuildConfig.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,717 +0,0 @@
-/*
- * Copyright (c) 2005, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.util.*;
-import java.io.File;
-
-class BuildConfig {
-    Hashtable vars;
-    Vector basicNames, basicPaths;
-    String[] context;
-
-    static CompilerInterface ci;
-    static CompilerInterface getCI() {
-        if (ci == null) {
-            String comp = (String)getField(null, "CompilerVersion");
-            try {
-                ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance();
-            } catch (Exception cnfe) {
-                System.err.println("Cannot find support for compiler " + comp);
-                throw new RuntimeException(cnfe.toString());
-            }
-        }
-        return ci;
-    }
-
-    protected void initNames(String flavour, String build, String outDll) {
-        if (vars == null) vars = new Hashtable();
-
-        String flavourBuild =  flavour + "_" + build;
-        put("Name", getCI().makeCfgName(flavourBuild));
-        put("Flavour", flavour);
-        put("Build", build);
-
-        // ones mentioned above were needed to expand format
-        String buildBase = expandFormat(getFieldString(null, "BuildBase"));
-        String jdkDir =  getFieldString(null, "JdkTargetRoot");
-        String sourceBase = getFieldString(null, "SourceBase");
-        String outDir = buildBase;
-
-        put("Id", flavourBuild);
-        put("OutputDir", outDir);
-        put("SourceBase", sourceBase);
-        put("BuildBase", buildBase);
-        put("OutputDll", jdkDir + Util.sep + outDll);
-
-        context = new String [] {flavourBuild, flavour, build, null};
-    }
-
-    protected void init(Vector includes, Vector defines) {
-        initDefaultDefines(defines);
-        initDefaultCompilerFlags(includes);
-        initDefaultLinkerFlags();
-        handleDB((String)getFieldInContext("IncludeDB"));
-    }
-
-
-    protected void initDefaultCompilerFlags(Vector includes) {
-        Vector compilerFlags = new Vector();
-
-        compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
-                                                          includes,
-                                                          get("OutputDir")));
-
-        put("CompilerFlags", compilerFlags);
-    }
-
-    protected void initDefaultLinkerFlags() {
-        Vector linkerFlags = new Vector();
-
-        linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll")));
-
-        put("LinkerFlags", linkerFlags);
-    }
-
-    DirectoryTree getSourceTree(String sourceBase, String startAt) {
-        DirectoryTree tree = new DirectoryTree();
-
-        tree.addSubdirToIgnore("Codemgr_wsdata");
-        tree.addSubdirToIgnore("deleted_files");
-        tree.addSubdirToIgnore("SCCS");
-        tree.setVerbose(true);
-        if (startAt != null) {
-            tree.readDirectory(sourceBase + File.separator + startAt);
-        } else {
-            tree.readDirectory(sourceBase);
-        }
-
-        return tree;
-    }
-
-
-    Vector getPreferredPaths(Database currentDB) {
-        Vector preferredPaths = new Vector();
-        // In the case of multiple files with the same name in
-        // different subdirectories, prefer the versions specified in
-        // the platform file as the "os_family" and "arch" macros.
-        for (Iterator iter = currentDB.getMacros(); iter.hasNext(); ) {
-            Macro macro = (Macro) iter.next();
-            if (macro.name.equals("os_family") ||
-                macro.name.equals("arch")) {
-                preferredPaths.add(macro.contents);
-            }
-        }
-        // Also prefer "opto" over "adlc" for adlcVMDeps.hpp
-        preferredPaths.add("opto");
-
-        return preferredPaths;
-    }
-
-
-    void handleDB(String dbFile) {
-        WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject");
-        Database db = new Database(platform, platform.defaultGrandIncludeThreshold());
-
-        try {
-            File incls = new File(get("OutputDir")+Util.sep+"incls");
-            FileName oldInclTempl = platform.getInclFileTemplate();
-            FileName oldGITempl = platform.getGIFileTemplate();
-            FileName oldGDTempl = platform.getGDFileTemplate();
-
-            platform.setInclFileTemplate(new FileName(platform, incls.getPath()+Util.sep,
-                                                      "_", "", ".incl", "", ""));
-            platform.setGIFileTemplate(new FileName(platform, incls.getPath()+Util.sep,
-                                                    "",  "_precompiled", ".incl", "", ""));
-
-            incls.mkdirs();
-
-            db.get(getFieldString(null, "Platform"), dbFile);
-            db.compute();
-
-            db.put();
-
-            //platform.setInclFileTemplate(oldInclTempl);
-            //platform.setGIFileTemplate(oldInclTempl);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new RuntimeException("cannot do db: "+e);
-        }
-
-        putSpecificField("AllFilesHash", computeAllFiles(platform, db));
-    }
-
-
-    void addAll(Iterator i, Hashtable hash,
-                WinGammaPlatform platform, DirectoryTree tree,
-                Vector preferredPaths, Vector filesNotFound, Vector filesDuplicate) {
-        for (; i.hasNext(); ) {
-            String fileName = (String) i.next();
-            if (lookupHashFieldInContext("IgnoreFile", fileName) == null) {
-                String prefixedName = platform.envVarPrefixedFileName(fileName,
-                                                                      0, /* ignored */
-                                                                      tree,
-                                                                      preferredPaths,
-                                                                      filesNotFound,
-                                                                      filesDuplicate);
-                if (prefixedName != null) {
-                    addTo(hash, Util.normalize(prefixedName), fileName);
-                }
-            }
-        }
-    }
-
-    void addTo(Hashtable ht, String key, String value) {
-        ht.put(expandFormat(key), expandFormat(value));
-    }
-
-    Hashtable computeAllFiles(WinGammaPlatform platform, Database db) {
-        Hashtable rv = new Hashtable();
-        DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt"));
-        Vector preferredPaths = getPreferredPaths(db);
-
-        // Hold errors until end
-        Vector filesNotFound = new Vector();
-        Vector filesDuplicate = new Vector();
-
-
-        // find all files
-        Vector dbFiles = new Vector();
-        for (Iterator i=db.getAllFiles().iterator(); i.hasNext(); ) {
-            FileList fl = (FileList) i.next();
-            dbFiles.add(fl.getName());
-        }
-        addAll(dbFiles.iterator(), rv,
-               platform, tree,
-               preferredPaths, filesNotFound, filesDuplicate);
-
-        Vector addFiles = new Vector();
-        collectRelevantVectors(addFiles, "AdditionalFile");
-        addAll(addFiles.iterator(), rv,
-               platform, tree,
-               preferredPaths, filesNotFound, filesDuplicate);
-
-        collectRelevantHashes(rv, "AdditionalGeneratedFile");
-
-        if ((filesNotFound.size() != 0) ||
-            (filesDuplicate.size() != 0)) {
-            System.err.println("Error: some files were not found or " +
-                               "appeared in multiple subdirectories of " +
-                               "directory " + get("SourceBase") + " and could not " +
-                               "be resolved with the os_family and arch " +
-                               "macros in the platform file.");
-            if (filesNotFound.size() != 0) {
-                System.err.println("Files not found:");
-                for (Iterator iter = filesNotFound.iterator();
-                     iter.hasNext(); ) {
-                    System.err.println("  " + (String) iter.next());
-                }
-            }
-            if (filesDuplicate.size() != 0) {
-                System.err.println("Duplicate files:");
-                for (Iterator iter = filesDuplicate.iterator();
-                     iter.hasNext(); ) {
-                    System.err.println("  " + (String) iter.next());
-                }
-            }
-            throw new RuntimeException();
-        }
-
-        return rv;
-    }
-
-    void initDefaultDefines(Vector defines) {
-        Vector sysDefines = new Vector();
-        if( Util.os().equals("Win32")) {
-        	sysDefines.add("WIN32");
-            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
-        } else {
-        	sysDefines.add("_AMD64_");
-        	sysDefines.add("AMD64");
-        	sysDefines.add("_WIN64");
-        	sysDefines.add("_LP64");
-        	if (System.getenv("MSC_VER") != null)
-        		sysDefines.add("MSC_VER=" + System.getenv("MSC_VER"));
-            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
-        }
-        sysDefines.add("_WINDOWS");
-        sysDefines.add("HOTSPOT_BUILD_USER="+System.getProperty("user.name"));
-        sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
-        sysDefines.add("_JNI_IMPLEMENTATION_");
-
-        sysDefines.addAll(defines);
-
-        put("Define", sysDefines);
-    }
-
-    String get(String key) {
-        return (String)vars.get(key);
-    }
-
-    Vector getV(String key) {
-        return (Vector)vars.get(key);
-    }
-
-    Object getO(String key) {
-        return vars.get(key);
-    }
-
-    Hashtable getH(String key) {
-        return (Hashtable)vars.get(key);
-    }
-
-    Object getFieldInContext(String field) {
-        for (int i=0; i<context.length; i++) {
-            Object rv = getField(context[i], field);
-            if (rv != null) {
-                return rv;
-            }
-        }
-        return null;
-    }
-
-    Object lookupHashFieldInContext(String field, String key) {
-        for (int i=0; i<context.length; i++) {
-            Hashtable ht = (Hashtable)getField(context[i], field);
-            if (ht != null) {
-                Object rv = ht.get(key);
-                if (rv != null) {
-                    return rv;
-                }
-            }
-        }
-        return null;
-    }
-
-    void put(String key, String value) {
-        vars.put(key, value);
-    }
-
-    void put(String key, Vector vvalue) {
-        vars.put(key, vvalue);
-    }
-
-    void add(String key, Vector vvalue) {
-        getV(key).addAll(vvalue);
-    }
-
-    String flavour() {
-        return get("Flavour");
-    }
-
-    String build() {
-        return get("Build");
-    }
-
-    Object getSpecificField(String field) {
-        return getField(get("Id"), field);
-    }
-
-    void putSpecificField(String field, Object value) {
-        putField(get("Id"), field, value);
-    }
-
-    void collectRelevantVectors(Vector rv, String field) {
-        for (int i = 0; i < context.length; i++) {
-            Vector v = getFieldVector(context[i], field);
-            if (v != null) {
-                for (Iterator j=v.iterator(); j.hasNext(); ) {
-                    String val = (String)j.next();
-                    rv.add(expandFormat(val));
-                }
-            }
-        }
-    }
-
-    void collectRelevantHashes(Hashtable rv, String field) {
-        for (int i = 0; i < context.length; i++) {
-            Hashtable v = (Hashtable)getField(context[i], field);
-            if (v != null) {
-                for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
-                    String key = (String)e.nextElement();
-                    String val =  (String)v.get(key);
-                    addTo(rv, key, val);
-                }
-            }
-        }
-    }
-
-
-    Vector getDefines() {
-        Vector rv = new Vector();
-        collectRelevantVectors(rv, "Define");
-        return rv;
-    }
-
-    Vector getIncludes() {
-        Vector rv = new Vector();
-
-        // for generated includes
-        rv.add(get("OutputDir"));
-
-        collectRelevantVectors(rv, "AbsoluteInclude");
-
-        Vector ri = new Vector();
-        String sourceBase = getFieldString(null, "SourceBase");
-        collectRelevantVectors(ri, "RelativeInclude");
-        for (Iterator i = ri.iterator(); i.hasNext(); ) {
-            String f = (String)i.next();
-            rv.add(sourceBase + Util.sep + f);
-        }
-
-        return rv;
-    }
-
-    static Hashtable cfgData = new Hashtable();
-    static Hashtable globalData = new Hashtable();
-
-    static boolean appliesToTieredBuild(String cfg) {
-        return (cfg != null &&
-                (cfg.startsWith("compiler1") ||
-                 cfg.startsWith("compiler2")));
-    }
-
-    // Filters out the IncludeDB statement, which is the only command-
-    // line argument we explicitly specialize for the tiered build
-    static boolean appliesToTieredBuild(String cfg, String key) {
-        return (appliesToTieredBuild(cfg) &&
-                (key != null &&
-                 !key.equals("IncludeDB")));
-    }
-
-    static String getTieredBuildCfg(String cfg) {
-        assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
-        return "tiered" + cfg.substring(9);
-    }
-
-    static Object getField(String cfg, String field) {
-        if (cfg == null) {
-            return globalData.get(field);
-        }
-
-        Hashtable ht =  (Hashtable)cfgData.get(cfg);
-        return ht == null ? null : ht.get(field);
-    }
-
-    static String getFieldString(String cfg, String field) {
-        return (String)getField(cfg, field);
-    }
-
-    static Vector getFieldVector(String cfg, String field) {
-        return (Vector)getField(cfg, field);
-    }
-
-    static void putField(String cfg, String field, Object value) {
-        putFieldImpl(cfg, field, value);
-        if (appliesToTieredBuild(cfg, field)) {
-            putFieldImpl(getTieredBuildCfg(cfg), field, value);
-        }
-    }
-
-    private static void putFieldImpl(String cfg, String field, Object value) {
-        if (cfg == null) {
-            globalData.put(field, value);
-            return;
-        }
-
-        Hashtable ht = (Hashtable)cfgData.get(cfg);
-        if (ht == null) {
-            ht = new Hashtable();
-            cfgData.put(cfg, ht);
-        }
-
-        ht.put(field, value);
-    }
-
-    static Object getFieldHash(String cfg, String field, String name) {
-        Hashtable ht = (Hashtable)getField(cfg, field);
-
-        return ht == null ? null : ht.get(name);
-    }
-
-    static void putFieldHash(String cfg, String field, String name, Object val) {
-        putFieldHashImpl(cfg, field, name, val);
-        if (appliesToTieredBuild(cfg)) {
-            putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
-        }
-    }
-
-    private static void putFieldHashImpl(String cfg, String field, String name, Object val) {
-        Hashtable ht = (Hashtable)getField(cfg, field);
-
-        if (ht == null) {
-            ht = new Hashtable();
-            putFieldImpl(cfg, field, ht);
-        }
-
-        ht.put(name, val);
-    }
-
-    static void addFieldVector(String cfg, String field, String element) {
-        addFieldVectorImpl(cfg, field, element);
-        if (appliesToTieredBuild(cfg)) {
-            addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
-        }
-    }
-
-    private static void addFieldVectorImpl(String cfg, String field, String element) {
-        Vector v = (Vector)getField(cfg, field);
-
-        if (v == null) {
-            v = new Vector();
-            putFieldImpl(cfg, field, v);
-        }
-
-        v.add(element);
-    }
-
-    String expandFormat(String format) {
-        if (format == null) {
-            return null;
-        }
-
-        if (format.indexOf('%') == -1) {
-            return format;
-        }
-
-        StringBuffer sb = new StringBuffer();
-        int len = format.length();
-        for (int i=0; i<len; i++) {
-            char ch = format.charAt(i);
-            if (ch == '%') {
-                char ch1 = format.charAt(i+1);
-                switch (ch1) {
-                case '%':
-                    sb.append(ch1);
-                    break;
-                case 'b':
-                    sb.append(build());
-                    break;
-                case 'f':
-                    sb.append(flavour());
-                    break;
-                default:
-                    sb.append(ch);
-                    sb.append(ch1);
-                }
-                i++;
-            } else {
-                sb.append(ch);
-            }
-        }
-
-        return sb.toString();
-    }
-}
-
-abstract class GenericDebugConfig extends BuildConfig {
-    abstract String getOptFlag();
-
-    protected void init(Vector includes, Vector defines) {
-        defines.add("_DEBUG");
-        defines.add("ASSERT");
-
-        super.init(includes, defines);
-
-        getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag()));
-        getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags());
-   }
-}
-
-class C1DebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    C1DebugConfig() {
-        initNames("compiler1", "debug", "fastdebug\\jre\\bin\\client\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class C1FastDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    C1FastDebugConfig() {
-        initNames("compiler1", "fastdebug", "fastdebug\\jre\\bin\\client\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class C2DebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    C2DebugConfig() {
-        initNames("compiler2", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class C2FastDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    C2FastDebugConfig() {
-        initNames("compiler2", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class TieredDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    TieredDebugConfig() {
-        initNames("tiered", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class TieredFastDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    TieredFastDebugConfig() {
-        initNames("tiered", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-abstract class ProductConfig extends BuildConfig {
-    protected void init(Vector includes, Vector defines) {
-        defines.add("NDEBUG");
-        defines.add("PRODUCT");
-
-        super.init(includes, defines);
-
-        getV("CompilerFlags").addAll(getCI().getProductCompilerFlags());
-        getV("LinkerFlags").addAll(getCI().getProductLinkerFlags());
-    }
-}
-
-class C1ProductConfig extends ProductConfig {
-    C1ProductConfig() {
-        initNames("compiler1", "product", "jre\\bin\\client\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class C2ProductConfig extends ProductConfig {
-    C2ProductConfig() {
-        initNames("compiler2", "product", "jre\\bin\\server\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class TieredProductConfig extends ProductConfig {
-    TieredProductConfig() {
-        initNames("tiered", "product", "jre\\bin\\server\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-class CoreDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    CoreDebugConfig() {
-        initNames("core", "debug", "fastdebug\\jre\\bin\\core\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-class CoreFastDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    CoreFastDebugConfig() {
-        initNames("core", "fastdebug", "fastdebug\\jre\\bin\\core\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-class CoreProductConfig extends ProductConfig {
-    CoreProductConfig() {
-        initNames("core", "product", "jre\\bin\\core\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class KernelDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    KernelDebugConfig() {
-        initNames("kernel", "debug", "fastdebug\\jre\\bin\\kernel\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-class KernelFastDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    KernelFastDebugConfig() {
-        initNames("kernel", "fastdebug", "fastdebug\\jre\\bin\\kernel\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-class KernelProductConfig extends ProductConfig {
-    KernelProductConfig() {
-        initNames("kernel", "product", "jre\\bin\\kernel\\jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-abstract class CompilerInterface {
-    abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
-    abstract Vector getBaseLinkerFlags(String outDir, String outDll);
-    abstract Vector getDebugCompilerFlags(String opt);
-    abstract Vector getDebugLinkerFlags();
-    abstract Vector getProductCompilerFlags();
-    abstract Vector getProductLinkerFlags();
-    abstract String getOptFlag();
-    abstract String getNoOptFlag();
-    abstract String makeCfgName(String flavourBuild);
-
-    void addAttr(Vector receiver, String attr, String value) {
-        receiver.add(attr); receiver.add(value);
-    }
-}
--- a/src/share/tools/MakeDeps/Database.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,552 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class Database {
-  private MacroDefinitions macros;
-  // allFiles is kept in lexicographically sorted order. See get().
-  private FileList allFiles;
-  // files that have implicit dependency on platform files
-  // e.g. os.hpp: os_<os_family>.hpp os_<os_arch>.hpp but only
-  // recorded if the platform file was seen.
-  private FileList platformFiles;
-  private FileList outerFiles;
-  private FileList indivIncludes;
-  private FileList grandInclude; // the results for the grand include file
-  private HashMap<String,String> platformDepFiles;
-  private long threshold;
-  private int nOuterFiles;
-  private boolean missingOk;
-  private Platform plat;
-  /** These allow you to specify files not in the include database
-    which are prepended and appended to the file list, allowing
-    you to have well-known functions at the start and end of the
-    text segment (allows us to find out in a portable fashion
-    whether the current PC is in VM code or not upon a crash) */
-  private String firstFile;
-  private String lastFile;
-
-  public Database(Platform plat, long t) {
-    this.plat = plat;
-    macros          = new MacroDefinitions();
-    allFiles        = new FileList("allFiles", plat);
-    platformFiles   = new FileList("platformFiles", plat);
-    outerFiles      = new FileList("outerFiles", plat);
-    indivIncludes   = new FileList("IndivIncludes", plat);
-    grandInclude    = new FileList(plat.getGIFileTemplate().nameOfList(), plat);
-    platformDepFiles = new HashMap<String,String>();
-
-    threshold = t;
-    nOuterFiles = 0;
-    missingOk = false;
-    firstFile = null;
-    lastFile = null;
-  };
-
-  public FileList getAllFiles() {
-    return allFiles;
-  }
-
-  public Iterator getMacros() {
-    return macros.getMacros();
-  }
-
-  public void canBeMissing() {
-    missingOk = true;
-  }
-
-  public boolean hfileIsInGrandInclude(FileList hfile, FileList cfile) {
-    return ((hfile.getCount() >= threshold) && (cfile.getUseGrandInclude()));
-  }
-
-  /** These allow you to specify files not in the include database
-    which are prepended and appended to the file list, allowing
-    you to have well-known functions at the start and end of the
-    text segment (allows us to find out in a portable fashion
-    whether the current PC is in VM code or not upon a crash) */
-  public void setFirstFile(String fileName) {
-    firstFile = fileName;
-  }
-
-  public void setLastFile(String fileName) {
-    lastFile = fileName;
-  }
-
-  public void get(String platFileName, String dbFileName)
-    throws FileFormatException, IOException, FileNotFoundException {
-      macros.readFrom(platFileName, missingOk);
-
-      BufferedReader reader = null;
-      try {
-        reader = new BufferedReader(new FileReader(dbFileName));
-      } catch (FileNotFoundException e) {
-        if (missingOk) {
-          return;
-        } else {
-          throw(e);
-        }
-      }
-      System.out.println("\treading database: " + dbFileName);
-      String line;
-      int lineNo = 0;
-      do {
-        line = reader.readLine();
-        lineNo++;
-        if (line != null) {
-          StreamTokenizer tokenizer =
-            new StreamTokenizer(new StringReader(line));
-          tokenizer.slashSlashComments(true);
-          tokenizer.wordChars('_', '_');
-          tokenizer.wordChars('<', '>');
-          // NOTE: if we didn't have to do this line by line,
-          // we could trivially recognize C-style comments as
-          // well.
-          // tokenizer.slashStarComments(true);
-          int numTok = 0;
-          int res;
-          String unexpandedIncluder = null;
-          String unexpandedIncludee = null;
-          do {
-            res = tokenizer.nextToken();
-            if (res != StreamTokenizer.TT_EOF) {
-              if (numTok == 0) {
-                unexpandedIncluder = tokenizer.sval;
-              } else if (numTok == 1) {
-                unexpandedIncludee = tokenizer.sval;
-              } else {
-                throw new FileFormatException(
-                    "invalid line: \"" + line +
-                    "\". Error position: line " + lineNo
-                    );
-              }
-              numTok++;
-            }
-          } while (res != StreamTokenizer.TT_EOF);
-
-          if ((numTok != 0) && (numTok != 2)) {
-            throw new FileFormatException(
-                "invalid line: \"" + line +
-                "\". Error position: line " + lineNo
-                );
-          }
-
-          if (numTok == 2) {
-            // Non-empty line
-            String includer = macros.expand(unexpandedIncluder);
-            String includee = macros.expand(unexpandedIncludee);
-
-            if (includee.equals(plat.generatePlatformDependentInclude())) {
-              MacroDefinitions localExpander = macros.copy();
-              MacroDefinitions localExpander2 = macros.copy();
-              localExpander.setAllMacroBodiesTo("pd");
-              localExpander2.setAllMacroBodiesTo("");
-
-              // unexpanded_includer e.g. thread_<os_arch>.hpp
-              // thread_solaris_i486.hpp -> _thread_pd.hpp.incl
-
-              FileName pdName =
-                plat.getInclFileTemplate().copyStem(
-                    localExpander.expand(unexpandedIncluder)
-                    );
-
-              // derive generic name from platform specific name
-              // e.g. os_<arch_os>.hpp => os.hpp. We enforce the
-              // restriction (imperfectly) noted in includeDB_core
-              // that platform specific files will have an underscore
-              // preceding the macro invocation.
-
-              // First expand macro as null string.
-
-              String newIncluder_temp =
-                localExpander2.expand(unexpandedIncluder);
-
-              // Now find "_." and remove the underscore.
-
-              String newIncluder = "";
-
-              int len = newIncluder_temp.length();
-              int count = 0;
-
-              for ( int i = 0; i < len - 1 ; i++ ) {
-                if (newIncluder_temp.charAt(i) == '_' && newIncluder_temp.charAt(i+1) == '.') {
-                  count++;
-                } else {
-                  newIncluder += newIncluder_temp.charAt(i);
-                }
-              }
-              newIncluder += newIncluder_temp.charAt(len-1);
-
-              if (count != 1) {
-                throw new FileFormatException(
-                    "Unexpected filename format for platform dependent file.\nline: \"" + line +
-                    "\".\nError position: line " + lineNo
-                    );
-              }
-
-              FileList p = allFiles.listForFile(includer);
-              p.setPlatformDependentInclude(pdName.dirPreStemSuff());
-
-              // Record the implicit include of this file so that the
-              // dependencies for precompiled headers can mention it.
-              platformDepFiles.put(newIncluder, includer);
-
-              // Add an implicit dependency on platform
-              // specific file for the generic file
-
-              p = platformFiles.listForFile(newIncluder);
-
-              // if this list is empty then this is 1st
-              // occurance of a platform dependent file and
-              // we need a new version of the include file.
-              // Otherwise we just append to the current
-              // file.
-
-              PrintWriter pdFile =
-                new PrintWriter(
-                    new FileWriter(pdName.dirPreStemSuff(),
-                      !p.isEmpty())
-                    );
-              pdFile.println("# include \"" + includer + "\"");
-              pdFile.close();
-
-              // Add the platform specific file to the list
-              // for this generic file.
-
-              FileList q = allFiles.listForFile(includer);
-              p.addIfAbsent(q);
-            } else {
-              FileList p = allFiles.listForFile(includer);
-              if (isOuterFile(includer))
-                outerFiles.addIfAbsent(p);
-
-              if (includee.equals(plat.noGrandInclude())) {
-                p.setUseGrandInclude(false);
-              } else {
-                FileList q = allFiles.listForFile(includee);
-                p.addIfAbsent(q);
-              }
-            }
-          }
-        }
-      } while (line != null);
-      reader.close();
-
-      // Keep allFiles in well-known order so we can easily determine
-      // whether the known files are the same
-      allFiles.sortByName();
-
-      // Add first and last files differently to prevent a mistake
-      // in ordering in the include databases from breaking the
-      // error reporting in the VM.
-      if (firstFile != null) {
-        FileList p = allFiles.listForFile(firstFile);
-        allFiles.setFirstFile(p);
-        outerFiles.setFirstFile(p);
-      }
-
-      if (lastFile != null) {
-        FileList p = allFiles.listForFile(lastFile);
-        allFiles.setLastFile(p);
-        outerFiles.setLastFile(p);
-      }
-    }
-
-  public void compute() {
-    System.out.println("\tcomputing closures\n");
-    // build both indiv and grand results
-    for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) {
-      indivIncludes.add(((FileList) iter.next()).doCFile());
-      ++nOuterFiles;
-    }
-
-    if (!plat.haveGrandInclude())
-      return; // nothing in grand include
-
-    // count how many times each include is included & add em to grand
-    for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
-      FileList indivInclude = (FileList) iter.next();
-      if (!indivInclude.getUseGrandInclude()) {
-        continue; // do not bump count if my files cannot be
-        // in grand include
-      }
-      indivInclude.doFiles(grandInclude); // put em on
-      // grand_include list
-      for (Iterator incListIter = indivInclude.iterator();
-          incListIter.hasNext(); ) {
-        ((FileList) incListIter.next()).incrementCount();
-      }
-    }
-  }
-
-  // Not sure this is necessary in Java
-  public void verify() {
-    for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
-      if (iter.next() == null) {
-        plat.abort();
-      }
-    }
-  }
-
-  public void put() throws IOException {
-    writeIndividualIncludes();
-
-    if (plat.haveGrandInclude())
-      writeGrandInclude();
-
-    writeGrandUnixMakefile();
-  }
-
-  private void writeIndividualIncludes() throws IOException {
-    System.out.println("\twriting individual include files\n");
-
-    for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
-      FileList list = (FileList) iter.next();
-      System.out.println("\tcreating " + list.getName());
-      list.putInclFile(this);
-    }
-  }
-
-  private void writeGrandInclude() throws IOException {
-    System.out.println("\twriting grand include file\n");
-    PrintWriter inclFile =
-      new PrintWriter(new FileWriter(plat.getGIFileTemplate().dirPreStemSuff()));
-    plat.writeGIPragma(inclFile);
-    for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) {
-      FileList list = (FileList) iter.next();
-      if (list.getCount() >= threshold) {
-        inclFile.println("# include \"" +
-            plat.getGIFileTemplate().getInvDir() +
-            list.getName() +
-            "\"");
-      }
-    }
-    inclFile.println();
-    inclFile.close();
-  }
-
-  private void writeGrandUnixMakefile() throws IOException {
-    if (!plat.writeDeps())
-      return;
-
-    System.out.println("\twriting dependencies file\n");
-    PrintWriter gd =
-      new PrintWriter(new FileWriter(
-            plat.getGDFileTemplate().dirPreStemSuff())
-          );
-    gd.println("# generated by makeDeps");
-    gd.println();
-
-
-    // HACK ALERT. The compilation of ad_<arch> files is very slow.
-    // We want to start compiling them as early as possible. The compilation
-    // order on unix is dependent on the order we emit files here.
-    // By sorting the output before emitting it, we expect
-    // that ad_<arch> will be compiled early.
-    boolean shouldSortObjFiles = true;
-
-    if (shouldSortObjFiles) {
-      ArrayList sortList = new ArrayList();
-
-      // We need to preserve the ordering of the first and last items
-      // in outerFiles.
-      int size = outerFiles.size() - 1;
-      String firstName = removeSuffixFrom(((FileList)outerFiles.get(0)).getName());
-      String lastName = removeSuffixFrom(((FileList)outerFiles.get(size)).getName());
-
-      for (int i=1; i<size; i++) {
-        FileList anOuterFile = (FileList)outerFiles.get(i);
-        String stemName = removeSuffixFrom(anOuterFile.getName());
-        sortList.add(stemName);
-      }
-      Collections.sort(sortList);
-
-      // write Obj_Files = ...
-      gd.println("Obj_Files = \\");
-      gd.println(firstName + plat.objFileSuffix() + " \\");
-      for (Iterator iter = sortList.iterator(); iter.hasNext(); ) {
-        gd.println(iter.next() + plat.objFileSuffix() + " \\");
-      }
-      gd.println(lastName + plat.objFileSuffix() + " \\");
-      gd.println();
-      gd.println();
-    } else {
-      // write Obj_Files = ...
-      gd.println("Obj_Files = \\");
-      for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) {
-        FileList anOuterFile = (FileList) iter.next();
-
-        String stemName = removeSuffixFrom(anOuterFile.getName());
-        gd.println(stemName + plat.objFileSuffix() + " \\");
-      }
-      gd.println();
-      gd.println();
-    }
-
-    // write Precompiled_Files = ...
-    gd.println("Precompiled_Files = \\");
-    for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) {
-      FileList list = (FileList) iter.next();
-      if (list.getCount() >= threshold) {
-        gd.println(list.getName() + " \\");
-        String platformDep = platformDepFiles.get(list.getName());
-        if (platformDep != null) {
-          // make sure changes to the platform dependent file will
-          // cause regeneration of the pch file.
-          gd.println(platformDep + " \\");
-        }
-      }
-    }
-    gd.println();
-    gd.println();
-
-    gd.println("DTraced_Files = \\");
-    for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) {
-      FileList anOuterFile = (FileList) iter.next();
-
-      if (anOuterFile.hasListForFile("dtrace.hpp")) {
-        String stemName = removeSuffixFrom(anOuterFile.getName());
-        gd.println(stemName + plat.objFileSuffix() + " \\");
-      }
-    }
-    gd.println();
-    gd.println();
-
-    {
-      // write each dependency
-
-      for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
-
-        FileList anII = (FileList) iter.next();
-
-        String stemName = removeSuffixFrom(anII.getName());
-        String inclFileName =
-          plat.getInclFileTemplate().copyStem(anII.getName()).
-          preStemSuff();
-
-        gd.println(stemName + plat.objFileSuffix() + " " +
-            stemName + plat.asmFileSuffix() + ": \\");
-
-        printDependentOn(gd, anII.getName());
-        // this gets the include file that includes all that
-        // this file needs (first level) since nested includes
-        // are skipped to avoid cycles.
-        printDependentOn(gd, inclFileName);
-
-        if ( plat.haveGrandInclude() ) {
-          printDependentOn(gd,
-              plat.getGIFileTemplate().preStemSuff());
-        }
-
-        for (Iterator iiIter = anII.iterator(); iiIter.hasNext(); ) {
-          FileList hfile = (FileList) iiIter.next();
-          if (!hfileIsInGrandInclude(hfile, anII) ||
-              plat.writeDependenciesOnHFilesFromGI()) {
-                printDependentOn(gd, hfile.getName());
-          }
-          if (platformFiles.hasListForFile(hfile.getName())) {
-            FileList p =
-              platformFiles.listForFile(hfile.getName());;
-            for (Iterator hiIter = p.iterator();
-                hiIter.hasNext(); ) {
-              FileList hi2 = (FileList) hiIter.next();
-              if (!hfileIsInGrandInclude(hi2, p)) {
-                printDependentOn(gd, hi2.getName());
-              }
-            }
-          }
-        }
-
-        if (plat.includeGIDependencies()
-            && anII.getUseGrandInclude()) {
-          gd.println("    $(Precompiled_Files) \\");
-        }
-        gd.println();
-        gd.println();
-      }
-    }
-
-    gd.close();
-  }
-
-  public void putDiffs(Database previous) throws IOException {
-    System.out.println("\tupdating output files\n");
-
-    if (!indivIncludes.compareLists(previous.indivIncludes)
-        || !grandInclude.compareLists(previous.grandInclude)) {
-      System.out.println("The order of .c or .s has changed, or " +
-          "the grand include file has changed.");
-      put();
-      return;
-    }
-
-    Iterator curIter = indivIncludes.iterator();
-    Iterator prevIter = previous.indivIncludes.iterator();
-
-    try {
-      while (curIter.hasNext()) {
-        FileList newCFileList = (FileList) curIter.next();
-        FileList prevCFileList = (FileList) prevIter.next();
-        if (!newCFileList.compareLists(prevCFileList)) {
-          System.out.println("\tupdating " + newCFileList.getName());
-          newCFileList.putInclFile(this);
-        }
-      }
-    }
-    catch (Exception e) {
-      throw new InternalError("assertion failure: cur and prev " +
-          "database lists changed unexpectedly.");
-    }
-
-    writeGrandUnixMakefile();
-  }
-
-  private void printDependentOn(PrintWriter gd, String name) {
-    gd.print(" ");
-    gd.print(plat.dependentPrefix() + name);
-  }
-
-  private boolean isOuterFile(String s) {
-    int len = s.length();
-    String[] suffixes = plat.outerSuffixes();
-    for (int i = 0; i < suffixes.length; i++) {
-      String suffix = suffixes[i];
-      int suffLen = suffix.length();
-      if ((len >= suffLen) &&
-          (plat.fileNameStringEquality(s.substring(len - suffLen),
-                                       suffix))) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  private String removeSuffixFrom(String s) {
-    int idx = s.lastIndexOf('.');
-    if (idx <= 0)
-      plat.abort();
-    return s.substring(0, idx);
-  }
-}
--- a/src/share/tools/MakeDeps/DirectoryTree.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,257 +0,0 @@
-/*
- * 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/** Encapsulates a notion of a directory tree. Designed to allow fast
-    querying of full paths for unique filenames in the hierarchy. */
-
-import java.io.*;
-import java.util.*;
-
-public class DirectoryTree {
-
-    /** The root of the read directoryTree */
-    private Node rootNode;
-
-    /** Subdirs to ignore; Vector of Strings */
-    private Vector subdirsToIgnore;
-
-    /** This maps file names to Lists of nodes. */
-    private Hashtable nameToNodeListTable;
-
-    /** Output "."'s as directories are read. Defaults to false. */
-    private boolean verbose;
-
-    public DirectoryTree() {
-        subdirsToIgnore = new Vector();
-        verbose = false;
-    }
-
-    /** Takes an absolute path to the root directory of this
-        DirectoryTree. Throws IllegalArgumentException if the given
-        string represents a plain file or nonexistent directory. */
-
-    public DirectoryTree(String baseDirectory) {
-        this();
-        readDirectory(baseDirectory);
-    }
-
-    public void addSubdirToIgnore(String subdir) {
-        subdirsToIgnore.add(subdir);
-    }
-
-    /** Output "."'s to System.out as directories are read. Defaults
-        to false. */
-    public void setVerbose(boolean newValue) {
-        verbose = newValue;
-    }
-
-    public boolean getVerbose() {
-        return verbose;
-    }
-
-    public String getRootNodeName() {
-        return rootNode.getName();
-    }
-
-    /** Takes an absolute path to the root directory of this
-        DirectoryTree. Throws IllegalArgumentException if the given
-        string represents a plain file or nonexistent directory. */
-
-    public void readDirectory(String baseDirectory)
-        throws IllegalArgumentException {
-        File root = new File(baseDirectory);
-        if (!root.isDirectory()) {
-            throw new IllegalArgumentException("baseDirectory \"" +
-                                               baseDirectory +
-                                               "\" does not exist or " +
-                                               "is not a directory");
-        }
-        try {
-            root = root.getCanonicalFile();
-        }
-        catch (IOException e) {
-            throw new RuntimeException(e.toString());
-        }
-        rootNode = new Node(root);
-        readDirectory(rootNode, root);
-    }
-
-    /** Queries the DirectoryTree for a file or directory name. Takes
-        only the name of the file or directory itself (i.e., no parent
-        directory information should be in the passed name). Returns a
-        List of DirectoryTreeNodes specifying the full paths of all of
-        the files or directories of this name in the DirectoryTree.
-        Returns null if the directory tree has not been read from disk
-        yet or if the file was not found in the tree. */
-    public List findFile(String name) {
-        if (rootNode == null) {
-            return null;
-        }
-
-        if (nameToNodeListTable == null) {
-            nameToNodeListTable = new Hashtable();
-            try {
-                buildNameToNodeListTable(rootNode);
-            } catch (IOException e) {
-                e.printStackTrace();
-                return null;
-            }
-        }
-
-        return (List) nameToNodeListTable.get(name);
-    }
-
-    private void buildNameToNodeListTable(Node curNode)
-      throws IOException {
-        String fullName = curNode.getName();
-        String parent = curNode.getParent();
-        String separator = System.getProperty("file.separator");
-
-        if (parent != null) {
-          if (!fullName.startsWith(parent)) {
-            throw new RuntimeException(
-                "Internal error: parent of file name \"" + fullName +
-                "\" does not match file name \"" + parent + "\""
-            );
-          }
-
-          int len = parent.length();
-          if (!parent.endsWith(separator)) {
-            len += separator.length();
-          }
-
-          String fileName = fullName.substring(len);
-
-          if (fileName == null) {
-            throw new RuntimeException(
-                "Internal error: file name was empty"
-            );
-          }
-
-          List nodeList = (List) nameToNodeListTable.get(fileName);
-          if (nodeList == null) {
-            nodeList = new Vector();
-            nameToNodeListTable.put(fileName, nodeList);
-          }
-
-          nodeList.add(curNode);
-        } else {
-          if (curNode != rootNode) {
-            throw new RuntimeException(
-                "Internal error: parent of file + \"" + fullName + "\"" +
-                " was null"
-            );
-          }
-        }
-
-        if (curNode.isDirectory()) {
-          Iterator iter = curNode.getChildren();
-          if (iter != null) {
-            while (iter.hasNext()) {
-              buildNameToNodeListTable((Node) iter.next());
-            }
-          }
-        }
-    }
-
-    /** Reads all of the files in the given directory and adds them as
-        children of the directory tree node. Requires that the passed
-        node represents a directory. */
-
-    private void readDirectory(Node parentNode, File parentDir) {
-        File[] children = parentDir.listFiles();
-        if (children == null)
-            return;
-        if (verbose) {
-            System.out.print(".");
-            System.out.flush();
-        }
-        for (int i = 0; i < children.length; i++) {
-            File child = children[i];
-            children[i] = null;
-            boolean isDir = child.isDirectory();
-            boolean mustSkip = false;
-            if (isDir) {
-                for (Iterator iter = subdirsToIgnore.iterator();
-                     iter.hasNext(); ) {
-                    if (child.getName().equals((String) iter.next())) {
-                        mustSkip = true;
-                        break;
-                    }
-                }
-            }
-            if (!mustSkip) {
-                Node childNode = new Node(child);
-                parentNode.addChild(childNode);
-                if (isDir) {
-                    readDirectory(childNode, child);
-                }
-            }
-        }
-    }
-
-    private class Node implements DirectoryTreeNode {
-        private File file;
-        private Vector children;
-
-        /** file must be a canonical file */
-        Node(File file) {
-            this.file = file;
-            children = new Vector();
-        }
-
-        public boolean isFile() {
-            return file.isFile();
-        }
-
-        public boolean isDirectory() {
-            return file.isDirectory();
-        }
-
-        public String getName() {
-            return file.getPath();
-        }
-
-        public String getParent() {
-            return file.getParent();
-        }
-
-        public void addChild(Node n) {
-            children.add(n);
-        }
-
-        public Iterator getChildren() throws IllegalArgumentException {
-            return children.iterator();
-        }
-
-        public int getNumChildren() throws IllegalArgumentException {
-            return children.size();
-        }
-
-        public DirectoryTreeNode getChild(int i)
-            throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
-            return (DirectoryTreeNode) children.get(i);
-        }
-    }
-}
--- a/src/share/tools/MakeDeps/DirectoryTreeNode.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.util.*;
-
-public interface DirectoryTreeNode {
-    public boolean isFile();
-    public boolean isDirectory();
-    public String getName();
-    public String getParent();
-    public Iterator getChildren() throws IllegalArgumentException;
-    public int getNumChildren() throws IllegalArgumentException;
-    public DirectoryTreeNode getChild(int i)
-        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-}
--- a/src/share/tools/MakeDeps/FileFormatException.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-public class FileFormatException extends Exception {
-    public FileFormatException() {
-        super();
-    }
-
-    public FileFormatException(String s) {
-        super(s);
-    }
-}
--- a/src/share/tools/MakeDeps/FileList.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1999, 2000, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-/** This class implements the java.util.List interface as well as
-    providing functionality specific to keeping track of lists of
-    files. See the documentation for the Database class to see how
-    these are used. Each FileList must only contain other FileLists
-    (although that is not currently enforced in the mutators). */
-
-public class FileList extends Vector {
-    private String name; // (also the file name)
-    private boolean beenHere;
-    private boolean mayBeCycle;
-    private boolean isCycle;
-    /** Put in list because a file can refuse to */
-    private boolean useGrandInclude;
-    private String platformDependentInclude;
-    private int count;
-    private Platform plat;
-
-    public FileList(String n, Platform plat) {
-        super();
-        this.plat = plat;
-        beenHere = mayBeCycle = isCycle = false;
-        platformDependentInclude = null;
-        name = n;
-        count = 0;
-        useGrandInclude = plat.haveGrandInclude();
-    }
-
-    // Change definition of equality from AbstractList so remove() works properly
-    public boolean equals(Object o) {
-      return ((Object) this) == o;
-    }
-
-    // Necessary accessors
-    public String getName() {
-        return name;
-    }
-
-    public void setPlatformDependentInclude(String arg) {
-        platformDependentInclude = arg;
-    }
-
-    public String getPlatformDependentInclude() {
-        return platformDependentInclude;
-    }
-
-    public boolean getUseGrandInclude() {
-        return useGrandInclude;
-    }
-
-    public void setUseGrandInclude(boolean arg) {
-        useGrandInclude = arg;
-    }
-
-    public void incrementCount() {
-        count++;
-    }
-
-    public int getCount() {
-        return count;
-    }
-
-    public FileList listForFile(String fileName) {
-        for (Iterator iter = iterator(); iter.hasNext(); ) {
-            FileList fl = (FileList) iter.next();
-            if (plat.fileNameStringEquality(fl.name, fileName)) {
-                plat.fileNamePortabilityCheck(fl.name, fileName);
-                return fl;
-            }
-        }
-        plat.fileNamePortabilityCheck(fileName);
-        FileList newList = new FileList(fileName, plat);
-        add(newList);
-        return newList;
-    }
-
-    public boolean hasListForFile(String fileName) {
-        for (Iterator iter = iterator(); iter.hasNext(); ) {
-            FileList fl = (FileList) iter.next();
-            if (plat.fileNameStringEquality(fl.name, fileName)) {
-                plat.fileNamePortabilityCheck(fl.name, fileName);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public boolean compareLists(FileList s) {
-        Iterator myIter = iterator();
-        Iterator hisIter = s.iterator();
-
-        while (myIter.hasNext() &&
-               hisIter.hasNext()) {
-            // crude: order dependent
-            FileList myElement = (FileList) myIter.next();
-            FileList hisElement = (FileList) hisIter.next();
-            if (!plat.fileNameStringEquality(myElement.name,
-                                             hisElement.name)) {
-                return false;
-            }
-        }
-
-        if (myIter.hasNext() != hisIter.hasNext()) {
-            // One ended earlier
-            return false;
-        }
-
-        return true;
-    }
-
-    public void addIfAbsent(FileList s) {
-        for (Iterator iter = iterator(); iter.hasNext(); ) {
-            if (iter.next() == s) {
-                return;
-            }
-        }
-        add(s);
-    }
-
-    public void sortByName() {
-        Collections.sort(this, new Comparator() {
-                public int compare(Object o1, Object o2) {
-                    FileList fl1 = (FileList) o1;
-                    FileList fl2 = (FileList) o2;
-                    return fl1.getName().compareTo(fl2.getName());
-                }
-            });
-    }
-
-    public void setFirstFile(FileList s) {
-      // Remove the file list if it's already here
-      remove(s);
-      add(0, s);
-    }
-
-    public void setLastFile(FileList s) {
-      // Remove the file list if it's already here
-      remove(s);
-      add(s);
-    }
-
-    public boolean doFiles(FileList s) {
-        boolean result = true;
-        for (Iterator iter = iterator(); iter.hasNext(); ) {
-            FileList h = (FileList) iter.next();
-            if (h.platformDependentInclude != null) {
-                System.err.println("Error: the source for " +
-                                   h.platformDependentInclude +
-                                   " is " + h.name + ".");
-                System.err.println("\tIt shouldn't be included directly by " +
-                                   name + ".");
-                h.platformDependentInclude = null; // report once per file
-                result = false;
-            }
-            h.doHFile(s);
-        }
-        return result;
-    }
-
-    public void traceCycle(FileList s) {
-        if (isCycle) // already traced
-            return;
-        isCycle = true;
-        System.err.println("\ttracing cycle for " + name);
-        // FIXME: must return status in caller routine
-        // exitCode = 1;
-        for (Iterator iter = iterator(); iter.hasNext(); ) {
-            FileList q = (FileList) iter.next();
-            if (q.mayBeCycle) {
-                if (s == q) {
-                    plat.fatalError("\tend of cycle for " + s.getName());
-                } else {
-                    q.traceCycle(s);
-                }
-            }
-        }
-    }
-
-    public void doHFile(FileList s) {
-        if (beenHere) {
-            if (mayBeCycle) {
-                traceCycle(this);
-            }
-            return;
-        }
-        beenHere = true;
-        mayBeCycle = true;
-        doFiles(s);
-        mayBeCycle = false;
-        s.add(this);
-    }
-
-    public FileList doCFile() {
-        FileList s = new FileList(name, plat);
-        s.useGrandInclude = useGrandInclude; // propagate this
-        doFiles(s);
-        for (Iterator iter = s.iterator(); iter.hasNext(); ) {
-            FileList l = (FileList) iter.next();
-            l.beenHere = false;
-        }
-        return s;
-    }
-
-    /** if .h file is included thresh times, put it in the grand
-        include file */
-    public void putInclFile(Database db)
-        throws IOException {
-        boolean needline = true;
-        FileName inclName = plat.getInclFileTemplate().copyStem(name);
-        PrintWriter inclFile =
-            new PrintWriter(new FileWriter(inclName.dirPreStemSuff()));
-        if (plat.haveGrandInclude() && plat.includeGIInEachIncl()) {
-            inclFile.println("# include \"" +
-                             plat.getGIFileTemplate().dirPreStemAltSuff() +
-                             "\"");
-            needline = false;
-        }
-        for (Iterator iter = iterator(); iter.hasNext(); ) {
-            FileList hfile = (FileList) iter.next();
-            if (!db.hfileIsInGrandInclude(hfile, this)) {
-                inclFile.println("# include \"" +
-                                 plat.getInclFileTemplate().getInvDir() +
-                                 hfile.name +
-                                 "\"");
-                needline = false;
-            }
-        }
-
-        // Solaris C++ in strict mode warns about empty files
-
-        if(needline) {
-            inclFile.println();
-        }
-
-        inclFile.close();
-    }
-}
--- a/src/share/tools/MakeDeps/FileName.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-public class FileName {
-    private String dir;
-    private String prefix;
-    private String stem;
-    private String suffix;
-    private String inverseDir;
-    private String altSuffix;
-
-    private String dpss;
-    private String psa;
-    private String dpsa;
-    private String pss;
-
-    private Platform plat;
-
-    /** None of the passed strings may be null. */
-
-    public FileName(Platform plat, String dir, String prefix,
-                    String stem, String suffix,
-                    String inverseDir, String altSuffix) {
-        if ((dir == null) ||
-            (prefix == null) ||
-            (stem == null) ||
-            (suffix == null) ||
-            (inverseDir == null) ||
-            (altSuffix == null)) {
-            throw new NullPointerException("All arguments must be non-null");
-        }
-
-        this.plat = plat;
-
-        this.dir = dir;
-        this.prefix = prefix;
-        this.stem = stem;
-        this.suffix = suffix;
-        this.inverseDir = inverseDir;
-        this.altSuffix = altSuffix;
-
-        pss = prefix + stem + suffix;
-        dpss = dir + prefix + stem + suffix;
-        psa = prefix + stem + altSuffix;
-        dpsa = dir + prefix + stem + altSuffix;
-
-        checkLength(plat);
-    }
-
-    public void checkLength(Platform p) {
-        int len;
-        String s;
-        int suffLen = suffix.length();
-        int altSuffLen = altSuffix.length();
-        if (suffLen >= altSuffLen) {
-            len = suffLen;
-            s = suffix;
-        } else {
-            len = altSuffLen;
-            s = altSuffix;
-        }
-        len += prefix.length() + stem.length();
-        int lim = p.fileNameLengthLimit();
-        if (len > lim) {
-            p.fatalError(prefix + stem + s + " is too long: " +
-                         len + " >= " + lim);
-        }
-    }
-
-    public String dirPreStemSuff() {
-        return dpss;
-    }
-
-    public String preStemSuff() {
-        return pss;
-    }
-
-    public String dirPreStemAltSuff() {
-        return dpsa;
-    }
-
-    public String preStemAltSuff() {
-        return psa;
-    }
-
-    public FileName copyStem(String newStem) {
-        return new FileName(plat, dir, prefix, newStem,
-                            suffix, inverseDir, altSuffix);
-    }
-
-    String nameOfList() {
-        return stem;
-    }
-
-    String getInvDir() {
-        return inverseDir;
-    }
-}
--- a/src/share/tools/MakeDeps/Macro.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-public class Macro {
-    public String name;
-    public String contents;
-}
--- a/src/share/tools/MakeDeps/MacroDefinitions.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,256 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class MacroDefinitions {
-    private Vector macros;
-
-    public MacroDefinitions() {
-        macros = new Vector();
-    }
-
-    private String lookup(String name) throws NoSuchElementException {
-        for (Iterator iter = macros.iterator(); iter.hasNext(); ) {
-            Macro macro = (Macro) iter.next();
-            if (macro.name.equals(name)) {
-                return macro.contents;
-            }
-        }
-        throw new NoSuchElementException(name);
-    }
-
-    public void addMacro(String name, String contents) {
-        Macro macro = new Macro();
-        macro.name = name;
-        macro.contents = contents;
-        macros.add(macro);
-    }
-
-    private boolean lineIsEmpty(String s) {
-        for (int i = 0; i < s.length(); i++) {
-            if (!Character.isWhitespace(s.charAt(i))) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public void readFrom(String fileName, boolean missingOk)
-        throws FileNotFoundException, FileFormatException, IOException {
-        BufferedReader reader = null;
-        try {
-            reader = new BufferedReader(new FileReader(fileName));
-        } catch (FileNotFoundException e) {
-            if (missingOk) {
-                return;
-            } else {
-                throw(e);
-            }
-        }
-        String line;
-        do {
-            line = reader.readLine();
-            if (line != null) {
-                // This had to be rewritten (compare to Database.java)
-                // because the Solaris platform file has been
-                // repurposed and now contains "macros" with spaces in
-                // them.
-
-                if ((!line.startsWith("//")) &&
-                    (!lineIsEmpty(line))) {
-                    int nameBegin = -1;
-                    int nameEnd = -1;
-                    boolean gotEquals = false;
-                    int contentsBegin = -1;
-                    int contentsEnd = -1;
-
-                    int i = 0;
-                    // Scan forward for beginning of name
-                    while (i < line.length()) {
-                        if (!Character.isWhitespace(line.charAt(i))) {
-                            break;
-                        }
-                        i++;
-                    }
-                    nameBegin = i;
-
-                    // Scan forward for end of name
-                    while (i < line.length()) {
-                        if (Character.isWhitespace(line.charAt(i))) {
-                            break;
-                        }
-                        i++;
-                    }
-                    nameEnd = i;
-
-                    // Scan forward for equals sign
-                    while (i < line.length()) {
-                        if (line.charAt(i) == '=') {
-                            gotEquals = true;
-                            break;
-                        }
-                        i++;
-                    }
-
-                    // Scan forward for start of contents
-                    i++;
-                    while (i < line.length()) {
-                        if (!Character.isWhitespace(line.charAt(i))) {
-                            break;
-                        }
-                        i++;
-                    }
-                    contentsBegin = i;
-
-                    // Scan *backward* for end of contents
-                    i = line.length() - 1;
-                    while (i >= 0) {
-                        if (!Character.isWhitespace(line.charAt(i))) {
-                            break;
-                        }
-                    }
-                    contentsEnd = i+1;
-
-                    // Now do consistency check
-                    if (!((nameBegin < nameEnd) &&
-                          (nameEnd < contentsBegin) &&
-                          (contentsBegin < contentsEnd) &&
-                          (gotEquals == true))) {
-                        throw new FileFormatException(
-                            "Expected \"macroname = value\", " +
-                            "but found: " + line
-                        );
-                    }
-
-                    String name = line.substring(nameBegin, nameEnd);
-                    String contents = line.substring(contentsBegin,
-                                                     contentsEnd);
-                    addMacro(name, contents);
-                }
-            }
-        } while (line != null);
-        reader.close();
-    }
-
-    /** Throws IllegalArgumentException if passed token is illegally
-        formatted */
-    public String expand(String token)
-        throws IllegalArgumentException {
-        // the token may contain one or more <macroName>'s
-
-        String out = "";
-
-        // emacs lingo
-        int mark = 0;
-        int point = 0;
-
-        int len = token.length();
-
-        if (len == 0)
-            return out;
-
-        do {
-            // Scan "point" forward until hitting either the end of
-            // the string or the beginning of a macro
-            if (token.charAt(point) == '<') {
-                // Append (point - mark) to out
-                if ((point - mark) != 0) {
-                    out += token.substring(mark, point);
-                }
-                mark = point + 1;
-                // Scan forward from point for right bracket
-                point++;
-                while ((point < len) &&
-                       (token.charAt(point) != '>')) {
-                    point++;
-                }
-                if (point == len) {
-                    throw new IllegalArgumentException(
-                        "Could not find right angle-bracket in token " + token
-                    );
-                }
-                String name = token.substring(mark, point);
-                if (name == null) {
-                    throw new IllegalArgumentException(
-                        "Empty macro in token " + token
-                    );
-                }
-                try {
-                    String contents = lookup(name);
-                    out += contents;
-                    point++;
-                    mark = point;
-                } catch (NoSuchElementException e) {
-                    throw new IllegalArgumentException(
-                        "Unknown macro " + name + " in token " + token
-                    );
-                }
-            } else {
-                point++;
-            }
-        } while (point != len);
-
-        if (mark != point) {
-            out += token.substring(mark, point);
-        }
-
-        return out;
-    }
-
-    public MacroDefinitions copy() {
-        MacroDefinitions ret = new MacroDefinitions();
-        for (Iterator iter = macros.iterator();
-             iter.hasNext(); ) {
-            Macro orig = (Macro) iter.next();
-            Macro macro = new Macro();
-            macro.name = orig.name;
-            macro.contents = orig.contents;
-            ret.macros.add(macro);
-        }
-        return ret;
-    }
-
-    public void setAllMacroBodiesTo(String s) {
-        for (Iterator iter = macros.iterator();
-             iter.hasNext(); ) {
-            Macro macro = (Macro) iter.next();
-            macro.contents = s;
-        }
-    }
-
-    /** This returns an Iterator of Macros. You should not mutate the
-        returned Macro objects or use the Iterator to remove
-        macros. */
-    public Iterator getMacros() {
-        return macros.iterator();
-    }
-
-    private void error(String text) throws FileFormatException {
-        throw new FileFormatException(
-            "Expected \"macroname = value\", but found: " + text
-        );
-    }
-}
--- a/src/share/tools/MakeDeps/MakeDeps.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-import java.util.Map;
-import java.util.Map.Entry;
-
-/*
- * Copyright (c) 1999, 2001, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-// This program reads an include file database.
-// The database should cover each self .c and .h file,
-//   but not files in /usr/include
-// The database consists of pairs of nonblank words, where the first word is
-//   the filename that needs to include the file named by the second word.
-// For each .c file, this program generates a fooIncludes.h file that
-//  the .c file may include to include all the needed files in the right order.
-// It also generates a foo.dep file to include in the makefile.
-// Finally it detects cycles, and can work with two files, an old and a new one.
-// To incrementally write out only needed files after a small change.
-//
-// Based on a suggestion by Roland Conybeare, algorithm suggested by Craig
-//  Chambers, written by David Ungar, 3/1/89.
-//  Added PREFIX, {DEP/INC}_DIR, smaller dep output  10/92  -Urs
-
-// Add something for precompiled headers
-
-// To handle different platforms, I am introducing a platform file.
-// The platform file contains lines like:
-// os = svr4
-//
-// Then, when processing the includeDB file, a token such as <os>
-// gets replaced by svr4. -- dmu 3/25/97
-
-// Modified to centralize Dependencies to speed up make -- dmu 5/97
-
-public class MakeDeps {
-
-    public static void usage() {
-        System.out.println("usage:");
-        System.out.println("\tmakeDeps platform-name     platform-file     database-file [MakeDeps args] [platform args]");
-        System.out.println("\tmakeDeps diffs platform-name old-platform-file old-database-file new-platform-file new-database-file [MakeDeps args] [platform args]");
-        System.out.println("where platform-name is the name of a platform MakeDeps supports");
-        System.out.println("(currently \"WinGammaPlatform\" or \"UnixPlatform\")");
-        System.out.println("MakeDeps options:");
-        System.out.println("  -firstFile [filename]: Specify the first file in link order (i.e.,");
-        System.out.println("   to have a well-known function at the start of the output file)");
-        System.out.println("  -lastFile [filename]: Specify the last file in link order (i.e.,");
-        System.out.println("   to have a well-known function at the end of the output file)");
-        System.err.println("WinGammaPlatform platform-specific options:");
-        System.err.println("  -sourceBase <path to directory (workspace) " +
-                           "containing source files; no trailing slash>");
-        System.err.println("  -dspFileName <full pathname to which .dsp file " +
-                           "will be written; all parent directories must " +
-                           "already exist>");
-        System.err.println("  -envVar <environment variable to be inserted " +
-                           "into .dsp file, substituting for path given in " +
-                           "-sourceBase. Example: HotSpotWorkSpace>");
-        System.err.println("  -dllLoc <path to directory in which to put " +
-                           "jvm.dll and jvm_g.dll; no trailing slash>");
-        System.err.println("  If any of the above are specified, "+
-                           "they must all be.");
-        System.err.println("  Additional, optional arguments, which can be " +
-                           "specified multiple times:");
-        System.err.println("    -absoluteInclude <string containing absolute " +
-                           "path to include directory>");
-        System.err.println("    -relativeInclude <string containing include " +
-                           "directory relative to -envVar>");
-        System.err.println("    -define <preprocessor flag to be #defined " +
-                           "(note: doesn't yet support " +
-                           "#define (flag) (value))>");
-        System.err.println("    -perFileLine <file> <line>");
-        System.err.println("    -conditionalPerFileLine <file> <line for " +
-                           "release build> <line for debug build>");
-        System.err.println("  (NOTE: To work around a bug in nmake, where " +
-                           "you can't have a '#' character in a quoted " +
-                           "string, all of the lines outputted have \"#\"" +
-                           "prepended)");
-        System.err.println("    -startAt <subdir of sourceBase>");
-        System.err.println("    -ignoreFile <file which won't be able to be " +
-                           "found in the sourceBase because it's generated " +
-                           "later>");
-        System.err.println("    -additionalFile <file not in database but " +
-                           "which should show up in .dsp file, like " +
-                           "includeDB_core>");
-        System.err.println("    -additionalGeneratedFile <environment variable of " +
-                           "generated file's location> <relative path to " +
-                           "directory containing file; no trailing slash> " +
-                           "<name of file generated later in the build process>");
-        System.err.println("    -prelink <build> <desc> <cmds>:");
-        System.err.println(" Generate a set of prelink commands for the given BUILD");
-        System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands");
-        System.err.println(" are both quoted strings.");
-        System.err.println("    Default includes: \".\"");
-        System.err.println("    Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
-    }
-
-    public static void main(String[] args) {
-        try {
-            if (args.length < 3) {
-                usage();
-                System.exit(1);
-            }
-
-            int argc = 0;
-            boolean diffMode = false;
-            if (args[argc].equals("diffs")) {
-                diffMode = true;
-                ++argc;
-            }
-
-            String platformName = args[argc++];
-            Class platformClass = Class.forName(platformName);
-
-            String plat1 = null;
-            String db1 = null;
-            String plat2 = null;
-            String db2 = null;
-
-            String firstFile = null;
-            String lastFile = null;
-
-            int numOptionalArgs =
-                (diffMode ? (args.length - 6) : (args.length - 3));
-            if (numOptionalArgs < 0) {
-                usage();
-                System.exit(1);
-            }
-
-            plat1 = args[argc++];
-            db1   = args[argc++];
-
-            if (diffMode) {
-              plat2 = args[argc++];
-              db2   = args[argc++];
-            }
-
-            // argc now points at start of optional arguments, if any
-
-            try {
-              boolean gotOne = true;
-              while (gotOne && (argc < args.length - 1)) {
-                gotOne = false;
-                String arg = args[argc];
-                if (arg.equals("-firstFile")) {
-                  firstFile = args[argc + 1];
-                  argc += 2;
-                  gotOne = true;
-                } else if (arg.equals("-lastFile")) {
-                  lastFile = args[argc + 1];
-                  argc += 2;
-                  gotOne = true;
-                }
-              }
-            }
-            catch (Exception e) {
-              e.printStackTrace();
-              usage();
-              System.exit(1);
-            }
-
-            Platform platform = (Platform) platformClass.newInstance();
-            platform.setupFileTemplates();
-            long t = platform.defaultGrandIncludeThreshold();
-
-            String[] platformArgs = null;
-            int numPlatformArgs = args.length - argc;
-            if (numPlatformArgs > 0) {
-                platformArgs = new String[numPlatformArgs];
-                int offset = argc;
-                while (argc < args.length) {
-                  platformArgs[argc - offset] = args[argc];
-                  ++argc;
-                }
-            }
-
-            // If you want to change the threshold, change the default
-            // "grand include" threshold in Platform.java, or override
-            // it in the platform-specific file like UnixPlatform.java
-
-            Database previous = new Database(platform, t);
-            Database current = new Database(platform, t);
-
-            previous.canBeMissing();
-
-            if (firstFile != null) {
-              previous.setFirstFile(firstFile);
-              current.setFirstFile(firstFile);
-            }
-            if (lastFile != null) {
-              previous.setLastFile(lastFile);
-              current.setLastFile(lastFile);
-            }
-
-            if (diffMode) {
-                System.out.println("Old database:");
-                previous.get(plat1, db1);
-                previous.compute();
-                System.out.println("New database:");
-                current.get(plat2, db2);
-                current.compute();
-                System.out.println("Deltas:");
-                current.putDiffs(previous);
-            } else {
-                System.out.println("New database:");
-                current.get(plat1, db1);
-                current.compute();
-                current.put();
-            }
-
-            if (platformArgs != null) {
-                // Allow the platform to write platform-specific files
-                platform.writePlatformSpecificFiles(previous, current,
-                                                    platformArgs);
-            }
-        }
-        catch (Exception e) {
-            e.printStackTrace();
-              System.exit(1);
-        }
-    }
-}
--- a/src/share/tools/MakeDeps/MetroWerksMacPlatform.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-
-public class MetroWerksMacPlatform extends Platform {
-    public void setupFileTemplates() {
-        inclFileTemplate = new FileName(this,
-            ":incls:", "_", "",                  ".incl", "", ""
-        );
-        giFileTemplate = new FileName(this,
-            "",        "",  "precompiledHeader", ".pch",  "", ""
-        );
-        gdFileTemplate = dummyFileTemplate;
-    }
-
-    private static String[] suffixes = { ".cpp", ".c", ".s" };
-
-    public String[] outerSuffixes() {
-        return suffixes;
-    }
-
-    public boolean includeGIInEachIncl() {
-        return true;
-    }
-
-    public int defaultGrandIncludeThreshold() {
-        return 150;
-    }
-
-    public void writeGIPragma(PrintWriter out) {
-        out.println("#pragma precompile_target \"" +
-                    giFileTemplate.preStemAltSuff() +
-                    "\"");
-        out.println();
-    }
-
-    public String objFileSuffix() {
-        throw new RuntimeException("Unimplemented in original makeDeps");
-    }
-
-    public String asmFileSuffix() {
-        throw new RuntimeException("Unimplemented in original makeDeps");
-    }
-
-    public String dependentPrefix() {
-        throw new RuntimeException("Unimplemented in original makeDeps");
-    }
-}
--- a/src/share/tools/MakeDeps/Platform.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/** Defines what must be specified for each platform. This class must
-    have a no-arg constructor. */
-
-import java.io.*;
-
-public abstract class Platform {
-    /** file name templates capture naming conventions */
-    protected FileName dummyFileTemplate =
-        new FileName(this, "", "", "", "", "", "");
-
-    // The next three must be instantiated in subclasses' constructors
-
-    /** An incl file is produced per .c file and contains all the
-        includes it needs */
-    protected FileName inclFileTemplate;
-
-    /** A GI (grand-include) file has any file used more than N times
-        for precompiled headers */
-    protected FileName giFileTemplate;
-
-    /** A GD (grand-dependencies) file that tells Unix make all the
-        .o's needed for linking and the include dependencies */
-    protected FileName gdFileTemplate;
-
-    // Accessors
-    public FileName getInclFileTemplate() {
-        return inclFileTemplate;
-    }
-
-    public FileName getGIFileTemplate() {
-        return giFileTemplate;
-    }
-
-    public FileName getGDFileTemplate() {
-        return gdFileTemplate;
-    }
-
-    // an incl file is the file included by each.c file that includes
-    // all needed header files
-
-    public abstract void setupFileTemplates();
-    public abstract String[] outerSuffixes();
-
-    /** empty file name -> no grand include file */
-    public boolean haveGrandInclude() {
-        return (giFileTemplate.nameOfList().length() > 0);
-    }
-
-    public boolean writeDeps() {
-        return (gdFileTemplate.nameOfList().length() > 0);
-    }
-
-    /** <p> A gi file is the grand-include file. It includes in one
-        file any file that is included more than a certain number of
-        times. </p>
-
-        <p> It is used for precompiled header files. </p>
-
-        <p> It has a source name, that is the file that this program
-        generates, and a compiled name; that is the file that is
-        included by other files. </p>
-
-        <p> Some platforms have this program actually explictly
-        include the preprocessed gi file-- see includeGIInEachIncl().
-        </p>
-
-        <p> Also, some platforms need a pragma in the GI file. </p> */
-    public boolean includeGIInEachIncl() {
-        return false;
-    }
-
-    /** For some platforms, e.g. Solaris, include the grand-include
-        dependencies in the makefile. For others, e.g. Windows, do
-        not. */
-    public boolean includeGIDependencies() {
-        return false;
-    }
-
-    /** Should C/C++ source file be dependent on a file included
-        into the grand-include file. */
-    public boolean writeDependenciesOnHFilesFromGI() {
-        return false;
-    }
-
-    /** Default implementation does nothing */
-    public void writeGIPragma(PrintWriter out) {
-    }
-
-    /** A line with a filename and the noGrandInclude string means
-        that this file cannot use the precompiled header. */
-    public String noGrandInclude() {
-        return "no_precompiled_headers";
-    }
-
-    /** A line with a filename and the
-        generatePlatformDependentInclude means that an include file
-        for the header file must be generated. This file generated include
-        file is directly included by the non-platform dependent include file
-        (e.g os.hpp includes _os_pd.hpp.incl. So while we notice files that
-        are directly dependent on non-platform dependent files from the database
-        we must infer the dependence on platform specific files to generate correct
-        dependences on the platform specific files. */
-    public String generatePlatformDependentInclude() {
-        return "generate_platform_dependent_include";
-    }
-
-    /** Prefix and suffix strings for emitting Makefile rules */
-    public abstract String objFileSuffix();
-    public abstract String asmFileSuffix();
-    public abstract String dependentPrefix();
-
-    // Exit routines:
-
-    /** Abort means an internal error */
-    public void abort() {
-        throw new RuntimeException("Internal error");
-    }
-
-    /** fatalError is used by clients to stop the system */
-    public void fatalError(String msg) {
-        System.err.println(msg);
-        System.exit(1);
-    }
-
-    /** Default implementation performs case-sensitive comparison */
-    public boolean fileNameStringEquality(String s1, String s2) {
-        return s1.equals(s2);
-    }
-
-    public void fileNamePortabilityCheck(String name) {
-        if (Character.isUpperCase(name.charAt(0))) {
-            fatalError("Error: for the sake of portability we have chosen\n" +
-                       "to avoid files starting with an uppercase letter.\n" +
-                       "Please rename " + name + ".");
-        }
-    }
-
-    public void fileNamePortabilityCheck(String name, String matchingName) {
-        if (!name.equals(matchingName)) {
-            fatalError("Error: file " + name + " also appears as " +
-                       matchingName + ".  Case must be consistent for " +
-                       "portability.");
-        }
-    }
-
-    /** max is 31 on mac, so warn */
-    public int fileNameLengthLimit() {
-        return 45;
-    }
-
-    public int defaultGrandIncludeThreshold() {
-        return 30;
-    }
-
-    /** Not very general, but this is a way to get platform-specific
-        files to be written. Default implementation does nothing. */
-    public void writePlatformSpecificFiles(Database previousDB,
-                                           Database currentDB, String[] args)
-        throws IllegalArgumentException, IOException {
-    }
-}
--- a/src/share/tools/MakeDeps/UnixPlatform.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-public class UnixPlatform extends Platform {
-    public void setupFileTemplates() {
-        inclFileTemplate = new FileName(this,
-            "incls/", "_", "",             ".incl", "", ""
-        );
-        giFileTemplate = new FileName(this,
-            "incls/", "",  "_precompiled", ".incl", "", ""
-        );
-        gdFileTemplate = new FileName(this,
-            "",       "",  "Dependencies", "",      "", ""
-        );
-    }
-
-    private static String[] suffixes = { ".cpp", ".c", ".s" };
-
-    public String[] outerSuffixes() {
-        return suffixes;
-    }
-
-    public String objFileSuffix() {
-        return ".o";
-    }
-
-    public String asmFileSuffix() {
-        return ".i";
-    }
-
-    public String dependentPrefix() {
-        return "";
-    }
-
-    /** Do not change this; unless you fix things so precompiled
-        header files get translated into make dependencies. - Ungar */
-    public int defaultGrandIncludeThreshold() {
-       if (System.getProperty("USE_PRECOMPILED_HEADER") != null)
-          return 30;
-       else
-          return 1 << 30;
-    }
-
-    /** For Unix make, include the dependencies for precompiled header
-        files. */
-    public boolean includeGIDependencies() {
-        return false;
-    }
-
-    /** Should C/C++ source file be dependent on a file included
-        into the grand-include file.
-        On Unix with precompiled headers we don't want each file to be
-        dependent on grand-include file. Instead each C/C++ source file
-        is depended on each own set of files, and recompiled only when
-        files from this set are changed. */
-    public boolean writeDependenciesOnHFilesFromGI() {
-        return System.getProperty("USE_PRECOMPILED_HEADER") != null;
-    }
-}
--- a/src/share/tools/MakeDeps/Util.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.util.*;
-import java.util.Map.Entry;
-import java.io.File;
-
-public class Util {
-    static String join(String padder, Vector v) {
-        return join(padder, v, false);
-    }
-
-    static String join(String padder, Vector v, boolean quoted) {
-        StringBuffer sb = new StringBuffer();
-
-        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
-            if (quoted) {
-                sb.append('"');
-            }
-            sb.append((String)iter.next());
-            if (quoted) {
-                sb.append('"');
-            }
-            if (iter.hasNext()) sb.append(padder);
-        }
-
-        return sb.toString();
-    }
-
-     static String join(String padder, String v[]) {
-        StringBuffer sb = new StringBuffer();
-
-        for (int i=0; i<v.length; i++) {
-            sb.append(v[i]);
-            if (i < (v.length  - 1)) sb.append(padder);
-        }
-
-        return sb.toString();
-    }
-
-
-
-    static String prefixed_join(String padder, Vector v, boolean quoted) {
-        StringBuffer sb = new StringBuffer();
-
-        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
-            sb.append(padder);
-
-            if (quoted) {
-                sb.append('"');
-            }
-            sb.append((String)iter.next());
-            if (quoted) {
-                sb.append('"');
-            }
-        }
-
-        return sb.toString();
-    }
-
-
-    static String normalize(String file) {
-        return file.replace('\\', '/');
-    }
-
-    static String sep = File.separator;
-    
-    private static String _os;
-    
-    static String os() {
-    	if( _os==null) {
-
-        	for(Map.Entry<String, String> entry: System.getenv().entrySet())
-        		if("PLATFORM_ARCH_MODEL".equals(entry.getKey().toUpperCase())) {
-        			String archModel = entry.getValue();
-        			if("x86_32".equals(archModel))
-        				_os = "Win32";
-        			else if("x86_64".equals(archModel))
-        				_os = "x64";
-        			else
-        				throw new RuntimeException("Unsupported PLATFORM_ARCH_MODEL " + archModel);
-        			return _os;
-        		}
-        	throw new RuntimeException("PLATFORM_ARCH_MODEL not specified");
-    	}
-    	return _os;
-    }
-}
--- a/src/share/tools/MakeDeps/WinGammaPlatform.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,765 +0,0 @@
-/*
- * 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-abstract class HsArgHandler extends ArgHandler {
-    static final int STRING = 1;
-    static final int VECTOR = 2;
-    static final int HASH   = 3;
-
-    boolean nextNotKey(ArgIterator it) {
-        if (it.next()) {
-            String s = it.get();
-            return (s.length() == 0) || (s.charAt(0) != '-');
-        } else {
-            return false;
-        }
-    }
-
-    void empty(String key, String message) {
-        if (key != null) {
-            System.err.println("** Error: empty " + key);
-        }
-        if (message != null) {
-            System.err.println(message);
-        }
-        WinGammaPlatform.usage();
-    }
-
-    static String getCfg(String val) {
-        int under = val.indexOf('_');
-        int len = val.length();
-        if (under != -1 && under < len - 1) {
-            return val.substring(under+1, len);
-        } else {
-            return null;
-        }
-    }
-}
-
-class ArgRuleSpecific extends ArgRule {
-    ArgRuleSpecific(String arg, ArgHandler handler) {
-        super(arg, handler);
-    }
-
-    boolean match(String rulePattern, String arg) {
-        return rulePattern.startsWith(arg);
-    }
-}
-
-
-class SpecificHsArgHandler extends HsArgHandler {
-
-    String message, argKey, valKey;
-    int type;
-
-    public void handle(ArgIterator it) {
-        String cfg = getCfg(it.get());
-        if (nextNotKey(it)) {
-            String val = it.get();
-            switch (type) {
-            case VECTOR:
-                BuildConfig.addFieldVector(cfg, valKey, val);
-                break;
-            case HASH:
-                BuildConfig.putFieldHash(cfg, valKey, val, "1");
-                break;
-            case STRING:
-                BuildConfig.putField(cfg, valKey, val);
-                break;
-            default:
-                empty(valKey, "Unknown type: "+type);
-            }
-            it.next();
-
-        } else {
-            empty(argKey, message);
-        }
-    }
-
-    SpecificHsArgHandler(String argKey, String valKey, String message, int type) {
-        this.argKey = argKey;
-        this.valKey = valKey;
-        this.message = message;
-        this.type = type;
-    }
-}
-
-
-class HsArgRule extends ArgRuleSpecific {
-
-    HsArgRule(String argKey, String valKey, String message, int type) {
-        super(argKey, new SpecificHsArgHandler(argKey, valKey, message, type));
-    }
-
-}
-
-public abstract class WinGammaPlatform extends Platform {
-    public void setupFileTemplates() {
-        inclFileTemplate = new FileName(this,
-            "incls\\", "_", "",                      ".incl", "", ""
-        );
-        giFileTemplate = new FileName(this,
-            "incls\\", "",  "_precompiled", ".incl", "", ""
-        );
-        gdFileTemplate = new FileName(this,
-            "", "",  "Dependencies",         "",      "", ""
-        );
-    }
-
-    private static String[] suffixes = { ".cpp", ".c" };
-
-    public String[] outerSuffixes() {
-        return suffixes;
-    }
-
-    public String objFileSuffix() {
-        return ".obj";
-    }
-
-    public String asmFileSuffix() {
-        return ".i";
-    }
-
-    public String dependentPrefix() {
-        return "$(VM_PATH)";
-    }
-
-    public boolean includeGIInEachIncl() {
-        return false;
-    }
-
-    public boolean fileNameStringEquality(String s1, String s2) {
-        return s1.equalsIgnoreCase(s2);
-    }
-
-    static void usage() throws IllegalArgumentException {
-        System.err.println("WinGammaPlatform platform-specific options:");
-        System.err.println("  -sourceBase <path to directory (workspace) " +
-                           "containing source files; no trailing slash>");
-        System.err.println("  -projectFileName <full pathname to which project file " +
-                           "will be written; all parent directories must " +
-                           "already exist>");
-        System.err.println("  If any of the above are specified, "+
-                           "they must all be.");
-        System.err.println("  Additional, optional arguments, which can be " +
-                           "specified multiple times:");
-        System.err.println("    -absoluteInclude <string containing absolute " +
-                           "path to include directory>");
-        System.err.println("    -relativeInclude <string containing include " +
-                           "directory relative to -sourceBase>");
-        System.err.println("    -define <preprocessor flag to be #defined " +
-                           "(note: doesn't yet support " +
-                           "#define (flag) (value))>");
-        System.err.println("    -startAt <subdir of sourceBase>");
-        System.err.println("    -additionalFile <file not in database but " +
-                           "which should show up in project file, like " +
-                           "includeDB_core>");
-        System.err.println("    -additionalGeneratedFile <absolute path to " +
-                           "directory containing file; no trailing slash> " +
-                           "<name of file generated later in the build process>");
-        throw new IllegalArgumentException();
-    }
-
-
-    public void addPerFileLine(Hashtable table,
-                               String fileName,
-                               String line) {
-        Vector v = (Vector) table.get(fileName);
-        if (v != null) {
-            v.add(line);
-        } else {
-            v = new Vector();
-            v.add(line);
-            table.put(fileName, v);
-        }
-    }
-
-    protected static class PerFileCondData {
-        public String releaseString;
-        public String debugString;
-    }
-
-    protected void addConditionalPerFileLine(Hashtable table,
-                                           String fileName,
-                                           String releaseLine,
-                                           String debugLine) {
-        PerFileCondData data = new PerFileCondData();
-        data.releaseString = releaseLine;
-        data.debugString = debugLine;
-        Vector v = (Vector) table.get(fileName);
-        if (v != null) {
-            v.add(data);
-        } else {
-            v = new Vector();
-            v.add(data);
-            table.put(fileName, v);
-        }
-    }
-
-    protected static class PrelinkCommandData {
-      String description;
-      String commands;
-    }
-
-    protected void addPrelinkCommand(Hashtable table,
-                                     String build,
-                                     String description,
-                                     String commands) {
-      PrelinkCommandData data = new PrelinkCommandData();
-      data.description = description;
-      data.commands = commands;
-      table.put(build, data);
-    }
-
-    public boolean findString(Vector v, String s) {
-        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
-            if (((String) iter.next()).equals(s)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /* This returns a String containing the full path to the passed
-       file name, or null if an error occurred. If the file was not
-       found or was a duplicate and couldn't be resolved using the
-       preferred paths, the file name is added to the appropriate
-       Vector of Strings. */
-    private String findFileInDirectory(String fileName,
-                                       DirectoryTree directory,
-                                       Vector preferredPaths,
-                                       Vector filesNotFound,
-                                       Vector filesDuplicate) {
-        List locationsInTree = directory.findFile(fileName);
-        int  rootNameLength = directory.getRootNodeName().length();
-        String name = null;
-        if ((locationsInTree == null) ||
-            (locationsInTree.size() == 0)) {
-            filesNotFound.add(fileName);
-        } else if (locationsInTree.size() > 1) {
-            // We shouldn't have duplicate file names in our workspace.
-            System.err.println();
-            System.err.println("There are multiple files named as: " + fileName);
-            System.exit(-1);
-            // The following code could be safely removed if we don't need duplicate
-            // file names.
-
-            // Iterate through them, trying to find one with a
-            // preferred path
-        search:
-            {
-                for (Iterator locIter = locationsInTree.iterator();
-                     locIter.hasNext(); ) {
-                    DirectoryTreeNode node =
-                        (DirectoryTreeNode) locIter.next();
-                    String tmpName = node.getName();
-                    for (Iterator prefIter = preferredPaths.iterator();
-                         prefIter.hasNext(); ) {
-                        // We need to make sure the preferred path is
-                        // found from the file path not including the root node name.
-                        if (tmpName.indexOf((String)prefIter.next(),
-                                            rootNameLength) != -1) {
-                            name = tmpName;
-                            break search;
-                        }
-                    }
-                }
-            }
-
-            if (name == null) {
-                filesDuplicate.add(fileName);
-            }
-        } else {
-            name = ((DirectoryTreeNode) locationsInTree.get(0)).getName();
-        }
-
-        return name;
-    }
-
-    protected boolean databaseAllFilesEqual(Database previousDB,
-                                            Database currentDB) {
-        Iterator i1 = previousDB.getAllFiles().iterator();
-        Iterator i2 = currentDB.getAllFiles().iterator();
-
-        while (i1.hasNext() && i2.hasNext()) {
-            FileList fl1 = (FileList) i1.next();
-            FileList fl2 = (FileList) i2.next();
-            if (!fl1.getName().equals(fl2.getName())) {
-                return false;
-            }
-        }
-
-        if (i1.hasNext() != i2.hasNext()) {
-            // Different lengths
-            return false;
-        }
-
-        return true;
-    }
-
-    protected String envVarPrefixedFileName(String fileName,
-                                            int sourceBaseLen,
-                                            DirectoryTree tree,
-                                            Vector preferredPaths,
-                                            Vector filesNotFound,
-                                            Vector filesDuplicate) {
-        String fullName = findFileInDirectory(fileName,
-                                              tree,
-                                              preferredPaths,
-                                              filesNotFound,
-                                              filesDuplicate);
-        return fullName;
-    }
-
-     String getProjectName(String fullPath, String extension)
-        throws IllegalArgumentException, IOException {
-        File file = new File(fullPath).getCanonicalFile();
-        fullPath = file.getCanonicalPath();
-        String parent = file.getParent();
-
-        if (!fullPath.endsWith(extension)) {
-            throw new IllegalArgumentException("project file name \"" +
-                                               fullPath +
-                                               "\" does not end in "+extension);
-        }
-
-        if ((parent != null) &&
-            (!fullPath.startsWith(parent))) {
-            throw new RuntimeException(
-                "Internal error: parent of file name \"" + parent +
-                "\" does not match file name \"" + fullPath + "\""
-            );
-        }
-
-        int len = parent.length();
-        if (!parent.endsWith(Util.sep)) {
-            len += Util.sep.length();
-        }
-
-        int end = fullPath.length() - extension.length();
-
-        if (len == end) {
-            throw new RuntimeException(
-                "Internal error: file name was empty"
-            );
-        }
-
-        return fullPath.substring(len, end);
-    }
-
-    protected abstract String getProjectExt();
-
-    public void writePlatformSpecificFiles(Database previousDB,
-                                           Database currentDB, String[] args)
-        throws IllegalArgumentException, IOException {
-
-        parseArguments(args);
-
-        String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName");
-        String ext = getProjectExt();
-
-        // Compare contents of allFiles of previousDB and includeDB.
-        // If these haven't changed, then skip writing the .vcproj file.
-        if (false && databaseAllFilesEqual(previousDB, currentDB) &&
-            new File(projectFileName).exists()) {
-            System.out.println(
-                               "    Databases unchanged; skipping overwrite of "+ext+" file."
-                               );
-            return;
-        }
-
-        String projectName = getProjectName(projectFileName, ext);
-
-        writeProjectFile(projectFileName, projectName, createAllConfigs());
-    }
-
-    protected void writePrologue(String[] args) {
-        System.err.println("WinGammaPlatform platform-specific arguments:");
-        for (int i = 0; i < args.length; i++) {
-            System.err.print(args[i] + " ");
-        }
-        System.err.println();
-    }
-
-
-    void setInclFileTemplate(FileName val) {
-        this.inclFileTemplate = val;
-    }
-
-    void setGIFileTemplate(FileName val) {
-        this.giFileTemplate = val;
-    }
-
-
-    void parseArguments(String[] args) {
-        new ArgsParser(args,
-                       new ArgRule[]
-            {
-                new HsArgRule("-sourceBase",
-                              "SourceBase",
-                              "   (Did you set the HotSpotWorkSpace environment variable?)",
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-buildBase",
-                              "BuildBase",
-                              "   (Did you set the HotSpotBuildSpace environment variable?)",
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-projectFileName",
-                              "ProjectFileName",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-jdkTargetRoot",
-                              "JdkTargetRoot",
-                              "   (Did you set the HotSpotJDKDist environment variable?)",
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-compiler",
-                              "CompilerVersion",
-                              "   (Did you set the VcVersion correctly?)",
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-platform",
-                              "Platform",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-absoluteInclude",
-                              "AbsoluteInclude",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-relativeInclude",
-                              "RelativeInclude",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-define",
-                              "Define",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-useToGeneratePch",
-                              "UseToGeneratePch",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-                new ArgRuleSpecific("-perFileLine",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    String cfg = getCfg(it.get());
-                                    if (nextNotKey(it)) {
-                                        String fileName = it.get();
-                                        if (nextNotKey(it)) {
-                                            String line = it.get();
-                                            BuildConfig.putFieldHash(cfg, "PerFileLine", fileName, line);
-                                            it.next();
-                                            return;
-                                        }
-                                    }
-                                    empty(null, "** Error: wrong number of args to -perFileLine");
-                                }
-                            }
-                            ),
-
-                new ArgRuleSpecific("-conditionalPerFileLine",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    String cfg = getCfg(it.get());
-                                    if (nextNotKey(it)) {
-                                        String fileName = it.get();
-                                        if (nextNotKey(it)) {
-                                            String productLine = it.get();
-                                            if (nextNotKey(it)) {
-                                                String debugLine = it.get();
-                                                BuildConfig.putFieldHash(cfg+"_debug", "CondPerFileLine",
-                                                                         fileName, debugLine);
-                                                BuildConfig.putFieldHash(cfg+"_product", "CondPerFileLine",
-                                                                         fileName, productLine);
-                                                it.next();
-                                                return;
-                                            }
-                                        }
-                                    }
-
-                                    empty(null, "** Error: wrong number of args to -conditionalPerFileLine");
-                                }
-                            }
-                            ),
-
-                new HsArgRule("-disablePch",
-                              "DisablePch",
-                              null,
-                              HsArgHandler.HASH
-                              ),
-
-                new ArgRule("-startAt",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    if (BuildConfig.getField(null, "StartAt") != null) {
-                                        empty(null, "** Error: multiple -startAt");
-                                    }
-                                    if (nextNotKey(it)) {
-                                        BuildConfig.putField(null, "StartAt", it.get());
-                                        it.next();
-                                    } else {
-                                        empty("-startAt", null);
-                                    }
-                                }
-                            }
-                            ),
-
-                new HsArgRule("-ignoreFile",
-                                      "IgnoreFile",
-                                      null,
-                                      HsArgHandler.HASH
-                                      ),
-
-                new HsArgRule("-additionalFile",
-                              "AdditionalFile",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new ArgRuleSpecific("-additionalGeneratedFile",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    String cfg = getCfg(it.get());
-                                    if (nextNotKey(it)) {
-                                        String dir = it.get();
-                                        if (nextNotKey(it)) {
-                                            String fileName = it.get();
-                                            // we ignore files that we know are generated, so we coudn't
-                                            // find them in sources
-                                            BuildConfig.putFieldHash(cfg, "IgnoreFile",  fileName, "1");
-                                            BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile",
-                                                                     Util.normalize(dir + Util.sep + fileName),
-                                                                     fileName);
-                                            it.next();
-                                            return;
-                                        }
-                                    }
-                                    empty(null, "** Error: wrong number of args to -additionalGeneratedFile");
-                                }
-                            }
-                            ),
-
-                new HsArgRule("-includeDB",
-                              "IncludeDB",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-                new ArgRule("-prelink",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    if (nextNotKey(it)) {
-                                        String build = it.get();
-                                        if (nextNotKey(it)) {
-                                            String description = it.get();
-                                            if (nextNotKey(it)) {
-                                                String command = it.get();
-                                                BuildConfig.putField(null, "PrelinkDescription", description);
-                                                BuildConfig.putField(null, "PrelinkCommand", command);
-                                                it.next();
-                                                return;
-                                            }
-                                        }
-                                    }
-
-                                    empty(null,  "** Error: wrong number of args to -prelink");
-                                }
-                            }
-                            )
-            },
-                                       new ArgHandler() {
-                                           public void handle(ArgIterator it) {
-
-                                               throw new RuntimeException("Arg Parser: unrecognized option "+it.get());
-                                           }
-                                       }
-                                       );
-        if (BuildConfig.getField(null, "SourceBase") == null      ||
-            BuildConfig.getField(null, "BuildBase") == null       ||
-            BuildConfig.getField(null, "ProjectFileName") == null ||
-            BuildConfig.getField(null, "CompilerVersion") == null) {
-            usage();
-        }
-
-        if (BuildConfig.getField(null, "UseToGeneratePch") == null) {
-            throw new RuntimeException("ERROR: need to specify one file to compute PCH, with -useToGeneratePch flag");
-        }
-
-        BuildConfig.putField(null, "PlatformObject", this);
-    }
-
-    Vector createAllConfigs() {
-        Vector allConfigs = new Vector();
-
-        allConfigs.add(new C1DebugConfig());
-
-        boolean b = true;
-        if (b) {
-            allConfigs.add(new C1FastDebugConfig());
-            allConfigs.add(new C1ProductConfig());
-
-            allConfigs.add(new C2DebugConfig());
-            allConfigs.add(new C2FastDebugConfig());
-            allConfigs.add(new C2ProductConfig());
-
-            allConfigs.add(new TieredDebugConfig());
-            allConfigs.add(new TieredFastDebugConfig());
-            allConfigs.add(new TieredProductConfig());
-
-            allConfigs.add(new CoreDebugConfig());
-            allConfigs.add(new CoreFastDebugConfig());
-            allConfigs.add(new CoreProductConfig());
-
-            allConfigs.add(new KernelDebugConfig());
-            allConfigs.add(new KernelFastDebugConfig());
-            allConfigs.add(new KernelProductConfig());
-        }
-
-        return allConfigs;
-    }
-
-    class FileAttribute {
-        int     numConfigs;
-        Vector  configs;
-        String  shortName;
-        boolean noPch, pchRoot;
-
-        FileAttribute(String shortName, BuildConfig cfg, int numConfigs) {
-            this.shortName = shortName;
-            this.noPch =  (cfg.lookupHashFieldInContext("DisablePch", shortName) != null);
-            this.pchRoot = shortName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"));
-            this.numConfigs = numConfigs;
-
-            configs = new Vector();
-            add(cfg.get("Name"));
-        }
-
-        void add(String confName) {
-            configs.add(confName);
-
-            // if presented in all configs
-            if (configs.size() == numConfigs) {
-                configs = null;
-            }
-        }
-    }
-
-    class FileInfo implements Comparable {
-        String        full;
-        FileAttribute attr;
-
-        FileInfo(String full, FileAttribute  attr) {
-            this.full = full;
-            this.attr = attr;
-        }
-
-        public int compareTo(Object o) {
-            FileInfo oo = (FileInfo)o;
-            // Don't squelch identical short file names where the full
-            // paths are different
-            if (!attr.shortName.equals(oo.attr.shortName))
-              return attr.shortName.compareTo(oo.attr.shortName);
-            return full.compareTo(oo.full);
-        }
-
-        boolean isHeader() {
-            return attr.shortName.endsWith(".h") || attr.shortName.endsWith(".hpp");
-        }
-    }
-
-
-    TreeSet sortFiles(Hashtable allFiles) {
-        TreeSet rv = new TreeSet();
-        Enumeration e = allFiles.keys();
-        while (e.hasMoreElements()) {
-            String fullPath = (String)e.nextElement();
-            rv.add(new FileInfo(fullPath, (FileAttribute)allFiles.get(fullPath)));
-        }
-        return rv;
-    }
-
-    Hashtable computeAttributedFiles(Vector allConfigs) {
-        Hashtable ht = new Hashtable();
-        int numConfigs = allConfigs.size();
-
-        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
-            BuildConfig bc = (BuildConfig)i.next();
-            Hashtable  confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
-            String confName = bc.get("Name");
-
-            for (Enumeration e=confFiles.keys(); e.hasMoreElements(); ) {
-                String filePath = (String)e.nextElement();
-                FileAttribute fa = (FileAttribute)ht.get(filePath);
-
-                if (fa == null) {
-                    fa = new FileAttribute((String)confFiles.get(filePath), bc, numConfigs);
-                    ht.put(filePath, fa);
-                } else {
-                    fa.add(confName);
-                }
-            }
-        }
-
-        return ht;
-    }
-
-     Hashtable computeAttributedFiles(BuildConfig bc) {
-        Hashtable ht = new Hashtable();
-        Hashtable confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
-
-        for (Enumeration e = confFiles.keys(); e.hasMoreElements(); ) {
-            String filePath = (String)e.nextElement();
-            ht.put(filePath,  new FileAttribute((String)confFiles.get(filePath), bc, 1));
-        }
-
-        return ht;
-    }
-
-    PrintWriter printWriter;
-
-    public void writeProjectFile(String projectFileName, String projectName,
-                                 Vector allConfigs) throws IOException {
-        throw new RuntimeException("use compiler version specific version");
-    }
-}
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC6.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class WinGammaPlatformVC6 extends WinGammaPlatform {
-    public void writeProjectFile(String projectFileName, String projectName,
-                                 Vector allConfigs) throws IOException {
-        Vector allConfigNames = new Vector();
-
-        printWriter = new PrintWriter(new FileWriter(projectFileName));
-        String cfg = ((BuildConfig)allConfigs.get(0)).get("Name");
-
-        printWriter.println("# Microsoft Developer Studio Project File - Name=\"" + projectName + "\" - Package Owner=<4>");
-        printWriter.println("# Microsoft Developer Studio Generated Build File, Format Version 6.00");
-        printWriter.println("# ** DO NOT EDIT **");
-        printWriter.println("");
-        printWriter.println("# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102");
-        printWriter.println("CFG=" + cfg);
-        printWriter.println("");
-
-        printWriter.println("!MESSAGE This is not a valid makefile. To build this project using NMAKE,");
-        printWriter.println("!MESSAGE use the Export Makefile command and run");
-        printWriter.println("!MESSAGE ");
-        printWriter.println("!MESSAGE NMAKE /f \"" + projectName + ".mak\".");
-        printWriter.println("!MESSAGE ");
-        printWriter.println("!MESSAGE You can specify a configuration when running NMAKE");
-        printWriter.println("!MESSAGE by defining the macro CFG on the command line. For example:");
-        printWriter.println("!MESSAGE ");
-        printWriter.println("!MESSAGE NMAKE /f \"" + projectName + ".mak\" CFG=\"" + cfg + "\"");
-        printWriter.println("!MESSAGE ");
-        printWriter.println("!MESSAGE Possible choices for configuration are:");
-        printWriter.println("!MESSAGE ");
-        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
-            String name = ((BuildConfig)i.next()).get("Name");
-            printWriter.println("!MESSAGE \""+ name + "\" (based on \"Win32 (x86) Dynamic-Link Library\")");
-            allConfigNames.add(name);
-        }
-        printWriter.println("!MESSAGE ");
-        printWriter.println("");
-
-        printWriter.println("# Begin Project");
-        printWriter.println("# PROP AllowPerConfigDependencies 0");
-        printWriter.println("# PROP Scc_ProjName \"\"");
-        printWriter.println("# PROP Scc_LocalPath \"\"");
-        printWriter.println("CPP=cl.exe");
-        printWriter.println("MTL=midl.exe");
-        printWriter.println("RSC=rc.exe");
-
-
-        String keyword = "!IF";
-        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
-            BuildConfig bcfg = (BuildConfig)i.next();
-            printWriter.println(keyword + "  \"$(CFG)\" == \"" + bcfg.get("Name") + "\"");
-            writeConfigHeader(bcfg);
-            keyword = "!ELSEIF";
-            if (!i.hasNext()) printWriter.println("!ENDIF");
-        }
-
-
-        TreeSet sortedFiles = sortFiles(computeAttributedFiles(allConfigs));
-
-        printWriter.println("# Begin Target");
-
-        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
-            printWriter.println("# Name \"" + ((BuildConfig)i.next()).get("Name") + "\"");
-        }
-        printWriter.println("# Begin Group \"Header Files\"");
-        printWriter.println("# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"");
-
-        Iterator i = sortedFiles.iterator();
-
-        while (i.hasNext()) {
-            FileInfo fi = (FileInfo)i.next();
-
-            // skip sources
-            if (!fi.isHeader()) {
-                continue;
-            }
-
-            printFile(fi, allConfigNames);
-        }
-        printWriter.println("# End Group");
-        printWriter.println("");
-
-        printWriter.println("# Begin Group \"Source Files\"");
-        printWriter.println("# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90\"");
-
-        i = sortedFiles.iterator();
-        while (i.hasNext()) {
-            FileInfo fi = (FileInfo)i.next();
-
-            // skip headers
-            if (fi.isHeader()) {
-                continue;
-            }
-
-            printFile(fi, allConfigNames);
-        }
-        printWriter.println("# End Group");
-        printWriter.println("");
-
-
-        printWriter.println("# Begin Group \"Resource Files\"");
-        printWriter.println("# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"");
-        printWriter.println("# End Group");
-        printWriter.println("");
-        printWriter.println("# End Target");
-
-        printWriter.println("# End Project");
-
-        printWriter.close();
-    }
-
-
-    void printFile(FileInfo fi, Vector allConfigNames) {
-        printWriter.println("# Begin Source File");
-        printWriter.println("");
-        printWriter.println("SOURCE=\"" + fi.full + "\"");
-        FileAttribute attr = fi.attr;
-
-        if (attr.noPch) {
-            printWriter.println("# SUBTRACT CPP /YX /Yc /Yu");
-        }
-
-        if (attr.pchRoot) {
-            printWriter.println("# ADD CPP /Yc\"incls/_precompiled.incl\"");
-        }
-        if (attr.configs != null) {
-            String keyword = "!IF";
-            for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
-                String cfg = (String)j.next();
-                if (!attr.configs.contains(cfg)) {
-                    printWriter.println(keyword+" \"$(CFG)\" == \"" + cfg +"\"");
-                    printWriter.println("# PROP BASE Exclude_From_Build 1");
-                    printWriter.println("# PROP Exclude_From_Build 1");
-                    keyword = "!ELSEIF";
-                }
-            }
-            printWriter.println("!ENDIF");
-        }
-
-        printWriter.println("# End Source File");
-    }
-
-    void writeConfigHeader(BuildConfig cfg) {
-        printWriter.println("# Begin Special Build Tool");
-        printWriter.println("SOURCE=\"$(InputPath)\"");
-        printWriter.println("PreLink_Desc=" +  BuildConfig.getFieldString(null, "PrelinkDescription"));
-        printWriter.println("PreLink_Cmds=" +
-                            cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand")));
-        printWriter.println("# End Special Build Tool");
-        printWriter.println("");
-
-        for (Iterator i = cfg.getV("CompilerFlags").iterator(); i.hasNext(); ) {
-            printWriter.println("# "+(String)i.next());
-        }
-
-
-        printWriter.println("LINK32=link.exe");
-
-        for (Iterator i = cfg.getV("LinkerFlags").iterator(); i.hasNext(); ) {
-            printWriter.println("# "+(String)i.next());
-        }
-
-        printWriter.println("ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32");
-        printWriter.println("ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32");
-        printWriter.println("ADD BASE RSC /l 0x409 /d \"_DEBUG\"");
-        printWriter.println("ADD RSC /l 0x409 /d \"_DEBUG\"");
-        printWriter.println("BSC32=bscmake.exe");
-        printWriter.println("ADD BASE BSC32 /nologo");
-        printWriter.println("ADD BSC32 /nologo");
-        printWriter.println("");
-    }
-
-    protected String getProjectExt() {
-        return ".dsp";
-    }
-}
-
-
-class CompilerInterfaceVC6  extends CompilerInterface {
-    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
-        Vector rv = new Vector();
-
-        rv.add("PROP BASE Use_MFC 0");
-        rv.add("PROP Use_MFC 0");
-        rv.add("ADD CPP /nologo /MT /W3 /WX /GX /YX /Fr /FD /c");
-        rv.add("PROP BASE Output_Dir \""+outDir+"\"");
-        rv.add("PROP Output_Dir \""+outDir+"\"");
-        rv.add("PROP BASE Intermediate_Dir \""+outDir+"\"");
-        rv.add("PROP Intermediate_Dir \""+outDir+"\"");
-        rv.add("PROP BASE Target_Dir \"\"");
-        rv.add("PROP Target_Dir \"\"");
-        rv.add("ADD BASE CPP "+Util.prefixed_join(" /I ", includes, true));
-        rv.add("ADD CPP "+Util.prefixed_join(" /I ", includes, true));
-        rv.add("ADD BASE CPP "+Util.prefixed_join(" /D ", defines, true));
-        rv.add("ADD CPP "+Util.prefixed_join(" /D ", defines, true));
-        rv.add("ADD CPP /Yu\"incls/_precompiled.incl\"");
-
-        return rv;
-    }
-
-    Vector getBaseLinkerFlags(String outDir, String outDll) {
-        Vector rv = new Vector();
-
-        rv.add("PROP Ignore_Export_Lib 0");
-        rv.add("ADD BASE CPP /MD");
-        rv.add("ADD CPP /MD");
-        rv.add("ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib " +
-               "           advapi32.lib shell32.lib ole32.lib oleaut32.lib winmm.lib");
-        rv.add("ADD LINK32      /out:\""+outDll+"\" "+
-               "                /nologo /subsystem:windows /machine:I386" +
-               "                /nologo /base:\"0x8000000\" /subsystem:windows /dll" +
-               "                /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+
-               "                /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+
-               "                /export:jio_vsnprintf ");
-        rv.add("SUBTRACT LINK32 /pdb:none /map");
-
-        return rv;
-    }
-
-    Vector getDebugCompilerFlags(String opt) {
-        Vector rv = new Vector();
-
-        rv.add("ADD BASE CPP /Gm /Zi /O"+opt);
-
-        return rv;
-    }
-
-    Vector getDebugLinkerFlags() {
-        Vector rv = new Vector();
-
-        rv.add("PROP BASE Use_Debug_Libraries 1");
-        rv.add("PROP Use_Debug_Libraries 1");
-        rv.add("ADD LINK32 /debug");
-
-        return rv;
-    }
-
-    Vector getProductCompilerFlags() {
-        Vector rv = new Vector();
-
-        rv.add("ADD CPP /O"+getOptFlag());
-
-        return rv;
-    }
-
-    Vector getProductLinkerFlags() {
-        Vector rv = new Vector();
-
-        rv.add("PROP BASE Use_Debug_Libraries 0");
-        rv.add("PROP Use_Debug_Libraries 0");
-
-        return rv;
-    }
-
-    String getOptFlag() {
-        return "2";
-    }
-
-    String getNoOptFlag() {
-        return "d";
-    }
-
-    String makeCfgName(String flavourBuild) {
-        return "vm - "+ "Win32" + " " + flavourBuild;
-    }
-}
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC7.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,694 +0,0 @@
-/*
- * Copyright (c) 2005, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class WinGammaPlatformVC7 extends WinGammaPlatform {
-
-    String projectVersion() {return "7.10";};
-
-    public void writeProjectFile(String projectFileName, String projectName,
-                                 Vector allConfigs) throws IOException {
-        System.out.println();
-        System.out.println("    Writing .vcproj file...");
-        // If we got this far without an error, we're safe to actually
-        // write the .vcproj file
-        printWriter = new PrintWriter(new FileWriter(projectFileName));
-
-        printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>");
-        startTag(
-            "VisualStudioProject",
-            new String[] {
-                "ProjectType", "Visual C++",
-                "Version", projectVersion(),
-                "Name", projectName,
-                "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}",
-                "SccProjectName", "",
-                "SccLocalPath", ""
-            }
-            );
-
-        startTag("Platforms", null);
-        tag("Platform", new String[] {"Name", Util.os()});
-        endTag("Platforms");
-
-        startTag("Configurations", null);
-
-        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
-            writeConfiguration((BuildConfig)i.next());
-        }
-
-        endTag("Configurations");
-
-        tag("References", null);
-
-        writeFiles(allConfigs);
-
-        tag("Globals", null);
-
-        endTag("VisualStudioProject");
-        printWriter.close();
-
-        System.out.println("    Done.");
-    }
-
-
-    abstract class NameFilter {
-        protected String fname;
-
-        abstract boolean match(FileInfo fi);
-
-        String  filterString() { return ""; }
-        String name() { return this.fname;}
-    }
-
-    class DirectoryFilter extends NameFilter {
-        String dir;
-        int baseLen, dirLen;
-
-        DirectoryFilter(String dir, String sbase) {
-            this.dir = dir;
-            this.baseLen = sbase.length();
-            this.dirLen = dir.length();
-            this.fname = dir;
-        }
-
-        DirectoryFilter(String fname, String dir, String sbase) {
-            this.dir = dir;
-            this.baseLen = sbase.length();
-            this.dirLen = dir.length();
-            this.fname = fname;
-        }
-
-
-        boolean match(FileInfo fi) {
-            return fi.full.regionMatches(true, baseLen, dir, 0, dirLen);
-        }
-    }
-
-    class TypeFilter extends NameFilter {
-        String[] exts;
-
-        TypeFilter(String fname, String[] exts) {
-            this.fname = fname;
-            this.exts = exts;
-        }
-
-        boolean match(FileInfo fi) {
-            for (int i=0; i<exts.length; i++) {
-                if (fi.full.endsWith(exts[i])) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        String  filterString() {
-            return Util.join(";", exts);
-        }
-    }
-
-    class TerminatorFilter extends NameFilter {
-        TerminatorFilter(String fname) {
-            this.fname = fname;
-
-        }
-        boolean match(FileInfo fi) {
-            return true;
-        }
-
-    }
-
-    class SpecificNameFilter extends NameFilter {
-        String pats[];
-
-        SpecificNameFilter(String fname, String[] pats) {
-            this.fname = fname;
-            this.pats = pats;
-        }
-
-        boolean match(FileInfo fi) {
-            for (int i=0; i<pats.length; i++) {
-                if (fi.attr.shortName.matches(pats[i])) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-    }
-
-    class ContainerFilter extends NameFilter {
-        Vector children;
-
-        ContainerFilter(String fname) {
-            this.fname = fname;
-            children = new Vector();
-
-        }
-        boolean match(FileInfo fi) {
-            return false;
-        }
-
-        Iterator babies() { return children.iterator(); }
-
-        void add(NameFilter f) {
-            children.add(f);
-        }
-    }
-
-
-    void writeCustomToolConfig(Vector configs, String[] customToolAttrs) {
-        for (Iterator i = configs.iterator(); i.hasNext(); ) {
-            startTag("FileConfiguration",
-                     new String[] {
-                         "Name",  (String)i.next()
-                     }
-                     );
-            tag("Tool", customToolAttrs);
-
-            endTag("FileConfiguration");
-        }
-    }
-
-    // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC
-    // Basically there are two types of entities - container filters and real filters
-    //   - container filter just provides a container to group together real filters
-    //   - real filter can select elements from the set according to some rule, put it into XML
-    //     and remove from the list
-    Vector makeFilters(TreeSet files) {
-        Vector rv = new Vector();
-        String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/");
-
-        ContainerFilter rt = new ContainerFilter("Runtime");
-        rt.add(new DirectoryFilter("share/vm/prims", sbase));
-        rt.add(new DirectoryFilter("share/vm/runtime", sbase));
-        rt.add(new DirectoryFilter("share/vm/oops", sbase));
-        rv.add(rt);
-
-        ContainerFilter gc = new ContainerFilter("GC");
-        gc.add(new DirectoryFilter("share/vm/memory", sbase));
-        gc.add(new DirectoryFilter("share/vm/gc_interface", sbase));
-
-        ContainerFilter gc_impl = new ContainerFilter("Implementations");
-        gc_impl.add(new DirectoryFilter("CMS",
-                                        "share/vm/gc_implementation/concurrentMarkSweep",
-                                        sbase));
-        gc_impl.add(new DirectoryFilter("Parallel Scavenge",
-                                        "share/vm/gc_implementation/parallelScavenge",
-                                        sbase));
-        gc_impl.add(new DirectoryFilter("Shared",
-                                        "share/vm/gc_implementation/shared",
-                                        sbase));
-        // for all leftovers
-        gc_impl.add(new DirectoryFilter("Misc",
-                                        "share/vm/gc_implementation",
-                                        sbase));
-
-        gc.add(gc_impl);
-        rv.add(gc);
-
-        rv.add(new DirectoryFilter("C1X", "share/vm/c1x", sbase));
-
-        rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase));
-
-        ContainerFilter c2 = new ContainerFilter("C2");
-        //c2.add(new DirectoryFilter("share/vm/adlc", sbase));
-        c2.add(new DirectoryFilter("share/vm/opto", sbase));
-        c2.add(new SpecificNameFilter("Generated", new String[] {"^ad_.+", "^dfa_.+", "^adGlobals.+"}));
-        rv.add(c2);
-
-        ContainerFilter comp = new ContainerFilter("Compiler Common");
-        comp.add(new DirectoryFilter("share/vm/asm", sbase));
-        comp.add(new DirectoryFilter("share/vm/ci", sbase));
-        comp.add(new DirectoryFilter("share/vm/code", sbase));
-        comp.add(new DirectoryFilter("share/vm/compiler", sbase));
-        rv.add(comp);
-
-        rv.add(new DirectoryFilter("Interpreter",
-                                   "share/vm/interpreter",
-                                   sbase));
-
-        ContainerFilter misc = new ContainerFilter("Misc");
-        //misc.add(new DirectoryFilter("share/vm/launch", sbase));
-        misc.add(new DirectoryFilter("share/vm/libadt", sbase));
-        misc.add(new DirectoryFilter("share/vm/services", sbase));
-        misc.add(new DirectoryFilter("share/vm/utilities", sbase));
-        rv.add(misc);
-
-        rv.add(new DirectoryFilter("os_cpu", sbase));
-
-        rv.add(new DirectoryFilter("cpu", sbase));
-
-        rv.add(new DirectoryFilter("os", sbase));
-
-        rv.add(new SpecificNameFilter("JVMTI Generated", new String[] {"^jvmti.+"}));
-
-        rv.add(new SpecificNameFilter("C++ Interpreter Generated", new String[] {"^bytecodeInterpreterWithChecks.+"}));
-
-        rv.add(new SpecificNameFilter("Include DBs", new String[] {"^includeDB_.+"}));
-
-        // this one is to catch files not caught by other filters
-        //rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"}));
-        rv.add(new TerminatorFilter("Source Files"));
-
-        return rv;
-    }
-
-    void writeFiles(Vector allConfigs) {
-
-        Hashtable allFiles = computeAttributedFiles(allConfigs);
-
-        Vector allConfigNames = new Vector();
-        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
-            allConfigNames.add(((BuildConfig)i.next()).get("Name"));
-        }
-
-        TreeSet sortedFiles = sortFiles(allFiles);
-
-        startTag("Files", null);
-
-        for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) {
-            doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next());
-        }
-
-
-        startTag("Filter",
-                 new String[] {
-                     "Name", "Resource Files",
-                     "Filter", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-                 }
-                 );
-        endTag("Filter");
-
-        endTag("Files");
-    }
-
-    void doWriteFiles(TreeSet allFiles, Vector allConfigNames, NameFilter filter) {
-        startTag("Filter",
-                 new String[] {
-                     "Name",   filter.name(),
-                     "Filter", filter.filterString()
-                 }
-                 );
-
-        if (filter instanceof ContainerFilter) {
-
-            Iterator i = ((ContainerFilter)filter).babies();
-            while (i.hasNext()) {
-                doWriteFiles(allFiles, allConfigNames, (NameFilter)i.next());
-            }
-
-        } else {
-
-            Iterator i = allFiles.iterator();
-            while (i.hasNext()) {
-                FileInfo fi = (FileInfo)i.next();
-
-                if (!filter.match(fi)) {
-                    continue;
-                }
-
-                startTag("File",
-                         new String[] {
-                             "RelativePath", fi.full.replace('/', '\\')
-                         }
-                         );
-
-                FileAttribute a = fi.attr;
-                if (a.pchRoot) {
-                    writeCustomToolConfig(allConfigNames,
-                                          new String[] {
-                                              "Name", "VCCLCompilerTool",
-                                              "UsePrecompiledHeader", "1"
-                                          });
-                }
-
-                if (a.noPch) {
-                    writeCustomToolConfig(allConfigNames,
-                                          new String[] {
-                                              "Name", "VCCLCompilerTool",
-                                              "UsePrecompiledHeader", "0"
-                                          });
-                }
-
-                if (a.configs != null) {
-                    for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
-                        String cfg = (String)j.next();
-                        if (!a.configs.contains(cfg)) {
-                            startTag("FileConfiguration",
-                                     new String[] {
-                                         "Name", cfg,
-                                         "ExcludedFromBuild", "TRUE"
-                                     });
-                            tag("Tool", new String[] {"Name", "VCCLCompilerTool"});
-                            endTag("FileConfiguration");
-
-                        }
-                    }
-                }
-
-                endTag("File");
-
-                // we not gonna look at this file anymore
-                i.remove();
-            }
-        }
-
-        endTag("Filter");
-    }
-
-
-    void writeConfiguration(BuildConfig cfg) {
-        startTag("Configuration",
-                 new String[] {
-                     "Name", cfg.get("Name"),
-                     "OutputDirectory",  cfg.get("OutputDir"),
-                     "IntermediateDirectory",  cfg.get("OutputDir"),
-                     "ConfigurationType", "2",
-                     "UseOfMFC", "0",
-                     "ATLMinimizesCRunTimeLibraryUsage", "FALSE"
-                 }
-                 );
-
-
-
-        tagV("Tool", cfg.getV("CompilerFlags"));
-
-        tag("Tool",
-            new String[] {
-                "Name", "VCCustomBuildTool"
-            }
-            );
-
-        tagV("Tool", cfg.getV("LinkerFlags"));
-
-        tag("Tool",
-            new String[] {
-                "Name", "VCPostBuildEventTool"
-            }
-            );
-
-        tag("Tool",
-            new String[] {
-                "Name", "VCPreBuildEventTool"
-            }
-            );
-
-        tag("Tool",
-            new String[] {
-                "Name", "VCPreLinkEventTool",
-                "Description", BuildConfig.getFieldString(null, "PrelinkDescription"),
-                //Caution: String.replace(String,String) is available from JDK5 onwards only
-                "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace
-                   ("\t", "&#x0D;&#x0A;"))
-            }
-            );
-
-        tag("Tool",
-            new String[] {
-                "Name", "VCResourceCompilerTool",
-                // XXX???
-                "PreprocessorDefinitions", "NDEBUG",
-                "Culture", "1033"
-            }
-            );
-        tag("Tool",
-            new String[] {
-              "Name", "VCWebServiceProxyGeneratorTool"
-            }
-            );
-
-        tag ("Tool",
-             new String[] {
-              "Name", "VCXMLDataGeneratorTool"
-             }
-             );
-
-        tag("Tool",
-            new String[] {
-              "Name", "VCWebDeploymentTool"
-            }
-            );
-        tag("Tool",
-             new String[] {
-            "Name", "VCManagedWrapperGeneratorTool"
-             }
-            );
-        tag("Tool",
-            new String[] {
-              "Name", "VCAuxiliaryManagedWrapperGeneratorTool"
-            }
-            );
-
-        tag("Tool",
-            new String[] {
-                "Name", "VCMIDLTool",
-                "PreprocessorDefinitions", "NDEBUG",
-                "MkTypLibCompatible", "TRUE",
-                "SuppressStartupBanner", "TRUE",
-                "TargetEnvironment", Util.os().equals("Win32") ? "1" : "3",
-                "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb",
-                "HeaderFileName", ""
-            }
-            );
-
-        endTag("Configuration");
-    }
-
-    int indent;
-
-    private void startTagPrim(String name,
-                              String[] attrs,
-                              boolean close) {
-        doIndent();
-        printWriter.print("<"+name);
-        indent++;
-
-        if (attrs != null) {
-            printWriter.println();
-            for (int i=0; i<attrs.length; i+=2) {
-                doIndent();
-                printWriter.println(" " + attrs[i]+"=\""+attrs[i+1]+"\"");
-            }
-        }
-
-        if (close) {
-            indent--;
-            //doIndent();
-            printWriter.println("/>");
-        } else {
-            //doIndent();
-            printWriter.println(">");
-        }
-    }
-
-    void startTag(String name, String[] attrs) {
-        startTagPrim(name, attrs, false);
-    }
-
-    void startTagV(String name, Vector attrs) {
-        String s[] = new String [attrs.size()];
-         for (int i=0; i<attrs.size(); i++) {
-             s[i] = (String)attrs.elementAt(i);
-         }
-        startTagPrim(name, s, false);
-    }
-
-    void endTag(String name) {
-        indent--;
-        doIndent();
-        printWriter.println("</"+name+">");
-    }
-
-    void tag(String name, String[] attrs) {
-        startTagPrim(name, attrs, true);
-    }
-
-     void tagV(String name, Vector attrs) {
-         String s[] = new String [attrs.size()];
-         for (int i=0; i<attrs.size(); i++) {
-             s[i] = (String)attrs.elementAt(i);
-         }
-         startTagPrim(name, s, true);
-    }
-
-
-    void doIndent() {
-        for (int i=0; i<indent; i++) {
-            printWriter.print("    ");
-        }
-    }
-
-    protected String getProjectExt() {
-        return ".vcproj";
-    }
-}
-
-class CompilerInterfaceVC7 extends CompilerInterface {
-    void getBaseCompilerFlags_common(Vector defines, Vector includes, String outDir,Vector rv) {
-
-        // advanced M$ IDE (2003) can only recognize name if it's first or
-        // second attribute in the tag - go guess
-        addAttr(rv, "Name", "VCCLCompilerTool");
-        addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes));
-        addAttr(rv, "PreprocessorDefinitions",
-                                Util.join(";", defines).replace("\"","&quot;"));
-        addAttr(rv, "PrecompiledHeaderThrough",
-                                "incls"+Util.sep+"_precompiled.incl");
-        addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch");
-        addAttr(rv, "AssemblerListingLocation", outDir);
-        addAttr(rv, "ObjectFile", outDir+Util.sep);
-        addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"vm.pdb");
-        // Set /nologo optin
-        addAttr(rv, "SuppressStartupBanner", "TRUE");
-        // Surpass the default /Tc or /Tp. 0 is compileAsDefault
-        addAttr(rv, "CompileAs", "0");
-        // Set /W3 option. 3 is warningLevel_3
-        addAttr(rv, "WarningLevel", "3");
-        // Set /WX option,
-        addAttr(rv, "WarnAsError", "TRUE");
-        // Set /GS option
-        addAttr(rv, "BufferSecurityCheck", "FALSE");
-        // Set /Zi option. 3 is debugEnabled
-        addAttr(rv, "DebugInformationFormat", "3");
-    }
-    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
-        Vector rv = new Vector();
-
-        getBaseCompilerFlags_common(defines,includes, outDir, rv);
-        // Set /Yu option. 3 is pchUseUsingSpecific
-        // Note: Starting VC8 pchUseUsingSpecific is 2 !!!
-        addAttr(rv, "UsePrecompiledHeader", "3");
-        // Set /EHsc- option
-        addAttr(rv, "ExceptionHandling", "FALSE");
-
-        return rv;
-    }
-
-    Vector getBaseLinkerFlags(String outDir, String outDll) {
-        Vector rv = new Vector();
-
-        addAttr(rv, "Name", "VCLinkerTool");
-        addAttr(rv, "AdditionalOptions",
-                "/export:JNI_GetDefaultJavaVMInitArgs " +
-                "/export:JNI_CreateJavaVM " +
-                "/export:JNI_GetCreatedJavaVMs "+
-                "/export:jio_snprintf /export:jio_printf "+
-                "/export:jio_fprintf /export:jio_vfprintf "+
-                "/export:jio_vsnprintf ");
-        addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib");
-        addAttr(rv, "OutputFile", outDll);
-        // Set /INCREMENTAL option. 1 is linkIncrementalNo
-        addAttr(rv, "LinkIncremental", "1");
-        addAttr(rv, "SuppressStartupBanner", "TRUE");
-        addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
-        addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"vm.pdb");
-        // Set /SUBSYSTEM option. 2 is subSystemWindows
-        addAttr(rv, "SubSystem", "2");
-        addAttr(rv, "BaseAddress", "0x8000000");
-        addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
-        // Set /MACHINE option. 1 is machineX86
-        addAttr(rv, "TargetMachine", Util.os().equals("Win32") ? "1" : "17");
-
-        return rv;
-    }
-
-    void  getDebugCompilerFlags_common(String opt,Vector rv) {
-
-        // Set /On option
-        addAttr(rv, "Optimization", opt);
-        // Set /FR option. 1 is brAllInfo
-        addAttr(rv, "BrowseInformation", "1");
-        addAttr(rv, "BrowseInformationFile", "$(IntDir)" + Util.sep);
-        // Set /MD option. 2 is rtMultiThreadedDLL
-        addAttr(rv, "RuntimeLibrary", "2");
-        // Set /Oy- option
-        addAttr(rv, "OmitFramePointers", "FALSE");
-
-    }
-
-    Vector getDebugCompilerFlags(String opt) {
-        Vector rv = new Vector();
-
-        getDebugCompilerFlags_common(opt,rv);
-
-        return rv;
-    }
-
-    Vector getDebugLinkerFlags() {
-        Vector rv = new Vector();
-
-        addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option
-
-        return rv;
-    }
-
-    void getProductCompilerFlags_common(Vector rv) {
-        // Set /O2 option. 2 is optimizeMaxSpeed
-        addAttr(rv, "Optimization", "2");
-        // Set /Oy- option
-        addAttr(rv, "OmitFramePointers", "FALSE");
-    }
-
-    Vector getProductCompilerFlags() {
-        Vector rv = new Vector();
-
-        getProductCompilerFlags_common(rv);
-        // Set /Ob option.  1 is expandOnlyInline
-        addAttr(rv, "InlineFunctionExpansion", "1");
-        // Set /GF option.
-        addAttr(rv, "StringPooling", "TRUE");
-        // Set /MD option. 2 is rtMultiThreadedDLL
-        addAttr(rv, "RuntimeLibrary", "2");
-        // Set /Gy option
-        addAttr(rv, "EnableFunctionLevelLinking", "TRUE");
-
-        return rv;
-    }
-
-    Vector getProductLinkerFlags() {
-        Vector rv = new Vector();
-
-        // Set /OPT:REF option. 2 is optReferences
-        addAttr(rv, "OptimizeReferences", "2");
-        // Set /OPT:optFolding option. 2 is optFolding
-        addAttr(rv, "EnableCOMDATFolding", "2");
-
-        return rv;
-    }
-
-    String getOptFlag() {
-        return "2";
-    }
-
-    String getNoOptFlag() {
-        return "0";
-    }
-
-    String makeCfgName(String flavourBuild) {
-        return  flavourBuild + "|" + Util.os();
-    }
-}
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC8.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2005, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class WinGammaPlatformVC8 extends WinGammaPlatformVC7 {
-
-    String projectVersion() {return "8.00";};
-
-}
-
-class CompilerInterfaceVC8 extends CompilerInterfaceVC7 {
-
-    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
-        Vector rv = new Vector();
-
-        getBaseCompilerFlags_common(defines,includes, outDir, rv);
-        // Set /Yu option. 2 is pchUseUsingSpecific
-        addAttr(rv, "UsePrecompiledHeader", "2");
-        // Set /EHsc- option. 0 is cppExceptionHandlingNo
-        addAttr(rv, "ExceptionHandling", "0");
-        // Parallel compilation
-        addAttr(rv, "AdditionalOptions", "/MP");
-
-        return rv;
-    }
-
-
-    Vector getDebugCompilerFlags(String opt) {
-        Vector rv = new Vector();
-
-        getDebugCompilerFlags_common(opt,rv);
-
-        return rv;
-    }
-
-    Vector getProductCompilerFlags() {
-        Vector rv = new Vector();
-
-        getProductCompilerFlags_common(rv);
-
-        return rv;
-    }
-
-
-}
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC9.java	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2005, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class WinGammaPlatformVC9 extends WinGammaPlatformVC8 {
-
-    String projectVersion() {return "9.00";};
-
-}
-
-class CompilerInterfaceVC9 extends CompilerInterfaceVC8 {
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/ArgsParser.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+class ArgIterator {
+    String[] args;
+    int i;
+    ArgIterator(String[] args) {
+        this.args = args;
+        this.i = 0;
+    }
+    String get() { return args[i]; }
+    boolean hasMore() { return args != null && i  < args.length; }
+    boolean next() { return ++i < args.length; }
+}
+
+abstract class ArgHandler {
+    public abstract void handle(ArgIterator it);
+
+}
+
+class ArgRule {
+    String arg;
+    ArgHandler handler;
+    ArgRule(String arg, ArgHandler handler) {
+        this.arg = arg;
+        this.handler = handler;
+    }
+
+    boolean process(ArgIterator it) {
+        if (match(it.get(), arg)) {
+            handler.handle(it);
+            return true;
+        }
+        return false;
+    }
+    boolean match(String rule_pattern, String arg) {
+        return arg.equals(rule_pattern);
+    }
+}
+
+class ArgsParser {
+    ArgsParser(String[] args,
+               ArgRule[] rules,
+               ArgHandler defaulter) {
+        ArgIterator ai = new ArgIterator(args);
+        while (ai.hasMore()) {
+            boolean processed = false;
+            for (int i=0; i<rules.length; i++) {
+                processed |= rules[i].process(ai);
+                if (processed) {
+                    break;
+                }
+            }
+            if (!processed) {
+                if (defaulter != null) {
+                    defaulter.handle(ai);
+                } else {
+                    System.err.println("ERROR: unparsed \""+ai.get()+"\"");
+                    ai.next();
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/BuildConfig.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,746 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.io.File;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Vector;
+
+class BuildConfig {
+    Hashtable vars;
+    Vector basicNames, basicPaths;
+    String[] context;
+
+    static CompilerInterface ci;
+    static CompilerInterface getCI() {
+        if (ci == null) {
+            String comp = (String)getField(null, "CompilerVersion");
+            try {
+                ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance();
+            } catch (Exception cnfe) {
+                System.err.println("Cannot find support for compiler " + comp);
+                throw new RuntimeException(cnfe.toString());
+            }
+        }
+        return ci;
+    }
+
+    protected void initNames(String flavour, String build, String outDll) {
+        if (vars == null) vars = new Hashtable();
+
+        String flavourBuild =  flavour + "_" + build;
+        System.out.println();
+        System.out.println(flavourBuild);
+
+        put("Name", getCI().makeCfgName(flavourBuild));
+        put("Flavour", flavour);
+        put("Build", build);
+
+        // ones mentioned above were needed to expand format
+        String buildBase = expandFormat(getFieldString(null, "BuildBase"));
+        String sourceBase = getFieldString(null, "SourceBase");
+        String outDir = buildBase;
+
+        put("Id", flavourBuild);
+        put("OutputDir", outDir);
+        put("SourceBase", sourceBase);
+        put("BuildBase", buildBase);
+        put("OutputDll", outDir + Util.sep + outDll);
+
+        context = new String [] {flavourBuild, flavour, build, null};
+    }
+
+    protected void init(Vector includes, Vector defines) {
+        initDefaultDefines(defines);
+        initDefaultCompilerFlags(includes);
+        initDefaultLinkerFlags();
+        handleDB();
+    }
+
+
+    protected void initDefaultCompilerFlags(Vector includes) {
+        Vector compilerFlags = new Vector();
+
+        compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
+                                                          includes,
+                                                          get("OutputDir")));
+
+        put("CompilerFlags", compilerFlags);
+    }
+
+    protected void initDefaultLinkerFlags() {
+        Vector linkerFlags = new Vector();
+
+        linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll")));
+
+        put("LinkerFlags", linkerFlags);
+    }
+
+    DirectoryTree getSourceTree(String sourceBase, String startAt) {
+        DirectoryTree tree = new DirectoryTree();
+
+        tree.addSubdirToIgnore("Codemgr_wsdata");
+        tree.addSubdirToIgnore("deleted_files");
+        tree.addSubdirToIgnore("SCCS");
+        tree.setVerbose(true);
+        if (startAt != null) {
+            tree.readDirectory(sourceBase + File.separator + startAt);
+        } else {
+            tree.readDirectory(sourceBase);
+        }
+
+        return tree;
+    }
+
+
+    Vector getPreferredPaths(MacroDefinitions macros) {
+        Vector preferredPaths = new Vector();
+        // In the case of multiple files with the same name in
+        // different subdirectories, prefer the versions specified in
+        // the platform file as the "os_family" and "arch" macros.
+        for (Iterator iter = macros.getMacros(); iter.hasNext(); ) {
+            Macro macro = (Macro) iter.next();
+            if (macro.name.equals("os_family") ||
+                macro.name.equals("arch")) {
+                preferredPaths.add(macro.contents);
+            }
+        }
+        // Also prefer "opto" over "adlc" for adlcVMDeps.hpp
+        preferredPaths.add("opto");
+
+        return preferredPaths;
+    }
+
+
+    void handleDB() {
+        WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject");
+
+        File incls = new File(get("OutputDir")+Util.sep+"incls");
+
+        incls.mkdirs();
+
+        MacroDefinitions macros = new MacroDefinitions();
+        try {
+            macros.readFrom(getFieldString(null, "Platform"), false);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        putSpecificField("AllFilesHash", computeAllFiles(platform, macros));
+    }
+
+
+    private boolean matchesIgnoredPath(String prefixedName) {
+        Vector rv = new Vector();
+        collectRelevantVectors(rv, "IgnorePath");
+        for (Iterator i = rv.iterator(); i.hasNext(); ) {
+            String pathPart = (String) i.next();
+            if (prefixedName.contains(Util.normalize(pathPart)))  {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    void addAll(Iterator i, Hashtable hash,
+                WinGammaPlatform platform, DirectoryTree tree,
+                Vector preferredPaths, Vector filesNotFound, Vector filesDuplicate) {
+        for (; i.hasNext(); ) {
+            String fileName = (String) i.next();
+            if (lookupHashFieldInContext("IgnoreFile", fileName) == null) {
+                String prefixedName = platform.envVarPrefixedFileName(fileName,
+                                                                      0, /* ignored */
+                                                                      tree,
+                                                                      preferredPaths,
+                                                                      filesNotFound,
+                                                                      filesDuplicate);
+                if (prefixedName != null) {
+                    prefixedName = Util.normalize(prefixedName);
+                    if (!matchesIgnoredPath(prefixedName)) {
+                        addTo(hash, prefixedName, fileName);
+                    }
+                }
+            }
+        }
+    }
+
+    void addTo(Hashtable ht, String key, String value) {
+        ht.put(expandFormat(key), expandFormat(value));
+    }
+
+    Hashtable computeAllFiles(WinGammaPlatform platform, MacroDefinitions macros) {
+        Hashtable rv = new Hashtable();
+        DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt"));
+        Vector preferredPaths = getPreferredPaths(macros);
+
+        // Hold errors until end
+        Vector filesNotFound = new Vector();
+        Vector filesDuplicate = new Vector();
+
+        Vector includedFiles = new Vector();
+
+        // find all files
+        Vector dirs = getSourceIncludes();
+        for (Iterator i = dirs.iterator(); i.hasNext(); ) {
+            String dir = (String)i.next();
+            DirectoryTree subtree = getSourceTree(dir, null);
+            for (Iterator fi = subtree.getFileIterator(); fi.hasNext(); ) {
+                String name = ((File)fi.next()).getName();
+                includedFiles.add(name);
+            }
+        }
+        addAll(includedFiles.iterator(), rv,
+               platform, tree,
+               preferredPaths, filesNotFound, filesDuplicate);
+
+        Vector addFiles = new Vector();
+        collectRelevantVectors(addFiles, "AdditionalFile");
+        addAll(addFiles.iterator(), rv,
+               platform, tree,
+               preferredPaths, filesNotFound, filesDuplicate);
+
+        collectRelevantHashes(rv, "AdditionalGeneratedFile");
+
+        if ((filesNotFound.size() != 0) ||
+            (filesDuplicate.size() != 0)) {
+            System.err.println("Error: some files were not found or " +
+                               "appeared in multiple subdirectories of " +
+                               "directory " + get("SourceBase") + " and could not " +
+                               "be resolved with the os_family and arch " +
+                               "macros in the platform file.");
+            if (filesNotFound.size() != 0) {
+                System.err.println("Files not found:");
+                for (Iterator iter = filesNotFound.iterator();
+                     iter.hasNext(); ) {
+                    System.err.println("  " + (String) iter.next());
+                }
+            }
+            if (filesDuplicate.size() != 0) {
+                System.err.println("Duplicate files:");
+                for (Iterator iter = filesDuplicate.iterator();
+                     iter.hasNext(); ) {
+                    System.err.println("  " + (String) iter.next());
+                }
+            }
+            throw new RuntimeException();
+        }
+
+        return rv;
+    }
+
+    void initDefaultDefines(Vector defines) {
+        Vector sysDefines = new Vector();
+        if( Util.os().equals("Win32")) {
+        	sysDefines.add("WIN32");
+            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
+        } else {
+        	sysDefines.add("_AMD64_");
+        	sysDefines.add("AMD64");
+        	sysDefines.add("_WIN64");
+        	sysDefines.add("_LP64");
+        	if (System.getenv("MSC_VER") != null)
+        		sysDefines.add("MSC_VER=" + System.getenv("MSC_VER"));
+            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
+        }
+        sysDefines.add("_WINDOWS");
+        sysDefines.add("HOTSPOT_BUILD_USER="+System.getProperty("user.name"));
+        sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
+        sysDefines.add("_JNI_IMPLEMENTATION_");
+
+        sysDefines.addAll(defines);
+
+        put("Define", sysDefines);
+    }
+
+    String get(String key) {
+        return (String)vars.get(key);
+    }
+
+    Vector getV(String key) {
+        return (Vector)vars.get(key);
+    }
+
+    Object getO(String key) {
+        return vars.get(key);
+    }
+
+    Hashtable getH(String key) {
+        return (Hashtable)vars.get(key);
+    }
+
+    Object getFieldInContext(String field) {
+        for (int i=0; i<context.length; i++) {
+            Object rv = getField(context[i], field);
+            if (rv != null) {
+                return rv;
+            }
+        }
+        return null;
+    }
+
+    Object lookupHashFieldInContext(String field, String key) {
+        for (int i=0; i<context.length; i++) {
+            Hashtable ht = (Hashtable)getField(context[i], field);
+            if (ht != null) {
+                Object rv = ht.get(key);
+                if (rv != null) {
+                    return rv;
+                }
+            }
+        }
+        return null;
+    }
+
+    void put(String key, String value) {
+        vars.put(key, value);
+    }
+
+    void put(String key, Vector vvalue) {
+        vars.put(key, vvalue);
+    }
+
+    void add(String key, Vector vvalue) {
+        getV(key).addAll(vvalue);
+    }
+
+    String flavour() {
+        return get("Flavour");
+    }
+
+    String build() {
+        return get("Build");
+    }
+
+    Object getSpecificField(String field) {
+        return getField(get("Id"), field);
+    }
+
+    void putSpecificField(String field, Object value) {
+        putField(get("Id"), field, value);
+    }
+
+    void collectRelevantVectors(Vector rv, String field) {
+        for (int i = 0; i < context.length; i++) {
+            Vector v = getFieldVector(context[i], field);
+            if (v != null) {
+                for (Iterator j=v.iterator(); j.hasNext(); ) {
+                    String val = (String)j.next();
+                    rv.add(expandFormat(val));
+                }
+            }
+        }
+    }
+
+    void collectRelevantHashes(Hashtable rv, String field) {
+        for (int i = 0; i < context.length; i++) {
+            Hashtable v = (Hashtable)getField(context[i], field);
+            if (v != null) {
+                for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
+                    String key = (String)e.nextElement();
+                    String val =  (String)v.get(key);
+                    addTo(rv, key, val);
+                }
+            }
+        }
+    }
+
+
+    Vector getDefines() {
+        Vector rv = new Vector();
+        collectRelevantVectors(rv, "Define");
+        return rv;
+    }
+
+    Vector getIncludes() {
+        Vector rv = new Vector();
+
+        collectRelevantVectors(rv, "AbsoluteInclude");
+
+        rv.addAll(getSourceIncludes());
+
+        return rv;
+    }
+
+    private Vector getSourceIncludes() {
+        Vector rv = new Vector();
+        Vector ri = new Vector();
+        String sourceBase = getFieldString(null, "SourceBase");
+        collectRelevantVectors(ri, "RelativeInclude");
+        for (Iterator i = ri.iterator(); i.hasNext(); ) {
+            String f = (String)i.next();
+            rv.add(sourceBase + Util.sep + f);
+        }
+        return rv;
+    }
+
+    static Hashtable cfgData = new Hashtable();
+    static Hashtable globalData = new Hashtable();
+
+    static boolean appliesToTieredBuild(String cfg) {
+        return (cfg != null &&
+                (cfg.startsWith("compiler1") ||
+                 cfg.startsWith("compiler2")));
+    }
+
+    // Filters out the IgnoreFile and IgnorePaths since they are
+    // handled specially for tiered builds.
+    static boolean appliesToTieredBuild(String cfg, String key) {
+        return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore"));
+    }
+
+    static String getTieredBuildCfg(String cfg) {
+        assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
+        return "tiered" + cfg.substring(9);
+    }
+
+    static Object getField(String cfg, String field) {
+        if (cfg == null) {
+            return globalData.get(field);
+        }
+
+        Hashtable ht =  (Hashtable)cfgData.get(cfg);
+        return ht == null ? null : ht.get(field);
+    }
+
+    static String getFieldString(String cfg, String field) {
+        return (String)getField(cfg, field);
+    }
+
+    static Vector getFieldVector(String cfg, String field) {
+        return (Vector)getField(cfg, field);
+    }
+
+    static void putField(String cfg, String field, Object value) {
+        putFieldImpl(cfg, field, value);
+        if (appliesToTieredBuild(cfg, field)) {
+            putFieldImpl(getTieredBuildCfg(cfg), field, value);
+        }
+    }
+
+    private static void putFieldImpl(String cfg, String field, Object value) {
+        if (cfg == null) {
+            globalData.put(field, value);
+            return;
+        }
+
+        Hashtable ht = (Hashtable)cfgData.get(cfg);
+        if (ht == null) {
+            ht = new Hashtable();
+            cfgData.put(cfg, ht);
+        }
+
+        ht.put(field, value);
+    }
+
+    static Object getFieldHash(String cfg, String field, String name) {
+        Hashtable ht = (Hashtable)getField(cfg, field);
+
+        return ht == null ? null : ht.get(name);
+    }
+
+    static void putFieldHash(String cfg, String field, String name, Object val) {
+        putFieldHashImpl(cfg, field, name, val);
+        if (appliesToTieredBuild(cfg, field)) {
+            putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
+        }
+    }
+
+    private static void putFieldHashImpl(String cfg, String field, String name, Object val) {
+        Hashtable ht = (Hashtable)getField(cfg, field);
+
+        if (ht == null) {
+            ht = new Hashtable();
+            putFieldImpl(cfg, field, ht);
+        }
+
+        ht.put(name, val);
+    }
+
+    static void addFieldVector(String cfg, String field, String element) {
+        addFieldVectorImpl(cfg, field, element);
+        if (appliesToTieredBuild(cfg, field)) {
+            addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
+        }
+    }
+
+    private static void addFieldVectorImpl(String cfg, String field, String element) {
+        Vector v = (Vector)getField(cfg, field);
+
+        if (v == null) {
+            v = new Vector();
+            putFieldImpl(cfg, field, v);
+        }
+
+        v.add(element);
+    }
+
+    String expandFormat(String format) {
+        if (format == null) {
+            return null;
+        }
+
+        if (format.indexOf('%') == -1) {
+            return format;
+        }
+
+        StringBuffer sb = new StringBuffer();
+        int len = format.length();
+        for (int i=0; i<len; i++) {
+            char ch = format.charAt(i);
+            if (ch == '%') {
+                char ch1 = format.charAt(i+1);
+                switch (ch1) {
+                case '%':
+                    sb.append(ch1);
+                    break;
+                case 'b':
+                    sb.append(build());
+                    break;
+                case 'f':
+                    sb.append(flavour());
+                    break;
+                default:
+                    sb.append(ch);
+                    sb.append(ch1);
+                }
+                i++;
+            } else {
+                sb.append(ch);
+            }
+        }
+
+        return sb.toString();
+    }
+}
+
+abstract class GenericDebugConfig extends BuildConfig {
+    abstract String getOptFlag();
+
+    protected void init(Vector includes, Vector defines) {
+        defines.add("_DEBUG");
+        defines.add("ASSERT");
+
+        super.init(includes, defines);
+
+        getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag()));
+        getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags());
+   }
+}
+
+abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
+    protected void init(Vector includes, Vector defines) {
+        super.init(includes, defines);
+        getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
+   }
+}
+
+class C1DebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    C1DebugConfig() {
+        initNames("compiler1", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class C1FastDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    C1FastDebugConfig() {
+        initNames("compiler1", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class C2DebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    C2DebugConfig() {
+        initNames("compiler2", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class C2FastDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    C2FastDebugConfig() {
+        initNames("compiler2", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class TieredDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    TieredDebugConfig() {
+        initNames("tiered", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    TieredFastDebugConfig() {
+        initNames("tiered", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+
+abstract class ProductConfig extends BuildConfig {
+    protected void init(Vector includes, Vector defines) {
+        defines.add("NDEBUG");
+        defines.add("PRODUCT");
+
+        super.init(includes, defines);
+
+        getV("CompilerFlags").addAll(getCI().getProductCompilerFlags());
+        getV("LinkerFlags").addAll(getCI().getProductLinkerFlags());
+    }
+}
+
+class C1ProductConfig extends ProductConfig {
+    C1ProductConfig() {
+        initNames("compiler1", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class C2ProductConfig extends ProductConfig {
+    C2ProductConfig() {
+        initNames("compiler2", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class TieredProductConfig extends ProductConfig {
+    TieredProductConfig() {
+        initNames("tiered", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+
+class CoreDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    CoreDebugConfig() {
+        initNames("core", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+
+class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    CoreFastDebugConfig() {
+        initNames("core", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+
+class CoreProductConfig extends ProductConfig {
+    CoreProductConfig() {
+        initNames("core", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class KernelDebugConfig extends GenericDebugConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    KernelDebugConfig() {
+        initNames("kernel", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+
+class KernelFastDebugConfig extends GenericDebugConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    KernelFastDebugConfig() {
+        initNames("kernel", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+
+class KernelProductConfig extends ProductConfig {
+    KernelProductConfig() {
+        initNames("kernel", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+abstract class CompilerInterface {
+    abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
+    abstract Vector getBaseLinkerFlags(String outDir, String outDll);
+    abstract Vector getDebugCompilerFlags(String opt);
+    abstract Vector getDebugLinkerFlags();
+    abstract void   getAdditionalNonKernelLinkerFlags(Vector rv);
+    abstract Vector getProductCompilerFlags();
+    abstract Vector getProductLinkerFlags();
+    abstract String getOptFlag();
+    abstract String getNoOptFlag();
+    abstract String makeCfgName(String flavourBuild);
+
+    void addAttr(Vector receiver, String attr, String value) {
+        receiver.add(attr); receiver.add(value);
+    }
+    void extAttr(Vector receiver, String attr, String value) {
+        int attr_pos=receiver.indexOf(attr) ;
+        if ( attr_pos == -1) {
+          // If attr IS NOT present in the Vector - add it
+          receiver.add(attr); receiver.add(value);
+        } else {
+          // If attr IS present in the Vector - append value to it
+          receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/DirectoryTree.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/** Encapsulates a notion of a directory tree. Designed to allow fast
+    querying of full paths for unique filenames in the hierarchy. */
+
+import java.io.*;
+import java.util.*;
+
+public class DirectoryTree {
+
+    /** The root of the read directoryTree */
+    private Node rootNode;
+
+    /** Subdirs to ignore; Vector of Strings */
+    private Vector subdirsToIgnore;
+
+    /** This maps file names to Lists of nodes. */
+    private Hashtable nameToNodeListTable;
+
+    /** Output "."'s as directories are read. Defaults to false. */
+    private boolean verbose;
+
+    public DirectoryTree() {
+        subdirsToIgnore = new Vector();
+        verbose = false;
+    }
+
+    public void addSubdirToIgnore(String subdir) {
+        subdirsToIgnore.add(subdir);
+    }
+
+    private class FileIterator implements Iterator {
+        private Vector nodes = new Vector();
+
+        public FileIterator(Node rootNode) {
+            nodes.add(rootNode);
+            prune();
+        }
+        public boolean hasNext() {
+            return nodes.size() > 0;
+        }
+        public Object next() {
+            Node last = (Node)nodes.remove(nodes.size() - 1);
+            prune();
+            return new File(last.getName());
+        }
+
+        public void remove() {
+            throw new RuntimeException();
+        }
+
+        private void prune() {
+            while (nodes.size() > 0) {
+                Node last = (Node)nodes.get(nodes.size() - 1);
+
+                if (last.isDirectory()) {
+                    nodes.remove(nodes.size() - 1);
+                    nodes.addAll(last.children);
+                } else {
+                    // Is at file
+                    return;
+                }
+            }
+        }
+    }
+
+    public Iterator getFileIterator() {
+        return new FileIterator(rootNode);
+    }
+
+    /** Output "."'s to System.out as directories are read. Defaults
+        to false. */
+    public void setVerbose(boolean newValue) {
+        verbose = newValue;
+    }
+
+    public boolean getVerbose() {
+        return verbose;
+    }
+
+    public String getRootNodeName() {
+        return rootNode.getName();
+    }
+
+    /** Takes an absolute path to the root directory of this
+        DirectoryTree. Throws IllegalArgumentException if the given
+        string represents a plain file or nonexistent directory. */
+
+    public void readDirectory(String baseDirectory)
+        throws IllegalArgumentException {
+        File root = new File(Util.normalize(baseDirectory));
+        if (!root.isDirectory()) {
+            throw new IllegalArgumentException("baseDirectory \"" +
+                                               baseDirectory +
+                                               "\" does not exist or " +
+                                               "is not a directory");
+        }
+        try {
+            root = root.getCanonicalFile();
+        }
+        catch (IOException e) {
+            throw new RuntimeException(e.toString());
+        }
+        rootNode = new Node(root);
+        readDirectory(rootNode, root);
+    }
+
+    /** Queries the DirectoryTree for a file or directory name. Takes
+        only the name of the file or directory itself (i.e., no parent
+        directory information should be in the passed name). Returns a
+        List of DirectoryTreeNodes specifying the full paths of all of
+        the files or directories of this name in the DirectoryTree.
+        Returns null if the directory tree has not been read from disk
+        yet or if the file was not found in the tree. */
+    public List findFile(String name) {
+        if (rootNode == null) {
+            return null;
+        }
+
+        if (nameToNodeListTable == null) {
+            nameToNodeListTable = new Hashtable();
+            try {
+                buildNameToNodeListTable(rootNode);
+            } catch (IOException e) {
+                e.printStackTrace();
+                return null;
+            }
+        }
+
+        return (List) nameToNodeListTable.get(name);
+    }
+
+    private void buildNameToNodeListTable(Node curNode)
+      throws IOException {
+        String fullName = curNode.getName();
+        String parent = curNode.getParent();
+        String separator = System.getProperty("file.separator");
+
+        if (parent != null) {
+          if (!fullName.startsWith(parent)) {
+            throw new RuntimeException(
+                "Internal error: parent of file name \"" + fullName +
+                "\" does not match file name \"" + parent + "\""
+            );
+          }
+
+          int len = parent.length();
+          if (!parent.endsWith(separator)) {
+            len += separator.length();
+          }
+
+          String fileName = fullName.substring(len);
+
+          if (fileName == null) {
+            throw new RuntimeException(
+                "Internal error: file name was empty"
+            );
+          }
+
+          List nodeList = (List) nameToNodeListTable.get(fileName);
+          if (nodeList == null) {
+            nodeList = new Vector();
+            nameToNodeListTable.put(fileName, nodeList);
+          }
+
+          nodeList.add(curNode);
+        } else {
+          if (curNode != rootNode) {
+            throw new RuntimeException(
+                "Internal error: parent of file + \"" + fullName + "\"" +
+                " was null"
+            );
+          }
+        }
+
+        if (curNode.isDirectory()) {
+          Iterator iter = curNode.getChildren();
+          if (iter != null) {
+            while (iter.hasNext()) {
+              buildNameToNodeListTable((Node) iter.next());
+            }
+          }
+        }
+    }
+
+    /** Reads all of the files in the given directory and adds them as
+        children of the directory tree node. Requires that the passed
+        node represents a directory. */
+
+    private void readDirectory(Node parentNode, File parentDir) {
+        File[] children = parentDir.listFiles();
+        if (children == null)
+            return;
+        if (verbose) {
+            System.out.print(".");
+            System.out.flush();
+        }
+        for (int i = 0; i < children.length; i++) {
+            File child = children[i];
+            children[i] = null;
+            boolean isDir = child.isDirectory();
+            boolean mustSkip = false;
+            if (isDir) {
+                for (Iterator iter = subdirsToIgnore.iterator();
+                     iter.hasNext(); ) {
+                    if (child.getName().equals((String) iter.next())) {
+                        mustSkip = true;
+                        break;
+                    }
+                }
+            }
+            if (!mustSkip) {
+                Node childNode = new Node(child);
+                parentNode.addChild(childNode);
+                if (isDir) {
+                    readDirectory(childNode, child);
+                }
+            }
+        }
+    }
+
+    private class Node implements DirectoryTreeNode {
+        private File file;
+        private Vector children;
+
+        /** file must be a canonical file */
+        Node(File file) {
+            this.file = file;
+            children = new Vector();
+        }
+
+        public boolean isFile() {
+            return file.isFile();
+        }
+
+        public boolean isDirectory() {
+            return file.isDirectory();
+        }
+
+        public String getName() {
+            return file.getPath();
+        }
+
+        public String getParent() {
+            return file.getParent();
+        }
+
+        public void addChild(Node n) {
+            children.add(n);
+        }
+
+        public Iterator getChildren() throws IllegalArgumentException {
+            return children.iterator();
+        }
+
+        public int getNumChildren() throws IllegalArgumentException {
+            return children.size();
+        }
+
+        public DirectoryTreeNode getChild(int i)
+            throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
+            return (DirectoryTreeNode) children.get(i);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/DirectoryTreeNode.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.util.*;
+
+public interface DirectoryTreeNode {
+    public boolean isFile();
+    public boolean isDirectory();
+    public String getName();
+    public String getParent();
+    public Iterator getChildren() throws IllegalArgumentException;
+    public int getNumChildren() throws IllegalArgumentException;
+    public DirectoryTreeNode getChild(int i)
+        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/FileFormatException.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+public class FileFormatException extends Exception {
+    public FileFormatException() {
+        super();
+    }
+
+    public FileFormatException(String s) {
+        super(s);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/Macro.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+public class Macro {
+    public String name;
+    public String contents;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/MacroDefinitions.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class MacroDefinitions {
+    private Vector macros;
+
+    public MacroDefinitions() {
+        macros = new Vector();
+    }
+
+    public void addMacro(String name, String contents) {
+        Macro macro = new Macro();
+        macro.name = name;
+        macro.contents = contents;
+        macros.add(macro);
+    }
+
+    private boolean lineIsEmpty(String s) {
+        for (int i = 0; i < s.length(); i++) {
+            if (!Character.isWhitespace(s.charAt(i))) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public void readFrom(String fileName, boolean missingOk)
+        throws FileNotFoundException, FileFormatException, IOException {
+        BufferedReader reader = null;
+        try {
+            reader = new BufferedReader(new FileReader(fileName));
+        } catch (FileNotFoundException e) {
+            if (missingOk) {
+                return;
+            } else {
+                throw(e);
+            }
+        }
+        String line;
+        do {
+            line = reader.readLine();
+            if (line != null) {
+                // This had to be rewritten (compare to Database.java)
+                // because the Solaris platform file has been
+                // repurposed and now contains "macros" with spaces in
+                // them.
+
+                if ((!line.startsWith("//")) &&
+                    (!lineIsEmpty(line))) {
+                    int nameBegin = -1;
+                    int nameEnd = -1;
+                    boolean gotEquals = false;
+                    int contentsBegin = -1;
+                    int contentsEnd = -1;
+
+                    int i = 0;
+                    // Scan forward for beginning of name
+                    while (i < line.length()) {
+                        if (!Character.isWhitespace(line.charAt(i))) {
+                            break;
+                        }
+                        i++;
+                    }
+                    nameBegin = i;
+
+                    // Scan forward for end of name
+                    while (i < line.length()) {
+                        if (Character.isWhitespace(line.charAt(i))) {
+                            break;
+                        }
+                        i++;
+                    }
+                    nameEnd = i;
+
+                    // Scan forward for equals sign
+                    while (i < line.length()) {
+                        if (line.charAt(i) == '=') {
+                            gotEquals = true;
+                            break;
+                        }
+                        i++;
+                    }
+
+                    // Scan forward for start of contents
+                    i++;
+                    while (i < line.length()) {
+                        if (!Character.isWhitespace(line.charAt(i))) {
+                            break;
+                        }
+                        i++;
+                    }
+                    contentsBegin = i;
+
+                    // Scan *backward* for end of contents
+                    i = line.length() - 1;
+                    while (i >= 0) {
+                        if (!Character.isWhitespace(line.charAt(i))) {
+                            break;
+                        }
+                    }
+                    contentsEnd = i+1;
+
+                    // Now do consistency check
+                    if (!((nameBegin < nameEnd) &&
+                          (nameEnd < contentsBegin) &&
+                          (contentsBegin < contentsEnd) &&
+                          (gotEquals == true))) {
+                        throw new FileFormatException(
+                            "Expected \"macroname = value\", " +
+                            "but found: " + line
+                        );
+                    }
+
+                    String name = line.substring(nameBegin, nameEnd);
+                    String contents = line.substring(contentsBegin,
+                                                     contentsEnd);
+                    addMacro(name, contents);
+                }
+            }
+        } while (line != null);
+        reader.close();
+    }
+
+    /** This returns an Iterator of Macros. You should not mutate the
+        returned Macro objects or use the Iterator to remove
+        macros. */
+    public Iterator getMacros() {
+        return macros.iterator();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/ProjectCreator.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,101 @@
+import java.util.Map;
+import java.util.Map.Entry;
+
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+public class ProjectCreator {
+
+    public static void usage() {
+        System.out.println("ProjectCreator options:");
+        System.err.println("WinGammaPlatform platform-specific options:");
+        System.err.println("  -sourceBase <path to directory (workspace) " +
+                           "containing source files; no trailing slash>");
+        System.err.println("  -dspFileName <full pathname to which .dsp file " +
+                           "will be written; all parent directories must " +
+                           "already exist>");
+        System.err.println("  -envVar <environment variable to be inserted " +
+                           "into .dsp file, substituting for path given in " +
+                           "-sourceBase. Example: HotSpotWorkSpace>");
+        System.err.println("  -dllLoc <path to directory in which to put " +
+                           "jvm.dll and jvm_g.dll; no trailing slash>");
+        System.err.println("  If any of the above are specified, "+
+                           "they must all be.");
+        System.err.println("  Additional, optional arguments, which can be " +
+                           "specified multiple times:");
+        System.err.println("    -absoluteInclude <string containing absolute " +
+                           "path to include directory>");
+        System.err.println("    -relativeInclude <string containing include " +
+                           "directory relative to -envVar>");
+        System.err.println("    -define <preprocessor flag to be #defined " +
+                           "(note: doesn't yet support " +
+                           "#define (flag) (value))>");
+        System.err.println("    -perFileLine <file> <line>");
+        System.err.println("    -conditionalPerFileLine <file> <line for " +
+                           "release build> <line for debug build>");
+        System.err.println("  (NOTE: To work around a bug in nmake, where " +
+                           "you can't have a '#' character in a quoted " +
+                           "string, all of the lines outputted have \"#\"" +
+                           "prepended)");
+        System.err.println("    -startAt <subdir of sourceBase>");
+        System.err.println("    -ignoreFile <file which won't be able to be " +
+                           "found in the sourceBase because it's generated " +
+                           "later>");
+        System.err.println("    -additionalFile <file not in database but " +
+                           "which should show up in .dsp file>");
+        System.err.println("    -additionalGeneratedFile <environment variable of " +
+                           "generated file's location> <relative path to " +
+                           "directory containing file; no trailing slash> " +
+                           "<name of file generated later in the build process>");
+        System.err.println("    -prelink <build> <desc> <cmds>:");
+        System.err.println(" Generate a set of prelink commands for the given BUILD");
+        System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands");
+        System.err.println(" are both quoted strings.");
+        System.err.println("    Default includes: \".\"");
+        System.err.println("    Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
+    }
+
+    public static void main(String[] args) {
+        try {
+            if (args.length < 3) {
+                usage();
+                System.exit(1);
+            }
+
+            String platformName = args[0];
+            Class platformClass = Class.forName(platformName);
+            WinGammaPlatform platform = (WinGammaPlatform) platformClass.newInstance();
+
+            String[] platformArgs = new String[args.length - 1];
+            System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
+
+            // Allow the platform to write platform-specific files
+            platform.createVcproj(platformArgs);
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+              System.exit(1);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/Util.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.util.*;
+import java.util.Map.Entry;
+import java.io.File;
+
+public class Util {
+    static String join(String padder, Vector v) {
+        return join(padder, v, false);
+    }
+
+    static String join(String padder, Vector v, boolean quoted) {
+        StringBuffer sb = new StringBuffer();
+
+        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
+            if (quoted) {
+                sb.append('"');
+            }
+            sb.append((String)iter.next());
+            if (quoted) {
+                sb.append('"');
+            }
+            if (iter.hasNext()) sb.append(padder);
+        }
+
+        return sb.toString();
+    }
+
+     static String join(String padder, String v[]) {
+        StringBuffer sb = new StringBuffer();
+
+        for (int i=0; i<v.length; i++) {
+            sb.append(v[i]);
+            if (i < (v.length  - 1)) sb.append(padder);
+        }
+
+        return sb.toString();
+    }
+
+
+
+    static String prefixed_join(String padder, Vector v, boolean quoted) {
+        StringBuffer sb = new StringBuffer();
+
+        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
+            sb.append(padder);
+
+            if (quoted) {
+                sb.append('"');
+            }
+            sb.append((String)iter.next());
+            if (quoted) {
+                sb.append('"');
+            }
+        }
+
+        return sb.toString();
+    }
+
+
+    static String normalize(String file) {
+        return file.replace('\\', '/');
+    }
+
+    static String sep = File.separator;
+    
+    private static String _os;
+    
+    static String os() {
+    	if( _os==null) {
+
+        	for(Map.Entry<String, String> entry: System.getenv().entrySet())
+        		if("PLATFORM_ARCH_MODEL".equals(entry.getKey().toUpperCase())) {
+        			String archModel = entry.getValue();
+        			if("x86_32".equals(archModel))
+        				_os = "Win32";
+        			else if("x86_64".equals(archModel))
+        				_os = "x64";
+        			else
+        				throw new RuntimeException("Unsupported PLATFORM_ARCH_MODEL " + archModel);
+        			return _os;
+        		}
+        	throw new RuntimeException("PLATFORM_ARCH_MODEL not specified");
+    	}
+    	return _os;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/WinGammaPlatform.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,722 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TreeSet;
+import java.util.Vector;
+
+abstract class HsArgHandler extends ArgHandler {
+    static final int STRING = 1;
+    static final int VECTOR = 2;
+    static final int HASH   = 3;
+
+    boolean nextNotKey(ArgIterator it) {
+        if (it.next()) {
+            String s = it.get();
+            return (s.length() == 0) || (s.charAt(0) != '-');
+        } else {
+            return false;
+        }
+    }
+
+    void empty(String key, String message) {
+        if (key != null) {
+            System.err.println("** Error: empty " + key);
+        }
+        if (message != null) {
+            System.err.println(message);
+        }
+        WinGammaPlatform.usage();
+    }
+
+    static String getCfg(String val) {
+        int under = val.indexOf('_');
+        int len = val.length();
+        if (under != -1 && under < len - 1) {
+            return val.substring(under+1, len);
+        } else {
+            return null;
+        }
+    }
+}
+
+class ArgRuleSpecific extends ArgRule {
+    ArgRuleSpecific(String arg, ArgHandler handler) {
+        super(arg, handler);
+    }
+
+    boolean match(String rulePattern, String arg) {
+        return rulePattern.startsWith(arg);
+    }
+}
+
+
+class SpecificHsArgHandler extends HsArgHandler {
+
+    String message, argKey, valKey;
+    int type;
+
+    public void handle(ArgIterator it) {
+        String cfg = getCfg(it.get());
+        if (nextNotKey(it)) {
+            String val = it.get();
+            switch (type) {
+            case VECTOR:
+                BuildConfig.addFieldVector(cfg, valKey, val);
+                break;
+            case HASH:
+                BuildConfig.putFieldHash(cfg, valKey, val, "1");
+                break;
+            case STRING:
+                BuildConfig.putField(cfg, valKey, val);
+                break;
+            default:
+                empty(valKey, "Unknown type: "+type);
+            }
+            it.next();
+
+        } else {
+            empty(argKey, message);
+        }
+    }
+
+    SpecificHsArgHandler(String argKey, String valKey, String message, int type) {
+        this.argKey = argKey;
+        this.valKey = valKey;
+        this.message = message;
+        this.type = type;
+    }
+}
+
+
+class HsArgRule extends ArgRuleSpecific {
+
+    HsArgRule(String argKey, String valKey, String message, int type) {
+        super(argKey, new SpecificHsArgHandler(argKey, valKey, message, type));
+    }
+
+}
+
+public abstract class WinGammaPlatform {
+
+    public boolean fileNameStringEquality(String s1, String s2) {
+        return s1.equalsIgnoreCase(s2);
+    }
+
+    static void usage() throws IllegalArgumentException {
+        System.err.println("WinGammaPlatform platform-specific options:");
+        System.err.println("  -sourceBase <path to directory (workspace) " +
+                           "containing source files; no trailing slash>");
+        System.err.println("  -projectFileName <full pathname to which project file " +
+                           "will be written; all parent directories must " +
+                           "already exist>");
+        System.err.println("  If any of the above are specified, "+
+                           "they must all be.");
+        System.err.println("  Additional, optional arguments, which can be " +
+                           "specified multiple times:");
+        System.err.println("    -absoluteInclude <string containing absolute " +
+                           "path to include directory>");
+        System.err.println("    -relativeInclude <string containing include " +
+                           "directory relative to -sourceBase>");
+        System.err.println("    -define <preprocessor flag to be #defined " +
+                           "(note: doesn't yet support " +
+                           "#define (flag) (value))>");
+        System.err.println("    -startAt <subdir of sourceBase>");
+        System.err.println("    -additionalFile <file not in database but " +
+                           "which should show up in project file>");
+        System.err.println("    -additionalGeneratedFile <absolute path to " +
+                           "directory containing file; no trailing slash> " +
+                           "<name of file generated later in the build process>");
+        throw new IllegalArgumentException();
+    }
+
+
+    public void addPerFileLine(Hashtable table,
+                               String fileName,
+                               String line) {
+        Vector v = (Vector) table.get(fileName);
+        if (v != null) {
+            v.add(line);
+        } else {
+            v = new Vector();
+            v.add(line);
+            table.put(fileName, v);
+        }
+    }
+
+    protected static class PerFileCondData {
+        public String releaseString;
+        public String debugString;
+    }
+
+    protected void addConditionalPerFileLine(Hashtable table,
+                                           String fileName,
+                                           String releaseLine,
+                                           String debugLine) {
+        PerFileCondData data = new PerFileCondData();
+        data.releaseString = releaseLine;
+        data.debugString = debugLine;
+        Vector v = (Vector) table.get(fileName);
+        if (v != null) {
+            v.add(data);
+        } else {
+            v = new Vector();
+            v.add(data);
+            table.put(fileName, v);
+        }
+    }
+
+    protected static class PrelinkCommandData {
+      String description;
+      String commands;
+    }
+
+    protected void addPrelinkCommand(Hashtable table,
+                                     String build,
+                                     String description,
+                                     String commands) {
+      PrelinkCommandData data = new PrelinkCommandData();
+      data.description = description;
+      data.commands = commands;
+      table.put(build, data);
+    }
+
+    public boolean findString(Vector v, String s) {
+        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
+            if (((String) iter.next()).equals(s)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /* This returns a String containing the full path to the passed
+       file name, or null if an error occurred. If the file was not
+       found or was a duplicate and couldn't be resolved using the
+       preferred paths, the file name is added to the appropriate
+       Vector of Strings. */
+    private String findFileInDirectory(String fileName,
+                                       DirectoryTree directory,
+                                       Vector preferredPaths,
+                                       Vector filesNotFound,
+                                       Vector filesDuplicate) {
+        List locationsInTree = directory.findFile(fileName);
+        int  rootNameLength = directory.getRootNodeName().length();
+        String name = null;
+        if ((locationsInTree == null) ||
+            (locationsInTree.size() == 0)) {
+            filesNotFound.add(fileName);
+        } else if (locationsInTree.size() > 1) {
+            // We shouldn't have duplicate file names in our workspace.
+            System.err.println();
+            System.err.println("There are multiple files named as: " + fileName);
+            System.exit(-1);
+            // The following code could be safely removed if we don't need duplicate
+            // file names.
+
+            // Iterate through them, trying to find one with a
+            // preferred path
+        search:
+            {
+                for (Iterator locIter = locationsInTree.iterator();
+                     locIter.hasNext(); ) {
+                    DirectoryTreeNode node =
+                        (DirectoryTreeNode) locIter.next();
+                    String tmpName = node.getName();
+                    for (Iterator prefIter = preferredPaths.iterator();
+                         prefIter.hasNext(); ) {
+                        // We need to make sure the preferred path is
+                        // found from the file path not including the root node name.
+                        if (tmpName.indexOf((String)prefIter.next(),
+                                            rootNameLength) != -1) {
+                            name = tmpName;
+                            break search;
+                        }
+                    }
+                }
+            }
+
+            if (name == null) {
+                filesDuplicate.add(fileName);
+            }
+        } else {
+            name = ((DirectoryTreeNode) locationsInTree.get(0)).getName();
+        }
+
+        return name;
+    }
+
+    protected String envVarPrefixedFileName(String fileName,
+                                            int sourceBaseLen,
+                                            DirectoryTree tree,
+                                            Vector preferredPaths,
+                                            Vector filesNotFound,
+                                            Vector filesDuplicate) {
+        String fullName = findFileInDirectory(fileName,
+                                              tree,
+                                              preferredPaths,
+                                              filesNotFound,
+                                              filesDuplicate);
+        return fullName;
+    }
+
+     String getProjectName(String fullPath, String extension)
+        throws IllegalArgumentException, IOException {
+        File file = new File(fullPath).getCanonicalFile();
+        fullPath = file.getCanonicalPath();
+        String parent = file.getParent();
+
+        if (!fullPath.endsWith(extension)) {
+            throw new IllegalArgumentException("project file name \"" +
+                                               fullPath +
+                                               "\" does not end in "+extension);
+        }
+
+        if ((parent != null) &&
+            (!fullPath.startsWith(parent))) {
+            throw new RuntimeException(
+                "Internal error: parent of file name \"" + parent +
+                "\" does not match file name \"" + fullPath + "\""
+            );
+        }
+
+        int len = parent.length();
+        if (!parent.endsWith(Util.sep)) {
+            len += Util.sep.length();
+        }
+
+        int end = fullPath.length() - extension.length();
+
+        if (len == end) {
+            throw new RuntimeException(
+                "Internal error: file name was empty"
+            );
+        }
+
+        return fullPath.substring(len, end);
+    }
+
+    protected abstract String getProjectExt();
+
+    public void createVcproj(String[] args)
+        throws IllegalArgumentException, IOException {
+
+        parseArguments(args);
+
+        String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName");
+        String ext = getProjectExt();
+
+        String projectName = getProjectName(projectFileName, ext);
+
+        writeProjectFile(projectFileName, projectName, createAllConfigs());
+    }
+
+    protected void writePrologue(String[] args) {
+        System.err.println("WinGammaPlatform platform-specific arguments:");
+        for (int i = 0; i < args.length; i++) {
+            System.err.print(args[i] + " ");
+        }
+        System.err.println();
+    }
+
+
+    void parseArguments(String[] args) {
+        new ArgsParser(args,
+                       new ArgRule[]
+            {
+                new ArgRule("-sourceBase",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                   String cfg = getCfg(it.get());
+                                   if (nextNotKey(it)) {
+                                      String sb = (String) it.get();
+                                      if (sb.endsWith(Util.sep)) {
+                                         sb = sb.substring(0, sb.length() - 1);
+                                      }
+                                      BuildConfig.putField(cfg, "SourceBase", sb);
+                                      it.next();
+                                   } else {
+                                      empty("-sourceBase", null);
+                                   }
+                                }
+                            }
+                            ),
+
+                new HsArgRule("-buildBase",
+                              "BuildBase",
+                              "   (Did you set the HotSpotBuildSpace environment variable?)",
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-projectFileName",
+                              "ProjectFileName",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-jdkTargetRoot",
+                              "JdkTargetRoot",
+                              "   (Did you set the HotSpotJDKDist environment variable?)",
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-compiler",
+                              "CompilerVersion",
+                              "   (Did you set the VcVersion correctly?)",
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-platform",
+                              "Platform",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-absoluteInclude",
+                              "AbsoluteInclude",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-relativeInclude",
+                              "RelativeInclude",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-define",
+                              "Define",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-useToGeneratePch",
+                              "UseToGeneratePch",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+                new ArgRuleSpecific("-perFileLine",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    String cfg = getCfg(it.get());
+                                    if (nextNotKey(it)) {
+                                        String fileName = it.get();
+                                        if (nextNotKey(it)) {
+                                            String line = it.get();
+                                            BuildConfig.putFieldHash(cfg, "PerFileLine", fileName, line);
+                                            it.next();
+                                            return;
+                                        }
+                                    }
+                                    empty(null, "** Error: wrong number of args to -perFileLine");
+                                }
+                            }
+                            ),
+
+                new ArgRuleSpecific("-conditionalPerFileLine",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    String cfg = getCfg(it.get());
+                                    if (nextNotKey(it)) {
+                                        String fileName = it.get();
+                                        if (nextNotKey(it)) {
+                                            String productLine = it.get();
+                                            if (nextNotKey(it)) {
+                                                String debugLine = it.get();
+                                                BuildConfig.putFieldHash(cfg+"_debug", "CondPerFileLine",
+                                                                         fileName, debugLine);
+                                                BuildConfig.putFieldHash(cfg+"_product", "CondPerFileLine",
+                                                                         fileName, productLine);
+                                                it.next();
+                                                return;
+                                            }
+                                        }
+                                    }
+
+                                    empty(null, "** Error: wrong number of args to -conditionalPerFileLine");
+                                }
+                            }
+                            ),
+
+                new HsArgRule("-disablePch",
+                              "DisablePch",
+                              null,
+                              HsArgHandler.HASH
+                              ),
+
+                new ArgRule("-startAt",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    if (BuildConfig.getField(null, "StartAt") != null) {
+                                        empty(null, "** Error: multiple -startAt");
+                                    }
+                                    if (nextNotKey(it)) {
+                                        BuildConfig.putField(null, "StartAt", it.get());
+                                        it.next();
+                                    } else {
+                                        empty("-startAt", null);
+                                    }
+                                }
+                            }
+                            ),
+
+                new HsArgRule("-ignoreFile",
+                                      "IgnoreFile",
+                                      null,
+                                      HsArgHandler.HASH
+                                      ),
+
+                new HsArgRule("-ignorePath",
+                              "IgnorePath",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-additionalFile",
+                              "AdditionalFile",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new ArgRuleSpecific("-additionalGeneratedFile",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    String cfg = getCfg(it.get());
+                                    if (nextNotKey(it)) {
+                                        String dir = it.get();
+                                        if (nextNotKey(it)) {
+                                            String fileName = it.get();
+                                            BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile",
+                                                                     Util.normalize(dir + Util.sep + fileName),
+                                                                     fileName);
+                                            it.next();
+                                            return;
+                                        }
+                                    }
+                                    empty(null, "** Error: wrong number of args to -additionalGeneratedFile");
+                                }
+                            }
+                            ),
+
+                new ArgRule("-prelink",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    if (nextNotKey(it)) {
+                                        if (nextNotKey(it)) {
+                                            String description = it.get();
+                                            if (nextNotKey(it)) {
+                                                String command = it.get();
+                                                BuildConfig.putField(null, "PrelinkDescription", description);
+                                                BuildConfig.putField(null, "PrelinkCommand", command);
+                                                it.next();
+                                                return;
+                                            }
+                                        }
+                                    }
+
+                                    empty(null,  "** Error: wrong number of args to -prelink");
+                                }
+                            }
+                            ),
+
+                new ArgRule("-postbuild",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    if (nextNotKey(it)) {
+                                        if (nextNotKey(it)) {
+                                            String description = it.get();
+                                            if (nextNotKey(it)) {
+                                                String command = it.get();
+                                                BuildConfig.putField(null, "PostbuildDescription", description);
+                                                BuildConfig.putField(null, "PostbuildCommand", command);
+                                                it.next();
+                                                return;
+                                            }
+                                        }
+                                    }
+
+                                    empty(null,  "** Error: wrong number of args to -postbuild");
+                                }
+                            }
+                            ),
+            },
+                                       new ArgHandler() {
+                                           public void handle(ArgIterator it) {
+
+                                               throw new RuntimeException("Arg Parser: unrecognized option "+it.get());
+                                           }
+                                       }
+                                       );
+        if (BuildConfig.getField(null, "SourceBase") == null      ||
+            BuildConfig.getField(null, "BuildBase") == null       ||
+            BuildConfig.getField(null, "ProjectFileName") == null ||
+            BuildConfig.getField(null, "CompilerVersion") == null) {
+            usage();
+        }
+
+        if (BuildConfig.getField(null, "UseToGeneratePch") == null) {
+            throw new RuntimeException("ERROR: need to specify one file to compute PCH, with -useToGeneratePch flag");
+        }
+
+        BuildConfig.putField(null, "PlatformObject", this);
+    }
+
+    Vector createAllConfigs() {
+        Vector allConfigs = new Vector();
+
+        allConfigs.add(new C1DebugConfig());
+
+        boolean b = true;
+        if (b) {
+            allConfigs.add(new C1FastDebugConfig());
+            allConfigs.add(new C1ProductConfig());
+
+            allConfigs.add(new C2DebugConfig());
+            allConfigs.add(new C2FastDebugConfig());
+            allConfigs.add(new C2ProductConfig());
+
+            allConfigs.add(new TieredDebugConfig());
+            allConfigs.add(new TieredFastDebugConfig());
+            allConfigs.add(new TieredProductConfig());
+
+            allConfigs.add(new CoreDebugConfig());
+            allConfigs.add(new CoreFastDebugConfig());
+            allConfigs.add(new CoreProductConfig());
+
+            allConfigs.add(new KernelDebugConfig());
+            allConfigs.add(new KernelFastDebugConfig());
+            allConfigs.add(new KernelProductConfig());
+        }
+
+        return allConfigs;
+    }
+
+    class FileAttribute {
+        int     numConfigs;
+        Vector  configs;
+        String  shortName;
+        boolean noPch, pchRoot;
+
+        FileAttribute(String shortName, BuildConfig cfg, int numConfigs) {
+            this.shortName = shortName;
+            this.noPch =  (cfg.lookupHashFieldInContext("DisablePch", shortName) != null);
+            this.pchRoot = shortName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"));
+            this.numConfigs = numConfigs;
+
+            configs = new Vector();
+            add(cfg.get("Name"));
+        }
+
+        void add(String confName) {
+            configs.add(confName);
+
+            // if presented in all configs
+            if (configs.size() == numConfigs) {
+                configs = null;
+            }
+        }
+    }
+
+    class FileInfo implements Comparable {
+        String        full;
+        FileAttribute attr;
+
+        FileInfo(String full, FileAttribute  attr) {
+            this.full = full;
+            this.attr = attr;
+        }
+
+        public int compareTo(Object o) {
+            FileInfo oo = (FileInfo)o;
+            return full.compareTo(oo.full);
+        }
+
+        boolean isHeader() {
+            return attr.shortName.endsWith(".h") || attr.shortName.endsWith(".hpp");
+        }
+    }
+
+
+    TreeSet sortFiles(Hashtable allFiles) {
+        TreeSet rv = new TreeSet();
+        Enumeration e = allFiles.keys();
+        while (e.hasMoreElements()) {
+            String fullPath = (String)e.nextElement();
+            rv.add(new FileInfo(fullPath, (FileAttribute)allFiles.get(fullPath)));
+        }
+        return rv;
+    }
+
+    Hashtable computeAttributedFiles(Vector allConfigs) {
+        Hashtable ht = new Hashtable();
+        int numConfigs = allConfigs.size();
+
+        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
+            BuildConfig bc = (BuildConfig)i.next();
+            Hashtable  confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
+            String confName = bc.get("Name");
+
+            for (Enumeration e=confFiles.keys(); e.hasMoreElements(); ) {
+                String filePath = (String)e.nextElement();
+                FileAttribute fa = (FileAttribute)ht.get(filePath);
+
+                if (fa == null) {
+                    fa = new FileAttribute((String)confFiles.get(filePath), bc, numConfigs);
+                    ht.put(filePath, fa);
+                } else {
+                    fa.add(confName);
+                }
+            }
+        }
+
+        return ht;
+    }
+
+     Hashtable computeAttributedFiles(BuildConfig bc) {
+        Hashtable ht = new Hashtable();
+        Hashtable confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
+
+        for (Enumeration e = confFiles.keys(); e.hasMoreElements(); ) {
+            String filePath = (String)e.nextElement();
+            ht.put(filePath,  new FileAttribute((String)confFiles.get(filePath), bc, 1));
+        }
+
+        return ht;
+    }
+
+    PrintWriter printWriter;
+
+    public void writeProjectFile(String projectFileName, String projectName,
+                                 Vector allConfigs) throws IOException {
+        throw new RuntimeException("use compiler version specific version");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class WinGammaPlatformVC6 extends WinGammaPlatform {
+    public void writeProjectFile(String projectFileName, String projectName,
+                                 Vector allConfigs) throws IOException {
+        Vector allConfigNames = new Vector();
+
+        printWriter = new PrintWriter(new FileWriter(projectFileName));
+        String cfg = ((BuildConfig)allConfigs.get(0)).get("Name");
+
+        printWriter.println("# Microsoft Developer Studio Project File - Name=\"" + projectName + "\" - Package Owner=<4>");
+        printWriter.println("# Microsoft Developer Studio Generated Build File, Format Version 6.00");
+        printWriter.println("# ** DO NOT EDIT **");
+        printWriter.println("");
+        printWriter.println("# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102");
+        printWriter.println("CFG=" + cfg);
+        printWriter.println("");
+
+        printWriter.println("!MESSAGE This is not a valid makefile. To build this project using NMAKE,");
+        printWriter.println("!MESSAGE use the Export Makefile command and run");
+        printWriter.println("!MESSAGE ");
+        printWriter.println("!MESSAGE NMAKE /f \"" + projectName + ".mak\".");
+        printWriter.println("!MESSAGE ");
+        printWriter.println("!MESSAGE You can specify a configuration when running NMAKE");
+        printWriter.println("!MESSAGE by defining the macro CFG on the command line. For example:");
+        printWriter.println("!MESSAGE ");
+        printWriter.println("!MESSAGE NMAKE /f \"" + projectName + ".mak\" CFG=\"" + cfg + "\"");
+        printWriter.println("!MESSAGE ");
+        printWriter.println("!MESSAGE Possible choices for configuration are:");
+        printWriter.println("!MESSAGE ");
+        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
+            String name = ((BuildConfig)i.next()).get("Name");
+            printWriter.println("!MESSAGE \""+ name + "\" (based on \"Win32 (x86) Dynamic-Link Library\")");
+            allConfigNames.add(name);
+        }
+        printWriter.println("!MESSAGE ");
+        printWriter.println("");
+
+        printWriter.println("# Begin Project");
+        printWriter.println("# PROP AllowPerConfigDependencies 0");
+        printWriter.println("# PROP Scc_ProjName \"\"");
+        printWriter.println("# PROP Scc_LocalPath \"\"");
+        printWriter.println("CPP=cl.exe");
+        printWriter.println("MTL=midl.exe");
+        printWriter.println("RSC=rc.exe");
+
+
+        String keyword = "!IF";
+        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
+            BuildConfig bcfg = (BuildConfig)i.next();
+            printWriter.println(keyword + "  \"$(CFG)\" == \"" + bcfg.get("Name") + "\"");
+            writeConfigHeader(bcfg);
+            keyword = "!ELSEIF";
+            if (!i.hasNext()) printWriter.println("!ENDIF");
+        }
+
+
+        TreeSet sortedFiles = sortFiles(computeAttributedFiles(allConfigs));
+
+        printWriter.println("# Begin Target");
+
+        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
+            printWriter.println("# Name \"" + ((BuildConfig)i.next()).get("Name") + "\"");
+        }
+        printWriter.println("# Begin Group \"Header Files\"");
+        printWriter.println("# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"");
+
+        Iterator i = sortedFiles.iterator();
+
+        while (i.hasNext()) {
+            FileInfo fi = (FileInfo)i.next();
+
+            // skip sources
+            if (!fi.isHeader()) {
+                continue;
+            }
+
+            printFile(fi, allConfigNames);
+        }
+        printWriter.println("# End Group");
+        printWriter.println("");
+
+        printWriter.println("# Begin Group \"Source Files\"");
+        printWriter.println("# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90\"");
+
+        i = sortedFiles.iterator();
+        while (i.hasNext()) {
+            FileInfo fi = (FileInfo)i.next();
+
+            // skip headers
+            if (fi.isHeader()) {
+                continue;
+            }
+
+            printFile(fi, allConfigNames);
+        }
+        printWriter.println("# End Group");
+        printWriter.println("");
+
+
+        printWriter.println("# Begin Group \"Resource Files\"");
+        printWriter.println("# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"");
+        printWriter.println("# End Group");
+        printWriter.println("");
+        printWriter.println("# End Target");
+
+        printWriter.println("# End Project");
+
+        printWriter.close();
+    }
+
+
+    void printFile(FileInfo fi, Vector allConfigNames) {
+        printWriter.println("# Begin Source File");
+        printWriter.println("");
+        printWriter.println("SOURCE=\"" + fi.full + "\"");
+        FileAttribute attr = fi.attr;
+
+        if (attr.noPch) {
+            printWriter.println("# SUBTRACT CPP /YX /Yc /Yu");
+        }
+
+        if (attr.pchRoot) {
+            printWriter.println("# ADD CPP /Yc\"incls/_precompiled.incl\"");
+        }
+        if (attr.configs != null) {
+            String keyword = "!IF";
+            for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
+                String cfg = (String)j.next();
+                if (!attr.configs.contains(cfg)) {
+                    printWriter.println(keyword+" \"$(CFG)\" == \"" + cfg +"\"");
+                    printWriter.println("# PROP BASE Exclude_From_Build 1");
+                    printWriter.println("# PROP Exclude_From_Build 1");
+                    keyword = "!ELSEIF";
+                }
+            }
+            printWriter.println("!ENDIF");
+        }
+
+        printWriter.println("# End Source File");
+    }
+
+    void writeConfigHeader(BuildConfig cfg) {
+        printWriter.println("# Begin Special Build Tool");
+        printWriter.println("SOURCE=\"$(InputPath)\"");
+        printWriter.println("PreLink_Desc=" +  BuildConfig.getFieldString(null, "PrelinkDescription"));
+        printWriter.println("PreLink_Cmds=" +
+                            cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand")));
+        printWriter.println("# End Special Build Tool");
+        printWriter.println("");
+
+        for (Iterator i = cfg.getV("CompilerFlags").iterator(); i.hasNext(); ) {
+            printWriter.println("# "+(String)i.next());
+        }
+
+
+        printWriter.println("LINK32=link.exe");
+
+        for (Iterator i = cfg.getV("LinkerFlags").iterator(); i.hasNext(); ) {
+            printWriter.println("# "+(String)i.next());
+        }
+
+        printWriter.println("ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32");
+        printWriter.println("ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32");
+        printWriter.println("ADD BASE RSC /l 0x409 /d \"_DEBUG\"");
+        printWriter.println("ADD RSC /l 0x409 /d \"_DEBUG\"");
+        printWriter.println("BSC32=bscmake.exe");
+        printWriter.println("ADD BASE BSC32 /nologo");
+        printWriter.println("ADD BSC32 /nologo");
+        printWriter.println("");
+    }
+
+    protected String getProjectExt() {
+        return ".dsp";
+    }
+}
+
+
+class CompilerInterfaceVC6  extends CompilerInterface {
+    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
+        Vector rv = new Vector();
+
+        rv.add("PROP BASE Use_MFC 0");
+        rv.add("PROP Use_MFC 0");
+        rv.add("ADD CPP /nologo /MT /W3 /WX /GX /YX /Fr /FD /c");
+        rv.add("PROP BASE Output_Dir \""+outDir+"\"");
+        rv.add("PROP Output_Dir \""+outDir+"\"");
+        rv.add("PROP BASE Intermediate_Dir \""+outDir+"\"");
+        rv.add("PROP Intermediate_Dir \""+outDir+"\"");
+        rv.add("PROP BASE Target_Dir \"\"");
+        rv.add("PROP Target_Dir \"\"");
+        rv.add("ADD BASE CPP "+Util.prefixed_join(" /I ", includes, true));
+        rv.add("ADD CPP "+Util.prefixed_join(" /I ", includes, true));
+        rv.add("ADD BASE CPP "+Util.prefixed_join(" /D ", defines, true));
+        rv.add("ADD CPP "+Util.prefixed_join(" /D ", defines, true));
+        rv.add("ADD CPP /Yu\"incls/_precompiled.incl\"");
+
+        return rv;
+    }
+
+    Vector getBaseLinkerFlags(String outDir, String outDll) {
+        Vector rv = new Vector();
+
+        rv.add("PROP Ignore_Export_Lib 0");
+        rv.add("ADD BASE CPP /MD");
+        rv.add("ADD CPP /MD");
+        rv.add("ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib " +
+               "           advapi32.lib shell32.lib ole32.lib oleaut32.lib winmm.lib");
+        rv.add("ADD LINK32      /out:\""+outDll+"\" "+
+               "                /nologo /subsystem:windows /machine:I386" +
+               "                /nologo /base:\"0x8000000\" /subsystem:windows /dll" +
+               "                /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+
+               "                /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+
+               "                /export:jio_vsnprintf ");
+        rv.add("SUBTRACT LINK32 /pdb:none /map");
+
+        return rv;
+    }
+
+    Vector getDebugCompilerFlags(String opt) {
+        Vector rv = new Vector();
+
+        rv.add("ADD BASE CPP /Gm /Zi /O"+opt);
+
+        return rv;
+    }
+
+    Vector getDebugLinkerFlags() {
+        Vector rv = new Vector();
+
+        rv.add("PROP BASE Use_Debug_Libraries 1");
+        rv.add("PROP Use_Debug_Libraries 1");
+        rv.add("ADD LINK32 /debug");
+
+        return rv;
+    }
+
+    void getAdditionalNonKernelLinkerFlags(Vector rv) {}
+
+    Vector getProductCompilerFlags() {
+        Vector rv = new Vector();
+
+        rv.add("ADD CPP /O"+getOptFlag());
+
+        return rv;
+    }
+
+    Vector getProductLinkerFlags() {
+        Vector rv = new Vector();
+
+        rv.add("PROP BASE Use_Debug_Libraries 0");
+        rv.add("PROP Use_Debug_Libraries 0");
+
+        return rv;
+    }
+
+    String getOptFlag() {
+        return "2";
+    }
+
+    String getNoOptFlag() {
+        return "d";
+    }
+
+    String makeCfgName(String flavourBuild) {
+        return "vm - "+ "Win32" + " " + flavourBuild;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,702 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.TreeSet;
+import java.util.Vector;
+
+public class WinGammaPlatformVC7 extends WinGammaPlatform {
+
+    String projectVersion() {return "7.10";};
+
+    public void writeProjectFile(String projectFileName, String projectName,
+                                 Vector allConfigs) throws IOException {
+        System.out.println();
+        System.out.println("    Writing .vcproj file...");
+        // If we got this far without an error, we're safe to actually
+        // write the .vcproj file
+        printWriter = new PrintWriter(new FileWriter(projectFileName));
+
+        printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>");
+        startTag(
+            "VisualStudioProject",
+            new String[] {
+                "ProjectType", "Visual C++",
+                "Version", projectVersion(),
+                "Name", projectName,
+                "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}",
+                "SccProjectName", "",
+                "SccLocalPath", ""
+            }
+            );
+
+        startTag("Platforms", null);
+        tag("Platform", new String[] {"Name", Util.os()});
+        endTag("Platforms");
+
+        startTag("Configurations", null);
+
+        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
+            writeConfiguration((BuildConfig)i.next());
+        }
+
+        endTag("Configurations");
+
+        tag("References", null);
+
+        writeFiles(allConfigs);
+
+        tag("Globals", null);
+
+        endTag("VisualStudioProject");
+        printWriter.close();
+
+        System.out.println("    Done.");
+    }
+
+
+    abstract class NameFilter {
+        protected String fname;
+
+        abstract boolean match(FileInfo fi);
+
+        String  filterString() { return ""; }
+        String name() { return this.fname;}
+    }
+
+    class DirectoryFilter extends NameFilter {
+        String dir;
+        int baseLen, dirLen;
+
+        DirectoryFilter(String dir, String sbase) {
+            this.dir = dir;
+            this.baseLen = sbase.length();
+            this.dirLen = dir.length();
+            this.fname = dir;
+        }
+
+        DirectoryFilter(String fname, String dir, String sbase) {
+            this.dir = dir;
+            this.baseLen = sbase.length();
+            this.dirLen = dir.length();
+            this.fname = fname;
+        }
+
+
+        boolean match(FileInfo fi) {
+           int lastSlashIndex = fi.full.lastIndexOf('/');
+           String fullDir = fi.full.substring(0, lastSlashIndex);
+           return fullDir.endsWith(dir);
+        }
+    }
+
+    class TypeFilter extends NameFilter {
+        String[] exts;
+
+        TypeFilter(String fname, String[] exts) {
+            this.fname = fname;
+            this.exts = exts;
+        }
+
+        boolean match(FileInfo fi) {
+            for (int i=0; i<exts.length; i++) {
+                if (fi.full.endsWith(exts[i])) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        String  filterString() {
+            return Util.join(";", exts);
+        }
+    }
+
+    class TerminatorFilter extends NameFilter {
+        TerminatorFilter(String fname) {
+            this.fname = fname;
+
+        }
+        boolean match(FileInfo fi) {
+            return true;
+        }
+
+    }
+
+    class SpecificNameFilter extends NameFilter {
+        String pats[];
+
+        SpecificNameFilter(String fname, String[] pats) {
+            this.fname = fname;
+            this.pats = pats;
+        }
+
+        boolean match(FileInfo fi) {
+            for (int i=0; i<pats.length; i++) {
+                if (fi.attr.shortName.matches(pats[i])) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+    }
+
+    class SpecificPathFilter extends NameFilter {
+        String pats[];
+
+        SpecificPathFilter(String fname, String[] pats) {
+            this.fname = fname;
+            this.pats = pats;
+        }
+
+        boolean match(FileInfo fi) {
+            for (int i=0; i<pats.length; i++) {
+                if (fi.full.matches(pats[i])) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+    }
+
+    class ContainerFilter extends NameFilter {
+        Vector children;
+
+        ContainerFilter(String fname) {
+            this.fname = fname;
+            children = new Vector();
+
+        }
+        boolean match(FileInfo fi) {
+            return false;
+        }
+
+        Iterator babies() { return children.iterator(); }
+
+        void add(NameFilter f) {
+            children.add(f);
+        }
+    }
+
+
+    void writeCustomToolConfig(Vector configs, String[] customToolAttrs) {
+        for (Iterator i = configs.iterator(); i.hasNext(); ) {
+            startTag("FileConfiguration",
+                     new String[] {
+                         "Name",  (String)i.next()
+                     }
+                     );
+            tag("Tool", customToolAttrs);
+
+            endTag("FileConfiguration");
+        }
+    }
+
+    // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC
+    // Basically there are two types of entities - container filters and real filters
+    //   - container filter just provides a container to group together real filters
+    //   - real filter can select elements from the set according to some rule, put it into XML
+    //     and remove from the list
+    Vector makeFilters(TreeSet<FileInfo> files) {
+        Vector rv = new Vector();
+        String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/");
+
+        String currentDir = "";
+        DirectoryFilter container = null;
+        for(FileInfo fileInfo : files) {
+
+           if (!fileInfo.full.startsWith(sbase)) {
+              continue;
+           }
+
+           int lastSlash = fileInfo.full.lastIndexOf('/');
+           String dir = fileInfo.full.substring(sbase.length(), lastSlash);
+           if(dir.equals("share/vm")) {
+              // skip files directly in share/vm - should only be precompiled.hpp which is handled below
+              continue;
+           }
+           if (!dir.equals(currentDir)) {
+              currentDir = dir;
+              if (container != null) {
+                 rv.add(container);
+              }
+
+              // remove "share/vm/" from names
+              String name = dir;
+              if (dir.startsWith("share/vm/")) {
+                 name = dir.substring("share/vm/".length(), dir.length());
+              }
+              container = new DirectoryFilter(name, dir, sbase);
+           }
+        }
+        if (container != null) {
+           rv.add(container);
+        }
+
+        rv.add(new DirectoryFilter("C1X", "share/vm/c1x", sbase));
+        rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase));
+
+        ContainerFilter generated = new ContainerFilter("Generated");
+        ContainerFilter c1Generated = new ContainerFilter("C1");
+        c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+        c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"}));
+        generated.add(c1Generated);
+        ContainerFilter c2Generated = new ContainerFilter("C2");
+        c2Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler2/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+        c2Generated.add(new SpecificPathFilter("adfiles", new String[] {".*compiler2/generated/adfiles/.*"}));
+        c2Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler2/generated/jvmtifiles/.*"}));
+        generated.add(c2Generated);
+        ContainerFilter coreGenerated = new ContainerFilter("Core");
+        coreGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*core/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+        coreGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*core/generated/jvmtifiles/.*"}));
+        generated.add(coreGenerated);
+        ContainerFilter tieredGenerated = new ContainerFilter("Tiered");
+        tieredGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*tiered/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+        tieredGenerated.add(new SpecificPathFilter("adfiles", new String[] {".*tiered/generated/adfiles/.*"}));
+        tieredGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*tiered/generated/jvmtifiles/.*"}));
+        generated.add(tieredGenerated);
+        ContainerFilter kernelGenerated = new ContainerFilter("Kernel");
+        kernelGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*kernel/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+        kernelGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*kernel/generated/jvmtifiles/.*"}));
+        generated.add(kernelGenerated);
+        rv.add(generated);
+
+        rv.add(new SpecificNameFilter("Precompiled Header", new String[] {"precompiled.hpp"}));
+
+        // this one is to catch files not caught by other filters
+        //rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"}));
+        rv.add(new TerminatorFilter("Source Files"));
+
+        return rv;
+    }
+
+    void writeFiles(Vector allConfigs) {
+
+        Hashtable allFiles = computeAttributedFiles(allConfigs);
+
+        Vector allConfigNames = new Vector();
+        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
+            allConfigNames.add(((BuildConfig)i.next()).get("Name"));
+        }
+
+        TreeSet sortedFiles = sortFiles(allFiles);
+
+        startTag("Files", null);
+
+        for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) {
+            doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next());
+        }
+
+
+        startTag("Filter",
+                 new String[] {
+                     "Name", "Resource Files",
+                     "Filter", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+                 }
+                 );
+        endTag("Filter");
+
+        endTag("Files");
+    }
+
+    void doWriteFiles(TreeSet allFiles, Vector allConfigNames, NameFilter filter) {
+        startTag("Filter",
+                 new String[] {
+                     "Name",   filter.name(),
+                     "Filter", filter.filterString()
+                 }
+                 );
+
+        if (filter instanceof ContainerFilter) {
+
+            Iterator i = ((ContainerFilter)filter).babies();
+            while (i.hasNext()) {
+                doWriteFiles(allFiles, allConfigNames, (NameFilter)i.next());
+            }
+
+        } else {
+
+            Iterator i = allFiles.iterator();
+            while (i.hasNext()) {
+                FileInfo fi = (FileInfo)i.next();
+
+                if (!filter.match(fi)) {
+                    continue;
+                }
+
+                startTag("File",
+                         new String[] {
+                             "RelativePath", fi.full.replace('/', '\\')
+                         }
+                         );
+
+                FileAttribute a = fi.attr;
+                if (a.pchRoot) {
+                    writeCustomToolConfig(allConfigNames,
+                                          new String[] {
+                                              "Name", "VCCLCompilerTool",
+                                              "UsePrecompiledHeader", "1"
+                                          });
+                }
+
+                if (a.noPch) {
+                    writeCustomToolConfig(allConfigNames,
+                                          new String[] {
+                                              "Name", "VCCLCompilerTool",
+                                              "UsePrecompiledHeader", "0"
+                                          });
+                }
+
+                if (a.configs != null) {
+                    for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
+                        String cfg = (String)j.next();
+                        if (!a.configs.contains(cfg)) {
+                            startTag("FileConfiguration",
+                                     new String[] {
+                                         "Name", cfg,
+                                         "ExcludedFromBuild", "TRUE"
+                                     });
+                            endTag("FileConfiguration");
+
+                        }
+                    }
+                }
+
+                endTag("File");
+
+                // we not gonna look at this file anymore
+                i.remove();
+            }
+        }
+
+        endTag("Filter");
+    }
+
+
+    void writeConfiguration(BuildConfig cfg) {
+        startTag("Configuration",
+                 new String[] {
+                     "Name", cfg.get("Name"),
+                     "OutputDirectory",  cfg.get("OutputDir"),
+                     "IntermediateDirectory",  cfg.get("OutputDir"),
+                     "ConfigurationType", "2",
+                     "UseOfMFC", "0",
+                     "ATLMinimizesCRunTimeLibraryUsage", "FALSE"
+                 }
+                 );
+
+
+
+        tagV("Tool", cfg.getV("CompilerFlags"));
+
+        tag("Tool",
+            new String[] {
+                "Name", "VCCustomBuildTool"
+            }
+            );
+
+        tagV("Tool", cfg.getV("LinkerFlags"));
+
+        tag("Tool",
+            new String[] {
+               "Name", "VCPostBuildEventTool",
+                "Description", BuildConfig.getFieldString(null, "PostbuildDescription"),
+                //Caution: String.replace(String,String) is available from JDK5 onwards only
+                "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace
+                   ("\t", "&#x0D;&#x0A;"))
+            }
+            );
+
+        tag("Tool",
+            new String[] {
+                "Name", "VCPreBuildEventTool"
+            }
+            );
+
+        tag("Tool",
+            new String[] {
+                "Name", "VCPreLinkEventTool",
+                "Description", BuildConfig.getFieldString(null, "PrelinkDescription"),
+                //Caution: String.replace(String,String) is available from JDK5 onwards only
+                "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace
+                   ("\t", "&#x0D;&#x0A;"))
+            }
+            );
+
+        tag("Tool",
+            new String[] {
+                "Name", "VCResourceCompilerTool",
+                // XXX???
+                "PreprocessorDefinitions", "NDEBUG",
+                "Culture", "1033"
+            }
+            );
+
+        tag("Tool",
+            new String[] {
+                "Name", "VCMIDLTool",
+                "PreprocessorDefinitions", "NDEBUG",
+                "MkTypLibCompatible", "TRUE",
+                "SuppressStartupBanner", "TRUE",
+                "TargetEnvironment", Util.os().equals("Win32") ? "1" : "3",
+                "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb",
+                "HeaderFileName", ""
+            }
+            );
+
+        endTag("Configuration");
+    }
+
+    int indent;
+
+    private void startTagPrim(String name,
+                              String[] attrs,
+                              boolean close) {
+        doIndent();
+        printWriter.print("<"+name);
+        indent++;
+
+        if (attrs != null) {
+            printWriter.println();
+            for (int i=0; i<attrs.length; i+=2) {
+                doIndent();
+                printWriter.print(" " + attrs[i]+"=\""+attrs[i+1]+"\"");
+                if (i < attrs.length - 2) {
+                    printWriter.println();
+                }
+            }
+        }
+
+        if (close) {
+            indent--;
+            //doIndent();
+            printWriter.println("/>");
+        } else {
+            //doIndent();
+            printWriter.println(">");
+        }
+    }
+
+    void startTag(String name, String[] attrs) {
+        startTagPrim(name, attrs, false);
+    }
+
+    void startTagV(String name, Vector attrs) {
+        String s[] = new String [attrs.size()];
+         for (int i=0; i<attrs.size(); i++) {
+             s[i] = (String)attrs.elementAt(i);
+         }
+        startTagPrim(name, s, false);
+    }
+
+    void endTag(String name) {
+        indent--;
+        doIndent();
+        printWriter.println("</"+name+">");
+    }
+
+    void tag(String name, String[] attrs) {
+        startTagPrim(name, attrs, true);
+    }
+
+     void tagV(String name, Vector attrs) {
+         String s[] = new String [attrs.size()];
+         for (int i=0; i<attrs.size(); i++) {
+             s[i] = (String)attrs.elementAt(i);
+         }
+         startTagPrim(name, s, true);
+    }
+
+
+    void doIndent() {
+        for (int i=0; i<indent; i++) {
+            printWriter.print("    ");
+        }
+    }
+
+    protected String getProjectExt() {
+        return ".vcproj";
+    }
+}
+
+class CompilerInterfaceVC7 extends CompilerInterface {
+    void getBaseCompilerFlags_common(Vector defines, Vector includes, String outDir,Vector rv) {
+
+        // advanced M$ IDE (2003) can only recognize name if it's first or
+        // second attribute in the tag - go guess
+        addAttr(rv, "Name", "VCCLCompilerTool");
+        addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes));
+        addAttr(rv, "PreprocessorDefinitions",
+                                Util.join(";", defines).replace("\"","&quot;"));
+        addAttr(rv, "PrecompiledHeaderThrough", "precompiled.hpp");
+        addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch");
+        addAttr(rv, "AssemblerListingLocation", outDir);
+        addAttr(rv, "ObjectFile", outDir+Util.sep);
+        addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb");
+        // Set /nologo optin
+        addAttr(rv, "SuppressStartupBanner", "TRUE");
+        // Surpass the default /Tc or /Tp. 0 is compileAsDefault
+        addAttr(rv, "CompileAs", "0");
+        // Set /W3 option. 3 is warningLevel_3
+        addAttr(rv, "WarningLevel", "3");
+        // Set /WX option,
+        addAttr(rv, "WarnAsError", "TRUE");
+        // Set /GS option
+        addAttr(rv, "BufferSecurityCheck", "FALSE");
+        // Set /Zi option. 3 is debugEnabled
+        addAttr(rv, "DebugInformationFormat", "3");
+    }
+    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
+        Vector rv = new Vector();
+
+        getBaseCompilerFlags_common(defines,includes, outDir, rv);
+        // Set /Yu option. 3 is pchUseUsingSpecific
+        // Note: Starting VC8 pchUseUsingSpecific is 2 !!!
+        addAttr(rv, "UsePrecompiledHeader", "3");
+        // Set /EHsc- option
+        addAttr(rv, "ExceptionHandling", "FALSE");
+
+        return rv;
+    }
+
+    Vector getBaseLinkerFlags(String outDir, String outDll) {
+        Vector rv = new Vector();
+
+        addAttr(rv, "Name", "VCLinkerTool");
+        addAttr(rv, "AdditionalOptions",
+                "/export:JNI_GetDefaultJavaVMInitArgs " +
+                "/export:JNI_CreateJavaVM " +
+                "/export:JVM_FindClassFromBootLoader "+
+                "/export:JNI_GetCreatedJavaVMs "+
+                "/export:jio_snprintf /export:jio_printf "+
+                "/export:jio_fprintf /export:jio_vfprintf "+
+                "/export:jio_vsnprintf "+
+                "/export:JVM_GetVersionInfo "+
+                "/export:JVM_GetThreadStateNames "+
+                "/export:JVM_GetThreadStateValues "+
+                "/export:JVM_InitAgentProperties ");
+        addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib");
+        addAttr(rv, "OutputFile", outDll);
+        // Set /INCREMENTAL option. 1 is linkIncrementalNo
+        addAttr(rv, "LinkIncremental", "1");
+        addAttr(rv, "SuppressStartupBanner", "TRUE");
+        addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
+        addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb");
+        // Set /SUBSYSTEM option. 2 is subSystemWindows
+        addAttr(rv, "SubSystem", "2");
+        addAttr(rv, "BaseAddress", "0x8000000");
+        addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
+        // Set /MACHINE option. 1 is machineX86
+        addAttr(rv, "TargetMachine", Util.os().equals("Win32") ? "1" : "17");
+
+        return rv;
+    }
+
+    void  getDebugCompilerFlags_common(String opt,Vector rv) {
+
+        // Set /On option
+        addAttr(rv, "Optimization", opt);
+        // Set /FR option. 1 is brAllInfo
+        addAttr(rv, "BrowseInformation", "1");
+        addAttr(rv, "BrowseInformationFile", "$(IntDir)" + Util.sep);
+        // Set /MD option. 2 is rtMultiThreadedDLL
+        addAttr(rv, "RuntimeLibrary", "2");
+        // Set /Oy- option
+        addAttr(rv, "OmitFramePointers", "FALSE");
+
+    }
+
+    Vector getDebugCompilerFlags(String opt) {
+        Vector rv = new Vector();
+
+        getDebugCompilerFlags_common(opt,rv);
+
+        return rv;
+    }
+
+    Vector getDebugLinkerFlags() {
+        Vector rv = new Vector();
+
+        addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option
+
+        return rv;
+    }
+
+    void getAdditionalNonKernelLinkerFlags(Vector rv) {
+        extAttr(rv, "AdditionalOptions",
+                "/export:AsyncGetCallTrace ");
+    }
+
+    void getProductCompilerFlags_common(Vector rv) {
+        // Set /O2 option. 2 is optimizeMaxSpeed
+        addAttr(rv, "Optimization", "2");
+        // Set /Oy- option
+        addAttr(rv, "OmitFramePointers", "FALSE");
+    }
+
+    Vector getProductCompilerFlags() {
+        Vector rv = new Vector();
+
+        getProductCompilerFlags_common(rv);
+        // Set /Ob option.  1 is expandOnlyInline
+        addAttr(rv, "InlineFunctionExpansion", "1");
+        // Set /GF option.
+        addAttr(rv, "StringPooling", "TRUE");
+        // Set /MD option. 2 is rtMultiThreadedDLL
+        addAttr(rv, "RuntimeLibrary", "2");
+        // Set /Gy option
+        addAttr(rv, "EnableFunctionLevelLinking", "TRUE");
+
+        return rv;
+    }
+
+    Vector getProductLinkerFlags() {
+        Vector rv = new Vector();
+
+        // Set /OPT:REF option. 2 is optReferences
+        addAttr(rv, "OptimizeReferences", "2");
+        // Set /OPT:optFolding option. 2 is optFolding
+        addAttr(rv, "EnableCOMDATFolding", "2");
+
+        return rv;
+    }
+
+    String getOptFlag() {
+        return "2";
+    }
+
+    String getNoOptFlag() {
+        return "0";
+    }
+
+    String makeCfgName(String flavourBuild) {
+        return  flavourBuild + "|" + Util.os();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC8.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.util.Vector;
+
+public class WinGammaPlatformVC8 extends WinGammaPlatformVC7 {
+
+    String projectVersion() {return "8.00";};
+
+}
+
+class CompilerInterfaceVC8 extends CompilerInterfaceVC7 {
+
+    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
+        Vector rv = new Vector();
+
+        getBaseCompilerFlags_common(defines,includes, outDir, rv);
+        // Set /Yu option. 2 is pchUseUsingSpecific
+        addAttr(rv, "UsePrecompiledHeader", "2");
+        // Set /EHsc- option. 0 is cppExceptionHandlingNo
+        addAttr(rv, "ExceptionHandling", "0");
+        // Parallel compilation
+        addAttr(rv, "AdditionalOptions", "/MP");
+
+        // enable multi process builds
+        extAttr(rv, "AdditionalOptions", "/MP");
+
+        return rv;
+    }
+
+
+    Vector getDebugCompilerFlags(String opt) {
+        Vector rv = new Vector();
+
+        getDebugCompilerFlags_common(opt,rv);
+
+        return rv;
+    }
+
+    Vector getProductCompilerFlags() {
+        Vector rv = new Vector();
+
+        getProductCompilerFlags_common(rv);
+
+        return rv;
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC9.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+public class WinGammaPlatformVC9 extends WinGammaPlatformVC8 {
+
+    String projectVersion() {return "9.00";};
+
+}
+
+class CompilerInterfaceVC9 extends CompilerInterfaceVC8 {
+}
--- a/src/share/tools/hsdis/hsdis-demo.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/tools/hsdis/hsdis-demo.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,8 @@
  *
  */
 
+#include "precompiled.hpp"
+
 /* hsdis-demo.c -- dump a range of addresses as native instructions
    This demonstrates the protocol required by the HotSpot PrintAssembly option.
 */
--- a/src/share/tools/hsdis/hsdis.c	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/tools/hsdis/hsdis.c	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,8 @@
  *
  */
 
+#include "precompiled.hpp"
+
 /* hsdis.c -- dump a range of addresses as native instructions
    This implements the plugin protocol required by the
    HotSpot PrintAssembly option.
--- a/src/share/tools/hsdis/hsdis.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/tools/hsdis/hsdis.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/launcher/java.c	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,2080 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * Gamma (Hotspot internal engineering test) launcher based on 6.0u22 JDK,
+ * search "GAMMA" for gamma specific changes.
+ *
+ * GAMMA: gamma launcher is much simpler than regular java launcher in that
+ *        JVM is either statically linked in or it is installed in the
+ *        same directory where the launcher exists, so we don't have to
+ *        worry about choosing the right JVM based on command line flag, jar
+ *        file and/or ergonomics. Intead of removing unused logic from source
+ *        they are commented out with #ifndef GAMMA, hopefully it'll be easier
+ *        to maintain this file in sync with regular JDK launcher.
+ */
+
+/*
+ * Shared source for 'java' command line tool.
+ *
+ * If JAVA_ARGS is defined, then acts as a launcher for applications. For
+ * instance, the JDK command line tools such as javac and javadoc (see
+ * makefiles for more details) are built with this program.  Any arguments
+ * prefixed with '-J' will be passed directly to the 'java' command.
+ */
+
+#ifdef GAMMA
+#  ifdef JAVA_ARGS
+#    error Do NOT define JAVA_ARGS when building gamma launcher
+#  endif
+#  if !defined(LINK_INTO_AOUT) && !defined(LINK_INTO_LIBJVM)
+#    error Either LINK_INTO_AOUT or LINK_INTO_LIBJVM must be defined
+#  endif
+#endif
+
+/*
+ * One job of the launcher is to remove command line options which the
+ * vm does not understand and will not process.  These options include
+ * options which select which style of vm is run (e.g. -client and
+ * -server) as well as options which select the data model to use.
+ * Additionally, for tools which invoke an underlying vm "-J-foo"
+ * options are turned into "-foo" options to the vm.  This option
+ * filtering is handled in a number of places in the launcher, some of
+ * it in machine-dependent code.  In this file, the function
+ * CheckJVMType removes vm style options and TranslateApplicationArgs
+ * removes "-J" prefixes.  On unix platforms, the
+ * CreateExecutionEnvironment function from the unix java_md.c file
+ * processes and removes -d<n> options.  However, in case
+ * CreateExecutionEnvironment does not need to exec because
+ * LD_LIBRARY_PATH is set acceptably and the data model does not need
+ * to be changed, ParseArguments will screen out the redundant -d<n>
+ * options and prevent them from being passed to the vm; this is done
+ * by using the machine-dependent call
+ * RemovableMachineDependentOption.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <jni.h>
+#include <jvm.h>
+#include "java.h"
+#ifndef GAMMA
+#include "manifest_info.h"
+#include "version_comp.h"
+#include "splashscreen.h"
+#endif
+#include "wildcard.h"
+
+#ifndef FULL_VERSION
+#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
+#endif
+
+/*
+ * The following environment variable is used to influence the behavior
+ * of the jre exec'd through the SelectVersion routine.  The command line
+ * options which specify the version are not passed to the exec'd version,
+ * because that jre may be an older version which wouldn't recognize them.
+ * This environment variable is known to this (and later) version and serves
+ * to suppress the version selection code.  This is not only for efficiency,
+ * but also for correctness, since any command line options have been
+ * removed which would cause any value found in the manifest to be used.
+ * This would be incorrect because the command line options are defined
+ * to take precedence.
+ *
+ * The value associated with this environment variable is the MainClass
+ * name from within the executable jar file (if any). This is strictly a
+ * performance enhancement to avoid re-reading the jar file manifest.
+ *
+ * A NOTE TO DEVELOPERS: For performance reasons it is important that
+ * the program image remain relatively small until after SelectVersion
+ * CreateExecutionEnvironment have finished their possibly recursive
+ * processing. Watch everything, but resist all temptations to use Java
+ * interfaces.
+ */
+#define ENV_ENTRY "_JAVA_VERSION_SET"
+
+#ifndef GAMMA
+#define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE"
+#define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR"
+#endif
+
+static jboolean printVersion = JNI_FALSE; /* print and exit */
+static jboolean showVersion = JNI_FALSE;  /* print but continue */
+static char *progname;
+jboolean _launcher_debug = JNI_FALSE;
+
+#ifndef GAMMA
+/*
+ * Entries for splash screen environment variables.
+ * putenv is performed in SelectVersion. We need
+ * them in memory until UnsetEnv, so they are made static
+ * global instead of auto local.
+ */
+static char* splash_file_entry = NULL;
+static char* splash_jar_entry = NULL;
+#endif
+
+/*
+ * List of VM options to be specified when the VM is created.
+ */
+static JavaVMOption *options;
+static int numOptions, maxOptions;
+
+/*
+ * Prototypes for functions internal to launcher.
+ */
+static void SetClassPath(const char *s);
+static void SelectVersion(int argc, char **argv, char **main_class);
+static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile,
+                               char **pclassname, int *pret, const char *jvmpath);
+static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv,
+                              InvocationFunctions *ifn);
+static jstring NewPlatformString(JNIEnv *env, char *s);
+static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc);
+static jclass LoadClass(JNIEnv *env, char *name);
+static jstring GetMainClassName(JNIEnv *env, char *jarname);
+static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv);
+static void SetJavaLauncherProp(void);
+
+#ifdef JAVA_ARGS
+static void TranslateApplicationArgs(int *pargc, char ***pargv);
+static jboolean AddApplicationOptions(void);
+#endif
+
+static void PrintJavaVersion(JNIEnv *env);
+static void PrintUsage(void);
+static jint PrintXUsage(const char *jvmpath);
+
+static void SetPaths(int argc, char **argv);
+
+#ifndef GAMMA
+
+/* Maximum supported entries from jvm.cfg. */
+#define INIT_MAX_KNOWN_VMS      10
+/* Values for vmdesc.flag */
+#define VM_UNKNOWN              -1
+#define VM_KNOWN                 0
+#define VM_ALIASED_TO            1
+#define VM_WARN                  2
+#define VM_ERROR                 3
+#define VM_IF_SERVER_CLASS       4
+#define VM_IGNORE                5
+struct vmdesc {
+    char *name;
+    int flag;
+    char *alias;
+    char *server_class;
+};
+static struct vmdesc *knownVMs = NULL;
+static int knownVMsCount = 0;
+static int knownVMsLimit = 0;
+
+static void GrowKnownVMs();
+static int  KnownVMIndex(const char* name);
+static void FreeKnownVMs();
+static void ShowSplashScreen();
+
+#endif /* ifndef GAMMA */
+
+jboolean ServerClassMachine();
+
+/* flag which if set suppresses error messages from the launcher */
+static int noExitErrorMessage = 0;
+
+/*
+ * Running Java code in primordial thread caused many problems. We will
+ * create a new thread to invoke JVM. See 6316197 for more information.
+ */
+static jlong threadStackSize = 0;  /* stack size of the new thread */
+
+int JNICALL JavaMain(void * args); /* entry point                  */
+
+struct JavaMainArgs {
+  int     argc;
+  char ** argv;
+  char *  jarfile;
+  char *  classname;
+  InvocationFunctions ifn;
+};
+
+/*
+ * Entry point.
+ */
+int
+main(int argc, char ** argv)
+{
+    char *jarfile = 0;
+    char *classname = 0;
+    char *s = 0;
+    char *main_class = NULL;
+    int ret;
+    InvocationFunctions ifn;
+    jlong start, end;
+    char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
+    char ** original_argv = argv;
+
+    if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) {
+        _launcher_debug = JNI_TRUE;
+        printf("----_JAVA_LAUNCHER_DEBUG----\n");
+    }
+
+#ifndef GAMMA
+    /*
+     * Make sure the specified version of the JRE is running.
+     *
+     * There are three things to note about the SelectVersion() routine:
+     *  1) If the version running isn't correct, this routine doesn't
+     *     return (either the correct version has been exec'd or an error
+     *     was issued).
+     *  2) Argc and Argv in this scope are *not* altered by this routine.
+     *     It is the responsibility of subsequent code to ignore the
+     *     arguments handled by this routine.
+     *  3) As a side-effect, the variable "main_class" is guaranteed to
+     *     be set (if it should ever be set).  This isn't exactly the
+     *     poster child for structured programming, but it is a small
+     *     price to pay for not processing a jar file operand twice.
+     *     (Note: This side effect has been disabled.  See comment on
+     *     bugid 5030265 below.)
+     */
+    SelectVersion(argc, argv, &main_class);
+#endif /* ifndef GAMMA */
+
+    /* copy original argv */
+    {
+      int i;
+      original_argv = (char**)JLI_MemAlloc(sizeof(char*)*(argc+1));
+      for(i = 0; i < argc+1; i++)
+        original_argv[i] = argv[i];
+    }
+
+    CreateExecutionEnvironment(&argc, &argv,
+                               jrepath, sizeof(jrepath),
+                               jvmpath, sizeof(jvmpath),
+                               original_argv);
+
+    printf("Using java runtime at: %s\n", jrepath);
+
+    ifn.CreateJavaVM = 0;
+    ifn.GetDefaultJavaVMInitArgs = 0;
+
+    if (_launcher_debug)
+      start = CounterGet();
+    if (!LoadJavaVM(jvmpath, &ifn)) {
+      exit(6);
+    }
+    if (_launcher_debug) {
+      end   = CounterGet();
+      printf("%ld micro seconds to LoadJavaVM\n",
+             (long)(jint)Counter2Micros(end-start));
+    }
+
+#ifdef JAVA_ARGS  /* javac, jar and friends. */
+    progname = "java";
+#else             /* java, oldjava, javaw and friends */
+#ifdef PROGNAME
+    progname = PROGNAME;
+#else
+    progname = *argv;
+    if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
+        progname = s + 1;
+    }
+#endif /* PROGNAME */
+#endif /* JAVA_ARGS */
+    ++argv;
+    --argc;
+
+#ifdef JAVA_ARGS
+    /* Preprocess wrapper arguments */
+    TranslateApplicationArgs(&argc, &argv);
+    if (!AddApplicationOptions()) {
+        exit(1);
+    }
+#endif
+
+    /* Set default CLASSPATH */
+    if ((s = getenv("CLASSPATH")) == 0) {
+        s = ".";
+    }
+#ifndef JAVA_ARGS
+    SetClassPath(s);
+#endif
+
+    /*
+     *  Parse command line options; if the return value of
+     *  ParseArguments is false, the program should exit.
+     */
+    if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret, jvmpath)) {
+      exit(ret);
+    }
+
+    /* Override class path if -jar flag was specified */
+    if (jarfile != 0) {
+        SetClassPath(jarfile);
+    }
+
+    /* set the -Dsun.java.command pseudo property */
+    SetJavaCommandLineProp(classname, jarfile, argc, argv);
+
+    /* Set the -Dsun.java.launcher pseudo property */
+    SetJavaLauncherProp();
+
+    /* set the -Dsun.java.launcher.* platform properties */
+    SetJavaLauncherPlatformProps();
+
+#ifndef GAMMA
+    /* Show the splash screen if needed */
+    ShowSplashScreen();
+#endif
+
+    /*
+     * Done with all command line processing and potential re-execs so
+     * clean up the environment.
+     */
+    (void)UnsetEnv(ENV_ENTRY);
+#ifndef GAMMA
+    (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY);
+    (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY);
+
+    JLI_MemFree(splash_jar_entry);
+    JLI_MemFree(splash_file_entry);
+#endif
+
+    /*
+     * If user doesn't specify stack size, check if VM has a preference.
+     * Note that HotSpot no longer supports JNI_VERSION_1_1 but it will
+     * return its default stack size through the init args structure.
+     */
+    if (threadStackSize == 0) {
+      struct JDK1_1InitArgs args1_1;
+      memset((void*)&args1_1, 0, sizeof(args1_1));
+      args1_1.version = JNI_VERSION_1_1;
+      ifn.GetDefaultJavaVMInitArgs(&args1_1);  /* ignore return value */
+      if (args1_1.javaStackSize > 0) {
+         threadStackSize = args1_1.javaStackSize;
+      }
+    }
+
+    { /* Create a new thread to create JVM and invoke main method */
+      struct JavaMainArgs args;
+
+      args.argc = argc;
+      args.argv = argv;
+      args.jarfile = jarfile;
+      args.classname = classname;
+      args.ifn = ifn;
+
+      return ContinueInNewThread(JavaMain, threadStackSize, (void*)&args);
+    }
+}
+
+int JNICALL
+JavaMain(void * _args)
+{
+    struct JavaMainArgs *args = (struct JavaMainArgs *)_args;
+    int argc = args->argc;
+    char **argv = args->argv;
+    char *jarfile = args->jarfile;
+    char *classname = args->classname;
+    InvocationFunctions ifn = args->ifn;
+
+    JavaVM *vm = 0;
+    JNIEnv *env = 0;
+    jstring mainClassName;
+    jclass mainClass;
+    jmethodID mainID;
+    jobjectArray mainArgs;
+    int ret = 0;
+    jlong start, end;
+
+    /*
+     * Error message to print or display; by default the message will
+     * only be displayed in a window.
+     */
+    char * message = "Fatal exception occurred.  Program will exit.";
+    jboolean messageDest = JNI_FALSE;
+
+    /* Initialize the virtual machine */
+
+    if (_launcher_debug)
+        start = CounterGet();
+    if (!InitializeJVM(&vm, &env, &ifn)) {
+        ReportErrorMessage("Could not create the Java virtual machine.",
+                           JNI_TRUE);
+        exit(1);
+    }
+
+    if (printVersion || showVersion) {
+        PrintJavaVersion(env);
+        if ((*env)->ExceptionOccurred(env)) {
+            ReportExceptionDescription(env);
+            goto leave;
+        }
+        if (printVersion) {
+            ret = 0;
+            message = NULL;
+            goto leave;
+        }
+        if (showVersion) {
+            fprintf(stderr, "\n");
+        }
+    }
+
+    /* If the user specified neither a class name nor a JAR file */
+    if (jarfile == 0 && classname == 0) {
+        PrintUsage();
+        message = NULL;
+        goto leave;
+    }
+
+#ifndef GAMMA
+    FreeKnownVMs();  /* after last possible PrintUsage() */
+#endif
+
+    if (_launcher_debug) {
+        end   = CounterGet();
+        printf("%ld micro seconds to InitializeJVM\n",
+               (long)(jint)Counter2Micros(end-start));
+    }
+
+    /* At this stage, argc/argv have the applications' arguments */
+    if (_launcher_debug) {
+        int i = 0;
+        printf("Main-Class is '%s'\n", classname ? classname : "");
+        printf("Apps' argc is %d\n", argc);
+        for (; i < argc; i++) {
+            printf("    argv[%2d] = '%s'\n", i, argv[i]);
+        }
+    }
+
+    ret = 1;
+
+    /*
+     * Get the application's main class.
+     *
+     * See bugid 5030265.  The Main-Class name has already been parsed
+     * from the manifest, but not parsed properly for UTF-8 support.
+     * Hence the code here ignores the value previously extracted and
+     * uses the pre-existing code to reextract the value.  This is
+     * possibly an end of release cycle expedient.  However, it has
+     * also been discovered that passing some character sets through
+     * the environment has "strange" behavior on some variants of
+     * Windows.  Hence, maybe the manifest parsing code local to the
+     * launcher should never be enhanced.
+     *
+     * Hence, future work should either:
+     *     1)   Correct the local parsing code and verify that the
+     *          Main-Class attribute gets properly passed through
+     *          all environments,
+     *     2)   Remove the vestages of maintaining main_class through
+     *          the environment (and remove these comments).
+     */
+    if (jarfile != 0) {
+        mainClassName = GetMainClassName(env, jarfile);
+        if ((*env)->ExceptionOccurred(env)) {
+            ReportExceptionDescription(env);
+            goto leave;
+        }
+        if (mainClassName == NULL) {
+          const char * format = "Failed to load Main-Class manifest "
+                                "attribute from\n%s";
+          message = (char*)JLI_MemAlloc((strlen(format) + strlen(jarfile)) *
+                                    sizeof(char));
+          sprintf(message, format, jarfile);
+          messageDest = JNI_TRUE;
+          goto leave;
+        }
+        classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
+        if (classname == NULL) {
+            ReportExceptionDescription(env);
+            goto leave;
+        }
+        mainClass = LoadClass(env, classname);
+        if(mainClass == NULL) { /* exception occured */
+            const char * format = "Could not find the main class: %s. Program will exit.";
+            ReportExceptionDescription(env);
+            message = (char *)JLI_MemAlloc((strlen(format) +
+                                            strlen(classname)) * sizeof(char) );
+            messageDest = JNI_TRUE;
+            sprintf(message, format, classname);
+            goto leave;
+        }
+        (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
+    } else {
+      mainClassName = NewPlatformString(env, classname);
+      if (mainClassName == NULL) {
+        const char * format = "Failed to load Main Class: %s";
+        message = (char *)JLI_MemAlloc((strlen(format) + strlen(classname)) *
+                                   sizeof(char) );
+        sprintf(message, format, classname);
+        messageDest = JNI_TRUE;
+        goto leave;
+      }
+      classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
+      if (classname == NULL) {
+        ReportExceptionDescription(env);
+        goto leave;
+      }
+      mainClass = LoadClass(env, classname);
+      if(mainClass == NULL) { /* exception occured */
+        const char * format = "Could not find the main class: %s.  Program will exit.";
+        ReportExceptionDescription(env);
+        message = (char *)JLI_MemAlloc((strlen(format) +
+                                        strlen(classname)) * sizeof(char) );
+        messageDest = JNI_TRUE;
+        sprintf(message, format, classname);
+        goto leave;
+      }
+      (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
+    }
+
+    /* Get the application's main method */
+    mainID = (*env)->GetStaticMethodID(env, mainClass, "main",
+                                       "([Ljava/lang/String;)V");
+    if (mainID == NULL) {
+        if ((*env)->ExceptionOccurred(env)) {
+            ReportExceptionDescription(env);
+        } else {
+          message = "No main method found in specified class.";
+          messageDest = JNI_TRUE;
+        }
+        goto leave;
+    }
+
+    {    /* Make sure the main method is public */
+        jint mods;
+        jmethodID mid;
+        jobject obj = (*env)->ToReflectedMethod(env, mainClass,
+                                                mainID, JNI_TRUE);
+
+        if( obj == NULL) { /* exception occurred */
+            ReportExceptionDescription(env);
+            goto leave;
+        }
+
+        mid =
+          (*env)->GetMethodID(env,
+                              (*env)->GetObjectClass(env, obj),
+                              "getModifiers", "()I");
+        if ((*env)->ExceptionOccurred(env)) {
+            ReportExceptionDescription(env);
+            goto leave;
+        }
+
+        mods = (*env)->CallIntMethod(env, obj, mid);
+        if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */
+            message = "Main method not public.";
+            messageDest = JNI_TRUE;
+            goto leave;
+        }
+    }
+
+    /* Build argument array */
+    mainArgs = NewPlatformStringArray(env, argv, argc);
+    if (mainArgs == NULL) {
+        ReportExceptionDescription(env);
+        goto leave;
+    }
+
+    /* Invoke main method. */
+    (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
+
+    /*
+     * The launcher's exit code (in the absence of calls to
+     * System.exit) will be non-zero if main threw an exception.
+     */
+    ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
+
+    /*
+     * Detach the main thread so that it appears to have ended when
+     * the application's main method exits.  This will invoke the
+     * uncaught exception handler machinery if main threw an
+     * exception.  An uncaught exception handler cannot change the
+     * launcher's return code except by calling System.exit.
+     */
+    if ((*vm)->DetachCurrentThread(vm) != 0) {
+        message = "Could not detach main thread.";
+        messageDest = JNI_TRUE;
+        ret = 1;
+        goto leave;
+    }
+
+    message = NULL;
+
+ leave:
+    /*
+     * Wait for all non-daemon threads to end, then destroy the VM.
+     * This will actually create a trivial new Java waiter thread
+     * named "DestroyJavaVM", but this will be seen as a different
+     * thread from the one that executed main, even though they are
+     * the same C thread.  This allows mainThread.join() and
+     * mainThread.isAlive() to work as expected.
+     */
+    (*vm)->DestroyJavaVM(vm);
+
+    if(message != NULL && !noExitErrorMessage)
+      ReportErrorMessage(message, messageDest);
+    return ret;
+}
+
+#ifndef GAMMA
+/*
+ * Checks the command line options to find which JVM type was
+ * specified.  If no command line option was given for the JVM type,
+ * the default type is used.  The environment variable
+ * JDK_ALTERNATE_VM and the command line option -XXaltjvm= are also
+ * checked as ways of specifying which JVM type to invoke.
+ */
+char *
+CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
+    int i, argi;
+    int argc;
+    char **newArgv;
+    int newArgvIdx = 0;
+    int isVMType;
+    int jvmidx = -1;
+    char *jvmtype = getenv("JDK_ALTERNATE_VM");
+
+    argc = *pargc;
+
+    /* To make things simpler we always copy the argv array */
+    newArgv = JLI_MemAlloc((argc + 1) * sizeof(char *));
+
+    /* The program name is always present */
+    newArgv[newArgvIdx++] = (*argv)[0];
+
+    for (argi = 1; argi < argc; argi++) {
+        char *arg = (*argv)[argi];
+        isVMType = 0;
+
+#ifdef JAVA_ARGS
+        if (arg[0] != '-') {
+            newArgv[newArgvIdx++] = arg;
+            continue;
+        }
+#else
+        if (strcmp(arg, "-classpath") == 0 ||
+            strcmp(arg, "-cp") == 0) {
+            newArgv[newArgvIdx++] = arg;
+            argi++;
+            if (argi < argc) {
+                newArgv[newArgvIdx++] = (*argv)[argi];
+            }
+            continue;
+        }
+        if (arg[0] != '-') break;
+#endif
+
+        /* Did the user pass an explicit VM type? */
+        i = KnownVMIndex(arg);
+        if (i >= 0) {
+            jvmtype = knownVMs[jvmidx = i].name + 1; /* skip the - */
+            isVMType = 1;
+            *pargc = *pargc - 1;
+        }
+
+        /* Did the user specify an "alternate" VM? */
+        else if (strncmp(arg, "-XXaltjvm=", 10) == 0 || strncmp(arg, "-J-XXaltjvm=", 12) == 0) {
+            isVMType = 1;
+            jvmtype = arg+((arg[1]=='X')? 10 : 12);
+            jvmidx = -1;
+        }
+
+        if (!isVMType) {
+            newArgv[newArgvIdx++] = arg;
+        }
+    }
+
+    /*
+     * Finish copying the arguments if we aborted the above loop.
+     * NOTE that if we aborted via "break" then we did NOT copy the
+     * last argument above, and in addition argi will be less than
+     * argc.
+     */
+    while (argi < argc) {
+        newArgv[newArgvIdx++] = (*argv)[argi];
+        argi++;
+    }
+
+    /* argv is null-terminated */
+    newArgv[newArgvIdx] = 0;
+
+    /* Copy back argv */
+    *argv = newArgv;
+    *pargc = newArgvIdx;
+
+    /* use the default VM type if not specified (no alias processing) */
+    if (jvmtype == NULL) {
+      char* result = knownVMs[0].name+1;
+      /* Use a different VM type if we are on a server class machine? */
+      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
+          (ServerClassMachine() == JNI_TRUE)) {
+        result = knownVMs[0].server_class+1;
+      }
+      if (_launcher_debug) {
+        printf("Default VM: %s\n", result);
+      }
+      return result;
+    }
+
+    /* if using an alternate VM, no alias processing */
+    if (jvmidx < 0)
+      return jvmtype;
+
+    /* Resolve aliases first */
+    {
+      int loopCount = 0;
+      while (knownVMs[jvmidx].flag == VM_ALIASED_TO) {
+        int nextIdx = KnownVMIndex(knownVMs[jvmidx].alias);
+
+        if (loopCount > knownVMsCount) {
+          if (!speculative) {
+            ReportErrorMessage("Error: Corrupt jvm.cfg file; cycle in alias list.",
+                               JNI_TRUE);
+            exit(1);
+          } else {
+            return "ERROR";
+            /* break; */
+          }
+        }
+
+        if (nextIdx < 0) {
+          if (!speculative) {
+            ReportErrorMessage2("Error: Unable to resolve VM alias %s",
+                                knownVMs[jvmidx].alias, JNI_TRUE);
+            exit(1);
+          } else {
+            return "ERROR";
+          }
+        }
+        jvmidx = nextIdx;
+        jvmtype = knownVMs[jvmidx].name+1;
+        loopCount++;
+      }
+    }
+
+    switch (knownVMs[jvmidx].flag) {
+    case VM_WARN:
+        if (!speculative) {
+            fprintf(stderr, "Warning: %s VM not supported; %s VM will be used\n",
+                    jvmtype, knownVMs[0].name + 1);
+        }
+        /* fall through */
+    case VM_IGNORE:
+        jvmtype = knownVMs[jvmidx=0].name + 1;
+        /* fall through */
+    case VM_KNOWN:
+        break;
+    case VM_ERROR:
+        if (!speculative) {
+            ReportErrorMessage2("Error: %s VM not supported", jvmtype, JNI_TRUE);
+            exit(1);
+        } else {
+            return "ERROR";
+        }
+    }
+
+    return jvmtype;
+}
+#endif /* ifndef GAMMA */
+
+# define KB (1024UL)
+# define MB (1024UL * KB)
+# define GB (1024UL * MB)
+
+/* copied from HotSpot function "atomll()" */
+static int
+parse_stack_size(const char *s, jlong *result) {
+  jlong n = 0;
+  int args_read = sscanf(s, jlong_format_specifier(), &n);
+  if (args_read != 1) {
+    return 0;
+  }
+  while (*s != '\0' && *s >= '0' && *s <= '9') {
+    s++;
+  }
+  // 4705540: illegal if more characters are found after the first non-digit
+  if (strlen(s) > 1) {
+    return 0;
+  }
+  switch (*s) {
+    case 'T': case 't':
+      *result = n * GB * KB;
+      return 1;
+    case 'G': case 'g':
+      *result = n * GB;
+      return 1;
+    case 'M': case 'm':
+      *result = n * MB;
+      return 1;
+    case 'K': case 'k':
+      *result = n * KB;
+      return 1;
+    case '\0':
+      *result = n;
+      return 1;
+    default:
+      /* Create JVM with default stack and let VM handle malformed -Xss string*/
+      return 0;
+  }
+}
+
+/*
+ * Adds a new VM option with the given given name and value.
+ */
+void
+AddOption(char *str, void *info)
+{
+    /*
+     * Expand options array if needed to accommodate at least one more
+     * VM option.
+     */
+    if (numOptions >= maxOptions) {
+        if (options == 0) {
+            maxOptions = 4;
+            options = JLI_MemAlloc(maxOptions * sizeof(JavaVMOption));
+        } else {
+            JavaVMOption *tmp;
+            maxOptions *= 2;
+            tmp = JLI_MemAlloc(maxOptions * sizeof(JavaVMOption));
+            memcpy(tmp, options, numOptions * sizeof(JavaVMOption));
+            JLI_MemFree(options);
+            options = tmp;
+        }
+    }
+    options[numOptions].optionString = str;
+    options[numOptions++].extraInfo = info;
+
+    if (strncmp(str, "-Xss", 4) == 0) {
+      jlong tmp;
+      if (parse_stack_size(str + 4, &tmp)) {
+        threadStackSize = tmp;
+      }
+    }
+}
+
+static void
+SetClassPath(const char *s)
+{
+    char *def;
+    s = JLI_WildcardExpandClasspath(s);
+    def = JLI_MemAlloc(strlen(s) + 40);
+    sprintf(def, "-Djava.class.path=%s", s);
+    AddOption(def, NULL);
+}
+
+#ifndef GAMMA
+/*
+ * The SelectVersion() routine ensures that an appropriate version of
+ * the JRE is running.  The specification for the appropriate version
+ * is obtained from either the manifest of a jar file (preferred) or
+ * from command line options.
+ * The routine also parses splash screen command line options and
+ * passes on their values in private environment variables.
+ */
+static void
+SelectVersion(int argc, char **argv, char **main_class)
+{
+    char    *arg;
+    char    **new_argv;
+    char    **new_argp;
+    char    *operand;
+    char    *version = NULL;
+    char    *jre = NULL;
+    int     jarflag = 0;
+    int     headlessflag = 0;
+    int     restrict_search = -1;               /* -1 implies not known */
+    manifest_info info;
+    char    env_entry[MAXNAMELEN + 24] = ENV_ENTRY "=";
+    char    *splash_file_name = NULL;
+    char    *splash_jar_name = NULL;
+    char    *env_in;
+    int     res;
+
+    /*
+     * If the version has already been selected, set *main_class
+     * with the value passed through the environment (if any) and
+     * simply return.
+     */
+    if ((env_in = getenv(ENV_ENTRY)) != NULL) {
+        if (*env_in != '\0')
+            *main_class = JLI_StringDup(env_in);
+        return;
+    }
+
+    /*
+     * Scan through the arguments for options relevant to multiple JRE
+     * support.  For reference, the command line syntax is defined as:
+     *
+     * SYNOPSIS
+     *      java [options] class [argument...]
+     *
+     *      java [options] -jar file.jar [argument...]
+     *
+     * As the scan is performed, make a copy of the argument list with
+     * the version specification options (new to 1.5) removed, so that
+     * a version less than 1.5 can be exec'd.
+     *
+     * Note that due to the syntax of the native Windows interface
+     * CreateProcess(), processing similar to the following exists in
+     * the Windows platform specific routine ExecJRE (in java_md.c).
+     * Changes here should be reproduced there.
+     */
+    new_argv = JLI_MemAlloc((argc + 1) * sizeof(char*));
+    new_argv[0] = argv[0];
+    new_argp = &new_argv[1];
+    argc--;
+    argv++;
+    while ((arg = *argv) != 0 && *arg == '-') {
+        if (strncmp(arg, "-version:", 9) == 0) {
+            version = arg + 9;
+        } else if (strcmp(arg, "-jre-restrict-search") == 0) {
+            restrict_search = 1;
+        } else if (strcmp(arg, "-no-jre-restrict-search") == 0) {
+            restrict_search = 0;
+        } else {
+            if (strcmp(arg, "-jar") == 0)
+                jarflag = 1;
+            /* deal with "unfortunate" classpath syntax */
+            if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) &&
+              (argc >= 2)) {
+                *new_argp++ = arg;
+                argc--;
+                argv++;
+                arg = *argv;
+            }
+
+            /*
+             * Checking for headless toolkit option in the some way as AWT does:
+             * "true" means true and any other value means false
+             */
+            if (strcmp(arg, "-Djava.awt.headless=true") == 0) {
+                headlessflag = 1;
+            } else if (strncmp(arg, "-Djava.awt.headless=", 20) == 0) {
+                headlessflag = 0;
+            } else if (strncmp(arg, "-splash:", 8) == 0) {
+                splash_file_name = arg+8;
+            }
+            *new_argp++ = arg;
+        }
+        argc--;
+        argv++;
+    }
+    if (argc <= 0) {    /* No operand? Possibly legit with -[full]version */
+        operand = NULL;
+    } else {
+        argc--;
+        *new_argp++ = operand = *argv++;
+    }
+    while (argc-- > 0)  /* Copy over [argument...] */
+        *new_argp++ = *argv++;
+    *new_argp = NULL;
+
+    /*
+     * If there is a jar file, read the manifest. If the jarfile can't be
+     * read, the manifest can't be read from the jar file, or the manifest
+     * is corrupt, issue the appropriate error messages and exit.
+     *
+     * Even if there isn't a jar file, construct a manifest_info structure
+     * containing the command line information.  It's a convenient way to carry
+     * this data around.
+     */
+    if (jarflag && operand) {
+        if ((res = JLI_ParseManifest(operand, &info)) != 0) {
+            if (res == -1)
+                ReportErrorMessage2("Unable to access jarfile %s",
+                  operand, JNI_TRUE);
+            else
+                ReportErrorMessage2("Invalid or corrupt jarfile %s",
+                  operand, JNI_TRUE);
+            exit(1);
+        }
+
+        /*
+         * Command line splash screen option should have precedence
+         * over the manifest, so the manifest data is used only if
+         * splash_file_name has not been initialized above during command
+         * line parsing
+         */
+        if (!headlessflag && !splash_file_name && info.splashscreen_image_file_name) {
+            splash_file_name = info.splashscreen_image_file_name;
+            splash_jar_name = operand;
+        }
+    } else {
+        info.manifest_version = NULL;
+        info.main_class = NULL;
+        info.jre_version = NULL;
+        info.jre_restrict_search = 0;
+    }
+
+    /*
+     * Passing on splash screen info in environment variables
+     */
+    if (splash_file_name && !headlessflag) {
+        char* splash_file_entry = JLI_MemAlloc(strlen(SPLASH_FILE_ENV_ENTRY "=")+strlen(splash_file_name)+1);
+        strcpy(splash_file_entry, SPLASH_FILE_ENV_ENTRY "=");
+        strcat(splash_file_entry, splash_file_name);
+        putenv(splash_file_entry);
+    }
+    if (splash_jar_name && !headlessflag) {
+        char* splash_jar_entry = JLI_MemAlloc(strlen(SPLASH_JAR_ENV_ENTRY "=")+strlen(splash_jar_name)+1);
+        strcpy(splash_jar_entry, SPLASH_JAR_ENV_ENTRY "=");
+        strcat(splash_jar_entry, splash_jar_name);
+        putenv(splash_jar_entry);
+    }
+
+    /*
+     * The JRE-Version and JRE-Restrict-Search values (if any) from the
+     * manifest are overwritten by any specified on the command line.
+     */
+    if (version != NULL)
+        info.jre_version = version;
+    if (restrict_search != -1)
+        info.jre_restrict_search = restrict_search;
+
+    /*
+     * "Valid" returns (other than unrecoverable errors) follow.  Set
+     * main_class as a side-effect of this routine.
+     */
+    if (info.main_class != NULL)
+        *main_class = JLI_StringDup(info.main_class);
+
+    /*
+     * If no version selection information is found either on the command
+     * line or in the manifest, simply return.
+     */
+    if (info.jre_version == NULL) {
+        JLI_FreeManifest();
+        JLI_MemFree(new_argv);
+        return;
+    }
+
+    /*
+     * Check for correct syntax of the version specification (JSR 56).
+     */
+    if (!JLI_ValidVersionString(info.jre_version)) {
+        ReportErrorMessage2("Syntax error in version specification \"%s\"",
+          info.jre_version, JNI_TRUE);
+        exit(1);
+    }
+
+    /*
+     * Find the appropriate JVM on the system. Just to be as forgiving as
+     * possible, if the standard algorithms don't locate an appropriate
+     * jre, check to see if the one running will satisfy the requirements.
+     * This can happen on systems which haven't been set-up for multiple
+     * JRE support.
+     */
+    jre = LocateJRE(&info);
+    if (_launcher_debug)
+        printf("JRE-Version = %s, JRE-Restrict-Search = %s Selected = %s\n",
+          (info.jre_version?info.jre_version:"null"),
+          (info.jre_restrict_search?"true":"false"), (jre?jre:"null"));
+    if (jre == NULL) {
+        if (JLI_AcceptableRelease(FULL_VERSION, info.jre_version)) {
+            JLI_FreeManifest();
+            JLI_MemFree(new_argv);
+            return;
+        } else {
+            ReportErrorMessage2(
+              "Unable to locate JRE meeting specification \"%s\"",
+              info.jre_version, JNI_TRUE);
+            exit(1);
+        }
+    }
+
+    /*
+     * If I'm not the chosen one, exec the chosen one.  Returning from
+     * ExecJRE indicates that I am indeed the chosen one.
+     *
+     * The private environment variable _JAVA_VERSION_SET is used to
+     * prevent the chosen one from re-reading the manifest file and
+     * using the values found within to override the (potential) command
+     * line flags stripped from argv (because the target may not
+     * understand them).  Passing the MainClass value is an optimization
+     * to avoid locating, expanding and parsing the manifest extra
+     * times.
+     */
+    if (info.main_class != NULL) {
+        if (strlen(info.main_class) <= MAXNAMELEN) {
+            (void)strcat(env_entry, info.main_class);
+        } else {
+            ReportErrorMessage("Error: main-class: attribute exceeds system limits\n", JNI_TRUE);
+            exit(1);
+        }
+    }
+    (void)putenv(env_entry);
+    ExecJRE(jre, new_argv);
+    JLI_FreeManifest();
+    JLI_MemFree(new_argv);
+    return;
+}
+#endif /* ifndef GAMMA */
+
+/*
+ * Parses command line arguments.  Returns JNI_FALSE if launcher
+ * should exit without starting vm (e.g. certain version and usage
+ * options); returns JNI_TRUE if vm needs to be started to process
+ * given options.  *pret (the launcher process return value) is set to
+ * 0 for a normal exit.
+ */
+static jboolean
+ParseArguments(int *pargc, char ***pargv, char **pjarfile,
+                       char **pclassname, int *pret, const char *jvmpath)
+{
+    int argc = *pargc;
+    char **argv = *pargv;
+    jboolean jarflag = JNI_FALSE;
+    char *arg;
+
+    *pret = 1;
+    while ((arg = *argv) != 0 && *arg == '-') {
+        argv++; --argc;
+        if (strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) {
+            if (argc < 1) {
+                ReportErrorMessage2("%s requires class path specification",
+                                    arg, JNI_TRUE);
+                PrintUsage();
+                return JNI_FALSE;
+            }
+            SetClassPath(*argv);
+            argv++; --argc;
+        } else if (strcmp(arg, "-jar") == 0) {
+            jarflag = JNI_TRUE;
+        } else if (strcmp(arg, "-help") == 0 ||
+                   strcmp(arg, "-h") == 0 ||
+                   strcmp(arg, "-?") == 0) {
+            PrintUsage();
+            *pret = 0;
+            return JNI_FALSE;
+        } else if (strcmp(arg, "-version") == 0) {
+            printVersion = JNI_TRUE;
+            return JNI_TRUE;
+        } else if (strcmp(arg, "-showversion") == 0) {
+            showVersion = JNI_TRUE;
+        } else if (strcmp(arg, "-X") == 0) {
+            *pret = PrintXUsage(jvmpath);
+            return JNI_FALSE;
+/*
+ * The following case provide backward compatibility with old-style
+ * command line options.
+ */
+        } else if (strcmp(arg, "-fullversion") == 0) {
+            fprintf(stderr, "%s full version \"%s\"\n", progname,
+                    FULL_VERSION);
+            *pret = 0;
+            return JNI_FALSE;
+        } else if (strcmp(arg, "-verbosegc") == 0) {
+            AddOption("-verbose:gc", NULL);
+        } else if (strcmp(arg, "-t") == 0) {
+            AddOption("-Xt", NULL);
+        } else if (strcmp(arg, "-tm") == 0) {
+            AddOption("-Xtm", NULL);
+        } else if (strcmp(arg, "-debug") == 0) {
+            AddOption("-Xdebug", NULL);
+        } else if (strcmp(arg, "-noclassgc") == 0) {
+            AddOption("-Xnoclassgc", NULL);
+        } else if (strcmp(arg, "-Xfuture") == 0) {
+            AddOption("-Xverify:all", NULL);
+        } else if (strcmp(arg, "-verify") == 0) {
+            AddOption("-Xverify:all", NULL);
+        } else if (strcmp(arg, "-verifyremote") == 0) {
+            AddOption("-Xverify:remote", NULL);
+        } else if (strcmp(arg, "-noverify") == 0) {
+            AddOption("-Xverify:none", NULL);
+        } else if (strcmp(arg, "-XXsuppressExitMessage") == 0) {
+            noExitErrorMessage = 1;
+        } else if (strncmp(arg, "-prof", 5) == 0) {
+            char *p = arg + 5;
+            char *tmp = JLI_MemAlloc(strlen(arg) + 50);
+            if (*p) {
+                sprintf(tmp, "-Xrunhprof:cpu=old,file=%s", p + 1);
+            } else {
+                sprintf(tmp, "-Xrunhprof:cpu=old,file=java.prof");
+            }
+            AddOption(tmp, NULL);
+        } else if (strncmp(arg, "-ss", 3) == 0 ||
+                   strncmp(arg, "-oss", 4) == 0 ||
+                   strncmp(arg, "-ms", 3) == 0 ||
+                   strncmp(arg, "-mx", 3) == 0) {
+            char *tmp = JLI_MemAlloc(strlen(arg) + 6);
+            sprintf(tmp, "-X%s", arg + 1); /* skip '-' */
+            AddOption(tmp, NULL);
+        } else if (strcmp(arg, "-checksource") == 0 ||
+                   strcmp(arg, "-cs") == 0 ||
+                   strcmp(arg, "-noasyncgc") == 0) {
+            /* No longer supported */
+            fprintf(stderr,
+                    "Warning: %s option is no longer supported.\n",
+                    arg);
+        } else if (strncmp(arg, "-version:", 9) == 0 ||
+                   strcmp(arg, "-no-jre-restrict-search") == 0 ||
+                   strcmp(arg, "-jre-restrict-search") == 0 ||
+                   strncmp(arg, "-splash:", 8) == 0) {
+            ; /* Ignore machine independent options already handled */
+        } else if (RemovableMachineDependentOption(arg) ) {
+            ; /* Do not pass option to vm. */
+        }
+        else {
+            AddOption(arg, NULL);
+        }
+    }
+
+    if (--argc >= 0) {
+        if (jarflag) {
+            *pjarfile = *argv++;
+            *pclassname = 0;
+        } else {
+            *pjarfile = 0;
+            *pclassname = *argv++;
+        }
+        *pargc = argc;
+        *pargv = argv;
+    }
+
+    return JNI_TRUE;
+}
+
+/*
+ * Initializes the Java Virtual Machine. Also frees options array when
+ * finished.
+ */
+static jboolean
+InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn)
+{
+    JavaVMInitArgs args;
+    jint r;
+
+    memset(&args, 0, sizeof(args));
+    args.version  = JNI_VERSION_1_2;
+    args.nOptions = numOptions;
+    args.options  = options;
+    args.ignoreUnrecognized = JNI_FALSE;
+
+    if (_launcher_debug) {
+        int i = 0;
+        printf("JavaVM args:\n    ");
+        printf("version 0x%08lx, ", (long)args.version);
+        printf("ignoreUnrecognized is %s, ",
+               args.ignoreUnrecognized ? "JNI_TRUE" : "JNI_FALSE");
+        printf("nOptions is %ld\n", (long)args.nOptions);
+        for (i = 0; i < numOptions; i++)
+            printf("    option[%2d] = '%s'\n",
+                   i, args.options[i].optionString);
+    }
+
+    r = ifn->CreateJavaVM(pvm, (void **)penv, &args);
+    JLI_MemFree(options);
+    return r == JNI_OK;
+}
+
+
+#define NULL_CHECK0(e) if ((e) == 0) return 0
+#define NULL_CHECK(e) if ((e) == 0) return
+
+static jstring platformEncoding = NULL;
+static jstring getPlatformEncoding(JNIEnv *env) {
+    if (platformEncoding == NULL) {
+        jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding");
+        if (propname) {
+            jclass cls;
+            jmethodID mid;
+            NULL_CHECK0 (cls = (*env)->FindClass(env, "java/lang/System"));
+            NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
+                                   env, cls,
+                                   "getProperty",
+                                   "(Ljava/lang/String;)Ljava/lang/String;"));
+            platformEncoding = (*env)->CallStaticObjectMethod (
+                                    env, cls, mid, propname);
+        }
+    }
+    return platformEncoding;
+}
+
+static jboolean isEncodingSupported(JNIEnv *env, jstring enc) {
+    jclass cls;
+    jmethodID mid;
+    NULL_CHECK0 (cls = (*env)->FindClass(env, "java/nio/charset/Charset"));
+    NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
+                           env, cls,
+                           "isSupported",
+                           "(Ljava/lang/String;)Z"));
+    return (*env)->CallStaticBooleanMethod(env, cls, mid, enc);
+}
+
+/*
+ * Returns a new Java string object for the specified platform string.
+ */
+static jstring
+NewPlatformString(JNIEnv *env, char *s)
+{
+    int len = (int)strlen(s);
+    jclass cls;
+    jmethodID mid;
+    jbyteArray ary;
+    jstring enc;
+
+    if (s == NULL)
+        return 0;
+    enc = getPlatformEncoding(env);
+
+    ary = (*env)->NewByteArray(env, len);
+    if (ary != 0) {
+        jstring str = 0;
+        (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s);
+        if (!(*env)->ExceptionOccurred(env)) {
+            if (isEncodingSupported(env, enc) == JNI_TRUE) {
+                NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String"));
+                NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
+                                          "([BLjava/lang/String;)V"));
+                str = (*env)->NewObject(env, cls, mid, ary, enc);
+            } else {
+                /*If the encoding specified in sun.jnu.encoding is not
+                  endorsed by "Charset.isSupported" we have to fall back
+                  to use String(byte[]) explicitly here without specifying
+                  the encoding name, in which the StringCoding class will
+                  pickup the iso-8859-1 as the fallback converter for us.
+                */
+                NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String"));
+                NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
+                                          "([B)V"));
+                str = (*env)->NewObject(env, cls, mid, ary);
+            }
+            (*env)->DeleteLocalRef(env, ary);
+            return str;
+        }
+    }
+    return 0;
+}
+
+/*
+ * Returns a new array of Java string objects for the specified
+ * array of platform strings.
+ */
+static jobjectArray
+NewPlatformStringArray(JNIEnv *env, char **strv, int strc)
+{
+    jarray cls;
+    jarray ary;
+    int i;
+
+    NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String"));
+    NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0));
+    for (i = 0; i < strc; i++) {
+        jstring str = NewPlatformString(env, *strv++);
+        NULL_CHECK0(str);
+        (*env)->SetObjectArrayElement(env, ary, i, str);
+        (*env)->DeleteLocalRef(env, str);
+    }
+    return ary;
+}
+
+/*
+ * Loads a class, convert the '.' to '/'.
+ */
+static jclass
+LoadClass(JNIEnv *env, char *name)
+{
+    char *buf = JLI_MemAlloc(strlen(name) + 1);
+    char *s = buf, *t = name, c;
+    jclass cls;
+    jlong start, end;
+
+    if (_launcher_debug)
+        start = CounterGet();
+
+    do {
+        c = *t++;
+        *s++ = (c == '.') ? '/' : c;
+    } while (c != '\0');
+    cls = (*env)->FindClass(env, buf);
+    JLI_MemFree(buf);
+
+    if (_launcher_debug) {
+        end   = CounterGet();
+        printf("%ld micro seconds to load main class\n",
+               (long)(jint)Counter2Micros(end-start));
+        printf("----_JAVA_LAUNCHER_DEBUG----\n");
+    }
+
+    return cls;
+}
+
+
+/*
+ * Returns the main class name for the specified jar file.
+ */
+static jstring
+GetMainClassName(JNIEnv *env, char *jarname)
+{
+#define MAIN_CLASS "Main-Class"
+    jclass cls;
+    jmethodID mid;
+    jobject jar, man, attr;
+    jstring str, result = 0;
+
+    NULL_CHECK0(cls = (*env)->FindClass(env, "java/util/jar/JarFile"));
+    NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
+                                          "(Ljava/lang/String;)V"));
+    NULL_CHECK0(str = NewPlatformString(env, jarname));
+    NULL_CHECK0(jar = (*env)->NewObject(env, cls, mid, str));
+    NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "getManifest",
+                                          "()Ljava/util/jar/Manifest;"));
+    man = (*env)->CallObjectMethod(env, jar, mid);
+    if (man != 0) {
+        NULL_CHECK0(mid = (*env)->GetMethodID(env,
+                                    (*env)->GetObjectClass(env, man),
+                                    "getMainAttributes",
+                                    "()Ljava/util/jar/Attributes;"));
+        attr = (*env)->CallObjectMethod(env, man, mid);
+        if (attr != 0) {
+            NULL_CHECK0(mid = (*env)->GetMethodID(env,
+                                    (*env)->GetObjectClass(env, attr),
+                                    "getValue",
+                                    "(Ljava/lang/String;)Ljava/lang/String;"));
+            NULL_CHECK0(str = NewPlatformString(env, MAIN_CLASS));
+            result = (*env)->CallObjectMethod(env, attr, mid, str);
+        }
+    }
+    return result;
+}
+
+#ifdef JAVA_ARGS
+static char *java_args[] = JAVA_ARGS;
+static char *app_classpath[] = APP_CLASSPATH;
+
+/*
+ * For tools, convert command line args thus:
+ *   javac -cp foo:foo/"*" -J-ms32m ...
+ *   java -ms32m -cp JLI_WildcardExpandClasspath(foo:foo/"*") ...
+ */
+static void
+TranslateApplicationArgs(int *pargc, char ***pargv)
+{
+    const int NUM_ARGS = (sizeof(java_args) / sizeof(char *));
+    int argc = *pargc;
+    char **argv = *pargv;
+    int nargc = argc + NUM_ARGS;
+    char **nargv = JLI_MemAlloc((nargc + 1) * sizeof(char *));
+    int i;
+
+    *pargc = nargc;
+    *pargv = nargv;
+
+    /* Copy the VM arguments (i.e. prefixed with -J) */
+    for (i = 0; i < NUM_ARGS; i++) {
+        char *arg = java_args[i];
+        if (arg[0] == '-' && arg[1] == 'J') {
+            *nargv++ = arg + 2;
+        }
+    }
+
+    for (i = 0; i < argc; i++) {
+        char *arg = argv[i];
+        if (arg[0] == '-' && arg[1] == 'J') {
+            if (arg[2] == '\0') {
+                ReportErrorMessage("Error: the -J option should not be "
+                                   "followed by a space.", JNI_TRUE);
+                exit(1);
+            }
+            *nargv++ = arg + 2;
+        }
+    }
+
+    /* Copy the rest of the arguments */
+    for (i = 0; i < NUM_ARGS; i++) {
+        char *arg = java_args[i];
+        if (arg[0] != '-' || arg[1] != 'J') {
+            *nargv++ = arg;
+        }
+    }
+    for (i = 0; i < argc; i++) {
+        char *arg = argv[i];
+        if (arg[0] == '-') {
+            if (arg[1] == 'J')
+                continue;
+#ifdef EXPAND_CLASSPATH_WILDCARDS
+            if (arg[1] == 'c'
+                && (strcmp(arg, "-cp") == 0 ||
+                    strcmp(arg, "-classpath") == 0)
+                && i < argc - 1) {
+                *nargv++ = arg;
+                *nargv++ = (char *) JLI_WildcardExpandClasspath(argv[i+1]);
+                i++;
+                continue;
+            }
+#endif
+        }
+        *nargv++ = arg;
+    }
+    *nargv = 0;
+}
+
+/*
+ * For our tools, we try to add 3 VM options:
+ *      -Denv.class.path=<envcp>
+ *      -Dapplication.home=<apphome>
+ *      -Djava.class.path=<appcp>
+ * <envcp>   is the user's setting of CLASSPATH -- for instance the user
+ *           tells javac where to find binary classes through this environment
+ *           variable.  Notice that users will be able to compile against our
+ *           tools classes (sun.tools.javac.Main) only if they explicitly add
+ *           tools.jar to CLASSPATH.
+ * <apphome> is the directory where the application is installed.
+ * <appcp>   is the classpath to where our apps' classfiles are.
+ */
+static jboolean
+AddApplicationOptions()
+{
+    const int NUM_APP_CLASSPATH = (sizeof(app_classpath) / sizeof(char *));
+    char *envcp, *appcp, *apphome;
+    char home[MAXPATHLEN]; /* application home */
+    char separator[] = { PATH_SEPARATOR, '\0' };
+    int size, i;
+    int strlenHome;
+
+    {
+        const char *s = getenv("CLASSPATH");
+        if (s) {
+            s = (char *) JLI_WildcardExpandClasspath(s);
+            /* 40 for -Denv.class.path= */
+            envcp = (char *)JLI_MemAlloc(strlen(s) + 40);
+            sprintf(envcp, "-Denv.class.path=%s", s);
+            AddOption(envcp, NULL);
+        }
+    }
+
+    if (!GetApplicationHome(home, sizeof(home))) {
+        ReportErrorMessage("Can't determine application home", JNI_TRUE);
+        return JNI_FALSE;
+    }
+
+    /* 40 for '-Dapplication.home=' */
+    apphome = (char *)JLI_MemAlloc(strlen(home) + 40);
+    sprintf(apphome, "-Dapplication.home=%s", home);
+    AddOption(apphome, NULL);
+
+    /* How big is the application's classpath? */
+    size = 40;                                 /* 40: "-Djava.class.path=" */
+    strlenHome = (int)strlen(home);
+    for (i = 0; i < NUM_APP_CLASSPATH; i++) {
+        size += strlenHome + (int)strlen(app_classpath[i]) + 1; /* 1: separator */
+    }
+    appcp = (char *)JLI_MemAlloc(size + 1);
+    strcpy(appcp, "-Djava.class.path=");
+    for (i = 0; i < NUM_APP_CLASSPATH; i++) {
+        strcat(appcp, home);                    /* c:\program files\myapp */
+        strcat(appcp, app_classpath[i]);        /* \lib\myapp.jar         */
+        strcat(appcp, separator);               /* ;                      */
+    }
+    appcp[strlen(appcp)-1] = '\0';  /* remove trailing path separator */
+    AddOption(appcp, NULL);
+    return JNI_TRUE;
+}
+#endif /* JAVA_ARGS */
+
+/*
+ * inject the -Dsun.java.command pseudo property into the args structure
+ * this pseudo property is used in the HotSpot VM to expose the
+ * Java class name and arguments to the main method to the VM. The
+ * HotSpot VM uses this pseudo property to store the Java class name
+ * (or jar file name) and the arguments to the class's main method
+ * to the instrumentation memory region. The sun.java.command pseudo
+ * property is not exported by HotSpot to the Java layer.
+ */
+void
+SetJavaCommandLineProp(char *classname, char *jarfile,
+                       int argc, char **argv)
+{
+
+    int i = 0;
+    size_t len = 0;
+    char* javaCommand = NULL;
+    char* dashDstr = "-Dsun.java.command=";
+
+    if (classname == NULL && jarfile == NULL) {
+        /* unexpected, one of these should be set. just return without
+         * setting the property
+         */
+        return;
+    }
+
+    /* if the class name is not set, then use the jarfile name */
+    if (classname == NULL) {
+        classname = jarfile;
+    }
+
+    /* determine the amount of memory to allocate assuming
+     * the individual components will be space separated
+     */
+    len = strlen(classname);
+    for (i = 0; i < argc; i++) {
+        len += strlen(argv[i]) + 1;
+    }
+
+    /* allocate the memory */
+    javaCommand = (char*) JLI_MemAlloc(len + strlen(dashDstr) + 1);
+
+    /* build the -D string */
+    *javaCommand = '\0';
+    strcat(javaCommand, dashDstr);
+    strcat(javaCommand, classname);
+
+    for (i = 0; i < argc; i++) {
+        /* the components of the string are space separated. In
+         * the case of embedded white space, the relationship of
+         * the white space separated components to their true
+         * positional arguments will be ambiguous. This issue may
+         * be addressed in a future release.
+         */
+        strcat(javaCommand, " ");
+        strcat(javaCommand, argv[i]);
+    }
+
+    AddOption(javaCommand, NULL);
+}
+
+/*
+ * JVM would like to know if it's created by a standard Sun launcher, or by
+ * user native application, the following property indicates the former.
+ */
+void SetJavaLauncherProp() {
+  AddOption("-Dsun.java.launcher=" LAUNCHER_TYPE, NULL);
+}
+
+/*
+ * Prints the version information from the java.version and other properties.
+ */
+static void
+PrintJavaVersion(JNIEnv *env)
+{
+    jclass ver;
+    jmethodID print;
+
+    NULL_CHECK(ver = (*env)->FindClass(env, "sun/misc/Version"));
+    NULL_CHECK(print = (*env)->GetStaticMethodID(env, ver, "print", "()V"));
+
+    (*env)->CallStaticVoidMethod(env, ver, print);
+}
+
+/*
+ * Prints default usage message.
+ */
+static void
+PrintUsage(void)
+{
+#ifndef GAMMA
+    int i;
+#endif
+
+    fprintf(stdout,
+        "Usage: %s [-options] class [args...]\n"
+        "           (to execute a class)\n"
+        "   or  %s [-options] -jar jarfile [args...]\n"
+        "           (to execute a jar file)\n"
+        "\n"
+        "where options include:\n",
+        progname,
+        progname);
+
+#ifndef GAMMA
+    PrintMachineDependentOptions();
+
+    if ((knownVMs[0].flag == VM_KNOWN) ||
+        (knownVMs[0].flag == VM_IF_SERVER_CLASS)) {
+      fprintf(stdout, "    %s\t  to select the \"%s\" VM\n",
+              knownVMs[0].name, knownVMs[0].name+1);
+    }
+    for (i=1; i<knownVMsCount; i++) {
+        if (knownVMs[i].flag == VM_KNOWN)
+            fprintf(stdout, "    %s\t  to select the \"%s\" VM\n",
+                    knownVMs[i].name, knownVMs[i].name+1);
+    }
+    for (i=1; i<knownVMsCount; i++) {
+        if (knownVMs[i].flag == VM_ALIASED_TO)
+            fprintf(stdout, "    %s\t  is a synonym for "
+                    "the \"%s\" VM  [deprecated]\n",
+                    knownVMs[i].name, knownVMs[i].alias+1);
+    }
+    /* The first known VM is the default */
+    {
+      const char* defaultVM   = knownVMs[0].name+1;
+      const char* punctuation = ".";
+      const char* reason      = "";
+      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
+          (ServerClassMachine() == JNI_TRUE)) {
+        defaultVM = knownVMs[0].server_class+1;
+        punctuation = ", ";
+        reason = "because you are running on a server-class machine.\n";
+      }
+      fprintf(stdout, "                  The default VM is %s%s\n",
+              defaultVM, punctuation);
+      fprintf(stdout, "                  %s\n",
+              reason);
+    }
+#endif /* ifndef GAMMA */
+
+    fprintf(stdout,
+"    -cp <class search path of directories and zip/jar files>\n"
+"    -classpath <class search path of directories and zip/jar files>\n"
+"                  A %c separated list of directories, JAR archives,\n"
+"                  and ZIP archives to search for class files.\n"
+"    -D<name>=<value>\n"
+"                  set a system property\n"
+"    -verbose[:class|gc|jni]\n"
+"                  enable verbose output\n"
+"    -version      print product version and exit\n"
+"    -version:<value>\n"
+"                  require the specified version to run\n"
+"    -showversion  print product version and continue\n"
+"    -jre-restrict-search | -jre-no-restrict-search\n"
+"                  include/exclude user private JREs in the version search\n"
+"    -? -help      print this help message\n"
+"    -X            print help on non-standard options\n"
+"    -ea[:<packagename>...|:<classname>]\n"
+"    -enableassertions[:<packagename>...|:<classname>]\n"
+"                  enable assertions\n"
+"    -da[:<packagename>...|:<classname>]\n"
+"    -disableassertions[:<packagename>...|:<classname>]\n"
+"                  disable assertions\n"
+"    -esa | -enablesystemassertions\n"
+"                  enable system assertions\n"
+"    -dsa | -disablesystemassertions\n"
+"                  disable system assertions\n"
+"    -agentlib:<libname>[=<options>]\n"
+"                  load native agent library <libname>, e.g. -agentlib:hprof\n"
+"                    see also, -agentlib:jdwp=help and -agentlib:hprof=help\n"
+"    -agentpath:<pathname>[=<options>]\n"
+"                  load native agent library by full pathname\n"
+"    -javaagent:<jarpath>[=<options>]\n"
+"                  load Java programming language agent, see java.lang.instrument\n"
+"    -splash:<imagepath>\n"
+"                  show splash screen with specified image\n"
+
+            ,PATH_SEPARATOR);
+}
+
+/*
+ * Print usage message for -X options.
+ */
+static jint
+PrintXUsage(const char *jvmpath)
+{
+    /*
+       A 32 bit cushion to prevent buffer overrun, noting that
+       fopen(3C) may fail if the buffer exceeds MAXPATHLEN.
+    */
+    char path[MAXPATHLEN+32];
+    char buf[128];
+    size_t n;
+    FILE *fp;
+    static const char Xusage_txt[] = "/Xusage.txt";
+
+    strcpy(path, jvmpath);
+    /* Note the FILE_SEPARATOR is platform dependent */
+    strcpy(strrchr(path, FILE_SEPARATOR), Xusage_txt);
+    fp = fopen(path, "r");
+    if (fp == 0) {
+        fprintf(stderr, "Can't open %s\n", path);
+        return 1;
+    }
+    while ((n = fread(buf, 1, sizeof(buf), fp)) != 0) {
+        fwrite(buf, 1, n, stdout);
+    }
+    fclose(fp);
+    return 0;
+}
+
+#ifndef GAMMA
+/*
+ * Read the jvm.cfg file and fill the knownJVMs[] array.
+ *
+ * The functionality of the jvm.cfg file is subject to change without
+ * notice and the mechanism will be removed in the future.
+ *
+ * The lexical structure of the jvm.cfg file is as follows:
+ *
+ *     jvmcfg         :=  { vmLine }
+ *     vmLine         :=  knownLine
+ *                    |   aliasLine
+ *                    |   warnLine
+ *                    |   ignoreLine
+ *                    |   errorLine
+ *                    |   predicateLine
+ *                    |   commentLine
+ *     knownLine      :=  flag  "KNOWN"                  EOL
+ *     warnLine       :=  flag  "WARN"                   EOL
+ *     ignoreLine     :=  flag  "IGNORE"                 EOL
+ *     errorLine      :=  flag  "ERROR"                  EOL
+ *     aliasLine      :=  flag  "ALIASED_TO"       flag  EOL
+ *     predicateLine  :=  flag  "IF_SERVER_CLASS"  flag  EOL
+ *     commentLine    :=  "#" text                       EOL
+ *     flag           :=  "-" identifier
+ *
+ * The semantics are that when someone specifies a flag on the command line:
+ * - if the flag appears on a knownLine, then the identifier is used as
+ *   the name of the directory holding the JVM library (the name of the JVM).
+ * - if the flag appears as the first flag on an aliasLine, the identifier
+ *   of the second flag is used as the name of the JVM.
+ * - if the flag appears on a warnLine, the identifier is used as the
+ *   name of the JVM, but a warning is generated.
+ * - if the flag appears on an ignoreLine, the identifier is recognized as the
+ *   name of a JVM, but the identifier is ignored and the default vm used
+ * - if the flag appears on an errorLine, an error is generated.
+ * - if the flag appears as the first flag on a predicateLine, and
+ *   the machine on which you are running passes the predicate indicated,
+ *   then the identifier of the second flag is used as the name of the JVM,
+ *   otherwise the identifier of the first flag is used as the name of the JVM.
+ * If no flag is given on the command line, the first vmLine of the jvm.cfg
+ * file determines the name of the JVM.
+ * PredicateLines are only interpreted on first vmLine of a jvm.cfg file,
+ * since they only make sense if someone hasn't specified the name of the
+ * JVM on the command line.
+ *
+ * The intent of the jvm.cfg file is to allow several JVM libraries to
+ * be installed in different subdirectories of a single JRE installation,
+ * for space-savings and convenience in testing.
+ * The intent is explicitly not to provide a full aliasing or predicate
+ * mechanism.
+ */
+jint
+ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative)
+{
+    FILE *jvmCfg;
+    char jvmCfgName[MAXPATHLEN+20];
+    char line[MAXPATHLEN+20];
+    int cnt = 0;
+    int lineno = 0;
+    jlong start, end;
+    int vmType;
+    char *tmpPtr;
+    char *altVMName = NULL;
+    char *serverClassVMName = NULL;
+    static char *whiteSpace = " \t";
+    if (_launcher_debug) {
+        start = CounterGet();
+    }
+
+    strcpy(jvmCfgName, jrepath);
+    strcat(jvmCfgName, FILESEP "lib" FILESEP);
+    strcat(jvmCfgName, arch);
+    strcat(jvmCfgName, FILESEP "jvm.cfg");
+
+    jvmCfg = fopen(jvmCfgName, "r");
+    if (jvmCfg == NULL) {
+      if (!speculative) {
+        ReportErrorMessage2("Error: could not open `%s'", jvmCfgName,
+                            JNI_TRUE);
+        exit(1);
+      } else {
+        return -1;
+      }
+    }
+    while (fgets(line, sizeof(line), jvmCfg) != NULL) {
+        vmType = VM_UNKNOWN;
+        lineno++;
+        if (line[0] == '#')
+            continue;
+        if (line[0] != '-') {
+            fprintf(stderr, "Warning: no leading - on line %d of `%s'\n",
+                    lineno, jvmCfgName);
+        }
+        if (cnt >= knownVMsLimit) {
+            GrowKnownVMs(cnt);
+        }
+        line[strlen(line)-1] = '\0'; /* remove trailing newline */
+        tmpPtr = line + strcspn(line, whiteSpace);
+        if (*tmpPtr == 0) {
+            fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
+                    lineno, jvmCfgName);
+        } else {
+            /* Null-terminate this string for JLI_StringDup below */
+            *tmpPtr++ = 0;
+            tmpPtr += strspn(tmpPtr, whiteSpace);
+            if (*tmpPtr == 0) {
+                fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
+                        lineno, jvmCfgName);
+            } else {
+                if (!strncmp(tmpPtr, "KNOWN", strlen("KNOWN"))) {
+                    vmType = VM_KNOWN;
+                } else if (!strncmp(tmpPtr, "ALIASED_TO", strlen("ALIASED_TO"))) {
+                    tmpPtr += strcspn(tmpPtr, whiteSpace);
+                    if (*tmpPtr != 0) {
+                        tmpPtr += strspn(tmpPtr, whiteSpace);
+                    }
+                    if (*tmpPtr == 0) {
+                        fprintf(stderr, "Warning: missing VM alias on line %d of `%s'\n",
+                                lineno, jvmCfgName);
+                    } else {
+                        /* Null terminate altVMName */
+                        altVMName = tmpPtr;
+                        tmpPtr += strcspn(tmpPtr, whiteSpace);
+                        *tmpPtr = 0;
+                        vmType = VM_ALIASED_TO;
+                    }
+                } else if (!strncmp(tmpPtr, "WARN", strlen("WARN"))) {
+                    vmType = VM_WARN;
+                } else if (!strncmp(tmpPtr, "IGNORE", strlen("IGNORE"))) {
+                    vmType = VM_IGNORE;
+                } else if (!strncmp(tmpPtr, "ERROR", strlen("ERROR"))) {
+                    vmType = VM_ERROR;
+                } else if (!strncmp(tmpPtr,
+                                    "IF_SERVER_CLASS",
+                                    strlen("IF_SERVER_CLASS"))) {
+                    tmpPtr += strcspn(tmpPtr, whiteSpace);
+                    if (*tmpPtr != 0) {
+                        tmpPtr += strspn(tmpPtr, whiteSpace);
+                    }
+                    if (*tmpPtr == 0) {
+                        fprintf(stderr, "Warning: missing server class VM on line %d of `%s'\n",
+                                lineno, jvmCfgName);
+                    } else {
+                        /* Null terminate server class VM name */
+                        serverClassVMName = tmpPtr;
+                        tmpPtr += strcspn(tmpPtr, whiteSpace);
+                        *tmpPtr = 0;
+                        vmType = VM_IF_SERVER_CLASS;
+                    }
+                } else {
+                    fprintf(stderr, "Warning: unknown VM type on line %d of `%s'\n",
+                            lineno, &jvmCfgName[0]);
+                    vmType = VM_KNOWN;
+                }
+            }
+        }
+
+        if (_launcher_debug)
+            printf("jvm.cfg[%d] = ->%s<-\n", cnt, line);
+        if (vmType != VM_UNKNOWN) {
+            knownVMs[cnt].name = JLI_StringDup(line);
+            knownVMs[cnt].flag = vmType;
+            switch (vmType) {
+            default:
+                break;
+            case VM_ALIASED_TO:
+                knownVMs[cnt].alias = JLI_StringDup(altVMName);
+                if (_launcher_debug) {
+                    printf("    name: %s  vmType: %s  alias: %s\n",
+                           knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias);
+                }
+                break;
+            case VM_IF_SERVER_CLASS:
+                knownVMs[cnt].server_class = JLI_StringDup(serverClassVMName);
+                if (_launcher_debug) {
+                    printf("    name: %s  vmType: %s  server_class: %s\n",
+                           knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class);
+                }
+                break;
+            }
+            cnt++;
+        }
+    }
+    fclose(jvmCfg);
+    knownVMsCount = cnt;
+
+    if (_launcher_debug) {
+        end   = CounterGet();
+        printf("%ld micro seconds to parse jvm.cfg\n",
+               (long)(jint)Counter2Micros(end-start));
+    }
+
+    return cnt;
+}
+
+
+static void
+GrowKnownVMs(int minimum)
+{
+    struct vmdesc* newKnownVMs;
+    int newMax;
+
+    newMax = (knownVMsLimit == 0 ? INIT_MAX_KNOWN_VMS : (2 * knownVMsLimit));
+    if (newMax <= minimum) {
+        newMax = minimum;
+    }
+    newKnownVMs = (struct vmdesc*) JLI_MemAlloc(newMax * sizeof(struct vmdesc));
+    if (knownVMs != NULL) {
+        memcpy(newKnownVMs, knownVMs, knownVMsLimit * sizeof(struct vmdesc));
+    }
+    JLI_MemFree(knownVMs);
+    knownVMs = newKnownVMs;
+    knownVMsLimit = newMax;
+}
+
+
+/* Returns index of VM or -1 if not found */
+static int
+KnownVMIndex(const char* name)
+{
+    int i;
+    if (strncmp(name, "-J", 2) == 0) name += 2;
+    for (i = 0; i < knownVMsCount; i++) {
+        if (!strcmp(name, knownVMs[i].name)) {
+            return i;
+        }
+    }
+    return -1;
+}
+
+static void
+FreeKnownVMs()
+{
+    int i;
+    for (i = 0; i < knownVMsCount; i++) {
+        JLI_MemFree(knownVMs[i].name);
+        knownVMs[i].name = NULL;
+    }
+    JLI_MemFree(knownVMs);
+}
+
+
+/*
+ * Displays the splash screen according to the jar file name
+ * and image file names stored in environment variables
+ */
+static void
+ShowSplashScreen()
+{
+    const char *jar_name = getenv(SPLASH_JAR_ENV_ENTRY);
+    const char *file_name = getenv(SPLASH_FILE_ENV_ENTRY);
+    int data_size;
+    void *image_data;
+    if (jar_name) {
+        image_data = JLI_JarUnpackFile(jar_name, file_name, &data_size);
+        if (image_data) {
+            DoSplashInit();
+            DoSplashLoadMemory(image_data, data_size);
+            JLI_MemFree(image_data);
+        }
+    } else if (file_name) {
+        DoSplashInit();
+        DoSplashLoadFile(file_name);
+    } else {
+        return;
+    }
+    DoSplashSetFileJarName(file_name, jar_name);
+}
+
+#endif /* ifndef GAMMA */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/launcher/java.h	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+
+#ifndef _JAVA_H_
+#define _JAVA_H_
+
+/*
+ * Get system specific defines.
+ */
+#include "jni.h"
+#include "java_md.h"
+#include "jli_util.h"
+
+/*
+ * Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
+ */
+typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
+typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
+
+typedef struct {
+    CreateJavaVM_t CreateJavaVM;
+    GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs;
+} InvocationFunctions;
+
+/*
+ * Prototypes for launcher functions in the system specific java_md.c.
+ */
+
+jboolean
+LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn);
+
+void
+GetXUsagePath(char *buf, jint bufsize);
+
+jboolean
+GetApplicationHome(char *buf, jint bufsize);
+
+const char *
+GetArch();
+
+void CreateExecutionEnvironment(int *_argc,
+                                       char ***_argv,
+                                       char jrepath[],
+                                       jint so_jrepath,
+                                       char jvmpath[],
+                                       jint so_jvmpath,
+                                       char **original_argv);
+
+/*
+ * Report an error message to stderr or a window as appropriate.  The
+ * flag always is set to JNI_TRUE if message is to be reported to both
+ * strerr and windows and set to JNI_FALSE if the message should only
+ * be sent to a window.
+ */
+void ReportErrorMessage(char * message, jboolean always);
+void ReportErrorMessage2(char * format, char * string, jboolean always);
+
+/*
+ * Report an exception which terminates the vm to stderr or a window
+ * as appropriate.
+ */
+void ReportExceptionDescription(JNIEnv * env);
+
+jboolean RemovableMachineDependentOption(char * option);
+void PrintMachineDependentOptions();
+
+const char *jlong_format_specifier();
+/*
+ * Block current thread and continue execution in new thread
+ */
+int ContinueInNewThread(int (JNICALL *continuation)(void *),
+                        jlong stack_size, void * args);
+
+/* sun.java.launcher.* platform properties. */
+void SetJavaLauncherPlatformProps(void);
+
+/*
+ * Functions defined in java.c and used in java_md.c.
+ */
+jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative);
+char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
+void AddOption(char *str, void *info);
+
+/*
+ * Make launcher spit debug output.
+ */
+extern jboolean _launcher_debug;
+
+#endif /* _JAVA_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/launcher/jli_util.c	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,89 @@
+
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "jli_util.h"
+
+#ifdef GAMMA
+#ifdef TARGET_OS_FAMILY_windows
+#define strdup _strdup
+#endif
+#endif
+
+/*
+ * Returns a pointer to a block of at least 'size' bytes of memory.
+ * Prints error message and exits if the memory could not be allocated.
+ */
+void *
+JLI_MemAlloc(size_t size)
+{
+    void *p = malloc(size);
+    if (p == 0) {
+        perror("malloc");
+        exit(1);
+    }
+    return p;
+}
+
+/*
+ * Equivalent to realloc(size).
+ * Prints error message and exits if the memory could not be reallocated.
+ */
+void *
+JLI_MemRealloc(void *ptr, size_t size)
+{
+    void *p = realloc(ptr, size);
+    if (p == 0) {
+        perror("realloc");
+        exit(1);
+    }
+    return p;
+}
+
+/*
+ * Wrapper over strdup(3C) which prints an error message and exits if memory
+ * could not be allocated.
+ */
+char *
+JLI_StringDup(const char *s1)
+{
+    char *s = strdup(s1);
+    if (s == NULL) {
+        perror("strdup");
+        exit(1);
+    }
+    return s;
+}
+
+/*
+ * Very equivalent to free(ptr).
+ * Here to maintain pairing with the above routines.
+ */
+void
+JLI_MemFree(void *ptr)
+{
+    free(ptr);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/launcher/jli_util.h	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef _JLI_UTIL_H
+#define _JLI_UTIL_H
+
+#include <stdlib.h>
+
+void *JLI_MemAlloc(size_t size);
+void *JLI_MemRealloc(void *ptr, size_t size);
+char *JLI_StringDup(const char *s1);
+void  JLI_MemFree(void *ptr);
+
+#endif  /* _JLI_UTIL_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/launcher/wildcard.c	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,494 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * Class-Path Wildcards
+ *
+ * The syntax for wildcards is a single asterisk. The class path
+ * foo/"*", e.g., loads all jar files in the directory named foo.
+ * (This requires careful quotation when used in shell scripts.)
+ *
+ * Only files whose names end in .jar or .JAR are matched.
+ * Files whose names end in .zip, or which have a particular
+ * magic number, regardless of filename extension, are not
+ * matched.
+ *
+ * Files are considered regardless of whether or not they are
+ * "hidden" in the UNIX sense, i.e., have names beginning with '.'.
+ *
+ * A wildcard only matches jar files, not class files in the same
+ * directory.  If you want to load both class files and jar files from
+ * a single directory foo then you can say foo:foo/"*", or foo/"*":foo
+ * if you want the jar files to take precedence.
+ *
+ * Subdirectories are not searched recursively, i.e., foo/"*" only
+ * looks for jar files in foo, not in foo/bar, foo/baz, etc.
+ *
+ * Expansion of wildcards is done early, prior to the invocation of a
+ * program's main method, rather than late, during the class-loading
+ * process itself.  Each element of the input class path containing a
+ * wildcard is replaced by the (possibly empty) sequence of elements
+ * generated by enumerating the jar files in the named directory.  If
+ * the directory foo contains a.jar, b.jar, and c.jar,
+ * e.g., then the class path foo/"*" is expanded into
+ * foo/a.jar:foo/b.jar:foo/c.jar, and that string would be the value
+ * of the system property java.class.path.
+ *
+ * The order in which the jar files in a directory are enumerated in
+ * the expanded class path is not specified and may vary from platform
+ * to platform and even from moment to moment on the same machine.  A
+ * well-constructed application should not depend upon any particular
+ * order.  If a specific order is required then the jar files can be
+ * enumerated explicitly in the class path.
+ *
+ * The CLASSPATH environment variable is not treated any differently
+ * from the -classpath (equiv. -cp) command-line option,
+ * i.e. wildcards are honored in all these cases.
+ *
+ * Class-path wildcards are not honored in the Class-Path jar-manifest
+ * header.
+ *
+ * Class-path wildcards are honored not only by the Java launcher but
+ * also by most other command-line tools that accept class paths, and
+ * in particular by javac and javadoc.
+ *
+ * Class-path wildcards are not honored in any other kind of path, and
+ * especially not in the bootstrap class path, which is a mere
+ * artifact of our implementation and not something that developers
+ * should use.
+ *
+ * Classpath wildcards are only expanded in the Java launcher code,
+ * supporting the use of wildcards on the command line and in the
+ * CLASSPATH environment variable.  We do not support the use of
+ * wildcards by applications that embed the JVM.
+ */
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include "java.h"       /* Strictly for PATH_SEPARATOR/FILE_SEPARATOR */
+#include "jli_util.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#else /* Unix */
+#include <unistd.h>
+#include <dirent.h>
+#endif /* Unix */
+
+static int
+exists(const char* filename)
+{
+#ifdef _WIN32
+    return _access(filename, 0) == 0;
+#else
+    return access(filename, F_OK) == 0;
+#endif
+}
+
+#define NEW_(TYPE) ((TYPE) JLI_MemAlloc(sizeof(struct TYPE##_)))
+
+/*
+ * Wildcard directory iteration.
+ * WildcardIterator_for(wildcard) returns an iterator.
+ * Each call to that iterator's next() method returns the basename
+ * of an entry in the wildcard's directory.  The basename's memory
+ * belongs to the iterator.  The caller is responsible for prepending
+ * the directory name and file separator, if necessary.
+ * When done with the iterator, call the close method to clean up.
+ */
+typedef struct WildcardIterator_* WildcardIterator;
+
+#ifdef _WIN32
+struct WildcardIterator_
+{
+    HANDLE handle;
+    char *firstFile; /* Stupid FindFirstFile...FindNextFile */
+};
+
+static WildcardIterator
+WildcardIterator_for(const char *wildcard)
+{
+    WIN32_FIND_DATA find_data;
+    WildcardIterator it = NEW_(WildcardIterator);
+    HANDLE handle = FindFirstFile(wildcard, &find_data);
+    if (handle == INVALID_HANDLE_VALUE)
+        return NULL;
+    it->handle = handle;
+    it->firstFile = find_data.cFileName;
+    return it;
+}
+
+static char *
+WildcardIterator_next(WildcardIterator it)
+{
+    WIN32_FIND_DATA find_data;
+    if (it->firstFile != NULL) {
+        char *firstFile = it->firstFile;
+        it->firstFile = NULL;
+        return firstFile;
+    }
+    return FindNextFile(it->handle, &find_data)
+        ? find_data.cFileName : NULL;
+}
+
+static void
+WildcardIterator_close(WildcardIterator it)
+{
+    if (it) {
+        FindClose(it->handle);
+        JLI_MemFree(it->firstFile);
+        JLI_MemFree(it);
+    }
+}
+
+#else /* Unix */
+struct WildcardIterator_
+{
+    DIR *dir;
+};
+
+static WildcardIterator
+WildcardIterator_for(const char *wildcard)
+{
+    DIR *dir;
+    int wildlen = strlen(wildcard);
+    if (wildlen < 2) {
+        dir = opendir(".");
+    } else {
+        char *dirname = JLI_StringDup(wildcard);
+        dirname[wildlen - 1] = '\0';
+        dir = opendir(dirname);
+        JLI_MemFree(dirname);
+    }
+    if (dir == NULL)
+        return NULL;
+    else {
+        WildcardIterator it = NEW_(WildcardIterator);
+        it->dir = dir;
+        return it;
+    }
+}
+
+static char *
+WildcardIterator_next(WildcardIterator it)
+{
+    struct dirent* dirp = readdir(it->dir);
+    return dirp ? dirp->d_name : NULL;
+}
+
+static void
+WildcardIterator_close(WildcardIterator it)
+{
+    if (it) {
+        closedir(it->dir);
+        JLI_MemFree(it);
+    }
+}
+#endif /* Unix */
+
+static int
+equal(const char *s1, const char *s2)
+{
+    return strcmp(s1, s2) == 0;
+}
+
+/*
+ * FileList ADT - a dynamic list of C filenames
+ */
+struct FileList_
+{
+    char **files;
+    int size;
+    int capacity;
+};
+typedef struct FileList_ *FileList;
+
+static FileList
+FileList_new(int capacity)
+{
+    FileList fl = NEW_(FileList);
+    fl->capacity = capacity;
+    fl->files = (char **) JLI_MemAlloc(capacity * sizeof(fl->files[0]));
+    fl->size = 0;
+    return fl;
+}
+
+#ifdef DEBUG_WILDCARD
+static void
+FileList_print(FileList fl)
+{
+    int i;
+    putchar('[');
+    for (i = 0; i < fl->size; i++) {
+        if (i > 0) printf(", ");
+        printf("\"%s\"",fl->files[i]);
+    }
+    putchar(']');
+}
+#endif
+
+static void
+FileList_free(FileList fl)
+{
+    if (fl) {
+        if (fl->files) {
+            int i;
+            for (i = 0; i < fl->size; i++)
+                JLI_MemFree(fl->files[i]);
+            JLI_MemFree(fl->files);
+        }
+        JLI_MemFree(fl);
+    }
+}
+
+static void
+FileList_ensureCapacity(FileList fl, int capacity)
+{
+    if (fl->capacity < capacity) {
+        while (fl->capacity < capacity)
+            fl->capacity *= 2;
+        fl->files = JLI_MemRealloc(fl->files,
+                               fl->capacity * sizeof(fl->files[0]));
+    }
+}
+
+static void
+FileList_add(FileList fl, char *file)
+{
+    FileList_ensureCapacity(fl, fl->size+1);
+    fl->files[fl->size++] = file;
+}
+
+static void
+FileList_addSubstring(FileList fl, const char *beg, int len)
+{
+    char *filename = (char *) JLI_MemAlloc(len+1);
+    memcpy(filename, beg, len);
+    filename[len] = '\0';
+    FileList_ensureCapacity(fl, fl->size+1);
+    fl->files[fl->size++] = filename;
+}
+
+static char *
+FileList_join(FileList fl, char sep)
+{
+    int i;
+    int size;
+    char *path;
+    char *p;
+    for (i = 0, size = 1; i < fl->size; i++)
+        size += strlen(fl->files[i]) + 1;
+
+    path = JLI_MemAlloc(size);
+
+    for (i = 0, p = path; i < fl->size; i++) {
+        int len = strlen(fl->files[i]);
+        if (i > 0) *p++ = sep;
+        memcpy(p, fl->files[i], len);
+        p += len;
+    }
+    *p = '\0';
+
+    return path;
+}
+
+static FileList
+FileList_split(const char *path, char sep)
+{
+    const char *p, *q;
+    int len = strlen(path);
+    int count;
+    FileList fl;
+    for (count = 1, p = path; p < path + len; p++)
+        count += (*p == sep);
+    fl = FileList_new(count);
+    for (p = path;;) {
+        for (q = p; q <= path + len; q++) {
+            if (*q == sep || *q == '\0') {
+                FileList_addSubstring(fl, p, q - p);
+                if (*q == '\0')
+                    return fl;
+                p = q + 1;
+            }
+        }
+    }
+}
+
+static int
+isJarFileName(const char *filename)
+{
+    int len = strlen(filename);
+    return (len >= 4) &&
+        (filename[len - 4] == '.') &&
+        (equal(filename + len - 3, "jar") ||
+         equal(filename + len - 3, "JAR")) &&
+        /* Paranoia: Maybe filename is "DIR:foo.jar" */
+        (strchr(filename, PATH_SEPARATOR) == NULL);
+}
+
+static char *
+wildcardConcat(const char *wildcard, const char *basename)
+{
+    int wildlen = strlen(wildcard);
+    int baselen = strlen(basename);
+    char *filename = (char *) JLI_MemAlloc(wildlen + baselen);
+    /* Replace the trailing '*' with basename */
+    memcpy(filename, wildcard, wildlen-1);
+    memcpy(filename+wildlen-1, basename, baselen+1);
+    return filename;
+}
+
+static FileList
+wildcardFileList(const char *wildcard)
+{
+    const char *basename;
+    FileList fl = FileList_new(16);
+    WildcardIterator it = WildcardIterator_for(wildcard);
+    if (it == NULL)
+        return NULL;
+    while ((basename = WildcardIterator_next(it)) != NULL)
+        if (isJarFileName(basename))
+            FileList_add(fl, wildcardConcat(wildcard, basename));
+    WildcardIterator_close(it);
+    return fl;
+}
+
+static int
+isWildcard(const char *filename)
+{
+    int len = strlen(filename);
+    return (len > 0) &&
+        (filename[len - 1] == '*') &&
+        (len == 1 || IS_FILE_SEPARATOR(filename[len - 2])) &&
+        (! exists(filename));
+}
+
+static void
+FileList_expandWildcards(FileList fl)
+{
+    int i, j;
+    for (i = 0; i < fl->size; i++) {
+        if (isWildcard(fl->files[i])) {
+            FileList expanded = wildcardFileList(fl->files[i]);
+            if (expanded != NULL && expanded->size > 0) {
+                JLI_MemFree(fl->files[i]);
+                FileList_ensureCapacity(fl, fl->size + expanded->size);
+                for (j = fl->size - 1; j >= i+1; j--)
+                    fl->files[j+expanded->size-1] = fl->files[j];
+                for (j = 0; j < expanded->size; j++)
+                    fl->files[i+j] = expanded->files[j];
+                i += expanded->size - 1;
+                fl->size += expanded->size - 1;
+                /* fl expropriates expanded's elements. */
+                expanded->size = 0;
+            }
+            FileList_free(expanded);
+        }
+    }
+}
+
+const char *
+JLI_WildcardExpandClasspath(const char *classpath)
+{
+    char *expanded;
+    FileList fl;
+
+    if (strchr(classpath, '*') == NULL)
+        return classpath;
+    fl = FileList_split(classpath, PATH_SEPARATOR);
+    FileList_expandWildcards(fl);
+    expanded = FileList_join(fl, PATH_SEPARATOR);
+    FileList_free(fl);
+    if (getenv("_JAVA_LAUNCHER_DEBUG") != 0)
+        printf("Expanded wildcards:\n"
+               "    before: \"%s\"\n"
+               "    after : \"%s\"\n",
+               classpath, expanded);
+    return expanded;
+}
+
+#ifdef DEBUG_WILDCARD
+static void
+wildcardExpandArgv(const char ***argv)
+{
+    int i;
+    for (i = 0; (*argv)[i]; i++) {
+        if (equal((*argv)[i], "-cp") ||
+            equal((*argv)[i], "-classpath")) {
+            i++;
+            (*argv)[i] = wildcardExpandClasspath((*argv)[i]);
+        }
+    }
+}
+
+static void
+debugPrintArgv(char *argv[])
+{
+    int i;
+    putchar('[');
+    for (i = 0; argv[i]; i++) {
+        if (i > 0) printf(", ");
+        printf("\"%s\"", argv[i]);
+    }
+    printf("]\n");
+}
+
+int
+main(int argc, char *argv[])
+{
+    argv[0] = "java";
+    wildcardExpandArgv((const char***)&argv);
+    debugPrintArgv(argv);
+    /* execvp("java", argv); */
+    return 0;
+}
+#endif /* DEBUG_WILDCARD */
+
+/* Cute little perl prototype implementation....
+
+my $sep = ($^O =~ /^(Windows|cygwin)/) ? ";" : ":";
+
+sub expand($) {
+  opendir DIR, $_[0] or return $_[0];
+  join $sep, map {"$_[0]/$_"} grep {/\.(jar|JAR)$/} readdir DIR;
+}
+
+sub munge($) {
+  join $sep,
+    map {(! -r $_ and s/[\/\\]+\*$//) ? expand $_ : $_} split $sep, $_[0];
+}
+
+for (my $i = 0; $i < @ARGV - 1; $i++) {
+  $ARGV[$i+1] = munge $ARGV[$i+1] if $ARGV[$i] =~ /^-c(p|lasspath)$/;
+}
+
+$ENV{CLASSPATH} = munge $ENV{CLASSPATH} if exists $ENV{CLASSPATH};
+@ARGV = ("java", @ARGV);
+print "@ARGV\n";
+exec @ARGV;
+
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/launcher/wildcard.h	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef WILDCARD_H_
+#define WILDCARD_H_
+
+#ifdef EXPAND_CLASSPATH_WILDCARDS
+const char *JLI_WildcardExpandClasspath(const char *classpath);
+#else
+#define JLI_WildcardExpandClasspath(s) (s)
+#endif
+
+#endif /* include guard */
--- a/src/share/vm/adlc/adlc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/adlc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_ADLC_HPP
+#define SHARE_VM_ADLC_ADLC_HPP
+
 //
 // Standard include file for ADLC parser
 //
@@ -77,18 +80,19 @@
 #define uint32 unsigned int
 #define uint   unsigned int
 
+// VM components
+#include "opto/opcodes.hpp"
+
 // Macros
 // Debugging note:  Put a breakpoint on "abort".
 #undef assert
 #define assert(cond, msg) { if (!(cond)) { fprintf(stderr, "assert fails %s %d: %s\n", __FILE__, __LINE__, msg); abort(); }}
+#undef max
 #define max(a, b)   (((a)>(b)) ? (a) : (b))
 
-// VM components
-#include "opcodes.hpp"
-
 // ADLC components
 #include "arena.hpp"
-#include "adlcVMDeps.hpp"
+#include "opto/adlcVMDeps.hpp"
 #include "filebuff.hpp"
 #include "dict2.hpp"
 #include "forms.hpp"
@@ -101,3 +105,5 @@
 // could have a backpointer to the AD but it's too complicated to pass
 // it everywhere it needs to be available.
 extern ArchDesc* globalAD;
+
+#endif // SHARE_VM_ADLC_ADLC_HPP
--- a/src/share/vm/adlc/adlparse.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/adlparse.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
     if (ident == NULL) {         // Empty line
       continue;                  // Get the next line
     }
-    if (!strcmp(ident, "instruct"))        instr_parse();
+         if (!strcmp(ident, "instruct"))   instr_parse();
     else if (!strcmp(ident, "operand"))    oper_parse();
     else if (!strcmp(ident, "opclass"))    opclass_parse();
     else if (!strcmp(ident, "ins_attrib")) ins_attr_parse();
@@ -216,24 +216,23 @@
     else if (!strcmp(ident, "encode"))  {
       parse_err(SYNERR, "Instructions specify ins_encode, not encode\n");
     }
-    else if (!strcmp(ident, "ins_encode"))
-      instr->_insencode = ins_encode_parse(*instr);
-    else if (!strcmp(ident, "opcode"))  instr->_opcode = opcode_parse(instr);
-    else if (!strcmp(ident, "size"))    instr->_size = size_parse(instr);
-    else if (!strcmp(ident, "effect"))  effect_parse(instr);
-    else if (!strcmp(ident, "expand"))  instr->_exprule = expand_parse(instr);
-    else if (!strcmp(ident, "rewrite")) instr->_rewrule = rewrite_parse();
+    else if (!strcmp(ident, "ins_encode"))     ins_encode_parse(*instr);
+    else if (!strcmp(ident, "opcode"))         instr->_opcode    = opcode_parse(instr);
+    else if (!strcmp(ident, "size"))           instr->_size      = size_parse(instr);
+    else if (!strcmp(ident, "effect"))         effect_parse(instr);
+    else if (!strcmp(ident, "expand"))         instr->_exprule   = expand_parse(instr);
+    else if (!strcmp(ident, "rewrite"))        instr->_rewrule   = rewrite_parse();
     else if (!strcmp(ident, "constraint")) {
       parse_err(SYNERR, "Instructions do not specify a constraint\n");
     }
     else if (!strcmp(ident, "construct")) {
       parse_err(SYNERR, "Instructions do not specify a construct\n");
     }
-    else if (!strcmp(ident, "format"))  instr->_format  = format_parse();
+    else if (!strcmp(ident, "format"))         instr->_format    = format_parse();
     else if (!strcmp(ident, "interface")) {
       parse_err(SYNERR, "Instructions do not specify an interface\n");
     }
-    else if (!strcmp(ident, "ins_pipe")) ins_pipe_parse(*instr);
+    else if (!strcmp(ident, "ins_pipe"))        ins_pipe_parse(*instr);
     else {  // Done with staticly defined parts of instruction definition
       // Check identifier to see if it is the name of an attribute
       const Form    *form = _globalNames[ident];
@@ -323,7 +322,8 @@
       const char *optype2  = NULL;
       // Can not have additional base operands in right side of match!
       if ( ! right->base_operand( position, _globalNames, result2, name2, optype2) ) {
-        assert( instr->_predicate == NULL, "ADLC does not support instruction chain rules with predicates");
+        if (instr->_predicate != NULL)
+          parse_err(SYNERR, "ADLC does not support instruction chain rules with predicates");
         // Chain from input  _ideal_operand_type_,
         // Needed for shared roots of match-trees
         ChainList *lst = (ChainList *)_AD._chainRules[optype];
@@ -935,9 +935,9 @@
     // (2)
     // If we are at a replacement variable,
     // copy it and record in EncClass
-    if ( _curchar == '$' ) {
+    if (_curchar == '$') {
       // Found replacement Variable
-      char *rep_var = get_rep_var_ident_dup();
+      char* rep_var = get_rep_var_ident_dup();
       // Add flag to _strings list indicating we should check _rep_vars
       encoding->add_rep_var(rep_var);
     }
@@ -2774,47 +2774,122 @@
 
 //------------------------------ins_encode_parse_block-------------------------
 // Parse the block form of ins_encode.  See ins_encode_parse for more details
-InsEncode *ADLParser::ins_encode_parse_block(InstructForm &inst) {
+void ADLParser::ins_encode_parse_block(InstructForm& inst) {
   // Create a new encoding name based on the name of the instruction
   // definition, which should be unique.
-  const char * prefix = "__enc_";
-  char* ec_name = (char*)malloc(strlen(inst._ident) + strlen(prefix) + 1);
+  const char* prefix = "__ins_encode_";
+  char* ec_name = (char*) malloc(strlen(inst._ident) + strlen(prefix) + 1);
   sprintf(ec_name, "%s%s", prefix, inst._ident);
 
   assert(_AD._encode->encClass(ec_name) == NULL, "shouldn't already exist");
-  EncClass  *encoding = _AD._encode->add_EncClass(ec_name);
+  EncClass* encoding = _AD._encode->add_EncClass(ec_name);
   encoding->_linenum = linenum();
 
   // synthesize the arguments list for the enc_class from the
   // arguments to the instruct definition.
-  const char * param = NULL;
+  const char* param = NULL;
   inst._parameters.reset();
   while ((param = inst._parameters.iter()) != NULL) {
-    OperandForm *opForm = (OperandForm*)inst._localNames[param];
+    OperandForm* opForm = (OperandForm*) inst._localNames[param];
     encoding->add_parameter(opForm->_ident, param);
   }
 
-  // Add the prologue to create the MacroAssembler
-  encoding->add_code("\n"
-  "    // Define a MacroAssembler instance for use by the encoding.  The\n"
-  "    // name is chosen to match the __ idiom used for assembly in other\n"
-  "    // parts of hotspot and assumes the existence of the standard\n"
-  "    // #define __ _masm.\n"
-  "    MacroAssembler _masm(&cbuf);\n");
+  // Define a MacroAssembler instance for use by the encoding.  The
+  // name is chosen to match the __ idiom used for assembly in other
+  // parts of hotspot and assumes the existence of the standard
+  // #define __ _masm.
+  encoding->add_code("    MacroAssembler _masm(&cbuf);\n");
 
   // Parse the following %{ }% block
-  enc_class_parse_block(encoding, ec_name);
+  ins_encode_parse_block_impl(inst, encoding, ec_name);
 
   // Build an encoding rule which invokes the encoding rule we just
   // created, passing all arguments that we received.
-  InsEncode *encrule  = new InsEncode(); // Encode class for instruction
-  NameAndList *params = encrule->add_encode(ec_name);
+  InsEncode*   encrule = new InsEncode(); // Encode class for instruction
+  NameAndList* params  = encrule->add_encode(ec_name);
   inst._parameters.reset();
   while ((param = inst._parameters.iter()) != NULL) {
     params->add_entry(param);
   }
 
-  return encrule;
+  // Set encode class of this instruction.
+  inst._insencode = encrule;
+}
+
+
+void ADLParser::ins_encode_parse_block_impl(InstructForm& inst, EncClass* encoding, char* ec_name) {
+  skipws_no_preproc();              // Skip leading whitespace
+  // Prepend location descriptor, for debugging; cf. ADLParser::find_cpp_block
+  if (_AD._adlocation_debug) {
+    encoding->add_code(get_line_string());
+  }
+
+  // Collect the parts of the encode description
+  // (1) strings that are passed through to output
+  // (2) replacement/substitution variable, preceeded by a '$'
+  while ((_curchar != '%') && (*(_ptr+1) != '}')) {
+
+    // (1)
+    // Check if there is a string to pass through to output
+    char *start = _ptr;       // Record start of the next string
+    while ((_curchar != '$') && ((_curchar != '%') || (*(_ptr+1) != '}')) ) {
+      // If at the start of a comment, skip past it
+      if( (_curchar == '/') && ((*(_ptr+1) == '/') || (*(_ptr+1) == '*')) ) {
+        skipws_no_preproc();
+      } else {
+        // ELSE advance to the next character, or start of the next line
+        next_char_or_line();
+      }
+    }
+    // If a string was found, terminate it and record in EncClass
+    if (start != _ptr) {
+      *_ptr = '\0';          // Terminate the string
+      encoding->add_code(start);
+    }
+
+    // (2)
+    // If we are at a replacement variable,
+    // copy it and record in EncClass
+    if (_curchar == '$') {
+      // Found replacement Variable
+      char* rep_var = get_rep_var_ident_dup();
+
+      // Add flag to _strings list indicating we should check _rep_vars
+      encoding->add_rep_var(rep_var);
+
+      skipws();
+
+      // Check if this instruct is a MachConstantNode.
+      if (strcmp(rep_var, "constanttablebase") == 0) {
+        // This instruct is a MachConstantNode.
+        inst.set_is_mach_constant(true);
+
+        if (_curchar == '(')  {
+          parse_err(SYNERR, "constanttablebase in instruct %s cannot have an argument (only constantaddress and constantoffset)", ec_name);
+          return;
+        }
+      }
+      else if ((strcmp(rep_var, "constantaddress")   == 0) ||
+               (strcmp(rep_var, "constantoffset")    == 0)) {
+        // This instruct is a MachConstantNode.
+        inst.set_is_mach_constant(true);
+
+        // If the constant keyword has an argument, parse it.
+        if (_curchar == '(')  constant_parse(inst);
+      }
+    }
+  } // end while part of format description
+  next_char();                      // Skip '%'
+  next_char();                      // Skip '}'
+
+  skipws();
+
+  if (_AD._adlocation_debug) {
+    encoding->add_code(end_line_marker());
+  }
+
+  // Debug Stuff
+  if (_AD._adl_debug > 1)  fprintf(stderr, "EncodingClass Form: %s\n", ec_name);
 }
 
 
@@ -2838,7 +2913,7 @@
 //
 //  making it more compact to take advantage of the MacroAssembler and
 //  placing the assembly closer to it's use by instructions.
-InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) {
+void ADLParser::ins_encode_parse(InstructForm& inst) {
 
   // Parse encode class name
   skipws();                        // Skip whitespace
@@ -2849,11 +2924,12 @@
       next_char();                      // Skip '{'
 
       // Parse the block form of ins_encode
-      return ins_encode_parse_block(inst);
+      ins_encode_parse_block(inst);
+      return;
     }
 
     parse_err(SYNERR, "missing '%%{' or '(' in ins_encode definition\n");
-    return NULL;
+    return;
   }
   next_char();                     // move past '('
   skipws();
@@ -2866,7 +2942,7 @@
     ec_name = get_ident();
     if (ec_name == NULL) {
       parse_err(SYNERR, "Invalid encode class name after 'ins_encode('.\n");
-      return NULL;
+      return;
     }
     // Check that encoding is defined in the encode section
     EncClass *encode_class = _AD._encode->encClass(ec_name);
@@ -2898,7 +2974,7 @@
                (Opcode::as_opcode_type(param) == Opcode::NOT_AN_OPCODE) &&
                ((_AD._register == NULL ) || (_AD._register->getRegDef(param) == NULL)) ) {
             parse_err(SYNERR, "Using non-locally defined parameter %s for encoding %s.\n", param, ec_name);
-            return NULL;
+            return;
           }
           params->add_entry(param);
 
@@ -2915,7 +2991,7 @@
             // Only ',' or ')' are valid after a parameter name
             parse_err(SYNERR, "expected ',' or ')' after parameter %s.\n",
                       ec_name);
-            return NULL;
+            return;
           }
 
         } else {
@@ -2923,11 +2999,11 @@
           // Did not find a parameter
           if (_curchar == ',') {
             parse_err(SYNERR, "Expected encode parameter before ',' in encoding %s.\n", ec_name);
-            return NULL;
+            return;
           }
           if (_curchar != ')') {
             parse_err(SYNERR, "Expected ')' after encode parameters.\n");
-            return NULL;
+            return;
           }
         }
       } // WHILE loop collecting parameters
@@ -2944,7 +3020,7 @@
     else if ( _curchar != ')' ) {
       // If not a ',' then only a ')' is allowed
       parse_err(SYNERR, "Expected ')' after encoding %s.\n", ec_name);
-      return NULL;
+      return;
     }
 
     // Check for ',' separating parameters
@@ -2956,14 +3032,14 @@
   } // done parsing ins_encode methods and their parameters
   if (_curchar != ')') {
     parse_err(SYNERR, "Missing ')' at end of ins_encode description.\n");
-    return NULL;
+    return;
   }
   next_char();                     // move past ')'
   skipws();                        // Skip leading whitespace
 
   if ( _curchar != ';' ) {
     parse_err(SYNERR, "Missing ';' at end of ins_encode.\n");
-    return NULL;
+    return;
   }
   next_char();                     // move past ';'
   skipws();                        // be friendly to oper_parse()
@@ -2971,7 +3047,113 @@
   // Debug Stuff
   if (_AD._adl_debug > 1) fprintf(stderr,"Instruction Encode: %s\n", ec_name);
 
-  return encrule;
+  // Set encode class of this instruction.
+  inst._insencode = encrule;
+}
+
+
+//------------------------------constant_parse---------------------------------
+// Parse a constant expression.
+void ADLParser::constant_parse(InstructForm& inst) {
+  // Create a new encoding name based on the name of the instruction
+  // definition, which should be unique.
+  const char* prefix = "__constant_";
+  char* ec_name = (char*) malloc(strlen(inst._ident) + strlen(prefix) + 1);
+  sprintf(ec_name, "%s%s", prefix, inst._ident);
+
+  assert(_AD._encode->encClass(ec_name) == NULL, "shouldn't already exist");
+  EncClass* encoding = _AD._encode->add_EncClass(ec_name);
+  encoding->_linenum = linenum();
+
+  // synthesize the arguments list for the enc_class from the
+  // arguments to the instruct definition.
+  const char* param = NULL;
+  inst._parameters.reset();
+  while ((param = inst._parameters.iter()) != NULL) {
+    OperandForm* opForm = (OperandForm*) inst._localNames[param];
+    encoding->add_parameter(opForm->_ident, param);
+  }
+
+  // Parse the following ( ) expression.
+  constant_parse_expression(encoding, ec_name);
+
+  // Build an encoding rule which invokes the encoding rule we just
+  // created, passing all arguments that we received.
+  InsEncode*   encrule = new InsEncode(); // Encode class for instruction
+  NameAndList* params  = encrule->add_encode(ec_name);
+  inst._parameters.reset();
+  while ((param = inst._parameters.iter()) != NULL) {
+    params->add_entry(param);
+  }
+
+  // Set encode class of this instruction.
+  inst._constant = encrule;
+}
+
+
+//------------------------------constant_parse_expression----------------------
+void ADLParser::constant_parse_expression(EncClass* encoding, char* ec_name) {
+  skipws();
+
+  // Prepend location descriptor, for debugging; cf. ADLParser::find_cpp_block
+  if (_AD._adlocation_debug) {
+    encoding->add_code(get_line_string());
+  }
+
+  // Start code line.
+  encoding->add_code("    _constant = C->constant_table().add");
+
+  // Parse everything in ( ) expression.
+  encoding->add_code("(");
+  next_char();  // Skip '('
+  int parens_depth = 1;
+
+  // Collect the parts of the constant expression.
+  // (1) strings that are passed through to output
+  // (2) replacement/substitution variable, preceeded by a '$'
+  while (parens_depth > 0) {
+    if (_curchar == '(') {
+      parens_depth++;
+      encoding->add_code("(");
+      next_char();
+    }
+    else if (_curchar == ')') {
+      parens_depth--;
+      encoding->add_code(")");
+      next_char();
+    }
+    else {
+      // (1)
+      // Check if there is a string to pass through to output
+      char *start = _ptr;  // Record start of the next string
+      while ((_curchar != '$') && (_curchar != '(') && (_curchar != ')')) {
+        next_char();
+      }
+      // If a string was found, terminate it and record in EncClass
+      if (start != _ptr) {
+        *_ptr = '\0';  // Terminate the string
+        encoding->add_code(start);
+      }
+
+      // (2)
+      // If we are at a replacement variable, copy it and record in EncClass.
+      if (_curchar == '$') {
+        // Found replacement Variable
+        char* rep_var = get_rep_var_ident_dup();
+        encoding->add_rep_var(rep_var);
+      }
+    }
+  }
+
+  // Finish code line.
+  encoding->add_code(";");
+
+  if (_AD._adlocation_debug) {
+    encoding->add_code(end_line_marker());
+  }
+
+  // Debug Stuff
+  if (_AD._adl_debug > 1)  fprintf(stderr, "EncodingClass Form: %s\n", ec_name);
 }
 
 
--- a/src/share/vm/adlc/adlparse.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/adlparse.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_ADLPARSE_HPP
+#define SHARE_VM_ADLC_ADLPARSE_HPP
+
 // ADLPARSE.HPP - Definitions for Architecture Description Language Parser
 // Authors: Chris Vick and Mike Paleczny
 
@@ -153,8 +156,13 @@
 
   Attribute     *attr_parse(char *ident);// Parse instr/operand attribute rule
   // Parse instruction encode rule
-  InsEncode     *ins_encode_parse(InstructForm &inst);
-  InsEncode     *ins_encode_parse_block(InstructForm &inst);
+  void           ins_encode_parse(InstructForm &inst);
+  void           ins_encode_parse_block(InstructForm &inst);
+  void           ins_encode_parse_block_impl(InstructForm& inst, EncClass* encoding, char* ec_name);
+
+  void           constant_parse(InstructForm& inst);
+  void           constant_parse_expression(EncClass* encoding, char* ec_name);
+
   Opcode        *opcode_parse(InstructForm *insr); // Parse instruction opcode
   char          *size_parse(InstructForm *insr); // Parse instruction size
   Interface     *interface_parse();      // Parse operand interface rule
@@ -277,3 +285,5 @@
   static bool equivalent_expressions(const char* str1, const char* str2);
   static void trim(char* &token);  // trim leading & trailing spaces
 };
+
+#endif // SHARE_VM_ADLC_ADLPARSE_HPP
--- a/src/share/vm/adlc/archDesc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/archDesc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
@@ -1038,22 +1038,38 @@
   fprintf(fp,"\n");
 }
 
-//---------------------------machineDependentIncludes--------------------------
-// output #include declarations for machine specific files
-void ArchDesc::machineDependentIncludes(ADLFILE &adlfile) {
-  const char *basename = adlfile._name;
-  const char *cp;
-  for (cp = basename; *cp; cp++)
-    if (*cp == '/')  basename = cp+1;
 
+//---------------------------addIncludeGuardStart--------------------------
+// output the start of an include guard.
+void ArchDesc::addIncludeGuardStart(ADLFILE &adlfile, const char* guardString) {
   // Build #include lines
   fprintf(adlfile._fp, "\n");
-  fprintf(adlfile._fp, "#include \"incls/_precompiled.incl\"\n");
-  fprintf(adlfile._fp, "#include \"incls/_%s.incl\"\n",basename);
+  fprintf(adlfile._fp, "#ifndef %s\n", guardString);
+  fprintf(adlfile._fp, "#define %s\n", guardString);
   fprintf(adlfile._fp, "\n");
 
 }
 
+//---------------------------addIncludeGuardEnd--------------------------
+// output the end of an include guard.
+void ArchDesc::addIncludeGuardEnd(ADLFILE &adlfile, const char* guardString) {
+  // Build #include lines
+  fprintf(adlfile._fp, "\n");
+  fprintf(adlfile._fp, "#endif // %s\n", guardString);
+
+}
+
+//---------------------------addInclude--------------------------
+// output the #include line for this file.
+void ArchDesc::addInclude(ADLFILE &adlfile, const char* fileName) {
+  fprintf(adlfile._fp, "#include \"%s\"\n", fileName);
+
+}
+
+void ArchDesc::addInclude(ADLFILE &adlfile, const char* includeDir, const char* fileName) {
+  fprintf(adlfile._fp, "#include \"%s/%s\"\n", includeDir, fileName);
+
+}
 
 //---------------------------addPreprocessorChecks-----------------------------
 // Output C preprocessor code to verify the backend compilation environment.
--- a/src/share/vm/adlc/archDesc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/archDesc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_ARCHDESC_HPP
+#define SHARE_VM_ADLC_ARCHDESC_HPP
+
 // Definitions for Error Flags
 #define  WARN   0
 #define  SYNERR 1
@@ -123,7 +126,6 @@
   void chain_rule(FILE *fp, const char *indent, const char *ideal,
                   const Expr *icost, const char *irule,
                   Dict &operands_chained_from, ProductionState &status);
-  void chain_rule_c(FILE *fp, char *indent, char *ideal, char *irule);  // %%%%% TODO: remove this
   void expand_opclass(FILE *fp, const char *indent, const Expr *cost,
                       const char *result_type, ProductionState &status);
   Expr *calc_cost(FILE *fp, const char *spaces, MatchList &mList, ProductionState &status);
@@ -274,8 +276,13 @@
 
   // output SUN copyright info
   void addSunCopyright(char* legal, int size, FILE *fp);
-  // output #include declarations for machine specific files
-  void machineDependentIncludes(ADLFILE &adlfile);
+  // output the start of an include guard.
+  void addIncludeGuardStart(ADLFILE &adlfile, const char* guardString);
+  // output the end of an include guard.
+  void addIncludeGuardEnd(ADLFILE &adlfile, const char* guardString);
+  // output the #include line for this file.
+  void addInclude(ADLFILE &adlfile, const char* fileName);
+  void addInclude(ADLFILE &adlfile, const char* includeDir, const char* fileName);
   // Output C preprocessor code to verify the backend compilation environment.
   void addPreprocessorChecks(FILE *fp);
   // Output C source and header (source_hpp) blocks.
@@ -293,13 +300,18 @@
   void buildMachNodeGenerator(FILE *fp_cpp);
 
   // Generator for Expand methods for instructions with expand rules
-  void defineExpand(FILE *fp, InstructForm *node);
+  void defineExpand      (FILE *fp, InstructForm *node);
   // Generator for Peephole methods for instructions with peephole rules
-  void definePeephole(FILE *fp, InstructForm *node);
+  void definePeephole    (FILE *fp, InstructForm *node);
   // Generator for Size methods for instructions
-  void defineSize(FILE *fp, InstructForm &node);
+  void defineSize        (FILE *fp, InstructForm &node);
+
+public:
+  // Generator for EvalConstantValue methods for instructions
+  void defineEvalConstant(FILE *fp, InstructForm &node);
   // Generator for Emit methods for instructions
-  void defineEmit(FILE *fp, InstructForm &node);
+  void defineEmit        (FILE *fp, InstructForm &node);
+
   // Define a MachOper encode method
   void define_oper_interface(FILE *fp, OperandForm &oper, FormDict &globals,
                              const char *name, const char *encoding);
@@ -387,3 +399,5 @@
   // Allow derived class to output name and position specific info
   virtual void record_position(OutputMap::position place, int index) {}
 };
+
+#endif // SHARE_VM_ADLC_ARCHDESC_HPP
--- a/src/share/vm/adlc/arena.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/arena.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/adlc/arena.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/arena.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_ARENA_HPP
+#define SHARE_VM_ADLC_ARENA_HPP
+
 // All classes in the virtual machine must be subclassed
 // by one of the following allocation classes:
 //
@@ -155,3 +158,5 @@
   size_t size_in_bytes() const         {  return _size_in_bytes; }
   void   set_size_in_bytes(size_t size)  { _size_in_bytes = size;   }
 };
+
+#endif // SHARE_VM_ADLC_ARENA_HPP
--- a/src/share/vm/adlc/dfa.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/dfa.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/adlc/dict2.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/dict2.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/adlc/dict2.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/dict2.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#ifndef _DICT_
-#define _DICT_
+#ifndef SHARE_VM_ADLC_DICT2_HPP
+#define SHARE_VM_ADLC_DICT2_HPP
+
 // Dictionaries - An Abstract Data Type
 
 
@@ -117,4 +118,4 @@
   int test(void) { return _i<_d->_size;} // Test for end of iteration
 };
 
-#endif // _DICT_
+#endif // SHARE_VM_ADLC_DICT2_HPP
--- a/src/share/vm/adlc/filebuff.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/filebuff.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/adlc/filebuff.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/filebuff.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_FILEBUFF_HPP
+#define SHARE_VM_ADLC_FILEBUFF_HPP
+
 // FILEBUFF.HPP - Definitions for parser file buffering routines
 #include <iostream>
 
@@ -99,3 +102,5 @@
   void print(ostream&);
   friend ostream& operator<< (ostream&, FileBuffRegion&);
 };
+
+#endif // SHARE_VM_ADLC_FILEBUFF_HPP
--- a/src/share/vm/adlc/forms.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/forms.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/adlc/forms.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/forms.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_FORMS_HPP
+#define SHARE_VM_ADLC_FORMS_HPP
+
 // FORMS.HPP - ADL Parser Generic and Utility Forms Classes
 
 #define TRUE 1
@@ -588,3 +591,5 @@
   void print_asserts(FILE *fp);
   void dump();
 };
+
+#endif // SHARE_VM_ADLC_FORMS_HPP
--- a/src/share/vm/adlc/formsopt.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/formsopt.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/adlc/formsopt.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/formsopt.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_FORMSOPT_HPP
+#define SHARE_VM_ADLC_FORMSOPT_HPP
+
 // FORMSOPT.HPP - ADL Parser Target Specific Optimization Forms Classes
 
 // Class List
@@ -546,3 +549,5 @@
   void dump();
   void output(FILE *fp);
 };
+
+#endif // SHARE_VM_ADLC_FORMSOPT_HPP
--- a/src/share/vm/adlc/formssel.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/formssel.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -30,11 +30,14 @@
 InstructForm::InstructForm(const char *id, bool ideal_only)
   : _ident(id), _ideal_only(ideal_only),
     _localNames(cmpstr, hashstr, Form::arena),
-    _effects(cmpstr, hashstr, Form::arena) {
+    _effects(cmpstr, hashstr, Form::arena),
+    _is_mach_constant(false)
+{
       _ftype = Form::INS;
 
       _matrule   = NULL;
       _insencode = NULL;
+      _constant  = NULL;
       _opcode    = NULL;
       _size      = NULL;
       _attribs   = NULL;
@@ -58,11 +61,14 @@
 InstructForm::InstructForm(const char *id, InstructForm *instr, MatchRule *rule)
   : _ident(id), _ideal_only(false),
     _localNames(instr->_localNames),
-    _effects(instr->_effects) {
+    _effects(instr->_effects),
+    _is_mach_constant(false)
+{
       _ftype = Form::INS;
 
       _matrule   = rule;
       _insencode = instr->_insencode;
+      _constant  = instr->_constant;
       _opcode    = instr->_opcode;
       _size      = instr->_size;
       _attribs   = instr->_attribs;
@@ -1094,6 +1100,9 @@
   else if (is_ideal_nop()) {
     return "MachNopNode";
   }
+  else if (is_mach_constant()) {
+    return "MachConstantNode";
+  }
   else if (captures_bottom_type(globals)) {
     return "MachTypeNode";
   } else {
@@ -1190,6 +1199,21 @@
 //
 // Generate the format call for the replacement variable
 void InstructForm::rep_var_format(FILE *fp, const char *rep_var) {
+  // Handle special constant table variables.
+  if (strcmp(rep_var, "constanttablebase") == 0) {
+    fprintf(fp, "char reg[128];  ra->dump_register(in(mach_constant_base_node_input()), reg);\n");
+    fprintf(fp, "st->print(\"%%s\");\n");
+    return;
+  }
+  if (strcmp(rep_var, "constantoffset") == 0) {
+    fprintf(fp, "st->print(\"#%%d\", constant_offset());\n");
+    return;
+  }
+  if (strcmp(rep_var, "constantaddress") == 0) {
+    fprintf(fp, "st->print(\"constant table base + #%%d\", constant_offset());\n");
+    return;
+  }
+
   // Find replacement variable's type
   const Form *form   = _localNames[rep_var];
   if (form == NULL) {
@@ -1348,6 +1372,7 @@
   fprintf(fp,"\nInstruction: %s\n", (_ident?_ident:""));
   if (_matrule)   _matrule->output(fp);
   if (_insencode) _insencode->output(fp);
+  if (_constant)  _constant->output(fp);
   if (_opcode)    _opcode->output(fp);
   if (_attribs)   _attribs->output(fp);
   if (_predicate) _predicate->output(fp);
--- a/src/share/vm/adlc/formssel.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/formssel.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_ADLC_FORMSSEL_HPP
+#define SHARE_VM_ADLC_FORMSSEL_HPP
+
 // FORMSSEL.HPP - ADL Parser Instruction Selection Forms Classes
 
 // Class List
@@ -71,15 +74,16 @@
 //------------------------------InstructForm-----------------------------------
 class InstructForm : public Form {
 private:
-  bool          _ideal_only;       // Not a user-defined instruction
+  bool           _ideal_only;       // Not a user-defined instruction
   // Members used for tracking CISC-spilling
-  uint          _cisc_spill_operand;// Which operand may cisc-spill
+  uint           _cisc_spill_operand;// Which operand may cisc-spill
   void           set_cisc_spill_operand(uint op_index) { _cisc_spill_operand = op_index; }
-  bool          _is_cisc_alternate;
+  bool           _is_cisc_alternate;
   InstructForm  *_cisc_spill_alternate;// cisc possible replacement
   const char    *_cisc_reg_mask_name;
   InstructForm  *_short_branch_form;
   bool           _is_short_branch;
+  bool           _is_mach_constant;   // true if Node is a MachConstantNode
   uint           _alignment;
 
 public:
@@ -91,6 +95,7 @@
   Opcode        *_opcode;          // Encoding of the opcode for instruction
   char          *_size;            // Size of instruction
   InsEncode     *_insencode;       // Encoding class instruction belongs to
+  InsEncode     *_constant;        // Encoding class constant value belongs to
   Attribute     *_attribs;         // List of Attribute rules
   Predicate     *_predicate;       // Predicate test for this instruction
   FormDict       _effects;         // Dictionary of effect rules
@@ -248,6 +253,9 @@
   bool                is_short_branch() { return _is_short_branch; }
   void                set_short_branch(bool val) { _is_short_branch = val; }
 
+  bool                    is_mach_constant() const { return _is_mach_constant;     }
+  void                set_is_mach_constant(bool x) {        _is_mach_constant = x; }
+
   InstructForm       *short_branch_form() { return _short_branch_form; }
   bool                has_short_branch_form() { return _short_branch_form != NULL; }
   // Output short branch prototypes and method bodies
@@ -1062,3 +1070,5 @@
   void dump();
   void output(FILE *fp);
 };
+
+#endif // SHARE_VM_ADLC_FORMSSEL_HPP
--- a/src/share/vm/adlc/main.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/main.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,17 @@
 
 ArchDesc* globalAD = NULL;      // global reference to Architecture Description object
 
+const char* get_basename(const char* filename) {
+  const char *basename = filename;
+  const char *cp;
+  for (cp = basename; *cp; cp++) {
+    if (*cp == '/') {
+      basename = cp+1;
+    }
+  }
+  return basename;
+}
+
 //------------------------------main-------------------------------------------
 int main(int argc, char *argv[])
 {
@@ -193,16 +204,69 @@
   AD.addSunCopyright(legal_text, legal_sz, AD._CPP_PIPELINE_file._fp);  // .cpp
   AD.addSunCopyright(legal_text, legal_sz, AD._VM_file._fp);            // .hpp
   AD.addSunCopyright(legal_text, legal_sz, AD._DFA_file._fp);           // .cpp
+  // Add include guards for all .hpp files
+  AD.addIncludeGuardStart(AD._HPP_file, "GENERATED_ADFILES_AD_HPP");        // .hpp
+  AD.addIncludeGuardStart(AD._VM_file, "GENERATED_ADFILES_ADGLOBALS_HPP");  // .hpp
+  // Add includes
+  AD.addInclude(AD._CPP_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._VM_file._name));
+  AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp");
+  AD.addInclude(AD._CPP_file, "asm/assembler.hpp");
+  AD.addInclude(AD._CPP_file, "code/vmreg.hpp");
+  AD.addInclude(AD._CPP_file, "gc_interface/collectedHeap.inline.hpp");
+  AD.addInclude(AD._CPP_file, "oops/compiledICHolderOop.hpp");
+  AD.addInclude(AD._CPP_file, "oops/markOop.hpp");
+  AD.addInclude(AD._CPP_file, "oops/methodOop.hpp");
+  AD.addInclude(AD._CPP_file, "oops/oop.inline.hpp");
+  AD.addInclude(AD._CPP_file, "oops/oop.inline2.hpp");
+  AD.addInclude(AD._CPP_file, "opto/cfgnode.hpp");
+  AD.addInclude(AD._CPP_file, "opto/locknode.hpp");
+  AD.addInclude(AD._CPP_file, "opto/opcodes.hpp");
+  AD.addInclude(AD._CPP_file, "opto/regalloc.hpp");
+  AD.addInclude(AD._CPP_file, "opto/regmask.hpp");
+  AD.addInclude(AD._CPP_file, "opto/runtime.hpp");
+  AD.addInclude(AD._CPP_file, "runtime/biasedLocking.hpp");
+  AD.addInclude(AD._CPP_file, "runtime/sharedRuntime.hpp");
+  AD.addInclude(AD._CPP_file, "runtime/stubRoutines.hpp");
+  AD.addInclude(AD._CPP_file, "utilities/growableArray.hpp");
+#ifdef TARGET_ARCH_x86
+  AD.addInclude(AD._CPP_file, "assembler_x86.inline.hpp");
+  AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp");
+  AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp");
+#endif
+#ifdef TARGET_ARCH_sparc
+  AD.addInclude(AD._CPP_file, "assembler_sparc.inline.hpp");
+  AD.addInclude(AD._CPP_file, "nativeInst_sparc.hpp");
+  AD.addInclude(AD._CPP_file, "vmreg_sparc.inline.hpp");
+#endif
+  AD.addInclude(AD._HPP_file, "memory/allocation.hpp");
+  AD.addInclude(AD._HPP_file, "opto/machnode.hpp");
+  AD.addInclude(AD._HPP_file, "opto/node.hpp");
+  AD.addInclude(AD._HPP_file, "opto/regalloc.hpp");
+  AD.addInclude(AD._HPP_file, "opto/subnode.hpp");
+  AD.addInclude(AD._CPP_CLONE_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_CLONE_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._CPP_EXPAND_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_EXPAND_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._CPP_FORMAT_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_FORMAT_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._CPP_GEN_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_GEN_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._CPP_GEN_file, "opto/cfgnode.hpp");
+  AD.addInclude(AD._CPP_GEN_file, "opto/locknode.hpp");
+  AD.addInclude(AD._CPP_MISC_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_MISC_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._CPP_PEEPHOLE_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_PEEPHOLE_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._CPP_PIPELINE_file, "precompiled.hpp");
+  AD.addInclude(AD._CPP_PIPELINE_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._DFA_file, "precompiled.hpp");
+  AD.addInclude(AD._DFA_file, "adfiles", get_basename(AD._HPP_file._name));
+  AD.addInclude(AD._DFA_file, "opto/matcher.hpp");
+  AD.addInclude(AD._DFA_file, "opto/opcodes.hpp");
   // Make sure each .cpp file starts with include lines:
   // files declaring and defining generators for Mach* Objects (hpp,cpp)
-  AD.machineDependentIncludes(AD._CPP_file);      // .cpp
-  AD.machineDependentIncludes(AD._CPP_CLONE_file);     // .cpp
-  AD.machineDependentIncludes(AD._CPP_EXPAND_file);    // .cpp
-  AD.machineDependentIncludes(AD._CPP_FORMAT_file);    // .cpp
-  AD.machineDependentIncludes(AD._CPP_GEN_file);       // .cpp
-  AD.machineDependentIncludes(AD._CPP_MISC_file);      // .cpp
-  AD.machineDependentIncludes(AD._CPP_PEEPHOLE_file);  // .cpp
-  AD.machineDependentIncludes(AD._CPP_PIPELINE_file);  // .cpp
   // Generate the result files:
   // enumerations, class definitions, object generators, and the DFA
   // file containing enumeration of machine operands & instructions (hpp)
@@ -244,8 +308,10 @@
   AD.addPreprocessorChecks(AD._CPP_PIPELINE_file._fp);  // .cpp
 
   // define the finite automata that selects lowest cost production
-  AD.machineDependentIncludes(AD._DFA_file);      // .cpp
   AD.buildDFA(AD._DFA_file._fp);
+  // Add include guards for all .hpp files
+  AD.addIncludeGuardEnd(AD._HPP_file, "GENERATED_ADFILES_AD_HPP");        // .hpp
+  AD.addIncludeGuardEnd(AD._VM_file, "GENERATED_ADFILES_ADGLOBALS_HPP");  // .hpp
 
   AD.close_files(0);               // Close all input/output files
 
--- a/src/share/vm/adlc/output_c.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/output_c.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1496,8 +1496,8 @@
   unsigned      i;
 
   // Generate Expand function header
-  fprintf(fp,"MachNode *%sNode::Expand(State *state, Node_List &proj_list, Node* mem) {\n", node->_ident);
-  fprintf(fp,"Compile* C = Compile::current();\n");
+  fprintf(fp, "MachNode* %sNode::Expand(State* state, Node_List& proj_list, Node* mem) {\n", node->_ident);
+  fprintf(fp, "  Compile* C = Compile::current();\n");
   // Generate expand code
   if( node->expands() ) {
     const char   *opid;
@@ -1818,6 +1818,12 @@
     }
   }
 
+  // If the node is a MachConstantNode, insert the MachConstantBaseNode edge.
+  // NOTE: this edge must be the last input (see MachConstantNode::mach_constant_base_node_input).
+  if (node->is_mach_constant()) {
+    fprintf(fp,"  add_req(C->mach_constant_base_node());\n");
+  }
+
   fprintf(fp,"\n");
   if( node->expands() ) {
     fprintf(fp,"  return result;\n");
@@ -1924,7 +1930,17 @@
         // No state needed.
         assert( _opclass == NULL,
                 "'primary', 'secondary' and 'tertiary' don't follow operand.");
-      } else {
+      }
+      else if ((strcmp(rep_var, "constanttablebase") == 0) ||
+               (strcmp(rep_var, "constantoffset")    == 0) ||
+               (strcmp(rep_var, "constantaddress")   == 0)) {
+        if (!_inst.is_mach_constant()) {
+          _AD.syntax_err(_encoding._linenum,
+                         "Replacement variable %s not allowed in instruct %s (only in MachConstantNode).\n",
+                         rep_var, _encoding._name);
+        }
+      }
+      else {
         // Lookup its position in parameter list
         int   param_no  = _encoding.rep_var_index(rep_var);
         if ( param_no == -1 ) {
@@ -2380,6 +2396,15 @@
                         rep_var, _inst._ident, _encoding._name);
       }
     }
+    else if (strcmp(rep_var, "constanttablebase") == 0) {
+      fprintf(_fp, "as_Register(ra_->get_encode(in(mach_constant_base_node_input())))");
+    }
+    else if (strcmp(rep_var, "constantoffset") == 0) {
+      fprintf(_fp, "constant_offset()");
+    }
+    else if (strcmp(rep_var, "constantaddress") == 0) {
+      fprintf(_fp, "InternalAddress(__ code()->consts()->start() + constant_offset())");
+    }
     else {
       // Lookup its position in parameter list
       int   param_no  = _encoding.rep_var_index(rep_var);
@@ -2465,37 +2490,39 @@
   fprintf(fp,"}\n");
 }
 
-void ArchDesc::defineEmit(FILE *fp, InstructForm &inst) {
-  InsEncode *ins_encode = inst._insencode;
+// defineEmit -----------------------------------------------------------------
+void ArchDesc::defineEmit(FILE* fp, InstructForm& inst) {
+  InsEncode* encode = inst._insencode;
 
   // (1)
   // Output instruction's emit prototype
-  fprintf(fp,"void  %sNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {\n",
-          inst._ident);
+  fprintf(fp, "void %sNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {\n", inst._ident);
 
   // If user did not define an encode section,
   // provide stub that does not generate any machine code.
-  if( (_encode == NULL) || (ins_encode == NULL) ) {
+  if( (_encode == NULL) || (encode == NULL) ) {
     fprintf(fp, "  // User did not define an encode section.\n");
-    fprintf(fp,"}\n");
+    fprintf(fp, "}\n");
     return;
   }
 
   // Save current instruction's starting address (helps with relocation).
-  fprintf(fp, "    cbuf.set_insts_mark();\n");
-
-  // // // idx0 is only needed for syntactic purposes and only by "storeSSI"
-  // fprintf( fp, "    unsigned idx0  = 0;\n");
+  fprintf(fp, "  cbuf.set_insts_mark();\n");
+
+  // For MachConstantNodes which are ideal jump nodes, fill the jump table.
+  if (inst.is_mach_constant() && inst.is_ideal_jump()) {
+    fprintf(fp, "  ra_->C->constant_table().fill_jump_table(cbuf, (MachConstantNode*) this, _index2label);\n");
+  }
 
   // Output each operand's offset into the array of registers.
-  inst.index_temps( fp, _globalNames );
+  inst.index_temps(fp, _globalNames);
 
   // Output this instruction's encodings
   const char *ec_name;
   bool        user_defined = false;
-  ins_encode->reset();
-  while ( (ec_name = ins_encode->encode_class_iter()) != NULL ) {
-    fprintf(fp, "  {");
+  encode->reset();
+  while ((ec_name = encode->encode_class_iter()) != NULL) {
+    fprintf(fp, "  {\n");
     // Output user-defined encoding
     user_defined           = true;
 
@@ -2507,25 +2534,25 @@
       abort();
     }
 
-    if (ins_encode->current_encoding_num_args() != encoding->num_args()) {
-      globalAD->syntax_err(ins_encode->_linenum, "In %s: passing %d arguments to %s but expecting %d",
-                           inst._ident, ins_encode->current_encoding_num_args(),
+    if (encode->current_encoding_num_args() != encoding->num_args()) {
+      globalAD->syntax_err(encode->_linenum, "In %s: passing %d arguments to %s but expecting %d",
+                           inst._ident, encode->current_encoding_num_args(),
                            ec_name, encoding->num_args());
     }
 
-    DefineEmitState  pending(fp, *this, *encoding, *ins_encode, inst );
+    DefineEmitState pending(fp, *this, *encoding, *encode, inst);
     encoding->_code.reset();
     encoding->_rep_vars.reset();
     // Process list of user-defined strings,
     // and occurrences of replacement variables.
     // Replacement Vars are pushed into a list and then output
-    while ( (ec_code = encoding->_code.iter()) != NULL ) {
-      if ( ! encoding->_code.is_signal( ec_code ) ) {
+    while ((ec_code = encoding->_code.iter()) != NULL) {
+      if (!encoding->_code.is_signal(ec_code)) {
         // Emit pending code
         pending.emit();
         pending.clear();
         // Emit this code section
-        fprintf(fp,"%s", ec_code);
+        fprintf(fp, "%s", ec_code);
       } else {
         // A replacement variable or one of its subfields
         // Obtain replacement variable from list
@@ -2536,7 +2563,7 @@
     // Emit pending code
     pending.emit();
     pending.clear();
-    fprintf(fp, "}\n");
+    fprintf(fp, "  }\n");
   } // end while instruction's encodings
 
   // Check if user stated which encoding to user
@@ -2545,7 +2572,86 @@
   }
 
   // (3) and (4)
-  fprintf(fp,"}\n");
+  fprintf(fp, "}\n");
+}
+
+// defineEvalConstant ---------------------------------------------------------
+void ArchDesc::defineEvalConstant(FILE* fp, InstructForm& inst) {
+  InsEncode* encode = inst._constant;
+
+  // (1)
+  // Output instruction's emit prototype
+  fprintf(fp, "void %sNode::eval_constant(Compile* C) {\n", inst._ident);
+
+  // For ideal jump nodes, allocate a jump table.
+  if (inst.is_ideal_jump()) {
+    fprintf(fp, "  _constant = C->constant_table().allocate_jump_table(this);\n");
+  }
+
+  // If user did not define an encode section,
+  // provide stub that does not generate any machine code.
+  if ((_encode == NULL) || (encode == NULL)) {
+    fprintf(fp, "  // User did not define an encode section.\n");
+    fprintf(fp, "}\n");
+    return;
+  }
+
+  // Output this instruction's encodings
+  const char *ec_name;
+  bool        user_defined = false;
+  encode->reset();
+  while ((ec_name = encode->encode_class_iter()) != NULL) {
+    fprintf(fp, "  {\n");
+    // Output user-defined encoding
+    user_defined           = true;
+
+    const char *ec_code    = NULL;
+    const char *ec_rep_var = NULL;
+    EncClass   *encoding   = _encode->encClass(ec_name);
+    if (encoding == NULL) {
+      fprintf(stderr, "User did not define contents of this encode_class: %s\n", ec_name);
+      abort();
+    }
+
+    if (encode->current_encoding_num_args() != encoding->num_args()) {
+      globalAD->syntax_err(encode->_linenum, "In %s: passing %d arguments to %s but expecting %d",
+                           inst._ident, encode->current_encoding_num_args(),
+                           ec_name, encoding->num_args());
+    }
+
+    DefineEmitState pending(fp, *this, *encoding, *encode, inst);
+    encoding->_code.reset();
+    encoding->_rep_vars.reset();
+    // Process list of user-defined strings,
+    // and occurrences of replacement variables.
+    // Replacement Vars are pushed into a list and then output
+    while ((ec_code = encoding->_code.iter()) != NULL) {
+      if (!encoding->_code.is_signal(ec_code)) {
+        // Emit pending code
+        pending.emit();
+        pending.clear();
+        // Emit this code section
+        fprintf(fp, "%s", ec_code);
+      } else {
+        // A replacement variable or one of its subfields
+        // Obtain replacement variable from list
+        ec_rep_var  = encoding->_rep_vars.iter();
+        pending.add_rep_var(ec_rep_var);
+      }
+    }
+    // Emit pending code
+    pending.emit();
+    pending.clear();
+    fprintf(fp, "  }\n");
+  } // end while instruction's encodings
+
+  // Check if user stated which encoding to user
+  if (user_defined == false) {
+    fprintf(fp, "  // User did not define which encode class to use.\n");
+  }
+
+  // (3) and (4)
+  fprintf(fp, "}\n");
 }
 
 // ---------------------------------------------------------------------------
@@ -2952,6 +3058,7 @@
     // If there are multiple defs/kills, or an explicit expand rule, build rule
     if( instr->expands() || instr->needs_projections() ||
         instr->has_temps() ||
+        instr->is_mach_constant() ||
         instr->_matrule != NULL &&
         instr->num_opnds() != instr->num_unique_opnds() )
       defineExpand(_CPP_EXPAND_file._fp, instr);
@@ -3032,8 +3139,9 @@
     // Ensure this is a machine-world instruction
     if ( instr->ideal_only() ) continue;
 
-    if (instr->_insencode) defineEmit(fp, *instr);
-    if (instr->_size)      defineSize(fp, *instr);
+    if (instr->_insencode)         defineEmit        (fp, *instr);
+    if (instr->is_mach_constant()) defineEvalConstant(fp, *instr);
+    if (instr->_size)              defineSize        (fp, *instr);
 
     // side-call to generate output that used to be in the header file:
     extern void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &oper, bool for_c_file);
--- a/src/share/vm/adlc/output_h.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/adlc/output_h.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1550,7 +1550,12 @@
     }
 
     // virtual functions for encode and format
-    //
+
+    // Virtual function for evaluating the constant.
+    if (instr->is_mach_constant()) {
+      fprintf(fp,"  virtual void           eval_constant(Compile* C);\n");
+    }
+
     // Output the opcode function and the encode function here using the
     // encoding class information in the _insencode slot.
     if ( instr->_insencode ) {
@@ -1559,7 +1564,7 @@
 
     // virtual function for getting the size of an instruction
     if ( instr->_size ) {
-       fprintf(fp,"  virtual uint           size(PhaseRegAlloc *ra_) const;\n");
+      fprintf(fp,"  virtual uint           size(PhaseRegAlloc *ra_) const;\n");
     }
 
     // Return the top-level ideal opcode.
@@ -1752,6 +1757,7 @@
     // Virtual methods which are only generated to override base class
     if( instr->expands() || instr->needs_projections() ||
         instr->has_temps() ||
+        instr->is_mach_constant() ||
         instr->_matrule != NULL &&
         instr->num_opnds() != instr->num_unique_opnds() ) {
       fprintf(fp,"  virtual MachNode      *Expand(State *state, Node_List &proj_list, Node* mem);\n");
@@ -1780,24 +1786,6 @@
     // Declare short branch methods, if applicable
     instr->declare_short_branch_methods(fp);
 
-    // Instructions containing a constant that will be entered into the
-    // float/double table redefine the base virtual function
-#ifdef SPARC
-    // Sparc doubles entries in the constant table require more space for
-    // alignment. (expires 9/98)
-    int table_entries = (3 * instr->num_consts( _globalNames, Form::idealD ))
-      + instr->num_consts( _globalNames, Form::idealF );
-#else
-    int table_entries = instr->num_consts( _globalNames, Form::idealD )
-      + instr->num_consts( _globalNames, Form::idealF );
-#endif
-    if( table_entries != 0 ) {
-      fprintf(fp,"  virtual int            const_size() const {");
-      fprintf(fp,   " return %d;", table_entries);
-      fprintf(fp, " }\n");
-    }
-
-
     // See if there is an "ins_pipe" declaration for this instruction
     if (instr->_ins_pipe) {
       fprintf(fp,"  static  const Pipeline *pipeline_class();\n");
--- a/src/share/vm/asm/assembler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/asm/assembler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_assembler.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "asm/assembler.inline.hpp"
+#include "asm/codeBuffer.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+#endif
 
 
 // Implementation of AbstractAssembler
--- a/src/share/vm/asm/assembler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/asm/assembler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,28 @@
  *
  */
 
+#ifndef SHARE_VM_ASM_ASSEMBLER_HPP
+#define SHARE_VM_ASM_ASSEMBLER_HPP
+
+#include "code/oopRecorder.hpp"
+#include "code/relocInfo.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_ARCH_x86
+# include "register_x86.hpp"
+# include "vm_version_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "register_sparc.hpp"
+# include "vm_version_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "register_zero.hpp"
+# include "vm_version_zero.hpp"
+#endif
+
 // This file contains platform-independent assembler declarations.
 
 class CodeBuffer;
@@ -270,7 +292,16 @@
   address    start_a_const(int required_space, int required_align = sizeof(double));
   void       end_a_const();
 
-  // fp constants support
+  // constants support
+  address long_constant(jlong c) {
+    address ptr = start_a_const(sizeof(c), sizeof(c));
+    if (ptr != NULL) {
+      *(jlong*)ptr = c;
+      _code_pos = ptr + sizeof(c);
+      end_a_const();
+    }
+    return ptr;
+  }
   address double_constant(jdouble c) {
     address ptr = start_a_const(sizeof(c), sizeof(c));
     if (ptr != NULL) {
@@ -289,6 +320,15 @@
     }
     return ptr;
   }
+  address address_constant(address c) {
+    address ptr = start_a_const(sizeof(c), sizeof(c));
+    if (ptr != NULL) {
+      *(address*)ptr = c;
+      _code_pos = ptr + sizeof(c);
+      end_a_const();
+    }
+    return ptr;
+  }
   address address_constant(address c, RelocationHolder const& rspec) {
     address ptr = start_a_const(sizeof(c), sizeof(c));
     if (ptr != NULL) {
@@ -299,8 +339,6 @@
     }
     return ptr;
   }
-  inline address address_constant(Label& L);
-  inline address address_table_constant(GrowableArray<Label*> label);
 
   // Bootstrapping aid to cope with delayed determination of constants.
   // Returns a static address which will eventually contain the constant.
@@ -348,4 +386,15 @@
 #endif // PRODUCT
 };
 
-#include "incls/_assembler_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.hpp"
+#endif
+
+
+#endif // SHARE_VM_ASM_ASSEMBLER_HPP
--- a/src/share/vm/asm/assembler.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/asm/assembler.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_ASM_ASSEMBLER_INLINE_HPP
+#define SHARE_VM_ASM_ASSEMBLER_INLINE_HPP
+
+#include "asm/assembler.hpp"
+#include "asm/codeBuffer.hpp"
+#include "compiler/disassembler.hpp"
+#include "runtime/threadLocalStorage.hpp"
+
 inline void AbstractAssembler::sync() {
   CodeSection* cs = code_section();
   guarantee(cs->start() == _code_begin, "must not shift code buffer");
@@ -106,30 +114,4 @@
   bind_loc(CodeBuffer::locator(pos, sect));
 }
 
-address AbstractAssembler::address_constant(Label& L) {
-  address c = NULL;
-  address ptr = start_a_const(sizeof(c), sizeof(c));
-  if (ptr != NULL) {
-    relocate(Relocation::spec_simple(relocInfo::internal_word_type));
-    *(address*)ptr = c = code_section()->target(L, ptr);
-    _code_pos = ptr + sizeof(c);
-    end_a_const();
-  }
-  return ptr;
-}
-
-address AbstractAssembler::address_table_constant(GrowableArray<Label*> labels) {
-  int addressSize = sizeof(address);
-  int sizeLabel = addressSize * labels.length();
-  address ptr = start_a_const(sizeLabel, addressSize);
-
-  if (ptr != NULL) {
-    address *labelLoc = (address*)ptr;
-    for (int i=0; i < labels.length(); i++) {
-      emit_address(code_section()->target(*labels.at(i), (address)&labelLoc[i]));
-      code_section()->relocate((address)&labelLoc[i], relocInfo::internal_word_type);
-    }
-    end_a_const();
-  }
-  return ptr;
-}
+#endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP
--- a/src/share/vm/asm/codeBuffer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/asm/codeBuffer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_codeBuffer.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/codeBuffer.hpp"
+#include "compiler/disassembler.hpp"
+#include "utilities/copy.hpp"
 
 // The structure of a CodeSection:
 //
@@ -129,6 +131,7 @@
 #ifdef ASSERT
   // Save allocation type to execute assert in ~ResourceObj()
   // which is called after this destructor.
+  assert(_default_oop_recorder.allocated_on_stack(), "should be embedded object");
   ResourceObj::allocation_type at = _default_oop_recorder.get_allocation_type();
   Copy::fill_to_bytes(this, sizeof(*this), badResourceValue);
   ResourceObj::set_allocation_type((address)(&_default_oop_recorder), at);
--- a/src/share/vm/asm/codeBuffer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/asm/codeBuffer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_ASM_CODEBUFFER_HPP
+#define SHARE_VM_ASM_CODEBUFFER_HPP
+
+#include "asm/assembler.hpp"
+#include "code/oopRecorder.hpp"
+#include "code/relocInfo.hpp"
+
 class  CodeComments;
 class  AbstractAssembler;
 class  MacroAssembler;
@@ -550,7 +557,16 @@
 
 
   // The following header contains architecture-specific implementations
-  #include "incls/_codeBuffer_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "codeBuffer_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "codeBuffer_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "codeBuffer_zero.hpp"
+#endif
+
 };
 
 
@@ -562,3 +578,5 @@
   if (remaining() < amount) { _outer->expand(this, amount); return true; }
   return false;
 }
+
+#endif // SHARE_VM_ASM_CODEBUFFER_HPP
--- a/src/share/vm/asm/register.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/asm/register.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_register.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/register.hpp"
 
 
 // Intentionally left blank
--- a/src/share/vm/asm/register.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/asm/register.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_ASM_REGISTER_HPP
+#define SHARE_VM_ASM_REGISTER_HPP
+
+#include "utilities/top.hpp"
+
 // Use AbstractRegister as shortcut
 class AbstractRegisterImpl;
 typedef AbstractRegisterImpl* AbstractRegister;
@@ -209,3 +214,5 @@
     "registers must be different"
   );
 }
+
+#endif // SHARE_VM_ASM_REGISTER_HPP
--- a/src/share/vm/c1/c1_CFGPrinter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_CFGPrinter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_CFGPrinter.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_CFGPrinter.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_LIR.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "c1/c1_ValueStack.hpp"
 
 #ifndef PRODUCT
 
--- a/src/share/vm/c1/c1_CFGPrinter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_CFGPrinter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_CFGPRINTER_HPP
+#define SHARE_VM_C1_C1_CFGPRINTER_HPP
+
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_Instruction.hpp"
+
 #ifndef PRODUCT
 
 // This is a utility class used for recording the results of a
@@ -44,3 +50,5 @@
 };
 
 #endif
+
+#endif // SHARE_VM_C1_C1_CFGPRINTER_HPP
--- a/src/share/vm/c1/c1_Canonicalizer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Canonicalizer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Canonicalizer.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Canonicalizer.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciArray.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 
 class PrintValueVisitor: public ValueVisitor {
--- a/src/share/vm/c1/c1_Canonicalizer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Canonicalizer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_CANONICALIZER_HPP
+#define SHARE_VM_C1_C1_CANONICALIZER_HPP
+
+#include "c1/c1_Instruction.hpp"
+
 class Canonicalizer: InstructionVisitor {
  private:
   Compilation *_compilation;
@@ -98,3 +103,5 @@
   virtual void do_ProfileCall    (ProfileCall*     x);
   virtual void do_ProfileInvoke  (ProfileInvoke*   x);
 };
+
+#endif // SHARE_VM_C1_C1_CANONICALIZER_HPP
--- a/src/share/vm/c1/c1_CodeStubs.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_CodeStubs.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_CODESTUBS_HPP
+#define SHARE_VM_C1_C1_CODESTUBS_HPP
+
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LIR.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "utilities/array.hpp"
+
 class CodeEmitInfo;
 class LIR_Assembler;
 class LIR_OpVisitState;
@@ -586,3 +596,5 @@
 
 #endif // SERIALGC
 //////////////////////////////////////////////////////////////////////////////////////////
+
+#endif // SHARE_VM_C1_C1_CODESTUBS_HPP
--- a/src/share/vm/c1/c1_Compilation.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Compilation.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Compilation.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_CFGPrinter.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_ValueMap.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "code/debugInfoRec.hpp"
 
 
 typedef enum {
@@ -290,8 +298,8 @@
 
   CHECK_BAILOUT_(no_frame_size);
 
-  if (is_profiling()) {
-    method()->build_method_data();
+  if (is_profiling() && !method()->ensure_method_data()) {
+    BAILOUT_("mdo allocation failed", no_frame_size);
   }
 
   {
@@ -471,9 +479,16 @@
   _exception_info_list = new ExceptionInfoList();
   _implicit_exception_table.set_size(0);
   compile_method();
-  if (is_profiling() && _would_profile) {
-    ciMethodData *md = method->method_data();
-    assert (md != NULL, "Should have MDO");
+  if (bailed_out()) {
+    _env->record_method_not_compilable(bailout_msg(), !TieredCompilation);
+    if (is_profiling()) {
+      // Compilation failed, create MDO, which would signal the interpreter
+      // to start profiling on its own.
+      _method->ensure_method_data();
+    }
+  } else if (is_profiling() && _would_profile) {
+    ciMethodData *md = method->method_data_or_null();
+    assert(md != NULL, "Sanity");
     md->set_would_profile(_would_profile);
   }
 }
--- a/src/share/vm/c1/c1_Compilation.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Compilation.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_COMPILATION_HPP
+#define SHARE_VM_C1_C1_COMPILATION_HPP
+
+#include "ci/ciEnv.hpp"
+#include "code/exceptionHandlerTable.hpp"
+#include "memory/resourceArea.hpp"
+
 class CompilationResourceObj;
 class XHandlers;
 class ExceptionInfo;
@@ -285,3 +292,5 @@
   int pco()                                      { return _pco; }
   XHandlers* exception_handlers()                { return _exception_handlers; }
 };
+
+#endif // SHARE_VM_C1_C1_COMPILATION_HPP
--- a/src/share/vm/c1/c1_Compiler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Compiler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Compiler.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_Compiler.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_GraphBuilder.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "c1/c1_ValueType.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 volatile int Compiler::_runtimes = uninitialized;
 
--- a/src/share/vm/c1/c1_Compiler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Compiler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_COMPILER_HPP
+#define SHARE_VM_C1_C1_COMPILER_HPP
+
+#include "compiler/abstractCompiler.hpp"
+
 // There is one instance of the Compiler per CompilerThread.
 
 class Compiler: public AbstractCompiler {
@@ -61,3 +66,5 @@
   // Print compilation timers and statistics
   virtual void print_timers();
 };
+
+#endif // SHARE_VM_C1_C1_COMPILER_HPP
--- a/src/share/vm/c1/c1_Defs.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Defs.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,6 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Defs.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Defs.hpp"
+
--- a/src/share/vm/c1/c1_Defs.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Defs.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_DEFS_HPP
+#define SHARE_VM_C1_C1_DEFS_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#ifdef TARGET_ARCH_x86
+# include "register_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "register_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "register_zero.hpp"
+#endif
+
 // set frame size and return address offset to these values in blobs
 // (if the compiled frame uses ebp as link pointer on IA; otherwise,
 // the frame size must be fixed)
@@ -30,7 +44,13 @@
 };
 
 
-# include "incls/_c1_Defs_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "c1_Defs_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_Defs_sparc.hpp"
+#endif
+
 
 // native word offsets from memory address
 enum {
@@ -49,3 +69,5 @@
 enum {
   float_saved_as_double = pd_float_saved_as_double
 };
+
+#endif // SHARE_VM_C1_C1_DEFS_HPP
--- a/src/share/vm/c1/c1_FpuStackSim.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_FpuStackSim.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,22 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_FPUSTACKSIM_HPP
+#define SHARE_VM_C1_C1_FPUSTACKSIM_HPP
+
+#include "c1/c1_FrameMap.hpp"
+#include "memory/allocation.hpp"
+
 // Provides location for forward declaration of this class, which is
 // only implemented on Intel
 class FpuStackSim;
 
-# include "incls/_c1_FpuStackSim_pd.hpp.incl"  // platform dependent declarations
+#ifdef TARGET_ARCH_x86
+# include "c1_FpuStackSim_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_FpuStackSim_sparc.hpp"
+#endif
+
+
+#endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP
--- a/src/share/vm/c1/c1_FrameMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_FrameMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_FrameMap.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIR.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vmreg_zero.inline.hpp"
+#endif
 
 
 
--- a/src/share/vm/c1/c1_FrameMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_FrameMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_FRAMEMAP_HPP
+#define SHARE_VM_C1_C1_FRAMEMAP_HPP
+
+#include "asm/assembler.hpp"
+#include "c1/c1_Defs.hpp"
+#include "c1/c1_LIR.hpp"
+#include "code/vmreg.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/synchronizer.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 class ciMethod;
 class CallingConvention;
 class BasicTypeArray;
@@ -64,13 +76,19 @@
     nof_cpu_regs_reg_alloc = pd_nof_cpu_regs_reg_alloc,
     nof_fpu_regs_reg_alloc = pd_nof_fpu_regs_reg_alloc,
 
-    nof_caller_save_cpu_regs = pd_nof_caller_save_cpu_regs_frame_map,
-    nof_caller_save_fpu_regs = pd_nof_caller_save_fpu_regs_frame_map,
+    max_nof_caller_save_cpu_regs = pd_nof_caller_save_cpu_regs_frame_map,
+    nof_caller_save_fpu_regs     = pd_nof_caller_save_fpu_regs_frame_map,
 
     spill_slot_size_in_bytes = 4
   };
 
-# include "incls/_c1_FrameMap_pd.hpp.incl"  // platform dependent declarations
+#ifdef TARGET_ARCH_x86
+# include "c1_FrameMap_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_FrameMap_sparc.hpp"
+#endif
+
 
   friend class LIR_OprDesc;
 
@@ -79,7 +97,7 @@
   static Register     _cpu_rnr2reg [nof_cpu_regs];
   static int          _cpu_reg2rnr [nof_cpu_regs];
 
-  static LIR_Opr      _caller_save_cpu_regs [nof_caller_save_cpu_regs];
+  static LIR_Opr      _caller_save_cpu_regs [max_nof_caller_save_cpu_regs];
   static LIR_Opr      _caller_save_fpu_regs [nof_caller_save_fpu_regs];
 
   int                 _framesize;
@@ -225,7 +243,7 @@
   VMReg regname(LIR_Opr opr) const;
 
   static LIR_Opr caller_save_cpu_reg_at(int i) {
-    assert(i >= 0 && i < nof_caller_save_cpu_regs, "out of bounds");
+    assert(i >= 0 && i < max_nof_caller_save_cpu_regs, "out of bounds");
     return _caller_save_cpu_regs[i];
   }
 
@@ -266,3 +284,5 @@
   }
 #endif // PRODUCT
 };
+
+#endif // SHARE_VM_C1_C1_FRAMEMAP_HPP
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_GraphBuilder.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_CFGPrinter.hpp"
+#include "c1/c1_Canonicalizer.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_GraphBuilder.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciKlass.hpp"
+#include "interpreter/bytecode.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "utilities/bitMap.inline.hpp"
 
 class BlockListBuilder VALUE_OBJ_CLASS_SPEC {
  private:
@@ -2786,7 +2795,7 @@
       get = append(new UnsafeGetRaw(as_BasicType(local->type()), e,
                                     append(new Constant(new IntConstant(offset))),
                                     0,
-                                    true));
+                                    true /*unaligned*/, true /*wide*/));
     }
     _state->store_local(index, get);
   }
@@ -3368,6 +3377,9 @@
     INLINE_BAILOUT("total inlining greater than DesiredMethodLimit");
   }
 
+  if (is_profiling() && !callee->ensure_method_data()) {
+    INLINE_BAILOUT("mdo allocation failed");
+  }
 #ifndef PRODUCT
       // printing
   if (PrintInlining) {
--- a/src/share/vm/c1/c1_GraphBuilder.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_GraphBuilder.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_GRAPHBUILDER_HPP
+#define SHARE_VM_C1_C1_GRAPHBUILDER_HPP
+
+#include "c1/c1_IR.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_ValueMap.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciMethodData.hpp"
+#include "ci/ciStreams.hpp"
+
 class MemoryBuffer;
 
 class GraphBuilder VALUE_OBJ_CLASS_SPEC {
@@ -378,3 +388,5 @@
 
   BlockBegin* start() const                      { return _start; }
 };
+
+#endif // SHARE_VM_C1_C1_GRAPHBUILDER_HPP
--- a/src/share/vm/c1/c1_IR.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_IR.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_IR.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_GraphBuilder.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_Optimizer.hpp"
+#include "utilities/bitMap.inline.hpp"
 
 
 // Implementation of XHandlers
@@ -498,7 +504,12 @@
   count_edges(start_block, NULL);
 
   if (compilation()->is_profiling()) {
-    compilation()->method()->method_data()->set_compilation_stats(_num_loops, _num_blocks);
+    ciMethod *method = compilation()->method();
+    if (!method->is_accessor()) {
+      ciMethodData* md = method->method_data_or_null();
+      assert(md != NULL, "Sanity");
+      md->set_compilation_stats(_num_loops, _num_blocks);
+    }
   }
 
   if (_num_loops > 0) {
--- a/src/share/vm/c1/c1_IR.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_IR.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_IR_HPP
+#define SHARE_VM_C1_C1_IR_HPP
+
+#include "c1/c1_Instruction.hpp"
+#include "ci/ciExceptionHandler.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciStreams.hpp"
+#include "memory/allocation.hpp"
+
 // An XHandler is a C1 internal description for an exception handler
 
 class XHandler: public CompilationResourceObj {
@@ -337,3 +346,5 @@
 
   virtual void block_do(BlockBegin* block);
 };
+
+#endif // SHARE_VM_C1_C1_IR_HPP
--- a/src/share/vm/c1/c1_Instruction.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Instruction.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Instruction.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
 
 
 // Implementation of Instruction
--- a/src/share/vm/c1/c1_Instruction.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Instruction.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_INSTRUCTION_HPP
+#define SHARE_VM_C1_C1_INSTRUCTION_HPP
+
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_LIR.hpp"
+#include "c1/c1_ValueType.hpp"
+#include "ci/ciField.hpp"
+
 // Predefined classes
 class ciField;
 class ValueStack;
@@ -2102,20 +2110,23 @@
 
 LEAF(UnsafeGetRaw, UnsafeRawOp)
  private:
-  bool _may_be_unaligned;  // For OSREntry
+ bool _may_be_unaligned, _is_wide;  // For OSREntry
 
  public:
-  UnsafeGetRaw(BasicType basic_type, Value addr, bool may_be_unaligned)
+ UnsafeGetRaw(BasicType basic_type, Value addr, bool may_be_unaligned, bool is_wide = false)
   : UnsafeRawOp(basic_type, addr, false) {
     _may_be_unaligned = may_be_unaligned;
+    _is_wide = is_wide;
   }
 
-  UnsafeGetRaw(BasicType basic_type, Value base, Value index, int log2_scale, bool may_be_unaligned)
+ UnsafeGetRaw(BasicType basic_type, Value base, Value index, int log2_scale, bool may_be_unaligned, bool is_wide = false)
   : UnsafeRawOp(basic_type, base, index, log2_scale, false) {
     _may_be_unaligned = may_be_unaligned;
+    _is_wide = is_wide;
   }
 
-  bool may_be_unaligned()                               { return _may_be_unaligned; }
+  bool may_be_unaligned()                         { return _may_be_unaligned; }
+  bool is_wide()                                  { return _is_wide; }
 };
 
 
@@ -2303,3 +2314,5 @@
 inline void        BlockBegin::add_successor(BlockBegin* sux)   { assert(_end == NULL, "Would create mismatch with successors of BlockEnd");         _successors.append(sux); }
 
 #undef ASSERT_VALUES
+
+#endif // SHARE_VM_C1_C1_INSTRUCTION_HPP
--- a/src/share/vm/c1/c1_InstructionPrinter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_InstructionPrinter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_InstructionPrinter.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciArray.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciObject.hpp"
 
 
 #ifndef PRODUCT
--- a/src/share/vm/c1/c1_InstructionPrinter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_InstructionPrinter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP
+#define SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP
+
+#include "c1/c1_IR.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_Runtime1.hpp"
+
 #ifndef PRODUCT
 class InstructionPrinter: public InstructionVisitor {
  private:
@@ -126,3 +133,5 @@
   virtual void do_ProfileInvoke  (ProfileInvoke*   x);
 };
 #endif // PRODUCT
+
+#endif // SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP
--- a/src/share/vm/c1/c1_LIR.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LIR.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIR.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_LIR.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciInstance.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 Register LIR_OprDesc::as_register() const {
   return FrameMap::cpu_rnr2reg(cpu_regnr());
@@ -1737,6 +1742,8 @@
       return "unaligned move";
     case lir_move_volatile:
       return "volatile_move";
+    case lir_move_wide:
+      return "wide_move";
     default:
       ShouldNotReachHere();
     return "illegal_op";
--- a/src/share/vm/c1/c1_LIR.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LIR.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_LIR_HPP
+#define SHARE_VM_C1_C1_LIR_HPP
+
+#include "c1/c1_ValueType.hpp"
+
 class BlockBegin;
 class BlockList;
 class LIR_Assembler;
@@ -980,6 +985,7 @@
   lir_move_normal,
   lir_move_volatile,
   lir_move_unaligned,
+  lir_move_wide,
   lir_move_max_flag
 };
 
@@ -1927,7 +1933,20 @@
   void move(LIR_Opr src, LIR_Opr dst, CodeEmitInfo* info = NULL) { append(new LIR_Op1(lir_move, src, dst, dst->type(), lir_patch_none, info)); }
   void move(LIR_Address* src, LIR_Opr dst, CodeEmitInfo* info = NULL) { append(new LIR_Op1(lir_move, LIR_OprFact::address(src), dst, src->type(), lir_patch_none, info)); }
   void move(LIR_Opr src, LIR_Address* dst, CodeEmitInfo* info = NULL) { append(new LIR_Op1(lir_move, src, LIR_OprFact::address(dst), dst->type(), lir_patch_none, info)); }
-
+  void move_wide(LIR_Address* src, LIR_Opr dst, CodeEmitInfo* info = NULL) {
+    if (UseCompressedOops) {
+      append(new LIR_Op1(lir_move, LIR_OprFact::address(src), dst, src->type(), lir_patch_none, info, lir_move_wide));
+    } else {
+      move(src, dst, info);
+    }
+  }
+  void move_wide(LIR_Opr src, LIR_Address* dst, CodeEmitInfo* info = NULL) {
+    if (UseCompressedOops) {
+      append(new LIR_Op1(lir_move, src, LIR_OprFact::address(dst), dst->type(), lir_patch_none, info, lir_move_wide));
+    } else {
+      move(src, dst, info);
+    }
+  }
   void volatile_move(LIR_Opr src, LIR_Opr dst, BasicType type, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none) { append(new LIR_Op1(lir_move, src, dst, type, patch_code, info, lir_move_volatile)); }
 
   void oop2reg  (jobject o, LIR_Opr reg)         { append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o),    reg));   }
@@ -2282,3 +2301,5 @@
 
 
 inline LIR_Opr LIR_OprDesc::illegalOpr()   { return LIR_OprFact::illegalOpr; };
+
+#endif // SHARE_VM_C1_C1_LIR_HPP
--- a/src/share/vm/c1/c1_LIRAssembler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LIRAssembler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,26 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRAssembler.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciInstance.hpp"
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+# include "vmreg_zero.inline.hpp"
+#endif
 
 
 void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
@@ -471,7 +489,9 @@
         volatile_move_op(op->in_opr(), op->result_opr(), op->type(), op->info());
       } else {
         move_op(op->in_opr(), op->result_opr(), op->type(),
-                op->patch_code(), op->info(), op->pop_fpu_stack(), op->move_kind() == lir_move_unaligned);
+                op->patch_code(), op->info(), op->pop_fpu_stack(),
+                op->move_kind() == lir_move_unaligned,
+                op->move_kind() == lir_move_wide);
       }
       break;
 
@@ -740,7 +760,7 @@
 }
 
 
-void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned) {
+void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned, bool wide) {
   if (src->is_register()) {
     if (dest->is_register()) {
       assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
@@ -749,7 +769,7 @@
       assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
       reg2stack(src, dest, type, pop_fpu_stack);
     } else if (dest->is_address()) {
-      reg2mem(src, dest, type, patch_code, info, pop_fpu_stack, unaligned);
+      reg2mem(src, dest, type, patch_code, info, pop_fpu_stack, wide, unaligned);
     } else {
       ShouldNotReachHere();
     }
@@ -772,13 +792,13 @@
       const2stack(src, dest);
     } else if (dest->is_address()) {
       assert(patch_code == lir_patch_none, "no patching allowed here");
-      const2mem(src, dest, type, info);
+      const2mem(src, dest, type, info, wide);
     } else {
       ShouldNotReachHere();
     }
 
   } else if (src->is_address()) {
-    mem2reg(src, dest, type, patch_code, info, unaligned);
+    mem2reg(src, dest, type, patch_code, info, wide, unaligned);
 
   } else {
     ShouldNotReachHere();
--- a/src/share/vm/c1/c1_LIRAssembler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LIRAssembler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_LIRASSEMBLER_HPP
+#define SHARE_VM_C1_C1_LIRASSEMBLER_HPP
+
+#include "c1/c1_CodeStubs.hpp"
+#include "ci/ciMethodData.hpp"
+#include "oops/methodDataOop.hpp"
+#include "utilities/top.hpp"
+
 class Compilation;
 class ScopeValue;
 class BarrierSet;
@@ -157,15 +165,17 @@
 
   void const2reg  (LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info);
   void const2stack(LIR_Opr src, LIR_Opr dest);
-  void const2mem  (LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info);
+  void const2mem  (LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide);
   void reg2stack  (LIR_Opr src, LIR_Opr dest, BasicType type, bool pop_fpu_stack);
   void reg2reg    (LIR_Opr src, LIR_Opr dest);
-  void reg2mem    (LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned);
+  void reg2mem    (LIR_Opr src, LIR_Opr dest, BasicType type,
+                   LIR_PatchCode patch_code, CodeEmitInfo* info,
+                   bool pop_fpu_stack, bool wide, bool unaligned);
   void stack2reg  (LIR_Opr src, LIR_Opr dest, BasicType type);
   void stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type);
   void mem2reg    (LIR_Opr src, LIR_Opr dest, BasicType type,
-                   LIR_PatchCode patch_code = lir_patch_none,
-                   CodeEmitInfo* info = NULL, bool unaligned = false);
+                   LIR_PatchCode patch_code,
+                   CodeEmitInfo* info, bool wide, bool unaligned);
 
   void prefetchr  (LIR_Opr src);
   void prefetchw  (LIR_Opr src);
@@ -203,7 +213,7 @@
 
   void roundfp_op(LIR_Opr src, LIR_Opr tmp, LIR_Opr dest, bool pop_fpu_stack);
   void move_op(LIR_Opr src, LIR_Opr result, BasicType type,
-               LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned);
+               LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned, bool wide);
   void volatile_move_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info);
   void comp_mem_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info);  // info set for null exceptions
   void comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr result, LIR_Op2* op);
@@ -236,5 +246,13 @@
 
   void verify_oop_map(CodeEmitInfo* info);
 
-  #include "incls/_c1_LIRAssembler_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "c1_LIRAssembler_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_LIRAssembler_sparc.hpp"
+#endif
+
 };
+
+#endif // SHARE_VM_C1_C1_LIRASSEMBLER_HPP
--- a/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRGenerator.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_LIRGenerator.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "ci/ciArrayKlass.hpp"
+#include "ci/ciCPCache.hpp"
+#include "ci/ciInstance.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/bitMap.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/heapRegion.hpp"
+#endif
 
 #ifdef ASSERT
 #define __ gen()->lir(__FILE__, __LINE__)->
@@ -822,11 +836,8 @@
   if (if_instr->should_profile()) {
     ciMethod* method = if_instr->profiled_method();
     assert(method != NULL, "method should be set if branch is profiled");
-    ciMethodData* md = method->method_data();
-    if (md == NULL) {
-      bailout("out of memory building methodDataOop");
-      return;
-    }
+    ciMethodData* md = method->method_data_or_null();
+    assert(md != NULL, "Sanity");
     ciProfileData* data = md->bci_to_data(if_instr->profiled_bci());
     assert(data != NULL, "must have profiling data");
     assert(data->is_BranchData(), "need BranchData for two-way branches");
@@ -850,11 +861,11 @@
     // MDO cells are intptr_t, so the data_reg width is arch-dependent.
     LIR_Opr data_reg = new_pointer_register();
     LIR_Address* data_addr = new LIR_Address(md_reg, data_offset_reg, data_reg->type());
-    __ move(LIR_OprFact::address(data_addr), data_reg);
+    __ move(data_addr, data_reg);
     // Use leal instead of add to avoid destroying condition codes on x86
     LIR_Address* fake_incr_value = new LIR_Address(data_reg, DataLayout::counter_increment, T_INT);
     __ leal(LIR_OprFact::address(fake_incr_value), data_reg);
-    __ move(data_reg, LIR_OprFact::address(data_addr));
+    __ move(data_reg, data_addr);
   }
 }
 
@@ -995,12 +1006,12 @@
                    operand_for_instruction(phi));
 
   LIR_Opr thread_reg = getThreadPointer();
-  __ move(new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT),
-          exceptionOopOpr());
-  __ move(LIR_OprFact::oopConst(NULL),
-          new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT));
-  __ move(LIR_OprFact::oopConst(NULL),
-          new LIR_Address(thread_reg, in_bytes(JavaThread::exception_pc_offset()), T_OBJECT));
+  __ move_wide(new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT),
+               exceptionOopOpr());
+  __ move_wide(LIR_OprFact::oopConst(NULL),
+               new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT));
+  __ move_wide(LIR_OprFact::oopConst(NULL),
+               new LIR_Address(thread_reg, in_bytes(JavaThread::exception_pc_offset()), T_OBJECT));
 
   LIR_Opr result = new_register(T_OBJECT);
   __ move(exceptionOopOpr(), result);
@@ -1071,7 +1082,7 @@
 void LIRGenerator::do_Return(Return* x) {
   if (compilation()->env()->dtrace_method_probes()) {
     BasicTypeList signature;
-    signature.append(T_INT);    // thread
+    signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT));    // thread
     signature.append(T_OBJECT); // methodOop
     LIR_OprList* args = new LIR_OprList();
     args->append(getThreadPointer());
@@ -1108,8 +1119,8 @@
     info = state_for(x);
   }
   __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_OBJECT), result, info);
-  __ move(new LIR_Address(result, Klass::java_mirror_offset_in_bytes() +
-                          klassOopDesc::klass_part_offset_in_bytes(), T_OBJECT), result);
+  __ move_wide(new LIR_Address(result, Klass::java_mirror_offset_in_bytes() +
+                               klassOopDesc::klass_part_offset_in_bytes(), T_OBJECT), result);
 }
 
 
@@ -1117,7 +1128,7 @@
 void LIRGenerator::do_currentThread(Intrinsic* x) {
   assert(x->number_of_arguments() == 0, "wrong type");
   LIR_Opr reg = rlock_result(x);
-  __ load(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::threadObj_offset()), T_OBJECT), reg);
+  __ move_wide(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::threadObj_offset()), T_OBJECT), reg);
 }
 
 
@@ -1894,7 +1905,11 @@
   if (x->may_be_unaligned() && (dst_type == T_LONG || dst_type == T_DOUBLE)) {
     __ unaligned_move(addr, reg);
   } else {
-    __ move(addr, reg);
+    if (dst_type == T_OBJECT && x->is_wide()) {
+      __ move_wide(addr, reg);
+    } else {
+      __ move(addr, reg);
+    }
   }
 }
 
@@ -2201,11 +2216,8 @@
   if (x->should_profile()) {
     ciMethod* method = x->profiled_method();
     assert(method != NULL, "method should be set if branch is profiled");
-    ciMethodData* md = method->method_data();
-    if (md == NULL) {
-      bailout("out of memory building methodDataOop");
-      return;
-    }
+    ciMethodData* md = method->method_data_or_null();
+    assert(md != NULL, "Sanity");
     ciProfileData* data = md->bci_to_data(x->profiled_bci());
     assert(data != NULL, "must have profiling data");
     int offset;
@@ -2273,7 +2285,7 @@
 
   if (compilation()->env()->dtrace_method_probes()) {
     BasicTypeList signature;
-    signature.append(T_INT);    // thread
+    signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT));    // thread
     signature.append(T_OBJECT); // methodOop
     LIR_OprList* args = new LIR_OprList();
     args->append(getThreadPointer());
@@ -2338,11 +2350,14 @@
     } else {
       LIR_Address* addr = loc->as_address_ptr();
       param->load_for_store(addr->type());
-      if (addr->type() == T_LONG || addr->type() == T_DOUBLE) {
-        __ unaligned_move(param->result(), addr);
-      } else {
-        __ move(param->result(), addr);
-      }
+      if (addr->type() == T_OBJECT) {
+        __ move_wide(param->result(), addr);
+      } else
+        if (addr->type() == T_LONG || addr->type() == T_DOUBLE) {
+          __ unaligned_move(param->result(), addr);
+        } else {
+          __ move(param->result(), addr);
+        }
     }
   }
 
@@ -2354,7 +2369,7 @@
     } else {
       assert(loc->is_address(), "just checking");
       receiver->load_for_store(T_OBJECT);
-      __ move(receiver->result(), loc);
+      __ move_wide(receiver->result(), loc->as_address_ptr());
     }
   }
 }
@@ -2702,7 +2717,9 @@
   } else if (level == CompLevel_full_profile) {
     offset = in_bytes(backedge ? methodDataOopDesc::backedge_counter_offset() :
                                  methodDataOopDesc::invocation_counter_offset());
-    __ oop2reg(method->method_data()->constant_encoding(), counter_holder);
+    ciMethodData* md = method->method_data_or_null();
+    assert(md != NULL, "Sanity");
+    __ oop2reg(md->constant_encoding(), counter_holder);
     meth = new_register(T_OBJECT);
     __ oop2reg(method->constant_encoding(), meth);
   } else {
--- a/src/share/vm/c1/c1_LIRGenerator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LIRGenerator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_LIRGENERATOR_HPP
+#define SHARE_VM_C1_C1_LIRGENERATOR_HPP
+
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LIR.hpp"
+#include "ci/ciMethodData.hpp"
+#include "utilities/sizes.hpp"
+
 // The classes responsible for code emission and register allocation
 
 
@@ -596,3 +604,5 @@
   jdouble   get_jdouble_constant() const;
   jint      get_address_constant() const;
 };
+
+#endif // SHARE_VM_C1_C1_LIRGENERATOR_HPP
--- a/src/share/vm/c1/c1_LinearScan.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LinearScan.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_LinearScan.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_CFGPrinter.hpp"
+#include "c1/c1_CodeStubs.hpp"
+#include "c1/c1_Compilation.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_LIRGenerator.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "utilities/bitMap.inline.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vmreg_zero.inline.hpp"
+#endif
 
 
 #ifndef PRODUCT
@@ -1256,7 +1273,7 @@
   int caller_save_registers[LinearScan::nof_regs];
 
   int i;
-  for (i = 0; i < FrameMap::nof_caller_save_cpu_regs; i++) {
+  for (i = 0; i < FrameMap::nof_caller_save_cpu_regs(); i++) {
     LIR_Opr opr = FrameMap::caller_save_cpu_reg_at(i);
     assert(opr->is_valid() && opr->is_register(), "FrameMap should not return invalid operands");
     assert(reg_numHi(opr) == -1, "missing addition of range for hi-register");
@@ -3540,7 +3557,7 @@
 
     // invalidate all caller save registers at calls
     if (visitor.has_call()) {
-      for (j = 0; j < FrameMap::nof_caller_save_cpu_regs; j++) {
+      for (j = 0; j < FrameMap::nof_caller_save_cpu_regs(); j++) {
         state_put(input_state, reg_num(FrameMap::caller_save_cpu_reg_at(j)), NULL);
       }
       for (j = 0; j < FrameMap::nof_caller_save_fpu_regs; j++) {
@@ -5579,7 +5596,7 @@
     _last_reg = pd_last_fpu_reg;
   } else {
     _first_reg = pd_first_cpu_reg;
-    _last_reg = pd_last_cpu_reg;
+    _last_reg = FrameMap::last_cpu_reg();
   }
 
   assert(0 <= _first_reg && _first_reg < LinearScan::nof_regs, "out of range");
--- a/src/share/vm/c1/c1_LinearScan.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_LinearScan.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_LINEARSCAN_HPP
+#define SHARE_VM_C1_C1_LINEARSCAN_HPP
+
+#include "c1/c1_FpuStackSim.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LIR.hpp"
+#include "c1/c1_LIRGenerator.hpp"
+
 class DebugInfoCache;
 class FpuStackAllocator;
 class IRScopeDebugInfo;
@@ -955,4 +965,12 @@
 
 
 // Pick up platform-dependent implementation details
-# include "incls/_c1_LinearScan_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "c1_LinearScan_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_LinearScan_sparc.hpp"
+#endif
+
+
+#endif // SHARE_VM_C1_C1_LINEARSCAN_HPP
--- a/src/share/vm/c1/c1_MacroAssembler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_MacroAssembler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_MACROASSEMBLER_HPP
+#define SHARE_VM_C1_C1_MACROASSEMBLER_HPP
+
+#include "asm/assembler.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+#endif
+
 class CodeEmitInfo;
 
 class C1_MacroAssembler: public MacroAssembler {
@@ -41,7 +55,13 @@
   void verify_stack_oop(int offset) PRODUCT_RETURN;
   void verify_not_null_oop(Register r)  PRODUCT_RETURN;
 
-#include "incls/_c1_MacroAssembler_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "c1_MacroAssembler_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_MacroAssembler_sparc.hpp"
+#endif
+
 };
 
 
@@ -80,3 +100,5 @@
   int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2);
   int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2, Register arg3);
 };
+
+#endif // SHARE_VM_C1_C1_MACROASSEMBLER_HPP
--- a/src/share/vm/c1/c1_Optimizer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Optimizer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Optimizer.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Canonicalizer.hpp"
+#include "c1/c1_Optimizer.hpp"
+#include "c1/c1_ValueMap.hpp"
+#include "c1/c1_ValueSet.hpp"
+#include "c1/c1_ValueStack.hpp"
+#include "utilities/bitMap.inline.hpp"
 
 define_array(ValueSetArray, ValueSet*);
 define_stack(ValueSetList, ValueSetArray);
--- a/src/share/vm/c1/c1_Optimizer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Optimizer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_OPTIMIZER_HPP
+#define SHARE_VM_C1_C1_OPTIMIZER_HPP
+
+#include "c1/c1_IR.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "memory/allocation.hpp"
+
 class Optimizer VALUE_OBJ_CLASS_SPEC {
  private:
   IR* _ir;
@@ -35,3 +42,5 @@
   void eliminate_blocks();
   void eliminate_null_checks();
 };
+
+#endif // SHARE_VM_C1_C1_OPTIMIZER_HPP
--- a/src/share/vm/c1/c1_Runtime1.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Runtime1.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,41 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Runtime1.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/codeBuffer.hpp"
+#include "c1/c1_CodeStubs.hpp"
+#include "c1/c1_Defs.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIRAssembler.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/codeBlob.hpp"
+#include "code/compiledIC.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/disassembler.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/events.hpp"
 
 
 // Implementation of StubAssembler
@@ -1183,7 +1216,7 @@
     memmove(dst_addr, src_addr, length << l2es);
     return ac_ok;
   } else if (src->is_objArray() && dst->is_objArray()) {
-    if (UseCompressedOops) {  // will need for tiered
+    if (UseCompressedOops) {
       narrowOop *src_addr  = objArrayOop(src)->obj_at_addr<narrowOop>(src_pos);
       narrowOop *dst_addr  = objArrayOop(dst)->obj_at_addr<narrowOop>(dst_pos);
       return obj_arraycopy_work(src, src_addr, dst, dst_addr, length);
@@ -1219,10 +1252,11 @@
   assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well.");
   if (UseCompressedOops) {
     bs->write_ref_array_pre((narrowOop*)dst, num);
+    Copy::conjoint_oops_atomic((narrowOop*) src, (narrowOop*) dst, num);
   } else {
     bs->write_ref_array_pre((oop*)dst, num);
+    Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num);
   }
-  Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num);
   bs->write_ref_array(dst, num);
 JRT_END
 
--- a/src/share/vm/c1/c1_Runtime1.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_Runtime1.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_RUNTIME1_HPP
+#define SHARE_VM_C1_C1_RUNTIME1_HPP
+
+#include "c1/c1_FrameMap.hpp"
+#include "code/stubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/deoptimization.hpp"
+
 class StubAssembler;
 
 // The Runtime1 holds all assembly stubs and VM
@@ -185,3 +194,5 @@
 
   static void print_statistics()                 PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_C1_C1_RUNTIME1_HPP
--- a/src/share/vm/c1/c1_ValueMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_ValueMap.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Canonicalizer.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_ValueMap.hpp"
+#include "utilities/bitMap.inline.hpp"
 
 
 #ifndef PRODUCT
--- a/src/share/vm/c1/c1_ValueMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_VALUEMAP_HPP
+#define SHARE_VM_C1_C1_VALUEMAP_HPP
+
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_ValueSet.hpp"
+#include "memory/allocation.hpp"
+
 class ValueMapEntry: public CompilationResourceObj {
  private:
   intx           _hash;
@@ -226,3 +233,5 @@
   // main entry point that performs global value numbering
   GlobalValueNumbering(IR* ir);
 };
+
+#endif // SHARE_VM_C1_C1_VALUEMAP_HPP
--- a/src/share/vm/c1/c1_ValueSet.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueSet.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,6 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_ValueSet.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_ValueSet.hpp"
+
--- a/src/share/vm/c1/c1_ValueSet.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueSet.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_VALUESET_HPP
+#define SHARE_VM_C1_C1_VALUESET_HPP
+
+#include "c1/c1_Instruction.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/bitMap.inline.hpp"
+
 // A ValueSet is a simple abstraction on top of a BitMap representing
 // a set of Instructions. Currently it assumes that the number of
 // instructions is fixed during its lifetime; should make it
@@ -93,3 +100,5 @@
 inline bool ValueSet::equals(ValueSet* other) {
   return _map.is_same(other->_map);
 }
+
+#endif // SHARE_VM_C1_C1_VALUESET_HPP
--- a/src/share/vm/c1/c1_ValueStack.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueStack.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c1_ValueStack.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_IR.hpp"
+#include "c1/c1_InstructionPrinter.hpp"
+#include "c1/c1_ValueStack.hpp"
 
 
 // Implementation of ValueStack
--- a/src/share/vm/c1/c1_ValueStack.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueStack.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_VALUESTACK_HPP
+#define SHARE_VM_C1_C1_VALUESTACK_HPP
+
+#include "c1/c1_Instruction.hpp"
+
 class ValueStack: public CompilationResourceObj {
  public:
   enum Kind {
@@ -322,3 +327,5 @@
     }                                                                                          \
   }                                                                                            \
 }
+
+#endif // SHARE_VM_C1_C1_VALUESTACK_HPP
--- a/src/share/vm/c1/c1_ValueType.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueType.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_ValueType.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_ValueType.hpp"
+#include "ci/ciArray.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciNullObject.hpp"
 
 
 // predefined types
--- a/src/share/vm/c1/c1_ValueType.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_ValueType.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_VALUETYPE_HPP
+#define SHARE_VM_C1_C1_VALUETYPE_HPP
+
+#include "c1/c1_Compilation.hpp"
+#include "ci/ciConstant.hpp"
+
 // type hierarchy
 class ValueType;
 class   VoidType;
@@ -419,3 +425,5 @@
 BasicType  as_BasicType(ValueType* type);
 
 inline ValueType* as_ValueType(ciType* type) { return as_ValueType(type->basic_type()); }
+
+#endif // SHARE_VM_C1_C1_VALUETYPE_HPP
--- a/src/share/vm/c1/c1_globals.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_globals.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c1_globals.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_globals.hpp"
 
 C1_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
--- a/src/share/vm/c1/c1_globals.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/c1/c1_globals.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,26 @@
  *
  */
 
+#ifndef SHARE_VM_C1_C1_GLOBALS_HPP
+#define SHARE_VM_C1_C1_GLOBALS_HPP
+
+#include "runtime/globals.hpp"
+#ifdef TARGET_ARCH_x86
+# include "c1_globals_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_globals_sparc.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "c1_globals_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "c1_globals_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "c1_globals_windows.hpp"
+#endif
+
 //
 // Defines all global flags used by the client compiler.
 //
@@ -313,6 +333,7 @@
 
 
 // Read default values for c1 globals
-// #include "incls/_c1_globals_pd.hpp.incl"
 
 C1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_NOTPRODUCT_FLAG)
+
+#endif // SHARE_VM_C1_C1_GLOBALS_HPP
--- a/src/share/vm/ci/bcEscapeAnalyzer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,15 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "ci/bcEscapeAnalyzer.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciMethodBlocks.hpp"
+#include "ci/ciStreams.hpp"
+#include "interpreter/bytecode.hpp"
+#include "utilities/bitMap.inline.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_bcEscapeAnalyzer.cpp.incl"
 
 
 #ifndef PRODUCT
--- a/src/share/vm/ci/bcEscapeAnalyzer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/bcEscapeAnalyzer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_CI_BCESCAPEANALYZER_HPP
+#define SHARE_VM_CI_BCESCAPEANALYZER_HPP
+
+#ifdef COMPILER2
+#include "ci/ciMethod.hpp"
+#include "ci/ciMethodData.hpp"
+#include "code/dependencies.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/growableArray.hpp"
+#endif
+
 // This class implements a fast, conservative analysis of effect of methods
 // on the escape state of their arguments.  The analysis is at the bytecode
 // level.
@@ -147,3 +159,5 @@
   void dump();
 #endif
 };
+
+#endif // SHARE_VM_CI_BCESCAPEANALYZER_HPP
--- a/src/share/vm/ci/ciArray.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciArray.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciArray.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciArray.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciArray
 //
--- a/src/share/vm/ci/ciArray.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciArray.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIARRAY_HPP
+#define SHARE_VM_CI_CIARRAY_HPP
+
+#include "ci/ciObject.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/typeArrayOop.hpp"
+
 // ciArray
 //
 // This class represents an arrayOop in the HotSpot virtual
@@ -50,3 +58,5 @@
   bool is_array()        { return true; }
   bool is_java_object()  { return true; }
 };
+
+#endif // SHARE_VM_CI_CIARRAY_HPP
--- a/src/share/vm/ci/ciArrayKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciArrayKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciArrayKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciArrayKlass.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciArrayKlass
 //
--- a/src/share/vm/ci/ciArrayKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciArrayKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIARRAYKLASS_HPP
+#define SHARE_VM_CI_CIARRAYKLASS_HPP
+
+#include "ci/ciKlass.hpp"
+
 // ciArrayKlass
 //
 // This class, and its subclasses represent klassOops in the
@@ -57,3 +62,5 @@
 
   static ciArrayKlass* make(ciType* element_type);
 };
+
+#endif // SHARE_VM_CI_CIARRAYKLASS_HPP
--- a/src/share/vm/ci/ciArrayKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciArrayKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIARRAYKLASSKLASS_HPP
+#define SHARE_VM_CI_CIARRAYKLASSKLASS_HPP
+
+#include "ci/ciKlassKlass.hpp"
+
 // ciArrayKlassKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -41,3 +46,5 @@
   // What kind of ciObject is this?
   bool is_array_klass_klass() { return true; }
 };
+
+#endif // SHARE_VM_CI_CIARRAYKLASSKLASS_HPP
--- a/src/share/vm/ci/ciCPCache.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciCPCache.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciCPCache.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciCPCache.hpp"
+#include "ci/ciUtilities.hpp"
+#include "oops/cpCacheOop.hpp"
 
 // ciCPCache
 
--- a/src/share/vm/ci/ciCPCache.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciCPCache.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CICPCACHE_HPP
+#define SHARE_VM_CI_CICPCACHE_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciObject.hpp"
+#include "oops/cpCacheOop.hpp"
+
 // ciCPCache
 //
 // This class represents a constant pool cache.
@@ -57,3 +64,5 @@
 
   void print();
 };
+
+#endif // SHARE_VM_CI_CICPCACHE_HPP
--- a/src/share/vm/ci/ciCallProfile.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciCallProfile.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CICALLPROFILE_HPP
+#define SHARE_VM_CI_CICALLPROFILE_HPP
+
+#include "ci/ciClassList.hpp"
+#include "memory/allocation.hpp"
+
 // ciCallProfile
 //
 // This class is used to determine the frequently called method
@@ -73,3 +79,5 @@
     return _receiver[i];
   }
 };
+
+#endif // SHARE_VM_CI_CICALLPROFILE_HPP
--- a/src/share/vm/ci/ciCallSite.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciCallSite.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciCallSite.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciCallSite.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciCallSite
 
--- a/src/share/vm/ci/ciCallSite.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciCallSite.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CICALLSITE_HPP
+#define SHARE_VM_CI_CICALLSITE_HPP
+
+#include "ci/ciInstance.hpp"
+
 // ciCallSite
 //
 // The class represents a java.dyn.CallSite object.
@@ -37,3 +42,5 @@
 
   void print();
 };
+
+#endif // SHARE_VM_CI_CICALLSITE_HPP
--- a/src/share/vm/ci/ciClassList.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciClassList.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CICLASSLIST_HPP
+#define SHARE_VM_CI_CICLASSLIST_HPP
+
 class ciEnv;
 class ciObjectFactory;
 class ciConstantPoolCache;
@@ -118,3 +121,5 @@
 friend class ciArrayKlassKlass;        \
 friend class ciObjArrayKlassKlass;     \
 friend class ciTypeArrayKlassKlass;
+
+#endif // SHARE_VM_CI_CICLASSLIST_HPP
--- a/src/share/vm/ci/ciConstant.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciConstant.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciConstant.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciUtilities.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
 
 // ciConstant
 //
--- a/src/share/vm/ci/ciConstant.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciConstant.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CICONSTANT_HPP
+#define SHARE_VM_CI_CICONSTANT_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciNullObject.hpp"
+
 // ciConstant
 //
 // This class represents a constant value.
@@ -110,3 +116,5 @@
   // Debugging output
   void print();
 };
+
+#endif // SHARE_VM_CI_CICONSTANT_HPP
--- a/src/share/vm/ci/ciConstantPoolCache.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciConstantPoolCache.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciConstantPoolCache.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciConstantPoolCache.hpp"
+#include "ci/ciUtilities.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
 
 // ciConstantPoolCache
 //
--- a/src/share/vm/ci/ciConstantPoolCache.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciConstantPoolCache.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CICONSTANTPOOLCACHE_HPP
+#define SHARE_VM_CI_CICONSTANTPOOLCACHE_HPP
+
+#include "memory/resourceArea.hpp"
+#include "utilities/growableArray.hpp"
+
 // ciConstantPoolCache
 //
 // The class caches indexed constant pool lookups.
@@ -45,3 +51,5 @@
 
   void print();
 };
+
+#endif // SHARE_VM_CI_CICONSTANTPOOLCACHE_HPP
--- a/src/share/vm/ci/ciEnv.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciEnv.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,44 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciEnv.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciEnv.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciInstanceKlassKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciNullObject.hpp"
+#include "ci/ciObjArrayKlassKlass.hpp"
+#include "ci/ciTypeArrayKlassKlass.hpp"
+#include "ci/ciUtilities.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/scopeDesc.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/compileLog.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/init.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "utilities/dtrace.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 // ciEnv
 //
--- a/src/share/vm/ci/ciEnv.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciEnv.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIENV_HPP
+#define SHARE_VM_CI_CIENV_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciObjectFactory.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/dependencies.hpp"
+#include "code/exceptionHandlerTable.hpp"
+#include "compiler/oopMap.hpp"
+#include "runtime/thread.hpp"
+
 class CompileTask;
 
 // ciEnv
@@ -390,3 +402,5 @@
   void record_method_not_compilable(const char* reason, bool all_tiers = true);
   void record_out_of_memory_failure();
 };
+
+#endif // SHARE_VM_CI_CIENV_HPP
--- a/src/share/vm/ci/ciExceptionHandler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciExceptionHandler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciExceptionHandler.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciExceptionHandler.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciExceptionHandler
 //
--- a/src/share/vm/ci/ciExceptionHandler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciExceptionHandler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIEXCEPTIONHANDLER_HPP
+#define SHARE_VM_CI_CIEXCEPTIONHANDLER_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciInstanceKlass.hpp"
+
 // ciExceptionHandler
 //
 // This class represents an exception handler for a method.
@@ -73,3 +79,5 @@
 
   void      print();
 };
+
+#endif // SHARE_VM_CI_CIEXCEPTIONHANDLER_HPP
--- a/src/share/vm/ci/ciField.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciField.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciField.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciUtilities.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/fieldDescriptor.hpp"
 
 // ciField
 //
--- a/src/share/vm/ci/ciField.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciField.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIFIELD_HPP
+#define SHARE_VM_CI_CIFIELD_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciFlags.hpp"
+#include "ci/ciInstance.hpp"
+
 // ciField
 //
 // This class represents the result of a field lookup in the VM.
@@ -176,3 +184,5 @@
   void print();
   void print_name_on(outputStream* st);
 };
+
+#endif // SHARE_VM_CI_CIFIELD_HPP
--- a/src/share/vm/ci/ciFlags.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciFlags.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciFlags.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciFlags.hpp"
 
 // ciFlags
 //
--- a/src/share/vm/ci/ciFlags.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciFlags.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIFLAGS_HPP
+#define SHARE_VM_CI_CIFLAGS_HPP
+
+#include "ci/ciClassList.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "utilities/accessFlags.hpp"
+
 // ciFlags
 //
 // This class represents klass or method flags.
@@ -59,3 +67,5 @@
   void print_member_flags(outputStream* st = tty);
   void print(outputStream* st = tty);
 };
+
+#endif // SHARE_VM_CI_CIFLAGS_HPP
--- a/src/share/vm/ci/ciInstance.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciInstance.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciInstance.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciUtilities.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "oops/oop.inline.hpp"
 
 // ciInstance
 //
--- a/src/share/vm/ci/ciInstance.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciInstance.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIINSTANCE_HPP
+#define SHARE_VM_CI_CIINSTANCE_HPP
+
+#include "ci/ciObject.hpp"
+#include "oops/instanceOop.hpp"
+
 // ciInstance
 //
 // This class represents an instanceOop in the HotSpot virtual
@@ -59,3 +65,5 @@
   // Constant value of a field at the specified offset.
   ciConstant field_value_by_offset(int field_offset);
 };
+
+#endif // SHARE_VM_CI_CIINSTANCE_HPP
--- a/src/share/vm/ci/ciInstanceKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciInstanceKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciInstanceKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciUtilities.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/fieldDescriptor.hpp"
 
 // ciInstanceKlass
 //
--- a/src/share/vm/ci/ciInstanceKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciInstanceKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIINSTANCEKLASS_HPP
+#define SHARE_VM_CI_CIINSTANCEKLASS_HPP
+
+#include "ci/ciConstantPoolCache.hpp"
+#include "ci/ciFlags.hpp"
+#include "ci/ciInstanceKlassKlass.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciSymbol.hpp"
+
 // ciInstanceKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -228,3 +237,5 @@
   bool is_instance_klass() { return true; }
   bool is_java_klass()     { return true; }
 };
+
+#endif // SHARE_VM_CI_CIINSTANCEKLASS_HPP
--- a/src/share/vm/ci/ciInstanceKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciInstanceKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciInstanceKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciInstanceKlassKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciInstanceKlassKlass
 //
--- a/src/share/vm/ci/ciInstanceKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciInstanceKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIINSTANCEKLASSKLASS_HPP
+#define SHARE_VM_CI_CIINSTANCEKLASSKLASS_HPP
+
+#include "ci/ciKlassKlass.hpp"
+
 // ciInstanceKlassKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -48,3 +53,5 @@
   // Return the distinguished ciInstanceKlassKlass instance.
   static ciInstanceKlassKlass* make();
 };
+
+#endif // SHARE_VM_CI_CIINSTANCEKLASSKLASS_HPP
--- a/src/share/vm/ci/ciKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciSymbol.hpp"
+#include "ci/ciUtilities.hpp"
+#include "oops/oop.inline.hpp"
 
 // ciKlass
 //
--- a/src/share/vm/ci/ciKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIKLASS_HPP
+#define SHARE_VM_CI_CIKLASS_HPP
+
+#include "ci/ciType.hpp"
+#include "oops/klassOop.hpp"
+
 // ciKlass
 //
 // This class and its subclasses represent klassOops in the
@@ -117,3 +123,5 @@
 
   void print_name_on(outputStream* st);
 };
+
+#endif // SHARE_VM_CI_CIKLASS_HPP
--- a/src/share/vm/ci/ciKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciKlassKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciKlassKlass
 //
--- a/src/share/vm/ci/ciKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIKLASSKLASS_HPP
+#define SHARE_VM_CI_CIKLASSKLASS_HPP
+
+#include "ci/ciKlass.hpp"
+#include "ci/ciSymbol.hpp"
+
 // ciKlassKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -49,3 +55,5 @@
   // Return the distinguished ciKlassKlass instance.
   static ciKlassKlass* make();
 };
+
+#endif // SHARE_VM_CI_CIKLASSKLASS_HPP
--- a/src/share/vm/ci/ciMethod.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethod.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,41 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciMethod.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciCallProfile.hpp"
+#include "ci/ciExceptionHandler.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciMethodBlocks.hpp"
+#include "ci/ciMethodData.hpp"
+#include "ci/ciMethodKlass.hpp"
+#include "ci/ciStreams.hpp"
+#include "ci/ciSymbol.hpp"
+#include "ci/ciUtilities.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "compiler/abstractCompiler.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "compiler/methodLiveness.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/generateOopMap.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/deoptimization.hpp"
+#include "utilities/bitMap.inline.hpp"
+#include "utilities/xmlstream.hpp"
+#ifdef COMPILER2
+#include "ci/bcEscapeAnalyzer.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "oops/methodOop.hpp"
+#endif
+#ifdef SHARK
+#include "ci/ciTypeFlow.hpp"
+#include "oops/methodOop.hpp"
+#endif
 
 // ciMethod
 //
@@ -764,12 +797,13 @@
 
 
 // ------------------------------------------------------------------
-// ciMethod::build_method_data
+// ciMethod::ensure_method_data
 //
 // Generate new methodDataOop objects at compile time.
-void ciMethod::build_method_data(methodHandle h_m) {
+// Return true if allocation was successful or no MDO is required.
+bool ciMethod::ensure_method_data(methodHandle h_m) {
   EXCEPTION_CONTEXT;
-  if (is_native() || is_abstract() || h_m()->is_accessor()) return;
+  if (is_native() || is_abstract() || h_m()->is_accessor()) return true;
   if (h_m()->method_data() == NULL) {
     methodOopDesc::build_interpreter_method_data(h_m, THREAD);
     if (HAS_PENDING_EXCEPTION) {
@@ -779,18 +813,22 @@
   if (h_m()->method_data() != NULL) {
     _method_data = CURRENT_ENV->get_object(h_m()->method_data())->as_method_data();
     _method_data->load_data();
+    return true;
   } else {
     _method_data = CURRENT_ENV->get_empty_methodData();
+    return false;
   }
 }
 
 // public, retroactive version
-void ciMethod::build_method_data() {
+bool ciMethod::ensure_method_data() {
+  bool result = true;
   if (_method_data == NULL || _method_data->is_empty()) {
     GUARDED_VM_ENTRY({
-      build_method_data(get_methodOop());
+      result = ensure_method_data(get_methodOop());
     });
   }
+  return result;
 }
 
 
@@ -806,11 +844,6 @@
   Thread* my_thread = JavaThread::current();
   methodHandle h_m(my_thread, get_methodOop());
 
-  // Create an MDO for the inlinee
-  if (TieredCompilation && is_c1_compile(env->comp_level())) {
-    build_method_data(h_m);
-  }
-
   if (h_m()->method_data() != NULL) {
     _method_data = CURRENT_ENV->get_object(h_m()->method_data())->as_method_data();
     _method_data->load_data();
@@ -821,6 +854,15 @@
 
 }
 
+// ------------------------------------------------------------------
+// ciMethod::method_data_or_null
+// Returns a pointer to ciMethodData if MDO exists on the VM side,
+// NULL otherwise.
+ciMethodData* ciMethod::method_data_or_null() {
+  ciMethodData *md = method_data();
+  if (md->is_empty()) return NULL;
+  return md;
+}
 
 // ------------------------------------------------------------------
 // ciMethod::will_link
--- a/src/share/vm/ci/ciMethod.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethod.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIMETHOD_HPP
+#define SHARE_VM_CI_CIMETHOD_HPP
+
+#include "ci/ciFlags.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciObject.hpp"
+#include "ci/ciSignature.hpp"
+#include "compiler/methodLiveness.hpp"
+#include "prims/methodHandles.hpp"
+#include "utilities/bitMap.hpp"
+
 class ciMethodBlocks;
 class MethodLiveness;
 class BitMap;
@@ -95,7 +106,7 @@
 
   void check_is_loaded() const                   { assert(is_loaded(), "not loaded"); }
 
-  void build_method_data(methodHandle h_m);
+  bool ensure_method_data(methodHandle h_m);
 
   void code_at_put(int bci, Bytecodes::Code code) {
     Bytecodes::check(code);
@@ -110,6 +121,7 @@
   ciSymbol* name() const                         { return _name; }
   ciInstanceKlass* holder() const                { return _holder; }
   ciMethodData* method_data();
+  ciMethodData* method_data_or_null();
 
   // Signature information.
   ciSignature* signature() const                 { return _signature; }
@@ -219,7 +231,7 @@
   bool has_unloaded_classes_in_signature();
   bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const;
   bool check_call(int refinfo_index, bool is_static) const;
-  void build_method_data();  // make sure it exists in the VM also
+  bool ensure_method_data();  // make sure it exists in the VM also
   int scale_count(int count, float prof_factor = 1.);  // make MDO count commensurate with IIC
 
   // JSR 292 support
@@ -269,3 +281,5 @@
     return MethodHandles::decode_method(get_oop(), receiver_limit_oop, flags);
   }
 };
+
+#endif // SHARE_VM_CI_CIMETHOD_HPP
--- a/src/share/vm/ci/ciMethodBlocks.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodBlocks.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciMethodBlocks.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethodBlocks.hpp"
+#include "ci/ciStreams.hpp"
+#include "interpreter/bytecode.hpp"
+#include "utilities/copy.hpp"
 
 // ciMethodBlocks
 
--- a/src/share/vm/ci/ciMethodBlocks.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodBlocks.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIMETHODBLOCKS_HPP
+#define SHARE_VM_CI_CIMETHODBLOCKS_HPP
+
+#include "ci/ciMethod.hpp"
+#include "memory/resourceArea.hpp"
+#include "utilities/growableArray.hpp"
+
 
 class ciBlock;
 
@@ -121,3 +128,5 @@
   void print_on(outputStream* st) const  PRODUCT_RETURN;
 #endif
 };
+
+#endif // SHARE_VM_CI_CIMETHODBLOCKS_HPP
--- a/src/share/vm/ci/ciMethodData.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodData.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciMethodData.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethodData.hpp"
+#include "ci/ciUtilities.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/deoptimization.hpp"
+#include "utilities/copy.hpp"
 
 // ciMethodData
 
--- a/src/share/vm/ci/ciMethodData.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodData.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIMETHODDATA_HPP
+#define SHARE_VM_CI_CIMETHODDATA_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciObject.hpp"
+#include "ci/ciUtilities.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/oop.inline.hpp"
+
 class ciBitData;
 class ciCounterData;
 class ciJumpData;
@@ -311,3 +321,5 @@
   void print_data_on(outputStream* st);
 #endif
 };
+
+#endif // SHARE_VM_CI_CIMETHODDATA_HPP
--- a/src/share/vm/ci/ciMethodHandle.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodHandle.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciMethodHandle.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciClassList.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciMethodHandle.hpp"
+#include "ci/ciUtilities.hpp"
+#include "prims/methodHandleWalk.hpp"
+#include "prims/methodHandles.hpp"
 
 // ciMethodHandle
 
--- a/src/share/vm/ci/ciMethodHandle.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodHandle.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIMETHODHANDLE_HPP
+#define SHARE_VM_CI_CIMETHODHANDLE_HPP
+
+#include "ci/ciInstance.hpp"
+#include "prims/methodHandles.hpp"
+
 // ciMethodHandle
 //
 // The class represents a java.dyn.MethodHandle object.
@@ -54,3 +60,5 @@
     return get_adapter(true);
   }
 };
+
+#endif // SHARE_VM_CI_CIMETHODHANDLE_HPP
--- a/src/share/vm/ci/ciMethodKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciMethodKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethodKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciMethodKlass
 //
--- a/src/share/vm/ci/ciMethodKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciMethodKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIMETHODKLASS_HPP
+#define SHARE_VM_CI_CIMETHODKLASS_HPP
+
+#include "ci/ciKlass.hpp"
+#include "ci/ciSymbol.hpp"
+
 // ciMethodKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -46,3 +52,5 @@
   // Return the distinguished ciMethodKlass instance.
   static ciMethodKlass* make();
 };
+
+#endif // SHARE_VM_CI_CIMETHODKLASS_HPP
--- a/src/share/vm/ci/ciNullObject.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciNullObject.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciNullObject.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciNullObject.hpp"
 
 // ciNullObject
 //
--- a/src/share/vm/ci/ciNullObject.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciNullObject.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CINULLOBJECT_HPP
+#define SHARE_VM_CI_CINULLOBJECT_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciObject.hpp"
+#include "ci/ciUtilities.hpp"
+
 // ciNullObject
 //
 // This class represents a null reference in the VM.
@@ -47,3 +54,5 @@
   // Get the distinguished instance of this klass.
   static ciNullObject* make();
 };
+
+#endif // SHARE_VM_CI_CINULLOBJECT_HPP
--- a/src/share/vm/ci/ciObjArray.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjArray.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciObjArray.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciNullObject.hpp"
+#include "ci/ciObjArray.hpp"
+#include "ci/ciUtilities.hpp"
+#include "oops/objArrayOop.hpp"
 
 // ciObjArray
 //
--- a/src/share/vm/ci/ciObjArray.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjArray.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIOBJARRAY_HPP
+#define SHARE_VM_CI_CIOBJARRAY_HPP
+
+#include "ci/ciArray.hpp"
+#include "ci/ciClassList.hpp"
+#include "oops/objArrayOop.hpp"
+
 // ciObjArray
 //
 // This class represents a ObjArrayOop in the HotSpot virtual
@@ -46,3 +53,5 @@
 
   ciObject* obj_at(int index);
 };
+
+#endif // SHARE_VM_CI_CIOBJARRAY_HPP
--- a/src/share/vm/ci/ciObjArrayKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjArrayKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciObjArrayKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciObjArrayKlassKlass.hpp"
+#include "ci/ciSymbol.hpp"
+#include "ci/ciUtilities.hpp"
+#include "oops/objArrayKlass.hpp"
 
 // ciObjArrayKlass
 //
--- a/src/share/vm/ci/ciObjArrayKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjArrayKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIOBJARRAYKLASS_HPP
+#define SHARE_VM_CI_CIOBJARRAYKLASS_HPP
+
+#include "ci/ciArrayKlass.hpp"
+
 // ciObjArrayKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -69,3 +74,5 @@
 
   static ciObjArrayKlass* make(ciKlass* element_klass);
 };
+
+#endif // SHARE_VM_CI_CIOBJARRAYKLASS_HPP
--- a/src/share/vm/ci/ciObjArrayKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjArrayKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciObjArrayKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciObjArrayKlassKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciObjArrayKlassKlass
 //
--- a/src/share/vm/ci/ciObjArrayKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjArrayKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIOBJARRAYKLASSKLASS_HPP
+#define SHARE_VM_CI_CIOBJARRAYKLASSKLASS_HPP
+
+#include "ci/ciArrayKlassKlass.hpp"
+
 // ciObjArrayKlassKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -48,3 +53,5 @@
   // Return the distinguished ciObjArrayKlassKlass instance.
   static ciObjArrayKlassKlass* make();
 };
+
+#endif // SHARE_VM_CI_CIOBJARRAYKLASSKLASS_HPP
--- a/src/share/vm/ci/ciObject.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObject.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciObject.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciObject.hpp"
+#include "ci/ciUtilities.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "oops/oop.inline2.hpp"
 
 // ciObject
 //
--- a/src/share/vm/ci/ciObject.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObject.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIOBJECT_HPP
+#define SHARE_VM_CI_CIOBJECT_HPP
+
+#include "ci/ciClassList.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/jniHandles.hpp"
+
 // ciObject
 //
 // This class represents an oop in the HotSpot virtual machine.
@@ -299,3 +307,5 @@
   // Print debugging output about the oop this ciObject represents.
   void print_oop(outputStream* st = tty);
 };
+
+#endif // SHARE_VM_CI_CIOBJECT_HPP
--- a/src/share/vm/ci/ciObjectFactory.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjectFactory.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,33 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciObjectFactory.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciCPCache.hpp"
+#include "ci/ciCallSite.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciInstanceKlassKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciMethodData.hpp"
+#include "ci/ciMethodHandle.hpp"
+#include "ci/ciMethodKlass.hpp"
+#include "ci/ciNullObject.hpp"
+#include "ci/ciObjArray.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciObjArrayKlassKlass.hpp"
+#include "ci/ciObjectFactory.hpp"
+#include "ci/ciSymbol.hpp"
+#include "ci/ciSymbolKlass.hpp"
+#include "ci/ciTypeArray.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
+#include "ci/ciTypeArrayKlassKlass.hpp"
+#include "ci/ciUtilities.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/fieldType.hpp"
 
 // ciObjectFactory
 //
--- a/src/share/vm/ci/ciObjectFactory.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciObjectFactory.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIOBJECTFACTORY_HPP
+#define SHARE_VM_CI_CIOBJECTFACTORY_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciObject.hpp"
+#include "utilities/growableArray.hpp"
+
 // ciObjectFactory
 //
 // This class handles requests for the creation of new instances
@@ -124,3 +131,5 @@
   void print_contents();
   void print();
 };
+
+#endif // SHARE_VM_CI_CIOBJECTFACTORY_HPP
--- a/src/share/vm/ci/ciSignature.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciSignature.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciSignature.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciSignature.hpp"
+#include "ci/ciUtilities.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/signature.hpp"
 
 // ciSignature
 //
--- a/src/share/vm/ci/ciSignature.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciSignature.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CISIGNATURE_HPP
+#define SHARE_VM_CI_CISIGNATURE_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciSymbol.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/growableArray.hpp"
+
 // ciSignature
 //
 // This class represents the signature of a method.
@@ -54,3 +62,5 @@
   void print_signature();
   void print();
 };
+
+#endif // SHARE_VM_CI_CISIGNATURE_HPP
--- a/src/share/vm/ci/ciStreams.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciStreams.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciStreams.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciCPCache.hpp"
+#include "ci/ciCallSite.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciStreams.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciExceptionHandlerStream
 //
--- a/src/share/vm/ci/ciStreams.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciStreams.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CISTREAMS_HPP
+#define SHARE_VM_CI_CISTREAMS_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciExceptionHandler.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "interpreter/bytecode.hpp"
+
 // ciBytecodeStream
 //
 // The class is used to iterate over the bytecodes of a method.
@@ -397,3 +406,5 @@
     return _method->_exception_handlers[_pos];
   }
 };
+
+#endif // SHARE_VM_CI_CISTREAMS_HPP
--- a/src/share/vm/ci/ciSymbol.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciSymbol.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciSymbol.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciSymbol.hpp"
+#include "ci/ciUtilities.hpp"
+#include "memory/oopFactory.hpp"
 
 // ------------------------------------------------------------------
 // ciSymbol::ciSymbol
--- a/src/share/vm/ci/ciSymbol.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciSymbol.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CISYMBOL_HPP
+#define SHARE_VM_CI_CISYMBOL_HPP
+
+#include "ci/ciObject.hpp"
+#include "ci/ciObjectFactory.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "oops/symbolOop.hpp"
+
 // ciSymbol
 //
 // This class represents a symbolOop in the HotSpot virtual
@@ -91,3 +99,5 @@
   VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE)
 #undef CI_SYMBOL_DECLARE
 };
+
+#endif // SHARE_VM_CI_CISYMBOL_HPP
--- a/src/share/vm/ci/ciSymbolKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciSymbolKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciSymbolKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciSymbolKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciSymbolKlass
 //
--- a/src/share/vm/ci/ciSymbolKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciSymbolKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CISYMBOLKLASS_HPP
+#define SHARE_VM_CI_CISYMBOLKLASS_HPP
+
+#include "ci/ciKlass.hpp"
+#include "ci/ciSymbol.hpp"
+
 // ciSymbolKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -50,3 +56,5 @@
   // Return the distinguished ciSymbolKlass instance.
   static ciSymbolKlass* make();
 };
+
+#endif // SHARE_VM_CI_CISYMBOLKLASS_HPP
--- a/src/share/vm/ci/ciType.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciType.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciType.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciType.hpp"
+#include "ci/ciUtilities.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "oops/oop.inline.hpp"
 
 ciType* ciType::_basic_types[T_CONFLICT+1];
 
--- a/src/share/vm/ci/ciType.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciType.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CITYPE_HPP
+#define SHARE_VM_CI_CITYPE_HPP
+
+#include "ci/ciObject.hpp"
+#include "oops/klassOop.hpp"
+
 // ciType
 //
 // This class represents either a class (T_OBJECT), array (T_ARRAY),
@@ -106,3 +112,5 @@
 
   static ciReturnAddress* make(int bci);
 };
+
+#endif // SHARE_VM_CI_CITYPE_HPP
--- a/src/share/vm/ci/ciTypeArray.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeArray.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciTypeArray.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciTypeArray.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciTypeArray
 //
--- a/src/share/vm/ci/ciTypeArray.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeArray.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CITYPEARRAY_HPP
+#define SHARE_VM_CI_CITYPEARRAY_HPP
+
+#include "ci/ciArray.hpp"
+#include "ci/ciClassList.hpp"
+#include "oops/typeArrayOop.hpp"
+
 // ciTypeArray
 //
 // This class represents a typeArrayOop in the HotSpot virtual
@@ -50,3 +57,5 @@
   jchar char_at(int index);
 
 };
+
+#endif // SHARE_VM_CI_CITYPEARRAY_HPP
--- a/src/share/vm/ci/ciTypeArrayKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeArrayKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciTypeArrayKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciTypeArrayKlass
 //
--- a/src/share/vm/ci/ciTypeArrayKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeArrayKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CITYPEARRAYKLASS_HPP
+#define SHARE_VM_CI_CITYPEARRAYKLASS_HPP
+
+#include "ci/ciArrayKlass.hpp"
+
 // ciTypeArrayKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -53,3 +58,5 @@
   // Make an array klass corresponding to the specified primitive type.
   static ciTypeArrayKlass* make(BasicType type);
 };
+
+#endif // SHARE_VM_CI_CITYPEARRAYKLASS_HPP
--- a/src/share/vm/ci/ciTypeArrayKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeArrayKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciTypeArrayKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciTypeArrayKlassKlass.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciTypeArrayKlassKlass
 //
--- a/src/share/vm/ci/ciTypeArrayKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeArrayKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CITYPEARRAYKLASSKLASS_HPP
+#define SHARE_VM_CI_CITYPEARRAYKLASSKLASS_HPP
+
+#include "ci/ciArrayKlassKlass.hpp"
+
 // ciTypeArrayKlassKlass
 //
 // This class represents a klassOop in the HotSpot virtual machine
@@ -49,3 +54,5 @@
   // Return the distinguished ciTypeArrayKlassKlass instance.
   static ciTypeArrayKlassKlass* make();
 };
+
+#endif // SHARE_VM_CI_CITYPEARRAYKLASSKLASS_HPP
--- a/src/share/vm/ci/ciTypeFlow.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeFlow.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciTypeFlow.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciMethodData.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciStreams.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "compiler/compileLog.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/deoptimization.hpp"
+#include "utilities/growableArray.hpp"
 
 // ciTypeFlow::JsrSet
 //
--- a/src/share/vm/ci/ciTypeFlow.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciTypeFlow.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CITYPEFLOW_HPP
+#define SHARE_VM_CI_CITYPEFLOW_HPP
+
+#ifdef COMPILER2
+#include "ci/ciEnv.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciMethodBlocks.hpp"
+#endif
+#ifdef SHARK
+#include "ci/ciEnv.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciMethodBlocks.hpp"
+#endif
+
 
 class ciTypeFlow : public ResourceObj {
 private:
@@ -924,3 +938,5 @@
 
   void rpo_print_on(outputStream* st) const PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_CI_CITYPEFLOW_HPP
--- a/src/share/vm/ci/ciUtilities.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciUtilities.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ciUtilities.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciUtilities.hpp"
 
 // ciUtilities
 //
--- a/src/share/vm/ci/ciUtilities.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/ciUtilities.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CI_CIUTILITIES_HPP
+#define SHARE_VM_CI_CIUTILITIES_HPP
+
+#include "ci/ciEnv.hpp"
+#include "runtime/interfaceSupport.hpp"
+
 // The following routines and definitions are used internally in the
 // compiler interface.
 
@@ -104,3 +110,5 @@
 
 const char* basictype_to_str(BasicType t);
 const char  basictype_to_char(BasicType t);
+
+#endif // SHARE_VM_CI_CIUTILITIES_HPP
--- a/src/share/vm/ci/compilerInterface.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/ci/compilerInterface.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,39 @@
  *
  */
 
+#ifndef SHARE_VM_CI_COMPILERINTERFACE_HPP
+#define SHARE_VM_CI_COMPILERINTERFACE_HPP
+
+#include "ci/ciArray.hpp"
+#include "ci/ciArrayKlass.hpp"
+#include "ci/ciArrayKlassKlass.hpp"
+#include "ci/ciCallProfile.hpp"
+#include "ci/ciConstant.hpp"
+#include "ci/ciEnv.hpp"
+#include "ci/ciExceptionHandler.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciFlags.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciInstanceKlassKlass.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciKlassKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciMethodKlass.hpp"
+#include "ci/ciNullObject.hpp"
+#include "ci/ciObjArray.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciObjArrayKlassKlass.hpp"
+#include "ci/ciObject.hpp"
+#include "ci/ciSignature.hpp"
+#include "ci/ciStreams.hpp"
+#include "ci/ciSymbol.hpp"
+#include "ci/ciSymbolKlass.hpp"
+#include "ci/ciTypeArray.hpp"
+#include "ci/ciTypeArrayKlass.hpp"
+#include "ci/ciTypeArrayKlassKlass.hpp"
+
 // This is a dummy file used for including the complete
 // compiler interface.
+
+#endif // SHARE_VM_CI_COMPILERINTERFACE_HPP
--- a/src/share/vm/classfile/classFileError.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/classFileError.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_classFileError.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classFileParser.hpp"
+#include "classfile/stackMapTable.hpp"
+#include "classfile/verifier.hpp"
 
 // Keep these in a separate file to prevent inlining
 
--- a/src/share/vm/classfile/classFileParser.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/classFileParser.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,34 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_classFileParser.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classFileParser.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/verificationType.hpp"
+#include "classfile/verifier.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klass.inline.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/klassVtable.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/perfData.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/timer.hpp"
+#include "services/classLoadingService.hpp"
+#include "services/threadService.hpp"
 
 // We generally try to create the oops directly when parsing, rather than
 // allocating temporary data structures and copying the bytes twice. A
@@ -73,12 +99,6 @@
   unsigned int hashValues[SymbolTable::symbol_alloc_batch_size];
   int names_count = 0;
 
-  // Side buffer for operands of variable-sized (InvokeDynamic) entries.
-  GrowableArray<int>* operands = NULL;
-#ifdef ASSERT
-  GrowableArray<int>* indy_instructions = new GrowableArray<int>(THREAD, 10);
-#endif
-
   // parsing  Index 0 is unused
   for (int index = 1; index < length; index++) {
     // Each of the following case guarantees one more byte in the stream
@@ -158,36 +178,20 @@
                "Class file version does not support constant tag %u in class file %s"),
               tag, CHECK);
           }
-          if (!AllowTransitionalJSR292 && tag == JVM_CONSTANT_InvokeDynamicTrans) {
-            classfile_parse_error(
+          cfs->guarantee_more(5, CHECK);  // bsm_index, nt, tag/access_flags
+          u2 bootstrap_specifier_index = cfs->get_u2_fast();
+          u2 name_and_type_index = cfs->get_u2_fast();
+          if (tag == JVM_CONSTANT_InvokeDynamicTrans) {
+            if (!AllowTransitionalJSR292)
+              classfile_parse_error(
                 "This JVM does not support transitional InvokeDynamic tag %u in class file %s",
                 tag, CHECK);
+            cp->invoke_dynamic_trans_at_put(index, bootstrap_specifier_index, name_and_type_index);
+            break;
           }
-          bool trans_no_argc = AllowTransitionalJSR292 && (tag == JVM_CONSTANT_InvokeDynamicTrans);
-          cfs->guarantee_more(7, CHECK);  // bsm_index, nt, argc, ..., tag/access_flags
-          u2 bootstrap_method_index = cfs->get_u2_fast();
-          u2 name_and_type_index = cfs->get_u2_fast();
-          int argument_count = trans_no_argc ? 0 : cfs->get_u2_fast();
-          cfs->guarantee_more(2*argument_count + 1, CHECK);  // argv[argc]..., tag/access_flags
-          int argv_offset = constantPoolOopDesc::_indy_argv_offset;
-          int op_count = argv_offset + argument_count;  // bsm, nt, argc, argv[]...
-          int op_base = start_operand_group(operands, op_count, CHECK);
-          assert(argv_offset == 3, "else adjust next 3 assignments");
-          operands->at_put(op_base + constantPoolOopDesc::_indy_bsm_offset, bootstrap_method_index);
-          operands->at_put(op_base + constantPoolOopDesc::_indy_nt_offset, name_and_type_index);
-          operands->at_put(op_base + constantPoolOopDesc::_indy_argc_offset, argument_count);
-          for (int arg_i = 0; arg_i < argument_count; arg_i++) {
-            int arg = cfs->get_u2_fast();
-            operands->at_put(op_base + constantPoolOopDesc::_indy_argv_offset + arg_i, arg);
-          }
-          cp->invoke_dynamic_at_put(index, op_base, op_count);
-#ifdef ASSERT
-          // Record the steps just taken for later checking.
-          indy_instructions->append(index);
-          indy_instructions->append(bootstrap_method_index);
-          indy_instructions->append(name_and_type_index);
-          indy_instructions->append(argument_count);
-#endif //ASSERT
+          if (_max_bootstrap_specifier_index < (int) bootstrap_specifier_index)
+            _max_bootstrap_specifier_index = (int) bootstrap_specifier_index;  // collect for later
+          cp->invoke_dynamic_at_put(index, bootstrap_specifier_index, name_and_type_index);
         }
         break;
       case JVM_CONSTANT_Integer :
@@ -290,23 +294,6 @@
     oopFactory::new_symbols(cp, names_count, names, lengths, indices, hashValues, CHECK);
   }
 
-  if (operands != NULL && operands->length() > 0) {
-    store_operand_array(operands, cp, CHECK);
-  }
-#ifdef ASSERT
-  // Re-assert the indy structures, now that assertion checking can work.
-  for (int indy_i = 0; indy_i < indy_instructions->length(); ) {
-    int index                  = indy_instructions->at(indy_i++);
-    int bootstrap_method_index = indy_instructions->at(indy_i++);
-    int name_and_type_index    = indy_instructions->at(indy_i++);
-    int argument_count         = indy_instructions->at(indy_i++);
-    assert(cp->check_invoke_dynamic_at(index,
-                                       bootstrap_method_index, name_and_type_index,
-                                       argument_count),
-           "indy structure is OK");
-  }
-#endif //ASSERT
-
   // Copy _current pointer of local copy back to stream().
 #ifdef ASSERT
   assert(cfs0->current() == old_current, "non-exclusive use of stream()");
@@ -314,41 +301,6 @@
   cfs0->set_current(cfs1.current());
 }
 
-int ClassFileParser::start_operand_group(GrowableArray<int>* &operands, int op_count, TRAPS) {
-  if (operands == NULL) {
-    operands = new GrowableArray<int>(THREAD, 100);
-    int fillp_offset = constantPoolOopDesc::_multi_operand_buffer_fill_pointer_offset;
-    while (operands->length() <= fillp_offset)
-      operands->append(0);  // force op_base > 0, for an error check
-    DEBUG_ONLY(operands->at_put(fillp_offset, (int)badHeapWordVal));
-  }
-  int cnt_pos = operands->append(op_count);
-  int arg_pos = operands->length();
-  operands->at_grow(arg_pos + op_count - 1);  // grow to include the operands
-  assert(operands->length() == arg_pos + op_count, "");
-  int op_base = cnt_pos - constantPoolOopDesc::_multi_operand_count_offset;
-  return op_base;
-}
-
-void ClassFileParser::store_operand_array(GrowableArray<int>* operands, constantPoolHandle cp, TRAPS) {
-  // Collect the buffer of operands from variable-sized entries into a permanent array.
-  int arraylen = operands->length();
-  int fillp_offset = constantPoolOopDesc::_multi_operand_buffer_fill_pointer_offset;
-  assert(operands->at(fillp_offset) == (int)badHeapWordVal, "value unused so far");
-  operands->at_put(fillp_offset, arraylen);
-  cp->multi_operand_buffer_grow(arraylen, CHECK);
-  typeArrayOop operands_oop = cp->operands();
-  assert(operands_oop->length() == arraylen, "");
-  for (int i = 0; i < arraylen; i++) {
-    operands_oop->int_at_put(i, operands->at(i));
-  }
-  cp->set_operands(operands_oop);
-  // The fill_pointer is used only by constantPoolOop::copy_entry_to and friends,
-  // when constant pools need to be merged.  Make sure it is sane now.
-  assert(cp->multi_operand_buffer_fill_pointer() == arraylen, "");
-}
-
-
 bool inline valid_cp_range(int index, int length) { return (index > 0 && index < length); }
 
 constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
@@ -375,7 +327,8 @@
 
   // first verification pass - validate cross references and fixup class and string constants
   for (index = 1; index < length; index++) {          // Index 0 is unused
-    switch (cp->tag_at(index).value()) {
+    jbyte tag = cp->tag_at(index).value();
+    switch (tag) {
       case JVM_CONSTANT_Class :
         ShouldNotReachHere();     // Only JVM_CONSTANT_ClassIndex should be present
         break;
@@ -517,35 +470,23 @@
         }
         break;
       case JVM_CONSTANT_InvokeDynamicTrans :
-        ShouldNotReachHere();  // this tag does not appear in the heap
       case JVM_CONSTANT_InvokeDynamic :
         {
-          int bootstrap_method_ref_index = cp->invoke_dynamic_bootstrap_method_ref_index_at(index);
           int name_and_type_ref_index = cp->invoke_dynamic_name_and_type_ref_index_at(index);
-          check_property((bootstrap_method_ref_index == 0 && AllowTransitionalJSR292)
-                         ||
-                         (valid_cp_range(bootstrap_method_ref_index, length) &&
-                          (cp->tag_at(bootstrap_method_ref_index).is_method_handle())),
-                         "Invalid constant pool index %u in class file %s",
-                         bootstrap_method_ref_index,
-                         CHECK_(nullHandle));
           check_property(valid_cp_range(name_and_type_ref_index, length) &&
                          cp->tag_at(name_and_type_ref_index).is_name_and_type(),
                          "Invalid constant pool index %u in class file %s",
                          name_and_type_ref_index,
                          CHECK_(nullHandle));
-          int argc = cp->invoke_dynamic_argument_count_at(index);
-          for (int arg_i = 0; arg_i < argc; arg_i++) {
-            int arg = cp->invoke_dynamic_argument_index_at(index, arg_i);
-            check_property(valid_cp_range(arg, length) &&
-                           cp->tag_at(arg).is_loadable_constant() ||
-                           // temporary early forms of string and class:
-                           cp->tag_at(arg).is_klass_index() ||
-                           cp->tag_at(arg).is_string_index(),
+          if (tag == JVM_CONSTANT_InvokeDynamicTrans) {
+            int bootstrap_method_ref_index = cp->invoke_dynamic_bootstrap_method_ref_index_at(index);
+            check_property(valid_cp_range(bootstrap_method_ref_index, length) &&
+                           cp->tag_at(bootstrap_method_ref_index).is_method_handle(),
                            "Invalid constant pool index %u in class file %s",
-                           arg,
+                           bootstrap_method_ref_index,
                            CHECK_(nullHandle));
           }
+          // bootstrap specifier index must be checked later, when BootstrapMethods attr is available
           break;
         }
       default:
@@ -2403,6 +2344,76 @@
   k->set_generic_signature(cp->symbol_at(signature_index));
 }
 
+void ClassFileParser::parse_classfile_bootstrap_methods_attribute(constantPoolHandle cp, instanceKlassHandle k,
+                                                                  u4 attribute_byte_length, TRAPS) {
+  ClassFileStream* cfs = stream();
+  u1* current_start = cfs->current();
+
+  cfs->guarantee_more(2, CHECK);  // length
+  int attribute_array_length = cfs->get_u2_fast();
+
+  guarantee_property(_max_bootstrap_specifier_index < attribute_array_length,
+                     "Short length on BootstrapMethods in class file %s",
+                     CHECK);
+
+  // The attribute contains a counted array of counted tuples of shorts,
+  // represending bootstrap specifiers:
+  //    length*{bootstrap_method_index, argument_count*{argument_index}}
+  int operand_count = (attribute_byte_length - sizeof(u2)) / sizeof(u2);
+  // operand_count = number of shorts in attr, except for leading length
+
+  // The attribute is copied into a short[] array.
+  // The array begins with a series of short[2] pairs, one for each tuple.
+  int index_size = (attribute_array_length * 2);
+
+  typeArrayOop operands_oop = oopFactory::new_permanent_intArray(index_size + operand_count, CHECK);
+  typeArrayHandle operands(THREAD, operands_oop);
+  operands_oop = NULL; // tidy
+
+  int operand_fill_index = index_size;
+  int cp_size = cp->length();
+
+  for (int n = 0; n < attribute_array_length; n++) {
+    // Store a 32-bit offset into the header of the operand array.
+    assert(constantPoolOopDesc::operand_offset_at(operands(), n) == 0, "");
+    constantPoolOopDesc::operand_offset_at_put(operands(), n, operand_fill_index);
+
+    // Read a bootstrap specifier.
+    cfs->guarantee_more(sizeof(u2) * 2, CHECK);  // bsm, argc
+    u2 bootstrap_method_index = cfs->get_u2_fast();
+    u2 argument_count = cfs->get_u2_fast();
+    check_property(
+      valid_cp_range(bootstrap_method_index, cp_size) &&
+      cp->tag_at(bootstrap_method_index).is_method_handle(),
+      "bootstrap_method_index %u has bad constant type in class file %s",
+      CHECK);
+    operands->short_at_put(operand_fill_index++, bootstrap_method_index);
+    operands->short_at_put(operand_fill_index++, argument_count);
+
+    cfs->guarantee_more(sizeof(u2) * argument_count, CHECK);  // argv[argc]
+    for (int j = 0; j < argument_count; j++) {
+      u2 arg_index = cfs->get_u2_fast();
+      check_property(
+        valid_cp_range(arg_index, cp_size) &&
+        cp->tag_at(arg_index).is_loadable_constant(),
+        "argument_index %u has bad constant type in class file %s",
+        CHECK);
+      operands->short_at_put(operand_fill_index++, arg_index);
+    }
+  }
+
+  assert(operand_fill_index == operands()->length(), "exact fill");
+  assert(constantPoolOopDesc::operand_array_length(operands()) == attribute_array_length, "correct decode");
+
+  u1* current_end = cfs->current();
+  guarantee_property(current_end == current_start + attribute_byte_length,
+                     "Bad length on BootstrapMethods in class file %s",
+                     CHECK);
+
+  cp->set_operands(operands());
+}
+
+
 void ClassFileParser::parse_classfile_attributes(constantPoolHandle cp, instanceKlassHandle k, TRAPS) {
   ClassFileStream* cfs = stream();
   // Set inner classes attribute to default sentinel
@@ -2412,6 +2423,7 @@
   bool parsed_sourcefile_attribute = false;
   bool parsed_innerclasses_attribute = false;
   bool parsed_enclosingmethod_attribute = false;
+  bool parsed_bootstrap_methods_attribute = false;
   u1* runtime_visible_annotations = NULL;
   int runtime_visible_annotations_length = 0;
   u1* runtime_invisible_annotations = NULL;
@@ -2510,6 +2522,12 @@
           classfile_parse_error("Invalid or out-of-bounds method index in EnclosingMethod attribute in class file %s", CHECK);
         }
         k->set_enclosing_method_indices(class_index, method_index);
+      } else if (tag == vmSymbols::tag_bootstrap_methods() &&
+                 _major_version >= Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
+        if (parsed_bootstrap_methods_attribute)
+          classfile_parse_error("Multiple BootstrapMethods attributes in class file %s", CHECK);
+        parsed_bootstrap_methods_attribute = true;
+        parse_classfile_bootstrap_methods_attribute(cp, k, attribute_length, CHECK);
       } else {
         // Unknown attribute
         cfs->skip_u1(attribute_length, CHECK);
@@ -2525,6 +2543,11 @@
                                                      runtime_invisible_annotations_length,
                                                      CHECK);
   k->set_class_annotations(annotations());
+
+  if (_max_bootstrap_specifier_index >= 0) {
+    guarantee_property(parsed_bootstrap_methods_attribute,
+                       "Missing BootstrapMethods attribute in class file %s", CHECK);
+  }
 }
 
 
@@ -2842,6 +2865,7 @@
                             PerfClassTraceTime::PARSE_CLASS);
 
   _has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false;
+  _max_bootstrap_specifier_index = -1;
 
   if (JvmtiExport::should_post_class_file_load_hook()) {
     unsigned char* ptr = cfs->buffer();
--- a/src/share/vm/classfile/classFileParser.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/classFileParser.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP
+#define SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP
+
+#include "classfile/classFileStream.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/accessFlags.hpp"
+
 // Parser for for .class files
 //
 // The bytes describing the class file structure is read from a Stream object
@@ -40,6 +50,8 @@
   bool _has_empty_finalizer;
   bool _has_vanilla_constructor;
 
+  int _max_bootstrap_specifier_index;
+
   enum { fixed_buffer_size = 128 };
   u_char linenumbertable_buffer[fixed_buffer_size];
 
@@ -56,9 +68,6 @@
 
   constantPoolHandle parse_constant_pool(TRAPS);
 
-  static int start_operand_group(GrowableArray<int>* &operands, int op_count, TRAPS);
-  static void store_operand_array(GrowableArray<int>* operands, constantPoolHandle cp, TRAPS);
-
   // Interface parsing
   objArrayHandle parse_interfaces(constantPoolHandle cp,
                                   int length,
@@ -120,6 +129,7 @@
   void parse_classfile_attributes(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
   void parse_classfile_synthetic_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
   void parse_classfile_signature_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
+  void parse_classfile_bootstrap_methods_attribute(constantPoolHandle cp, instanceKlassHandle k, u4 attribute_length, TRAPS);
 
   // Annotations handling
   typeArrayHandle assemble_annotations(u1* runtime_visible_annotations,
@@ -286,3 +296,5 @@
   static void check_final_method_override(instanceKlassHandle this_klass, TRAPS);
   static void check_illegal_static_method(instanceKlassHandle this_klass, TRAPS);
 };
+
+#endif // SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP
--- a/src/share/vm/classfile/classFileStream.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/classFileStream.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_classFileStream.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classFileStream.hpp"
+#include "classfile/vmSymbols.hpp"
 
 void ClassFileStream::truncated_file_error(TRAPS) {
   THROW_MSG(vmSymbols::java_lang_ClassFormatError(), "Truncated class file");
--- a/src/share/vm/classfile/classFileStream.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/classFileStream.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
+#define SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
+
+#include "utilities/top.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 // Input stream for reading .class file
 //
 // The entire input stream is present in a buffer allocated by the caller.
@@ -116,3 +130,5 @@
   // Tells whether eos is reached
   bool at_eos() const          { return _current == _buffer_end; }
 };
+
+#endif // SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
--- a/src/share/vm/classfile/classLoader.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/classLoader.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,52 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_classLoader.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classFileParser.hpp"
+#include "classfile/classFileStream.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileBroker.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/generation.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/constantPoolKlass.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/timer.hpp"
+#include "services/management.hpp"
+#include "services/threadService.hpp"
+#include "utilities/events.hpp"
+#include "utilities/hashtable.hpp"
+#include "utilities/hashtable.inline.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 
 // Entry points in zip.dll for loading zip/jar file entries
@@ -160,13 +204,13 @@
   struct stat st;
   if (os::stat(path, &st) == 0) {
     // found file, open it
-    int file_handle = hpi::open(path, 0, 0);
+    int file_handle = os::open(path, 0, 0);
     if (file_handle != -1) {
       // read contents into resource array
       u1* buffer = NEW_RESOURCE_ARRAY(u1, st.st_size);
       size_t num_read = os::read(file_handle, (char*) buffer, st.st_size);
       // close file
-      hpi::close(file_handle);
+      os::close(file_handle);
       // construct ClassFileStream
       if (num_read == (size_t)st.st_size) {
         if (UsePerfData) {
@@ -559,18 +603,18 @@
   // Load zip library
   char path[JVM_MAXPATHLEN];
   char ebuf[1024];
-  hpi::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "zip");
-  void* handle = hpi::dll_load(path, ebuf, sizeof ebuf);
+  os::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "zip");
+  void* handle = os::dll_load(path, ebuf, sizeof ebuf);
   if (handle == NULL) {
     vm_exit_during_initialization("Unable to load ZIP library", path);
   }
   // Lookup zip entry points
-  ZipOpen      = CAST_TO_FN_PTR(ZipOpen_t, hpi::dll_lookup(handle, "ZIP_Open"));
-  ZipClose     = CAST_TO_FN_PTR(ZipClose_t, hpi::dll_lookup(handle, "ZIP_Close"));
-  FindEntry    = CAST_TO_FN_PTR(FindEntry_t, hpi::dll_lookup(handle, "ZIP_FindEntry"));
-  ReadEntry    = CAST_TO_FN_PTR(ReadEntry_t, hpi::dll_lookup(handle, "ZIP_ReadEntry"));
-  ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, hpi::dll_lookup(handle, "ZIP_ReadMappedEntry"));
-  GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, hpi::dll_lookup(handle, "ZIP_GetNextEntry"));
+  ZipOpen      = CAST_TO_FN_PTR(ZipOpen_t, os::dll_lookup(handle, "ZIP_Open"));
+  ZipClose     = CAST_TO_FN_PTR(ZipClose_t, os::dll_lookup(handle, "ZIP_Close"));
+  FindEntry    = CAST_TO_FN_PTR(FindEntry_t, os::dll_lookup(handle, "ZIP_FindEntry"));
+  ReadEntry    = CAST_TO_FN_PTR(ReadEntry_t, os::dll_lookup(handle, "ZIP_ReadEntry"));
+  ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, os::dll_lookup(handle, "ZIP_ReadMappedEntry"));
+  GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, os::dll_lookup(handle, "ZIP_GetNextEntry"));
 
   // ZIP_Close is not exported on Windows in JDK5.0 so don't abort if ZIP_Close is NULL
   if (ZipOpen == NULL || FindEntry == NULL || ReadEntry == NULL || GetNextEntry == NULL) {
@@ -579,7 +623,7 @@
 
   // Lookup canonicalize entry in libjava.dll
   void *javalib_handle = os::native_java_library();
-  CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, hpi::dll_lookup(javalib_handle, "Canonicalize"));
+  CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, os::dll_lookup(javalib_handle, "Canonicalize"));
   // This lookup only works on 1.3. Do not check for non-null here
 }
 
@@ -1028,7 +1072,7 @@
   assert(orig != NULL && out != NULL && len > 0, "bad arguments");
   if (CanonicalizeEntry != NULL) {
     JNIEnv* env = JavaThread::current()->jni_environment();
-    if ((CanonicalizeEntry)(env, hpi::native_path(orig), out, len) < 0) {
+    if ((CanonicalizeEntry)(env, os::native_path(orig), out, len) < 0) {
       return false;
     }
   } else {
--- a/src/share/vm/classfile/classLoader.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/classLoader.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_CLASSLOADER_HPP
+#define SHARE_VM_CLASSFILE_CLASSLOADER_HPP
+
+#include "classfile/classFileParser.hpp"
+#include "runtime/perfData.hpp"
+
 // The VM class loader.
 #include <sys/stat.h>
 
@@ -456,3 +462,5 @@
     }
 };
 
+
+#endif // SHARE_VM_CLASSFILE_CLASSLOADER_HPP
--- a/src/share/vm/classfile/dictionary.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/dictionary.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dictionary.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/dictionary.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "services/classLoadingService.hpp"
+#include "utilities/hashtable.inline.hpp"
 
 
 DictionaryEntry*  Dictionary::_current_class_entry = NULL;
--- a/src/share/vm/classfile/dictionary.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/dictionary.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_DICTIONARY_HPP
+#define SHARE_VM_CLASSFILE_DICTIONARY_HPP
+
+#include "classfile/systemDictionary.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.hpp"
+#include "utilities/hashtable.hpp"
+
 class DictionaryEntry;
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -336,3 +344,5 @@
   void verify();
 };
 
+
+#endif // SHARE_VM_CLASSFILE_DICTIONARY_HPP
--- a/src/share/vm/classfile/javaAssertions.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/javaAssertions.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_javaAssertions.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaAssertions.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 
 bool                            JavaAssertions::_userDefault = false;
 bool                            JavaAssertions::_sysDefault = false;
--- a/src/share/vm/classfile/javaAssertions.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/javaAssertions.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_JAVAASSERTIONS_HPP
+#define SHARE_VM_CLASSFILE_JAVAASSERTIONS_HPP
+
+#include "oops/objArrayOop.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/ostream.hpp"
+
 class JavaAssertions: AllStatic {
 public:
   static inline bool userClassDefault();
@@ -95,3 +103,5 @@
     tty->print_cr("JavaAssertions::setSystemClassDefault(%d)", enabled);
   _sysDefault = enabled;
 }
+
+#endif // SHARE_VM_CLASSFILE_JAVAASSERTIONS_HPP
--- a/src/share/vm/classfile/javaClasses.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/javaClasses.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,39 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_javaClasses.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/debugInfo.hpp"
+#include "code/pcDesc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/symbolOop.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vframe.hpp"
+#include "utilities/preserveException.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 static bool find_field(instanceKlass* ik,
                        symbolOop name_symbol, symbolOop signature_symbol,
@@ -151,7 +182,7 @@
 
   if (_to_java_string_fn == NULL) {
     void *lib_handle = os::native_java_library();
-    _to_java_string_fn = CAST_TO_FN_PTR(to_java_string_fn_t, hpi::dll_lookup(lib_handle, "NewStringPlatform"));
+    _to_java_string_fn = CAST_TO_FN_PTR(to_java_string_fn_t, os::dll_lookup(lib_handle, "NewStringPlatform"));
     if (_to_java_string_fn == NULL) {
       fatal("NewStringPlatform missing");
     }
@@ -176,7 +207,7 @@
 
   if (_to_platform_string_fn == NULL) {
     void *lib_handle = os::native_java_library();
-    _to_platform_string_fn = CAST_TO_FN_PTR(to_platform_string_fn_t, hpi::dll_lookup(lib_handle, "GetStringPlatformChars"));
+    _to_platform_string_fn = CAST_TO_FN_PTR(to_platform_string_fn_t, os::dll_lookup(lib_handle, "GetStringPlatformChars"));
     if (_to_platform_string_fn == NULL) {
       fatal("GetStringPlatformChars missing");
     }
@@ -282,6 +313,14 @@
   return UNICODE::as_utf8(position, length);
 }
 
+char* java_lang_String::as_utf8_string(oop java_string, char* buf, int buflen) {
+  typeArrayOop value  = java_lang_String::value(java_string);
+  int          offset = java_lang_String::offset(java_string);
+  int          length = java_lang_String::length(java_string);
+  jchar* position = (length == 0) ? NULL : value->char_at_addr(offset);
+  return UNICODE::as_utf8(position, length, buf, buflen);
+}
+
 char* java_lang_String::as_utf8_string(oop java_string, int start, int len) {
   typeArrayOop value  = java_lang_String::value(java_string);
   int          offset = java_lang_String::offset(java_string);
--- a/src/share/vm/classfile/javaClasses.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/javaClasses.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_HPP
+#define SHARE_VM_CLASSFILE_JAVACLASSES_HPP
+
+#include "classfile/systemDictionary.hpp"
+#include "jvmtifiles/jvmti.h"
+#include "oops/oop.hpp"
+#include "runtime/os.hpp"
+#include "utilities/utf8.hpp"
+
 // Interface for manipulating the basic Java classes.
 //
 // All dependencies on layout of actual Java classes should be kept here.
@@ -95,6 +104,7 @@
 
   // String converters
   static char*  as_utf8_string(oop java_string);
+  static char*  as_utf8_string(oop java_string, char* buf, int buflen);
   static char*  as_utf8_string(oop java_string, int start, int len);
   static char*  as_platform_dependent_str(Handle java_string, TRAPS);
   static jchar* as_unicode_string(oop java_string, int& length);
@@ -1271,3 +1281,5 @@
   static void compute_offsets();
   static void check_offsets() PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_CLASSFILE_JAVACLASSES_HPP
--- a/src/share/vm/classfile/loaderConstraints.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/loaderConstraints.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_loaderConstraints.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/loaderConstraints.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/safepoint.hpp"
+#include "utilities/hashtable.inline.hpp"
 
 LoaderConstraintTable::LoaderConstraintTable(int nof_buckets)
   : Hashtable(nof_buckets, sizeof(LoaderConstraintEntry)) {};
--- a/src/share/vm/classfile/loaderConstraints.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/loaderConstraints.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP
+#define SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP
+
+#include "classfile/dictionary.hpp"
+#include "classfile/placeholders.hpp"
+#include "utilities/hashtable.hpp"
+
 class LoaderConstraintEntry;
 
 class LoaderConstraintTable : public Hashtable {
@@ -130,3 +137,5 @@
   void set_loader(int i, oop p) { _loaders[i] = p; }
 
 };
+
+#endif // SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP
--- a/src/share/vm/classfile/placeholders.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/placeholders.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_placeholders.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/placeholders.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/fieldType.hpp"
+#include "utilities/hashtable.inline.hpp"
 
 // Placeholder methods
 
--- a/src/share/vm/classfile/placeholders.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/placeholders.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
+#define SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
+
+#include "runtime/thread.hpp"
+#include "utilities/hashtable.hpp"
+
 class PlaceholderEntry;
 
 // Placeholder objects. These represent classes currently
@@ -329,3 +335,5 @@
   void print() const  PRODUCT_RETURN;
   void verify() const;
 };
+
+#endif // SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
--- a/src/share/vm/classfile/resolutionErrors.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/resolutionErrors.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_resolutionErrors.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/resolutionErrors.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/safepoint.hpp"
+#include "utilities/hashtable.inline.hpp"
 
 // add new entry to the table
 void ResolutionErrorTable::add_entry(int index, unsigned int hash,
--- a/src/share/vm/classfile/resolutionErrors.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/resolutionErrors.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP
+#define SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP
+
+#include "oops/constantPoolOop.hpp"
+#include "utilities/hashtable.hpp"
+
 class ResolutionErrorEntry;
 
 // ResolutionError objects are used to record errors encountered during
@@ -97,3 +103,5 @@
   // GC support
   void oops_do(OopClosure* blk);
 };
+
+#endif // SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP
--- a/src/share/vm/classfile/stackMapFrame.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/stackMapFrame.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_stackMapFrame.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/stackMapFrame.hpp"
+#include "classfile/verifier.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 StackMapFrame::StackMapFrame(u2 max_locals, u2 max_stack, ClassVerifier* v) :
                       _offset(0), _locals_size(0), _stack_size(0), _flags(0),
--- a/src/share/vm/classfile/stackMapFrame.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/stackMapFrame.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP
+#define SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP
+
+#include "classfile/verificationType.hpp"
+#include "classfile/verifier.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/exceptions.hpp"
+
 // A StackMapFrame represents one frame in the stack map attribute.
 
 enum {
@@ -224,3 +234,5 @@
   // Debugging
   void print() const PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP
--- a/src/share/vm/classfile/stackMapTable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/stackMapTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_stackMapTable.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/stackMapTable.hpp"
+#include "classfile/verifier.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/fieldType.hpp"
+#include "runtime/handles.inline.hpp"
 
 StackMapTable::StackMapTable(StackMapReader* reader, StackMapFrame* init_frame,
                              u2 max_locals, u2 max_stack,
--- a/src/share/vm/classfile/stackMapTable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/stackMapTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,24 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP
+#define SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP
+
+#include "classfile/stackMapFrame.hpp"
+#include "memory/allocation.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/methodOop.hpp"
+#include "utilities/globalDefinitions.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 class StackMapReader;
 
 // StackMapTable class is the StackMap table used by type checker
@@ -159,3 +177,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP
--- a/src/share/vm/classfile/stackMapTableFormat.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/stackMapTableFormat.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP
+#define SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP
+
+#include "classfile/verificationType.hpp"
+
 // These classes represent the stack-map substructures described in the JVMS
 // (hence the non-conforming naming scheme).
 
@@ -914,3 +919,5 @@
     Bytes::put_Java_u2(number_of_entries_addr(), num);
   }
 };
+
+#endif // SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP
--- a/src/share/vm/classfile/symbolTable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/symbolTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_symbolTable.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/filemap.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/symbolKlass.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "utilities/hashtable.inline.hpp"
 
 // --------------------------------------------------------------------------
 
--- a/src/share/vm/classfile/symbolTable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/symbolTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
+#define SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
+
+#include "memory/allocation.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "utilities/hashtable.hpp"
+
 // The symbol table holds all symbolOops and corresponding interned strings.
 // symbolOops and literal strings should be canonicalized.
 //
@@ -222,3 +229,5 @@
     ((BasicHashtable*)the_table())->reverse();
   }
 };
+
+#endif // SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
--- a/src/share/vm/classfile/systemDictionary.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/systemDictionary.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,37 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_systemDictionary.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/dictionary.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/loaderConstraints.hpp"
+#include "classfile/placeholders.hpp"
+#include "classfile/resolutionErrors.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/klass.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "prims/jvmtiEnvBase.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/fieldType.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/signature.hpp"
+#include "services/classLoadingService.hpp"
+#include "services/threadService.hpp"
 
 
 Dictionary*            SystemDictionary::_dictionary          = NULL;
@@ -1982,7 +2011,7 @@
     scan = WKID(meth_group_end+1);
   }
   WKID indy_group_start = WK_KLASS_ENUM_NAME(Linkage_klass);
-  WKID indy_group_end   = WK_KLASS_ENUM_NAME(InvokeDynamic_klass);
+  WKID indy_group_end   = WK_KLASS_ENUM_NAME(CallSite_klass);
   initialize_wk_klasses_until(indy_group_start, scan, CHECK);
   if (EnableInvokeDynamic) {
     initialize_wk_klasses_through(indy_group_end, scan, CHECK);
--- a/src/share/vm/classfile/systemDictionary.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/systemDictionary.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP
+#define SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP
+
+#include "classfile/classFileStream.hpp"
+#include "classfile/classLoader.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/java.hpp"
+#include "runtime/reflectionUtils.hpp"
+#include "utilities/hashtable.hpp"
+
 // The system dictionary stores all loaded classes and maps:
 //
 //   [class name,class loader] -> class   i.e.  [symbolOop,oop] -> klassOop
@@ -145,8 +156,7 @@
   template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Opt) \
   template(Linkage_klass,                java_dyn_Linkage,               Opt) \
   template(CallSite_klass,               java_dyn_CallSite,              Opt) \
-  template(InvokeDynamic_klass,          java_dyn_InvokeDynamic,         Opt) \
-  /* Note: MethodHandle must be first, and InvokeDynamic last in group */     \
+  /* Note: MethodHandle must be first, and CallSite last in group */          \
                                                                               \
   template(StringBuffer_klass,           java_lang_StringBuffer,         Pre) \
   template(StringBuilder_klass,          java_lang_StringBuilder,        Pre) \
@@ -700,3 +710,5 @@
 
   static KlassHandle box_klass(BasicType t);
 };
+
+#endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP
--- a/src/share/vm/classfile/verificationType.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/verificationType.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_verificationType.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/verificationType.hpp"
 
 VerificationType VerificationType::from_tag(u1 tag) {
   switch (tag) {
--- a/src/share/vm/classfile/verificationType.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/verificationType.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP
+#define SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP
+
+#include "classfile/systemDictionary.hpp"
+#include "memory/allocation.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/signature.hpp"
+
 enum {
   // As specifed in the JVM spec
   ITEM_Top = 0,
@@ -303,3 +314,5 @@
   bool is_reference_assignable_from(
     const VerificationType&, instanceKlassHandle, TRAPS) const;
 };
+
+#endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP
--- a/src/share/vm/classfile/verifier.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/verifier.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,35 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_verifier.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classFileStream.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/stackMapTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/verifier.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "prims/jvm.h"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/orderAccess.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
 
 #define NOFAILOVER_MAJOR_VERSION 51
 
@@ -41,11 +68,11 @@
 static void* verify_byte_codes_fn() {
   if (_verify_byte_codes_fn == NULL) {
     void *lib_handle = os::native_java_library();
-    void *func = hpi::dll_lookup(lib_handle, "VerifyClassCodesForMajorVersion");
+    void *func = os::dll_lookup(lib_handle, "VerifyClassCodesForMajorVersion");
     OrderAccess::release_store_ptr(&_verify_byte_codes_fn, func);
     if (func == NULL) {
       OrderAccess::release_store(&_is_new_verify_byte_codes_fn, false);
-      func = hpi::dll_lookup(lib_handle, "VerifyClassCodes");
+      func = os::dll_lookup(lib_handle, "VerifyClassCodes");
       OrderAccess::release_store_ptr(&_verify_byte_codes_fn, func);
     }
   }
@@ -247,6 +274,10 @@
 ClassVerifier::~ClassVerifier() {
 }
 
+VerificationType ClassVerifier::object_type() const {
+  return VerificationType::reference_type(vmSymbols::java_lang_Object());
+}
+
 void ClassVerifier::verify_class(TRAPS) {
   if (_verify_verbose) {
     tty->print_cr("Verifying class %s with new format",
@@ -726,8 +757,7 @@
           }
           no_control_flow = false; break;
         case Bytecodes::_aastore :
-          type = current_frame.pop_stack(
-            VerificationType::reference_check(), CHECK_VERIFY(this));
+          type = current_frame.pop_stack(object_type(), CHECK_VERIFY(this));
           type2 = current_frame.pop_stack(
             VerificationType::integer_type(), CHECK_VERIFY(this));
           atype = current_frame.pop_stack(
@@ -1232,8 +1262,7 @@
         {
           index = bcs.get_index_u2();
           verify_cp_class_type(index, cp, CHECK_VERIFY(this));
-          current_frame.pop_stack(
-            VerificationType::reference_check(), CHECK_VERIFY(this));
+          current_frame.pop_stack(object_type(), CHECK_VERIFY(this));
           VerificationType klass_type = cp_index_to_type(
             index, cp, CHECK_VERIFY(this));
           current_frame.push_stack(klass_type, CHECK_VERIFY(this));
@@ -1242,8 +1271,7 @@
         case Bytecodes::_instanceof : {
           index = bcs.get_index_u2();
           verify_cp_class_type(index, cp, CHECK_VERIFY(this));
-          current_frame.pop_stack(
-            VerificationType::reference_check(), CHECK_VERIFY(this));
+          current_frame.pop_stack(object_type(), CHECK_VERIFY(this));
           current_frame.push_stack(
             VerificationType::integer_type(), CHECK_VERIFY(this));
           no_control_flow = false; break;
@@ -1610,9 +1638,7 @@
     verify_cp_type(index, cp, types, CHECK_VERIFY(this));
   }
   if (tag.is_string() && cp->is_pseudo_string_at(index)) {
-    current_frame->push_stack(
-      VerificationType::reference_type(
-        vmSymbols::java_lang_Object()), CHECK_VERIFY(this));
+    current_frame->push_stack(object_type(), CHECK_VERIFY(this));
   } else if (tag.is_string() || tag.is_unresolved_string()) {
     current_frame->push_stack(
       VerificationType::reference_type(
--- a/src/share/vm/classfile/verifier.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/verifier.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_VERIFIER_HPP
+#define SHARE_VM_CLASSFILE_VERIFIER_HPP
+
+#include "classfile/verificationType.hpp"
+#include "memory/gcLocker.hpp"
+#include "oops/klass.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/handles.hpp"
+#include "utilities/exceptions.hpp"
+
 // The verifier class
 class Verifier : AllStatic {
  public:
@@ -157,6 +167,8 @@
 
   bool name_in_supers(symbolOop ref_name, instanceKlassHandle current);
 
+  VerificationType object_type() const;
+
   instanceKlassHandle _klass;  // the class being verified
   methodHandle        _method; // current method being verified
   VerificationType    _this_type; // the verification type of the current class
@@ -252,3 +264,5 @@
       return 1;
   }
 }
+
+#endif // SHARE_VM_CLASSFILE_VERIFIER_HPP
--- a/src/share/vm/classfile/vmSymbols.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/vmSymbols.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmSymbols.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/xmlstream.hpp"
 
 
 symbolOop vmSymbols::_symbols[vmSymbols::SID_LIMIT];
--- a/src/share/vm/classfile/vmSymbols.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/classfile/vmSymbols.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
+#define SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
+
+#include "oops/symbolOop.hpp"
+
 // The classes vmSymbols and vmSymbolHandles are a name spaces for fast lookup of
 // symbols commonly used in the VM. The first class return a symbolOop, while the
 // second class returns a SymbolHandle. The underlying data structure is shared
@@ -127,6 +132,7 @@
   template(tag_runtime_invisible_parameter_annotations,"RuntimeInvisibleParameterAnnotations")    \
   template(tag_annotation_default,                    "AnnotationDefault")                        \
   template(tag_enclosing_method,                      "EnclosingMethod")                          \
+  template(tag_bootstrap_methods,                     "BootstrapMethods")                         \
                                                                                                   \
   /* exception klasses: at least all exceptions thrown by the VM have entries here */             \
   template(java_lang_ArithmeticException,             "java/lang/ArithmeticException")            \
@@ -1176,3 +1182,5 @@
   // Raw conversion:
   static ID for_raw_conversion(BasicType src, BasicType dest);
 };
+
+#endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
--- a/src/share/vm/code/codeBlob.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/codeBlob.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,35 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_codeBlob.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeBlob.hpp"
+#include "code/codeCache.hpp"
+#include "code/relocInfo.hpp"
+#include "compiler/disassembler.hpp"
+#include "interpreter/bytecode.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/heap.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/forte.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframe.hpp"
+#include "services/memoryService.hpp"
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
 
 unsigned int align_code_offset(int offset) {
   // align the size to CodeEntryAlignment
--- a/src/share/vm/code/codeBlob.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/codeBlob.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_CODEBLOB_HPP
+#define SHARE_VM_CODE_CODEBLOB_HPP
+
+#include "asm/codeBuffer.hpp"
+#include "compiler/oopMap.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/handles.hpp"
+
 // CodeBlob - superclass for all entries in the CodeCache.
 //
 // Suptypes are:
@@ -499,3 +507,5 @@
   // Typing
   bool is_safepoint_stub() const                 { return true; }
 };
+
+#endif // SHARE_VM_CODE_CODEBLOB_HPP
--- a/src/share/vm/code/codeCache.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/codeCache.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,26 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_codeCache.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeBlob.hpp"
+#include "code/codeCache.hpp"
+#include "code/dependencies.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/iterator.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/java.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/xmlstream.hpp"
 
 // Helper class for printing in CodeCache
 
--- a/src/share/vm/code/codeCache.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/codeCache.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_CODECACHE_HPP
+#define SHARE_VM_CODE_CODECACHE_HPP
+
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "memory/heap.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oopsHierarchy.hpp"
+
 // The CodeCache implements the code cache for various pieces of generated
 // code, e.g., compiled java methods, runtime stubs, transition frames, etc.
 // The entries in the CodeCache are all CodeBlob's.
@@ -173,3 +182,5 @@
     // tells how many nmethods have dependencies
   static int number_of_nmethods_with_dependencies();
 };
+
+#endif // SHARE_VM_CODE_CODECACHE_HPP
--- a/src/share/vm/code/compiledIC.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/compiledIC.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,23 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_compiledIC.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "code/compiledIC.hpp"
+#include "code/icBuffer.hpp"
+#include "code/nmethod.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/events.hpp"
 
 
 // Every time a compiled IC is changed or its type is being accessed,
--- a/src/share/vm/code/compiledIC.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/compiledIC.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,23 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_COMPILEDIC_HPP
+#define SHARE_VM_CODE_COMPILEDIC_HPP
+
+#include "interpreter/linkResolver.hpp"
+#include "oops/compiledICHolderKlass.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/klassOop.hpp"
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+#endif
+
 //-----------------------------------------------------------------------------
 // The CompiledIC represents a compiled inline cache.
 //
@@ -239,3 +256,5 @@
 inline CompiledStaticCall* compiledStaticCall_at(Relocation* call_site) {
   return compiledStaticCall_at(call_site->addr());
 }
+
+#endif // SHARE_VM_CODE_COMPILEDIC_HPP
--- a/src/share/vm/code/compressedStream.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/compressedStream.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_compressedStream.cpp.incl"
+#include "precompiled.hpp"
+#include "code/compressedStream.hpp"
+#include "utilities/ostream.hpp"
 
 // 32-bit one-to-one sign encoding taken from Pack200
 // converts leading sign bits into leading zeroes with trailing sign bit
@@ -196,6 +197,7 @@
 // compiler stack overflow is fixed.
 #if _MSC_VER >=1400 && !defined(_WIN64)
 #pragma optimize("", off)
+#pragma warning(disable: 4748)
 #endif
 
 // generator for an "interesting" set of critical values
@@ -275,6 +277,7 @@
 }
 
 #if _MSC_VER >=1400 && !defined(_WIN64)
+#pragma warning(default: 4748)
 #pragma optimize("", on)
 #endif
 
--- a/src/share/vm/code/compressedStream.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/compressedStream.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_COMPRESSEDSTREAM_HPP
+#define SHARE_VM_CODE_COMPRESSEDSTREAM_HPP
+
+#include "memory/allocation.hpp"
+
 // Simple interface for filing out and filing in basic types
 // Used for writing out and reading in debugging information.
 
@@ -118,3 +123,5 @@
   void write_double(jdouble value);    // write_int(reverse_int(<low,high>))
   void write_long(jlong value);        // write_signed_int(<low,high>)
 };
+
+#endif // SHARE_VM_CODE_COMPRESSEDSTREAM_HPP
--- a/src/share/vm/code/debugInfo.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/debugInfo.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_debugInfo.cpp.incl"
+#include "precompiled.hpp"
+#include "code/debugInfo.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/nmethod.hpp"
+#include "runtime/handles.inline.hpp"
 
 // Comstructors
 
--- a/src/share/vm/code/debugInfo.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/debugInfo.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_DEBUGINFO_HPP
+#define SHARE_VM_CODE_DEBUGINFO_HPP
+
+#include "code/compressedStream.hpp"
+#include "code/location.hpp"
+#include "code/nmethod.hpp"
+#include "code/oopRecorder.hpp"
+#include "runtime/stackValue.hpp"
+#include "utilities/growableArray.hpp"
+
 // Classes used for serializing debugging information.
 // These abstractions are introducted to provide symmetric
 // read and write operations.
@@ -270,3 +280,5 @@
   void write_handle(jobject h);
   void write_bci(int bci) { write_int(bci - InvocationEntryBci); }
 };
+
+#endif // SHARE_VM_CODE_DEBUGINFO_HPP
--- a/src/share/vm/code/debugInfoRec.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/debugInfoRec.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_debugInfoRec.cpp.incl"
+#include "precompiled.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/scopeDesc.hpp"
+#include "prims/jvmtiExport.hpp"
 
 // Private definition.
 // There is one DIR_Chunk for each scope and values array.
--- a/src/share/vm/code/debugInfoRec.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/debugInfoRec.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,19 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_DEBUGINFOREC_HPP
+#define SHARE_VM_CODE_DEBUGINFOREC_HPP
+
+#include "ci/ciClassList.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "code/debugInfo.hpp"
+#include "code/location.hpp"
+#include "code/pcDesc.hpp"
+#include "compiler/oopMap.hpp"
+#include "oops/oop.hpp"
+#include "utilities/growableArray.hpp"
+
 //** The DebugInformationRecorder collects debugging information
 //   for a compiled method.
 //   Debugging information is used for:
@@ -183,3 +196,5 @@
  public:
   enum { serialized_null = 0 };
 };
+
+#endif // SHARE_VM_CODE_DEBUGINFOREC_HPP
--- a/src/share/vm/code/dependencies.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/dependencies.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dependencies.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciArrayKlass.hpp"
+#include "ci/ciEnv.hpp"
+#include "ci/ciKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "code/dependencies.hpp"
+#include "compiler/compileLog.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/copy.hpp"
 
 
 #ifdef ASSERT
--- a/src/share/vm/code/dependencies.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/dependencies.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_DEPENDENCIES_HPP
+#define SHARE_VM_CODE_DEPENDENCIES_HPP
+
+#include "ci/ciKlass.hpp"
+#include "code/compressedStream.hpp"
+#include "code/nmethod.hpp"
+#include "utilities/growableArray.hpp"
+
 //** Dependencies represent assertions (approximate invariants) within
 // the class hierarchy.  An example is an assertion that a given
 // method is not overridden; another example is that a type has only
@@ -550,3 +558,5 @@
 
   void print();
 };
+
+#endif // SHARE_VM_CODE_DEPENDENCIES_HPP
--- a/src/share/vm/code/exceptionHandlerTable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/exceptionHandlerTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_exceptionHandlerTable.cpp.incl"
+#include "precompiled.hpp"
+#include "code/exceptionHandlerTable.hpp"
+#include "code/nmethod.hpp"
+#include "memory/allocation.inline.hpp"
 
 void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) {
   _nesting.check();
--- a/src/share/vm/code/exceptionHandlerTable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/exceptionHandlerTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_EXCEPTIONHANDLERTABLE_HPP
+#define SHARE_VM_CODE_EXCEPTIONHANDLERTABLE_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/methodOop.hpp"
+
 // A HandlerTableEntry describes an individual entry of a subtable
 // of ExceptionHandlerTable. An entry consists of a pair(bci, pco),
 // where bci is the exception handler bci, and pco is the pc offset
@@ -154,3 +160,5 @@
   void print(address base) const;
   void verify(nmethod *nm) const;
 };
+
+#endif // SHARE_VM_CODE_EXCEPTIONHANDLERTABLE_HPP
--- a/src/share/vm/code/icBuffer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/icBuffer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,30 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icBuffer.cpp.incl"
+#include "precompiled.hpp"
+#include "code/compiledIC.hpp"
+#include "code/icBuffer.hpp"
+#include "code/nmethod.hpp"
+#include "code/scopeDesc.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+#endif
 
 
 DEF_STUB_INTERFACE(ICStub);
--- a/src/share/vm/code/icBuffer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/icBuffer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_ICBUFFER_HPP
+#define SHARE_VM_CODE_ICBUFFER_HPP
+
+#include "code/stubs.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+
 //
 // For CompiledIC's:
 //
@@ -126,3 +133,5 @@
   static address ic_destination_for(CompiledIC *ic);
   static oop     cached_oop_for(CompiledIC *ic);
 };
+
+#endif // SHARE_VM_CODE_ICBUFFER_HPP
--- a/src/share/vm/code/location.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/location.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_location.cpp.incl"
+#include "precompiled.hpp"
+#include "code/debugInfo.hpp"
+#include "code/location.hpp"
 
 void Location::print_on(outputStream* st) const {
   if(type() == invalid) {
--- a/src/share/vm/code/location.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/location.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_LOCATION_HPP
+#define SHARE_VM_CODE_LOCATION_HPP
+
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
+#include "memory/allocation.hpp"
+
 // A Location describes a concrete machine variable location
 // (such as integer or floating point register or a stack-held
 // variable). Used when generating debug-information for nmethods.
@@ -113,3 +120,5 @@
   // check
   static bool legal_offset_in_bytes(int offset_in_bytes);
 };
+
+#endif // SHARE_VM_CODE_LOCATION_HPP
--- a/src/share/vm/code/nmethod.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/nmethod.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,26 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_nmethod.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/compiledIC.hpp"
+#include "code/nmethod.hpp"
+#include "code/scopeDesc.hpp"
+#include "compiler/abstractCompiler.hpp"
+#include "compiler/compileLog.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "compiler/disassembler.hpp"
+#include "interpreter/bytecode.hpp"
+#include "oops/methodDataOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/sweeper.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/events.hpp"
+#include "utilities/xmlstream.hpp"
+#ifdef SHARK
+#include "shark/sharkCompiler.hpp"
+#endif
 
 #ifdef DTRACE_ENABLED
 
@@ -601,8 +619,8 @@
   OopMapSet* oop_maps )
   : CodeBlob("native nmethod", code_buffer, sizeof(nmethod),
              nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps),
-  _compiled_synchronized_native_basic_lock_owner_sp_offset(basic_lock_owner_sp_offset),
-  _compiled_synchronized_native_basic_lock_sp_offset(basic_lock_sp_offset)
+  _native_receiver_sp_offset(basic_lock_owner_sp_offset),
+  _native_basic_lock_sp_offset(basic_lock_sp_offset)
 {
   {
     debug_only(No_Safepoint_Verifier nsv;)
@@ -678,8 +696,8 @@
   int frame_size)
   : CodeBlob("dtrace nmethod", code_buffer, sizeof(nmethod),
              nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, NULL),
-  _compiled_synchronized_native_basic_lock_owner_sp_offset(in_ByteSize(-1)),
-  _compiled_synchronized_native_basic_lock_sp_offset(in_ByteSize(-1))
+  _native_receiver_sp_offset(in_ByteSize(-1)),
+  _native_basic_lock_sp_offset(in_ByteSize(-1))
 {
   {
     debug_only(No_Safepoint_Verifier nsv;)
@@ -772,8 +790,8 @@
   )
   : CodeBlob("nmethod", code_buffer, sizeof(nmethod),
              nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps),
-  _compiled_synchronized_native_basic_lock_owner_sp_offset(in_ByteSize(-1)),
-  _compiled_synchronized_native_basic_lock_sp_offset(in_ByteSize(-1))
+  _native_receiver_sp_offset(in_ByteSize(-1)),
+  _native_basic_lock_sp_offset(in_ByteSize(-1))
 {
   assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR");
   {
--- a/src/share/vm/code/nmethod.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/nmethod.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_NMETHOD_HPP
+#define SHARE_VM_CODE_NMETHOD_HPP
+
+#include "code/codeBlob.hpp"
+#include "code/pcDesc.hpp"
+
 // This class is used internally by nmethods, to cache
 // exception/pc/handler information.
 
@@ -204,7 +210,7 @@
   ExceptionCache *_exception_cache;
   PcDescCache     _pc_desc_cache;
 
-  // These are only used for compiled synchronized native methods to
+  // These are used for compiled synchronized native methods to
   // locate the owner and stack slot for the BasicLock so that we can
   // properly revoke the bias of the owner if necessary. They are
   // needed because there is no debug information for compiled native
@@ -214,8 +220,10 @@
   // sharing between platforms. Note that currently biased locking
   // will never cause Class instances to be biased but this code
   // handles the static synchronized case as well.
-  ByteSize _compiled_synchronized_native_basic_lock_owner_sp_offset;
-  ByteSize _compiled_synchronized_native_basic_lock_sp_offset;
+  // JVMTI's GetLocalInstance() also uses these offsets to find the receiver
+  // for non-static native wrapper frames.
+  ByteSize _native_receiver_sp_offset;
+  ByteSize _native_basic_lock_sp_offset;
 
   friend class nmethodLocker;
 
@@ -673,11 +681,11 @@
   bool is_patchable_at(address instr_address);
 
   // UseBiasedLocking support
-  ByteSize compiled_synchronized_native_basic_lock_owner_sp_offset() {
-    return _compiled_synchronized_native_basic_lock_owner_sp_offset;
+  ByteSize native_receiver_sp_offset() {
+    return _native_receiver_sp_offset;
   }
-  ByteSize compiled_synchronized_native_basic_lock_sp_offset() {
-    return _compiled_synchronized_native_basic_lock_sp_offset;
+  ByteSize native_basic_lock_sp_offset() {
+    return _native_basic_lock_sp_offset;
   }
 
   // support for code generation
@@ -707,3 +715,5 @@
     lock_nmethod(_nm);
   }
 };
+
+#endif // SHARE_VM_CODE_NMETHOD_HPP
--- a/src/share/vm/code/oopRecorder.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/oopRecorder.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_oopRecorder.cpp.incl"
+#include "precompiled.hpp"
+#include "code/oopRecorder.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
 
 #ifdef ASSERT
 int OopRecorder::_find_index_calls = 0;
--- a/src/share/vm/code/oopRecorder.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/oopRecorder.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_OOPRECORDER_HPP
+#define SHARE_VM_CODE_OOPRECORDER_HPP
+
+#include "runtime/handles.hpp"
+#include "utilities/growableArray.hpp"
+
 // Recording and retrieval of oop relocations in compiled code.
 
 class CodeBlob;
@@ -134,3 +140,5 @@
   static int _find_index_calls, _hit_indexes, _missed_indexes;
 #endif
 };
+
+#endif // SHARE_VM_CODE_OOPRECORDER_HPP
--- a/src/share/vm/code/pcDesc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/pcDesc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_pcDesc.cpp.incl"
+#include "precompiled.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "memory/resourceArea.hpp"
 
 PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) {
   assert(sizeof(PcDescFlags) <= 4, "occupies more than a word");
--- a/src/share/vm/code/pcDesc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/pcDesc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_PCDESC_HPP
+#define SHARE_VM_CODE_PCDESC_HPP
+
+#include "memory/allocation.hpp"
+
 // PcDescs map a physical PC (given as offset from start of nmethod) to
 // the corresponding source scope and byte code index.
 
@@ -86,3 +91,5 @@
   void print(nmethod* code);
   bool verify(nmethod* code);
 };
+
+#endif // SHARE_VM_CODE_PCDESC_HPP
--- a/src/share/vm/code/relocInfo.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/relocInfo.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,25 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_relocInfo.cpp.incl"
+#include "precompiled.hpp"
+#include "code/compiledIC.hpp"
+#include "code/nmethod.hpp"
+#include "code/relocInfo.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "utilities/copy.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+# include "nativeInst_zero.hpp"
+#endif
 
 
 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
@@ -1076,8 +1093,8 @@
     tty->print_cr("(no relocs)");
     return;
   }
-  tty->print("relocInfo@" INTPTR_FORMAT " [type=%d(%s) addr=" INTPTR_FORMAT,
-             _current, type(), reloc_type_string((relocInfo::relocType) type()), _addr);
+  tty->print("relocInfo@" INTPTR_FORMAT " [type=%d(%s) addr=" INTPTR_FORMAT " offset=%d",
+             _current, type(), reloc_type_string((relocInfo::relocType) type()), _addr, _current->addr_offset());
   if (current()->format() != 0)
     tty->print(" format=%d", current()->format());
   if (datalen() == 1) {
--- a/src/share/vm/code/relocInfo.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/relocInfo.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_RELOCINFO_HPP
+#define SHARE_VM_CODE_RELOCINFO_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/top.hpp"
+
 // Types in this file:
 //    relocInfo
 //      One element of an array of halfwords encoding compressed relocations.
@@ -415,7 +421,16 @@
   static void remove_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type);
 
   // Machine dependent stuff
-  #include "incls/_relocInfo_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "relocInfo_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "relocInfo_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "relocInfo_zero.hpp"
+#endif
+
 
  protected:
   // Derived constant, based on format_width which is PD:
@@ -1325,3 +1340,5 @@
 
   ~PatchingRelocIterator()                           { postpass(); }
 };
+
+#endif // SHARE_VM_CODE_RELOCINFO_HPP
--- a/src/share/vm/code/scopeDesc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/scopeDesc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_scopeDesc.cpp.incl"
+#include "precompiled.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 
 
 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) {
--- a/src/share/vm/code/scopeDesc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/scopeDesc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_SCOPEDESC_HPP
+#define SHARE_VM_CODE_SCOPEDESC_HPP
+
+#include "code/debugInfo.hpp"
+#include "code/pcDesc.hpp"
+#include "oops/methodOop.hpp"
+#include "utilities/growableArray.hpp"
+
 // SimpleScopeDesc is used when all you need to extract from
 // a given pc,nmethod pair is a methodOop and a bci. This is
 // quite a bit faster than allocating a full ScopeDesc, but
@@ -125,3 +133,5 @@
   void print_value_on(outputStream* st) const;
 #endif
 };
+
+#endif // SHARE_VM_CODE_SCOPEDESC_HPP
--- a/src/share/vm/code/stubs.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/stubs.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubs.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeBlob.hpp"
+#include "code/stubs.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/mutexLocker.hpp"
 
 
 // Implementation of StubQueue
--- a/src/share/vm/code/stubs.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/stubs.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_STUBS_HPP
+#define SHARE_VM_CODE_STUBS_HPP
+
+#include "memory/allocation.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+
 // The classes in this file provide a simple framework for the
 // management of little pieces of machine code - or stubs -
 // created on the fly and frequently discarded. In this frame-
@@ -206,3 +220,5 @@
   void  verify();                                // verifies the stub queue
   void  print();                                 // prints information about the stub queue
 };
+
+#endif // SHARE_VM_CODE_STUBS_HPP
--- a/src/share/vm/code/vmreg.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/vmreg.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vmreg.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
 
 // First VMReg value that could refer to a stack slot
 VMReg VMRegImpl::stack0 = (VMReg)(intptr_t)((ConcreteRegisterImpl::number_of_registers + 1) & ~1);
--- a/src/share/vm/code/vmreg.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/vmreg.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,37 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_VMREG_HPP
+#define SHARE_VM_CODE_VMREG_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/globalDefinitions.hpp"
+#ifdef TARGET_ARCH_x86
+# include "register_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "register_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "register_zero.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/adlcVMDeps.hpp"
+#include "utilities/ostream.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/adGlobals_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/adGlobals_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/adGlobals_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/adGlobals_zero.hpp"
+#endif
+#endif
+
 //------------------------------VMReg------------------------------------------
 // The VM uses 'unwarped' stack slots; the compiler uses 'warped' stack slots.
 // Register numbers below VMRegImpl::stack0 are the same for both.  Register
@@ -124,7 +155,16 @@
 
   static void set_regName();
 
-#include "incls/_vmreg_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "vmreg_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vmreg_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vmreg_zero.hpp"
+#endif
+
 
 };
 
@@ -181,3 +221,5 @@
   VMRegPair(VMReg f) { _second = VMRegImpl::Bad(); _first = f; }
   VMRegPair() { _second = VMRegImpl::Bad(); _first = VMRegImpl::Bad(); }
 };
+
+#endif // SHARE_VM_CODE_VMREG_HPP
--- a/src/share/vm/code/vtableStubs.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/vtableStubs.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,22 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs.cpp.incl"
+#include "precompiled.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/disassembler.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/forte.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef COMPILER2
+#include "opto/matcher.hpp"
+#endif
 
 // -----------------------------------------------------------------------------------------
 // Implementation of VtableStub
--- a/src/share/vm/code/vtableStubs.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/code/vtableStubs.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_CODE_VTABLESTUBS_HPP
+#define SHARE_VM_CODE_VTABLESTUBS_HPP
+
+#include "code/vmreg.hpp"
+#include "memory/allocation.hpp"
+
 // A VtableStub holds an individual code stub for a pair (vtable index, #args) for either itables or vtables
 // There's a one-to-one relationship between a VtableStub and such a pair.
 
@@ -121,3 +127,5 @@
   static int         number_of_vtable_stubs() { return _number_of_vtable_stubs; }
   static void        initialize();
 };
+
+#endif // SHARE_VM_CODE_VTABLESTUBS_HPP
--- a/src/share/vm/compiler/abstractCompiler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/abstractCompiler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,10 @@
 // questions.
 //
 
-#include "incls/_precompiled.incl"
-#include "incls/_abstractCompiler.cpp.incl"
 
+#include "precompiled.hpp"
+#include "compiler/abstractCompiler.hpp"
+#include "runtime/mutexLocker.hpp"
 void AbstractCompiler::initialize_runtimes(initializer f, volatile int* state) {
   if (*state != initialized) {
 
--- a/src/share/vm/compiler/abstractCompiler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/abstractCompiler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP
+#define SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP
+
+#include "ci/compilerInterface.hpp"
+
 typedef void (*initializer)(void);
 
 class AbstractCompiler : public CHeapObj {
@@ -85,3 +90,5 @@
     ShouldNotReachHere();
   }
 };
+
+#endif // SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP
--- a/src/share/vm/compiler/compileBroker.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,37 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_compileBroker.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/compileLog.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/sweeper.hpp"
+#include "utilities/dtrace.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Compiler.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/c2compiler.hpp"
+#endif
+#ifdef SHARK
+#include "shark/sharkCompiler.hpp"
+#endif
 
 #ifdef DTRACE_ENABLED
 
@@ -593,6 +622,7 @@
 void CompileBroker::compilation_init() {
   _last_method_compiled[0] = '\0';
 
+#ifndef SHARK
   // Set the interface to the current compiler(s).
   int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple);
   int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization);
@@ -613,13 +643,12 @@
   }
 #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
+#else // SHARK
+  int c1_count = 0;
+  int c2_count = 1;
+
+  _compilers[1] = new SharkCompiler();
+#endif // SHARK
 
   // Initialize the CompileTask free list
   _task_free_list = NULL;
@@ -1624,7 +1653,7 @@
       //assert(false, "compiler should always document failure");
       // The compiler elected, without comment, not to register a result.
       // Do not attempt further compilations of this method.
-      ci_env.record_method_not_compilable("compile failed");
+      ci_env.record_method_not_compilable("compile failed", !TieredCompilation);
     }
 
     if (ci_env.failing()) {
@@ -1633,15 +1662,8 @@
       if (PrintCompilation) {
         const char* reason = ci_env.failure_reason();
         if (compilable == ciEnv::MethodCompilable_not_at_tier) {
-          if (is_highest_tier_compile(ci_env.comp_level())) {
-            // Already at highest tier, promote to not compilable.
-            compilable = ciEnv::MethodCompilable_never;
-          } else {
             tty->print_cr("%3d   COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason);
-          }
-        }
-
-        if (compilable == ciEnv::MethodCompilable_never) {
+        } else if (compilable == ciEnv::MethodCompilable_never) {
           tty->print_cr("%3d   COMPILE SKIPPED: %s (not retryable)", compile_id, reason);
         } else if (compilable == ciEnv::MethodCompilable) {
           tty->print_cr("%3d   COMPILE SKIPPED: %s", compile_id, reason);
--- a/src/share/vm/compiler/compileBroker.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/compileBroker.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_COMPILER_COMPILEBROKER_HPP
+#define SHARE_VM_COMPILER_COMPILEBROKER_HPP
+
+#include "ci/compilerInterface.hpp"
+#include "compiler/abstractCompiler.hpp"
+#include "runtime/perfData.hpp"
+
 class nmethod;
 class nmethodLocker;
 
@@ -382,3 +389,5 @@
 
   static void bootstrap_c1x();
 };
+
+#endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP
--- a/src/share/vm/compiler/compileLog.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/compileLog.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_compileLog.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethod.hpp"
+#include "compiler/compileLog.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
 
 CompileLog* CompileLog::_first = NULL;
 
--- a/src/share/vm/compiler/compileLog.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/compileLog.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_COMPILER_COMPILELOG_HPP
+#define SHARE_VM_COMPILER_COMPILELOG_HPP
+
+#include "utilities/xmlstream.hpp"
+
 class ciObject;
 class ciSymbol;
 
@@ -75,3 +80,5 @@
   static void finish_log(outputStream* out);
   static void finish_log_on_error(outputStream* out, char *buf, int buflen);
 };
+
+#endif // SHARE_VM_COMPILER_COMPILELOG_HPP
--- a/src/share/vm/compiler/compilerOracle.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/compilerOracle.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_compilerOracle.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/klass.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/jniHandles.hpp"
 
 class MethodMatcher : public CHeapObj {
  public:
--- a/src/share/vm/compiler/compilerOracle.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/compilerOracle.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_COMPILER_COMPILERORACLE_HPP
+#define SHARE_VM_COMPILER_COMPILERORACLE_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oopsHierarchy.hpp"
+
 // CompilerOracle is an interface for turning on and off compilation
 // for some methods
 
@@ -66,3 +72,5 @@
   static void append_comment_to_file(const char* message);
   static void append_exclude_to_file(methodHandle method);
 };
+
+#endif // SHARE_VM_COMPILER_COMPILERORACLE_HPP
--- a/src/share/vm/compiler/disassembler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/disassembler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,28 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_disassembler.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeCache.hpp"
+#include "compiler/disassembler.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_ARCH_x86
+# include "depChecker_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "depChecker_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "depChecker_zero.hpp"
+#endif
+#ifdef SHARK
+#include "shark/sharkEntry.hpp"
+#endif
 
 void*       Disassembler::_library               = NULL;
 bool        Disassembler::_tried_to_load_library = false;
@@ -63,17 +83,17 @@
     // Find the disassembler next to libjvm.so.
     strcpy(&buf[jvm_offset], hsdis_library_name);
     strcat(&buf[jvm_offset], os::dll_file_extension());
-    _library = hpi::dll_load(buf, ebuf, sizeof ebuf);
+    _library = os::dll_load(buf, ebuf, sizeof ebuf);
   }
   if (_library == NULL) {
     // Try a free-floating lookup.
     strcpy(&buf[0], hsdis_library_name);
     strcat(&buf[0], os::dll_file_extension());
-    _library = hpi::dll_load(buf, ebuf, sizeof ebuf);
+    _library = os::dll_load(buf, ebuf, sizeof ebuf);
   }
   if (_library != NULL) {
     _decode_instructions = CAST_TO_FN_PTR(Disassembler::decode_func,
-                                          hpi::dll_lookup(_library, decode_instructions_name));
+                                          os::dll_lookup(_library, decode_instructions_name));
   }
   _tried_to_load_library = true;
   if (_decode_instructions == NULL) {
@@ -446,5 +466,18 @@
     env.set_total_ticks(total_bucket_count);
   }
 
+  // Print constant table.
+  if (nm->consts_size() > 0) {
+    nm->print_nmethod_labels(env.output(), nm->consts_begin());
+    int offset = 0;
+    for (address p = nm->consts_begin(); p < nm->consts_end(); p += 4, offset += 4) {
+      if ((offset % 8) == 0) {
+        env.output()->print_cr("  " INTPTR_FORMAT " (offset: %4d): " PTR32_FORMAT "   " PTR64_FORMAT, (intptr_t) p, offset, *((int32_t*) p), *((int64_t*) p));
+      } else {
+        env.output()->print_cr("  " INTPTR_FORMAT " (offset: %4d): " PTR32_FORMAT,                    (intptr_t) p, offset, *((int32_t*) p));
+      }
+    }
+  }
+
   env.decode_instructions(p, end);
 }
--- a/src/share/vm/compiler/disassembler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/disassembler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP
+#define SHARE_VM_COMPILER_DISASSEMBLER_HPP
+
+#include "runtime/globals.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+
 class decode_env;
 
 // The disassembler prints out assembly code annotated
@@ -47,7 +61,16 @@
   static bool load_library();
 
   // Machine dependent stuff
-  #include "incls/_disassembler_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "disassembler_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "disassembler_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "disassembler_zero.hpp"
+#endif
+
 
  public:
   static bool can_decode() {
@@ -57,3 +80,5 @@
   static void decode(nmethod* nm,                outputStream* st = NULL);
   static void decode(address begin, address end, outputStream* st = NULL);
 };
+
+#endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP
--- a/src/share/vm/compiler/methodLiveness.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/methodLiveness.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciMethodBlocks.hpp"
+#include "ci/ciStreams.hpp"
+#include "compiler/methodLiveness.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.inline.hpp"
+#include "utilities/bitMap.inline.hpp"
+
 // The MethodLiveness class performs a simple liveness analysis on a method
 // in order to decide which locals are live (that is, will be used again) at
 // a particular bytecode index (bci).
@@ -60,9 +70,6 @@
 //    analysis.
 
 
-# include "incls/_precompiled.incl"
-# include "incls/_methodLiveness.cpp.incl"
-
 //--------------------------------------------------------------------------
 // The BitCounter class is used for counting the number of bits set in
 // some BitMap.  It is only used when collecting liveness statistics.
--- a/src/share/vm/compiler/methodLiveness.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/methodLiveness.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_COMPILER_METHODLIVENESS_HPP
+#define SHARE_VM_COMPILER_METHODLIVENESS_HPP
+
+#include "utilities/bitMap.hpp"
+#include "utilities/growableArray.hpp"
+
 class ciMethod;
 
 class MethodLivenessResult : public BitMap {
@@ -269,3 +275,5 @@
 
   static void print_times() PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_COMPILER_METHODLIVENESS_HPP
--- a/src/share/vm/compiler/oopMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/oopMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_oopMap.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeBlob.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "code/scopeDesc.hpp"
+#include "compiler/oopMap.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/signature.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Defs.hpp"
+#endif
 
 // OopMapStream
 
--- a/src/share/vm/compiler/oopMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/compiler/oopMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_COMPILER_OOPMAP_HPP
+#define SHARE_VM_COMPILER_OOPMAP_HPP
+
+#include "code/compressedStream.hpp"
+#include "code/vmreg.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/growableArray.hpp"
+
 // Interface for generating the frame map for compiled code.  A frame map
 // describes for a specific pc whether each register and frame stack slot is:
 //   Oop         - A GC root for current frame
@@ -315,3 +323,5 @@
   }
 };
 #endif // COMPILER2
+
+#endif // SHARE_VM_COMPILER_OOPMAP_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_binaryTreeDictionary.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp"
+#include "gc_implementation/shared/allocationStats.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/space.inline.hpp"
+#include "runtime/globals.hpp"
+#include "utilities/ostream.hpp"
 
 ////////////////////////////////////////////////////////////////////////////////
 // A binary tree based search structure for free blocks.
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP
+
+#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
+#include "gc_implementation/concurrentMarkSweep/freeList.hpp"
+
 /*
  * A binary tree based search structure for free blocks.
  * This is currently used in the Concurrent Mark&Sweep implementation.
@@ -286,3 +292,5 @@
 
   void       verify() const;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,22 @@
  * questions.
  *
  */
-#include "incls/_precompiled.incl"
-#include "incls/_cmsAdaptiveSizePolicy.cpp.incl"
 
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/gcStats.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "runtime/thread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 elapsedTimer CMSAdaptiveSizePolicy::_concurrent_timer;
 elapsedTimer CMSAdaptiveSizePolicy::_STW_timer;
 
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP
+
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+#include "runtime/timer.hpp"
+
 // This class keeps statistical information and computes the
 // size of the heap for the concurrent mark sweep collector.
 //
@@ -467,3 +473,5 @@
   // Printing support
   virtual bool print_adaptive_size_policy_on(outputStream* st) const;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,34 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_cmsCollectorPolicy.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/space.hpp"
+#include "memory/universe.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/globals_extension.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 //
 // ConcurrentMarkSweepPolicy methods
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSCOLLECTORPOLICY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSCOLLECTORPOLICY_HPP
+
+#include "memory/collectorPolicy.hpp"
+
 class ConcurrentMarkSweepPolicy : public TwoGenerationCollectorPolicy {
  protected:
   void initialize_generations();
@@ -55,3 +60,5 @@
     return CollectorPolicy::ASConcurrentMarkSweepPolicyKind;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSCOLLECTORPOLICY_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_cmsGCAdaptivePolicyCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
+#include "memory/resourceArea.hpp"
 
 CMSGCAdaptivePolicyCounters::CMSGCAdaptivePolicyCounters(const char* name_arg,
                                         int collectors,
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
+
+#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
+#include "gc_implementation/shared/gcStats.hpp"
+#include "runtime/perfData.hpp"
+
 // CMSGCAdaptivePolicyCounters is a holder class for performance counters
 // that track the data and decisions for the ergonomics policy for the
 // concurrent mark sweep collector
@@ -298,3 +306,5 @@
     return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_cmsLockVerifier.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "runtime/vmThread.hpp"
 
 ///////////// Locking verification specific to CMS //////////////
 // Much like "assert_lock_strong()", except that it relaxes the
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSLOCKVERIFIER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSLOCKVERIFIER_HPP
+
+#include "runtime/mutex.hpp"
+
 ///////////// Locking verification specific to CMS //////////////
 // Much like "assert_lock_strong()", except
 // that it relaxes the assertion somewhat for the parallel GC case, where
@@ -38,3 +43,5 @@
     assert_locked(lock, NULL);
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSLOCKVERIFIER_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
+
+#include "memory/genOopClosures.hpp"
+
 /////////////////////////////////////////////////////////////////
 // Closures used by ConcurrentMarkSweepGeneration's collector
 /////////////////////////////////////////////////////////////////
@@ -427,3 +432,5 @@
   inline void do_oop_nv(oop* p)       { CMSParKeepAliveClosure::do_oop_work(p); }
   inline void do_oop_nv(narrowOop* p) { CMSParKeepAliveClosure::do_oop_work(p); }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP
+
+#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+
 // Trim our work_queue so its length is below max at return
 inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) {
   while (_work_queue->size() > max) {
@@ -74,3 +80,5 @@
 inline void Par_PushOrMarkClosure::do_yield_check() {
   _parent->do_yield_check();
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cmsPermGen.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
+#include "gc_implementation/shared/cSpaceCounters.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/compactPermGen.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/permGen.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 CMSPermGen::CMSPermGen(ReservedSpace rs, size_t initial_byte_size,
              CardTableRS* ct,
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSPERMGEN_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSPERMGEN_HPP
+
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#include "memory/permGen.hpp"
+
 class CardTableRS;   // fwd decl
 class ConcurrentMarkSweepGeneration;
 
@@ -75,3 +81,5 @@
   bool must_be_youngest() const { return false; }
   bool must_be_oldest() const { return false; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSPERMGEN_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,25 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_compactibleFreeListSpace.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp"
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/shared/liveRange.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/java.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/copy.hpp"
 
 /////////////////////////////////////////////////////////////////////////
 //// CompactibleFreeListSpace
@@ -1093,7 +1110,9 @@
 // perm_gen_verify_bit_map where we store the "deadness" information if
 // we did not sweep the perm gen in the most recent previous GC cycle.
 bool CompactibleFreeListSpace::obj_is_alive(const HeapWord* p) const {
-  assert (block_is_obj(p), "The address should point to an object");
+  assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(),
+         "Else races are possible");
+  assert(block_is_obj(p), "The address should point to an object");
 
   // If we're sweeping, we use object liveness information from the main bit map
   // for both perm gen and old gen.
@@ -1102,9 +1121,14 @@
   // main marking bit map (live_map below) is locked,
   // OR we're in other phases and perm_gen_verify_bit_map (dead_map below)
   // is stable, because it's mutated only in the sweeping phase.
+  // NOTE: This method is also used by jmap where, if class unloading is
+  // off, the results can return "false" for legitimate perm objects,
+  // when we are not in the midst of a sweeping phase, which can result
+  // in jmap not reporting certain perm gen objects. This will be moot
+  // if/when the perm gen goes away in the future.
   if (_collector->abstract_state() == CMSCollector::Sweeping) {
     CMSBitMap* live_map = _collector->markBitMap();
-    return live_map->isMarked((HeapWord*) p);
+    return live_map->par_isMarked((HeapWord*) p);
   } else {
     // If we're not currently sweeping and we haven't swept the perm gen in
     // the previous concurrent cycle then we may have dead but unswept objects
@@ -2266,7 +2290,7 @@
 }
 
 void CompactibleFreeListSpace::print() const {
-  Space::print_on(tty);
+  print_on(tty);
 }
 
 void CompactibleFreeListSpace::prepare_for_verify() {
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP
+
+#include "gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp"
+#include "gc_implementation/concurrentMarkSweep/freeList.hpp"
+#include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/space.hpp"
+
 // Classes in support of keeping track of promotions into a non-Contiguous
 // space, in this case a CompactibleFreeListSpace.
 
@@ -646,3 +655,5 @@
                                    * CMSSpoolBlockSize);
   return CompactibleFreeListSpace::adjustObjectSize(sz);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,39 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_concurrentMarkSweepGeneration.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp"
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genMarkSweep.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/iterator.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/globals_extension.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/vmThread.hpp"
+#include "services/memoryService.hpp"
+#include "services/runtimeService.hpp"
 
 // statics
 CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
@@ -865,7 +896,7 @@
   size_t available = max_available();
   size_t av_promo  = (size_t)gc_stats()->avg_promoted()->padded_average();
   bool   res = (available >= av_promo) || (available >= max_promotion_in_bytes);
-  if (PrintGC && Verbose) {
+  if (Verbose && PrintGCDetails) {
     gclog_or_tty->print_cr(
       "CMS: promo attempt is%s safe: available("SIZE_FORMAT") %s av_promo("SIZE_FORMAT"),"
       "max_promo("SIZE_FORMAT")",
@@ -1531,8 +1562,8 @@
   GenCollectedHeap* gch = GenCollectedHeap::heap();
   assert(gch->collector_policy()->is_two_generation_policy(),
          "You may want to check the correctness of the following");
-  if (gch->incremental_collection_will_fail()) {
-    if (PrintGCDetails && Verbose) {
+  if (gch->incremental_collection_will_fail(true /* consult_young */)) {
+    if (Verbose && PrintGCDetails) {
       gclog_or_tty->print("CMSCollector: collect because incremental collection will fail ");
     }
     return true;
@@ -1896,7 +1927,7 @@
          "You may want to check the correctness of the following");
   // Inform cms gen if this was due to partial collection failing.
   // The CMS gen may use this fact to determine its expansion policy.
-  if (gch->incremental_collection_will_fail()) {
+  if (gch->incremental_collection_will_fail(false /* don't consult_young */)) {
     assert(!_cmsGen->incremental_collection_failed(),
            "Should have been noticed, reacted to and cleared");
     _cmsGen->set_incremental_collection_failed();
@@ -1905,7 +1936,7 @@
     UseCMSCompactAtFullCollection &&
     ((_full_gcs_since_conc_gc >= CMSFullGCsBeforeCompaction) ||
      GCCause::is_user_requested_gc(gch->gc_cause()) ||
-     gch->incremental_collection_will_fail());
+     gch->incremental_collection_will_fail(true /* consult_young */));
   *should_start_over = false;
   if (clear_all_soft_refs && !*should_compact) {
     // We are about to do a last ditch collection attempt
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,22 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
+
+#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
+#include "gc_implementation/shared/gSpaceCounters.hpp"
+#include "gc_implementation/shared/gcStats.hpp"
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/generation.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/virtualspace.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/bitMap.inline.hpp"
+#include "utilities/stack.inline.hpp"
+#include "utilities/taskqueue.hpp"
+#include "utilities/yieldingWorkgroup.hpp"
+
 // ConcurrentMarkSweepGeneration is in support of a concurrent
 // mark-sweep old generation in the Detlefs-Printezis--Boehm-Demers-Schenker
 // style. We assume, for now, that this generation is always the
@@ -1882,3 +1898,5 @@
   TraceCMSMemoryManagerStats();
 };
 
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
+
+#include "gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp"
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "memory/defNewGeneration.hpp"
+
 inline void CMSBitMap::clear_all() {
   assert_locked();
   // CMS bitmaps are usually cover large memory regions
@@ -277,7 +287,7 @@
   // scavenge is done or foreground GC wants to take over collection
   return _collectorState == AbortablePreclean &&
          (_abort_preclean || _foregroundGCIsActive ||
-          GenCollectedHeap::heap()->incremental_collection_will_fail());
+          GenCollectedHeap::heap()->incremental_collection_will_fail(true /* consult_young */));
 }
 
 inline size_t CMSCollector::get_eden_used() const {
@@ -505,3 +515,5 @@
                  CardTableModRefBS::card_size /* bytes */));
   _t->par_mark_range(mr2);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_concurrentMarkSweepThread.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/vmThread.hpp"
 
 // ======= Concurrent Mark Sweep Thread ========
 
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPTHREAD_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPTHREAD_HPP
+
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#include "gc_implementation/shared/concurrentGCThread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 class ConcurrentMarkSweepGeneration;
 class CMSCollector;
 
@@ -251,3 +266,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPTHREAD_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_freeBlockDictionary.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 #ifndef PRODUCT
 Mutex* FreeBlockDictionary::par_lock() const {
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREEBLOCKDICTIONARY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREEBLOCKDICTIONARY_HPP
+
+#include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
+#include "memory/allocation.hpp"
+#include "memory/memRegion.hpp"
+#include "runtime/mutex.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/ostream.hpp"
+
 // A FreeBlockDictionary is an abstract superclass that will allow
 // a number of alternative implementations in the future.
 class FreeBlockDictionary: public CHeapObj {
@@ -88,3 +99,5 @@
   void   set_par_lock(Mutex* lock)       PRODUCT_RETURN;
   void   verify_par_locked()       const PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREEBLOCKDICTIONARY_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_freeChunk.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
+#include "utilities/copy.hpp"
 
 #ifndef PRODUCT
 
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREECHUNK_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREECHUNK_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/memRegion.hpp"
+#include "oops/markOop.hpp"
+#include "runtime/mutex.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/ostream.hpp"
+
 //
 // Free block maintenance for Concurrent Mark Sweep Generation
 //
@@ -141,3 +152,5 @@
 
 extern size_t MinChunkSize;
 
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREECHUNK_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_freeList.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
+#include "gc_implementation/concurrentMarkSweep/freeList.hpp"
+#include "memory/sharedHeap.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/vmThread.hpp"
 
 // Free list.  A FreeList is used to access a linked list of chunks
 // of space in the heap.  The head and tail are maintained so that
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREELIST_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREELIST_HPP
+
+#include "gc_implementation/shared/allocationStats.hpp"
+
 class CompactibleFreeListSpace;
 
 // A class for maintaining a free list of FreeChunk's.  The FreeList
@@ -326,3 +331,5 @@
   static void print_labels_on(outputStream* st, const char* c);
   void print_on(outputStream* st, const char* c = NULL) const;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREELIST_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_promotionInfo.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp"
+#include "oops/markOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 
 /////////////////////////////////////////////////////////////////////////
 //// PromotionInfo
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP
+
+#include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
+#include "memory/allocation.hpp"
+
 // Forward declarations
 class CompactibleFreeListSpace;
 
@@ -204,3 +210,5 @@
   void print_statistics(uint worker_id) const;
 };
 
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,15 @@
  * questions.
  *
  */
-# include "incls/_precompiled.incl"
-# include "incls/_vmCMSOperations.cpp.incl"
 
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "utilities/dtrace.hpp"
 HS_DTRACE_PROBE_DECL(hs_private, cms__initmark__begin);
 HS_DTRACE_PROBE_DECL(hs_private, cms__initmark__end);
 
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP
+
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "gc_interface/gcCause.hpp"
+#include "runtime/vm_operations.hpp"
+
 // The VM_CMS_Operation is slightly different from
 // a VM_GC_Operation -- and would not have subclassed easily
 // to VM_GC_Operation without several changes to VM_GC_Operation.
@@ -136,3 +144,5 @@
   virtual bool is_cheap_allocated() const { return false; }
   virtual bool evaluate_at_safepoint() const;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMSTRUCTS_CMS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMSTRUCTS_CMS_HPP
+
 #define VM_STRUCTS_CMS(nonstatic_field, \
                    volatile_nonstatic_field, \
                    static_field) \
@@ -78,3 +81,5 @@
 #define VM_INT_CONSTANTS_CMS(declare_constant)                            \
   declare_constant(Generation::ConcurrentMarkSweep)                       \
   declare_constant(PermGen::ConcurrentMarkSweep)
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMSTRUCTS_CMS_HPP
--- a/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP
+
+#include "memory/genOopClosures.hpp"
+#include "memory/generation.hpp"
+#include "runtime/os.hpp"
+#include "utilities/taskqueue.hpp"
+
 // A BufferingOops closure tries to separate out the cost of finding roots
 // from the cost of applying closures to them.  It maintains an array of
 // ref-containing locations.  Until the array is full, applying the closure
@@ -201,3 +209,5 @@
     _hr_curr(_hr_buffer),
     _closure_app_seconds(0.0) { }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP
--- a/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_collectionSetChooser.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/collectionSetChooser.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "memory/space.inline.hpp"
 
 CSetChooserCache::CSetChooserCache() {
   for (int i = 0; i < CacheLength; ++i)
--- a/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_COLLECTIONSETCHOOSER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_COLLECTIONSETCHOOSER_HPP
+
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "utilities/growableArray.hpp"
+
 // We need to sort heap regions by collection desirability.
 
 class CSetChooserCache VALUE_OBJ_CLASS_SPEC {
@@ -136,3 +142,5 @@
 #endif
 
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_COLLECTIONSETCHOOSER_HPP
--- a/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_concurrentG1Refine.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentG1Refine.hpp"
+#include "gc_implementation/g1/concurrentG1RefineThread.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1RemSet.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "memory/space.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "utilities/copy.hpp"
 
 // Possible sizes for the card counts cache: odd primes that roughly double in size.
 // (See jvmtiTagMap.cpp).
--- a/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // Forward decl
 class ConcurrentG1RefineThread;
 class G1RemSet;
@@ -223,3 +231,5 @@
 
   int thread_threshold_step() const { return _thread_threshold_step; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP
--- a/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,14 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_concurrentG1RefineThread.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentG1Refine.hpp"
+#include "gc_implementation/g1/concurrentG1RefineThread.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
 
 ConcurrentG1RefineThread::
 ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *next,
--- a/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP
+
+#include "gc_implementation/shared/concurrentGCThread.hpp"
+
 // Forward Decl.
 class ConcurrentG1Refine;
 
@@ -84,3 +89,5 @@
   // shutdown
   void stop();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP
--- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_concurrentMark.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "gc_implementation/g1/concurrentMark.hpp"
+#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1RemSet.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
 
 //
 // CMS Bit Map Wrapper
@@ -1038,6 +1051,7 @@
   void work(int worker_i) {
     assert(Thread::current()->is_ConcurrentGC_thread(),
            "this should only be done by a conc GC thread");
+    ResourceMark rm;
 
     double start_vtime = os::elapsedVTime();
 
@@ -1811,23 +1825,11 @@
   }
 }
 
-
-class G1CMIsAliveClosure: public BoolObjectClosure {
-  G1CollectedHeap* _g1;
- public:
-  G1CMIsAliveClosure(G1CollectedHeap* g1) :
-    _g1(g1)
-  {}
-
-  void do_object(oop obj) {
-    assert(false, "not to be invoked");
-  }
-  bool do_object_b(oop obj) {
-    HeapWord* addr = (HeapWord*)obj;
-    return addr != NULL &&
-           (!_g1->is_in_g1_reserved(addr) || !_g1->is_obj_ill(obj));
-  }
-};
+bool G1CMIsAliveClosure::do_object_b(oop obj) {
+  HeapWord* addr = (HeapWord*)obj;
+  return addr != NULL &&
+         (!_g1->is_in_g1_reserved(addr) || !_g1->is_obj_ill(obj));
+}
 
 class G1CMKeepAliveClosure: public OopClosure {
   G1CollectedHeap* _g1;
@@ -1875,20 +1877,22 @@
   G1CollectedHeap* g1h   = G1CollectedHeap::heap();
   ReferenceProcessor* rp = g1h->ref_processor();
 
+  // See the comment in G1CollectedHeap::ref_processing_init()
+  // about how reference processing currently works in G1.
+
   // Process weak references.
   rp->setup_policy(clear_all_soft_refs);
   assert(_markStack.isEmpty(), "mark stack should be empty");
 
-  G1CMIsAliveClosure   g1IsAliveClosure  (g1h);
-  G1CMKeepAliveClosure g1KeepAliveClosure(g1h, this, nextMarkBitMap());
+  G1CMIsAliveClosure   g1_is_alive(g1h);
+  G1CMKeepAliveClosure g1_keep_alive(g1h, this, nextMarkBitMap());
   G1CMDrainMarkingStackClosure
-    g1DrainMarkingStackClosure(nextMarkBitMap(), &_markStack,
-                               &g1KeepAliveClosure);
+    g1_drain_mark_stack(nextMarkBitMap(), &_markStack, &g1_keep_alive);
 
   // XXXYYY  Also: copy the parallel ref processing code from CMS.
-  rp->process_discovered_references(&g1IsAliveClosure,
-                                    &g1KeepAliveClosure,
-                                    &g1DrainMarkingStackClosure,
+  rp->process_discovered_references(&g1_is_alive,
+                                    &g1_keep_alive,
+                                    &g1_drain_mark_stack,
                                     NULL);
   assert(_markStack.overflow() || _markStack.isEmpty(),
          "mark stack should be empty (unless it overflowed)");
@@ -1901,8 +1905,8 @@
   assert(!rp->discovery_enabled(), "should have been disabled");
 
   // Now clean up stale oops in SymbolTable and StringTable
-  SymbolTable::unlink(&g1IsAliveClosure);
-  StringTable::unlink(&g1IsAliveClosure);
+  SymbolTable::unlink(&g1_is_alive);
+  StringTable::unlink(&g1_is_alive);
 }
 
 void ConcurrentMark::swapMarkBitMaps() {
@@ -2905,7 +2909,11 @@
   CMOopClosure(G1CollectedHeap* g1h,
                ConcurrentMark* cm,
                CMTask* task)
-    : _g1h(g1h), _cm(cm), _task(task) { }
+    : _g1h(g1h), _cm(cm), _task(task)
+  {
+    _ref_processor = g1h->ref_processor();
+    assert(_ref_processor != NULL, "should not be NULL");
+  }
 };
 
 void CMTask::setup_for_region(HeapRegion* hr) {
--- a/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,11 +22,36 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
+
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "utilities/taskqueue.hpp"
+
 class G1CollectedHeap;
 class CMTask;
 typedef GenericTaskQueue<oop>            CMTaskQueue;
 typedef GenericTaskQueueSet<CMTaskQueue> CMTaskQueueSet;
 
+// Closure used by CM during concurrent reference discovery
+// and reference processing (during remarking) to determine
+// if a particular object is alive. It is primarily used
+// to determine if referents of discovered reference objects
+// are alive. An instance is also embedded into the
+// reference processor as the _is_alive_non_header field
+class G1CMIsAliveClosure: public BoolObjectClosure {
+  G1CollectedHeap* _g1;
+ public:
+  G1CMIsAliveClosure(G1CollectedHeap* g1) :
+    _g1(g1)
+  {}
+
+  void do_object(oop obj) {
+    ShouldNotCallThis();
+  }
+  bool do_object_b(oop obj);
+};
+
 // A generic CM bit map.  This is essentially a wrapper around the BitMap
 // class, with one bit per (1<<_shifter) HeapWords.
 
@@ -1120,3 +1145,5 @@
   void increase_objs_found_on_bitmap() { ++_objs_found_on_bitmap; }
 #endif // _MARKING_STATS_
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
--- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_concurrentMarkThread.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1MMUTracker.hpp"
+#include "gc_implementation/g1/vm_operations_g1.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/vmThread.hpp"
 
 // ======= Concurrent Mark Thread ========
 
@@ -271,7 +277,9 @@
     // completed. This will also notify the FullGCCount_lock in case a
     // Java thread is waiting for a full GC to happen (e.g., it
     // called System.gc() with +ExplicitGCInvokesConcurrent).
-    g1->increment_full_collections_completed(true /* outer */);
+    _sts.join();
+    g1->increment_full_collections_completed(true /* concurrent */);
+    _sts.leave();
   }
   assert(_should_terminate, "just checking");
 
--- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_HPP
+
+#include "gc_implementation/shared/concurrentGCThread.hpp"
+
 // The Concurrent Mark GC Thread (could be several in the future).
 // This is copied from the Concurrent Mark Sweep GC Thread
 // Still under construction.
@@ -93,3 +98,5 @@
   // shutdown
   void stop();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_HPP
--- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_INLINE_HPP
+
+#include "gc_implementation/g1/concurrentMark.hpp"
+#include "gc_implementation/g1/concurrentMarkThread.hpp"
+
   // Total virtual time so far.
 inline double ConcurrentMarkThread::vtime_accum() {
   return _vtime_accum + _cm->all_task_accum_vtime();
@@ -31,3 +37,5 @@
 inline double ConcurrentMarkThread::vtime_mark_accum() {
   return _vtime_mark_accum + _cm->all_task_accum_vtime();
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_INLINE_HPP
--- a/src/share/vm/gc_implementation/g1/concurrentZFThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentZFThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_concurrentZFThread.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentZFThread.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "memory/space.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "utilities/copy.hpp"
 
 // ======= Concurrent Zero-Fill Thread ========
 
--- a/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTZFTHREAD_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTZFTHREAD_HPP
+
+#include "gc_implementation/shared/concurrentGCThread.hpp"
+
 // The Concurrent ZF Thread.  Performs concurrent zero-filling.
 
 class ConcurrentZFThread: public ConcurrentGCThread {
@@ -82,3 +87,5 @@
 
   static void print_summary_info();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTZFTHREAD_HPP
--- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,23 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dirtyCardQueue.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/dirtyCardQueue.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/workgroup.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 bool DirtyCardQueue::apply_closure(CardTableEntryClosure* cl,
                                    bool consume,
--- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_DIRTYCARDQUEUE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_DIRTYCARDQUEUE_HPP
+
+#include "gc_implementation/g1/ptrQueue.hpp"
+#include "memory/allocation.hpp"
+
 class FreeIdSet;
 
 // A closure class for processing card table entries.  Note that we don't
@@ -168,3 +174,5 @@
   }
 
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_DIRTYCARDQUEUE_HPP
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1BlockOffsetTable.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
+#include "memory/space.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 //////////////////////////////////////////////////////////////////////
 // G1BlockOffsetSharedArray
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP
+
+#include "memory/memRegion.hpp"
+#include "runtime/virtualspace.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // The CollectedHeap type requires subtypes to implement a method
 // "block_start".  For some subtypes, notably generational
 // systems using card-table-based write barriers, the efficiency of this
@@ -489,3 +496,5 @@
 
   virtual void set_for_starts_humongous(HeapWord* new_end);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
+
+#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
+#include "memory/space.hpp"
+
 inline HeapWord* G1BlockOffsetTable::block_start(const void* addr) {
   if (addr >= _bottom && addr < _end) {
     return block_start_unsafe(addr);
@@ -151,3 +157,5 @@
 inline void G1BlockOffsetArray::freed(HeapWord* blk, size_t size) {
   freed(blk, blk + size);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,29 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1CollectedHeap.cpp.incl"
+#include "precompiled.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_implementation/g1/bufferingOopClosure.hpp"
+#include "gc_implementation/g1/concurrentG1Refine.hpp"
+#include "gc_implementation/g1/concurrentG1RefineThread.hpp"
+#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
+#include "gc_implementation/g1/concurrentZFThread.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1MarkSweep.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "gc_implementation/g1/vm_operations_g1.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/generationSpec.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#include "runtime/aprofiler.hpp"
+#include "runtime/vmThread.hpp"
 
 size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
 
@@ -37,10 +58,11 @@
 // INVARIANTS/NOTES
 //
 // All allocation activity covered by the G1CollectedHeap interface is
-//   serialized by acquiring the HeapLock.  This happens in
-//   mem_allocate_work, which all such allocation functions call.
-//   (Note that this does not apply to TLAB allocation, which is not part
-//   of this interface: it is done by clients of this interface.)
+// serialized by acquiring the HeapLock.  This happens in mem_allocate
+// and allocate_new_tlab, which are the "entry" points to the
+// allocation code from the rest of the JVM.  (Note that this does not
+// apply to TLAB allocation, which is not part of this interface: it
+// is done by clients of this interface.)
 
 // Local to this file.
 
@@ -515,18 +537,20 @@
 // If could fit into free regions w/o expansion, try.
 // Otherwise, if can expand, do so.
 // Otherwise, if using ex regions might help, try with ex given back.
-HeapWord* G1CollectedHeap::humongousObjAllocate(size_t word_size) {
+HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size) {
+  assert_heap_locked_or_at_safepoint();
   assert(regions_accounted_for(), "Region leakage!");
 
-  // We can't allocate H regions while cleanupComplete is running, since
-  // some of the regions we find to be empty might not yet be added to the
-  // unclean list.  (If we're already at a safepoint, this call is
-  // unnecessary, not to mention wrong.)
-  if (!SafepointSynchronize::is_at_safepoint())
+  // We can't allocate humongous regions while cleanupComplete is
+  // running, since some of the regions we find to be empty might not
+  // yet be added to the unclean list. If we're already at a
+  // safepoint, this call is unnecessary, not to mention wrong.
+  if (!SafepointSynchronize::is_at_safepoint()) {
     wait_for_cleanup_complete();
+  }
 
   size_t num_regions =
-    round_to(word_size, HeapRegion::GrainWords) / HeapRegion::GrainWords;
+         round_to(word_size, HeapRegion::GrainWords) / HeapRegion::GrainWords;
 
   // Special case if < one region???
 
@@ -577,153 +601,494 @@
   return res;
 }
 
+void
+G1CollectedHeap::retire_cur_alloc_region(HeapRegion* cur_alloc_region) {
+  // The cleanup operation might update _summary_bytes_used
+  // concurrently with this method. So, right now, if we don't wait
+  // for it to complete, updates to _summary_bytes_used might get
+  // lost. This will be resolved in the near future when the operation
+  // of the free region list is revamped as part of CR 6977804.
+  wait_for_cleanup_complete();
+
+  retire_cur_alloc_region_common(cur_alloc_region);
+  assert(_cur_alloc_region == NULL, "post-condition");
+}
+
+// See the comment in the .hpp file about the locking protocol and
+// assumptions of this method (and other related ones).
 HeapWord*
-G1CollectedHeap::attempt_allocation_slow(size_t word_size,
-                                         bool permit_collection_pause) {
-  HeapWord* res = NULL;
-  HeapRegion* allocated_young_region = NULL;
-
-  assert( SafepointSynchronize::is_at_safepoint() ||
-          Heap_lock->owned_by_self(), "pre condition of the call" );
-
-  if (isHumongous(word_size)) {
-    // Allocation of a humongous object can, in a sense, complete a
-    // partial region, if the previous alloc was also humongous, and
-    // caused the test below to succeed.
-    if (permit_collection_pause)
-      do_collection_pause_if_appropriate(word_size);
-    res = humongousObjAllocate(word_size);
-    assert(_cur_alloc_region == NULL
-           || !_cur_alloc_region->isHumongous(),
-           "Prevent a regression of this bug.");
-
-  } else {
-    // We may have concurrent cleanup working at the time. Wait for it
-    // to complete. In the future we would probably want to make the
-    // concurrent cleanup truly concurrent by decoupling it from the
-    // allocation.
-    if (!SafepointSynchronize::is_at_safepoint())
+G1CollectedHeap::replace_cur_alloc_region_and_allocate(size_t word_size,
+                                                       bool at_safepoint,
+                                                       bool do_dirtying,
+                                                       bool can_expand) {
+  assert_heap_locked_or_at_safepoint();
+  assert(_cur_alloc_region == NULL,
+         "replace_cur_alloc_region_and_allocate() should only be called "
+         "after retiring the previous current alloc region");
+  assert(SafepointSynchronize::is_at_safepoint() == at_safepoint,
+         "at_safepoint and is_at_safepoint() should be a tautology");
+  assert(!can_expand || g1_policy()->can_expand_young_list(),
+         "we should not call this method with can_expand == true if "
+         "we are not allowed to expand the young gen");
+
+  if (can_expand || !g1_policy()->is_young_list_full()) {
+    if (!at_safepoint) {
+      // The cleanup operation might update _summary_bytes_used
+      // concurrently with this method. So, right now, if we don't
+      // wait for it to complete, updates to _summary_bytes_used might
+      // get lost. This will be resolved in the near future when the
+      // operation of the free region list is revamped as part of
+      // CR 6977804. If we're already at a safepoint, this call is
+      // unnecessary, not to mention wrong.
       wait_for_cleanup_complete();
-    // If we do a collection pause, this will be reset to a non-NULL
-    // value.  If we don't, nulling here ensures that we allocate a new
-    // region below.
-    if (_cur_alloc_region != NULL) {
-      // We're finished with the _cur_alloc_region.
-      // As we're builing (at least the young portion) of the collection
-      // set incrementally we'll add the current allocation region to
-      // the collection set here.
-      if (_cur_alloc_region->is_young()) {
-        g1_policy()->add_region_to_incremental_cset_lhs(_cur_alloc_region);
+    }
+
+    HeapRegion* new_cur_alloc_region = newAllocRegion(word_size,
+                                                      false /* zero_filled */);
+    if (new_cur_alloc_region != NULL) {
+      assert(new_cur_alloc_region->is_empty(),
+             "the newly-allocated region should be empty, "
+             "as right now we only allocate new regions out of the free list");
+      g1_policy()->update_region_num(true /* next_is_young */);
+      _summary_bytes_used -= new_cur_alloc_region->used();
+      set_region_short_lived_locked(new_cur_alloc_region);
+
+      assert(!new_cur_alloc_region->isHumongous(),
+             "Catch a regression of this bug.");
+
+      // We need to ensure that the stores to _cur_alloc_region and,
+      // subsequently, to top do not float above the setting of the
+      // young type.
+      OrderAccess::storestore();
+
+      // Now allocate out of the new current alloc region. We could
+      // have re-used allocate_from_cur_alloc_region() but its
+      // operation is slightly different to what we need here. First,
+      // allocate_from_cur_alloc_region() is only called outside a
+      // safepoint and will always unlock the Heap_lock if it returns
+      // a non-NULL result. Second, it assumes that the current alloc
+      // region is what's already assigned in _cur_alloc_region. What
+      // we want here is to actually do the allocation first before we
+      // assign the new region to _cur_alloc_region. This ordering is
+      // not currently important, but it will be essential when we
+      // change the code to support CAS allocation in the future (see
+      // CR 6994297).
+      //
+      // This allocate method does BOT updates and we don't need them in
+      // the young generation. This will be fixed in the near future by
+      // CR 6994297.
+      HeapWord* result = new_cur_alloc_region->allocate(word_size);
+      assert(result != NULL, "we just allocate out of an empty region "
+             "so allocation should have been successful");
+      assert(is_in(result), "result should be in the heap");
+
+      _cur_alloc_region = new_cur_alloc_region;
+
+      if (!at_safepoint) {
+        Heap_lock->unlock();
       }
-      _summary_bytes_used += _cur_alloc_region->used();
-      _cur_alloc_region = NULL;
+
+      // do the dirtying, if necessary, after we release the Heap_lock
+      if (do_dirtying) {
+        dirty_young_block(result, word_size);
+      }
+      return result;
     }
-    assert(_cur_alloc_region == NULL, "Invariant.");
-    // Completion of a heap region is perhaps a good point at which to do
-    // a collection pause.
-    if (permit_collection_pause)
-      do_collection_pause_if_appropriate(word_size);
-    // Make sure we have an allocation region available.
-    if (_cur_alloc_region == NULL) {
-      if (!SafepointSynchronize::is_at_safepoint())
-        wait_for_cleanup_complete();
-      bool next_is_young = should_set_young_locked();
-      // If the next region is not young, make sure it's zero-filled.
-      _cur_alloc_region = newAllocRegion(word_size, !next_is_young);
-      if (_cur_alloc_region != NULL) {
-        _summary_bytes_used -= _cur_alloc_region->used();
-        if (next_is_young) {
-          set_region_short_lived_locked(_cur_alloc_region);
-          allocated_young_region = _cur_alloc_region;
+  }
+
+  assert(_cur_alloc_region == NULL, "we failed to allocate a new current "
+         "alloc region, it should still be NULL");
+  assert_heap_locked_or_at_safepoint();
+  return NULL;
+}
+
+// See the comment in the .hpp file about the locking protocol and
+// assumptions of this method (and other related ones).
+HeapWord*
+G1CollectedHeap::attempt_allocation_slow(size_t word_size) {
+  assert_heap_locked_and_not_at_safepoint();
+  assert(!isHumongous(word_size), "attempt_allocation_slow() should not be "
+         "used for humongous allocations");
+
+  // We will loop while succeeded is false, which means that we tried
+  // to do a collection, but the VM op did not succeed. So, when we
+  // exit the loop, either one of the allocation attempts was
+  // successful, or we succeeded in doing the VM op but which was
+  // unable to allocate after the collection.
+  for (int try_count = 1; /* we'll return or break */; try_count += 1) {
+    bool succeeded = true;
+
+    {
+      // We may have concurrent cleanup working at the time. Wait for
+      // it to complete. In the future we would probably want to make
+      // the concurrent cleanup truly concurrent by decoupling it from
+      // the allocation. This will happen in the near future as part
+      // of CR 6977804 which will revamp the operation of the free
+      // region list. The fact that wait_for_cleanup_complete() will
+      // do a wait() means that we'll give up the Heap_lock. So, it's
+      // possible that when we exit wait_for_cleanup_complete() we
+      // might be able to allocate successfully (since somebody else
+      // might have done a collection meanwhile). So, we'll attempt to
+      // allocate again, just in case. When we make cleanup truly
+      // concurrent with allocation, we should remove this allocation
+      // attempt as it's redundant (we only reach here after an
+      // allocation attempt has been unsuccessful).
+      wait_for_cleanup_complete();
+      HeapWord* result = attempt_allocation(word_size);
+      if (result != NULL) {
+        assert_heap_not_locked();
+        return result;
+      }
+    }
+
+    if (GC_locker::is_active_and_needs_gc()) {
+      // We are locked out of GC because of the GC locker. We can
+      // allocate a new region only if we can expand the young gen.
+
+      if (g1_policy()->can_expand_young_list()) {
+        // Yes, we are allowed to expand the young gen. Let's try to
+        // allocate a new current alloc region.
+
+        HeapWord* result =
+          replace_cur_alloc_region_and_allocate(word_size,
+                                                false, /* at_safepoint */
+                                                true,  /* do_dirtying */
+                                                true   /* can_expand */);
+        if (result != NULL) {
+          assert_heap_not_locked();
+          return result;
         }
       }
+      // We could not expand the young gen further (or we could but we
+      // failed to allocate a new region). We'll stall until the GC
+      // locker forces a GC.
+
+      // If this thread is not in a jni critical section, we stall
+      // the requestor until the critical section has cleared and
+      // GC allowed. When the critical section clears, a GC is
+      // initiated by the last thread exiting the critical section; so
+      // we retry the allocation sequence from the beginning of the loop,
+      // rather than causing more, now probably unnecessary, GC attempts.
+      JavaThread* jthr = JavaThread::current();
+      assert(jthr != NULL, "sanity");
+      if (!jthr->in_critical()) {
+        MutexUnlocker mul(Heap_lock);
+        GC_locker::stall_until_clear();
+
+        // We'll then fall off the end of the ("if GC locker active")
+        // if-statement and retry the allocation further down in the
+        // loop.
+      } else {
+        if (CheckJNICalls) {
+          fatal("Possible deadlock due to allocating while"
+                " in jni critical section");
+        }
+        return NULL;
+      }
+    } else {
+      // We are not locked out. So, let's try to do a GC. The VM op
+      // will retry the allocation before it completes.
+
+      // Read the GC count while holding the Heap_lock
+      unsigned int gc_count_before = SharedHeap::heap()->total_collections();
+
+      Heap_lock->unlock();
+
+      HeapWord* result =
+        do_collection_pause(word_size, gc_count_before, &succeeded);
+      assert_heap_not_locked();
+      if (result != NULL) {
+        assert(succeeded, "the VM op should have succeeded");
+
+        // Allocations that take place on VM operations do not do any
+        // card dirtying and we have to do it here.
+        dirty_young_block(result, word_size);
+        return result;
+      }
+
+      Heap_lock->lock();
     }
+
+    assert_heap_locked();
+
+    // We can reach here when we were unsuccessful in doing a GC,
+    // because another thread beat us to it, or because we were locked
+    // out of GC due to the GC locker. In either case a new alloc
+    // region might be available so we will retry the allocation.
+    HeapWord* result = attempt_allocation(word_size);
+    if (result != NULL) {
+      assert_heap_not_locked();
+      return result;
+    }
+
+    // So far our attempts to allocate failed. The only time we'll go
+    // around the loop and try again is if we tried to do a GC and the
+    // VM op that we tried to schedule was not successful because
+    // another thread beat us to it. If that happened it's possible
+    // that by the time we grabbed the Heap_lock again and tried to
+    // allocate other threads filled up the young generation, which
+    // means that the allocation attempt after the GC also failed. So,
+    // it's worth trying to schedule another GC pause.
+    if (succeeded) {
+      break;
+    }
+
+    // Give a warning if we seem to be looping forever.
+    if ((QueuedAllocationWarningCount > 0) &&
+        (try_count % QueuedAllocationWarningCount == 0)) {
+      warning("G1CollectedHeap::attempt_allocation_slow() "
+              "retries %d times", try_count);
+    }
+  }
+
+  assert_heap_locked();
+  return NULL;
+}
+
+// See the comment in the .hpp file about the locking protocol and
+// assumptions of this method (and other related ones).
+HeapWord*
+G1CollectedHeap::attempt_allocation_humongous(size_t word_size,
+                                              bool at_safepoint) {
+  // This is the method that will allocate a humongous object. All
+  // allocation paths that attempt to allocate a humongous object
+  // should eventually reach here. Currently, the only paths are from
+  // mem_allocate() and attempt_allocation_at_safepoint().
+  assert_heap_locked_or_at_safepoint();
+  assert(isHumongous(word_size), "attempt_allocation_humongous() "
+         "should only be used for humongous allocations");
+  assert(SafepointSynchronize::is_at_safepoint() == at_safepoint,
+         "at_safepoint and is_at_safepoint() should be a tautology");
+
+  HeapWord* result = NULL;
+
+  // We will loop while succeeded is false, which means that we tried
+  // to do a collection, but the VM op did not succeed. So, when we
+  // exit the loop, either one of the allocation attempts was
+  // successful, or we succeeded in doing the VM op but which was
+  // unable to allocate after the collection.
+  for (int try_count = 1; /* we'll return or break */; try_count += 1) {
+    bool succeeded = true;
+
+    // Given that humongous objects are not allocated in young
+    // regions, we'll first try to do the allocation without doing a
+    // collection hoping that there's enough space in the heap.
+    result = humongous_obj_allocate(word_size);
     assert(_cur_alloc_region == NULL || !_cur_alloc_region->isHumongous(),
-           "Prevent a regression of this bug.");
-
-    // Now retry the allocation.
-    if (_cur_alloc_region != NULL) {
-      if (allocated_young_region != NULL) {
-        // We need to ensure that the store to top does not
-        // float above the setting of the young type.
-        OrderAccess::storestore();
+           "catch a regression of this bug.");
+    if (result != NULL) {
+      if (!at_safepoint) {
+        // If we're not at a safepoint, unlock the Heap_lock.
+        Heap_lock->unlock();
       }
-      res = _cur_alloc_region->allocate(word_size);
+      return result;
     }
-  }
-
-  // NOTE: fails frequently in PRT
-  assert(regions_accounted_for(), "Region leakage!");
-
-  if (res != NULL) {
-    if (!SafepointSynchronize::is_at_safepoint()) {
-      assert( permit_collection_pause, "invariant" );
-      assert( Heap_lock->owned_by_self(), "invariant" );
+
+    // If we failed to allocate the humongous object, we should try to
+    // do a collection pause (if we're allowed) in case it reclaims
+    // enough space for the allocation to succeed after the pause.
+    if (!at_safepoint) {
+      // Read the GC count while holding the Heap_lock
+      unsigned int gc_count_before = SharedHeap::heap()->total_collections();
+
+      // If we're allowed to do a collection we're not at a
+      // safepoint, so it is safe to unlock the Heap_lock.
       Heap_lock->unlock();
+
+      result = do_collection_pause(word_size, gc_count_before, &succeeded);
+      assert_heap_not_locked();
+      if (result != NULL) {
+        assert(succeeded, "the VM op should have succeeded");
+        return result;
+      }
+
+      // If we get here, the VM operation either did not succeed
+      // (i.e., another thread beat us to it) or it succeeded but
+      // failed to allocate the object.
+
+      // If we're allowed to do a collection we're not at a
+      // safepoint, so it is safe to lock the Heap_lock.
+      Heap_lock->lock();
+    }
+
+    assert(result == NULL, "otherwise we should have exited the loop earlier");
+
+    // So far our attempts to allocate failed. The only time we'll go
+    // around the loop and try again is if we tried to do a GC and the
+    // VM op that we tried to schedule was not successful because
+    // another thread beat us to it. That way it's possible that some
+    // space was freed up by the thread that successfully scheduled a
+    // GC. So it's worth trying to allocate again.
+    if (succeeded) {
+      break;
+    }
+
+    // Give a warning if we seem to be looping forever.
+    if ((QueuedAllocationWarningCount > 0) &&
+        (try_count % QueuedAllocationWarningCount == 0)) {
+      warning("G1CollectedHeap::attempt_allocation_humongous "
+              "retries %d times", try_count);
     }
-
-    if (allocated_young_region != NULL) {
-      HeapRegion* hr = allocated_young_region;
-      HeapWord* bottom = hr->bottom();
-      HeapWord* end = hr->end();
-      MemRegion mr(bottom, end);
-      ((CardTableModRefBS*)_g1h->barrier_set())->dirty(mr);
+  }
+
+  assert_heap_locked_or_at_safepoint();
+  return NULL;
+}
+
+HeapWord* G1CollectedHeap::attempt_allocation_at_safepoint(size_t word_size,
+                                           bool expect_null_cur_alloc_region) {
+  assert_at_safepoint();
+  assert(_cur_alloc_region == NULL || !expect_null_cur_alloc_region,
+         err_msg("the current alloc region was unexpectedly found "
+                 "to be non-NULL, cur alloc region: "PTR_FORMAT" "
+                 "expect_null_cur_alloc_region: %d word_size: "SIZE_FORMAT,
+                 _cur_alloc_region, expect_null_cur_alloc_region, word_size));
+
+  if (!isHumongous(word_size)) {
+    if (!expect_null_cur_alloc_region) {
+      HeapRegion* cur_alloc_region = _cur_alloc_region;
+      if (cur_alloc_region != NULL) {
+        // This allocate method does BOT updates and we don't need them in
+        // the young generation. This will be fixed in the near future by
+        // CR 6994297.
+        HeapWord* result = cur_alloc_region->allocate(word_size);
+        if (result != NULL) {
+          assert(is_in(result), "result should be in the heap");
+
+          // We will not do any dirtying here. This is guaranteed to be
+          // called during a safepoint and the thread that scheduled the
+          // pause will do the dirtying if we return a non-NULL result.
+          return result;
+        }
+
+        retire_cur_alloc_region_common(cur_alloc_region);
+      }
     }
-  }
-
-  assert( SafepointSynchronize::is_at_safepoint() ||
-          (res == NULL && Heap_lock->owned_by_self()) ||
-          (res != NULL && !Heap_lock->owned_by_self()),
-          "post condition of the call" );
-
-  return res;
+
+    assert(_cur_alloc_region == NULL,
+           "at this point we should have no cur alloc region");
+    return replace_cur_alloc_region_and_allocate(word_size,
+                                                 true, /* at_safepoint */
+                                                 false /* do_dirtying */,
+                                                 false /* can_expand */);
+  } else {
+    return attempt_allocation_humongous(word_size,
+                                        true /* at_safepoint */);
+  }
+
+  ShouldNotReachHere();
+}
+
+HeapWord* G1CollectedHeap::allocate_new_tlab(size_t word_size) {
+  assert_heap_not_locked_and_not_at_safepoint();
+  assert(!isHumongous(word_size), "we do not allow TLABs of humongous size");
+
+  Heap_lock->lock();
+
+  // First attempt: try allocating out of the current alloc region or
+  // after replacing the current alloc region.
+  HeapWord* result = attempt_allocation(word_size);
+  if (result != NULL) {
+    assert_heap_not_locked();
+    return result;
+  }
+
+  assert_heap_locked();
+
+  // Second attempt: go into the even slower path where we might
+  // try to schedule a collection.
+  result = attempt_allocation_slow(word_size);
+  if (result != NULL) {
+    assert_heap_not_locked();
+    return result;
+  }
+
+  assert_heap_locked();
+  Heap_lock->unlock();
+  return NULL;
 }
 
 HeapWord*
 G1CollectedHeap::mem_allocate(size_t word_size,
                               bool   is_noref,
                               bool   is_tlab,
-                              bool* gc_overhead_limit_was_exceeded) {
-  debug_only(check_for_valid_allocation_state());
-  assert(no_gc_in_progress(), "Allocation during gc not allowed");
-  HeapWord* result = NULL;
+                              bool*  gc_overhead_limit_was_exceeded) {
+  assert_heap_not_locked_and_not_at_safepoint();
+  assert(!is_tlab, "mem_allocate() this should not be called directly "
+         "to allocate TLABs");
 
   // Loop until the allocation is satisified,
   // or unsatisfied after GC.
-  for (int try_count = 1; /* return or throw */; try_count += 1) {
-    int gc_count_before;
+  for (int try_count = 1; /* we'll return */; try_count += 1) {
+    unsigned int gc_count_before;
     {
       Heap_lock->lock();
-      result = attempt_allocation(word_size);
-      if (result != NULL) {
-        // attempt_allocation should have unlocked the heap lock
-        assert(is_in(result), "result not in heap");
-        return result;
+
+      if (!isHumongous(word_size)) {
+        // First attempt: try allocating out of the current alloc
+        // region or after replacing the current alloc region.
+        HeapWord* result = attempt_allocation(word_size);
+        if (result != NULL) {
+          assert_heap_not_locked();
+          return result;
+        }
+
+        assert_heap_locked();
+
+        // Second attempt: go into the even slower path where we might
+        // try to schedule a collection.
+        result = attempt_allocation_slow(word_size);
+        if (result != NULL) {
+          assert_heap_not_locked();
+          return result;
+        }
+      } else {
+        HeapWord* result = attempt_allocation_humongous(word_size,
+                                                     false /* at_safepoint */);
+        if (result != NULL) {
+          assert_heap_not_locked();
+          return result;
+        }
       }
+
+      assert_heap_locked();
       // Read the gc count while the heap lock is held.
       gc_count_before = SharedHeap::heap()->total_collections();
+      // We cannot be at a safepoint, so it is safe to unlock the Heap_lock
       Heap_lock->unlock();
     }
 
     // Create the garbage collection operation...
-    VM_G1CollectForAllocation op(word_size,
-                                 gc_count_before);
-
+    VM_G1CollectForAllocation op(gc_count_before, word_size);
     // ...and get the VM thread to execute it.
     VMThread::execute(&op);
-    if (op.prologue_succeeded()) {
-      result = op.result();
-      assert(result == NULL || is_in(result), "result not in heap");
+
+    assert_heap_not_locked();
+    if (op.prologue_succeeded() && op.pause_succeeded()) {
+      // If the operation was successful we'll return the result even
+      // if it is NULL. If the allocation attempt failed immediately
+      // after a Full GC, it's unlikely we'll be able to allocate now.
+      HeapWord* result = op.result();
+      if (result != NULL && !isHumongous(word_size)) {
+        // Allocations that take place on VM operations do not do any
+        // card dirtying and we have to do it here. We only have to do
+        // this for non-humongous allocations, though.
+        dirty_young_block(result, word_size);
+      }
       return result;
+    } else {
+      assert(op.result() == NULL,
+             "the result should be NULL if the VM op did not succeed");
     }
 
     // Give a warning if we seem to be looping forever.
     if ((QueuedAllocationWarningCount > 0) &&
         (try_count % QueuedAllocationWarningCount == 0)) {
-      warning("G1CollectedHeap::mem_allocate_work retries %d times",
-              try_count);
+      warning("G1CollectedHeap::mem_allocate retries %d times", try_count);
     }
   }
+
+  ShouldNotReachHere();
 }
 
 void G1CollectedHeap::abandon_cur_alloc_region() {
@@ -795,6 +1160,7 @@
     _worker_i(worker_i),
     _g1h(g1)
   { }
+
   bool doHeapRegion(HeapRegion* r) {
     if (!r->continuesHumongous()) {
       _cl.set_from(r);
@@ -819,13 +1185,14 @@
   }
 };
 
-void G1CollectedHeap::do_collection(bool explicit_gc,
+bool G1CollectedHeap::do_collection(bool explicit_gc,
                                     bool clear_all_soft_refs,
                                     size_t word_size) {
   if (GC_locker::check_active_before_gc()) {
-    return; // GC is disabled (e.g. JNI GetXXXCritical operation)
-  }
-
+    return false;
+  }
+
+  DTraceGCProbeMarker gc_probe_marker(true /* full */);
   ResourceMark rm;
 
   if (PrintHeapAtGC) {
@@ -907,6 +1274,9 @@
       g1_policy()->set_full_young_gcs(true);
     }
 
+    // See the comment in G1CollectedHeap::ref_processing_init() about
+    // how reference processing currently works in G1.
+
     // Temporarily make reference _discovery_ single threaded (non-MT).
     ReferenceProcessorMTMutator rp_disc_ser(ref_processor(), false);
 
@@ -1020,17 +1390,24 @@
   }
 
   // Update the number of full collections that have been completed.
-  increment_full_collections_completed(false /* outer */);
+  increment_full_collections_completed(false /* concurrent */);
 
   if (PrintHeapAtGC) {
     Universe::print_heap_after_gc();
   }
+
+  return true;
 }
 
 void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) {
-  do_collection(true,                /* explicit_gc */
-                clear_all_soft_refs,
-                0                    /* word_size */);
+  // do_collection() will return whether it succeeded in performing
+  // the GC. Currently, there is no facility on the
+  // do_full_collection() API to notify the caller than the collection
+  // did not succeed (e.g., because it was locked out by the GC
+  // locker). So, right now, we'll ignore the return value.
+  bool dummy = do_collection(true,                /* explicit_gc */
+                             clear_all_soft_refs,
+                             0                    /* word_size */);
 }
 
 // This code is mostly copied from TenuredGeneration.
@@ -1153,46 +1530,74 @@
 
 
 HeapWord*
-G1CollectedHeap::satisfy_failed_allocation(size_t word_size) {
-  HeapWord* result = NULL;
+G1CollectedHeap::satisfy_failed_allocation(size_t word_size,
+                                           bool* succeeded) {
+  assert(SafepointSynchronize::is_at_safepoint(),
+         "satisfy_failed_allocation() should only be called at a safepoint");
+  assert(Thread::current()->is_VM_thread(),
+         "satisfy_failed_allocation() should only be called by the VM thread");
+
+  *succeeded = true;
+  // Let's attempt the allocation first.
+  HeapWord* result = attempt_allocation_at_safepoint(word_size,
+                                     false /* expect_null_cur_alloc_region */);
+  if (result != NULL) {
+    assert(*succeeded, "sanity");
+    return result;
+  }
 
   // In a G1 heap, we're supposed to keep allocation from failing by
   // incremental pauses.  Therefore, at least for now, we'll favor
   // expansion over collection.  (This might change in the future if we can
   // do something smarter than full collection to satisfy a failed alloc.)
-
   result = expand_and_allocate(word_size);
   if (result != NULL) {
-    assert(is_in(result), "result not in heap");
+    assert(*succeeded, "sanity");
     return result;
   }
 
-  // OK, I guess we have to try collection.
-
-  do_collection(false, false, word_size);
-
-  result = attempt_allocation(word_size, /*permit_collection_pause*/false);
-
+  // Expansion didn't work, we'll try to do a Full GC.
+  bool gc_succeeded = do_collection(false, /* explicit_gc */
+                                    false, /* clear_all_soft_refs */
+                                    word_size);
+  if (!gc_succeeded) {
+    *succeeded = false;
+    return NULL;
+  }
+
+  // Retry the allocation
+  result = attempt_allocation_at_safepoint(word_size,
+                                      true /* expect_null_cur_alloc_region */);
   if (result != NULL) {
-    assert(is_in(result), "result not in heap");
+    assert(*succeeded, "sanity");
     return result;
   }
 
-  // Try collecting soft references.
-  do_collection(false, true, word_size);
-  result = attempt_allocation(word_size, /*permit_collection_pause*/false);
+  // Then, try a Full GC that will collect all soft references.
+  gc_succeeded = do_collection(false, /* explicit_gc */
+                               true,  /* clear_all_soft_refs */
+                               word_size);
+  if (!gc_succeeded) {
+    *succeeded = false;
+    return NULL;
+  }
+
+  // Retry the allocation once more
+  result = attempt_allocation_at_safepoint(word_size,
+                                      true /* expect_null_cur_alloc_region */);
   if (result != NULL) {
-    assert(is_in(result), "result not in heap");
+    assert(*succeeded, "sanity");
     return result;
   }
 
   assert(!collector_policy()->should_clear_all_soft_refs(),
-    "Flag should have been handled and cleared prior to this point");
+         "Flag should have been handled and cleared prior to this point");
 
   // What else?  We might try synchronous finalization later.  If the total
   // space available is large enough for the allocation, then a more
   // complete compaction phase than we've tried so far might be
   // appropriate.
+  assert(*succeeded, "sanity");
   return NULL;
 }
 
@@ -1202,14 +1607,20 @@
 // allocated block, or else "NULL".
 
 HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size) {
+  assert(SafepointSynchronize::is_at_safepoint(),
+         "expand_and_allocate() should only be called at a safepoint");
+  assert(Thread::current()->is_VM_thread(),
+         "expand_and_allocate() should only be called by the VM thread");
+
   size_t expand_bytes = word_size * HeapWordSize;
   if (expand_bytes < MinHeapDeltaBytes) {
     expand_bytes = MinHeapDeltaBytes;
   }
   expand(expand_bytes);
   assert(regions_accounted_for(), "Region leakage!");
-  HeapWord* result = attempt_allocation(word_size, false /* permit_collection_pause */);
-  return result;
+
+  return attempt_allocation_at_safepoint(word_size,
+                                     false /* expect_null_cur_alloc_region */);
 }
 
 size_t G1CollectedHeap::free_region_if_totally_empty(HeapRegion* hr) {
@@ -1358,6 +1769,7 @@
   _g1_policy(policy_),
   _dirty_card_queue_set(false),
   _into_cset_dirty_card_queue_set(false),
+  _is_alive_closure(this),
   _ref_processor(NULL),
   _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)),
   _bot_shared(NULL),
@@ -1627,14 +2039,32 @@
 }
 
 void G1CollectedHeap::ref_processing_init() {
+  // Reference processing in G1 currently works as follows:
+  //
+  // * There is only one reference processor instance that
+  //   'spans' the entire heap. It is created by the code
+  //   below.
+  // * Reference discovery is not enabled during an incremental
+  //   pause (see 6484982).
+  // * Discoverered refs are not enqueued nor are they processed
+  //   during an incremental pause (see 6484982).
+  // * Reference discovery is enabled at initial marking.
+  // * Reference discovery is disabled and the discovered
+  //   references processed etc during remarking.
+  // * Reference discovery is MT (see below).
+  // * Reference discovery requires a barrier (see below).
+  // * Reference processing is currently not MT (see 6608385).
+  // * A full GC enables (non-MT) reference discovery and
+  //   processes any discovered references.
+
   SharedHeap::ref_processing_init();
   MemRegion mr = reserved_region();
   _ref_processor = ReferenceProcessor::create_ref_processor(
                                          mr,    // span
                                          false, // Reference discovery is not atomic
-                                                // (though it shouldn't matter here.)
                                          true,  // mt_discovery
-                                         NULL,  // is alive closure: need to fill this in for efficiency
+                                         &_is_alive_closure, // is alive closure
+                                                             // for efficiency
                                          ParallelGCThreads,
                                          ParallelRefProcEnabled,
                                          true); // Setting next fields of discovered
@@ -1749,9 +2179,14 @@
      (cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent));
 }
 
-void G1CollectedHeap::increment_full_collections_completed(bool outer) {
+void G1CollectedHeap::increment_full_collections_completed(bool concurrent) {
   MonitorLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
 
+  // We assume that if concurrent == true, then the caller is a
+  // concurrent thread that was joined the Suspendible Thread
+  // Set. If there's ever a cheap way to check this, we should add an
+  // assert here.
+
   // We have already incremented _total_full_collections at the start
   // of the GC, so total_full_collections() represents how many full
   // collections have been started.
@@ -1765,17 +2200,18 @@
   // behind the number of full collections started.
 
   // This is the case for the inner caller, i.e. a Full GC.
-  assert(outer ||
+  assert(concurrent ||
          (full_collections_started == _full_collections_completed + 1) ||
          (full_collections_started == _full_collections_completed + 2),
-         err_msg("for inner caller: full_collections_started = %u "
+         err_msg("for inner caller (Full GC): full_collections_started = %u "
                  "is inconsistent with _full_collections_completed = %u",
                  full_collections_started, _full_collections_completed));
 
   // This is the case for the outer caller, i.e. the concurrent cycle.
-  assert(!outer ||
+  assert(!concurrent ||
          (full_collections_started == _full_collections_completed + 1),
-         err_msg("for outer caller: full_collections_started = %u "
+         err_msg("for outer caller (concurrent cycle): "
+                 "full_collections_started = %u "
                  "is inconsistent with _full_collections_completed = %u",
                  full_collections_started, _full_collections_completed));
 
@@ -1785,7 +2221,7 @@
   // we wake up any waiters (especially when ExplicitInvokesConcurrent
   // is set) so that if a waiter requests another System.gc() it doesn't
   // incorrectly see that a marking cyle is still in progress.
-  if (outer) {
+  if (concurrent) {
     _cmThread->clear_in_progress();
   }
 
@@ -1820,21 +2256,25 @@
   unsigned int full_gc_count_before;
   {
     MutexLocker ml(Heap_lock);
+
+    // Don't want to do a GC until cleanup is completed. This
+    // limitation will be removed in the near future when the
+    // operation of the free region list is revamped as part of
+    // CR 6977804.
+    wait_for_cleanup_complete();
+
     // Read the GC count while holding the Heap_lock
     gc_count_before = SharedHeap::heap()->total_collections();
     full_gc_count_before = SharedHeap::heap()->total_full_collections();
-
-    // Don't want to do a GC until cleanup is completed.
-    wait_for_cleanup_complete();
-
-    // We give up heap lock; VMThread::execute gets it back below
   }
 
   if (should_do_concurrent_full_gc(cause)) {
     // Schedule an initial-mark evacuation pause that will start a
-    // concurrent cycle.
+    // concurrent cycle. We're setting word_size to 0 which means that
+    // we are not requesting a post-GC allocation.
     VM_G1IncCollectionPause op(gc_count_before,
-                               true, /* should_initiate_conc_mark */
+                               0,     /* word_size */
+                               true,  /* should_initiate_conc_mark */
                                g1_policy()->max_pause_time_ms(),
                                cause);
     VMThread::execute(&op);
@@ -1842,8 +2282,10 @@
     if (cause == GCCause::_gc_locker
         DEBUG_ONLY(|| cause == GCCause::_scavenge_alot)) {
 
-      // Schedule a standard evacuation pause.
+      // Schedule a standard evacuation pause. We're setting word_size
+      // to 0 which means that we are not requesting a post-GC allocation.
       VM_G1IncCollectionPause op(gc_count_before,
+                                 0,     /* word_size */
                                  false, /* should_initiate_conc_mark */
                                  g1_policy()->max_pause_time_ms(),
                                  cause);
@@ -2199,14 +2641,6 @@
   }
 }
 
-HeapWord* G1CollectedHeap::allocate_new_tlab(size_t word_size) {
-  assert(!isHumongous(word_size),
-         err_msg("a TLAB should not be of humongous size, "
-                 "word_size = "SIZE_FORMAT, word_size));
-  bool dummy;
-  return G1CollectedHeap::mem_allocate(word_size, false, true, &dummy);
-}
-
 bool G1CollectedHeap::allocs_are_zero_filled() {
   return false;
 }
@@ -2611,27 +3045,26 @@
   // always_do_update_barrier = true;
 }
 
-void G1CollectedHeap::do_collection_pause() {
-  assert(Heap_lock->owned_by_self(), "we assume we'reholding the Heap_lock");
-
-  // Read the GC count while holding the Heap_lock
-  // we need to do this _before_ wait_for_cleanup_complete(), to
-  // ensure that we do not give up the heap lock and potentially
-  // pick up the wrong count
-  unsigned int gc_count_before = SharedHeap::heap()->total_collections();
-
-  // Don't want to do a GC pause while cleanup is being completed!
-  wait_for_cleanup_complete();
-
+HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size,
+                                               unsigned int gc_count_before,
+                                               bool* succeeded) {
+  assert_heap_not_locked_and_not_at_safepoint();
   g1_policy()->record_stop_world_start();
-  {
-    MutexUnlocker mu(Heap_lock);  // give up heap lock, execute gets it back
-    VM_G1IncCollectionPause op(gc_count_before,
-                               false, /* should_initiate_conc_mark */
-                               g1_policy()->max_pause_time_ms(),
-                               GCCause::_g1_inc_collection_pause);
-    VMThread::execute(&op);
-  }
+  VM_G1IncCollectionPause op(gc_count_before,
+                             word_size,
+                             false, /* should_initiate_conc_mark */
+                             g1_policy()->max_pause_time_ms(),
+                             GCCause::_g1_inc_collection_pause);
+  VMThread::execute(&op);
+
+  HeapWord* result = op.result();
+  bool ret_succeeded = op.prologue_succeeded() && op.pause_succeeded();
+  assert(result == NULL || ret_succeeded,
+         "the result should be NULL if the VM did not succeed");
+  *succeeded = ret_succeeded;
+
+  assert_heap_not_locked();
+  return result;
 }
 
 void
@@ -2775,19 +3208,20 @@
 }
 #endif // TASKQUEUE_STATS
 
-void
+bool
 G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
   if (GC_locker::check_active_before_gc()) {
-    return; // GC is disabled (e.g. JNI GetXXXCritical operation)
-  }
+    return false;
+  }
+
+  DTraceGCProbeMarker gc_probe_marker(false /* full */);
+  ResourceMark rm;
 
   if (PrintHeapAtGC) {
     Universe::print_heap_before_gc();
   }
 
   {
-    ResourceMark rm;
-
     // This call will decide whether this pause is an initial-mark
     // pause. If it is, during_initial_mark_pause() will return true
     // for the duration of this pause.
@@ -2849,6 +3283,9 @@
 
       COMPILER2_PRESENT(DerivedPointerTable::clear());
 
+      // Please see comment in G1CollectedHeap::ref_processing_init()
+      // to see how reference processing currently works in G1.
+      //
       // We want to turn off ref discovery, if necessary, and turn it back on
       // on again later if we do. XXX Dubious: why is discovery disabled?
       bool was_enabled = ref_processor()->discovery_enabled();
@@ -3046,6 +3483,8 @@
       (total_collections() % G1SummarizeRSetStatsPeriod == 0)) {
     g1_rem_set()->print_summary_info();
   }
+
+  return true;
 }
 
 size_t G1CollectedHeap::desired_plab_sz(GCAllocPurpose purpose)
@@ -3276,6 +3715,7 @@
   // untag the GC alloc regions and tear down the GC alloc region
   // list. It's desirable that no regions are tagged as GC alloc
   // outside GCs.
+
   forget_alloc_region_list();
 
   // The current alloc regions contain objs that have survived
@@ -3339,19 +3779,6 @@
 
 // *** Sequential G1 Evacuation
 
-HeapWord* G1CollectedHeap::allocate_during_gc(GCAllocPurpose purpose, size_t word_size) {
-  HeapRegion* alloc_region = _gc_alloc_regions[purpose];
-  // let the caller handle alloc failure
-  if (alloc_region == NULL) return NULL;
-  assert(isHumongous(word_size) || !alloc_region->isHumongous(),
-         "Either the object is humongous or the region isn't");
-  HeapWord* block = alloc_region->allocate(word_size);
-  if (block == NULL) {
-    block = allocate_during_gc_slow(purpose, alloc_region, false, word_size);
-  }
-  return block;
-}
-
 class G1IsAliveClosure: public BoolObjectClosure {
   G1CollectedHeap* _g1;
 public:
@@ -3533,8 +3960,6 @@
   // Now restore saved marks, if any.
   if (_objs_with_preserved_marks != NULL) {
     assert(_preserved_marks_of_objs != NULL, "Both or none.");
-    assert(_objs_with_preserved_marks->length() ==
-           _preserved_marks_of_objs->length(), "Both or none.");
     guarantee(_objs_with_preserved_marks->length() ==
               _preserved_marks_of_objs->length(), "Both or none.");
     for (int i = 0; i < _objs_with_preserved_marks->length(); i++) {
@@ -3629,7 +4054,10 @@
 }
 
 void G1CollectedHeap::preserve_mark_if_necessary(oop obj, markOop m) {
-  if (m != markOopDesc::prototype()) {
+  assert(evacuation_failed(), "Oversaving!");
+  // We want to call the "for_promotion_failure" version only in the
+  // case of a promotion failure.
+  if (m->must_be_preserved_for_promotion_failure(obj)) {
     if (_objs_with_preserved_marks == NULL) {
       assert(_preserved_marks_of_objs == NULL, "Both or none.");
       _objs_with_preserved_marks =
@@ -4294,6 +4722,10 @@
   }
   // Finish with the ref_processor roots.
   if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) {
+    // We need to treat the discovered reference lists as roots and
+    // keep entries (which are added by the marking threads) on them
+    // live until they can be processed at the end of marking.
+    ref_processor()->weak_oops_do(scan_non_heap_roots);
     ref_processor()->oops_do(scan_non_heap_roots);
   }
   g1_policy()->record_collection_pause_end_G1_strong_roots();
@@ -4359,6 +4791,11 @@
   // on individual heap regions when we allocate from
   // them in parallel, so this seems like the correct place for this.
   retire_all_alloc_regions();
+
+  // Weak root processing.
+  // Note: when JSR 292 is enabled and code blobs can contain
+  // non-perm oops then we will need to process the code blobs
+  // here too.
   {
     G1IsAliveClosure is_alive(this);
     G1KeepAliveClosure keep_alive(this);
@@ -4603,12 +5040,6 @@
 #endif
 }
 
-void G1CollectedHeap::do_collection_pause_if_appropriate(size_t word_size) {
-  if (g1_policy()->should_do_collection_pause(word_size)) {
-    do_collection_pause();
-  }
-}
-
 void G1CollectedHeap::free_collection_set(HeapRegion* cs_head) {
   double young_time_ms     = 0.0;
   double non_young_time_ms = 0.0;
@@ -4767,6 +5198,7 @@
 }
 
 void G1CollectedHeap::wait_for_cleanup_complete() {
+  assert_not_at_safepoint();
   MutexLockerEx x(Cleanup_mon);
   wait_for_cleanup_complete_locked();
 }
@@ -5071,13 +5503,6 @@
   return n + m;
 }
 
-bool G1CollectedHeap::should_set_young_locked() {
-  assert(heap_lock_held_for_gc(),
-              "the heap lock should already be held by or for this thread");
-  return  (g1_policy()->in_young_gc_mode() &&
-           g1_policy()->should_add_next_region_to_young_list());
-}
-
 void G1CollectedHeap::set_region_short_lived_locked(HeapRegion* hr) {
   assert(heap_lock_held_for_gc(),
               "the heap lock should already be held by or for this thread");
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
+
+#include "gc_implementation/g1/concurrentMark.hpp"
+#include "gc_implementation/g1/g1RemSet.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/parNew/parGCAllocBuffer.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/sharedHeap.hpp"
+
 // A "G1CollectedHeap" is an implementation of a java heap for HotSpot.
 // It uses the "Garbage First" heap organization and algorithm, which
 // may combine concurrent marking with parallel, incremental compaction of
@@ -279,6 +290,63 @@
   // started is maintained in _total_full_collections in CollectedHeap.
   volatile unsigned int _full_collections_completed;
 
+  // These are macros so that, if the assert fires, we get the correct
+  // line number, file, etc.
+
+#define heap_locking_asserts_err_msg(__extra_message)                         \
+  err_msg("%s : Heap_lock %slocked, %sat a safepoint",                        \
+          (__extra_message),                                                  \
+          (!Heap_lock->owned_by_self()) ? "NOT " : "",                        \
+          (!SafepointSynchronize::is_at_safepoint()) ? "NOT " : "")
+
+#define assert_heap_locked()                                                  \
+  do {                                                                        \
+    assert(Heap_lock->owned_by_self(),                                        \
+           heap_locking_asserts_err_msg("should be holding the Heap_lock"));  \
+  } while (0)
+
+#define assert_heap_locked_or_at_safepoint()                                  \
+  do {                                                                        \
+    assert(Heap_lock->owned_by_self() ||                                      \
+                                     SafepointSynchronize::is_at_safepoint(), \
+           heap_locking_asserts_err_msg("should be holding the Heap_lock or " \
+                                        "should be at a safepoint"));         \
+  } while (0)
+
+#define assert_heap_locked_and_not_at_safepoint()                             \
+  do {                                                                        \
+    assert(Heap_lock->owned_by_self() &&                                      \
+                                    !SafepointSynchronize::is_at_safepoint(), \
+          heap_locking_asserts_err_msg("should be holding the Heap_lock and " \
+                                       "should not be at a safepoint"));      \
+  } while (0)
+
+#define assert_heap_not_locked()                                              \
+  do {                                                                        \
+    assert(!Heap_lock->owned_by_self(),                                       \
+        heap_locking_asserts_err_msg("should not be holding the Heap_lock")); \
+  } while (0)
+
+#define assert_heap_not_locked_and_not_at_safepoint()                         \
+  do {                                                                        \
+    assert(!Heap_lock->owned_by_self() &&                                     \
+                                    !SafepointSynchronize::is_at_safepoint(), \
+      heap_locking_asserts_err_msg("should not be holding the Heap_lock and " \
+                                   "should not be at a safepoint"));          \
+  } while (0)
+
+#define assert_at_safepoint()                                                 \
+  do {                                                                        \
+    assert(SafepointSynchronize::is_at_safepoint(),                           \
+           heap_locking_asserts_err_msg("should be at a safepoint"));         \
+  } while (0)
+
+#define assert_not_at_safepoint()                                             \
+  do {                                                                        \
+    assert(!SafepointSynchronize::is_at_safepoint(),                          \
+           heap_locking_asserts_err_msg("should not be at a safepoint"));     \
+  } while (0)
+
 protected:
 
   // Returns "true" iff none of the gc alloc regions have any allocations
@@ -318,31 +386,165 @@
 
   // Attempt to allocate an object of the given (very large) "word_size".
   // Returns "NULL" on failure.
-  virtual HeapWord* humongousObjAllocate(size_t word_size);
+  virtual HeapWord* humongous_obj_allocate(size_t word_size);
+
+  // The following two methods, allocate_new_tlab() and
+  // mem_allocate(), are the two main entry points from the runtime
+  // into the G1's allocation routines. They have the following
+  // assumptions:
+  //
+  // * They should both be called outside safepoints.
+  //
+  // * They should both be called without holding the Heap_lock.
+  //
+  // * All allocation requests for new TLABs should go to
+  //   allocate_new_tlab().
+  //
+  // * All non-TLAB allocation requests should go to mem_allocate()
+  //   and mem_allocate() should never be called with is_tlab == true.
+  //
+  // * If the GC locker is active we currently stall until we can
+  //   allocate a new young region. This will be changed in the
+  //   near future (see CR 6994056).
+  //
+  // * If either call cannot satisfy the allocation request using the
+  //   current allocating region, they will try to get a new one. If
+  //   this fails, they will attempt to do an evacuation pause and
+  //   retry the allocation.
+  //
+  // * If all allocation attempts fail, even after trying to schedule
+  //   an evacuation pause, allocate_new_tlab() will return NULL,
+  //   whereas mem_allocate() will attempt a heap expansion and/or
+  //   schedule a Full GC.
+  //
+  // * We do not allow humongous-sized TLABs. So, allocate_new_tlab
+  //   should never be called with word_size being humongous. All
+  //   humongous allocation requests should go to mem_allocate() which
+  //   will satisfy them with a special path.
+
+  virtual HeapWord* allocate_new_tlab(size_t word_size);
+
+  virtual HeapWord* mem_allocate(size_t word_size,
+                                 bool   is_noref,
+                                 bool   is_tlab, /* expected to be false */
+                                 bool*  gc_overhead_limit_was_exceeded);
 
-  // If possible, allocate a block of the given word_size, else return "NULL".
-  // Returning NULL will trigger GC or heap expansion.
-  // These two methods have rather awkward pre- and
-  // post-conditions. If they are called outside a safepoint, then
-  // they assume that the caller is holding the heap lock. Upon return
-  // they release the heap lock, if they are returning a non-NULL
-  // value. attempt_allocation_slow() also dirties the cards of a
-  // newly-allocated young region after it releases the heap
-  // lock. This change in interface was the neatest way to achieve
-  // this card dirtying without affecting mem_allocate(), which is a
-  // more frequently called method. We tried two or three different
-  // approaches, but they were even more hacky.
-  HeapWord* attempt_allocation(size_t word_size,
-                               bool permit_collection_pause = true);
+  // The following methods, allocate_from_cur_allocation_region(),
+  // attempt_allocation(), replace_cur_alloc_region_and_allocate(),
+  // attempt_allocation_slow(), and attempt_allocation_humongous()
+  // have very awkward pre- and post-conditions with respect to
+  // locking:
+  //
+  // If they are called outside a safepoint they assume the caller
+  // holds the Heap_lock when it calls them. However, on exit they
+  // will release the Heap_lock if they return a non-NULL result, but
+  // keep holding the Heap_lock if they return a NULL result. The
+  // reason for this is that we need to dirty the cards that span
+  // allocated blocks on young regions to avoid having to take the
+  // slow path of the write barrier (for performance reasons we don't
+  // update RSets for references whose source is a young region, so we
+  // don't need to look at dirty cards on young regions). But, doing
+  // this card dirtying while holding the Heap_lock can be a
+  // scalability bottleneck, especially given that some allocation
+  // requests might be of non-trivial size (and the larger the region
+  // size is, the fewer allocations requests will be considered
+  // humongous, as the humongous size limit is a fraction of the
+  // region size). So, when one of these calls succeeds in allocating
+  // a block it does the card dirtying after it releases the Heap_lock
+  // which is why it will return without holding it.
+  //
+  // The above assymetry is the reason why locking / unlocking is done
+  // explicitly (i.e., with Heap_lock->lock() and
+  // Heap_lock->unlocked()) instead of using MutexLocker and
+  // MutexUnlocker objects. The latter would ensure that the lock is
+  // unlocked / re-locked at every possible exit out of the basic
+  // block. However, we only want that action to happen in selected
+  // places.
+  //
+  // Further, if the above methods are called during a safepoint, then
+  // naturally there's no assumption about the Heap_lock being held or
+  // there's no attempt to unlock it. The parameter at_safepoint
+  // indicates whether the call is made during a safepoint or not (as
+  // an optimization, to avoid reading the global flag with
+  // SafepointSynchronize::is_at_safepoint()).
+  //
+  // The methods share these parameters:
+  //
+  // * word_size     : the size of the allocation request in words
+  // * at_safepoint  : whether the call is done at a safepoint; this
+  //                   also determines whether a GC is permitted
+  //                   (at_safepoint == false) or not (at_safepoint == true)
+  // * do_dirtying   : whether the method should dirty the allocated
+  //                   block before returning
+  //
+  // They all return either the address of the block, if they
+  // successfully manage to allocate it, or NULL.
 
-  HeapWord* attempt_allocation_slow(size_t word_size,
-                                    bool permit_collection_pause = true);
+  // It tries to satisfy an allocation request out of the current
+  // allocating region, which is passed as a parameter. It assumes
+  // that the caller has checked that the current allocating region is
+  // not NULL. Given that the caller has to check the current
+  // allocating region for at least NULL, it might as well pass it as
+  // the first parameter so that the method doesn't have to read it
+  // from the _cur_alloc_region field again.
+  inline HeapWord* allocate_from_cur_alloc_region(HeapRegion* cur_alloc_region,
+                                                  size_t word_size);
+
+  // It attempts to allocate out of the current alloc region. If that
+  // fails, it retires the current alloc region (if there is one),
+  // tries to get a new one and retries the allocation.
+  inline HeapWord* attempt_allocation(size_t word_size);
+
+  // It assumes that the current alloc region has been retired and
+  // tries to allocate a new one. If it's successful, it performs the
+  // allocation out of the new current alloc region and updates
+  // _cur_alloc_region. Normally, it would try to allocate a new
+  // region if the young gen is not full, unless can_expand is true in
+  // which case it would always try to allocate a new region.
+  HeapWord* replace_cur_alloc_region_and_allocate(size_t word_size,
+                                                  bool at_safepoint,
+                                                  bool do_dirtying,
+                                                  bool can_expand);
+
+  // The slow path when we are unable to allocate a new current alloc
+  // region to satisfy an allocation request (i.e., when
+  // attempt_allocation() fails). It will try to do an evacuation
+  // pause, which might stall due to the GC locker, and retry the
+  // allocation attempt when appropriate.
+  HeapWord* attempt_allocation_slow(size_t word_size);
+
+  // The method that tries to satisfy a humongous allocation
+  // request. If it cannot satisfy it it will try to do an evacuation
+  // pause to perhaps reclaim enough space to be able to satisfy the
+  // allocation request afterwards.
+  HeapWord* attempt_allocation_humongous(size_t word_size,
+                                         bool at_safepoint);
+
+  // It does the common work when we are retiring the current alloc region.
+  inline void retire_cur_alloc_region_common(HeapRegion* cur_alloc_region);
+
+  // It retires the current alloc region, which is passed as a
+  // parameter (since, typically, the caller is already holding on to
+  // it). It sets _cur_alloc_region to NULL.
+  void retire_cur_alloc_region(HeapRegion* cur_alloc_region);
+
+  // It attempts to do an allocation immediately before or after an
+  // evacuation pause and can only be called by the VM thread. It has
+  // slightly different assumptions that the ones before (i.e.,
+  // assumes that the current alloc region has been retired).
+  HeapWord* attempt_allocation_at_safepoint(size_t word_size,
+                                            bool expect_null_cur_alloc_region);
+
+  // It dirties the cards that cover the block so that so that the post
+  // write barrier never queues anything when updating objects on this
+  // block. It is assumed (and in fact we assert) that the block
+  // belongs to a young region.
+  inline void dirty_young_block(HeapWord* start, size_t word_size);
 
   // Allocate blocks during garbage collection. Will ensure an
   // allocation region, either by picking one or expanding the
   // heap, and then allocate a block of the given size. The block
   // may not be a humongous - it must fit into a single heap region.
-  HeapWord* allocate_during_gc(GCAllocPurpose purpose, size_t word_size);
   HeapWord* par_allocate_during_gc(GCAllocPurpose purpose, size_t word_size);
 
   HeapWord* allocate_during_gc_slow(GCAllocPurpose purpose,
@@ -359,12 +561,14 @@
   void  retire_alloc_region(HeapRegion* alloc_region, bool par);
 
   // - if explicit_gc is true, the GC is for a System.gc() or a heap
-  // inspection request and should collect the entire heap
-  // - if clear_all_soft_refs is true, all soft references are cleared
-  // during the GC
+  //   inspection request and should collect the entire heap
+  // - if clear_all_soft_refs is true, all soft references should be
+  //   cleared during the GC
   // - if explicit_gc is false, word_size describes the allocation that
-  // the GC should attempt (at least) to satisfy
-  void do_collection(bool explicit_gc,
+  //   the GC should attempt (at least) to satisfy
+  // - it returns false if it is unable to do the collection due to the
+  //   GC locker being active, true otherwise
+  bool do_collection(bool explicit_gc,
                      bool clear_all_soft_refs,
                      size_t word_size);
 
@@ -380,13 +584,13 @@
   // Callback from VM_G1CollectForAllocation operation.
   // This function does everything necessary/possible to satisfy a
   // failed allocation request (including collection, expansion, etc.)
-  HeapWord* satisfy_failed_allocation(size_t word_size);
+  HeapWord* satisfy_failed_allocation(size_t word_size, bool* succeeded);
 
   // Attempting to expand the heap sufficiently
   // to support an allocation of the given "word_size".  If
   // successful, perform the allocation and return the address of the
   // allocated block, or else "NULL".
-  virtual HeapWord* expand_and_allocate(size_t word_size);
+  HeapWord* expand_and_allocate(size_t word_size);
 
 public:
   // Expand the garbage-first heap by at least the given size (in bytes!).
@@ -439,16 +643,16 @@
   // can happen in a nested fashion, i.e., we start a concurrent
   // cycle, a Full GC happens half-way through it which ends first,
   // and then the cycle notices that a Full GC happened and ends
-  // too. The outer parameter is a boolean to help us do a bit tighter
-  // consistency checking in the method. If outer is false, the caller
-  // is the inner caller in the nesting (i.e., the Full GC). If outer
-  // is true, the caller is the outer caller in this nesting (i.e.,
-  // the concurrent cycle). Further nesting is not currently
-  // supported. The end of the this call also notifies the
-  // FullGCCount_lock in case a Java thread is waiting for a full GC
-  // to happen (e.g., it called System.gc() with
+  // too. The concurrent parameter is a boolean to help us do a bit
+  // tighter consistency checking in the method. If concurrent is
+  // false, the caller is the inner caller in the nesting (i.e., the
+  // Full GC). If concurrent is true, the caller is the outer caller
+  // in this nesting (i.e., the concurrent cycle). Further nesting is
+  // not currently supported. The end of the this call also notifies
+  // the FullGCCount_lock in case a Java thread is waiting for a full
+  // GC to happen (e.g., it called System.gc() with
   // +ExplicitGCInvokesConcurrent).
-  void increment_full_collections_completed(bool outer);
+  void increment_full_collections_completed(bool concurrent);
 
   unsigned int full_collections_completed() {
     return _full_collections_completed;
@@ -467,21 +671,27 @@
   void reset_taskqueue_stats();
   #endif // TASKQUEUE_STATS
 
-  // Do an incremental collection: identify a collection set, and evacuate
-  // its live objects elsewhere.
-  virtual void do_collection_pause();
+  // Schedule the VM operation that will do an evacuation pause to
+  // satisfy an allocation request of word_size. *succeeded will
+  // return whether the VM operation was successful (it did do an
+  // evacuation pause) or not (another thread beat us to it or the GC
+  // locker was active). Given that we should not be holding the
+  // Heap_lock when we enter this method, we will pass the
+  // gc_count_before (i.e., total_collections()) as a parameter since
+  // it has to be read while holding the Heap_lock. Currently, both
+  // methods that call do_collection_pause() release the Heap_lock
+  // before the call, so it's easy to read gc_count_before just before.
+  HeapWord* do_collection_pause(size_t       word_size,
+                                unsigned int gc_count_before,
+                                bool*        succeeded);
 
   // The guts of the incremental collection pause, executed by the vm
-  // thread.
-  virtual void do_collection_pause_at_safepoint(double target_pause_time_ms);
+  // thread. It returns false if it is unable to do the collection due
+  // to the GC locker being active, true otherwise
+  bool do_collection_pause_at_safepoint(double target_pause_time_ms);
 
   // Actually do the work of evacuating the collection set.
-  virtual void evacuate_collection_set();
-
-  // If this is an appropriate right time, do a collection pause.
-  // The "word_size" argument, if non-zero, indicates the size of an
-  // allocation request that is prompting this query.
-  void do_collection_pause_if_appropriate(size_t word_size);
+  void evacuate_collection_set();
 
   // The g1 remembered set of the heap.
   G1RemSet* _g1_rem_set;
@@ -639,6 +849,12 @@
   void print_gc_alloc_regions();
 #endif // !PRODUCT
 
+  // Instance of the concurrent mark is_alive closure for embedding
+  // into the reference processor as the is_alive_non_header. This
+  // prevents unnecessary additions to the discovered lists during
+  // concurrent discovery.
+  G1CMIsAliveClosure _is_alive_closure;
+
   // ("Weak") Reference processing support
   ReferenceProcessor* _ref_processor;
 
@@ -683,7 +899,7 @@
   // specified by the policy object.
   jint initialize();
 
-  void ref_processing_init();
+  virtual void ref_processing_init();
 
   void set_par_threads(int t) {
     SharedHeap::set_par_threads(t);
@@ -751,11 +967,6 @@
 #endif // PRODUCT
 
   // These virtual functions do the actual allocation.
-  virtual HeapWord* mem_allocate(size_t word_size,
-                                 bool   is_noref,
-                                 bool   is_tlab,
-                                 bool* gc_overhead_limit_was_exceeded);
-
   // Some heaps may offer a contiguous region for shared non-blocking
   // allocation, via inlined code (by exporting the address of the top and
   // end fields defining the extent of the contiguous allocation region.)
@@ -1035,7 +1246,6 @@
   virtual bool supports_tlab_allocation() const;
   virtual size_t tlab_capacity(Thread* thr) const;
   virtual size_t unsafe_max_tlab_alloc(Thread* thr) const;
-  virtual HeapWord* allocate_new_tlab(size_t word_size);
 
   // Can a compiler initialize a new object without store barriers?
   // This permission only extends from the creation of a new object
@@ -1175,7 +1385,6 @@
   static G1CollectedHeap* heap();
 
   void empty_young_list();
-  bool should_set_young_locked();
 
   void set_region_short_lived_locked(HeapRegion* hr);
   // add appropriate methods for any other surv rate groups
@@ -1328,8 +1537,6 @@
 protected:
   size_t _max_heap_capacity;
 
-//  debug_only(static void check_for_valid_allocation_state();)
-
 public:
   // Temporary: call to mark things unimplemented for the G1 heap (e.g.,
   // MemoryService).  In productization, we can make this assert false
@@ -1797,3 +2004,5 @@
 public:
   void trim_queue();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP
+
+#include "gc_implementation/g1/concurrentMark.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/heapRegionSeq.hpp"
+#include "utilities/taskqueue.hpp"
+
 // Inline functions for G1CollectedHeap
 
 inline HeapRegion*
@@ -50,37 +59,115 @@
   return r != NULL && r->in_collection_set();
 }
 
-inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
-                                              bool permit_collection_pause) {
-  HeapWord* res = NULL;
+// See the comment in the .hpp file about the locking protocol and
+// assumptions of this method (and other related ones).
+inline HeapWord*
+G1CollectedHeap::allocate_from_cur_alloc_region(HeapRegion* cur_alloc_region,
+                                                size_t word_size) {
+  assert_heap_locked_and_not_at_safepoint();
+  assert(cur_alloc_region != NULL, "pre-condition of the method");
+  assert(cur_alloc_region == _cur_alloc_region, "pre-condition of the method");
+  assert(cur_alloc_region->is_young(),
+         "we only support young current alloc regions");
+  assert(!isHumongous(word_size), "allocate_from_cur_alloc_region() "
+         "should not be used for humongous allocations");
+  assert(!cur_alloc_region->isHumongous(), "Catch a regression of this bug.");
 
-  assert( SafepointSynchronize::is_at_safepoint() ||
-          Heap_lock->owned_by_self(), "pre-condition of the call" );
+  assert(!cur_alloc_region->is_empty(),
+         err_msg("region ["PTR_FORMAT","PTR_FORMAT"] should not be empty",
+                 cur_alloc_region->bottom(), cur_alloc_region->end()));
+  // This allocate method does BOT updates and we don't need them in
+  // the young generation. This will be fixed in the near future by
+  // CR 6994297.
+  HeapWord* result = cur_alloc_region->allocate(word_size);
+  if (result != NULL) {
+    assert(is_in(result), "result should be in the heap");
+    Heap_lock->unlock();
 
-  // All humongous allocation requests should go through the slow path in
-  // attempt_allocation_slow().
-  if (!isHumongous(word_size) && _cur_alloc_region != NULL) {
-    // If this allocation causes a region to become non empty,
-    // then we need to update our free_regions count.
+    // Do the dirtying after we release the Heap_lock.
+    dirty_young_block(result, word_size);
+    return result;
+  }
+
+  assert_heap_locked();
+  return NULL;
+}
 
-    if (_cur_alloc_region->is_empty()) {
-      res = _cur_alloc_region->allocate(word_size);
-      if (res != NULL)
-        _free_regions--;
-    } else {
-      res = _cur_alloc_region->allocate(word_size);
+// See the comment in the .hpp file about the locking protocol and
+// assumptions of this method (and other related ones).
+inline HeapWord*
+G1CollectedHeap::attempt_allocation(size_t word_size) {
+  assert_heap_locked_and_not_at_safepoint();
+  assert(!isHumongous(word_size), "attempt_allocation() should not be called "
+         "for humongous allocation requests");
+
+  HeapRegion* cur_alloc_region = _cur_alloc_region;
+  if (cur_alloc_region != NULL) {
+    HeapWord* result = allocate_from_cur_alloc_region(cur_alloc_region,
+                                                      word_size);
+    if (result != NULL) {
+      assert_heap_not_locked();
+      return result;
     }
 
-    if (res != NULL) {
-      if (!SafepointSynchronize::is_at_safepoint()) {
-        assert( Heap_lock->owned_by_self(), "invariant" );
-        Heap_lock->unlock();
-      }
-      return res;
-    }
+    assert_heap_locked();
+
+    // Since we couldn't successfully allocate into it, retire the
+    // current alloc region.
+    retire_cur_alloc_region(cur_alloc_region);
+  }
+
+  // Try to get a new region and allocate out of it
+  HeapWord* result = replace_cur_alloc_region_and_allocate(word_size,
+                                                     false, /* at_safepoint */
+                                                     true,  /* do_dirtying */
+                                                     false  /* can_expand */);
+  if (result != NULL) {
+    assert_heap_not_locked();
+    return result;
   }
-  // attempt_allocation_slow will also unlock the heap lock when appropriate.
-  return attempt_allocation_slow(word_size, permit_collection_pause);
+
+  assert_heap_locked();
+  return NULL;
+}
+
+inline void
+G1CollectedHeap::retire_cur_alloc_region_common(HeapRegion* cur_alloc_region) {
+  assert_heap_locked_or_at_safepoint();
+  assert(cur_alloc_region != NULL && cur_alloc_region == _cur_alloc_region,
+         "pre-condition of the call");
+  assert(cur_alloc_region->is_young(),
+         "we only support young current alloc regions");
+
+  // The region is guaranteed to be young
+  g1_policy()->add_region_to_incremental_cset_lhs(cur_alloc_region);
+  _summary_bytes_used += cur_alloc_region->used();
+  _cur_alloc_region = NULL;
+}
+
+// It dirties the cards that cover the block so that so that the post
+// write barrier never queues anything when updating objects on this
+// block. It is assumed (and in fact we assert) that the block
+// belongs to a young region.
+inline void
+G1CollectedHeap::dirty_young_block(HeapWord* start, size_t word_size) {
+  assert_heap_not_locked();
+
+  // Assign the containing region to containing_hr so that we don't
+  // have to keep calling heap_region_containing_raw() in the
+  // asserts below.
+  DEBUG_ONLY(HeapRegion* containing_hr = heap_region_containing_raw(start);)
+  assert(containing_hr != NULL && start != NULL && word_size > 0,
+         "pre-condition");
+  assert(containing_hr->is_in(start), "it should contain start");
+  assert(containing_hr->is_young(), "it should be young");
+  assert(!containing_hr->isHumongous(), "it should not be humongous");
+
+  HeapWord* end = start + word_size;
+  assert(containing_hr->is_in(end - 1), "it should also contain end - 1");
+
+  MemRegion mr(start, end);
+  ((CardTableModRefBS*)_g1h->barrier_set())->dirty(mr);
 }
 
 inline RefToScanQueue* G1CollectedHeap::task_queue(int i) const {
@@ -94,3 +181,5 @@
 inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
   return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1CollectorPolicy.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentG1Refine.hpp"
+#include "gc_implementation/g1/concurrentMark.hpp"
+#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/java.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "utilities/debug.hpp"
 
 #define PREDICTIONS_VERBOSE 0
 
@@ -448,8 +458,8 @@
     double now_sec = os::elapsedTime();
     double when_ms = _mmu_tracker->when_max_gc_sec(now_sec) * 1000.0;
     double alloc_rate_ms = predict_alloc_rate_ms();
-    int min_regions = (int) ceil(alloc_rate_ms * when_ms);
-    int current_region_num = (int) _g1->young_list()->length();
+    size_t min_regions = (size_t) ceil(alloc_rate_ms * when_ms);
+    size_t current_region_num = _g1->young_list()->length();
     _young_list_min_length = min_regions + current_region_num;
   }
 }
@@ -463,9 +473,13 @@
       _young_list_target_length = _young_list_fixed_length;
     else
       _young_list_target_length = _young_list_fixed_length / 2;
-
-    _young_list_target_length = MAX2(_young_list_target_length, (size_t)1);
   }
+
+  // Make sure we allow the application to allocate at least one
+  // region before we need to do a collection again.
+  size_t min_length = _g1->young_list()->length() + 1;
+  _young_list_target_length = MAX2(_young_list_target_length, min_length);
+  calculate_max_gc_locker_expansion();
   calculate_survivors_policy();
 }
 
@@ -558,7 +572,7 @@
 
     // we should have at least one region in the target young length
     _young_list_target_length =
-        MAX2((size_t) 1, final_young_length + _recorded_survivor_regions);
+                              final_young_length + _recorded_survivor_regions;
 
     // let's keep an eye of how long we spend on this calculation
     // right now, I assume that we'll print it when we need it; we
@@ -607,8 +621,7 @@
                            _young_list_min_length);
 #endif // TRACE_CALC_YOUNG_LENGTH
     // we'll do the pause as soon as possible by choosing the minimum
-    _young_list_target_length =
-      MAX2(_young_list_min_length, (size_t) 1);
+    _young_list_target_length = _young_list_min_length;
   }
 
   _rs_lengths_prediction = rs_lengths;
@@ -791,7 +804,7 @@
   _survivor_surv_rate_group->reset();
   calculate_young_list_min_length();
   calculate_young_list_target_length();
- }
+}
 
 void G1CollectorPolicy::record_before_bytes(size_t bytes) {
   _bytes_in_to_space_before_gc += bytes;
@@ -814,9 +827,9 @@
       gclog_or_tty->print(" (%s)", full_young_gcs() ? "young" : "partial");
   }
 
-  assert(_g1->used_regions() == _g1->recalculate_used_regions(),
-         "sanity");
-  assert(_g1->used() == _g1->recalculate_used(), "sanity");
+  assert(_g1->used() == _g1->recalculate_used(),
+         err_msg("sanity, used: "SIZE_FORMAT" recalculate_used: "SIZE_FORMAT,
+                 _g1->used(), _g1->recalculate_used()));
 
   double s_w_t_ms = (start_time_sec - _stop_world_start) * 1000.0;
   _all_stop_world_times_ms->add(s_w_t_ms);
@@ -2256,24 +2269,13 @@
 #endif // PRODUCT
 }
 
-bool
-G1CollectorPolicy::should_add_next_region_to_young_list() {
-  assert(in_young_gc_mode(), "should be in young GC mode");
-  bool ret;
-  size_t young_list_length = _g1->young_list()->length();
-  size_t young_list_max_length = _young_list_target_length;
-  if (G1FixedEdenSize) {
-    young_list_max_length -= _max_survivor_regions;
-  }
-  if (young_list_length < young_list_max_length) {
-    ret = true;
+void
+G1CollectorPolicy::update_region_num(bool young) {
+  if (young) {
     ++_region_num_young;
   } else {
-    ret = false;
     ++_region_num_tenured;
   }
-
-  return ret;
 }
 
 #ifndef PRODUCT
@@ -2300,6 +2302,21 @@
   };
 }
 
+void G1CollectorPolicy::calculate_max_gc_locker_expansion() {
+  size_t expansion_region_num = 0;
+  if (GCLockerEdenExpansionPercent > 0) {
+    double perc = (double) GCLockerEdenExpansionPercent / 100.0;
+    double expansion_region_num_d = perc * (double) _young_list_target_length;
+    // We use ceiling so that if expansion_region_num_d is > 0.0 (but
+    // less than 1.0) we'll get 1.
+    expansion_region_num = (size_t) ceil(expansion_region_num_d);
+  } else {
+    assert(expansion_region_num == 0, "sanity");
+  }
+  _young_list_max_length = _young_list_target_length + expansion_region_num;
+  assert(_young_list_target_length <= _young_list_max_length, "post-condition");
+}
+
 // Calculates survivor space parameters.
 void G1CollectorPolicy::calculate_survivors_policy()
 {
@@ -2317,32 +2334,6 @@
   }
 }
 
-bool
-G1CollectorPolicy_BestRegionsFirst::should_do_collection_pause(size_t
-                                                               word_size) {
-  assert(_g1->regions_accounted_for(), "Region leakage!");
-  double max_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
-
-  size_t young_list_length = _g1->young_list()->length();
-  size_t young_list_max_length = _young_list_target_length;
-  if (G1FixedEdenSize) {
-    young_list_max_length -= _max_survivor_regions;
-  }
-  bool reached_target_length = young_list_length >= young_list_max_length;
-
-  if (in_young_gc_mode()) {
-    if (reached_target_length) {
-      assert( young_list_length > 0 && _g1->young_list()->length() > 0,
-              "invariant" );
-      return true;
-    }
-  } else {
-    guarantee( false, "should not reach here" );
-  }
-
-  return false;
-}
-
 #ifndef PRODUCT
 class HRSortIndexIsOKClosure: public HeapRegionClosure {
   CollectionSetChooser* _chooser;
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP
+
+#include "gc_implementation/g1/collectionSetChooser.hpp"
+#include "gc_implementation/g1/g1MMUTracker.hpp"
+#include "memory/collectorPolicy.hpp"
+
 // A G1CollectorPolicy makes policy decisions that determine the
 // characteristics of the collector.  Examples include:
 //   * choice of collection set.
@@ -189,6 +196,10 @@
   size_t _young_list_target_length;
   size_t _young_list_fixed_length;
 
+  // The max number of regions we can extend the eden by while the GC
+  // locker is active. This should be >= _young_list_target_length;
+  size_t _young_list_max_length;
+
   size_t _young_cset_length;
   bool   _last_young_gc_full;
 
@@ -986,11 +997,6 @@
   void record_before_bytes(size_t bytes);
   void record_after_bytes(size_t bytes);
 
-  // Returns "true" if this is a good time to do a collection pause.
-  // The "word_size" argument, if non-zero, indicates the size of an
-  // allocation request that is prompting this query.
-  virtual bool should_do_collection_pause(size_t word_size) = 0;
-
   // Choose a new collection set.  Marks the chosen regions as being
   // "in_collection_set", and links them together.  The head and number of
   // the collection set are available via access methods.
@@ -1109,7 +1115,25 @@
     // do that for any other surv rate groups
   }
 
-  bool should_add_next_region_to_young_list();
+  bool is_young_list_full() {
+    size_t young_list_length = _g1->young_list()->length();
+    size_t young_list_target_length = _young_list_target_length;
+    if (G1FixedEdenSize) {
+      young_list_target_length -= _max_survivor_regions;
+    }
+    return young_list_length >= young_list_target_length;
+  }
+
+  bool can_expand_young_list() {
+    size_t young_list_length = _g1->young_list()->length();
+    size_t young_list_max_length = _young_list_max_length;
+    if (G1FixedEdenSize) {
+      young_list_max_length -= _max_survivor_regions;
+    }
+    return young_list_length < young_list_max_length;
+  }
+
+  void update_region_num(bool young);
 
   bool in_young_gc_mode() {
     return _in_young_gc_mode;
@@ -1220,6 +1244,8 @@
     _survivors_age_table.merge_par(age_table);
   }
 
+  void calculate_max_gc_locker_expansion();
+
   // Calculates survivor space parameters.
   void calculate_survivors_policy();
 
@@ -1263,7 +1289,6 @@
     _collectionSetChooser = new CollectionSetChooser();
   }
   void record_collection_pause_end();
-  bool should_do_collection_pause(size_t word_size);
   // This is not needed any more, after the CSet choosing code was
   // changed to use the pause prediction work. But let's leave the
   // hook in just in case.
@@ -1287,3 +1312,5 @@
 // Local Variables: ***
 // c-indentation-style: gnu ***
 // End: ***
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP
--- a/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1MMUTracker.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1MMUTracker.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "utilities/ostream.hpp"
 
 #define _DISABLE_MMU                             0
 
--- a/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1MMUTRACKER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1MMUTRACKER_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/debug.hpp"
+
 // Keeps track of the GC work and decides when it is OK to do GC work
 // and for how long so that the MMU invariants are maintained.
 
@@ -127,3 +133,5 @@
   virtual double longest_pause(double current_time);
   virtual double when_sec(double current_time, double pause_time);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1MMUTRACKER_HPP
--- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,30 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1MarkSweep.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_implementation/g1/g1MarkSweep.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/modRefBarrierSet.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/space.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/aprofiler.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/events.hpp"
 
 class HeapRegion;
 
--- a/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,19 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP
+
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "memory/genMarkSweep.hpp"
+#include "memory/generation.hpp"
+#include "memory/universe.hpp"
+#include "oops/markOop.hpp"
+#include "oops/oop.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/growableArray.hpp"
+
 class ReferenceProcessor;
 
 // G1MarkSweep takes care of global mark-compact garbage collection for a
@@ -55,3 +68,5 @@
 
   static void allocate_stacks();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP
--- a/src/share/vm/gc_implementation/g1/g1OopClosures.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1OopClosures.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP
+
 class HeapRegion;
 class G1CollectedHeap;
 class G1RemSet;
@@ -210,3 +213,5 @@
   bool do_header() { return false; }
   int out_of_region() { return _out_of_region; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP
--- a/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP
+
+#include "gc_implementation/g1/concurrentMark.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.hpp"
+#include "gc_implementation/g1/g1OopClosures.hpp"
+#include "gc_implementation/g1/g1RemSet.hpp"
+
 /*
  * This really ought to be an inline function, but apparently the C++
  * compiler sometimes sees fit to ignore inline declarations.  Sigh.
@@ -121,3 +129,5 @@
   }
 }
 
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP
--- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1RemSet.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/bufferingOopClosure.hpp"
+#include "gc_implementation/g1/concurrentG1Refine.hpp"
+#include "gc_implementation/g1/concurrentG1RefineThread.hpp"
+#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "memory/iterator.hpp"
+#include "oops/oop.inline.hpp"
+#include "utilities/intHisto.hpp"
 
 #define CARD_REPEAT_HISTO 0
 
@@ -116,7 +127,6 @@
   : _g1(g1), _conc_refine_cards(0),
     _ct_bs(ct_bs), _g1p(_g1->g1_policy()),
     _cg1r(g1->concurrent_g1_refine()),
-    _traversal_in_progress(false),
     _cset_rs_update_cl(NULL),
     _cards_scanned(NULL), _total_cards_scanned(0)
 {
@@ -512,8 +522,6 @@
   DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
   dcqs.concatenate_logs();
 
-  assert(!_traversal_in_progress, "Invariant between iterations.");
-  set_traversal(true);
   if (ParallelGCThreads > 0) {
     _seq_task->set_n_threads((int)n_workers());
   }
@@ -539,9 +547,6 @@
 // through the oops which coincide with that card. It scans the reference
 // fields in each oop; when it finds an oop that points into the collection
 // set, the RSet for the region containing the referenced object is updated.
-// Note: _par_traversal_in_progress in the G1RemSet must be FALSE; otherwise
-// the UpdateRSetImmediate closure will cause cards to be enqueued on to
-// the DCQS that we're iterating over, causing an infinite loop.
 class UpdateRSetCardTableEntryIntoCSetClosure: public CardTableEntryClosure {
   G1CollectedHeap* _g1;
   CardTableModRefBS* _ct_bs;
@@ -611,8 +616,6 @@
   // Set all cards back to clean.
   _g1->cleanUpCardTable();
 
-  set_traversal(false);
-
   DirtyCardQueueSet& into_cset_dcqs = _g1->into_cset_dirty_card_queue_set();
   int into_cset_n_buffers = into_cset_dcqs.completed_buffers_num();
 
@@ -645,21 +648,8 @@
   assert(_g1->into_cset_dirty_card_queue_set().completed_buffers_num() == 0,
          "all buffers should be freed");
   _g1->into_cset_dirty_card_queue_set().clear_n_completed_buffers();
-
-  assert(!_traversal_in_progress, "Invariant between iterations.");
 }
 
-class UpdateRSObjectClosure: public ObjectClosure {
-  UpdateRSOopClosure* _update_rs_oop_cl;
-public:
-  UpdateRSObjectClosure(UpdateRSOopClosure* update_rs_oop_cl) :
-    _update_rs_oop_cl(update_rs_oop_cl) {}
-  void do_object(oop obj) {
-    obj->oop_iterate(_update_rs_oop_cl);
-  }
-
-};
-
 class ScrubRSClosure: public HeapRegionClosure {
   G1CollectedHeap* _g1h;
   BitMap* _region_bm;
@@ -749,7 +739,12 @@
   ct_freq_note_card(_ct_bs->index_for(start));
 #endif
 
-  UpdateRSOopClosure update_rs_oop_cl(this, worker_i);
+  assert(!check_for_refs_into_cset || _cset_rs_update_cl[worker_i] != NULL, "sanity");
+  UpdateRSOrPushRefOopClosure update_rs_oop_cl(_g1,
+                                               _g1->g1_rem_set(),
+                                               _cset_rs_update_cl[worker_i],
+                                               check_for_refs_into_cset,
+                                               worker_i);
   update_rs_oop_cl.set_from(r);
 
   TriggerClosure trigger_cl;
--- a/src/share/vm/gc_implementation/g1/g1RemSet.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_HPP
+
 // A G1RemSet provides ways of iterating over pointers into a selected
 // collection set.
 
@@ -59,11 +62,6 @@
   size_t*             _cards_scanned;
   size_t              _total_cards_scanned;
 
-  // _traversal_in_progress is "true" iff a traversal is in progress.
-
-  bool _traversal_in_progress;
-  void set_traversal(bool b) { _traversal_in_progress = b; }
-
   // Used for caching the closure that is responsible for scanning
   // references into the collection set.
   OopsInHeapRegionClosure** _cset_rs_update_cl;
@@ -76,10 +74,6 @@
   bool concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i,
                                     bool check_for_refs_into_cset);
 
-protected:
-  template <class T> void write_ref_nv(HeapRegion* from, T* p);
-  template <class T> void par_write_ref_nv(HeapRegion* from, T* p, int tid);
-
 public:
   // This is called to reset dual hash tables after the gc pause
   // is finished and the initial hash table is no longer being
@@ -117,22 +111,8 @@
 
   // Record, if necessary, the fact that *p (where "p" is in region "from",
   // which is required to be non-NULL) has changed to a new non-NULL value.
-  // [Below the virtual version calls a non-virtual protected
-  // workhorse that is templatified for narrow vs wide oop.]
-  inline void write_ref(HeapRegion* from, oop* p) {
-    write_ref_nv(from, p);
-  }
-  inline void write_ref(HeapRegion* from, narrowOop* p) {
-    write_ref_nv(from, p);
-  }
-  inline void par_write_ref(HeapRegion* from, oop* p, int tid) {
-    par_write_ref_nv(from, p, tid);
-  }
-  inline void par_write_ref(HeapRegion* from, narrowOop* p, int tid) {
-    par_write_ref_nv(from, p, tid);
-  }
-
-  bool self_forwarded(oop obj);
+  template <class T> void write_ref(HeapRegion* from, T* p);
+  template <class T> void par_write_ref(HeapRegion* from, T* p, int tid);
 
   // Requires "region_bm" and "card_bm" to be bitmaps with 1 bit per region
   // or card, respectively, such that a region or card with a corresponding
@@ -186,9 +166,8 @@
 
 public:
   UpdateRSOopClosure(G1RemSet* rs, int worker_i = 0) :
-    _from(NULL), _rs(rs), _worker_i(worker_i) {
-    guarantee(_rs != NULL, "Requires an HRIntoG1RemSet");
-  }
+    _from(NULL), _rs(rs), _worker_i(worker_i)
+  {}
 
   void set_from(HeapRegion* from) {
     assert(from != NULL, "from region must be non-NULL");
@@ -215,3 +194,45 @@
   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
   virtual void do_oop(      oop* p) { do_oop_work(p); }
 };
+
+class UpdateRSOrPushRefOopClosure: public OopClosure {
+  G1CollectedHeap* _g1;
+  G1RemSet* _g1_rem_set;
+  HeapRegion* _from;
+  OopsInHeapRegionClosure* _push_ref_cl;
+  bool _record_refs_into_cset;
+  int _worker_i;
+
+  template <class T> void do_oop_work(T* p);
+
+public:
+  UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
+                              G1RemSet* rs,
+                              OopsInHeapRegionClosure* push_ref_cl,
+                              bool record_refs_into_cset,
+                              int worker_i = 0) :
+    _g1(g1h),
+    _g1_rem_set(rs),
+    _from(NULL),
+    _record_refs_into_cset(record_refs_into_cset),
+    _push_ref_cl(push_ref_cl),
+    _worker_i(worker_i) { }
+
+  void set_from(HeapRegion* from) {
+    assert(from != NULL, "from region must be non-NULL");
+    _from = from;
+  }
+
+  bool self_forwarded(oop obj) {
+    bool result = (obj->is_forwarded() && (obj->forwardee()== obj));
+    return result;
+  }
+
+  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
+  virtual void do_oop(oop* p)       { do_oop_work(p); }
+
+  bool apply_to_weak_ref_discovered_field() { return true; }
+};
+
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_HPP
--- a/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_INLINE_HPP
+
+#include "gc_implementation/g1/g1RemSet.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "oops/oop.inline.hpp"
+
 inline size_t G1RemSet::n_workers() {
   if (_g1->workers() != NULL) {
     return _g1->workers()->total_workers();
@@ -31,17 +38,12 @@
 }
 
 template <class T>
-inline void G1RemSet::write_ref_nv(HeapRegion* from, T* p) {
-  par_write_ref_nv(from, p, 0);
-}
-
-inline bool G1RemSet::self_forwarded(oop obj) {
-  bool result =  (obj->is_forwarded() && (obj->forwardee()== obj));
-  return result;
+inline void G1RemSet::write_ref(HeapRegion* from, T* p) {
+  par_write_ref(from, p, 0);
 }
 
 template <class T>
-inline void G1RemSet::par_write_ref_nv(HeapRegion* from, T* p, int tid) {
+inline void G1RemSet::par_write_ref(HeapRegion* from, T* p, int tid) {
   oop obj = oopDesc::load_decode_heap_oop(p);
 #ifdef ASSERT
   // can't do because of races
@@ -62,34 +64,15 @@
   assert(from == NULL || from->is_in_reserved(p), "p is not in from");
 
   HeapRegion* to = _g1->heap_region_containing(obj);
-  // The test below could be optimized by applying a bit op to to and from.
-  if (to != NULL && from != NULL && from != to) {
-    // The _traversal_in_progress flag is true during the collection pause,
-    // false during the evacuation failure handling. This should avoid a
-    // potential loop if we were to add the card containing 'p' to the DCQS
-    // that's used to regenerate the remembered sets for the collection set,
-    // in the event of an evacuation failure, here. The UpdateRSImmediate
-    // closure will eventally call this routine.
-    if (_traversal_in_progress &&
-        to->in_collection_set() && !self_forwarded(obj)) {
-
-      assert(_cset_rs_update_cl[tid] != NULL, "should have been set already");
-      _cset_rs_update_cl[tid]->do_oop(p);
-
-      // Deferred updates to the CSet are either discarded (in the normal case),
-      // or processed (if an evacuation failure occurs) at the end
-      // of the collection.
-      // See G1RemSet::cleanup_after_oops_into_collection_set_do().
-    } else {
+  if (to != NULL && from != to) {
 #if G1_REM_SET_LOGGING
-      gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS"
-                             " for region [" PTR_FORMAT ", " PTR_FORMAT ")",
-                             p, obj,
-                             to->bottom(), to->end());
+    gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS"
+                           " for region [" PTR_FORMAT ", " PTR_FORMAT ")",
+                           p, obj,
+                           to->bottom(), to->end());
 #endif
-      assert(to->rem_set() != NULL, "Need per-region 'into' remsets.");
-      to->rem_set()->add_reference(p, tid);
-    }
+    assert(to->rem_set() != NULL, "Need per-region 'into' remsets.");
+    to->rem_set()->add_reference(p, tid);
   }
 }
 
@@ -108,3 +91,66 @@
   }
 }
 
+template <class T>
+inline void UpdateRSOrPushRefOopClosure::do_oop_work(T* p) {
+  oop obj = oopDesc::load_decode_heap_oop(p);
+#ifdef ASSERT
+  // can't do because of races
+  // assert(obj == NULL || obj->is_oop(), "expected an oop");
+
+  // Do the safe subset of is_oop
+  if (obj != NULL) {
+#ifdef CHECK_UNHANDLED_OOPS
+    oopDesc* o = obj.obj();
+#else
+    oopDesc* o = obj;
+#endif // CHECK_UNHANDLED_OOPS
+    assert((intptr_t)o % MinObjAlignmentInBytes == 0, "not oop aligned");
+    assert(Universe::heap()->is_in_reserved(obj), "must be in heap");
+  }
+#endif // ASSERT
+
+  assert(_from != NULL, "from region must be non-NULL");
+
+  HeapRegion* to = _g1->heap_region_containing(obj);
+  if (to != NULL && _from != to) {
+    // The _record_refs_into_cset flag is true during the RSet
+    // updating part of an evacuation pause. It is false at all
+    // other times:
+    //  * rebuilding the rembered sets after a full GC
+    //  * during concurrent refinement.
+    //  * updating the remembered sets of regions in the collection
+    //    set in the event of an evacuation failure (when deferred
+    //    updates are enabled).
+
+    if (_record_refs_into_cset && to->in_collection_set()) {
+      // We are recording references that point into the collection
+      // set and this particular reference does exactly that...
+      // If the referenced object has already been forwarded
+      // to itself, we are handling an evacuation failure and
+      // we have already visited/tried to copy this object
+      // there is no need to retry.
+      if (!self_forwarded(obj)) {
+        assert(_push_ref_cl != NULL, "should not be null");
+        // Push the reference in the refs queue of the G1ParScanThreadState
+        // instance for this worker thread.
+        _push_ref_cl->do_oop(p);
+      }
+
+      // Deferred updates to the CSet are either discarded (in the normal case),
+      // or processed (if an evacuation failure occurs) at the end
+      // of the collection.
+      // See G1RemSet::cleanup_after_oops_into_collection_set_do().
+    } else {
+      // We either don't care about pushing references that point into the
+      // collection set (i.e. we're not during an evacuation pause) _or_
+      // the reference doesn't point into the collection set. Either way
+      // we add the reference directly to the RSet of the region containing
+      // the referenced object.
+      _g1_rem_set->par_write_ref(_from, p, _worker_i);
+    }
+  }
+}
+
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_INLINE_HPP
--- a/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1SATBCardTableModRefBS.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/g1/satbQueue.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/thread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap,
                                                  int max_covered_regions) :
--- a/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
+
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/memRegion.hpp"
+#include "oops/oop.inline.hpp"
+
 #ifndef SERIALGC
 
 class DirtyCardQueueSet;
@@ -115,3 +122,5 @@
 
 
 #endif // SERIALGC
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
--- a/src/share/vm/gc_implementation/g1/g1_globals.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1_globals.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_g1_globals.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1_globals.hpp"
 
 G1_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, \
          MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG,     \
--- a/src/share/vm/gc_implementation/g1/g1_globals.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1_globals.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1_GLOBALS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1_GLOBALS_HPP
+
+#include "runtime/globals.hpp"
+
 //
 // Defines all globals flags used by the garbage-first compiler.
 //
@@ -282,3 +287,5 @@
           " controls whether G1 allows the RICM optimization")
 
 G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG)
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_GLOBALS_HPP
--- a/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
+
 // The following OopClosure types get specialized versions of
 // "oop_oop_iterate" that invoke the closures' do_oop methods
 // non-virtually, using a mechanism defined in this file.  Extend these
@@ -63,3 +66,5 @@
 #endif
 
 #define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_heapRegion.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentZFThread.hpp"
+#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/heapRegion.inline.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/iterator.hpp"
+#include "oops/oop.inline.hpp"
 
 int HeapRegion::LogOfHRGrainBytes = 0;
 int HeapRegion::LogOfHRGrainWords = 0;
--- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
+
+#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
+#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
+#include "gc_implementation/g1/survRateGroup.hpp"
+#include "gc_implementation/shared/ageTable.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/space.inline.hpp"
+#include "memory/watermark.hpp"
+
 #ifndef SERIALGC
 
 // A HeapRegion is the smallest piece of a G1CollectedHeap that
@@ -945,3 +956,5 @@
 // End: ***
 
 #endif // SERIALGC
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
--- a/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
+
 inline HeapWord* G1OffsetTableContigSpace::allocate(size_t size) {
   HeapWord* res = ContiguousSpace::allocate(size);
   if (res != NULL) {
@@ -58,3 +61,5 @@
 G1OffsetTableContigSpace::block_start_const(const void* p) const {
   return _offsets.block_start_const(p);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
--- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_heapRegionRemSet.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentG1Refine.hpp"
+#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "memory/allocation.hpp"
+#include "memory/space.inline.hpp"
+#include "utilities/bitMap.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 #define HRRS_VERBOSE 0
 
--- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP
+
+#include "gc_implementation/g1/sparsePRT.hpp"
+
 // Remembered set for a heap region.  Represent a set of "cards" that
 // contain pointers into the owner heap region.  Cards are defined somewhat
 // abstractly, in terms of what the "BlockOffsetTable" in use can parse.
@@ -426,3 +431,5 @@
 };
 
 #endif
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_heapRegionSeq.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/heapRegionSeq.hpp"
+#include "memory/allocation.hpp"
 
 // Local to this file.
 
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP
+
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "utilities/growableArray.hpp"
+
 class HeapRegion;
 class HeapRegionClosure;
 
@@ -108,3 +114,5 @@
   void print_empty_runs();
 
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP
+
+#include "gc_implementation/g1/heapRegionSeq.hpp"
+
 inline HeapRegion* HeapRegionSeq::addr_to_region(const void* addr) {
   assert(_seq_bottom != NULL, "bad _seq_bottom in addr_to_region");
   if ((char*) addr >= _seq_bottom) {
@@ -38,3 +43,5 @@
   }
   return NULL;
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP
--- a/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_ptrQueue.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/ptrQueue.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/mutexLocker.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 PtrQueue::PtrQueue(PtrQueueSet* qset_, bool perm, bool active) :
   _qset(qset_), _buf(NULL), _index(0), _active(active),
--- a/src/share/vm/gc_implementation/g1/ptrQueue.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/ptrQueue.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/sizes.hpp"
+
 // There are various techniques that require threads to be able to log
 // addresses.  For example, a generational write barrier might log
 // the addresses of modified old-generation objects.  This type supports
@@ -293,3 +299,5 @@
   // Notify the consumer if the number of buffers crossed the threshold
   void notify_if_necessary();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP
--- a/src/share/vm/gc_implementation/g1/satbQueue.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/satbQueue.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_satbQueue.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/satbQueue.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/sharedHeap.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/thread.hpp"
 
 void ObjPtrQueue::apply_closure(ObjectClosure* cl) {
   if (_buf != NULL) {
--- a/src/share/vm/gc_implementation/g1/satbQueue.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/satbQueue.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP
+
+#include "gc_implementation/g1/ptrQueue.hpp"
+
 class ObjectClosure;
 class JavaThread;
 
@@ -113,3 +118,5 @@
   void abandon_partial_marking();
 
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP
--- a/src/share/vm/gc_implementation/g1/sparsePRT.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/sparsePRT.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sparsePRT.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/sparsePRT.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/space.inline.hpp"
+#include "runtime/mutexLocker.hpp"
 
 #define SPARSE_PRT_VERBOSE 0
 
--- a/src/share/vm/gc_implementation/g1/sparsePRT.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/sparsePRT.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_SPARSEPRT_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_SPARSEPRT_HPP
+
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "memory/allocation.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "runtime/mutex.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // Sparse remembered set for a heap region (the "owning" region).  Maps
 // indices of other regions to short sequences of cards in the other region
 // that might contain pointers into the owner region.
@@ -289,3 +299,5 @@
     return RSHashTableIter::has_next(card_index);
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_SPARSEPRT_HPP
--- a/src/share/vm/gc_implementation/g1/survRateGroup.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/survRateGroup.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_survRateGroup.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/g1/survRateGroup.hpp"
+#include "memory/allocation.hpp"
 
 SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p,
                              const char* name,
--- a/src/share/vm/gc_implementation/g1/survRateGroup.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/survRateGroup.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_SURVRATEGROUP_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_SURVRATEGROUP_HPP
+
+#include "utilities/numberSeq.hpp"
+
 class G1CollectorPolicy;
 
 class SurvRateGroup : public CHeapObj {
@@ -92,3 +97,5 @@
   void print_surv_rate_summary();
 #endif // PRODUCT
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_SURVRATEGROUP_HPP
--- a/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,27 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vm_operations_g1.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/vm_operations_g1.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "gc_implementation/g1/vm_operations_g1.hpp"
+#include "runtime/interfaceSupport.hpp"
+
+VM_G1CollectForAllocation::VM_G1CollectForAllocation(
+                                                  unsigned int gc_count_before,
+                                                  size_t word_size)
+  : VM_G1OperationWithAllocRequest(gc_count_before, word_size) {
+  guarantee(word_size > 0, "an allocation should always be requested");
+}
 
 void VM_G1CollectForAllocation::doit() {
   JvmtiGCForAllocationMarker jgcm;
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
-  _res = g1h->satisfy_failed_allocation(_size);
-  assert(g1h->is_in_or_null(_res), "result not in heap");
+  _result = g1h->satisfy_failed_allocation(_word_size, &_pause_succeeded);
+  assert(_result == NULL || _pause_succeeded,
+         "if we get back a result, the pause should have succeeded");
 }
 
 void VM_G1CollectFull::doit() {
@@ -39,6 +52,25 @@
   g1h->do_full_collection(false /* clear_all_soft_refs */);
 }
 
+VM_G1IncCollectionPause::VM_G1IncCollectionPause(
+                                      unsigned int   gc_count_before,
+                                      size_t         word_size,
+                                      bool           should_initiate_conc_mark,
+                                      double         target_pause_time_ms,
+                                      GCCause::Cause gc_cause)
+  : VM_G1OperationWithAllocRequest(gc_count_before, word_size),
+    _should_initiate_conc_mark(should_initiate_conc_mark),
+    _target_pause_time_ms(target_pause_time_ms),
+    _full_collections_completed_before(0) {
+  guarantee(target_pause_time_ms > 0.0,
+            err_msg("target_pause_time_ms = %1.6lf should be positive",
+                    target_pause_time_ms));
+  guarantee(word_size == 0 || gc_cause == GCCause::_g1_inc_collection_pause,
+            "we can only request an allocation if the GC cause is for "
+            "an incremental GC pause");
+  _gc_cause = gc_cause;
+}
+
 void VM_G1IncCollectionPause::doit() {
   JvmtiGCForAllocationMarker jgcm;
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
@@ -47,6 +79,18 @@
    (_gc_cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent)),
          "only a GC locker or a System.gc() induced GC should start a cycle");
 
+  if (_word_size > 0) {
+    // An allocation has been requested. So, try to do that first.
+    _result = g1h->attempt_allocation_at_safepoint(_word_size,
+                                     false /* expect_null_cur_alloc_region */);
+    if (_result != NULL) {
+      // If we can successfully allocate before we actually do the
+      // pause then we will consider this pause successful.
+      _pause_succeeded = true;
+      return;
+    }
+  }
+
   GCCauseSetter x(g1h, _gc_cause);
   if (_should_initiate_conc_mark) {
     // It's safer to read full_collections_completed() here, given
@@ -59,7 +103,16 @@
     // will do so if one is not already in progress.
     bool res = g1h->g1_policy()->force_initial_mark_if_outside_cycle();
   }
-  g1h->do_collection_pause_at_safepoint(_target_pause_time_ms);
+
+  _pause_succeeded =
+    g1h->do_collection_pause_at_safepoint(_target_pause_time_ms);
+  if (_pause_succeeded && _word_size > 0) {
+    // An allocation had been requested.
+    _result = g1h->attempt_allocation_at_safepoint(_word_size,
+                                      true /* expect_null_cur_alloc_region */);
+  } else {
+    assert(_result == NULL, "invariant");
+  }
 }
 
 void VM_G1IncCollectionPause::doit_epilogue() {
--- a/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,23 +22,42 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP
+
+#include "gc_implementation/shared/vmGCOperations.hpp"
+
 // VM_operations for the G1 collector.
 // VM_GC_Operation:
 //   - VM_CGC_Operation
 //   - VM_G1CollectFull
-//   - VM_G1CollectForAllocation
-//   - VM_G1IncCollectionPause
-//   - VM_G1PopRegionCollectionPause
+//   - VM_G1OperationWithAllocRequest
+//     - VM_G1CollectForAllocation
+//     - VM_G1IncCollectionPause
+
+class VM_G1OperationWithAllocRequest: public VM_GC_Operation {
+protected:
+  size_t    _word_size;
+  HeapWord* _result;
+  bool      _pause_succeeded;
+
+public:
+  VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
+                                 size_t       word_size)
+    : VM_GC_Operation(gc_count_before),
+      _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
+  HeapWord* result() { return _result; }
+  bool pause_succeeded() { return _pause_succeeded; }
+};
 
 class VM_G1CollectFull: public VM_GC_Operation {
- public:
+public:
   VM_G1CollectFull(unsigned int gc_count_before,
                    unsigned int full_gc_count_before,
                    GCCause::Cause cause)
     : VM_GC_Operation(gc_count_before, full_gc_count_before) {
     _gc_cause = cause;
   }
-  ~VM_G1CollectFull() {}
   virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
   virtual void doit();
   virtual const char* name() const {
@@ -46,45 +65,28 @@
   }
 };
 
-class VM_G1CollectForAllocation: public VM_GC_Operation {
- private:
-  HeapWord*   _res;
-  size_t      _size;                       // size of object to be allocated
- public:
-  VM_G1CollectForAllocation(size_t size, int gc_count_before)
-    : VM_GC_Operation(gc_count_before) {
-    _size        = size;
-    _res         = NULL;
-  }
-  ~VM_G1CollectForAllocation()        {}
+class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
+public:
+  VM_G1CollectForAllocation(unsigned int gc_count_before,
+                            size_t       word_size);
   virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
   virtual void doit();
   virtual const char* name() const {
     return "garbage-first collection to satisfy allocation";
   }
-  HeapWord* result() { return _res; }
 };
 
-class VM_G1IncCollectionPause: public VM_GC_Operation {
+class VM_G1IncCollectionPause: public VM_G1OperationWithAllocRequest {
 private:
-  bool _should_initiate_conc_mark;
-  double _target_pause_time_ms;
+  bool         _should_initiate_conc_mark;
+  double       _target_pause_time_ms;
   unsigned int _full_collections_completed_before;
 public:
   VM_G1IncCollectionPause(unsigned int   gc_count_before,
+                          size_t         word_size,
                           bool           should_initiate_conc_mark,
                           double         target_pause_time_ms,
-                          GCCause::Cause cause)
-    : VM_GC_Operation(gc_count_before),
-      _full_collections_completed_before(0),
-      _should_initiate_conc_mark(should_initiate_conc_mark),
-      _target_pause_time_ms(target_pause_time_ms) {
-    guarantee(target_pause_time_ms > 0.0,
-              err_msg("target_pause_time_ms = %1.6lf should be positive",
-                      target_pause_time_ms));
-
-    _gc_cause = cause;
-  }
+                          GCCause::Cause gc_cause);
   virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; }
   virtual void doit();
   virtual void doit_epilogue();
@@ -98,14 +100,9 @@
 class VM_CGC_Operation: public VM_Operation {
   VoidClosure* _cl;
   const char* _printGCMessage;
- public:
-  VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg) :
-    _cl(cl),
-    _printGCMessage(printGCMsg)
-    {}
-
-  ~VM_CGC_Operation() {}
-
+public:
+  VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg)
+    : _cl(cl), _printGCMessage(printGCMsg) { }
   virtual VMOp_Type type() const { return VMOp_CGC_Operation; }
   virtual void doit();
   virtual bool doit_prologue();
@@ -114,3 +111,5 @@
     return "concurrent gc";
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP
--- a/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-//
-// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// This code is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License version 2 only, as
-// published by the Free Software Foundation.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//  
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-binaryTreeDictionary.cpp                allocationStats.hpp
-binaryTreeDictionary.cpp                binaryTreeDictionary.hpp
-binaryTreeDictionary.cpp                globals.hpp
-binaryTreeDictionary.cpp                ostream.hpp
-binaryTreeDictionary.cpp                space.inline.hpp
-binaryTreeDictionary.cpp                spaceDecorator.hpp
-
-binaryTreeDictionary.hpp                freeBlockDictionary.hpp
-binaryTreeDictionary.hpp                freeList.hpp
-
-blockOffsetTable.inline.hpp             concurrentMarkSweepGeneration.hpp
-
-cmsAdaptiveSizePolicy.cpp		cmsAdaptiveSizePolicy.hpp
-cmsAdaptiveSizePolicy.cpp		defNewGeneration.hpp
-cmsAdaptiveSizePolicy.cpp		gcStats.hpp
-cmsAdaptiveSizePolicy.cpp		genCollectedHeap.hpp
-cmsAdaptiveSizePolicy.cpp		thread.hpp
-cmsAdaptiveSizePolicy.cpp		os_<os_family>.inline.hpp
-
-cmsAdaptiveSizePolicy.hpp		adaptiveSizePolicy.hpp
-cmsAdaptiveSizePolicy.hpp		timer.hpp
-
-cmsCollectorPolicy.cpp                  arguments.hpp
-cmsCollectorPolicy.cpp                  cardTableRS.hpp
-cmsCollectorPolicy.cpp                  cmsAdaptiveSizePolicy.hpp
-cmsCollectorPolicy.cpp                  cmsGCAdaptivePolicyCounters.hpp
-cmsCollectorPolicy.cpp                  cmsCollectorPolicy.hpp
-cmsCollectorPolicy.cpp                  collectorPolicy.hpp
-cmsCollectorPolicy.cpp                  gcLocker.inline.hpp
-cmsCollectorPolicy.cpp                  genCollectedHeap.hpp
-cmsCollectorPolicy.cpp                  gcPolicyCounters.hpp
-cmsCollectorPolicy.cpp                  generationSpec.hpp
-cmsCollectorPolicy.cpp                  globals_extension.hpp
-cmsCollectorPolicy.cpp                  handles.inline.hpp
-cmsCollectorPolicy.cpp                  java.hpp
-cmsCollectorPolicy.cpp                  parNewGeneration.hpp
-cmsCollectorPolicy.cpp                  space.hpp
-cmsCollectorPolicy.cpp                  thread_<os_family>.inline.hpp
-cmsCollectorPolicy.cpp                  universe.hpp
-cmsCollectorPolicy.cpp                  vmGCOperations.hpp
-cmsCollectorPolicy.cpp                  vmThread.hpp
-
-cmsCollectorPolicy.hpp                  collectorPolicy.hpp
-
-cmsGCAdaptivePolicyCounters.cpp		cmsGCAdaptivePolicyCounters.hpp
-cmsGCAdaptivePolicyCounters.cpp		resourceArea.hpp
-
-cmsGCAdaptivePolicyCounters.hpp		cmsAdaptiveSizePolicy.hpp
-cmsGCAdaptivePolicyCounters.hpp		gcAdaptivePolicyCounters.hpp
-cmsGCAdaptivePolicyCounters.hpp		gcStats.hpp
-cmsGCAdaptivePolicyCounters.hpp		perfData.hpp
-
-cmsLockVerifier.cpp                     cmsLockVerifier.hpp
-cmsLockVerifier.cpp                     concurrentMarkSweepThread.hpp
-cmsLockVerifier.cpp                     vmThread.hpp
-
-cmsLockVerifier.hpp                     mutex.hpp
-
-cmsOopClosures.hpp                      genOopClosures.hpp
-
-cmsOopClosures.inline.hpp               cmsOopClosures.hpp
-cmsOopClosures.inline.hpp               concurrentMarkSweepGeneration.hpp
-
-cmsPermGen.cpp                          blockOffsetTable.inline.hpp
-cmsPermGen.cpp                          cSpaceCounters.hpp
-cmsPermGen.cpp                          cmsPermGen.hpp
-cmsPermGen.cpp                          collectedHeap.inline.hpp
-cmsPermGen.cpp                          compactPermGen.hpp
-cmsPermGen.cpp                          concurrentMarkSweepGeneration.inline.hpp
-cmsPermGen.cpp                          genCollectedHeap.hpp
-cmsPermGen.cpp                          generation.inline.hpp
-cmsPermGen.cpp                          java.hpp
-cmsPermGen.cpp                          oop.inline.hpp
-cmsPermGen.cpp                          permGen.hpp
-cmsPermGen.cpp                          universe.hpp
-
-cmsPermGen.hpp                          concurrentMarkSweepGeneration.hpp
-cmsPermGen.hpp                          permGen.hpp
-
-compactibleFreeListSpace.cpp            allocation.inline.hpp
-compactibleFreeListSpace.cpp            blockOffsetTable.inline.hpp
-compactibleFreeListSpace.cpp            cmsLockVerifier.hpp
-compactibleFreeListSpace.cpp            collectedHeap.hpp
-compactibleFreeListSpace.cpp            compactibleFreeListSpace.hpp
-compactibleFreeListSpace.cpp            concurrentMarkSweepGeneration.inline.hpp
-compactibleFreeListSpace.cpp            concurrentMarkSweepThread.hpp
-compactibleFreeListSpace.cpp            copy.hpp
-compactibleFreeListSpace.cpp            globals.hpp
-compactibleFreeListSpace.cpp            handles.inline.hpp
-compactibleFreeListSpace.cpp            init.hpp
-compactibleFreeListSpace.cpp            java.hpp
-compactibleFreeListSpace.cpp            liveRange.hpp
-compactibleFreeListSpace.cpp            oop.inline.hpp
-compactibleFreeListSpace.cpp            resourceArea.hpp
-compactibleFreeListSpace.cpp            spaceDecorator.hpp
-compactibleFreeListSpace.cpp            universe.inline.hpp
-compactibleFreeListSpace.cpp            vmThread.hpp
-
-compactibleFreeListSpace.hpp            binaryTreeDictionary.hpp
-compactibleFreeListSpace.hpp            blockOffsetTable.inline.hpp
-compactibleFreeListSpace.hpp            freeList.hpp
-compactibleFreeListSpace.hpp            promotionInfo.hpp
-compactibleFreeListSpace.hpp            space.hpp
-
-compactingPermGenGen.cpp                concurrentMarkSweepGeneration.inline.hpp
-
-concurrentMarkSweepGeneration.cpp       cardTableRS.hpp
-concurrentMarkSweepGeneration.cpp       cmsAdaptiveSizePolicy.hpp
-concurrentMarkSweepGeneration.cpp       cmsCollectorPolicy.hpp
-concurrentMarkSweepGeneration.cpp       cmsGCAdaptivePolicyCounters.hpp
-concurrentMarkSweepGeneration.cpp       cmsOopClosures.inline.hpp
-concurrentMarkSweepGeneration.cpp       codeCache.hpp
-concurrentMarkSweepGeneration.cpp       collectedHeap.inline.hpp
-concurrentMarkSweepGeneration.cpp       collectorCounters.hpp
-concurrentMarkSweepGeneration.cpp       collectorPolicy.hpp
-concurrentMarkSweepGeneration.cpp       compactibleFreeListSpace.hpp
-concurrentMarkSweepGeneration.cpp       concurrentMarkSweepGeneration.inline.hpp
-concurrentMarkSweepGeneration.cpp       concurrentMarkSweepThread.hpp
-concurrentMarkSweepGeneration.cpp       gcLocker.inline.hpp
-concurrentMarkSweepGeneration.cpp       genCollectedHeap.hpp
-concurrentMarkSweepGeneration.cpp       genMarkSweep.hpp
-concurrentMarkSweepGeneration.cpp       genOopClosures.inline.hpp
-concurrentMarkSweepGeneration.cpp       globals_extension.hpp
-concurrentMarkSweepGeneration.cpp       handles.inline.hpp
-concurrentMarkSweepGeneration.cpp       isGCActiveMark.hpp
-concurrentMarkSweepGeneration.cpp       iterator.hpp
-concurrentMarkSweepGeneration.cpp       java.hpp
-concurrentMarkSweepGeneration.cpp       jvmtiExport.hpp
-concurrentMarkSweepGeneration.cpp       memoryService.hpp
-concurrentMarkSweepGeneration.cpp       oop.inline.hpp
-concurrentMarkSweepGeneration.cpp       parNewGeneration.hpp
-concurrentMarkSweepGeneration.cpp       referencePolicy.hpp
-concurrentMarkSweepGeneration.cpp       resourceArea.hpp
-concurrentMarkSweepGeneration.cpp       runtimeService.hpp
-concurrentMarkSweepGeneration.cpp       symbolTable.hpp
-concurrentMarkSweepGeneration.cpp       systemDictionary.hpp
-concurrentMarkSweepGeneration.cpp       vmCMSOperations.hpp
-concurrentMarkSweepGeneration.cpp       vmThread.hpp
-
-concurrentMarkSweepGeneration.hpp       bitMap.inline.hpp
-concurrentMarkSweepGeneration.hpp       freeBlockDictionary.hpp
-concurrentMarkSweepGeneration.hpp       gSpaceCounters.hpp
-concurrentMarkSweepGeneration.hpp       gcStats.hpp
-concurrentMarkSweepGeneration.hpp       generation.hpp
-concurrentMarkSweepGeneration.hpp       generationCounters.hpp
-concurrentMarkSweepGeneration.hpp       memoryService.hpp
-concurrentMarkSweepGeneration.hpp       mutexLocker.hpp
-concurrentMarkSweepGeneration.hpp       stack.inline.hpp
-concurrentMarkSweepGeneration.hpp       taskqueue.hpp
-concurrentMarkSweepGeneration.hpp       virtualspace.hpp
-concurrentMarkSweepGeneration.hpp       yieldingWorkgroup.hpp
-
-concurrentMarkSweepGeneration.inline.hpp cmsLockVerifier.hpp
-concurrentMarkSweepGeneration.inline.hpp compactibleFreeListSpace.hpp
-concurrentMarkSweepGeneration.inline.hpp concurrentMarkSweepGeneration.hpp
-concurrentMarkSweepGeneration.inline.hpp concurrentMarkSweepThread.hpp
-concurrentMarkSweepGeneration.inline.hpp defNewGeneration.hpp
-concurrentMarkSweepGeneration.inline.hpp gcUtil.hpp
-
-concurrentMarkSweepThread.cpp           concurrentMarkSweepGeneration.inline.hpp
-concurrentMarkSweepThread.cpp           concurrentMarkSweepThread.hpp
-concurrentMarkSweepThread.cpp           genCollectedHeap.hpp
-concurrentMarkSweepThread.cpp           init.hpp
-concurrentMarkSweepThread.cpp           instanceRefKlass.hpp
-concurrentMarkSweepThread.cpp           interfaceSupport.hpp
-concurrentMarkSweepThread.cpp           java.hpp
-concurrentMarkSweepThread.cpp           javaCalls.hpp
-concurrentMarkSweepThread.cpp           mutexLocker.hpp
-concurrentMarkSweepThread.cpp           oop.inline.hpp
-concurrentMarkSweepThread.cpp           os.hpp
-concurrentMarkSweepThread.cpp           systemDictionary.hpp
-concurrentMarkSweepThread.cpp           vmThread.hpp
-
-concurrentMarkSweepThread.hpp           concurrentGCThread.hpp
-concurrentMarkSweepThread.hpp           concurrentMarkSweepGeneration.hpp
-concurrentMarkSweepThread.hpp           thread_<os_family>.inline.hpp
-
-freeBlockDictionary.cpp                 freeBlockDictionary.hpp
-freeBlockDictionary.cpp                 thread_<os_family>.inline.hpp
-
-freeBlockDictionary.hpp                 allocation.hpp
-freeBlockDictionary.hpp                 debug.hpp
-freeBlockDictionary.hpp                 freeChunk.hpp
-freeBlockDictionary.hpp                 globalDefinitions.hpp
-freeBlockDictionary.hpp                 memRegion.hpp
-freeBlockDictionary.hpp                 mutex.hpp
-freeBlockDictionary.hpp                 ostream.hpp
-
-freeChunk.cpp                           copy.hpp
-freeChunk.cpp                           freeBlockDictionary.hpp
-
-freeChunk.hpp                           allocation.hpp
-freeChunk.hpp                           debug.hpp
-freeChunk.hpp                           globalDefinitions.hpp
-freeChunk.hpp                           markOop.hpp
-freeChunk.hpp                           memRegion.hpp
-freeChunk.hpp                           mutex.hpp
-freeChunk.hpp                           ostream.hpp
-
-freeList.cpp                            freeBlockDictionary.hpp
-freeList.cpp                            freeList.hpp
-freeList.cpp                            globals.hpp
-freeList.cpp                            mutex.hpp
-freeList.cpp                            sharedHeap.hpp
-freeList.cpp                            vmThread.hpp
-
-freeList.hpp                            allocationStats.hpp
-
-promotionInfo.cpp                       compactibleFreeListSpace.hpp
-promotionInfo.cpp                       markOop.inline.hpp
-promotionInfo.cpp                       oop.inline.hpp
-promotionInfo.cpp                       promotionInfo.hpp
-
-promotionInfo.hpp                       allocation.hpp
-promotionInfo.hpp                       freeChunk.hpp
-
-vmCMSOperations.cpp			concurrentMarkSweepGeneration.inline.hpp
-vmCMSOperations.cpp			concurrentMarkSweepThread.hpp
-vmCMSOperations.cpp			dtrace.hpp
-vmCMSOperations.cpp			gcLocker.inline.hpp
-vmCMSOperations.cpp			isGCActiveMark.hpp
-vmCMSOperations.cpp			interfaceSupport.hpp
-vmCMSOperations.cpp			vmCMSOperations.hpp
-
-vmCMSOperations.hpp			concurrentMarkSweepGeneration.hpp
-vmCMSOperations.hpp			gcCause.hpp
-vmCMSOperations.hpp			vm_operations.hpp
-vmCMSOperations.hpp			vmGCOperations.hpp
-
-yieldingWorkgroup.cpp                   yieldingWorkgroup.hpp
-
-yieldingWorkgroup.hpp                   workgroup.hpp
--- a/src/share/vm/gc_implementation/includeDB_gc_g1	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,377 +0,0 @@
-//
-// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// This code is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License version 2 only, as
-// published by the Free Software Foundation.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-bufferingOopClosure.hpp			genOopClosures.hpp
-bufferingOopClosure.hpp			generation.hpp
-bufferingOopClosure.hpp			os.hpp
-bufferingOopClosure.hpp			taskqueue.hpp
-
-cardTableRS.cpp				concurrentMark.hpp
-cardTableRS.cpp				g1SATBCardTableModRefBS.hpp
-
-collectionSetChooser.cpp		g1CollectedHeap.inline.hpp
-collectionSetChooser.cpp		g1CollectorPolicy.hpp
-collectionSetChooser.cpp		collectionSetChooser.hpp
-collectionSetChooser.cpp		space.inline.hpp
-
-collectionSetChooser.hpp		heapRegion.hpp
-collectionSetChooser.hpp                growableArray.hpp
-
-concurrentG1Refine.cpp			atomic.hpp
-concurrentG1Refine.cpp			concurrentG1Refine.hpp
-concurrentG1Refine.cpp			concurrentG1RefineThread.hpp
-concurrentG1Refine.cpp			copy.hpp
-concurrentG1Refine.cpp			g1CollectedHeap.inline.hpp
-concurrentG1Refine.cpp                  g1CollectorPolicy.hpp
-concurrentG1Refine.cpp			g1RemSet.hpp
-concurrentG1Refine.cpp			space.inline.hpp
-concurrentG1Refine.cpp                  heapRegionSeq.inline.hpp
-
-concurrentG1Refine.hpp			globalDefinitions.hpp
-concurrentG1Refine.hpp			allocation.hpp
-concurrentG1Refine.hpp                  cardTableModRefBS.hpp
-concurrentG1Refine.hpp			thread.hpp
-
-concurrentG1RefineThread.cpp		concurrentG1Refine.hpp
-concurrentG1RefineThread.cpp		concurrentG1RefineThread.hpp
-concurrentG1RefineThread.cpp		g1CollectedHeap.inline.hpp
-concurrentG1RefineThread.cpp            g1CollectorPolicy.hpp
-concurrentG1RefineThread.cpp		handles.inline.hpp
-concurrentG1RefineThread.cpp		mutexLocker.hpp
-concurrentG1RefineThread.cpp		resourceArea.hpp
-
-concurrentG1RefineThread.hpp		concurrentGCThread.hpp
-
-concurrentMark.cpp			concurrentMark.hpp
-concurrentMark.cpp			concurrentMarkThread.inline.hpp
-concurrentMark.cpp			g1CollectedHeap.inline.hpp
-concurrentMark.cpp                      g1CollectorPolicy.hpp
-concurrentMark.cpp                      g1RemSet.hpp
-concurrentMark.cpp		        genOopClosures.inline.hpp
-concurrentMark.cpp                      heapRegionRemSet.hpp
-concurrentMark.cpp                      heapRegionSeq.inline.hpp
-concurrentMark.cpp                      handles.inline.hpp
-concurrentMark.cpp			java.hpp
-concurrentMark.cpp			oop.inline.hpp
-concurrentMark.cpp                      referencePolicy.hpp
-concurrentMark.cpp			resourceArea.hpp
-concurrentMark.cpp			symbolTable.hpp
-
-concurrentMark.hpp			heapRegion.hpp
-concurrentMark.hpp			taskqueue.hpp
-
-concurrentMarkThread.cpp		concurrentMarkThread.inline.hpp
-concurrentMarkThread.cpp		g1CollectedHeap.inline.hpp
-concurrentMarkThread.cpp		g1CollectorPolicy.hpp
-concurrentMarkThread.cpp                g1MMUTracker.hpp
-concurrentMarkThread.cpp		resourceArea.hpp
-concurrentMarkThread.cpp		vm_operations_g1.hpp
-concurrentMarkThread.cpp                vmThread.hpp
-
-concurrentMarkThread.hpp		concurrentGCThread.hpp
-
-concurrentMarkThread.inline.hpp		concurrentMark.hpp
-concurrentMarkThread.inline.hpp		concurrentMarkThread.hpp
-
-concurrentZFThread.cpp			concurrentZFThread.hpp
-concurrentZFThread.cpp			heapRegion.hpp
-concurrentZFThread.cpp			g1CollectedHeap.inline.hpp
-concurrentZFThread.cpp			copy.hpp
-concurrentZFThread.cpp			mutexLocker.hpp
-concurrentZFThread.cpp			space.inline.hpp
-
-concurrentZFThread.hpp			concurrentGCThread.hpp
-
-dirtyCardQueue.cpp                      atomic.hpp
-dirtyCardQueue.cpp                      dirtyCardQueue.hpp
-dirtyCardQueue.cpp			heapRegionRemSet.hpp
-dirtyCardQueue.cpp                      mutexLocker.hpp
-dirtyCardQueue.cpp                      safepoint.hpp
-dirtyCardQueue.cpp                      thread.hpp
-dirtyCardQueue.cpp                      thread_<os_family>.inline.hpp
-dirtyCardQueue.cpp                      workgroup.hpp
-
-dirtyCardQueue.hpp                      allocation.hpp
-dirtyCardQueue.hpp                      ptrQueue.hpp
-
-g1BlockOffsetTable.cpp			g1BlockOffsetTable.inline.hpp
-g1BlockOffsetTable.cpp			java.hpp
-g1BlockOffsetTable.cpp			oop.inline.hpp
-g1BlockOffsetTable.cpp			space.hpp
-
-g1BlockOffsetTable.hpp			globalDefinitions.hpp
-g1BlockOffsetTable.hpp			memRegion.hpp
-g1BlockOffsetTable.hpp			virtualspace.hpp
-
-g1BlockOffsetTable.inline.hpp		g1BlockOffsetTable.hpp
-g1BlockOffsetTable.inline.hpp		space.hpp
-
-g1CollectedHeap.cpp                     aprofiler.hpp
-g1CollectedHeap.cpp                     bufferingOopClosure.hpp
-g1CollectedHeap.cpp                     concurrentG1Refine.hpp
-g1CollectedHeap.cpp                     concurrentG1RefineThread.hpp
-g1CollectedHeap.cpp			concurrentMarkThread.inline.hpp
-g1CollectedHeap.cpp                     concurrentZFThread.hpp
-g1CollectedHeap.cpp                     g1CollectedHeap.inline.hpp
-g1CollectedHeap.cpp                     g1CollectorPolicy.hpp
-g1CollectedHeap.cpp                     g1MarkSweep.hpp
-g1CollectedHeap.cpp                     g1RemSet.inline.hpp
-g1CollectedHeap.cpp                     g1OopClosures.inline.hpp
-g1CollectedHeap.cpp                     genOopClosures.inline.hpp
-g1CollectedHeap.cpp                     gcLocker.inline.hpp
-g1CollectedHeap.cpp                     generationSpec.hpp
-g1CollectedHeap.cpp                     heapRegionRemSet.hpp
-g1CollectedHeap.cpp                     heapRegionSeq.inline.hpp
-g1CollectedHeap.cpp                     icBuffer.hpp
-g1CollectedHeap.cpp                     isGCActiveMark.hpp
-g1CollectedHeap.cpp			oop.inline.hpp
-g1CollectedHeap.cpp			oop.pcgc.inline.hpp
-g1CollectedHeap.cpp                     vm_operations_g1.hpp
-g1CollectedHeap.cpp                     vmThread.hpp
-
-g1CollectedHeap.hpp                     barrierSet.hpp
-g1CollectedHeap.hpp                     g1RemSet.hpp
-g1CollectedHeap.hpp                     heapRegion.hpp
-g1CollectedHeap.hpp                     memRegion.hpp
-g1CollectedHeap.hpp			parGCAllocBuffer.hpp
-g1CollectedHeap.hpp                     sharedHeap.hpp
-
-g1CollectedHeap.inline.hpp              concurrentMark.hpp
-g1CollectedHeap.inline.hpp              g1CollectedHeap.hpp
-g1CollectedHeap.inline.hpp              heapRegionSeq.hpp
-g1CollectedHeap.inline.hpp		taskqueue.hpp
-
-g1CollectorPolicy.cpp			arguments.hpp
-g1CollectorPolicy.cpp			concurrentG1Refine.hpp
-g1CollectorPolicy.cpp			concurrentMark.hpp
-g1CollectorPolicy.cpp			concurrentMarkThread.inline.hpp
-g1CollectorPolicy.cpp			debug.hpp
-g1CollectorPolicy.cpp			java.hpp
-g1CollectorPolicy.cpp                   g1CollectedHeap.inline.hpp
-g1CollectorPolicy.cpp                   g1CollectorPolicy.hpp
-g1CollectorPolicy.cpp                   heapRegionRemSet.hpp
-g1CollectorPolicy.cpp			mutexLocker.hpp
-g1CollectorPolicy.cpp			gcPolicyCounters.hpp
-
-g1CollectorPolicy.hpp                   collectorPolicy.hpp
-g1CollectorPolicy.hpp                   collectionSetChooser.hpp
-g1CollectorPolicy.hpp			g1MMUTracker.hpp
-
-g1_globals.cpp				g1_globals.hpp
-
-g1_globals.hpp                          globals.hpp
-
-globals.cpp                             g1_globals.hpp
-top.hpp                                 g1_globals.hpp
-
-g1MarkSweep.cpp                         aprofiler.hpp
-g1MarkSweep.cpp                         biasedLocking.hpp
-g1MarkSweep.cpp                         codeCache.hpp
-g1MarkSweep.cpp                         events.hpp
-g1MarkSweep.cpp                         fprofiler.hpp
-g1MarkSweep.hpp                         g1CollectedHeap.inline.hpp
-g1MarkSweep.cpp                         g1MarkSweep.hpp
-g1MarkSweep.cpp                         gcLocker.hpp
-g1MarkSweep.cpp                         genCollectedHeap.hpp
-g1MarkSweep.hpp                         heapRegion.hpp
-g1MarkSweep.cpp                         icBuffer.hpp
-g1MarkSweep.cpp                         instanceRefKlass.hpp
-g1MarkSweep.cpp                         javaClasses.hpp
-g1MarkSweep.cpp				jvmtiExport.hpp
-g1MarkSweep.cpp                         copy.hpp
-g1MarkSweep.cpp                         modRefBarrierSet.hpp
-g1MarkSweep.cpp                         oop.inline.hpp
-g1MarkSweep.cpp                         referencePolicy.hpp
-g1MarkSweep.cpp                         space.hpp
-g1MarkSweep.cpp                         symbolTable.hpp
-g1MarkSweep.cpp                         synchronizer.hpp
-g1MarkSweep.cpp                         systemDictionary.hpp
-g1MarkSweep.cpp                         thread.hpp
-g1MarkSweep.cpp                         vmSymbols.hpp
-g1MarkSweep.cpp                         vmThread.hpp
-
-g1MarkSweep.hpp                         generation.hpp
-g1MarkSweep.hpp                         growableArray.hpp
-g1MarkSweep.hpp                         markOop.hpp
-g1MarkSweep.hpp                         genMarkSweep.hpp
-g1MarkSweep.hpp                         oop.hpp
-g1MarkSweep.hpp                         timer.hpp
-g1MarkSweep.hpp                         universe.hpp
-
-g1MemoryPool.cpp                        heapRegion.hpp
-g1MemoryPool.cpp                        g1CollectedHeap.inline.hpp
-g1MemoryPool.cpp                        g1CollectedHeap.hpp
-g1MemoryPool.cpp                        g1CollectorPolicy.hpp
-g1MemoryPool.cpp                        g1MemoryPool.hpp
-
-g1MemoryPool.hpp                        memoryUsage.hpp
-g1MemoryPool.hpp                        memoryPool.hpp
-
-g1OopClosures.inline.hpp		concurrentMark.hpp
-g1OopClosures.inline.hpp		g1OopClosures.hpp
-g1OopClosures.inline.hpp		g1CollectedHeap.hpp
-g1OopClosures.inline.hpp		g1RemSet.hpp
-
-g1MMUTracker.cpp			g1MMUTracker.hpp
-g1MMUTracker.cpp			ostream.hpp
-g1MMUTracker.cpp			mutexLocker.hpp
-
-g1MMUTracker.hpp			debug.hpp
-g1MMUTracker.hpp			allocation.hpp
-
-g1RemSet.cpp				bufferingOopClosure.hpp
-g1RemSet.cpp				concurrentG1Refine.hpp
-g1RemSet.cpp				concurrentG1RefineThread.hpp
-g1RemSet.cpp				g1BlockOffsetTable.inline.hpp
-g1RemSet.cpp				g1CollectedHeap.inline.hpp
-g1RemSet.cpp				g1CollectorPolicy.hpp
-g1RemSet.cpp				g1RemSet.inline.hpp
-g1RemSet.cpp				g1OopClosures.inline.hpp
-g1RemSet.cpp				heapRegionSeq.inline.hpp
-g1RemSet.cpp				intHisto.hpp
-g1RemSet.cpp				iterator.hpp
-g1RemSet.cpp				oop.inline.hpp
-
-g1RemSet.inline.hpp			oop.inline.hpp
-g1RemSet.inline.hpp			g1RemSet.hpp
-g1RemSet.inline.hpp			heapRegionRemSet.hpp
-
-g1SATBCardTableModRefBS.cpp		g1SATBCardTableModRefBS.hpp
-g1SATBCardTableModRefBS.cpp		heapRegion.hpp
-g1SATBCardTableModRefBS.cpp		mutexLocker.hpp
-g1SATBCardTableModRefBS.cpp		thread.hpp
-g1SATBCardTableModRefBS.cpp		thread_<os_family>.inline.hpp
-g1SATBCardTableModRefBS.cpp		satbQueue.hpp
-
-g1SATBCardTableModRefBS.hpp		oop.inline.hpp
-g1SATBCardTableModRefBS.hpp		cardTableModRefBS.hpp
-g1SATBCardTableModRefBS.hpp		memRegion.hpp
-
-heapRegion.cpp                          concurrentZFThread.hpp
-heapRegion.cpp                          g1BlockOffsetTable.inline.hpp
-heapRegion.cpp                          g1CollectedHeap.inline.hpp
-heapRegion.cpp                          g1OopClosures.inline.hpp
-heapRegion.cpp                          genOopClosures.inline.hpp
-heapRegion.cpp                          heapRegion.inline.hpp
-heapRegion.cpp                          heapRegionRemSet.hpp
-heapRegion.cpp                          heapRegionSeq.inline.hpp
-heapRegion.cpp                          iterator.hpp
-heapRegion.cpp                          oop.inline.hpp
-
-heapRegion.hpp                          space.inline.hpp
-heapRegion.hpp                          spaceDecorator.hpp
-heapRegion.hpp                          g1BlockOffsetTable.inline.hpp
-heapRegion.hpp                          watermark.hpp
-heapRegion.hpp				g1_specialized_oop_closures.hpp
-heapRegion.hpp				survRateGroup.hpp
-heapRegion.hpp				ageTable.hpp
-
-heapRegionRemSet.hpp			sparsePRT.hpp
-
-heapRegionRemSet.cpp                    allocation.hpp
-heapRegionRemSet.cpp                    bitMap.inline.hpp
-heapRegionRemSet.cpp                    concurrentG1Refine.hpp
-heapRegionRemSet.cpp                    g1BlockOffsetTable.inline.hpp
-heapRegionRemSet.cpp                    g1CollectedHeap.inline.hpp
-heapRegionRemSet.cpp                    heapRegionRemSet.hpp
-heapRegionRemSet.cpp			heapRegionSeq.inline.hpp
-heapRegionRemSet.cpp                    globalDefinitions.hpp
-heapRegionRemSet.cpp                    space.inline.hpp
-
-heapRegionSeq.cpp                       allocation.hpp
-heapRegionSeq.cpp                       g1CollectedHeap.inline.hpp
-heapRegionSeq.cpp                       heapRegionSeq.hpp
-
-heapRegionSeq.hpp                       growableArray.hpp
-heapRegionSeq.hpp                       heapRegion.hpp
-
-heapRegionSeq.inline.hpp                heapRegionSeq.hpp
-
-instanceKlass.cpp                       g1RemSet.inline.hpp
-
-instanceRefKlass.cpp                    g1RemSet.inline.hpp
-
-klass.hpp				g1OopClosures.hpp
-
-memoryService.cpp                       g1MemoryPool.hpp
-
-objArrayKlass.cpp                       g1RemSet.inline.hpp
-
-ptrQueue.cpp                            allocation.hpp
-ptrQueue.cpp                            allocation.inline.hpp
-ptrQueue.cpp                            mutex.hpp
-ptrQueue.cpp                            mutexLocker.hpp
-ptrQueue.cpp                            ptrQueue.hpp
-ptrQueue.cpp                            thread_<os_family>.inline.hpp
-
-ptrQueue.hpp                            allocation.hpp
-ptrQueue.hpp                            sizes.hpp
-
-satbQueue.cpp                           allocation.inline.hpp
-satbQueue.cpp                           mutexLocker.hpp
-satbQueue.cpp                           satbQueue.hpp
-satbQueue.cpp                           sharedHeap.hpp
-satbQueue.cpp                           thread.hpp
-
-satbQueue.hpp                           ptrQueue.hpp
-
-sparsePRT.cpp				allocation.inline.hpp
-sparsePRT.cpp				cardTableModRefBS.hpp
-sparsePRT.cpp				heapRegion.hpp
-sparsePRT.cpp				heapRegionRemSet.hpp
-sparsePRT.cpp				mutexLocker.hpp
-sparsePRT.cpp				sparsePRT.hpp
-sparsePRT.cpp				space.inline.hpp
-
-sparsePRT.hpp				allocation.hpp
-sparsePRT.hpp				cardTableModRefBS.hpp
-sparsePRT.hpp				globalDefinitions.hpp
-sparsePRT.hpp                           g1CollectedHeap.inline.hpp
-sparsePRT.hpp				heapRegion.hpp
-sparsePRT.hpp				mutex.hpp
-
-specialized_oop_closures.hpp		g1_specialized_oop_closures.hpp
-
-survRateGroup.hpp			numberSeq.hpp
-
-survRateGroup.cpp			allocation.hpp
-survRateGroup.cpp			g1CollectedHeap.inline.hpp
-survRateGroup.cpp			g1CollectorPolicy.hpp
-survRateGroup.cpp			heapRegion.hpp
-survRateGroup.cpp			survRateGroup.hpp
-
-thread.cpp				concurrentMarkThread.inline.hpp
-
-universe.cpp                            g1CollectedHeap.inline.hpp
-universe.cpp                            g1CollectorPolicy.hpp
-
-vm_operations_g1.hpp			vmGCOperations.hpp
-
-vm_operations_g1.cpp			vm_operations_g1.hpp
-vm_operations_g1.cpp                    g1CollectedHeap.inline.hpp
-vm_operations_g1.cpp                    g1CollectorPolicy.hpp
-vm_operations_g1.cpp                    interfaceSupport.hpp
-vm_operations_g1.cpp                    isGCActiveMark.hpp
--- a/src/share/vm/gc_implementation/includeDB_gc_parNew	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-//
-// Copyright (c) 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.
-//   
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//  
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//   
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//
-//
-
-asParNewGeneration.hpp                  adaptiveSizePolicy.hpp
-asParNewGeneration.hpp                  parNewGeneration.hpp
-
-asParNewGeneration.cpp                  asParNewGeneration.hpp
-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
-asParNewGeneration.cpp                  spaceDecorator.hpp
-
-parCardTableModRefBS.cpp                allocation.inline.hpp
-parCardTableModRefBS.cpp                cardTableModRefBS.hpp
-parCardTableModRefBS.cpp                cardTableRS.hpp
-parCardTableModRefBS.cpp                java.hpp
-parCardTableModRefBS.cpp                mutexLocker.hpp
-parCardTableModRefBS.cpp                sharedHeap.hpp
-parCardTableModRefBS.cpp                space.inline.hpp
-parCardTableModRefBS.cpp                universe.hpp
-parCardTableModRefBS.cpp                virtualspace.hpp
-
-parGCAllocBuffer.cpp                    arrayOop.hpp
-parGCAllocBuffer.cpp                    oop.inline.hpp
-parGCAllocBuffer.cpp                    parGCAllocBuffer.hpp
-parGCAllocBuffer.cpp                    sharedHeap.hpp
-
-parGCAllocBuffer.hpp                    allocation.hpp
-parGCAllocBuffer.hpp                    globalDefinitions.hpp
-parGCAllocBuffer.hpp                    threadLocalAllocBuffer.hpp
-
-parNewGeneration.cpp                    adaptiveSizePolicy.hpp
-parNewGeneration.cpp                    ageTable.hpp
-parNewGeneration.cpp                    concurrentMarkSweepGeneration.hpp
-parNewGeneration.cpp                    copy.hpp
-parNewGeneration.cpp                    defNewGeneration.inline.hpp
-parNewGeneration.cpp                    genCollectedHeap.hpp
-parNewGeneration.cpp                    genOopClosures.inline.hpp
-parNewGeneration.cpp                    generation.hpp
-parNewGeneration.cpp                    generation.inline.hpp
-parNewGeneration.cpp                    globalDefinitions.hpp
-parNewGeneration.cpp                    handles.hpp
-parNewGeneration.cpp                    handles.inline.hpp
-parNewGeneration.cpp                    java.hpp
-parNewGeneration.cpp                    objArrayOop.hpp
-parNewGeneration.cpp                    oop.inline.hpp
-parNewGeneration.cpp                    oop.pcgc.inline.hpp
-parNewGeneration.cpp                    parGCAllocBuffer.hpp
-parNewGeneration.cpp                    parNewGeneration.hpp
-parNewGeneration.cpp                    parOopClosures.inline.hpp
-parNewGeneration.cpp                    referencePolicy.hpp
-parNewGeneration.cpp                    resourceArea.hpp
-parNewGeneration.cpp                    sharedHeap.hpp
-parNewGeneration.cpp                    space.hpp
-parNewGeneration.cpp                    spaceDecorator.hpp
-parNewGeneration.cpp                    thread.hpp
-parNewGeneration.cpp                    workgroup.hpp
-
-parNewGeneration.hpp                    defNewGeneration.hpp
-parNewGeneration.hpp                    parGCAllocBuffer.hpp
-parNewGeneration.hpp                    taskqueue.hpp
-
-parOopClosures.hpp                      genOopClosures.hpp
-
-parOopClosures.inline.hpp               parNewGeneration.hpp
-parOopClosures.inline.hpp               parOopClosures.hpp
--- a/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,467 +0,0 @@
-//
-// Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// This code is free software; you can redistribute it and/or modify it
-// 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-
-adjoiningGenerations.hpp		adjoiningVirtualSpaces.hpp
-adjoiningGenerations.hpp		asPSOldGen.hpp
-adjoiningGenerations.hpp		asPSYoungGen.hpp
-adjoiningGenerations.hpp                psPermGen.hpp
-
-adjoiningGenerations.cpp		adjoiningGenerations.hpp
-adjoiningGenerations.cpp		adjoiningVirtualSpaces.hpp
-adjoiningGenerations.cpp		parallelScavengeHeap.hpp
-adjoiningGenerations.cpp                psPermGen.hpp
-
-adjoiningVirtualSpaces.hpp		psVirtualspace.hpp
-
-adjoiningVirtualSpaces.cpp		java.hpp
-adjoiningVirtualSpaces.cpp		adjoiningVirtualSpaces.hpp
-
-asPSOldGen.hpp                          generationCounters.hpp
-asPSOldGen.hpp                          mutableSpace.hpp
-asPSOldGen.hpp                          objectStartArray.hpp
-asPSOldGen.hpp                          psVirtualspace.hpp
-asPSOldGen.hpp                          spaceCounters.hpp
-asPSOldGen.hpp				psOldGen.hpp
-
-asPSOldGen.cpp                          psAdaptiveSizePolicy.hpp
-asPSOldGen.cpp                          cardTableModRefBS.hpp
-asPSOldGen.cpp                          java.hpp
-asPSOldGen.cpp                          oop.inline.hpp
-asPSOldGen.cpp                          parallelScavengeHeap.hpp
-asPSOldGen.cpp                          psMarkSweepDecorator.hpp
-asPSOldGen.cpp                          asPSOldGen.hpp
-
-asPSYoungGen.hpp                        generationCounters.hpp
-asPSYoungGen.hpp                        mutableSpace.hpp
-asPSYoungGen.hpp                        objectStartArray.hpp
-asPSYoungGen.hpp                        spaceCounters.hpp
-asPSYoungGen.hpp                        psVirtualspace.hpp
-asPSYoungGen.hpp                        psYoungGen.hpp
-asPSYoungGen.hpp                        spaceDecorator.hpp
-
-asPSYoungGen.cpp                        gcUtil.hpp
-asPSYoungGen.cpp                        java.hpp
-asPSYoungGen.cpp                        oop.inline.hpp
-asPSYoungGen.cpp                        parallelScavengeHeap.hpp
-asPSYoungGen.cpp                        psMarkSweepDecorator.hpp
-asPSYoungGen.cpp                        psScavenge.hpp
-asPSYoungGen.cpp                        asPSYoungGen.hpp
-asPSYoungGen.cpp                        psYoungGen.hpp
-asPSYoungGen.cpp                        spaceDecorator.hpp
-
-cardTableExtension.cpp                  cardTableExtension.hpp
-cardTableExtension.cpp                  gcTaskManager.hpp
-cardTableExtension.cpp                  oop.inline.hpp
-cardTableExtension.cpp                  oop.psgc.inline.hpp
-cardTableExtension.cpp                  parallelScavengeHeap.hpp
-cardTableExtension.cpp                  psTasks.hpp
-cardTableExtension.cpp                  psYoungGen.hpp
-
-cardTableExtension.hpp                  cardTableModRefBS.hpp
-
-gcTaskManager.hpp                       mutex.hpp
-gcTaskManager.hpp                       growableArray.hpp
-
-gcTaskManager.cpp                       allocation.hpp
-gcTaskManager.cpp                       allocation.inline.hpp
-gcTaskManager.cpp                       gcTaskManager.hpp
-gcTaskManager.cpp                       gcTaskThread.hpp
-gcTaskManager.cpp                       mutex.hpp
-gcTaskManager.cpp                       mutexLocker.hpp
-
-gcTaskThread.hpp                        thread.hpp
-
-gcTaskThread.cpp                        allocation.hpp
-gcTaskThread.cpp                        allocation.inline.hpp
-gcTaskThread.cpp                        gcTaskManager.hpp
-gcTaskThread.cpp                        gcTaskThread.hpp
-gcTaskThread.cpp                        handles.hpp
-gcTaskThread.cpp                        handles.inline.hpp
-gcTaskThread.cpp                        os.hpp
-gcTaskThread.cpp                        resourceArea.hpp
-gcTaskThread.cpp                        thread.hpp
-
-generationSizer.hpp                     collectorPolicy.hpp
-
-objectStartArray.cpp                    allocation.inline.hpp
-objectStartArray.cpp                    cardTableModRefBS.hpp
-objectStartArray.cpp                    java.hpp
-objectStartArray.cpp                    objectStartArray.hpp
-objectStartArray.cpp                    oop.inline.hpp
-
-objectStartArray.hpp                    allocation.hpp
-objectStartArray.hpp                    memRegion.hpp
-objectStartArray.hpp                    oop.hpp
-objectStartArray.hpp                    psVirtualspace.hpp
-
-parallelScavengeHeap.cpp                adjoiningGenerations.hpp
-parallelScavengeHeap.cpp                adjoiningVirtualSpaces.hpp
-parallelScavengeHeap.cpp                cardTableExtension.hpp
-parallelScavengeHeap.cpp                gcLocker.inline.hpp
-parallelScavengeHeap.cpp                gcTaskManager.hpp
-parallelScavengeHeap.cpp                generationSizer.hpp
-parallelScavengeHeap.cpp                handles.inline.hpp
-parallelScavengeHeap.cpp                java.hpp
-parallelScavengeHeap.cpp                oop.inline.hpp
-parallelScavengeHeap.cpp                parallelScavengeHeap.inline.hpp
-parallelScavengeHeap.cpp                psAdaptiveSizePolicy.hpp
-parallelScavengeHeap.cpp                psMarkSweep.hpp
-parallelScavengeHeap.cpp                psParallelCompact.hpp
-parallelScavengeHeap.cpp                psPromotionManager.hpp
-parallelScavengeHeap.cpp                psScavenge.hpp
-parallelScavengeHeap.cpp                vmError.hpp
-parallelScavengeHeap.cpp                vmThread.hpp
-parallelScavengeHeap.cpp                vmPSOperations.hpp
-
-parallelScavengeHeap.inline.hpp		parallelScavengeHeap.hpp
-parallelScavengeHeap.inline.hpp		psMarkSweep.hpp
-parallelScavengeHeap.inline.hpp		psParallelCompact.hpp
-parallelScavengeHeap.inline.hpp		psScavenge.hpp
-
-parallelScavengeHeap.hpp                collectedHeap.inline.hpp
-parallelScavengeHeap.hpp                objectStartArray.hpp
-parallelScavengeHeap.hpp                gcPolicyCounters.hpp
-parallelScavengeHeap.hpp                psGCAdaptivePolicyCounters.hpp
-parallelScavengeHeap.hpp                psOldGen.hpp
-parallelScavengeHeap.hpp                psPermGen.hpp
-parallelScavengeHeap.hpp                psYoungGen.hpp
-parallelScavengeHeap.hpp                ostream.hpp
-
-parMarkBitMap.cpp			bitMap.inline.hpp
-parMarkBitMap.cpp			oop.inline.hpp
-parMarkBitMap.cpp			os.hpp
-parMarkBitMap.cpp			os_<os_family>.inline.hpp
-parMarkBitMap.cpp			parMarkBitMap.hpp
-parMarkBitMap.cpp			parMarkBitMap.inline.hpp
-parMarkBitMap.cpp                       psParallelCompact.hpp
-
-parMarkBitMap.hpp			bitMap.inline.hpp
-parMarkBitMap.hpp			psVirtualspace.hpp
-
-psAdaptiveSizePolicy.cpp                collectorPolicy.hpp
-psAdaptiveSizePolicy.cpp                gcPolicyCounters.hpp
-psAdaptiveSizePolicy.cpp		gcCause.hpp
-psAdaptiveSizePolicy.cpp                generationSizer.hpp
-psAdaptiveSizePolicy.cpp                psAdaptiveSizePolicy.hpp
-psAdaptiveSizePolicy.cpp                psGCAdaptivePolicyCounters.hpp
-psAdaptiveSizePolicy.cpp                psScavenge.hpp
-psAdaptiveSizePolicy.cpp                timer.hpp
-psAdaptiveSizePolicy.cpp                top.hpp
-
-psAdaptiveSizePolicy.hpp                gcCause.hpp
-psAdaptiveSizePolicy.hpp		gcStats.hpp
-psAdaptiveSizePolicy.hpp                gcUtil.hpp
-psAdaptiveSizePolicy.hpp		adaptiveSizePolicy.hpp
-
-psCompactionManager.cpp                 gcTaskManager.hpp
-psCompactionManager.cpp                 objArrayKlass.inline.hpp
-psCompactionManager.cpp                 objectStartArray.hpp
-psCompactionManager.cpp                 oop.hpp
-psCompactionManager.cpp                 oop.inline.hpp
-psCompactionManager.cpp                 oop.pcgc.inline.hpp
-psCompactionManager.cpp                 parallelScavengeHeap.hpp
-psCompactionManager.cpp                 parMarkBitMap.hpp
-psCompactionManager.cpp                 psParallelCompact.hpp
-psCompactionManager.cpp                 psCompactionManager.hpp
-psCompactionManager.cpp                 psOldGen.hpp
-psCompactionManager.cpp                 stack.inline.hpp
-psCompactionManager.cpp                 systemDictionary.hpp
-
-psCompactionManager.hpp                 allocation.hpp
-psCompactionManager.hpp                 stack.hpp
-psCompactionManager.hpp                 taskqueue.hpp
-
-psCompactionManager.inline.hpp		psCompactionManager.hpp
-psCompactionManager.inline.hpp		psParallelCompact.hpp
-
-psGCAdaptivePolicyCounters.hpp		gcAdaptivePolicyCounters.hpp
-psGCAdaptivePolicyCounters.hpp          gcPolicyCounters.hpp
-psGCAdaptivePolicyCounters.hpp          psAdaptiveSizePolicy.hpp
-
-psGCAdaptivePolicyCounters.cpp          arguments.hpp
-psGCAdaptivePolicyCounters.cpp          resourceArea.hpp
-psGCAdaptivePolicyCounters.cpp          psGCAdaptivePolicyCounters.hpp
-
-psGenerationCounters.cpp                psGenerationCounters.hpp
-psGenerationCounters.cpp                resourceArea.hpp
-
-psGenerationCounters.hpp                generationCounters.hpp
-psGenerationCounters.hpp                perfData.hpp
-psGenerationCounters.hpp                psVirtualspace.hpp
-
-psMarkSweep.cpp                         psAdaptiveSizePolicy.hpp
-psMarkSweep.cpp                         biasedLocking.hpp
-psMarkSweep.cpp                         codeCache.hpp
-psMarkSweep.cpp                         events.hpp
-psMarkSweep.cpp                         fprofiler.hpp
-psMarkSweep.cpp                         gcCause.hpp
-psMarkSweep.cpp                         gcLocker.inline.hpp
-psMarkSweep.cpp                         generationSizer.hpp
-psMarkSweep.cpp                         isGCActiveMark.hpp
-psMarkSweep.cpp                         oop.inline.hpp
-psMarkSweep.cpp                         memoryService.hpp
-psMarkSweep.cpp                         management.hpp
-psMarkSweep.cpp                         parallelScavengeHeap.hpp
-psMarkSweep.cpp                         psMarkSweep.hpp
-psMarkSweep.cpp                         psMarkSweepDecorator.hpp
-psMarkSweep.cpp                         psOldGen.hpp
-psMarkSweep.cpp                         psPermGen.hpp
-psMarkSweep.cpp                         psScavenge.hpp
-psMarkSweep.cpp                         psYoungGen.hpp
-psMarkSweep.cpp                         referencePolicy.hpp
-psMarkSweep.cpp                         referenceProcessor.hpp
-psMarkSweep.cpp                         safepoint.hpp
-psMarkSweep.cpp                         spaceDecorator.hpp
-psMarkSweep.cpp                         stack.inline.hpp
-psMarkSweep.cpp                         symbolTable.hpp
-psMarkSweep.cpp                         systemDictionary.hpp
-psMarkSweep.cpp                         vmThread.hpp
-
-psMarkSweep.hpp                         markSweep.inline.hpp
-psMarkSweep.hpp                         collectorCounters.hpp
-psMarkSweep.hpp                         stack.hpp
-
-psMarkSweepDecorator.cpp                liveRange.hpp
-psMarkSweepDecorator.cpp                markSweep.inline.hpp
-psMarkSweepDecorator.cpp                objectStartArray.hpp
-psMarkSweepDecorator.cpp                oop.inline.hpp
-psMarkSweepDecorator.cpp                parallelScavengeHeap.hpp
-psMarkSweepDecorator.cpp                psMarkSweep.hpp
-psMarkSweepDecorator.cpp                psMarkSweepDecorator.hpp
-psMarkSweepDecorator.cpp                spaceDecorator.hpp
-psMarkSweepDecorator.cpp                systemDictionary.hpp
-
-psMarkSweepDecorator.hpp                mutableSpace.hpp
-
-psParallelCompact.cpp			psAdaptiveSizePolicy.hpp
-psParallelCompact.cpp			codeCache.hpp
-psParallelCompact.cpp			events.hpp
-psParallelCompact.cpp			fprofiler.hpp
-psParallelCompact.cpp			gcCause.hpp
-psParallelCompact.cpp			gcLocker.inline.hpp
-psParallelCompact.cpp                   gcTaskManager.hpp
-psParallelCompact.cpp                   generationSizer.hpp
-psParallelCompact.cpp			isGCActiveMark.hpp
-psParallelCompact.cpp			management.hpp
-psParallelCompact.cpp			memoryService.hpp
-psParallelCompact.cpp			methodDataOop.hpp
-psParallelCompact.cpp			oop.inline.hpp
-psParallelCompact.cpp			oop.pcgc.inline.hpp
-psParallelCompact.cpp			parallelScavengeHeap.inline.hpp
-psParallelCompact.cpp			pcTasks.hpp
-psParallelCompact.cpp			psMarkSweep.hpp
-psParallelCompact.cpp			psMarkSweepDecorator.hpp
-psParallelCompact.cpp			psCompactionManager.inline.hpp
-psParallelCompact.cpp                   psPromotionManager.inline.hpp
-psParallelCompact.cpp			psOldGen.hpp
-psParallelCompact.cpp			psParallelCompact.hpp
-psParallelCompact.cpp			psPermGen.hpp
-psParallelCompact.cpp			psScavenge.hpp
-psParallelCompact.cpp			psYoungGen.hpp
-psParallelCompact.cpp			referencePolicy.hpp
-psParallelCompact.cpp			referenceProcessor.hpp
-psParallelCompact.cpp			safepoint.hpp
-psParallelCompact.cpp			stack.inline.hpp
-psParallelCompact.cpp			symbolTable.hpp
-psParallelCompact.cpp			systemDictionary.hpp
-psParallelCompact.cpp			vmThread.hpp
-
-psParallelCompact.hpp			collectorCounters.hpp
-psParallelCompact.hpp			markSweep.hpp
-psParallelCompact.hpp			mutableSpace.hpp
-psParallelCompact.hpp                   objectStartArray.hpp
-psParallelCompact.hpp			oop.hpp
-psParallelCompact.hpp			parMarkBitMap.hpp
-psParallelCompact.hpp			psCompactionManager.hpp
-psParallelCompact.hpp			sharedHeap.hpp
-
-psOldGen.cpp                            psAdaptiveSizePolicy.hpp
-psOldGen.cpp                            cardTableModRefBS.hpp
-psOldGen.cpp                            gcLocker.inline.hpp
-psOldGen.cpp                            java.hpp
-psOldGen.cpp                            oop.inline.hpp
-psOldGen.cpp                            parallelScavengeHeap.hpp
-psOldGen.cpp                            psMarkSweepDecorator.hpp
-psOldGen.cpp                            psOldGen.hpp
-psOldGen.cpp                            spaceDecorator.hpp
-
-psOldGen.hpp                            psGenerationCounters.hpp
-psOldGen.hpp                            mutableSpace.hpp
-psOldGen.hpp                            objectStartArray.hpp
-psOldGen.hpp                            psVirtualspace.hpp
-psOldGen.hpp                         	safepoint.hpp
-psOldGen.hpp                            spaceCounters.hpp
-
-psPermGen.cpp                           gcUtil.hpp
-psPermGen.cpp                           markOop.inline.hpp
-psPermGen.cpp                           markSweep.inline.hpp
-psPermGen.cpp                           parallelScavengeHeap.hpp
-psPermGen.cpp                           psMarkSweepDecorator.hpp
-psPermGen.cpp                           psParallelCompact.hpp
-psPermGen.cpp                           psPermGen.hpp
-
-psPermGen.hpp                           psOldGen.hpp
-
-psPromotionManager.cpp                  memRegion.hpp
-psPromotionManager.cpp                  mutableSpace.hpp
-psPromotionManager.cpp                  oop.inline.hpp
-psPromotionManager.cpp                  oop.psgc.inline.hpp
-psPromotionManager.cpp                  parallelScavengeHeap.hpp
-psPromotionManager.cpp                  psOldGen.hpp
-psPromotionManager.cpp                  psPromotionManager.inline.hpp
-psPromotionManager.cpp                  psScavenge.inline.hpp
-
-psPromotionManager.hpp                  allocation.hpp
-psPromotionManager.hpp                  psPromotionLAB.hpp
-psPromotionManager.hpp                  taskqueue.hpp
-
-psPromotionManager.inline.hpp           psPromotionManager.hpp
-psPromotionManager.inline.hpp           psScavenge.hpp
-
-psPromotionLAB.cpp                      mutableSpace.hpp
-psPromotionLAB.cpp                      oop.inline.hpp
-psPromotionLAB.cpp                      parallelScavengeHeap.hpp
-psPromotionLAB.cpp                      psPromotionLAB.hpp
-
-psPromotionLAB.hpp                      allocation.hpp
-psPromotionLAB.hpp                      objectStartArray.hpp
-
-psScavenge.cpp                          psAdaptiveSizePolicy.hpp
-psScavenge.cpp                          biasedLocking.hpp
-psScavenge.cpp                          cardTableExtension.hpp
-psScavenge.cpp                          collectorPolicy.hpp
-psScavenge.cpp                          fprofiler.hpp
-psScavenge.cpp                          gcCause.hpp
-psScavenge.cpp                          gcLocker.inline.hpp
-psScavenge.cpp                          gcTaskManager.hpp
-psScavenge.cpp                          generationSizer.hpp
-psScavenge.cpp                          handles.inline.hpp
-psScavenge.cpp                          isGCActiveMark.hpp
-psScavenge.cpp                          oop.inline.hpp
-psScavenge.cpp                          oop.psgc.inline.hpp
-psScavenge.cpp                          memoryService.hpp
-psScavenge.cpp                          parallelScavengeHeap.hpp
-psScavenge.cpp                          psMarkSweep.hpp
-psScavenge.cpp                          psParallelCompact.hpp
-psScavenge.cpp                          psScavenge.inline.hpp
-psScavenge.cpp                          psTasks.hpp
-psScavenge.cpp                          referencePolicy.hpp
-psScavenge.cpp                          referenceProcessor.hpp
-psScavenge.cpp                          resourceArea.hpp
-psScavenge.cpp                          spaceDecorator.hpp
-psScavenge.cpp                          stack.inline.hpp
-psScavenge.cpp                          threadCritical.hpp
-psScavenge.cpp                          vmThread.hpp
-psScavenge.cpp                          vm_operations.hpp
-
-psScavenge.hpp                          allocation.hpp
-psScavenge.hpp                          cardTableExtension.hpp
-psScavenge.hpp                          collectorCounters.hpp
-psScavenge.hpp                          oop.hpp
-psScavenge.hpp                          psVirtualspace.hpp
-psScavenge.hpp                          stack.hpp
-
-psScavenge.inline.hpp                   cardTableExtension.hpp
-psScavenge.inline.hpp                   parallelScavengeHeap.hpp
-psScavenge.inline.hpp                   psPromotionManager.hpp
-psScavenge.inline.hpp                   psScavenge.hpp
-
-pcTasks.cpp                             codeCache.hpp
-pcTasks.cpp                             collectedHeap.hpp
-pcTasks.cpp                             fprofiler.hpp
-pcTasks.cpp                             jniHandles.hpp
-pcTasks.cpp                             jvmtiExport.hpp
-pcTasks.cpp                             management.hpp
-pcTasks.cpp                             objArrayKlass.inline.hpp
-pcTasks.cpp                             psParallelCompact.hpp
-pcTasks.cpp                             pcTasks.hpp
-pcTasks.cpp                             oop.inline.hpp
-pcTasks.cpp                             oop.pcgc.inline.hpp
-pcTasks.cpp                             systemDictionary.hpp
-pcTasks.cpp                             thread.hpp
-pcTasks.cpp                             universe.hpp
-pcTasks.cpp                             vmThread.hpp
-
-pcTasks.hpp				gcTaskManager.hpp
-pcTasks.hpp				psTasks.hpp
-
-psTasks.cpp                             cardTableExtension.hpp
-psTasks.cpp                             codeCache.hpp
-psTasks.cpp                             fprofiler.hpp
-psTasks.cpp                             gcTaskManager.hpp
-psTasks.cpp                             iterator.hpp
-psTasks.cpp                             management.hpp
-psTasks.cpp                             oop.inline.hpp
-psTasks.cpp                             oop.psgc.inline.hpp
-psTasks.cpp                             psMarkSweep.hpp
-psTasks.cpp                             psPromotionManager.hpp
-psTasks.cpp                             psPromotionManager.inline.hpp
-psTasks.cpp                             psScavenge.hpp
-psTasks.cpp                             psTasks.hpp
-psTasks.cpp                             systemDictionary.hpp
-psTasks.cpp                             taskqueue.hpp
-psTasks.cpp                             thread.hpp
-psTasks.cpp                             universe.hpp
-psTasks.cpp                             vmThread.hpp
-
-psTasks.hpp                             allocation.hpp
-psTasks.hpp                             growableArray.hpp
-
-psVirtualspace.hpp			virtualspace.hpp
-
-psVirtualspace.cpp			os.hpp
-psVirtualspace.cpp                      os_<os_family>.inline.hpp
-psVirtualspace.cpp                      psVirtualspace.hpp
-psVirtualspace.cpp                      virtualspace.hpp
-
-psYoungGen.cpp                          gcUtil.hpp
-psYoungGen.cpp                          java.hpp
-psYoungGen.cpp                          oop.inline.hpp
-psYoungGen.cpp                          parallelScavengeHeap.hpp
-psYoungGen.cpp                          psMarkSweepDecorator.hpp
-psYoungGen.cpp                          psScavenge.hpp
-psYoungGen.cpp                          psYoungGen.hpp
-psYoungGen.cpp                          mutableNUMASpace.hpp
-psYoungGen.cpp                          spaceDecorator.hpp
-
-psYoungGen.hpp                          psGenerationCounters.hpp
-psYoungGen.hpp                          mutableSpace.hpp
-psYoungGen.hpp                          objectStartArray.hpp
-psYoungGen.hpp                          spaceCounters.hpp
-psYoungGen.hpp                          psVirtualspace.hpp
-
-vmPSOperations.cpp                      dtrace.hpp
-vmPSOperations.cpp                      parallelScavengeHeap.inline.hpp
-vmPSOperations.cpp                      gcLocker.inline.hpp
-vmPSOperations.cpp                      psMarkSweep.hpp
-vmPSOperations.cpp                      psScavenge.hpp
-vmPSOperations.cpp                      psScavenge.inline.hpp
-vmPSOperations.cpp                      vmPSOperations.hpp
-
-vmPSOperations.hpp                      gcCause.hpp
-vmPSOperations.hpp                      parallelScavengeHeap.hpp
-vmPSOperations.hpp                      vmGCOperations.hpp
--- a/src/share/vm/gc_implementation/includeDB_gc_serial	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-//
-// Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//   
-// This code is free software; you can redistribute it and/or modify it
-// 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//  
-//
-
-adaptiveSizePolicy.hpp			collectedHeap.hpp
-adaptiveSizePolicy.hpp			gcCause.hpp
-adaptiveSizePolicy.hpp			gcUtil.hpp
-adaptiveSizePolicy.hpp			allocation.hpp
-adaptiveSizePolicy.hpp			universe.hpp
-
-adaptiveSizePolicy.cpp			adaptiveSizePolicy.hpp
-adaptiveSizePolicy.cpp			collectorPolicy.hpp
-adaptiveSizePolicy.cpp			gcCause.hpp
-adaptiveSizePolicy.cpp			ostream.hpp
-adaptiveSizePolicy.cpp			timer.hpp
-
-ageTable.cpp                            ageTable.hpp
-ageTable.cpp				collectorPolicy.hpp
-ageTable.cpp                            copy.hpp
-ageTable.cpp                            gcPolicyCounters.hpp
-ageTable.cpp                            resourceArea.hpp
-ageTable.cpp                            sharedHeap.hpp
-
-ageTable.hpp                            markOop.hpp
-ageTable.hpp                            oop.hpp
-ageTable.hpp                            perfData.hpp
-
-collectorCounters.cpp                   collectorCounters.hpp
-collectorCounters.cpp                   resourceArea.hpp
-
-collectorCounters.hpp                   perfData.hpp
-
-cSpaceCounters.cpp                      resourceArea.hpp
-cSpaceCounters.cpp                      cSpaceCounters.hpp
-
-cSpaceCounters.hpp                      space.inline.hpp
-cSpaceCounters.hpp                      perfData.hpp
-cSpaceCounters.hpp                      generationCounters.hpp
-
-gcPolicyCounters.cpp                    resourceArea.hpp
-gcPolicyCounters.cpp                    gcPolicyCounters.hpp
-
-gcPolicyCounters.hpp                    perfData.hpp
-
-gcStats.cpp				gcStats.hpp
-gcStats.cpp				gcUtil.hpp
-
-gcStats.hpp				gcUtil.hpp
-
-gcUtil.cpp                              gcUtil.hpp
-
-gcUtil.hpp                              allocation.hpp
-gcUtil.hpp                              debug.hpp
-gcUtil.hpp                              globalDefinitions.hpp
-gcUtil.hpp                              ostream.hpp
-gcUtil.hpp				timer.hpp
-
-generationCounters.cpp                  generationCounters.hpp
-generationCounters.cpp                  resourceArea.hpp
-
-generationCounters.hpp                  perfData.hpp
-generationCounters.hpp                  virtualspace.hpp
-
-immutableSpace.hpp                      iterator.hpp
-
-liveRange.hpp                           copy.hpp
-liveRange.hpp                           memRegion.hpp
-
-markSweep.cpp                           collectedHeap.inline.hpp
-markSweep.cpp                           markSweep.inline.hpp
-markSweep.cpp                           oop.inline.hpp
-
-markSweep.hpp                           growableArray.hpp
-markSweep.hpp                           markOop.hpp
-markSweep.hpp                           oop.hpp
-markSweep.hpp                           stack.hpp
-markSweep.hpp                           timer.hpp
-markSweep.hpp                           universe.hpp
-
-markSweep.inline.hpp                    collectedHeap.hpp
-markSweep.inline.hpp                    markSweep.hpp
-markSweep.inline.hpp                    stack.inline.hpp
-
-mutableSpace.hpp                        immutableSpace.hpp
-mutableSpace.hpp                        memRegion.hpp
-mutableSpace.hpp                        copy.hpp
-
-vmGCOperations.cpp                      vmGCOperations.hpp
-vmGCOperations.cpp                      dtrace.hpp
-vmGCOperations.cpp                      classLoader.hpp
-vmGCOperations.cpp                      gcLocker.inline.hpp
-vmGCOperations.cpp                      genCollectedHeap.hpp
-vmGCOperations.cpp                      handles.inline.hpp
-vmGCOperations.cpp                      init.hpp
-vmGCOperations.cpp                      instanceKlass.hpp
-vmGCOperations.cpp                      instanceRefKlass.hpp
-vmGCOperations.cpp                      interfaceSupport.hpp
-vmGCOperations.cpp                      javaClasses.hpp
-vmGCOperations.cpp                      jvmtiExport.hpp
-vmGCOperations.cpp                      oopFactory.hpp
-vmGCOperations.cpp                      preserveException.hpp
-
-vmGCOperations.hpp                      vm_operations.hpp
-vmGCOperations.hpp                      heapInspection.hpp
-vmGCOperations.hpp                      handles.hpp
-vmGCOperations.hpp                      jniHandles.hpp
-vmGCOperations.hpp                      synchronizer.hpp
--- a/src/share/vm/gc_implementation/includeDB_gc_shared	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-//
-// Copyright (c) 2001, 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.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-concurrentGCThread.cpp                  concurrentGCThread.hpp
-concurrentGCThread.cpp                  init.hpp
-concurrentGCThread.cpp                  instanceRefKlass.hpp
-concurrentGCThread.cpp                  interfaceSupport.hpp
-concurrentGCThread.cpp                  java.hpp
-concurrentGCThread.cpp                  javaCalls.hpp
-concurrentGCThread.cpp                  oop.inline.hpp
-concurrentGCThread.cpp                  systemDictionary.hpp
-
-concurrentGCThread.hpp                  thread.hpp
-
-allocationStats.cpp                     allocationStats.hpp
-allocationStats.cpp                     ostream.hpp
-
-allocationStats.hpp                     allocation.hpp
-allocationStats.hpp                     gcUtil.hpp
-allocationStats.hpp                     globalDefinitions.hpp
-
-gcAdaptivePolicyCounters.hpp            adaptiveSizePolicy.hpp
-gcAdaptivePolicyCounters.hpp            gcPolicyCounters.hpp
-
-gcAdaptivePolicyCounters.cpp            resourceArea.hpp
-gcAdaptivePolicyCounters.cpp            gcAdaptivePolicyCounters.hpp
-
-gSpaceCounters.cpp                      generation.hpp
-gSpaceCounters.cpp                      resourceArea.hpp
-gSpaceCounters.cpp                      gSpaceCounters.hpp
-
-gSpaceCounters.hpp                      generation.hpp
-gSpaceCounters.hpp                      perfData.hpp
-gSpaceCounters.hpp                      generationCounters.hpp
-
-immutableSpace.cpp                      immutableSpace.hpp
-immutableSpace.cpp                      oop.inline.hpp
-immutableSpace.cpp                      universe.hpp
-
-isGCActiveMark.hpp                      parallelScavengeHeap.hpp
-
-markSweep.inline.hpp                    psParallelCompact.hpp
-
-mutableNUMASpace.cpp                    mutableNUMASpace.hpp
-mutableNUMASpace.cpp                    oop.inline.hpp
-mutableNUMASpace.cpp                    sharedHeap.hpp
-mutableNUMASpace.cpp                    spaceDecorator.hpp
-mutableNUMASpace.cpp                    thread_<os_family>.inline.hpp
-
-mutableNUMASpace.hpp                    mutableSpace.hpp
-mutableNUMASpace.hpp                    gcUtil.hpp
-
-mutableSpace.cpp                        mutableSpace.hpp
-mutableSpace.cpp                        oop.inline.hpp
-mutableSpace.cpp                        safepoint.hpp
-mutableSpace.cpp                        spaceDecorator.hpp
-mutableSpace.cpp                        thread.hpp
-
-spaceCounters.cpp                       resourceArea.hpp
-spaceCounters.cpp                       spaceCounters.hpp
-
-spaceCounters.hpp                       immutableSpace.hpp
-spaceCounters.hpp                       mutableSpace.hpp
-spaceCounters.hpp                       perfData.hpp
-spaceCounters.hpp                       generationCounters.hpp
-
-vmGCOperations.cpp                      g1CollectedHeap.inline.hpp
--- a/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_asParNewGeneration.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
+#include "gc_implementation/parNew/asParNewGeneration.hpp"
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/defNewGeneration.inline.hpp"
+#include "memory/referencePolicy.hpp"
+#include "oops/markOop.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
 
 ASParNewGeneration::ASParNewGeneration(ReservedSpace rs,
                                        size_t initial_byte_size,
--- a/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
+
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+
 // A Generation that does parallel young-gen collection extended
 // for adaptive size policy.
 
@@ -88,3 +94,5 @@
   // Space boundary invariant checker
   void space_invariants() PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
--- a/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_parCardTableModRefBS.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/sharedHeap.hpp"
+#include "memory/space.inline.hpp"
+#include "memory/universe.hpp"
+#include "runtime/java.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/virtualspace.hpp"
 
 void CardTableModRefBS::par_non_clean_card_iterate_work(Space* sp, MemRegion mr,
                                                         DirtyCardToOopClosure* dcto_cl,
--- a/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_parGCAllocBuffer.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parNew/parGCAllocBuffer.hpp"
+#include "memory/sharedHeap.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/oop.inline.hpp"
 
 ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) :
   _word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
--- a/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/blockOffsetTable.hpp"
+#include "memory/threadLocalAllocBuffer.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // Forward decl.
 
 class PLABStats;
@@ -237,3 +245,5 @@
     return MemRegion(_top, _true_end);
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
--- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,33 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_parNewGeneration.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#include "gc_implementation/parNew/parGCAllocBuffer.hpp"
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/parNew/parOopClosures.inline.hpp"
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/ageTable.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/defNewGeneration.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/generation.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/sharedHeap.hpp"
+#include "memory/space.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/workgroup.hpp"
 
 #ifdef _MSC_VER
 #pragma warning( push )
@@ -1033,10 +1058,11 @@
 #endif
 
 void ParNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) {
-  if ((m != markOopDesc::prototype()) &&
-      (!UseBiasedLocking || (m != markOopDesc::biased_locking_prototype()))) {
+  if (m->must_be_preserved_for_promotion_failure(obj)) {
+    // We should really have separate per-worker stacks, rather
+    // than use locking of a common pair of stacks.
     MutexLocker ml(ParGCRareEvent_lock);
-    DefNewGeneration::preserve_mark_if_necessary(obj, m);
+    preserve_mark(obj, m);
   }
 }
 
--- a/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
+
+#include "gc_implementation/parNew/parGCAllocBuffer.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "utilities/taskqueue.hpp"
+
 class ChunkArray;
 class ParScanWithoutBarrierClosure;
 class ParScanWithBarrierClosure;
@@ -422,3 +429,5 @@
 
   DEBUG_ONLY(static bool is_legal_forward_ptr(oop p);)
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
--- a/src/share/vm/gc_implementation/parNew/parOopClosures.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/parOopClosures.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
+
+#include "memory/genOopClosures.hpp"
+
 // Closures for ParNewGeneration
 
 class ParScanThreadState;
@@ -141,3 +146,5 @@
     ParallelTaskTerminator* terminator_);
   virtual void do_void();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
--- a/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_INLINE_HPP
+
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/parNew/parOopClosures.hpp"
+#include "memory/cardTableRS.hpp"
+
 template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
   assert (!oopDesc::is_null(*p), "null weak reference?");
   oop obj = oopDesc::load_decode_heap_oop_not_null(p);
@@ -107,3 +114,5 @@
 
 inline void ParScanWithoutBarrierClosure::do_oop_nv(oop* p)       { ParScanClosure::do_oop_work(p, false, false); }
 inline void ParScanWithoutBarrierClosure::do_oop_nv(narrowOop* p) { ParScanClosure::do_oop_work(p, false, false); }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_INLINE_HPP
--- a/src/share/vm/gc_implementation/parNew/vmStructs_parNew.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parNew/vmStructs_parNew.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_VMSTRUCTS_PARNEW_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_VMSTRUCTS_PARNEW_HPP
+
 #define VM_TYPES_PARNEW(declare_type)                                     \
            declare_type(ParNewGeneration,             DefNewGeneration)
 
 #define VM_INT_CONSTANTS_PARNEW(declare_constant)                         \
   declare_constant(Generation::ParNew)
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_VMSTRUCTS_PARNEW_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_adjoiningGenerations.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/adjoiningGenerations.hpp"
+#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
 
 // If boundary moving is being used, create the young gen and old
 // gen with ASPSYoungGen and ASPSOldGen, respectively.  Revert to
--- a/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP
+
+#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp"
+#include "gc_implementation/parallelScavenge/asPSOldGen.hpp"
+#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+
 
 // Contains two generations that both use an AdjoiningVirtualSpaces.
 // The two generations are adjacent in the reserved space for the
@@ -75,3 +83,5 @@
   // for the adjoining generations.
   size_t reserved_byte_size();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_adjoiningVirtualSpaces.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp"
+#include "runtime/java.hpp"
 
 AdjoiningVirtualSpaces::AdjoiningVirtualSpaces(ReservedSpace rs,
                                                size_t min_low_byte_size,
--- a/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGVIRTUALSPACES_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGVIRTUALSPACES_HPP
+
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+
 
 // Contains two virtual spaces that each can individually span
 // most of the reserved region but committed parts of which
@@ -106,3 +111,5 @@
                   size_t init_low_byte_size,
                   size_t init_high_byte_size);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGVIRTUALSPACES_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_asPSOldGen.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/asPSOldGen.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 // Whereas PSOldGen takes the maximum size of the generation
 // (which doesn't change in the case of PSOldGen) as a parameter,
--- a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSOLDGEN_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSOLDGEN_HPP
+
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "gc_implementation/shared/spaceCounters.hpp"
+
 class ASPSOldGen : public PSOldGen {
   friend class VMStructs;
   size_t _gen_size_limit;  // Largest size the generation's reserved size
@@ -55,3 +65,5 @@
   // Debugging support
   virtual const char* short_name() const { return "ASPSOldGen"; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSOLDGEN_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_asPSYoungGen.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 ASPSYoungGen::ASPSYoungGen(size_t init_byte_size,
                            size_t minimum_byte_size,
--- a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSYOUNGGEN_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSYOUNGGEN_HPP
+
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "gc_implementation/shared/spaceCounters.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+
 class ASPSYoungGen : public PSYoungGen {
   friend class VMStructs;
  private:
@@ -62,3 +73,5 @@
   // Printing support
   virtual const char* short_name() const { return "ASPSYoungGen"; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSYOUNGGEN_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_cardTableExtension.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/cardTableExtension.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psTasks.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.psgc.inline.hpp"
 
 // Checks an individual oop for missing precise marks. Mark
 // may be either dirty or newgen.
--- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP
+
+#include "memory/cardTableModRefBS.hpp"
+
 class MutableSpace;
 class ObjectStartArray;
 class PSPromotionManager;
@@ -108,3 +113,5 @@
 
 #endif // ASSERT
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_gcTaskManager.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskThread.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/mutexLocker.hpp"
 
 //
 // GCTask
--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP
+
+#include "runtime/mutex.hpp"
+#include "utilities/growableArray.hpp"
+
 //
 // The GCTaskManager is a queue of GCTasks, and accessors
 // to allow the queue to be accessed from many threads.
@@ -636,3 +642,5 @@
     return _freelist;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_gcTaskThread.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskThread.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
 
 GCTaskThread::GCTaskThread(GCTaskManager* manager,
                            uint           which,
--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKTHREAD_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKTHREAD_HPP
+
+#include "runtime/thread.hpp"
+
 // Forward declarations of classes defined here.
 class GCTaskThread;
 class GCTaskTimeStamp;
@@ -97,3 +102,5 @@
   void set_exit_time(jlong time)  { _exit_time = time; }
   void set_name(char* name)       { _name = name; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKTHREAD_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
+
+#include "memory/collectorPolicy.hpp"
+
 // There is a nice batch of tested generation sizing code in
 // TwoGenerationCollectorPolicy. Lets reuse it!
 
@@ -67,3 +72,5 @@
   size_t perm_gen_size()      { return PermSize; }
   size_t max_perm_gen_size()  { return MaxPermSize; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_objectStartArray.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 void ObjectStartArray::initialize(MemRegion reserved_region) {
   // We're based on the assumption that we use the same
--- a/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP
+
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "memory/allocation.hpp"
+#include "memory/memRegion.hpp"
+#include "oops/oop.hpp"
+
 //
 // This class can be used to locate the beginning of an object in the
 // covered region.
@@ -160,3 +168,5 @@
   // "start", the method will return true.
   bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_parMarkBitMap.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
+#include "gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/os.hpp"
+#include "utilities/bitMap.inline.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 bool
 ParMarkBitMap::initialize(MemRegion covered_region)
--- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
+
+#include "memory/memRegion.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "utilities/bitMap.inline.hpp"
+
 class oopDesc;
 class ParMarkBitMapClosure;
 
@@ -426,3 +433,5 @@
   assert(addr <= region_start() + region_size(), "addr too big");
 }
 #endif  // #ifdef ASSERT
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP
+
+#include "oops/oop.hpp"
+
 inline bool
 ParMarkBitMap::mark_obj(oop obj)
 {
  return mark_obj(obj, obj->size());
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,25 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_parallelScavengeHeap.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/adjoiningGenerations.hpp"
+#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp"
+#include "gc_implementation/parallelScavenge/cardTableExtension.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/generationSizer.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp"
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/vmPSOperations.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/vmError.hpp"
 
 PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
 PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP
+
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "utilities/ostream.hpp"
+
 class AdjoiningGenerations;
 class GCTaskManager;
 class PSAdaptiveSizePolicy;
@@ -263,3 +275,5 @@
   var = round_to(val, intra_heap_alignment());
   return var;
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP
+
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+
 inline size_t ParallelScavengeHeap::total_invocations()
 {
   return UseParallelOldGC ? PSParallelCompact::total_invocations() :
@@ -49,3 +57,5 @@
 inline bool ParallelScavengeHeap::is_in_old_or_perm(oop p) {
   return old_gen()->is_in_reserved(p) || perm_gen()->is_in_reserved(p);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_pcTasks.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/parallelScavenge/pcTasks.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/universe.hpp"
+#include "oops/objArrayKlass.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vmThread.hpp"
+#include "services/management.hpp"
 
 //
 // ThreadRootsMarkingTask
--- a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
+
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_implementation/parallelScavenge/psTasks.hpp"
+
 
 // Tasks for parallel compaction of the old generation
 //
@@ -250,3 +257,5 @@
   char* name() { return (char *)"drain-region-task"; }
   virtual void do_it(GCTaskManager* manager, uint which);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psAdaptiveSizePolicy.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/generationSizer.hpp"
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "gc_interface/gcCause.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/top.hpp"
 
 #include <math.h>
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP
+
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/gcStats.hpp"
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "gc_interface/gcCause.hpp"
+
 // This class keeps statistical information and computes the
 // optimal free space for both the young and old generation
 // based on current application characteristics (based on gc cost
@@ -384,3 +392,5 @@
   // Printing support
   virtual bool print_adaptive_size_policy_on(outputStream* st) const;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psCompactionManager.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "oops/objArrayKlass.inline.hpp"
+#include "oops/oop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#include "utilities/stack.inline.hpp"
 
 PSOldGen*            ParCompactionManager::_old_gen = NULL;
 ParCompactionManager**  ParCompactionManager::_manager_array = NULL;
--- a/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/stack.hpp"
+#include "utilities/taskqueue.hpp"
+
 // Move to some global location
 #define HAS_BEEN_MOVED 0x1501d01d
 // End move to some global location
@@ -167,3 +174,5 @@
 bool ParCompactionManager::marking_stacks_empty() const {
   return _marking_stack.is_empty() && _objarray_stack.is_empty();
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP
+
+#include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+
 void ParCompactionManager::push_objarray(oop obj, size_t index)
 {
   ObjArrayTask task(obj, index);
@@ -39,3 +45,5 @@
 #endif
   region_stack()->push(index);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_psGCAdaptivePolicyCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/arguments.hpp"
 
 
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP
+
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+
 // PSGCAdaptivePolicyCounters is a holder class for performance counters
 // that track the data and decisions for the ergonomics policy for the
 // parallel scavenge collector.
@@ -200,3 +207,5 @@
     return GCPolicyCounters::PSGCAdaptivePolicyCountersKind;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_psGenerationCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/psGenerationCounters.hpp"
+#include "memory/resourceArea.hpp"
 
 
 PSGenerationCounters::PSGenerationCounters(const char* name,
--- a/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGENERATIONCOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGENERATIONCOUNTERS_HPP
+
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "runtime/perfData.hpp"
+
 // A PSGenerationCounter is a holder class for performance counters
 // that track a generation
 
@@ -41,3 +48,5 @@
     _current_size->set_value(_ps_virtual_space->committed_size());
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGENERATIONCOUNTERS_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,34 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psMarkSweep.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/parallelScavenge/generationSizer.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "gc_interface/gcCause.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/referenceProcessor.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#include "services/management.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/events.hpp"
+#include "utilities/stack.inline.hpp"
 
 elapsedTimer        PSMarkSweep::_accumulated_time;
 unsigned int        PSMarkSweep::_total_invocations = 0;
--- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
+
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "utilities/stack.hpp"
+
 class PSAdaptiveSizePolicy;
 class PSYoungGen;
 class PSOldGen;
@@ -83,3 +90,5 @@
   // Time since last full gc (in milliseconds)
   static jlong millis_since_last_gc();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_psMarkSweepDecorator.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "gc_implementation/shared/liveRange.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "oops/oop.inline.hpp"
 
 PSMarkSweepDecorator* PSMarkSweepDecorator::_destination_decorator = NULL;
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP
+
+#include "gc_implementation/shared/mutableSpace.hpp"
+
 //
 // A PSMarkSweepDecorator is used to add "ParallelScavenge" style mark sweep operations
 // to a MutableSpace.
@@ -73,3 +78,5 @@
   void precompact();
   void compact(bool mangle_free_space);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_psOldGen.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 inline const char* PSOldGen::select_name() {
   return UseParallelOldGC ? "ParOldGen" : "PSOldGen";
--- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP
+
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/psGenerationCounters.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "gc_implementation/shared/spaceCounters.hpp"
+#include "runtime/safepoint.hpp"
+
 class PSMarkSweepDecorator;
 
 class PSOldGen : public CHeapObj {
@@ -190,3 +200,5 @@
   // Save the tops of all spaces for later use during mangling.
   void record_spaces_top() PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,39 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psParallelCompact.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/generationSizer.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp"
+#include "gc_implementation/parallelScavenge/pcTasks.hpp"
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "gc_interface/gcCause.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/referenceProcessor.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#include "services/management.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/events.hpp"
+#include "utilities/stack.inline.hpp"
 
 #include <math.h>
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
+
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
+#include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "memory/sharedHeap.hpp"
+#include "oops/oop.hpp"
+
 class ParallelScavengeHeap;
 class PSAdaptiveSizePolicy;
 class PSYoungGen;
@@ -1514,3 +1526,5 @@
 private:
   ObjectStartArray* const _start_array;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_psPermGen.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "oops/markOop.inline.hpp"
 
 PSPermGen::PSPermGen(ReservedSpace rs, size_t alignment,
                      size_t initial_size, size_t min_size, size_t max_size,
--- a/src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPERMGEN_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPERMGEN_HPP
+
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+
 class AdaptivePaddedAverage;
 
 class PSPermGen : public PSOldGen {
@@ -51,3 +56,5 @@
 
   virtual const char* name() const { return "PSPermGen"; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPERMGEN_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psPromotionLAB.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionLAB.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "oops/oop.inline.hpp"
 
 size_t PSPromotionLAB::filler_header_size;
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP
+
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "memory/allocation.hpp"
+
 //
 // PSPromotionLAB is a parallel scavenge promotion lab. This class acts very
 // much like a MutableSpace. We couldn't embed a MutableSpace, though, as
@@ -140,3 +146,5 @@
 
   debug_only(virtual bool lab_is_valid(MemRegion lab));
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,15 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psPromotionManager.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "memory/memRegion.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.psgc.inline.hpp"
 
 PSPromotionManager**         PSPromotionManager::_manager_array = NULL;
 OopStarTaskQueueSet*         PSPromotionManager::_stack_array_depth = NULL;
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP
+
+#include "gc_implementation/parallelScavenge/psPromotionLAB.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/taskqueue.hpp"
+
 //
 // psPromotionManager is used by a single thread to manage object survival
 // during a scavenge. The promotion manager contains thread local data only.
@@ -191,3 +198,5 @@
 
   TASKQUEUE_STATS_ONLY(inline void record_steal(StarTask& p);)
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
+
+#include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+
 inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
   assert(_manager_array != NULL, "access of NULL manager_array");
   assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
@@ -77,3 +83,5 @@
   }
 }
 #endif // TASKQUEUE_STATS
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,9 +22,35 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/cardTableExtension.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/generationSizer.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "gc_implementation/parallelScavenge/psTasks.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "gc_interface/gcCause.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/referenceProcessor.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.psgc.inline.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/stack.inline.hpp"
 
-# include "incls/_precompiled.incl"
-# include "incls/_psScavenge.cpp.incl"
 
 HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
 int                        PSScavenge::_consecutive_skipped_scavenges = 0;
@@ -668,6 +694,8 @@
 void PSScavenge::oop_promotion_failed(oop obj, markOop obj_mark) {
   _promotion_failed = true;
   if (obj_mark->must_be_preserved_for_promotion_failure(obj)) {
+    // Should use per-worker private stakcs hetre rather than
+    // locking a common pair of stacks.
     ThreadCritical tc;
     _preserved_oop_stack.push(obj);
     _preserved_mark_stack.push(obj_mark);
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_HPP
+
+#include "gc_implementation/parallelScavenge/cardTableExtension.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "utilities/stack.hpp"
+
 class GCTaskManager;
 class GCTaskQueue;
 class OopStack;
@@ -135,3 +145,5 @@
     return result;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP
+
+#include "gc_implementation/parallelScavenge/cardTableExtension.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+
 inline void PSScavenge::save_to_space_top_before_gc() {
   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
   _to_space_top_before_gc = heap->young_gen()->to_space()->top();
@@ -77,3 +85,5 @@
     }
   }
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psTasks.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/parallelScavenge/cardTableExtension.hpp"
+#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psTasks.hpp"
+#include "memory/iterator.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.psgc.inline.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vmThread.hpp"
+#include "services/management.hpp"
+#include "utilities/taskqueue.hpp"
 
 //
 // ScavengeRootsTask
--- a/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/growableArray.hpp"
+
 //
 // psTasks.hpp is a collection of GCTasks used by the
 // parallelScavenge collector.
@@ -144,3 +150,5 @@
 
   virtual void do_it(GCTaskManager* manager, uint which);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_psVirtualspace.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "runtime/os.hpp"
+#include "runtime/virtualspace.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 // PSVirtualSpace
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP
+
+#include "runtime/virtualspace.hpp"
+
 // VirtualSpace for the parallel scavenge collector.
 //
 // VirtualSpace is data structure for committing a previously reserved address
@@ -173,3 +178,5 @@
   _committed_low_addr = low_addr;
   _committed_high_addr = high_addr;
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_psYoungGen.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "gc_implementation/shared/mutableNUMASpace.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 PSYoungGen::PSYoungGen(size_t        initial_size,
                        size_t        min_size,
--- a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSYOUNGGEN_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSYOUNGGEN_HPP
+
+#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+#include "gc_implementation/parallelScavenge/psGenerationCounters.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "gc_implementation/shared/spaceCounters.hpp"
+
 class PSMarkSweepDecorator;
 
 class PSYoungGen : public CHeapObj {
@@ -188,3 +197,5 @@
 
   void record_spaces_top() PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSYOUNGGEN_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmPSOperations.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp"
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "gc_implementation/parallelScavenge/vmPSOperations.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "utilities/dtrace.hpp"
 
 // The following methods are used by the parallel scavenge collector
 VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
--- a/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMPSOPERATIONS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMPSOPERATIONS_HPP
+
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "gc_interface/gcCause.hpp"
+
 class VM_ParallelGCFailedAllocation: public VM_GC_Operation {
  private:
   size_t    _size;
@@ -63,3 +70,5 @@
   virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; }
   virtual void doit();
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMPSOPERATIONS_HPP
--- a/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMSTRUCTS_PARALLELGC_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMSTRUCTS_PARALLELGC_HPP
+
 #define VM_STRUCTS_PARALLELGC(nonstatic_field, \
                    static_field) \
                                                                                                                                      \
@@ -93,3 +96,5 @@
   declare_toplevel_type(ASPSOldGen*)                                      \
   declare_toplevel_type(PSPermGen*)                                       \
   declare_toplevel_type(ParallelScavengeHeap*)
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMSTRUCTS_PARALLELGC_HPP
--- a/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -21,9 +21,13 @@
  * questions.
  *
  */
-#include "incls/_precompiled.incl"
-#include "incls/_adaptiveSizePolicy.cpp.incl"
 
+#include "precompiled.hpp"
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+#include "gc_interface/gcCause.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/ostream.hpp"
 elapsedTimer AdaptiveSizePolicy::_minor_timer;
 elapsedTimer AdaptiveSizePolicy::_major_timer;
 
--- a/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_ADAPTIVESIZEPOLICY_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_ADAPTIVESIZEPOLICY_HPP
+
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/gcCause.hpp"
+#include "memory/allocation.hpp"
+#include "memory/universe.hpp"
+
 // This class keeps statistical information and computes the
 // size of the heap.
 
@@ -503,3 +512,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ADAPTIVESIZEPOLICY_HPP
--- a/src/share/vm/gc_implementation/shared/ageTable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/ageTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,17 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "gc_implementation/shared/ageTable.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/sharedHeap.hpp"
+#include "utilities/copy.hpp"
+
 /* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University.
    See the LICENSE file for license information. */
 
-# include "incls/_precompiled.incl"
-# include "incls/_ageTable.cpp.incl"
-
 ageTable::ageTable(bool global) {
 
   clear();
--- a/src/share/vm/gc_implementation/shared/ageTable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/ageTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP
+
+#include "oops/markOop.hpp"
+#include "oops/oop.hpp"
+#include "runtime/perfData.hpp"
+
 /* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University.
    See the LICENSE file for license information. */
 
@@ -64,3 +71,5 @@
  private:
   PerfVariable* _perf_sizes[table_size];
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP
--- a/src/share/vm/gc_implementation/shared/allocationStats.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/allocationStats.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_allocationStats.cpp.incl"
+#include "precompiled.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/shared/allocationStats.hpp"
+#include "utilities/ostream.hpp"
+#endif
 
 // Technically this should be derived from machine speed, and
 // ideally it would be dynamically adjusted.
--- a/src/share/vm/gc_implementation/shared/allocationStats.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/allocationStats.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/globalDefinitions.hpp"
+#endif
+
 class AllocationStats VALUE_OBJ_CLASS_SPEC {
   // A duration threshold (in ms) used to filter
   // possibly unreliable samples.
@@ -157,3 +166,5 @@
     void set_returnedBytes(size_t v) { _returnedBytes = v; }
   )
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP
--- a/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_cSpaceCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/cSpaceCounters.hpp"
+#include "memory/resourceArea.hpp"
 
 CSpaceCounters::CSpaceCounters(const char* name, int ordinal, size_t max_size,
                                ContiguousSpace* s, GenerationCounters* gc) :
--- a/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
+
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/space.inline.hpp"
+#include "runtime/perfData.hpp"
+
 // A CSpaceCounters is a holder class for performance counters
 // that track a space;
 
@@ -75,3 +82,5 @@
       return _space->used();
     }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
--- a/src/share/vm/gc_implementation/shared/collectorCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/collectorCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_collectorCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "memory/resourceArea.hpp"
 
 CollectorCounters::CollectorCounters(const char* name, int ordinal) {
 
--- a/src/share/vm/gc_implementation/shared/collectorCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/collectorCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_COLLECTORCOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_COLLECTORCOUNTERS_HPP
+
+#include "runtime/perfData.hpp"
+
 // CollectorCounters is a holder class for performance counters
 // that track a collector
 
@@ -78,3 +83,5 @@
       if (UsePerfData) _c->last_exit_counter()->set_value(os::elapsed_counter());
     }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_COLLECTORCOUNTERS_HPP
--- a/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,17 @@
  *
  */
 
-// CopyrightVersion 1.2
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/concurrentGCThread.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
 
-# include "incls/_precompiled.incl"
-# include "incls/_concurrentGCThread.cpp.incl"
+// CopyrightVersion 1.2
 
 int  ConcurrentGCThread::_CGC_flag            = CGC_nil;
 
--- a/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP
+
+#ifndef SERIALGC
+#include "runtime/thread.hpp"
+#endif
+
 class VoidClosure;
 
 // A SuspendibleThreadSet is (obviously) a set of threads that can be
@@ -165,3 +172,5 @@
   void manipulatePLL(SLT_msg_type msg);
 
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP
--- a/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_gSpaceCounters.cpp.incl"
+#include "precompiled.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/shared/gSpaceCounters.hpp"
+#include "memory/generation.hpp"
+#include "memory/resourceArea.hpp"
+#endif
 
 GSpaceCounters::GSpaceCounters(const char* name, int ordinal, size_t max_size,
                                Generation* g, GenerationCounters* gc,
--- a/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GSPACECOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GSPACECOUNTERS_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/generation.hpp"
+#include "runtime/perfData.hpp"
+#endif
+
 // A GSpaceCounter is a holder class for performance counters
 // that track a space;
 
@@ -100,3 +109,5 @@
       return _gen->used();
     }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GSPACECOUNTERS_HPP
--- a/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_gcAdaptivePolicyCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
+#include "memory/resourceArea.hpp"
 
 // This class keeps statistical information and computes the
 // size of the heap.
--- a/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCADAPTIVEPOLICYCOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCADAPTIVEPOLICYCOUNTERS_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#endif
+
 // This class keeps statistical information and computes the
 // size of the heap.
 
@@ -222,3 +230,5 @@
     return GCPolicyCounters::GCAdaptivePolicyCountersKind;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCADAPTIVEPOLICYCOUNTERS_HPP
--- a/src/share/vm/gc_implementation/shared/gcPolicyCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcPolicyCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_gcPolicyCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "memory/resourceArea.hpp"
 
 GCPolicyCounters::GCPolicyCounters(const char* name, int collectors,
                                    int generations) {
--- a/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCPOLICYCOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCPOLICYCOUNTERS_HPP
+
+#include "runtime/perfData.hpp"
+
 // GCPolicyCounters is a holder class for performance counters
 // that track a generation
 
@@ -69,3 +74,5 @@
       return GCPolicyCounters::GCPolicyCountersKind;
     }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCPOLICYCOUNTERS_HPP
--- a/src/share/vm/gc_implementation/shared/gcStats.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcStats.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_gcStats.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/gcStats.hpp"
+#include "gc_implementation/shared/gcUtil.hpp"
 
 GCStats::GCStats() {
     _avg_promoted       = new AdaptivePaddedNoZeroDevAverage(
--- a/src/share/vm/gc_implementation/shared/gcStats.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcStats.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCSTATS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCSTATS_HPP
+
+#include "gc_implementation/shared/gcUtil.hpp"
+
 class GCStats : public CHeapObj {
  protected:
   // Avg amount promoted; used for avoiding promotion undo
@@ -61,3 +66,5 @@
     return CMSGCStatsKind;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCSTATS_HPP
--- a/src/share/vm/gc_implementation/shared/gcUtil.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcUtil.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_gcUtil.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/gcUtil.hpp"
 
 // Catch-all file for utility classes
 
--- a/src/share/vm/gc_implementation/shared/gcUtil.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/gcUtil.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/ostream.hpp"
+
 // Catch-all file for utility classes
 
 // A weighted average maintains a running, weighted average
@@ -206,3 +215,5 @@
     _timer->start();
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP
--- a/src/share/vm/gc_implementation/shared/generationCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/generationCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_generationCounters.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/resourceArea.hpp"
 
 
 GenerationCounters::GenerationCounters(const char* name,
--- a/src/share/vm/gc_implementation/shared/generationCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/generationCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP
+
+#include "runtime/perfData.hpp"
+#include "runtime/virtualspace.hpp"
+
 // A GenerationCounter is a holder class for performance counters
 // that track a generation
 
@@ -60,3 +66,5 @@
 
   const char* name_space() const        { return _name_space; }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP
--- a/src/share/vm/gc_implementation/shared/immutableSpace.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/immutableSpace.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_immutableSpace.cpp.incl"
+#include "precompiled.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/shared/immutableSpace.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#endif
 
 void ImmutableSpace::initialize(MemRegion mr) {
   HeapWord* bottom = mr.start();
--- a/src/share/vm/gc_implementation/shared/immutableSpace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/immutableSpace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_IMMUTABLESPACE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_IMMUTABLESPACE_HPP
+
+#include "memory/iterator.hpp"
+
 // An ImmutableSpace is a viewport into a contiguous range
 // (or subrange) of previously allocated objects.
 
@@ -62,3 +67,5 @@
   virtual void print_short() const      PRODUCT_RETURN;
   virtual void verify(bool allow_dirty);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_IMMUTABLESPACE_HPP
--- a/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_ISGCACTIVEMARK_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_ISGCACTIVEMARK_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#endif
+
 // This class provides a method for block structured setting of the
 // _is_gc_active state without requiring accessors in CollectedHeap
 
@@ -39,3 +46,5 @@
     heap->_is_gc_active = false;
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ISGCACTIVEMARK_HPP
--- a/src/share/vm/gc_implementation/shared/liveRange.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/liveRange.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_LIVERANGE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_LIVERANGE_HPP
+
+#include "memory/memRegion.hpp"
+#include "utilities/copy.hpp"
+
 // This is a shared helper class used during phase 3 and 4 to move all the objects
 // Dead regions in a Space are linked together to keep track of the live regions
 // so that the live data can be traversed quickly without having to look at each
@@ -46,3 +52,5 @@
     Copy::aligned_conjoint_words(start(), destination, word_size());
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_LIVERANGE_HPP
--- a/src/share/vm/gc_implementation/shared/markSweep.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/markSweep.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_markSweep.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileBroker.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.inline.hpp"
+#include "oops/oop.inline.hpp"
 
 Stack<oop>              MarkSweep::_marking_stack;
 Stack<DataLayout*>      MarkSweep::_revisit_mdo_stack;
--- a/src/share/vm/gc_implementation/shared/markSweep.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/markSweep.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
+
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/universe.hpp"
+#include "oops/markOop.hpp"
+#include "oops/oop.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/stack.hpp"
+#include "utilities/taskqueue.hpp"
+
 class ReferenceProcessor;
 class DataLayout;
 
@@ -248,3 +260,5 @@
     _obj->set_mark(_mark);
   }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
--- a/src/share/vm/gc_implementation/shared/markSweep.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/markSweep.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_INLINE_HPP
+
+#include "gc_implementation/shared/markSweep.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "utilities/stack.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#endif
+
 inline void MarkSweep::mark_object(oop obj) {
   // some marks may contain information we need to preserve so we store them away
   // and overwrite the mark.  We'll restore it at the end of markSweep.
@@ -115,3 +125,5 @@
 #endif
   mark_and_push(p);
 }
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_INLINE_HPP
--- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_mutableNUMASpace.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/mutableNUMASpace.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/sharedHeap.hpp"
+#include "oops/oop.inline.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) {
--- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#endif
+
 /*
  *    The NUMA-aware allocator (MutableNUMASpace) is basically a modification
  * of MutableSpace which preserves interfaces but implements different
@@ -221,3 +229,5 @@
 
   virtual void set_top(HeapWord* value);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP
--- a/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_mutableSpace.cpp.incl"
+#include "precompiled.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/thread.hpp"
+#endif
 
 MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
   assert(MutableSpace::alignment() >= 0 &&
--- a/src/share/vm/gc_implementation/shared/mutableSpace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/mutableSpace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP
+
+#include "gc_implementation/shared/immutableSpace.hpp"
+#include "memory/memRegion.hpp"
+#include "utilities/copy.hpp"
+
 // A MutableSpace is a subtype of ImmutableSpace that supports the
 // concept of allocation. This includes the concepts that a space may
 // be only partially full, and the querry methods that go with such
@@ -136,3 +143,5 @@
   virtual void print_short_on(outputStream* st) const;
   virtual void verify(bool allow_dirty);
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP
--- a/src/share/vm/gc_implementation/shared/spaceCounters.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/spaceCounters.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_spaceCounters.cpp.incl"
+#include "precompiled.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/shared/spaceCounters.hpp"
+#include "memory/resourceArea.hpp"
+#endif
 
 SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size,
                              MutableSpace* m, GenerationCounters* gc) :
--- a/src/share/vm/gc_implementation/shared/spaceCounters.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/spaceCounters.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACECOUNTERS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACECOUNTERS_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "gc_implementation/shared/immutableSpace.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "runtime/perfData.hpp"
+#endif
+
 // A SpaceCounter is a holder class for performance counters
 // that track a space;
 
@@ -75,3 +85,5 @@
       return _m->used_in_bytes();
     }
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACECOUNTERS_HPP
--- a/src/share/vm/gc_implementation/shared/spaceDecorator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/spaceDecorator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_spaceDecorator.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/space.inline.hpp"
+#include "utilities/copy.hpp"
 
 // Catch-all file for utility classes
 
--- a/src/share/vm/gc_implementation/shared/spaceDecorator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/spaceDecorator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACEDECORATOR_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACEDECORATOR_HPP
+
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "memory/space.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 class SpaceDecorator: public AllStatic {
  public:
   // Initialization flags.
@@ -139,3 +146,5 @@
  public:
   MutableSpaceMangler(MutableSpace* sp) : SpaceMangler(), _sp(sp) {}
 };
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACEDECORATOR_HPP
--- a/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,25 @@
  * questions.
  *
  */
-# include "incls/_precompiled.incl"
-# include "incls/_vmGCOperations.cpp.incl"
 
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaClasses.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/preserveException.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#endif
 HS_DTRACE_PROBE_DECL1(hotspot, gc__begin, bool);
 HS_DTRACE_PROBE_DECL(hotspot, gc__end);
 
--- a/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
+
+#include "memory/heapInspection.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/vm_operations.hpp"
+
 // The following class hierarchy represents
 // a set of operations (VM_Operation) related to GC.
 //
@@ -199,3 +208,16 @@
   virtual void doit();
   HeapWord* result() const       { return _res; }
 };
+
+class DTraceGCProbeMarker : public StackObj {
+public:
+  DTraceGCProbeMarker(bool full) {
+    VM_GC_Operation::notify_gc_begin(full);
+  }
+
+  ~DTraceGCProbeMarker() {
+    VM_GC_Operation::notify_gc_end();
+  }
+};
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
--- a/src/share/vm/gc_interface/collectedHeap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_interface/collectedHeap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,23 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_collectedHeap.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/init.hpp"
+#include "services/heapDumper.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 #ifdef ASSERT
--- a/src/share/vm/gc_interface/collectedHeap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_interface/collectedHeap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP
+#define SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP
+
+#include "gc_interface/gcCause.hpp"
+#include "memory/allocation.hpp"
+#include "memory/barrierSet.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/perfData.hpp"
+#include "runtime/safepoint.hpp"
+
 // A "CollectedHeap" is an implementation of a java heap for HotSpot.  This
 // is an abstract class: there may be many different kinds of heaps.  This
 // class defines the functions that a heap must implement, and contains
@@ -644,3 +654,5 @@
     _heap->set_gc_cause(_previous_cause);
   }
 };
+
+#endif // SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP
--- a/src/share/vm/gc_interface/collectedHeap.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_interface/collectedHeap.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,28 @@
  *
  */
 
+#ifndef SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_INLINE_HPP
+#define SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_INLINE_HPP
+
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/threadLocalAllocBuffer.inline.hpp"
+#include "memory/universe.hpp"
+#include "oops/arrayOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/thread.hpp"
+#include "services/lowMemoryDetector.hpp"
+#include "utilities/copy.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // Inline allocation implementations.
 
 void CollectedHeap::post_allocation_setup_common(KlassHandle klass,
@@ -368,3 +390,5 @@
   reset_promotion_should_fail(&_promotion_failure_alot_count);
 }
 #endif  // #ifndef PRODUCT
+
+#endif // SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_INLINE_HPP
--- a/src/share/vm/gc_interface/gcCause.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_interface/gcCause.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_gcCause.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/gcCause.hpp"
 
 const char* GCCause::to_string(GCCause::Cause cause) {
   switch (cause) {
--- a/src/share/vm/gc_interface/gcCause.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/gc_interface/gcCause.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_GC_INTERFACE_GCCAUSE_HPP
+#define SHARE_VM_GC_INTERFACE_GCCAUSE_HPP
+
+#include "memory/allocation.hpp"
+
 //
 // This class exposes implementation details of the various
 // collector(s), and we need to be very careful with it. If
@@ -83,3 +88,5 @@
   // Return true if the GCCause is for a full collection.
   static bool is_for_full_collection(GCCause::Cause cause) PRODUCT_RETURN0;
 };
+
+#endif // SHARE_VM_GC_INTERFACE_GCCAUSE_HPP
--- a/src/share/vm/includeDB_compiler1	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,490 +0,0 @@
-//
-// Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// This code is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License version 2 only, as
-// published by the Free Software Foundation.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-allocation.hpp                          c1_globals.hpp
-
-c1_CFGPrinter.cpp                       c1_CFGPrinter.hpp
-c1_CFGPrinter.cpp                       c1_IR.hpp
-c1_CFGPrinter.cpp                       c1_InstructionPrinter.hpp
-c1_CFGPrinter.cpp                       c1_LIR.hpp
-c1_CFGPrinter.cpp                       c1_LinearScan.hpp
-c1_CFGPrinter.cpp                       c1_ValueStack.hpp
-
-c1_CFGPrinter.hpp                       c1_Compilation.hpp
-c1_CFGPrinter.hpp                       c1_Instruction.hpp
-
-cardTableModRefBS.cpp			c1_LIR.hpp
-cardTableModRefBS.cpp			c1_LIRGenerator.hpp
-
-c1_Canonicalizer.cpp                    c1_Canonicalizer.hpp
-c1_Canonicalizer.cpp                    c1_InstructionPrinter.hpp
-c1_Canonicalizer.cpp                    ciArray.hpp
-c1_Canonicalizer.cpp                    sharedRuntime.hpp
-
-c1_Canonicalizer.hpp                    c1_Instruction.hpp
-
-c1_CodeStubs.hpp                        array.hpp
-c1_CodeStubs.hpp                        c1_FrameMap.hpp
-c1_CodeStubs.hpp                        c1_IR.hpp
-c1_CodeStubs.hpp                        c1_Instruction.hpp
-c1_CodeStubs.hpp                        c1_LIR.hpp
-c1_CodeStubs.hpp                        c1_Runtime1.hpp
-
-c1_CodeStubs_<arch>.cpp                 c1_CodeStubs.hpp
-c1_CodeStubs_<arch>.cpp                 c1_FrameMap.hpp
-c1_CodeStubs_<arch>.cpp                 c1_LIRAssembler.hpp
-c1_CodeStubs_<arch>.cpp                 c1_MacroAssembler.hpp
-c1_CodeStubs_<arch>.cpp                 c1_Runtime1.hpp
-c1_CodeStubs_<arch>.cpp                 g1SATBCardTableModRefBS.hpp
-c1_CodeStubs_<arch>.cpp                 nativeInst_<arch>.hpp
-c1_CodeStubs_<arch>.cpp                 sharedRuntime.hpp
-c1_CodeStubs_<arch>.cpp                 vmreg_<arch>.inline.hpp
-
-c1_Compilation.cpp                      c1_CFGPrinter.hpp
-c1_Compilation.cpp                      c1_Compilation.hpp
-c1_Compilation.cpp                      c1_IR.hpp
-c1_Compilation.cpp                      c1_LIRAssembler.hpp
-c1_Compilation.cpp                      c1_LinearScan.hpp
-c1_Compilation.cpp                      c1_MacroAssembler.hpp
-c1_Compilation.cpp                      c1_ValueMap.hpp
-c1_Compilation.cpp                      c1_ValueStack.hpp
-c1_Compilation.cpp                      debugInfoRec.hpp
-c1_Compilation.hpp                      ciEnv.hpp
-c1_Compilation.hpp                      exceptionHandlerTable.hpp
-c1_Compilation.hpp                      resourceArea.hpp
-
-c1_Compiler.cpp                         allocation.hpp
-c1_Compiler.cpp                         allocation.inline.hpp
-c1_Compiler.cpp                         arguments.hpp
-c1_Compiler.cpp                         c1_Compilation.hpp
-c1_Compiler.cpp                         c1_Compiler.hpp
-c1_Compiler.cpp                         c1_FrameMap.hpp
-c1_Compiler.cpp                         c1_GraphBuilder.hpp
-c1_Compiler.cpp                         c1_LinearScan.hpp
-c1_Compiler.cpp                         c1_MacroAssembler.hpp
-c1_Compiler.cpp                         c1_Runtime1.hpp
-c1_Compiler.cpp                         c1_ValueType.hpp
-c1_Compiler.cpp                         compileBroker.hpp
-c1_Compiler.cpp                         compilerOracle.hpp
-c1_Compiler.cpp                         interfaceSupport.hpp
-c1_Compiler.cpp                         linkResolver.hpp
-c1_Compiler.cpp                         nativeLookup.hpp
-c1_Compiler.cpp                         resourceArea.hpp
-c1_Compiler.cpp                         sharedRuntime.hpp
-
-c1_Compiler.hpp                         abstractCompiler.hpp
-
-c1_Defs.cpp                             c1_Defs.hpp
-
-c1_Defs.hpp                             globalDefinitions.hpp
-c1_Defs.hpp                             register_<arch>.hpp
-
-c1_Defs_<arch>.hpp                      generate_platform_dependent_include
-
-c1_FpuStackSim.hpp                      allocation.hpp
-c1_FpuStackSim.hpp                      c1_FrameMap.hpp
-
-c1_FpuStackSim_<arch>.cpp               array.hpp
-c1_FpuStackSim_<arch>.cpp               c1_FpuStackSim.hpp
-c1_FpuStackSim_<arch>.cpp               c1_FrameMap.hpp
-c1_FpuStackSim_<arch>.cpp               ostream.hpp
-
-c1_FpuStackSim_<arch>.hpp               generate_platform_dependent_include
-
-c1_FrameMap.cpp                         c1_FrameMap.hpp
-c1_FrameMap.cpp                         c1_LIR.hpp
-c1_FrameMap.cpp                         sharedRuntime.hpp
-c1_FrameMap.cpp                         vmreg_<arch>.inline.hpp
-
-c1_FrameMap.hpp                         allocation.hpp
-c1_FrameMap.hpp                         assembler.hpp
-c1_FrameMap.hpp                         c1_Defs.hpp
-c1_FrameMap.hpp                         c1_LIR.hpp
-c1_FrameMap.hpp                         frame.hpp
-c1_FrameMap.hpp                         globalDefinitions.hpp
-c1_FrameMap.hpp                         synchronizer.hpp
-c1_FrameMap.hpp                         vmreg.hpp
-
-c1_FrameMap_<arch>.cpp                  c1_FrameMap.hpp
-c1_FrameMap_<arch>.cpp                  c1_LIR.hpp
-c1_FrameMap_<arch>.cpp                  sharedRuntime.hpp
-c1_FrameMap_<arch>.cpp                  vmreg_<arch>.inline.hpp
-
-c1_FrameMap_<arch>.hpp                  generate_platform_dependent_include
-
-c1_globals.cpp                          c1_globals.hpp
-
-c1_globals.hpp                          c1_globals_<arch>.hpp
-c1_globals.hpp                          c1_globals_<os_family>.hpp
-c1_globals.hpp                          globals.hpp
-
-c1_globals_<arch>.hpp                   globalDefinitions.hpp
-c1_globals_<arch>.hpp                   macros.hpp
-
-c1_globals_<os_family>.hpp              globalDefinitions.hpp
-c1_globals_<os_family>.hpp              macros.hpp
-
-c1_GraphBuilder.cpp                     bitMap.inline.hpp
-c1_GraphBuilder.cpp                     bytecode.hpp
-c1_GraphBuilder.cpp                     c1_CFGPrinter.hpp
-c1_GraphBuilder.cpp                     c1_Canonicalizer.hpp
-c1_GraphBuilder.cpp                     c1_Compilation.hpp
-c1_GraphBuilder.cpp                     c1_GraphBuilder.hpp
-c1_GraphBuilder.cpp                     c1_InstructionPrinter.hpp
-c1_GraphBuilder.cpp                     ciField.hpp
-c1_GraphBuilder.cpp                     ciKlass.hpp
-c1_GraphBuilder.cpp                     sharedRuntime.hpp
-
-c1_GraphBuilder.hpp                     c1_IR.hpp
-c1_GraphBuilder.hpp                     c1_Instruction.hpp
-c1_GraphBuilder.hpp                     c1_ValueMap.hpp
-c1_GraphBuilder.hpp                     c1_ValueStack.hpp
-c1_GraphBuilder.hpp                     ciMethodData.hpp
-c1_GraphBuilder.hpp                     ciStreams.hpp
-
-c1_IR.cpp                               bitMap.inline.hpp
-c1_IR.cpp                               c1_Compilation.hpp
-c1_IR.cpp                               c1_FrameMap.hpp
-c1_IR.cpp                               c1_GraphBuilder.hpp
-c1_IR.cpp                               c1_IR.hpp
-c1_IR.cpp                               c1_InstructionPrinter.hpp
-c1_IR.cpp                               c1_Optimizer.hpp
-
-c1_IR.hpp                               allocation.hpp
-c1_IR.hpp                               c1_Instruction.hpp
-c1_IR.hpp                               ciExceptionHandler.hpp
-c1_IR.hpp                               ciMethod.hpp
-c1_IR.hpp                               ciStreams.hpp
-
-c1_Instruction.cpp                      c1_IR.hpp
-c1_Instruction.cpp                      c1_Instruction.hpp
-c1_Instruction.cpp                      c1_InstructionPrinter.hpp
-c1_Instruction.cpp                      c1_ValueStack.hpp
-c1_Instruction.cpp                      ciObjArrayKlass.hpp
-c1_Instruction.cpp                      ciTypeArrayKlass.hpp
-
-c1_Instruction.hpp                      c1_Compilation.hpp
-c1_Instruction.hpp                      c1_LIR.hpp
-c1_Instruction.hpp                      c1_ValueType.hpp
-c1_Instruction.hpp                      ciField.hpp
-
-c1_InstructionPrinter.cpp               c1_InstructionPrinter.hpp
-c1_InstructionPrinter.cpp               c1_ValueStack.hpp
-c1_InstructionPrinter.cpp               ciArray.hpp
-c1_InstructionPrinter.cpp               ciInstance.hpp
-c1_InstructionPrinter.cpp               ciObject.hpp
-
-c1_InstructionPrinter.hpp               c1_IR.hpp
-c1_InstructionPrinter.hpp               c1_Instruction.hpp
-c1_InstructionPrinter.hpp               c1_Runtime1.hpp
-
-c1_LIR.cpp                              c1_InstructionPrinter.hpp
-c1_LIR.cpp                              c1_LIR.hpp
-c1_LIR.cpp                              c1_LIRAssembler.hpp
-c1_LIR.cpp                              ciInstance.hpp
-c1_LIR.cpp                              sharedRuntime.hpp
-
-c1_LIR.hpp                              c1_ValueType.hpp
-
-c1_LIRAssembler.cpp                     c1_Compilation.hpp
-c1_LIRAssembler.cpp                     c1_Instruction.hpp
-c1_LIRAssembler.cpp                     c1_InstructionPrinter.hpp
-c1_LIRAssembler.cpp                     c1_LIRAssembler.hpp
-c1_LIRAssembler.cpp                     c1_MacroAssembler.hpp
-c1_LIRAssembler.cpp                     c1_ValueStack.hpp
-c1_LIRAssembler.cpp                     ciInstance.hpp
-c1_LIRAssembler.cpp                     nativeInst_<arch>.hpp
-c1_LIRAssembler.cpp                     vmreg_<arch>.inline.hpp
-
-c1_LIRAssembler.hpp                     c1_CodeStubs.hpp
-c1_LIRAssembler.hpp                     ciMethodData.hpp
-c1_LIRAssembler.hpp                     methodDataOop.hpp
-c1_LIRAssembler.hpp                     top.hpp
-
-c1_LIRAssembler_<arch>.cpp              barrierSet.hpp
-c1_LIRAssembler_<arch>.cpp              c1_Compilation.hpp
-c1_LIRAssembler_<arch>.cpp              c1_LIRAssembler.hpp
-c1_LIRAssembler_<arch>.cpp              c1_MacroAssembler.hpp
-c1_LIRAssembler_<arch>.cpp              c1_Runtime1.hpp
-c1_LIRAssembler_<arch>.cpp              c1_ValueStack.hpp
-c1_LIRAssembler_<arch>.cpp              cardTableModRefBS.hpp
-c1_LIRAssembler_<arch>.cpp              ciArrayKlass.hpp
-c1_LIRAssembler_<arch>.cpp              ciInstance.hpp
-c1_LIRAssembler_<arch>.cpp              collectedHeap.hpp
-c1_LIRAssembler_<arch>.cpp              nativeInst_<arch>.hpp
-c1_LIRAssembler_<arch>.cpp              objArrayKlass.hpp
-c1_LIRAssembler_<arch>.cpp              sharedRuntime.hpp
-
-c1_LIRAssembler_<arch>.hpp              generate_platform_dependent_include
-
-c1_LIRGenerator.cpp                     bitMap.inline.hpp
-c1_LIRGenerator.cpp                     c1_Compilation.hpp
-c1_LIRGenerator.cpp                     c1_FrameMap.hpp
-c1_LIRGenerator.cpp                     c1_Instruction.hpp
-c1_LIRGenerator.cpp                     c1_LIRAssembler.hpp
-c1_LIRGenerator.cpp                     c1_LIRGenerator.hpp
-c1_LIRGenerator.cpp                     c1_ValueStack.hpp
-c1_LIRGenerator.cpp                     ciArrayKlass.hpp
-c1_LIRGenerator.cpp                     ciCPCache.hpp
-c1_LIRGenerator.cpp                     ciInstance.hpp
-c1_LIRGenerator.cpp                     heapRegion.hpp
-c1_LIRGenerator.cpp                     sharedRuntime.hpp
-c1_LIRGenerator.cpp                     stubRoutines.hpp
-
-c1_LIRGenerator.hpp                     c1_Instruction.hpp
-c1_LIRGenerator.hpp                     c1_LIR.hpp
-c1_LIRGenerator.hpp                     ciMethodData.hpp
-c1_LIRGenerator.hpp                     sizes.hpp
-
-c1_LIRGenerator_<arch>.cpp             c1_Compilation.hpp
-c1_LIRGenerator_<arch>.cpp             c1_FrameMap.hpp
-c1_LIRGenerator_<arch>.cpp             c1_Instruction.hpp
-c1_LIRGenerator_<arch>.cpp             c1_LIRAssembler.hpp
-c1_LIRGenerator_<arch>.cpp             c1_LIRGenerator.hpp
-c1_LIRGenerator_<arch>.cpp             c1_Runtime1.hpp
-c1_LIRGenerator_<arch>.cpp             c1_ValueStack.hpp
-c1_LIRGenerator_<arch>.cpp             ciArray.hpp
-c1_LIRGenerator_<arch>.cpp             ciObjArrayKlass.hpp
-c1_LIRGenerator_<arch>.cpp             ciTypeArrayKlass.hpp
-c1_LIRGenerator_<arch>.cpp             sharedRuntime.hpp
-c1_LIRGenerator_<arch>.cpp             vmreg_<arch>.inline.hpp
-c1_LIRGenerator_<arch>.cpp             stubRoutines.hpp
-
-
-c1_LinearScan.cpp                       bitMap.inline.hpp
-c1_LinearScan.cpp                       c1_CFGPrinter.hpp
-c1_LinearScan.cpp                       c1_CodeStubs.hpp
-c1_LinearScan.cpp                       c1_Compilation.hpp
-c1_LinearScan.cpp                       c1_FrameMap.hpp
-c1_LinearScan.cpp                       c1_IR.hpp
-c1_LinearScan.cpp                       c1_LIRGenerator.hpp
-c1_LinearScan.cpp                       c1_LinearScan.hpp
-c1_LinearScan.cpp                       c1_ValueStack.hpp
-c1_LinearScan.cpp                       vmreg_<arch>.inline.hpp
-
-c1_LinearScan.hpp                       c1_FpuStackSim.hpp
-c1_LinearScan.hpp                       c1_FrameMap.hpp
-c1_LinearScan.hpp                       c1_IR.hpp
-c1_LinearScan.hpp                       c1_Instruction.hpp
-c1_LinearScan.hpp                       c1_LIR.hpp
-c1_LinearScan.hpp                       c1_LIRGenerator.hpp
-
-c1_LinearScan_<arch>.cpp                bitMap.inline.hpp
-c1_LinearScan_<arch>.cpp                c1_Instruction.hpp
-c1_LinearScan_<arch>.cpp                c1_LinearScan.hpp
-
-c1_LinearScan_<arch>.hpp                generate_platform_dependent_include
-
-c1_MacroAssembler.hpp                   assembler.hpp
-c1_MacroAssembler.hpp                   assembler_<arch>.inline.hpp
-
-c1_MacroAssembler_<arch>.cpp            arrayOop.hpp
-c1_MacroAssembler_<arch>.cpp            basicLock.hpp
-c1_MacroAssembler_<arch>.cpp            biasedLocking.hpp
-c1_MacroAssembler_<arch>.cpp            c1_MacroAssembler.hpp
-c1_MacroAssembler_<arch>.cpp            c1_Runtime1.hpp
-c1_MacroAssembler_<arch>.cpp            collectedHeap.hpp
-c1_MacroAssembler_<arch>.cpp            interpreter.hpp
-c1_MacroAssembler_<arch>.cpp            markOop.hpp
-c1_MacroAssembler_<arch>.cpp            os.hpp
-c1_MacroAssembler_<arch>.cpp            stubRoutines.hpp
-c1_MacroAssembler_<arch>.cpp            systemDictionary.hpp
-
-c1_MacroAssembler_<arch>.hpp            generate_platform_dependent_include
-
-c1_Optimizer.cpp                        bitMap.inline.hpp
-c1_Optimizer.cpp                        c1_Canonicalizer.hpp
-c1_Optimizer.cpp                        c1_Optimizer.hpp
-c1_Optimizer.cpp                        c1_ValueMap.hpp
-c1_Optimizer.cpp                        c1_ValueSet.hpp
-c1_Optimizer.cpp                        c1_ValueStack.hpp
-
-c1_Optimizer.hpp                        allocation.hpp
-c1_Optimizer.hpp                        c1_IR.hpp
-c1_Optimizer.hpp                        c1_Instruction.hpp
-
-c1_Runtime1.cpp                         allocation.inline.hpp
-c1_Runtime1.cpp                         barrierSet.hpp
-c1_Runtime1.cpp                         biasedLocking.hpp
-c1_Runtime1.cpp                         bytecode.hpp
-c1_Runtime1.cpp                         c1_CodeStubs.hpp
-c1_Runtime1.cpp                         c1_Defs.hpp
-c1_Runtime1.cpp                         c1_FrameMap.hpp
-c1_Runtime1.cpp                         c1_LIRAssembler.hpp
-c1_Runtime1.cpp                         c1_MacroAssembler.hpp
-c1_Runtime1.cpp                         c1_Runtime1.hpp
-c1_Runtime1.cpp                         codeBlob.hpp
-c1_Runtime1.cpp                         codeBuffer.hpp
-c1_Runtime1.cpp                         collectedHeap.hpp
-c1_Runtime1.cpp                         compilationPolicy.hpp
-c1_Runtime1.cpp                         compiledIC.hpp
-c1_Runtime1.cpp                         copy.hpp
-c1_Runtime1.cpp                         disassembler.hpp
-c1_Runtime1.cpp                         events.hpp
-c1_Runtime1.cpp                         interfaceSupport.hpp
-c1_Runtime1.cpp                         interpreter.hpp
-c1_Runtime1.cpp                         javaCalls.hpp
-c1_Runtime1.cpp                         objArrayKlass.hpp
-c1_Runtime1.cpp                         oop.inline.hpp
-c1_Runtime1.cpp                         oopFactory.hpp
-c1_Runtime1.cpp                         pcDesc.hpp
-c1_Runtime1.cpp                         resourceArea.hpp
-c1_Runtime1.cpp                         scopeDesc.hpp
-c1_Runtime1.cpp                         sharedRuntime.hpp
-c1_Runtime1.cpp                         systemDictionary.hpp
-c1_Runtime1.cpp                         threadCritical.hpp
-c1_Runtime1.cpp                         vframe.hpp
-c1_Runtime1.cpp                         vframeArray.hpp
-c1_Runtime1.cpp                         vmSymbols.hpp
-c1_Runtime1.cpp                         vtableStubs.hpp
-
-c1_Runtime1.hpp                         allocation.hpp
-c1_Runtime1.hpp                         c1_FrameMap.hpp
-c1_Runtime1.hpp                         deoptimization.hpp
-c1_Runtime1.hpp                         interpreter.hpp
-c1_Runtime1.hpp                         stubs.hpp
-
-c1_Runtime1_<arch>.cpp                  c1_Defs.hpp
-c1_Runtime1_<arch>.cpp                  c1_MacroAssembler.hpp
-c1_Runtime1_<arch>.cpp                  c1_Runtime1.hpp
-c1_Runtime1_<arch>.cpp                  compiledICHolderOop.hpp
-c1_Runtime1_<arch>.cpp                  interpreter.hpp
-c1_Runtime1_<arch>.cpp                  jvmtiExport.hpp
-c1_Runtime1_<arch>.cpp                  nativeInst_<arch>.hpp
-c1_Runtime1_<arch>.cpp                  oop.inline.hpp
-c1_Runtime1_<arch>.cpp                  register_<arch>.hpp
-c1_Runtime1_<arch>.cpp                  sharedRuntime.hpp
-c1_Runtime1_<arch>.cpp                  signature.hpp
-c1_Runtime1_<arch>.cpp                  vframeArray.hpp
-c1_Runtime1_<arch>.cpp                  vmreg_<arch>.inline.hpp
-
-c1_ValueMap.cpp                         bitMap.inline.hpp
-c1_ValueMap.cpp                         c1_Canonicalizer.hpp
-c1_ValueMap.cpp                         c1_IR.hpp
-c1_ValueMap.cpp                         c1_ValueMap.hpp
-
-c1_ValueMap.hpp                         allocation.hpp
-c1_ValueMap.hpp                         c1_Instruction.hpp
-c1_ValueMap.hpp                         c1_ValueSet.hpp
-
-c1_ValueSet.cpp                         c1_ValueSet.hpp
-
-c1_ValueSet.hpp                         allocation.hpp
-c1_ValueSet.hpp                         bitMap.inline.hpp
-c1_ValueSet.hpp                         c1_Instruction.hpp
-
-c1_ValueStack.cpp                       c1_IR.hpp
-c1_ValueStack.cpp                       c1_InstructionPrinter.hpp
-c1_ValueStack.cpp                       c1_ValueStack.hpp
-
-c1_ValueStack.hpp                       c1_Instruction.hpp
-c1_ValueType.cpp                        c1_ValueType.hpp
-c1_ValueType.cpp                        ciArray.hpp
-c1_ValueType.cpp                        ciInstance.hpp
-c1_ValueType.cpp                        ciNullObject.hpp
-
-c1_ValueType.hpp                        c1_Compilation.hpp
-c1_ValueType.hpp                        ciConstant.hpp
-
-ciEnv.cpp                               c1_Runtime1.hpp
-
-codeBlob.cpp                            c1_Runtime1.hpp
-
-compileBroker.cpp                       c1_Compiler.hpp
-
-frame_<arch>.cpp                        c1_Runtime1.hpp
-frame_<arch>.cpp                        vframeArray.hpp
-
-globals.cpp                             c1_globals.hpp
-
-globals.hpp                             c1_globals_<arch>.hpp
-globals.hpp                             c1_globals_<os_family>.hpp
-
-instanceKlass.cpp                       c1_Compiler.hpp
-
-interpreter_<arch_model>.cpp            c1_Runtime1.hpp
-
-java.cpp                                c1_Compiler.hpp
-java.cpp                                c1_Runtime1.hpp
-
-nativeInst_<arch>.cpp                   c1_Runtime1.hpp
-
-oopMap.cpp                              c1_Defs.hpp
-
-os_<os_family>.cpp                      c1_Runtime1.hpp
-
-os_<os_arch>.cpp                        c1_Runtime1.hpp
-
-safepoint.cpp                           c1_globals.hpp
-
-sharedRuntime.cpp                       c1_Runtime1.hpp
-
-sharedRuntime_<arch_model>.cpp          c1_Runtime1.hpp
-
-thread.cpp                              c1_Compiler.hpp
-
-top.hpp                                 c1_globals.hpp
-
-vmStructs.hpp                           c1_Runtime1.hpp
-
-compileBroker.cpp                       c1x_Compiler.hpp
-c1_Canonicalizer.cpp                    c1_ValueStack.hpp
-
-c1x_CodeInstaller.hpp                   c1x_Compiler.hpp
-
-c1x_CodeInstaller.cpp                   c1x_CodeInstaller.hpp
-c1x_CodeInstaller.cpp                   c1x_Compiler.hpp
-c1x_CodeInstaller.cpp                   c1x_TargetMethod.hpp
-c1x_CodeInstaller.cpp                   c1x_VmIds.hpp
-c1x_CodeInstaller.cpp                   c1_Runtime1.hpp
-c1x_CodeInstaller.cpp                   vmreg.hpp
-c1x_CodeInstaller.cpp                   vmreg_<arch>.inline.hpp
-
-c1x_Compiler.hpp                        abstractCompiler.hpp
-
-c1x_Compiler.cpp                        c1x_Compiler.hpp
-c1x_Compiler.cpp                        c1x_TargetMethod.hpp
-c1x_Compiler.cpp                        c1x_VMExits.hpp
-c1x_Compiler.cpp                        c1x_VMEntries.hpp
-c1x_Compiler.cpp                        c1x_VmIds.hpp
-
-c1x_TargetMethod.cpp                    c1x_TargetMethod.hpp
-
-c1x_VMEntries.cpp                       c1x_CodeInstaller.hpp
-c1x_VMEntries.cpp                       c1x_VMEntries.hpp
-c1x_VMEntries.cpp                       c1x_Compiler.hpp
-c1x_VMEntries.cpp                       c1x_TargetMethod.hpp
-c1x_VMEntries.cpp                       c1x_VMExits.hpp
-c1x_VMEntries.cpp                       c1x_VmIds.hpp
-c1x_VMEntries.cpp                       oopFactory.hpp
-c1x_VMEntries.cpp                       c1_Runtime1.hpp
-
-c1x_VMExits.cpp                         c1x_Compiler.hpp
-c1x_VMExits.cpp                         javaCalls.hpp
-c1x_VMExits.cpp                         c1x_VMExits.hpp
-
-c1x_VmIds.cpp                           c1x_VmIds.hpp
-
-c1_LIR.cpp                              c1_ValueStack.hpp
--- a/src/share/vm/includeDB_compiler2	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1164 +0,0 @@
-//
-// Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// This code is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License version 2 only, as
-// published by the Free Software Foundation.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//
-//
-
-ad_<arch_model>.cpp                     adGlobals_<arch_model>.hpp
-ad_<arch_model>.cpp                     ad_<arch_model>.hpp
-ad_<arch_model>.cpp                     allocation.inline.hpp
-ad_<arch_model>.cpp                     assembler.hpp
-ad_<arch_model>.cpp                     assembler_<arch>.inline.hpp
-ad_<arch_model>.cpp                     biasedLocking.hpp
-ad_<arch_model>.cpp                     cfgnode.hpp
-ad_<arch_model>.cpp                     collectedHeap.inline.hpp
-ad_<arch_model>.cpp                     compiledICHolderOop.hpp
-ad_<arch_model>.cpp                     growableArray.hpp
-ad_<arch_model>.cpp                     locknode.hpp
-ad_<arch_model>.cpp                     markOop.hpp
-ad_<arch_model>.cpp                     methodOop.hpp
-ad_<arch_model>.cpp                     nativeInst_<arch>.hpp
-ad_<arch_model>.cpp                     oop.inline.hpp
-ad_<arch_model>.cpp                     oop.inline2.hpp
-ad_<arch_model>.cpp                     opcodes.hpp
-ad_<arch_model>.cpp                     regalloc.hpp
-ad_<arch_model>.cpp                     regmask.hpp
-ad_<arch_model>.cpp                     runtime.hpp
-ad_<arch_model>.cpp                     sharedRuntime.hpp
-ad_<arch_model>.cpp                     stubRoutines.hpp
-ad_<arch_model>.cpp                     vmreg.hpp
-ad_<arch_model>.cpp                     vmreg_<arch>.inline.hpp
-
-ad_<arch_model>.hpp                     addnode.hpp
-ad_<arch_model>.hpp                     machnode.hpp
-ad_<arch_model>.hpp                     matcher.hpp
-ad_<arch_model>.hpp                     opcodes.hpp
-ad_<arch_model>.hpp                     regalloc.hpp
-ad_<arch_model>.hpp                     resourceArea.hpp
-ad_<arch_model>.hpp                     subnode.hpp
-ad_<arch_model>.hpp                     vectornode.hpp
-
-ad_<arch_model>_clone.cpp               ad_<arch_model>.hpp
-
-ad_<arch_model>_expand.cpp              ad_<arch_model>.hpp
-
-ad_<arch_model>_format.cpp              ad_<arch_model>.hpp
-
-ad_<arch_model>_gen.cpp                 ad_<arch_model>.hpp
-ad_<arch_model>_gen.cpp                 cfgnode.hpp
-ad_<arch_model>_gen.cpp                 locknode.hpp
-
-ad_<arch_model>_misc.cpp                ad_<arch_model>.hpp
-
-ad_<arch_model>_peephole.cpp            ad_<arch_model>.hpp
-
-ad_<arch_model>_pipeline.cpp            ad_<arch_model>.hpp
-
-addnode.cpp                             addnode.hpp
-addnode.cpp                             allocation.inline.hpp
-addnode.cpp                             cfgnode.hpp
-addnode.cpp                             connode.hpp
-addnode.cpp                             machnode.hpp
-addnode.cpp                             mulnode.hpp
-addnode.cpp                             phaseX.hpp
-addnode.cpp                             subnode.hpp
-
-addnode.hpp                             node.hpp
-addnode.hpp                             opcodes.hpp
-addnode.hpp                             type.hpp
-
-adlcVMDeps.hpp                          allocation.hpp
-
-allocation.hpp                          c2_globals.hpp
-
-bcEscapeAnalyzer.cpp                    bcEscapeAnalyzer.hpp
-bcEscapeAnalyzer.cpp                    bitMap.inline.hpp
-bcEscapeAnalyzer.cpp                    bytecode.hpp
-bcEscapeAnalyzer.cpp                    ciConstant.hpp
-bcEscapeAnalyzer.cpp                    ciField.hpp
-bcEscapeAnalyzer.cpp                    ciMethodBlocks.hpp
-bcEscapeAnalyzer.cpp                    ciStreams.hpp
-
-bcEscapeAnalyzer.hpp                    allocation.hpp
-bcEscapeAnalyzer.hpp                    ciMethod.hpp
-bcEscapeAnalyzer.hpp                    ciMethodData.hpp
-bcEscapeAnalyzer.hpp                    dependencies.hpp
-bcEscapeAnalyzer.hpp                    growableArray.hpp
-bcEscapeAnalyzer.hpp                    vectset.hpp
-
-block.cpp                               allocation.inline.hpp
-block.cpp                               block.hpp
-block.cpp                               cfgnode.hpp
-block.cpp                               chaitin.hpp
-block.cpp                               copy.hpp
-block.cpp                               loopnode.hpp
-block.cpp                               machnode.hpp
-block.cpp                               matcher.hpp
-block.cpp                               opcodes.hpp
-block.cpp                               rootnode.hpp
-block.cpp                               vectset.hpp
-
-block.hpp                               multnode.hpp
-block.hpp                               node.hpp
-block.hpp                               phase.hpp
-
-buildOopMap.cpp                         addnode.hpp
-buildOopMap.cpp                         callnode.hpp
-buildOopMap.cpp                         compile.hpp
-buildOopMap.cpp                         machnode.hpp
-buildOopMap.cpp                         matcher.hpp
-buildOopMap.cpp                         oopMap.hpp
-buildOopMap.cpp                         phase.hpp
-buildOopMap.cpp                         regalloc.hpp
-buildOopMap.cpp                         rootnode.hpp
-buildOopMap.cpp                         vmreg_<arch>.inline.hpp
-
-bytecodeInfo.cpp                        callGenerator.hpp
-bytecodeInfo.cpp                        compileLog.hpp
-bytecodeInfo.cpp                        handles.inline.hpp
-bytecodeInfo.cpp                        linkResolver.hpp
-bytecodeInfo.cpp                        objArrayKlass.hpp
-bytecodeInfo.cpp                        parse.hpp
-bytecodeInfo.cpp                        systemDictionary.hpp
-bytecodeInfo.cpp                        vmSymbols.hpp
-
-bytecodeInterpreter.hpp                 methodDataOop.hpp
-
-c2_globals.cpp                          c2_globals.hpp
-
-c2_globals.hpp                          c2_globals_<arch>.hpp
-c2_globals.hpp                          c2_globals_<os_family>.hpp
-c2_globals.hpp                          globals.hpp
-
-c2_globals_<arch>.hpp                   globalDefinitions.hpp
-c2_globals_<arch>.hpp                   macros.hpp
-
-c2_globals_<os_family>.hpp              globalDefinitions.hpp
-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
-c2compiler.cpp                          runtime.hpp
-
-c2compiler.hpp                          abstractCompiler.hpp
-
-callGenerator.cpp                       addnode.hpp
-callGenerator.cpp                       bcEscapeAnalyzer.hpp
-callGenerator.cpp                       callGenerator.hpp
-callGenerator.cpp                       callnode.hpp
-callGenerator.cpp                       cfgnode.hpp
-callGenerator.cpp                       compileLog.hpp
-callGenerator.cpp                       connode.hpp
-callGenerator.cpp                       ciCPCache.hpp
-callGenerator.cpp                       ciMethodHandle.hpp
-callGenerator.cpp                       javaClasses.hpp
-callGenerator.cpp                       parse.hpp
-callGenerator.cpp                       rootnode.hpp
-callGenerator.cpp                       runtime.hpp
-callGenerator.cpp                       subnode.hpp
-
-callGenerator.hpp                       callnode.hpp
-callGenerator.hpp                       compile.hpp
-callGenerator.hpp                       deoptimization.hpp
-callGenerator.hpp                       type.hpp
-
-callnode.cpp                            callnode.hpp
-callnode.cpp                            bcEscapeAnalyzer.hpp
-callnode.cpp                            escape.hpp
-callnode.cpp                            locknode.hpp
-callnode.cpp                            machnode.hpp
-callnode.cpp                            matcher.hpp
-callnode.cpp                            oopMap.hpp
-callnode.cpp                            parse.hpp
-callnode.cpp                            regalloc.hpp
-callnode.cpp                            regmask.hpp
-callnode.cpp                            rootnode.hpp
-callnode.cpp                            runtime.hpp
-
-callnode.hpp                            connode.hpp
-callnode.hpp                            mulnode.hpp
-callnode.hpp                            multnode.hpp
-callnode.hpp                            opcodes.hpp
-callnode.hpp                            phaseX.hpp
-callnode.hpp                            type.hpp
-
-cfgnode.cpp                             addnode.hpp
-cfgnode.cpp                             allocation.inline.hpp
-cfgnode.cpp                             cfgnode.hpp
-cfgnode.cpp                             connode.hpp
-cfgnode.cpp                             loopnode.hpp
-cfgnode.cpp                             machnode.hpp
-cfgnode.cpp                             mulnode.hpp
-cfgnode.cpp                             objArrayKlass.hpp
-cfgnode.cpp                             phaseX.hpp
-cfgnode.cpp                             regmask.hpp
-cfgnode.cpp                             runtime.hpp
-cfgnode.cpp                             subnode.hpp
-cfgnode.cpp                             systemDictionary.hpp
-
-cfgnode.hpp                             multnode.hpp
-cfgnode.hpp                             node.hpp
-cfgnode.hpp                             opcodes.hpp
-cfgnode.hpp                             type.hpp
-
-chaitin.cpp                             addnode.hpp
-chaitin.cpp                             allocation.inline.hpp
-chaitin.cpp                             block.hpp
-chaitin.cpp                             callnode.hpp
-chaitin.cpp                             cfgnode.hpp
-chaitin.cpp                             chaitin.hpp
-chaitin.cpp                             coalesce.hpp
-chaitin.cpp                             compileLog.hpp
-chaitin.cpp                             connode.hpp
-chaitin.cpp                             indexSet.hpp
-chaitin.cpp                             machnode.hpp
-chaitin.cpp                             memnode.hpp
-chaitin.cpp                             oopMap.hpp
-chaitin.cpp                             opcodes.hpp
-chaitin.cpp                             rootnode.hpp
-
-chaitin.hpp                             connode.hpp
-chaitin.hpp                             live.hpp
-chaitin.hpp                             matcher.hpp
-chaitin.hpp                             phase.hpp
-chaitin.hpp                             port.hpp
-chaitin.hpp                             regalloc.hpp
-chaitin.hpp                             regmask.hpp
-chaitin.hpp                             resourceArea.hpp
-chaitin.hpp                             vmreg.hpp
-
-chaitin_<os_family>.cpp                 chaitin.hpp
-chaitin_<os_family>.cpp                 machnode.hpp
-
-ciEnv.cpp                               compileLog.hpp
-ciEnv.cpp                               runtime.hpp
-
-ciMethod.cpp                            bcEscapeAnalyzer.hpp
-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.hpp                          ciEnv.hpp
-ciTypeFlow.hpp                          ciKlass.hpp
-ciTypeFlow.hpp                          ciMethodBlocks.hpp
-
-classes.cpp                             addnode.hpp
-classes.cpp                             callnode.hpp
-classes.cpp                             cfgnode.hpp
-classes.cpp                             connode.hpp
-classes.cpp                             divnode.hpp
-classes.cpp                             locknode.hpp
-classes.cpp                             loopnode.hpp
-classes.cpp                             machnode.hpp
-classes.cpp                             memnode.hpp
-classes.cpp                             mulnode.hpp
-classes.cpp                             multnode.hpp
-classes.cpp                             node.hpp
-classes.cpp                             rootnode.hpp
-classes.cpp                             subnode.hpp
-classes.cpp                             vectornode.hpp
-
-classes.hpp                             top.hpp
-
-coalesce.cpp                            allocation.inline.hpp
-coalesce.cpp                            block.hpp
-coalesce.cpp                            cfgnode.hpp
-coalesce.cpp                            chaitin.hpp
-coalesce.cpp                            coalesce.hpp
-coalesce.cpp                            connode.hpp
-coalesce.cpp                            indexSet.hpp
-coalesce.cpp                            machnode.hpp
-coalesce.cpp                            matcher.hpp
-coalesce.cpp                            regmask.hpp
-
-coalesce.hpp                            phase.hpp
-
-compile.cpp                             ad_<arch_model>.hpp
-compile.cpp                             addnode.hpp
-compile.cpp                             arguments.hpp
-compile.cpp                             assembler.hpp
-compile.cpp                             block.hpp
-compile.cpp                             c2compiler.hpp
-compile.cpp                             callGenerator.hpp
-compile.cpp                             callnode.hpp
-compile.cpp                             cfgnode.hpp
-compile.cpp                             chaitin.hpp
-compile.cpp                             compile.hpp
-compile.cpp                             compileLog.hpp
-compile.cpp                             connode.hpp
-compile.cpp                             copy.hpp
-compile.cpp                             divnode.hpp
-compile.cpp                             escape.hpp
-compile.cpp                             exceptionHandlerTable.hpp
-compile.cpp                             loopnode.hpp
-compile.cpp                             machnode.hpp
-compile.cpp                             macro.hpp
-compile.cpp                             matcher.hpp
-compile.cpp                             memnode.hpp
-compile.cpp                             mulnode.hpp
-compile.cpp                             nmethod.hpp
-compile.cpp                             node.hpp
-compile.cpp                             oopMap.hpp
-compile.cpp                             opcodes.hpp
-compile.cpp                             output.hpp
-compile.cpp                             parse.hpp
-compile.cpp                             phaseX.hpp
-compile.cpp                             rootnode.hpp
-compile.cpp                             runtime.hpp
-compile.cpp                             signature.hpp
-compile.cpp                             stringopts.hpp
-compile.cpp                             stubRoutines.hpp
-compile.cpp                             systemDictionary.hpp
-compile.cpp                             timer.hpp
-compile.cpp                             type.hpp
-compile.cpp                             vectornode.hpp
-
-compile.hpp                             codeBuffer.hpp
-compile.hpp                             compilerInterface.hpp
-compile.hpp                             compilerOracle.hpp
-compile.hpp                             debugInfoRec.hpp
-compile.hpp                             deoptimization.hpp
-compile.hpp                             dict.hpp
-compile.hpp                             exceptionHandlerTable.hpp
-compile.hpp                             idealGraphPrinter.hpp
-compile.hpp                             phase.hpp
-compile.hpp                             port.hpp
-compile.hpp                             regmask.hpp
-compile.hpp                             resourceArea.hpp
-compile.hpp                             vectset.hpp
-compile.hpp                             vmThread.hpp
-
-compileBroker.cpp                       c2compiler.hpp
-
-connode.cpp                             addnode.hpp
-connode.cpp                             allocation.inline.hpp
-connode.cpp                             compile.hpp
-connode.cpp                             connode.hpp
-connode.cpp                             machnode.hpp
-connode.cpp                             matcher.hpp
-connode.cpp                             memnode.hpp
-connode.cpp                             phaseX.hpp
-connode.cpp                             sharedRuntime.hpp
-connode.cpp                             subnode.hpp
-
-connode.hpp                             node.hpp
-connode.hpp                             opcodes.hpp
-connode.hpp                             type.hpp
-
-deoptimization.cpp                      ad_<arch_model>.hpp
-
-dfa_<arch_model>.cpp                    ad_<arch_model>.hpp
-dfa_<arch_model>.cpp                    matcher.hpp
-dfa_<arch_model>.cpp                    opcodes.hpp
-
-dict.cpp                                allocation.inline.hpp
-dict.cpp                                dict.hpp
-dict.cpp                                resourceArea.hpp
-dict.cpp                                thread.hpp
-
-dict.hpp                                port.hpp
-
-divnode.cpp                             addnode.hpp
-divnode.cpp                             allocation.inline.hpp
-divnode.cpp                             connode.hpp
-divnode.cpp                             divnode.hpp
-divnode.cpp                             machnode.hpp
-divnode.cpp                             matcher.hpp
-divnode.cpp                             mulnode.hpp
-divnode.cpp                             phaseX.hpp
-divnode.cpp                             subnode.hpp
-
-divnode.hpp                             multnode.hpp
-divnode.hpp                             node.hpp
-divnode.hpp                             opcodes.hpp
-divnode.hpp                             type.hpp
-
-doCall.cpp                              addnode.hpp
-doCall.cpp                              callGenerator.hpp
-doCall.cpp                              ciCallSite.hpp
-doCall.cpp                              ciCPCache.hpp
-doCall.cpp                              ciMethodHandle.hpp
-doCall.cpp                              cfgnode.hpp
-doCall.cpp                              compileLog.hpp
-doCall.cpp                              linkResolver.hpp
-doCall.cpp                              mulnode.hpp
-doCall.cpp                              nativeLookup.hpp
-doCall.cpp                              parse.hpp
-doCall.cpp                              rootnode.hpp
-doCall.cpp                              runtime.hpp
-doCall.cpp                              sharedRuntime.hpp
-doCall.cpp                              subnode.hpp
-doCall.cpp                              vmSymbols.hpp
-
-domgraph.cpp                            allocation.hpp
-domgraph.cpp                            block.hpp
-domgraph.cpp                            machnode.hpp
-domgraph.cpp                            phaseX.hpp
-domgraph.cpp                            rootnode.hpp
-domgraph.cpp                            vectset.hpp
-
-escape.cpp                              allocation.hpp
-escape.cpp                              bcEscapeAnalyzer.hpp
-escape.cpp                              c2compiler.hpp
-escape.cpp                              callnode.hpp
-escape.cpp                              cfgnode.hpp
-escape.cpp                              compile.hpp
-escape.cpp                              escape.hpp
-escape.cpp                              phaseX.hpp
-escape.cpp                              rootnode.hpp
-escape.cpp                              vectset.hpp
-
-escape.hpp                              addnode.hpp
-escape.hpp                              growableArray.hpp
-escape.hpp                              node.hpp
-
-frame.hpp                               adGlobals_<arch_model>.hpp
-
-gcm.cpp                                 ad_<arch_model>.hpp
-gcm.cpp                                 allocation.inline.hpp
-gcm.cpp                                 block.hpp
-gcm.cpp                                 c2compiler.hpp
-gcm.cpp                                 callnode.hpp
-gcm.cpp                                 cfgnode.hpp
-gcm.cpp                                 deoptimization.hpp
-gcm.cpp                                 machnode.hpp
-gcm.cpp                                 opcodes.hpp
-gcm.cpp                                 phaseX.hpp
-gcm.cpp                                 rootnode.hpp
-gcm.cpp                                 runtime.hpp
-gcm.cpp                                 vectset.hpp
-
-generateOptoStub.cpp                    addnode.hpp
-generateOptoStub.cpp                    callnode.hpp
-generateOptoStub.cpp                    cfgnode.hpp
-generateOptoStub.cpp                    compile.hpp
-generateOptoStub.cpp                    connode.hpp
-generateOptoStub.cpp                    locknode.hpp
-generateOptoStub.cpp                    memnode.hpp
-generateOptoStub.cpp                    mulnode.hpp
-generateOptoStub.cpp                    node.hpp
-generateOptoStub.cpp                    parse.hpp
-generateOptoStub.cpp                    phaseX.hpp
-generateOptoStub.cpp                    rootnode.hpp
-generateOptoStub.cpp                    runtime.hpp
-generateOptoStub.cpp                    type.hpp
-
-globals.hpp                             c2_globals_<arch>.hpp
-globals.hpp                             c2_globals_<os_family>.hpp
-
-globals.cpp                             c2_globals.hpp
-
-graphKit.cpp                            addnode.hpp
-graphKit.cpp                            barrierSet.hpp
-graphKit.cpp                            cardTableModRefBS.hpp
-graphKit.cpp                            g1SATBCardTableModRefBS.hpp
-graphKit.cpp                            collectedHeap.hpp
-graphKit.cpp                            compileLog.hpp
-graphKit.cpp                            deoptimization.hpp
-graphKit.cpp                            graphKit.hpp
-graphKit.cpp                            heapRegion.hpp
-graphKit.cpp                            idealKit.hpp
-graphKit.cpp                            locknode.hpp
-graphKit.cpp                            machnode.hpp
-graphKit.cpp                            parse.hpp
-graphKit.cpp                            rootnode.hpp
-graphKit.cpp                            runtime.hpp
-graphKit.cpp                            sharedRuntime.hpp
-
-graphKit.hpp                            addnode.hpp
-graphKit.hpp                            callnode.hpp
-graphKit.hpp                            cfgnode.hpp
-graphKit.hpp                            ciEnv.hpp
-graphKit.hpp                            ciMethodData.hpp
-graphKit.hpp                            divnode.hpp
-graphKit.hpp                            compile.hpp
-graphKit.hpp                            deoptimization.hpp
-graphKit.hpp                            phaseX.hpp
-graphKit.hpp                            mulnode.hpp
-graphKit.hpp                            subnode.hpp
-graphKit.hpp                            type.hpp
-
-idealKit.cpp                            addnode.hpp
-idealKit.cpp                            callnode.hpp
-idealKit.cpp                            cfgnode.hpp
-idealKit.cpp                            idealKit.hpp
-idealKit.cpp				runtime.hpp
-
-idealKit.hpp                            addnode.hpp
-idealKit.hpp                            cfgnode.hpp
-idealKit.hpp                            connode.hpp
-idealKit.hpp                            divnode.hpp
-idealKit.hpp                            mulnode.hpp
-idealKit.hpp                            phaseX.hpp
-idealKit.hpp                            subnode.hpp
-idealKit.hpp                            type.hpp
-
-ifg.cpp                                 addnode.hpp
-ifg.cpp                                 allocation.inline.hpp
-ifg.cpp                                 block.hpp
-ifg.cpp                                 callnode.hpp
-ifg.cpp                                 cfgnode.hpp
-ifg.cpp                                 chaitin.hpp
-ifg.cpp                                 coalesce.hpp
-ifg.cpp                                 connode.hpp
-ifg.cpp                                 indexSet.hpp
-ifg.cpp                                 machnode.hpp
-ifg.cpp                                 memnode.hpp
-ifg.cpp                                 oopMap.hpp
-ifg.cpp                                 opcodes.hpp
-
-ifnode.cpp                              addnode.hpp
-ifnode.cpp                              allocation.inline.hpp
-ifnode.cpp                              cfgnode.hpp
-ifnode.cpp                              connode.hpp
-ifnode.cpp                              phaseX.hpp
-ifnode.cpp                              runtime.hpp
-ifnode.cpp                              subnode.hpp
-
-indexSet.cpp                            allocation.inline.hpp
-indexSet.cpp                            chaitin.hpp
-indexSet.cpp                            compile.hpp
-indexSet.cpp                            indexSet.hpp
-indexSet.cpp                            regmask.hpp
-
-indexSet.hpp                            allocation.hpp
-indexSet.hpp                            compile.hpp
-indexSet.hpp                            regmask.hpp
-indexSet.hpp                            resourceArea.hpp
-
-interpreterRuntime.cpp                  runtime.hpp
-
-java.cpp                                compile.hpp
-java.cpp                                compiledIC.hpp
-java.cpp                                indexSet.hpp
-java.cpp                                methodLiveness.hpp
-java.cpp                                runtime.hpp
-
-lcm.cpp                                 ad_<arch_model>.hpp
-lcm.cpp                                 allocation.inline.hpp
-lcm.cpp                                 block.hpp
-lcm.cpp                                 c2compiler.hpp
-lcm.cpp                                 callnode.hpp
-lcm.cpp                                 cfgnode.hpp
-lcm.cpp                                 machnode.hpp
-lcm.cpp                                 runtime.hpp
-
-library_call.cpp                        addnode.hpp
-library_call.cpp                        callGenerator.hpp
-library_call.cpp                        cfgnode.hpp
-library_call.cpp                        compileLog.hpp
-library_call.cpp                        idealKit.hpp
-library_call.cpp                        mulnode.hpp
-library_call.cpp                        nativeLookup.hpp
-library_call.cpp                        objArrayKlass.hpp
-library_call.cpp                        parse.hpp
-library_call.cpp                        runtime.hpp
-library_call.cpp                        sharedRuntime.hpp
-library_call.cpp                        subnode.hpp
-library_call.cpp                        systemDictionary.hpp
-library_call.cpp                        vmSymbols.hpp
-
-live.cpp                                allocation.inline.hpp
-live.cpp                                callnode.hpp
-live.cpp                                chaitin.hpp
-live.cpp                                live.hpp
-live.cpp                                machnode.hpp
-
-live.hpp                                block.hpp
-live.hpp                                indexSet.hpp
-live.hpp                                phase.hpp
-live.hpp                                port.hpp
-live.hpp                                regmask.hpp
-live.hpp                                vectset.hpp
-
-locknode.cpp                            locknode.hpp
-locknode.cpp                            parse.hpp
-locknode.cpp                            rootnode.hpp
-locknode.cpp                            runtime.hpp
-
-locknode.hpp                            ad_<arch_model>.hpp
-locknode.hpp                            node.hpp
-locknode.hpp                            opcodes.hpp
-locknode.hpp                            subnode.hpp
-
-loopTransform.cpp                       addnode.hpp
-loopTransform.cpp                       allocation.inline.hpp
-loopTransform.cpp                       callnode.hpp
-loopTransform.cpp                       connode.hpp
-loopTransform.cpp                       compileLog.hpp
-loopTransform.cpp                       divnode.hpp
-loopTransform.cpp                       loopnode.hpp
-loopTransform.cpp                       mulnode.hpp
-loopTransform.cpp                       rootnode.hpp
-loopTransform.cpp                       runtime.hpp
-loopTransform.cpp                       subnode.hpp
-
-loopUnswitch.cpp                        allocation.inline.hpp
-loopUnswitch.cpp                        connode.hpp
-loopUnswitch.cpp                        loopnode.hpp
-loopUnswitch.cpp                        rootnode.hpp
-
-loopnode.cpp                            addnode.hpp
-loopnode.cpp                            allocation.inline.hpp
-loopnode.cpp                            callnode.hpp
-loopnode.cpp                            ciMethodData.hpp
-loopnode.cpp                            compileLog.hpp
-loopnode.cpp                            connode.hpp
-loopnode.cpp                            divnode.hpp
-loopnode.cpp                            loopnode.hpp
-loopnode.cpp                            mulnode.hpp
-loopnode.cpp                            rootnode.hpp
-loopnode.cpp                            superword.hpp
-loopnode.cpp                            vectset.hpp
-
-loopnode.hpp                            cfgnode.hpp
-loopnode.hpp                            multnode.hpp
-loopnode.hpp                            phaseX.hpp
-loopnode.hpp                            subnode.hpp
-loopnode.hpp                            type.hpp
-
-loopopts.cpp                            addnode.hpp
-loopopts.cpp                            allocation.inline.hpp
-loopopts.cpp                            connode.hpp
-loopopts.cpp                            divnode.hpp
-loopopts.cpp                            loopnode.hpp
-loopopts.cpp                            mulnode.hpp
-loopopts.cpp                            rootnode.hpp
-loopopts.cpp                            subnode.hpp
-
-machnode.cpp                            collectedHeap.hpp
-machnode.cpp                            machnode.hpp
-machnode.cpp                            regalloc.hpp
-
-machnode.hpp                            callnode.hpp
-machnode.hpp                            matcher.hpp
-machnode.hpp                            multnode.hpp
-machnode.hpp                            node.hpp
-machnode.hpp                            regmask.hpp
-
-macro.cpp                               addnode.hpp
-macro.cpp                               callnode.hpp
-macro.cpp                               cfgnode.hpp
-macro.cpp                               compile.hpp
-macro.cpp                              compileLog.hpp
-macro.cpp                               connode.hpp
-macro.cpp                               locknode.hpp
-macro.cpp                               loopnode.hpp
-macro.cpp                               macro.hpp
-macro.cpp                               memnode.hpp
-macro.cpp                               node.hpp
-macro.cpp                               phaseX.hpp
-macro.cpp                               rootnode.hpp
-macro.cpp                               runtime.hpp
-macro.cpp                               sharedRuntime.hpp
-macro.cpp                               subnode.hpp
-macro.cpp                               type.hpp
-macro.cpp                               vectset.hpp
-macro.hpp                               phase.hpp
-
-matcher.cpp                             ad_<arch_model>.hpp
-matcher.cpp                             addnode.hpp
-matcher.cpp                             allocation.inline.hpp
-matcher.cpp                             atomic.hpp
-matcher.cpp                             callnode.hpp
-matcher.cpp                             connode.hpp
-matcher.cpp                             hpi.hpp
-matcher.cpp                             matcher.hpp
-matcher.cpp                             memnode.hpp
-matcher.cpp                             opcodes.hpp
-matcher.cpp                             os.hpp
-matcher.cpp                             regmask.hpp
-matcher.cpp                             rootnode.hpp
-matcher.cpp                             runtime.hpp
-matcher.cpp                             type.hpp
-
-matcher.hpp                             node.hpp
-matcher.hpp                             phaseX.hpp
-matcher.hpp                             regmask.hpp
-matcher.hpp                             resourceArea.hpp
-matcher.hpp                             vectset.hpp
-
-memnode.cpp                             addnode.hpp
-memnode.cpp                             allocation.inline.hpp
-memnode.cpp                             cfgnode.hpp
-memnode.cpp                             compile.hpp
-memnode.cpp                             compileLog.hpp
-memnode.cpp                             connode.hpp
-memnode.cpp                             loopnode.hpp
-memnode.cpp                             machnode.hpp
-memnode.cpp                             matcher.hpp
-memnode.cpp                             memnode.hpp
-memnode.cpp                             mulnode.hpp
-memnode.cpp                             objArrayKlass.hpp
-memnode.cpp                             phaseX.hpp
-memnode.cpp                             regmask.hpp
-memnode.cpp                             systemDictionary.hpp
-
-memnode.hpp                             multnode.hpp
-memnode.hpp                             node.hpp
-memnode.hpp                             opcodes.hpp
-memnode.hpp                             type.hpp
-
-methodLiveness.cpp                      allocation.inline.hpp
-methodLiveness.cpp                      bytecode.hpp
-methodLiveness.cpp                      bytecodes.hpp
-methodLiveness.cpp                      ciStreams.hpp
-methodLiveness.cpp                      methodLiveness.hpp
-
-methodLiveness.hpp                      bitMap.hpp
-methodLiveness.hpp                      growableArray.hpp
-
-mulnode.cpp                             addnode.hpp
-mulnode.cpp                             allocation.inline.hpp
-mulnode.cpp                             connode.hpp
-mulnode.cpp                             memnode.hpp
-mulnode.cpp                             mulnode.hpp
-mulnode.cpp                             phaseX.hpp
-mulnode.cpp                             subnode.hpp
-
-mulnode.hpp                             node.hpp
-mulnode.hpp                             opcodes.hpp
-mulnode.hpp                             type.hpp
-
-multnode.cpp                            matcher.hpp
-multnode.cpp                            multnode.hpp
-multnode.cpp                            opcodes.hpp
-multnode.cpp                            phaseX.hpp
-multnode.cpp                            regmask.hpp
-multnode.cpp                            type.hpp
-
-multnode.hpp                            node.hpp
-
-node.cpp                                allocation.inline.hpp
-node.cpp                                cfgnode.hpp
-node.cpp                                connode.hpp
-node.cpp                                copy.hpp
-node.cpp                                machnode.hpp
-node.cpp                                matcher.hpp
-node.cpp                                node.hpp
-node.cpp                                opcodes.hpp
-node.cpp                                regmask.hpp
-node.cpp                                type.hpp
-node.cpp                                vectset.hpp
-
-node.hpp                                compile.hpp
-node.hpp                                port.hpp
-node.hpp                                type.hpp
-node.hpp                                vectset.hpp
-
-opcodes.cpp                             classes.hpp
-opcodes.cpp                             globalDefinitions.hpp
-opcodes.cpp                             no_precompiled_headers
-
-os_<os_arch>.cpp                        runtime.hpp
-
-os_<os_family>.cpp                      runtime.hpp
-
-output.cpp                              allocation.inline.hpp
-output.cpp                              assembler.inline.hpp
-output.cpp                              callnode.hpp
-output.cpp                              cfgnode.hpp
-output.cpp                              compileBroker.hpp
-output.cpp                              debugInfo.hpp
-output.cpp                              debugInfoRec.hpp
-output.cpp                              handles.inline.hpp
-output.cpp                              locknode.hpp
-output.cpp                              machnode.hpp
-output.cpp                              oopMap.hpp
-output.cpp                              output.hpp
-output.cpp                              regalloc.hpp
-output.cpp                              runtime.hpp
-output.cpp                              subnode.hpp
-output.cpp                              type.hpp
-output.cpp                              xmlstream.hpp
-
-output.hpp                              ad_<arch_model>.hpp
-output.hpp                              block.hpp
-output.hpp                              node.hpp
-
-parse.hpp                               ciMethodData.hpp
-parse.hpp                               ciTypeFlow.hpp
-parse.hpp                               generateOopMap.hpp
-parse.hpp                               graphKit.hpp
-parse.hpp                               methodLiveness.hpp
-parse.hpp                               subnode.hpp
-parse.hpp                               vectset.hpp
-
-parse1.cpp                              addnode.hpp
-parse1.cpp                              arguments.hpp
-parse1.cpp                              compileLog.hpp
-parse1.cpp                              copy.hpp
-parse1.cpp                              handles.inline.hpp
-parse1.cpp                              linkResolver.hpp
-parse1.cpp                              locknode.hpp
-parse1.cpp                              memnode.hpp
-parse1.cpp                              methodOop.hpp
-parse1.cpp                              parse.hpp
-parse1.cpp                              rootnode.hpp
-parse1.cpp                              runtime.hpp
-parse1.cpp                              sharedRuntime.hpp
-
-parse2.cpp                              addnode.hpp
-parse2.cpp                              ciMethodData.hpp
-parse2.cpp                              compileLog.hpp
-parse2.cpp                              deoptimization.hpp
-parse2.cpp                              divnode.hpp
-parse2.cpp                              linkResolver.hpp
-parse2.cpp                              matcher.hpp
-parse2.cpp                              memnode.hpp
-parse2.cpp                              mulnode.hpp
-parse2.cpp                              parse.hpp
-parse2.cpp                              runtime.hpp
-parse2.cpp                              sharedRuntime.hpp
-parse2.cpp                              systemDictionary.hpp
-parse2.cpp                              universe.inline.hpp
-parse2.cpp                              vmSymbols.hpp
-
-parse3.cpp                              addnode.hpp
-parse3.cpp                              compileLog.hpp
-parse3.cpp                              deoptimization.hpp
-parse3.cpp                              handles.inline.hpp
-parse3.cpp                              linkResolver.hpp
-parse3.cpp                              memnode.hpp
-parse3.cpp                              objArrayKlass.hpp
-parse3.cpp                              parse.hpp
-parse3.cpp                              rootnode.hpp
-parse3.cpp                              runtime.hpp
-parse3.cpp                              subnode.hpp
-parse3.cpp                              universe.inline.hpp
-
-parseHelper.cpp                         addnode.hpp
-parseHelper.cpp                         compileLog.hpp
-parseHelper.cpp                         memnode.hpp
-parseHelper.cpp                         mulnode.hpp
-parseHelper.cpp                         objArrayKlass.hpp
-parseHelper.cpp                         parse.hpp
-parseHelper.cpp                         rootnode.hpp
-parseHelper.cpp                         runtime.hpp
-parseHelper.cpp                         sharedRuntime.hpp
-parseHelper.cpp                         systemDictionary.hpp
-
-phase.cpp                               compile.hpp
-phase.cpp                               compileBroker.hpp
-phase.cpp                               nmethod.hpp
-phase.cpp                               node.hpp
-phase.cpp                               phase.hpp
-
-phase.hpp                               port.hpp
-phase.hpp                               timer.hpp
-
-phaseX.cpp                              allocation.inline.hpp
-phaseX.cpp                              block.hpp
-phaseX.cpp                              callnode.hpp
-phaseX.cpp                              cfgnode.hpp
-phaseX.cpp                              connode.hpp
-phaseX.cpp                              loopnode.hpp
-phaseX.cpp                              machnode.hpp
-phaseX.cpp                              opcodes.hpp
-phaseX.cpp                              phaseX.hpp
-phaseX.cpp                              regalloc.hpp
-phaseX.cpp                              rootnode.hpp
-
-phaseX.hpp                              dict.hpp
-phaseX.hpp                              memnode.hpp
-phaseX.hpp                              node.hpp
-phaseX.hpp                              phase.hpp
-phaseX.hpp                              resourceArea.hpp
-phaseX.hpp                              type.hpp
-phaseX.hpp                              vectset.hpp
-
-port.cpp                                port.hpp
-
-port.hpp                                top.hpp
-
-postaloc.cpp                            allocation.inline.hpp
-postaloc.cpp                            chaitin.hpp
-postaloc.cpp                            machnode.hpp
-
-reg_split.cpp                           addnode.hpp
-reg_split.cpp                           allocation.inline.hpp
-reg_split.cpp                           callnode.hpp
-reg_split.cpp                           c2compiler.hpp
-reg_split.cpp                           cfgnode.hpp
-reg_split.cpp                           chaitin.hpp
-reg_split.cpp                           loopnode.hpp
-reg_split.cpp                           machnode.hpp
-reg_split.cpp                           vectset.hpp
-
-regalloc.cpp                            regalloc.hpp
-
-regalloc.hpp                            block.hpp
-regalloc.hpp                            matcher.hpp
-regalloc.hpp                            phase.hpp
-regalloc.hpp                            vmreg.hpp
-
-regmask.cpp                             ad_<arch_model>.hpp
-regmask.cpp                             compile.hpp
-regmask.cpp                             regmask.hpp
-
-regmask.hpp                             adGlobals_<arch_model>.hpp
-regmask.hpp                             optoreg.hpp
-regmask.hpp                             port.hpp
-regmask.hpp                             vmreg.hpp
-
-rootnode.cpp                            allocation.inline.hpp
-rootnode.cpp                            callnode.hpp
-rootnode.cpp                            cfgnode.hpp
-rootnode.cpp                            phaseX.hpp
-rootnode.cpp                            regmask.hpp
-rootnode.cpp                            rootnode.hpp
-rootnode.cpp                            subnode.hpp
-rootnode.cpp                            type.hpp
-
-rootnode.hpp                            loopnode.hpp
-
-runtime.cpp                             ad_<arch_model>.hpp
-runtime.cpp                             addnode.hpp
-runtime.cpp                             barrierSet.hpp
-runtime.cpp                             bytecode.hpp
-runtime.cpp                             callnode.hpp
-runtime.cpp                             cfgnode.hpp
-runtime.cpp                             collectedHeap.hpp
-runtime.cpp                             compileBroker.hpp
-runtime.cpp                             compiledIC.hpp
-runtime.cpp                             compilerOracle.hpp
-runtime.cpp                             connode.hpp
-runtime.cpp                             copy.hpp
-runtime.cpp                             fprofiler.hpp
-runtime.cpp                             g1SATBCardTableModRefBS.hpp
-runtime.cpp                             gcLocker.inline.hpp
-runtime.cpp                             graphKit.hpp
-runtime.cpp                             handles.inline.hpp
-runtime.cpp                             heapRegion.hpp
-runtime.cpp                             icBuffer.hpp
-runtime.cpp                             interfaceSupport.hpp
-runtime.cpp                             interpreter.hpp
-runtime.cpp                             javaCalls.hpp
-runtime.cpp                             linkResolver.hpp
-runtime.cpp                             machnode.hpp
-runtime.cpp                             matcher.hpp
-runtime.cpp                             memnode.hpp
-runtime.cpp                             mulnode.hpp
-runtime.cpp                             nmethod.hpp
-runtime.cpp                             objArrayKlass.hpp
-runtime.cpp                             oop.inline.hpp
-runtime.cpp                             oopFactory.hpp
-runtime.cpp                             oopMap.hpp
-runtime.cpp                             pcDesc.hpp
-runtime.cpp                             preserveException.hpp
-runtime.cpp                             runtime.hpp
-runtime.cpp                             scopeDesc.hpp
-runtime.cpp                             sharedRuntime.hpp
-runtime.cpp                             signature.hpp
-runtime.cpp                             subnode.hpp
-runtime.cpp                             systemDictionary.hpp
-runtime.cpp                             threadCritical.hpp
-runtime.cpp                             vframe.hpp
-runtime.cpp                             vframeArray.hpp
-runtime.cpp                             vframe_hp.hpp
-runtime.cpp                             vmSymbols.hpp
-runtime.cpp                             vtableStubs.hpp
-
-runtime.hpp                             biasedLocking.hpp
-runtime.hpp                             codeBlob.hpp
-runtime.hpp                             deoptimization.hpp
-runtime.hpp                             machnode.hpp
-runtime.hpp                             type.hpp
-runtime.hpp                             vframe.hpp
-
-runtime_<arch_model>.cpp                adGlobals_<arch_model>.hpp
-runtime_<arch_model>.cpp                ad_<arch_model>.hpp
-runtime_<arch_model>.cpp                assembler.hpp
-runtime_<arch_model>.cpp                assembler_<arch>.inline.hpp
-runtime_<arch_model>.cpp                globalDefinitions.hpp
-runtime_<arch_model>.cpp                interfaceSupport.hpp
-runtime_<arch_model>.cpp                interpreter.hpp
-runtime_<arch_model>.cpp                nativeInst_<arch>.hpp
-runtime_<arch_model>.cpp                runtime.hpp
-runtime_<arch_model>.cpp                sharedRuntime.hpp
-runtime_<arch_model>.cpp                stubRoutines.hpp
-runtime_<arch_model>.cpp                systemDictionary.hpp
-runtime_<arch_model>.cpp                vframeArray.hpp
-runtime_<arch_model>.cpp                vmreg.hpp
-runtime_<arch_model>.cpp                vmreg_<arch>.inline.hpp
-
-set.cpp                                 allocation.inline.hpp
-set.cpp                                 set.hpp
-
-set.hpp                                 allocation.hpp
-set.hpp                                 port.hpp
-
-sharedRuntime_<arch_model>.cpp          runtime.hpp
-
-split_if.cpp                            allocation.inline.hpp
-split_if.cpp                            callnode.hpp
-split_if.cpp                            connode.hpp
-split_if.cpp                            loopnode.hpp
-
-stringopts.hpp                          phaseX.hpp
-stringopts.hpp                          node.hpp
-
-stringopts.cpp                          addnode.hpp
-stringopts.cpp                          callnode.hpp
-stringopts.cpp                          callGenerator.hpp
-stringopts.cpp                          compileLog.hpp
-stringopts.cpp                          divnode.hpp
-stringopts.cpp                          idealKit.hpp
-stringopts.cpp                          graphKit.hpp
-stringopts.cpp                          rootnode.hpp
-stringopts.cpp                          runtime.hpp
-stringopts.cpp                          subnode.hpp
-stringopts.cpp                          stringopts.hpp
-
-stubGenerator_<arch_model>.cpp          runtime.hpp
-
-stubRoutines.cpp                        runtime.hpp
-
-subnode.cpp                             addnode.hpp
-subnode.cpp                             allocation.inline.hpp
-subnode.cpp                             callnode.hpp
-subnode.cpp                             cfgnode.hpp
-subnode.cpp                             compileLog.hpp
-subnode.cpp                             connode.hpp
-subnode.cpp                             loopnode.hpp
-subnode.cpp                             matcher.hpp
-subnode.cpp                             mulnode.hpp
-subnode.cpp                             opcodes.hpp
-subnode.cpp                             phaseX.hpp
-subnode.cpp                             sharedRuntime.hpp
-subnode.cpp                             subnode.hpp
-
-subnode.hpp                             node.hpp
-subnode.hpp                             opcodes.hpp
-subnode.hpp                             type.hpp
-
-superword.cpp                           addnode.hpp
-superword.cpp                           allocation.inline.hpp
-superword.cpp                           callnode.hpp
-superword.cpp                           compileLog.hpp
-superword.cpp                           divnode.hpp
-superword.cpp                           matcher.hpp
-superword.cpp                           memnode.hpp
-superword.cpp                           mulnode.hpp
-superword.cpp                           opcodes.hpp
-superword.cpp                           superword.hpp
-superword.cpp                           vectornode.hpp
-superword.cpp                           vectset.hpp
-
-superword.hpp                           connode.hpp
-superword.hpp                           growableArray.hpp
-superword.hpp                           loopnode.hpp
-superword.hpp                           node.hpp
-superword.hpp                           phaseX.hpp
-superword.hpp                           vectornode.hpp
-
-thread.cpp                              c2compiler.hpp
-
-top.hpp                                 c2_globals.hpp
-
-type.cpp                                ciTypeFlow.hpp
-type.cpp                                compileLog.hpp
-type.cpp                                dict.hpp
-type.cpp                                gcLocker.hpp
-type.cpp                                instanceKlass.hpp
-type.cpp                                klassKlass.hpp
-type.cpp                                matcher.hpp
-type.cpp                                node.hpp
-type.cpp                                objArrayKlass.hpp
-type.cpp                                oopFactory.hpp
-type.cpp                                opcodes.hpp
-type.cpp                                resourceArea.hpp
-type.cpp                                symbolTable.hpp
-type.cpp                                systemDictionary.hpp
-type.cpp                                type.hpp
-type.cpp                                typeArrayKlass.hpp
-
-type.hpp                                adlcVMDeps.hpp
-type.hpp                                handles.hpp
-type.hpp                                port.hpp
-
-vectornode.cpp                          allocation.inline.hpp
-vectornode.cpp                          connode.hpp
-vectornode.cpp                          vectornode.hpp
-
-vectornode.hpp                          matcher.hpp
-vectornode.hpp                          memnode.hpp
-vectornode.hpp                          node.hpp
-vectornode.hpp                          opcodes.hpp
-
-vectset.cpp                             allocation.inline.hpp
-vectset.cpp                             vectset.hpp
-
-vectset.hpp                             set.hpp
-
-vframeArray.cpp                         runtime.hpp
-
-vframe_hp.cpp                           matcher.hpp
-
-vmStructs.cpp                           adGlobals_<arch_model>.hpp
-vmStructs.cpp                           matcher.hpp
-
-vmreg.hpp                               adGlobals_<arch_model>.hpp
-vmreg.hpp                               adlcVMDeps.hpp
-vmreg.hpp                               ostream.hpp
-
-vtableStubs.cpp                         matcher.hpp
-
-vtableStubs_<arch_model>.cpp            ad_<arch_model>.hpp
-vtableStubs_<arch_model>.cpp            runtime.hpp
-
-idealGraphPrinter.hpp                   dict.hpp
-idealGraphPrinter.hpp                   vectset.hpp
-idealGraphPrinter.hpp                   growableArray.hpp
-idealGraphPrinter.hpp                   ostream.hpp
-idealGraphPrinter.hpp                   xmlstream.hpp
-
-idealGraphPrinter.cpp                   idealGraphPrinter.hpp
-idealGraphPrinter.cpp                   chaitin.hpp
-idealGraphPrinter.cpp                   machnode.hpp
-idealGraphPrinter.cpp                   parse.hpp
-idealGraphPrinter.cpp                   threadCritical.hpp
-
-compile.cpp                             idealGraphPrinter.hpp
-thread.cpp                              idealGraphPrinter.hpp
-phaseX.cpp                              idealGraphPrinter.hpp
-parse2.cpp                              idealGraphPrinter.hpp
-parse1.cpp                              idealGraphPrinter.hpp
-matcher.cpp                             idealGraphPrinter.hpp
-loopnode.cpp                            idealGraphPrinter.hpp
-chaitin.cpp                             idealGraphPrinter.hpp
--- a/src/share/vm/includeDB_core	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4787 +0,0 @@
-//
-// Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// This code is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License version 2 only, as
-// published by the Free Software Foundation.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-
-// includeDB format:
-// a comment starts with '// ' and goes to the end of the line
-// anything else is a pair of filenames.  The line "x.cpp y.hpp" means
-// "x.cpp must include y.hpp".  Similarly, "y.hpp z.hpp" means "any file including
-// y.hpp must also include z.hpp, and z.hpp must be included before y.hpp".
-//
-// Style hint: we try to keep the entries ordered alphabetically, both
-// globally (left-hand sides) and within a given file (right-hand sides)
-//
-// To avoid unnecessary conflicts with the work of other programmers,
-// do not delete, move, or reformat pre-existing lines.  Do not attempt
-// to "optimize" this file incrementally.
-//
-// ============ Platform dependent include files ===========
-//
-// Some header files occur in clusters.  Header files which depend
-// on the token "generate_platform_dependent_include" are included
-// directly by other header files, and should not be explicitly declared
-// as dependencies.  Header files named H.inline.hpp generally contain
-// bodies for inline functions declared in H.hpp.
-//
-// NOTE: Files that use the token "generate_platform_dependent_include"
-// are expected to contain macro references like <os>, <arch_model>, ... and
-// makedeps has a dependency on these platform files looking like:
-// foo_<macro>.trailing_string
-// (where "trailing_string" can be any legal filename strings but typically
-// is "hpp" or "inline.hpp").
-//
-// The dependency in makedeps (and enforced) is that an underscore
-// will precedure the macro invocation. Note that this restriction
-// is only enforced on filenames that have the dependency token
-// "generate_platform_dependent_include" so other files using macro
-// expansion (typically .cpp files) have no requirement to have
-// an underscore precede the macro although this is encouraged for
-// readibility.
-//
-// ======= Circular dependencies and inline functions ==========
-//
-// (Sometimes, circular dependencies prevent complex function bodies
-// from being defined directly in H.hpp.  In such cases, a client S.cpp
-// of H.hpp must always declare a dependency on H.inline.hpp, which in
-// turn will declare a dependency on H.hpp.  If by some mischance S.cpp
-// declares a dependency on H.hpp, the compiler may complain about missing
-// inline function bodies, or (perhaps) the program may fail to link.
-// The solution is to have S.cpp depend on H.inline.hpp instead of H.hpp.
-//
-// Generally, if in response to a source code change the compiler
-// issues an error in a file F (which may be either a header or a
-// source file), you should consider if the error arises from a missing
-// class definition C.  If that is the case, find the header file H which
-// contains C (often, H=C.hpp, but you may have to search for C's definition).
-// Then, add a line to the includeDB file as appropriate.
-//
-//
-// Here are some typical compiler errors that may require changes to includeDB.
-// (Messages are taken from Sun's SPARC compiler.)
-//
-//   "klassVtable.cpp", line 96: Error: No_GC_Verifier is not defined.
-// Source code:
-//   No_GC_Verifier no_gc;
-//
-// The problem is that the class name No_GC_Verifier is not declared,
-// so the compiler is confused by the syntax.  The solution:
-//   klassVtable.cpp                    gcLocker.hpp
-//
-// Sometimes the compiler has only partial knowledge about a class:
-//   "privilegedStack.cpp", line 60: Error: cast is not a member of instanceKlass.
-// Source code:
-//   if (_protection_domain != instanceKlass::cast(method->method_holder())->protection_domain()) return false;
-//
-// Here, instanceKlass is known to the compiler as a type, because of a
-// forward declaration somewhere ("class instanceKlass;").  The problem
-// is that the compiler has not seen the body of instanceKlass, and so it
-// complains that it does not know about "instanceKlass::cast".  Solution:
-//   privilegedStack.cpp             instanceKlass.hpp
-//
-// Here's another example of a missing declaration:
-//   "privilegedStack.cpp", line 111: Error: The function AllocateHeap must have a prototype.
-// Source code:
-//   _array = NEW_C_HEAP_ARRAY(PrivilegedElement, initial_size);
-//
-// The problem is that the macro call expands to use a heap function
-// which is defined (for technical reasons) in a different file.  Solution:
-//   privilegedStack.cpp             allocation.inline.hpp
-// The macro is defined in allocation.hpp, while the function is
-// defined (as an inline) in allocation.inline.hpp.  Generally, if you
-// find you need a header H.hpp, and there is also a header
-// H.inline.hpp use the latter, because it contains inline definitions
-// you will require.
-
-abstractCompiler.cpp                    abstractCompiler.hpp
-abstractCompiler.cpp                    mutexLocker.hpp
-
-abstractCompiler.hpp                    compilerInterface.hpp
-
-abstractInterpreter.hpp                 bytecodes.hpp
-abstractInterpreter.hpp                 interp_masm_<arch_model>.hpp
-abstractInterpreter.hpp                 stubs.hpp
-abstractInterpreter.hpp                 thread_<os_family>.inline.hpp
-abstractInterpreter.hpp                 top.hpp
-abstractInterpreter.hpp                 vmThread.hpp
-
-accessFlags.cpp                         accessFlags.hpp
-accessFlags.cpp                         oop.inline.hpp
-accessFlags.cpp                         os_<os_family>.inline.hpp
-
-accessFlags.hpp                         jvm.h
-accessFlags.hpp                         top.hpp
-
-allocation.cpp                          allocation.hpp
-allocation.cpp                          allocation.inline.hpp
-allocation.cpp                          os.hpp
-allocation.cpp                          os_<os_family>.inline.hpp
-allocation.cpp                          ostream.hpp
-allocation.cpp                          resourceArea.hpp
-allocation.cpp                          task.hpp
-allocation.cpp                          threadCritical.hpp
-
-allocation.hpp                          globalDefinitions.hpp
-allocation.hpp                          globals.hpp
-
-allocation.inline.hpp                   os.hpp
-
-aprofiler.cpp                           aprofiler.hpp
-aprofiler.cpp                           collectedHeap.inline.hpp
-aprofiler.cpp                           oop.inline.hpp
-aprofiler.cpp                           oop.inline2.hpp
-aprofiler.cpp                           permGen.hpp
-aprofiler.cpp                           resourceArea.hpp
-aprofiler.cpp                           space.hpp
-aprofiler.cpp                           systemDictionary.hpp
-
-aprofiler.hpp                           allocation.hpp
-aprofiler.hpp                           klass.hpp
-aprofiler.hpp                           klassOop.hpp
-aprofiler.hpp                           top.hpp
-aprofiler.hpp                           universe.hpp
-
-arguments.cpp                           allocation.inline.hpp
-arguments.cpp                           arguments.hpp
-arguments.cpp                           cardTableRS.hpp
-arguments.cpp                           compilerOracle.hpp
-arguments.cpp                           defaultStream.hpp
-arguments.cpp                           globals_extension.hpp
-arguments.cpp                           java.hpp
-arguments.cpp                           javaAssertions.hpp
-arguments.cpp                           jvmtiExport.hpp
-arguments.cpp                           management.hpp
-arguments.cpp                           oop.inline.hpp
-arguments.cpp                           os_<os_family>.inline.hpp
-arguments.cpp                           referenceProcessor.hpp
-arguments.cpp                           taskqueue.hpp
-arguments.cpp                           universe.inline.hpp
-arguments.cpp                           vm_version_<arch>.hpp
-
-arguments.hpp                           java.hpp
-arguments.hpp                           perfData.hpp
-arguments.hpp                           top.hpp
-
-array.cpp                               array.hpp
-array.cpp                               resourceArea.hpp
-array.cpp                               thread_<os_family>.inline.hpp
-
-array.hpp                               allocation.hpp
-array.hpp                               allocation.inline.hpp
-
-arrayKlass.cpp                          arrayKlass.hpp
-arrayKlass.cpp                          arrayKlassKlass.hpp
-arrayKlass.cpp                          arrayOop.hpp
-arrayKlass.cpp                          collectedHeap.inline.hpp
-arrayKlass.cpp                          gcLocker.hpp
-arrayKlass.cpp                          instanceKlass.hpp
-arrayKlass.cpp                          javaClasses.hpp
-arrayKlass.cpp                          jvmti.h
-arrayKlass.cpp                          objArrayOop.hpp
-arrayKlass.cpp                          oop.inline.hpp
-arrayKlass.cpp                          systemDictionary.hpp
-arrayKlass.cpp                          universe.inline.hpp
-arrayKlass.cpp                          vmSymbols.hpp
-
-arrayKlass.hpp                          klass.hpp
-arrayKlass.hpp                          klassOop.hpp
-arrayKlass.hpp                          klassVtable.hpp
-arrayKlass.hpp                          universe.hpp
-
-arrayKlassKlass.cpp                     arrayKlassKlass.hpp
-arrayKlassKlass.cpp                     handles.inline.hpp
-arrayKlassKlass.cpp                     javaClasses.hpp
-arrayKlassKlass.cpp                     markSweep.inline.hpp
-arrayKlassKlass.cpp                     oop.inline.hpp
-
-arrayKlassKlass.hpp                     arrayKlass.hpp
-arrayKlassKlass.hpp                     klassKlass.hpp
-
-arrayOop.cpp                            arrayOop.hpp
-arrayOop.cpp                            objArrayOop.hpp
-arrayOop.cpp                            oop.inline.hpp
-arrayOop.cpp                            symbolOop.hpp
-
-arrayOop.hpp                            oop.hpp
-arrayOop.hpp                            universe.inline.hpp
-
-assembler.cpp                           assembler.hpp
-assembler.cpp                           assembler.inline.hpp
-assembler.cpp                           assembler_<arch>.inline.hpp
-assembler.cpp                           codeBuffer.hpp
-assembler.cpp                           icache.hpp
-assembler.cpp                           os.hpp
-
-assembler.hpp                           allocation.hpp
-assembler.hpp                           debug.hpp
-assembler.hpp                           growableArray.hpp
-assembler.hpp                           oopRecorder.hpp
-assembler.hpp                           register_<arch>.hpp
-assembler.hpp                           relocInfo.hpp
-assembler.hpp                           top.hpp
-assembler.hpp                           vm_version_<arch>.hpp
-
-assembler.inline.hpp                    assembler.hpp
-assembler.inline.hpp                    codeBuffer.hpp
-assembler.inline.hpp                    disassembler.hpp
-assembler.inline.hpp                    threadLocalStorage.hpp
-
-assembler_<arch>.cpp              assembler_<arch>.inline.hpp
-assembler_<arch>.cpp              biasedLocking.hpp
-assembler_<arch>.cpp              cardTableModRefBS.hpp
-assembler_<arch>.cpp              collectedHeap.inline.hpp
-assembler_<arch>.cpp              interfaceSupport.hpp
-assembler_<arch>.cpp              interpreter.hpp
-assembler_<arch>.cpp              methodHandles.hpp
-assembler_<arch>.cpp              objectMonitor.hpp
-assembler_<arch>.cpp              os.hpp
-assembler_<arch>.cpp              resourceArea.hpp
-assembler_<arch>.cpp              sharedRuntime.hpp
-assembler_<arch>.cpp              stubRoutines.hpp
-
-assembler_<arch>.hpp              generate_platform_dependent_include
-
-assembler_<arch>.inline.hpp       assembler.inline.hpp
-assembler_<arch>.inline.hpp       codeBuffer.hpp
-assembler_<arch>.inline.hpp       codeCache.hpp
-assembler_<arch>.inline.hpp       handles.inline.hpp
-
-assembler_<os_arch>.cpp           assembler.hpp
-assembler_<os_arch>.cpp           assembler_<arch>.inline.hpp
-assembler_<os_arch>.cpp           os.hpp
-assembler_<os_arch>.cpp           threadLocalStorage.hpp
-
-atomic.cpp                              atomic.hpp
-atomic.cpp                              atomic_<os_arch>.inline.hpp
-atomic.cpp                              os_<os_family>.inline.hpp
-
-atomic.hpp                              allocation.hpp
-
-atomic_<os_arch>.inline.hpp             atomic.hpp
-atomic_<os_arch>.inline.hpp             os.hpp
-atomic_<os_arch>.inline.hpp             vm_version_<arch>.hpp
-atomic_<os_arch>.inline.hpp             orderAccess_<os_arch>.inline.hpp
-
-// attachListener is jck optional, put cpp deps in includeDB_features
-
-attachListener.hpp                      allocation.hpp
-attachListener.hpp                      debug.hpp
-attachListener.hpp                      ostream.hpp
-
-barrierSet.cpp				barrierSet.inline.hpp
-barrierSet.cpp			        collectedHeap.hpp
-barrierSet.cpp				universe.hpp
-
-barrierSet.hpp                          memRegion.hpp
-barrierSet.hpp                          oopsHierarchy.hpp
-
-barrierSet.inline.hpp                   barrierSet.hpp
-barrierSet.inline.hpp                   cardTableModRefBS.hpp
-
-basicLock.cpp                           basicLock.hpp
-basicLock.cpp                           synchronizer.hpp
-
-basicLock.hpp                           handles.hpp
-basicLock.hpp                           markOop.hpp
-basicLock.hpp                           top.hpp
-
-biasedLocking.cpp                       basicLock.hpp
-biasedLocking.cpp                       biasedLocking.hpp
-biasedLocking.cpp                       klass.inline.hpp
-biasedLocking.cpp                       markOop.hpp
-biasedLocking.cpp                       task.hpp
-biasedLocking.cpp                       vframe.hpp
-biasedLocking.cpp                       vmThread.hpp
-biasedLocking.cpp                       vm_operations.hpp
-
-biasedLocking.hpp                       growableArray.hpp
-biasedLocking.hpp                       handles.hpp
-
-bitMap.cpp                              allocation.inline.hpp
-bitMap.cpp                              bitMap.inline.hpp
-bitMap.cpp                              copy.hpp
-bitMap.cpp                              os_<os_family>.inline.hpp
-
-bitMap.hpp                              allocation.hpp
-bitMap.hpp                              top.hpp
-
-bitMap.inline.hpp                       atomic.hpp
-bitMap.inline.hpp                       bitMap.hpp
-
-blockOffsetTable.cpp                    blockOffsetTable.inline.hpp
-blockOffsetTable.cpp                    collectedHeap.inline.hpp
-blockOffsetTable.cpp                    iterator.hpp
-blockOffsetTable.cpp                    java.hpp
-blockOffsetTable.cpp                    oop.inline.hpp
-blockOffsetTable.cpp                    space.inline.hpp
-blockOffsetTable.cpp                    universe.hpp
-
-blockOffsetTable.hpp                    globalDefinitions.hpp
-blockOffsetTable.hpp                    memRegion.hpp
-blockOffsetTable.hpp                    virtualspace.hpp
-
-blockOffsetTable.inline.hpp             blockOffsetTable.hpp
-blockOffsetTable.inline.hpp             safepoint.hpp
-blockOffsetTable.inline.hpp             space.hpp
-
-bytecode.cpp                            bytecode.hpp
-bytecode.cpp                            constantPoolOop.hpp
-bytecode.cpp                            fieldType.hpp
-bytecode.cpp                            handles.inline.hpp
-bytecode.cpp                            linkResolver.hpp
-bytecode.cpp                            oop.inline.hpp
-bytecode.cpp                            safepoint.hpp
-bytecode.cpp                            signature.hpp
-
-bytecode.hpp                            allocation.hpp
-bytecode.hpp                            bytecodes.hpp
-bytecode.hpp                            bytes_<arch>.hpp
-bytecode.hpp                            methodOop.hpp
-
-bytecodeHistogram.cpp                   bytecodeHistogram.hpp
-bytecodeHistogram.cpp                   growableArray.hpp
-bytecodeHistogram.cpp                   os.hpp
-bytecodeHistogram.cpp                   resourceArea.hpp
-
-bytecodeHistogram.hpp                   allocation.hpp
-bytecodeHistogram.hpp                   bytecodes.hpp
-
-bytecodeInterpreter.cpp                 no_precompiled_headers
-bytecodeInterpreter.cpp                 bytecodeHistogram.hpp
-bytecodeInterpreter.cpp                 bytecodeInterpreter.hpp
-bytecodeInterpreter.cpp                 bytecodeInterpreter.inline.hpp
-bytecodeInterpreter.cpp                 cardTableModRefBS.hpp
-bytecodeInterpreter.cpp                 collectedHeap.hpp
-bytecodeInterpreter.cpp                 exceptions.hpp
-bytecodeInterpreter.cpp                 frame.inline.hpp
-bytecodeInterpreter.cpp                 handles.inline.hpp
-bytecodeInterpreter.cpp                 interfaceSupport.hpp
-bytecodeInterpreter.cpp                 interpreterRuntime.hpp
-bytecodeInterpreter.cpp                 interpreter.hpp
-bytecodeInterpreter.cpp                 jvmtiExport.hpp
-bytecodeInterpreter.cpp                 objArrayKlass.hpp
-bytecodeInterpreter.cpp                 oop.inline.hpp
-bytecodeInterpreter.cpp                 orderAccess_<os_arch>.inline.hpp
-bytecodeInterpreter.cpp                 resourceArea.hpp
-bytecodeInterpreter.cpp                 sharedRuntime.hpp
-bytecodeInterpreter.cpp                 threadCritical.hpp
-bytecodeInterpreter.cpp                 vmSymbols.hpp
-
-bytecodeInterpreter_<arch>.cpp          assembler.hpp
-bytecodeInterpreter_<arch>.cpp          bytecodeInterpreter.hpp
-bytecodeInterpreter_<arch>.cpp          bytecodeInterpreter.inline.hpp
-bytecodeInterpreter_<arch>.cpp          debug.hpp
-bytecodeInterpreter_<arch>.cpp          deoptimization.hpp
-bytecodeInterpreter_<arch>.cpp          frame.inline.hpp
-bytecodeInterpreter_<arch>.cpp          interp_masm_<arch_model>.hpp
-bytecodeInterpreter_<arch>.cpp          interpreterRuntime.hpp
-bytecodeInterpreter_<arch>.cpp          interpreter.hpp
-bytecodeInterpreter_<arch>.cpp          jvmtiExport.hpp
-bytecodeInterpreter_<arch>.cpp          jvmtiThreadState.hpp
-bytecodeInterpreter_<arch>.cpp          methodDataOop.hpp
-bytecodeInterpreter_<arch>.cpp          methodOop.hpp
-bytecodeInterpreter_<arch>.cpp          oop.inline.hpp
-bytecodeInterpreter_<arch>.cpp          sharedRuntime.hpp
-bytecodeInterpreter_<arch>.cpp          stubRoutines.hpp
-bytecodeInterpreter_<arch>.cpp          synchronizer.hpp
-bytecodeInterpreter_<arch>.cpp          vframeArray.hpp
-
-bytecodeInterpreterWithChecks.cpp       bytecodeInterpreter.cpp
-
-bytecodeInterpreter.hpp                 allocation.hpp
-bytecodeInterpreter.hpp                 basicLock.hpp
-bytecodeInterpreter.hpp                 bytes_<arch>.hpp
-bytecodeInterpreter.hpp                 frame.hpp
-bytecodeInterpreter.hpp                 globalDefinitions.hpp
-bytecodeInterpreter.hpp                 globals.hpp
-bytecodeInterpreter.hpp                 methodDataOop.hpp
-bytecodeInterpreter.hpp                 methodOop.hpp
-
-bytecodeInterpreter.inline.hpp          bytecodeInterpreter.hpp
-bytecodeInterpreter.inline.hpp          stubRoutines.hpp
-
-bytecodeInterpreter_<arch>.hpp          generate_platform_dependent_include
-
-bytecodeInterpreter_<arch>.inline.hpp   generate_platform_dependent_include
-
-bytecodeStream.cpp                      bytecodeStream.hpp
-bytecodeStream.cpp                      bytecodes.hpp
-
-bytecodeStream.hpp                      allocation.hpp
-bytecodeStream.hpp                      bytecode.hpp
-bytecodeStream.hpp                      bytes_<arch>.hpp
-bytecodeStream.hpp                      methodOop.hpp
-
-bytecodeTracer.cpp                      bytecodeHistogram.hpp
-bytecodeTracer.cpp                      bytecodeTracer.hpp
-bytecodeTracer.cpp                      bytecodes.hpp
-bytecodeTracer.cpp                      interpreter.hpp
-bytecodeTracer.cpp                      interpreterRuntime.hpp
-bytecodeTracer.cpp                      methodDataOop.hpp
-bytecodeTracer.cpp                      methodOop.hpp
-bytecodeTracer.cpp                      mutexLocker.hpp
-bytecodeTracer.cpp                      resourceArea.hpp
-bytecodeTracer.cpp                      timer.hpp
-
-bytecodeTracer.hpp                      allocation.hpp
-
-bytecodes.cpp                           bytecodes.hpp
-bytecodes.cpp                           bytes_<arch>.hpp
-bytecodes.cpp                           methodOop.hpp
-bytecodes.cpp                           resourceArea.hpp
-
-bytecodes.hpp                           allocation.hpp
-bytecodes.hpp                           top.hpp
-
-bytecodes_<arch>.cpp                    bytecodes.hpp
-
-bytecodes_<arch>.hpp                    generate_platform_dependent_include
-
-bytes_<arch>.hpp                        allocation.hpp
-
-bytes_<os_arch>.inline.hpp              generate_platform_dependent_include
-
-cardTableModRefBS.cpp                   allocation.inline.hpp
-cardTableModRefBS.cpp                   cardTableModRefBS.hpp
-cardTableModRefBS.cpp                   cardTableRS.hpp
-cardTableModRefBS.cpp                   java.hpp
-cardTableModRefBS.cpp                   mutexLocker.hpp
-cardTableModRefBS.cpp                   sharedHeap.hpp
-cardTableModRefBS.cpp                   space.hpp
-cardTableModRefBS.cpp                   space.inline.hpp
-cardTableModRefBS.cpp                   universe.hpp
-cardTableModRefBS.cpp                   virtualspace.hpp
-
-cardTableModRefBS.hpp                   modRefBarrierSet.hpp
-cardTableModRefBS.hpp                   oop.hpp
-cardTableModRefBS.hpp                   oop.inline2.hpp
-
-cardTableRS.cpp                         allocation.inline.hpp
-cardTableRS.cpp                         cardTableRS.hpp
-cardTableRS.cpp                         genCollectedHeap.hpp
-cardTableRS.cpp                         generation.hpp
-cardTableRS.cpp                         java.hpp
-cardTableRS.cpp                         oop.inline.hpp
-cardTableRS.cpp                         os.hpp
-cardTableRS.cpp                         space.hpp
-
-cardTableRS.hpp                         cardTableModRefBS.hpp
-cardTableRS.hpp                         genRemSet.hpp
-cardTableRS.hpp                         memRegion.hpp
-
-ciArray.cpp                             ciArray.hpp
-ciArray.cpp                             ciKlass.hpp
-ciArray.cpp                             ciUtilities.hpp
-
-ciArray.hpp                             arrayOop.hpp
-ciArray.hpp                             ciObject.hpp
-ciArray.hpp                             objArrayOop.hpp
-ciArray.hpp                             typeArrayOop.hpp
-
-ciArrayKlass.cpp                        ciArrayKlass.hpp
-ciArrayKlass.cpp                        ciObjArrayKlass.hpp
-ciArrayKlass.cpp                        ciTypeArrayKlass.hpp
-ciArrayKlass.cpp                        ciUtilities.hpp
-
-ciArrayKlass.hpp                        ciKlass.hpp
-
-ciArrayKlassKlass.hpp                   ciKlassKlass.hpp
-
-ciCallProfile.hpp                       ciClassList.hpp
-
-ciCallSite.cpp                          ciCallSite.hpp
-ciCallSite.cpp                          ciUtilities.hpp
-
-ciCallSite.hpp                          ciInstance.hpp
-
-ciConstant.cpp                          allocation.hpp
-ciConstant.cpp                          allocation.inline.hpp
-ciConstant.cpp                          ciConstant.hpp
-ciConstant.cpp                          ciUtilities.hpp
-
-ciConstant.hpp                          ciClassList.hpp
-ciConstant.hpp                          ciNullObject.hpp
-
-ciConstantPoolCache.cpp                 allocation.hpp
-ciConstantPoolCache.cpp                 allocation.inline.hpp
-ciConstantPoolCache.cpp                 ciConstantPoolCache.hpp
-ciConstantPoolCache.cpp                 ciUtilities.hpp
-
-ciConstantPoolCache.hpp                 growableArray.hpp
-ciConstantPoolCache.hpp                 resourceArea.hpp
-
-ciCPCache.cpp                           cpCacheOop.hpp
-ciCPCache.cpp                           ciCPCache.hpp
-ciCPCache.cpp                           ciUtilities.hpp
-
-ciCPCache.hpp                           ciClassList.hpp
-ciCPCache.hpp                           ciObject.hpp
-ciCPCache.hpp                           cpCacheOop.hpp
-
-ciEnv.cpp                               allocation.inline.hpp
-ciEnv.cpp                               ciConstant.hpp
-ciEnv.cpp                               ciEnv.hpp
-ciEnv.cpp                               ciField.hpp
-ciEnv.cpp                               ciInstance.hpp
-ciEnv.cpp                               ciInstanceKlass.hpp
-ciEnv.cpp                               ciInstanceKlassKlass.hpp
-ciEnv.cpp                               ciMethod.hpp
-ciEnv.cpp                               ciNullObject.hpp
-ciEnv.cpp                               ciObjArrayKlassKlass.hpp
-ciEnv.cpp                               ciTypeArrayKlassKlass.hpp
-ciEnv.cpp                               ciUtilities.hpp
-ciEnv.cpp                               collectedHeap.inline.hpp
-ciEnv.cpp                               compileBroker.hpp
-ciEnv.cpp                               compileLog.hpp
-ciEnv.cpp                               compilerOracle.hpp
-ciEnv.cpp                               dtrace.hpp
-ciEnv.cpp                               init.hpp
-ciEnv.cpp                               jvmtiExport.hpp
-ciEnv.cpp                               linkResolver.hpp
-ciEnv.cpp                               methodDataOop.hpp
-ciEnv.cpp                               objArrayKlass.hpp
-ciEnv.cpp                               oop.inline.hpp
-ciEnv.cpp                               oop.inline2.hpp
-ciEnv.cpp                               oopFactory.hpp
-ciEnv.cpp                               reflection.hpp
-ciEnv.cpp                               scopeDesc.hpp
-ciEnv.cpp                               sharedRuntime.hpp
-ciEnv.cpp                               systemDictionary.hpp
-ciEnv.cpp                               universe.inline.hpp
-ciEnv.cpp                               vmSymbols.hpp
-
-ciEnv.hpp                               ciClassList.hpp
-ciEnv.hpp                               ciObjectFactory.hpp
-ciEnv.hpp                               debugInfoRec.hpp
-ciEnv.hpp                               dependencies.hpp
-ciEnv.hpp                               exceptionHandlerTable.hpp
-ciEnv.hpp                               oopMap.hpp
-ciEnv.hpp                               systemDictionary.hpp
-ciEnv.hpp                               thread.hpp
-
-ciExceptionHandler.cpp                  ciExceptionHandler.hpp
-ciExceptionHandler.cpp                  ciUtilities.hpp
-
-ciExceptionHandler.hpp                  ciClassList.hpp
-ciExceptionHandler.hpp                  ciInstanceKlass.hpp
-
-ciField.cpp                             ciField.hpp
-ciField.cpp                             ciInstanceKlass.hpp
-ciField.cpp                             ciUtilities.hpp
-ciField.cpp                             collectedHeap.inline.hpp
-ciField.cpp                             fieldDescriptor.hpp
-ciField.cpp                             linkResolver.hpp
-ciField.cpp                             oop.inline.hpp
-ciField.cpp                             oop.inline2.hpp
-ciField.cpp                             systemDictionary.hpp
-ciField.cpp                             universe.inline.hpp
-
-ciField.hpp                             ciClassList.hpp
-ciField.hpp                             ciConstant.hpp
-ciField.hpp                             ciFlags.hpp
-ciField.hpp                             ciInstance.hpp
-
-ciFlags.cpp                             ciFlags.hpp
-
-ciFlags.hpp                             accessFlags.hpp
-ciFlags.hpp                             allocation.hpp
-ciFlags.hpp                             ciClassList.hpp
-ciFlags.hpp                             jvm.h
-
-ciInstance.cpp                          ciConstant.hpp
-ciInstance.cpp                          ciField.hpp
-ciInstance.cpp                          ciInstance.hpp
-ciInstance.cpp                          ciInstanceKlass.hpp
-ciInstance.cpp                          ciUtilities.hpp
-ciInstance.cpp                          oop.inline.hpp
-ciInstance.cpp                          systemDictionary.hpp
-
-ciInstance.hpp                          ciObject.hpp
-ciInstance.hpp                          instanceOop.hpp
-
-ciInstanceKlass.cpp                     allocation.hpp
-ciInstanceKlass.cpp                     allocation.inline.hpp
-ciInstanceKlass.cpp                     ciField.hpp
-ciInstanceKlass.cpp                     ciInstance.hpp
-ciInstanceKlass.cpp                     ciInstanceKlass.hpp
-ciInstanceKlass.cpp                     ciUtilities.hpp
-ciInstanceKlass.cpp                     fieldDescriptor.hpp
-ciInstanceKlass.cpp                     oop.inline.hpp
-ciInstanceKlass.cpp                     systemDictionary.hpp
-
-ciInstanceKlass.hpp                     ciConstantPoolCache.hpp
-ciInstanceKlass.hpp                     ciFlags.hpp
-ciInstanceKlass.hpp                     ciInstanceKlassKlass.hpp
-ciInstanceKlass.hpp                     ciKlass.hpp
-ciInstanceKlass.hpp                     ciSymbol.hpp
-
-ciInstanceKlassKlass.cpp                ciInstanceKlassKlass.hpp
-ciInstanceKlassKlass.cpp                ciUtilities.hpp
-
-ciInstanceKlassKlass.hpp                ciKlassKlass.hpp
-
-ciKlass.cpp                             ciKlass.hpp
-ciKlass.cpp                             ciSymbol.hpp
-ciKlass.cpp                             ciUtilities.hpp
-ciKlass.cpp                             oop.inline.hpp
-
-ciKlass.hpp                             ciType.hpp
-ciKlass.hpp                             klassOop.hpp
-
-ciKlassKlass.cpp                        ciKlassKlass.hpp
-ciKlassKlass.cpp                        ciUtilities.hpp
-
-ciKlassKlass.hpp                        ciKlass.hpp
-ciKlassKlass.hpp                        ciSymbol.hpp
-
-ciMethod.cpp                            abstractCompiler.hpp
-ciMethod.cpp                            allocation.inline.hpp
-ciMethod.cpp                            bitMap.inline.hpp
-ciMethod.cpp                            ciCallProfile.hpp
-ciMethod.cpp                            ciExceptionHandler.hpp
-ciMethod.cpp                            ciInstanceKlass.hpp
-ciMethod.cpp                            ciMethod.hpp
-ciMethod.cpp                            ciMethodBlocks.hpp
-ciMethod.cpp                            ciMethodData.hpp
-ciMethod.cpp                            ciMethodKlass.hpp
-ciMethod.cpp                            ciStreams.hpp
-ciMethod.cpp                            ciSymbol.hpp
-ciMethod.cpp                            ciUtilities.hpp
-ciMethod.cpp                            compilerOracle.hpp
-ciMethod.cpp                            deoptimization.hpp
-ciMethod.cpp                            generateOopMap.hpp
-ciMethod.cpp                            interpreter.hpp
-ciMethod.cpp                            linkResolver.hpp
-ciMethod.cpp                            methodLiveness.hpp
-ciMethod.cpp                            nativeLookup.hpp
-ciMethod.cpp                            oop.inline.hpp
-ciMethod.cpp                            oopMapCache.hpp
-ciMethod.cpp                            resourceArea.hpp
-ciMethod.cpp                            systemDictionary.hpp
-ciMethod.cpp                            xmlstream.hpp
-
-ciMethod.hpp                            bitMap.hpp
-ciMethod.hpp                            ciFlags.hpp
-ciMethod.hpp                            ciInstanceKlass.hpp
-ciMethod.hpp                            ciObject.hpp
-ciMethod.hpp                            ciSignature.hpp
-ciMethod.hpp                            methodHandles.hpp
-ciMethod.hpp                            methodLiveness.hpp
-
-ciMethodBlocks.cpp                      bytecode.hpp
-ciMethodBlocks.cpp                      ciMethodBlocks.hpp
-ciMethodBlocks.cpp                      ciStreams.hpp
-ciMethodBlocks.cpp                      copy.hpp
-
-ciMethodBlocks.hpp                      ciMethod.hpp
-ciMethodBlocks.hpp                      growableArray.hpp
-ciMethodBlocks.hpp                      resourceArea.hpp
-
-ciMethodData.cpp                        allocation.inline.hpp
-ciMethodData.cpp                        ciMethodData.hpp
-ciMethodData.cpp                        ciUtilities.hpp
-ciMethodData.cpp                        copy.hpp
-ciMethodData.cpp                        deoptimization.hpp
-ciMethodData.cpp                        resourceArea.hpp
-
-ciMethodData.hpp                        ciClassList.hpp
-ciMethodData.hpp                        ciKlass.hpp
-ciMethodData.hpp                        ciObject.hpp
-ciMethodData.hpp                        ciUtilities.hpp
-ciMethodData.hpp                        methodDataOop.hpp
-ciMethodData.hpp                        oop.inline.hpp
-
-ciMethodKlass.cpp                       ciMethodKlass.hpp
-ciMethodKlass.cpp                       ciUtilities.hpp
-
-ciMethodKlass.hpp                       ciKlass.hpp
-ciMethodKlass.hpp                       ciSymbol.hpp
-
-ciMethodHandle.cpp                      ciClassList.hpp
-ciMethodHandle.cpp                      ciInstance.hpp
-ciMethodHandle.cpp                      ciMethodHandle.hpp
-ciMethodHandle.cpp                      ciUtilities.hpp
-ciMethodHandle.cpp                      methodHandles.hpp
-ciMethodHandle.cpp                      methodHandleWalk.hpp
-
-ciMethodHandle.hpp                      methodHandles.hpp
-
-ciNullObject.cpp                        ciNullObject.hpp
-
-ciNullObject.hpp                        ciClassList.hpp
-ciNullObject.hpp                        ciObject.hpp
-ciNullObject.hpp                        ciUtilities.hpp
-
-ciObjArray.hpp                          ciArray.hpp
-ciObjArray.hpp                          ciClassList.hpp
-ciObjArray.hpp                          objArrayOop.hpp
-
-ciObjArray.cpp                          ciObjArray.hpp
-ciObjArray.cpp                          ciNullObject.hpp
-ciObjArray.cpp                          ciUtilities.hpp
-ciObjArray.cpp                          objArrayOop.hpp
-
-ciObjArray.cpp                          ciObjArray.hpp
-ciObjArray.cpp                          ciNullObject.hpp
-ciObjArray.cpp                          ciUtilities.hpp
-ciObjArray.cpp                          objArrayOop.hpp
-
-ciObjArrayKlass.cpp                     ciInstanceKlass.hpp
-ciObjArrayKlass.cpp                     ciObjArrayKlass.hpp
-ciObjArrayKlass.cpp                     ciObjArrayKlassKlass.hpp
-ciObjArrayKlass.cpp                     ciSymbol.hpp
-ciObjArrayKlass.cpp                     ciUtilities.hpp
-ciObjArrayKlass.cpp                     objArrayKlass.hpp
-
-ciObjArrayKlass.hpp                     ciArrayKlass.hpp
-
-ciObjArrayKlassKlass.cpp                ciObjArrayKlassKlass.hpp
-ciObjArrayKlassKlass.cpp                ciUtilities.hpp
-
-ciObjArrayKlassKlass.hpp                ciArrayKlassKlass.hpp
-
-ciObject.cpp                            ciObject.hpp
-ciObject.cpp                            ciUtilities.hpp
-ciObject.cpp                            collectedHeap.inline.hpp
-ciObject.cpp                            oop.inline2.hpp
-
-ciObject.hpp                            allocation.hpp
-ciObject.hpp                            ciClassList.hpp
-ciObject.hpp                            handles.hpp
-ciObject.hpp                            jniHandles.hpp
-
-ciObjectFactory.cpp                     allocation.inline.hpp
-ciObjectFactory.cpp                     ciCallSite.hpp
-ciObjectFactory.cpp                     ciCPCache.hpp
-ciObjectFactory.cpp                     ciInstance.hpp
-ciObjectFactory.cpp                     ciInstanceKlass.hpp
-ciObjectFactory.cpp                     ciInstanceKlassKlass.hpp
-ciObjectFactory.cpp                     ciMethod.hpp
-ciObjectFactory.cpp                     ciMethodData.hpp
-ciObjectFactory.cpp                     ciMethodHandle.hpp
-ciObjectFactory.cpp                     ciMethodKlass.hpp
-ciObjectFactory.cpp                     ciNullObject.hpp
-ciObjectFactory.cpp                     ciObjArray.hpp
-ciObjectFactory.cpp                     ciObjArrayKlass.hpp
-ciObjectFactory.cpp                     ciObjArrayKlassKlass.hpp
-ciObjectFactory.cpp                     ciObjectFactory.hpp
-ciObjectFactory.cpp                     ciSymbol.hpp
-ciObjectFactory.cpp                     ciSymbolKlass.hpp
-ciObjectFactory.cpp                     ciTypeArray.hpp
-ciObjectFactory.cpp                     ciTypeArrayKlass.hpp
-ciObjectFactory.cpp                     ciTypeArrayKlassKlass.hpp
-ciObjectFactory.cpp                     ciUtilities.hpp
-ciObjectFactory.cpp                     collectedHeap.inline.hpp
-ciObjectFactory.cpp                     fieldType.hpp
-ciObjectFactory.cpp                     oop.inline.hpp
-ciObjectFactory.cpp                     oop.inline2.hpp
-ciObjectFactory.cpp                     systemDictionary.hpp
-
-ciObjectFactory.hpp                     ciClassList.hpp
-ciObjectFactory.hpp                     ciObject.hpp
-ciObjectFactory.hpp                     growableArray.hpp
-
-ciSignature.cpp                         allocation.inline.hpp
-ciSignature.cpp                         ciSignature.hpp
-ciSignature.cpp                         ciUtilities.hpp
-ciSignature.cpp                         oop.inline.hpp
-ciSignature.cpp                         signature.hpp
-
-ciSignature.hpp                         ciClassList.hpp
-ciSignature.hpp                         ciSymbol.hpp
-ciSignature.hpp                         globalDefinitions.hpp
-ciSignature.hpp                         growableArray.hpp
-
-ciStreams.cpp                           ciCallSite.hpp
-ciStreams.cpp                           ciConstant.hpp
-ciStreams.cpp                           ciCPCache.hpp
-ciStreams.cpp                           ciField.hpp
-ciStreams.cpp                           ciStreams.hpp
-ciStreams.cpp                           ciUtilities.hpp
-
-ciStreams.hpp                           bytecode.hpp
-ciStreams.hpp                           ciClassList.hpp
-ciStreams.hpp                           ciExceptionHandler.hpp
-ciStreams.hpp                           ciInstanceKlass.hpp
-ciStreams.hpp                           ciMethod.hpp
-
-ciSymbol.cpp                            ciSymbol.hpp
-ciSymbol.cpp                            ciUtilities.hpp
-ciSymbol.cpp                            oopFactory.hpp
-
-ciSymbol.hpp                            ciObject.hpp
-ciSymbol.hpp                            ciObjectFactory.hpp
-ciSymbol.hpp                            symbolOop.hpp
-ciSymbol.hpp                            vmSymbols.hpp
-
-ciSymbolKlass.cpp                       ciSymbolKlass.hpp
-ciSymbolKlass.cpp                       ciUtilities.hpp
-
-ciSymbolKlass.hpp                       ciKlass.hpp
-ciSymbolKlass.hpp                       ciSymbol.hpp
-
-ciType.cpp                              ciType.hpp
-ciType.cpp                              ciUtilities.hpp
-ciType.cpp                              oop.inline.hpp
-ciType.cpp                              systemDictionary.hpp
-
-ciType.hpp                              ciObject.hpp
-ciType.hpp                              klassOop.hpp
-
-ciTypeArray.cpp                         ciTypeArray.hpp
-ciTypeArray.cpp                         ciUtilities.hpp
-
-ciTypeArray.hpp                         ciArray.hpp
-ciTypeArray.hpp                         ciClassList.hpp
-ciTypeArray.hpp                         typeArrayOop.hpp
-
-ciTypeArrayKlass.cpp                    ciTypeArrayKlass.hpp
-ciTypeArrayKlass.cpp                    ciUtilities.hpp
-
-ciTypeArrayKlass.hpp                    ciArrayKlass.hpp
-
-ciTypeArrayKlassKlass.cpp               ciTypeArrayKlassKlass.hpp
-ciTypeArrayKlassKlass.cpp               ciUtilities.hpp
-
-ciTypeArrayKlassKlass.hpp               ciArrayKlassKlass.hpp
-
-ciUtilities.cpp                         ciUtilities.hpp
-
-ciUtilities.hpp                         ciEnv.hpp
-ciUtilities.hpp                         interfaceSupport.hpp
-
-classFileError.cpp                      classFileParser.hpp
-classFileError.cpp                      stackMapTable.hpp
-classFileError.cpp                      verifier.hpp
-
-classFileParser.cpp                     allocation.hpp
-classFileParser.cpp                     classFileParser.hpp
-classFileParser.cpp                     classLoader.hpp
-classFileParser.cpp                     classLoadingService.hpp
-classFileParser.cpp                     constantPoolOop.hpp
-classFileParser.cpp                     gcLocker.hpp
-classFileParser.cpp                     instanceKlass.hpp
-classFileParser.cpp                     javaCalls.hpp
-classFileParser.cpp                     javaClasses.hpp
-classFileParser.cpp                     jvmtiExport.hpp
-classFileParser.cpp                     klass.inline.hpp
-classFileParser.cpp                     klassOop.hpp
-classFileParser.cpp                     klassVtable.hpp
-classFileParser.cpp                     methodOop.hpp
-classFileParser.cpp                     oopFactory.hpp
-classFileParser.cpp                     perfData.hpp
-classFileParser.cpp                     reflection.hpp
-classFileParser.cpp                     signature.hpp
-classFileParser.cpp                     symbolOop.hpp
-classFileParser.cpp                     symbolTable.hpp
-classFileParser.cpp                     systemDictionary.hpp
-classFileParser.cpp                     threadService.hpp
-classFileParser.cpp                     timer.hpp
-classFileParser.cpp                     universe.inline.hpp
-classFileParser.cpp                     verificationType.hpp
-classFileParser.cpp                     verifier.hpp
-classFileParser.cpp                     vmSymbols.hpp
-
-classFileParser.hpp                     accessFlags.hpp
-classFileParser.hpp                     classFileStream.hpp
-classFileParser.hpp                     handles.inline.hpp
-classFileParser.hpp                     oop.inline.hpp
-classFileParser.hpp                     resourceArea.hpp
-classFileParser.hpp                     typeArrayOop.hpp
-
-classFileStream.cpp                     classFileStream.hpp
-classFileStream.cpp                     vmSymbols.hpp
-
-classFileStream.hpp                     bytes_<arch>.hpp
-classFileStream.hpp                     top.hpp
-
-classLoader.cpp                         allocation.inline.hpp
-classLoader.cpp                         arguments.hpp
-classLoader.cpp                         bytecodeStream.hpp
-classLoader.cpp                         classFileParser.hpp
-classLoader.cpp                         classFileStream.hpp
-classLoader.cpp                         classLoader.hpp
-classLoader.cpp                         collectedHeap.inline.hpp
-classLoader.cpp                         compilationPolicy.hpp
-classLoader.cpp                         compileBroker.hpp
-classLoader.cpp                         constantPoolKlass.hpp
-classLoader.cpp                         events.hpp
-classLoader.cpp                         fprofiler.hpp
-classLoader.cpp                         generation.hpp
-classLoader.cpp                         handles.hpp
-classLoader.cpp                         handles.inline.hpp
-classLoader.cpp                         hashtable.hpp
-classLoader.cpp                         hashtable.inline.hpp
-classLoader.cpp                         hpi.hpp
-classLoader.cpp                         hpi_<os_family>.hpp
-classLoader.cpp                         init.hpp
-classLoader.cpp                         instanceKlass.hpp
-classLoader.cpp                         instanceRefKlass.hpp
-classLoader.cpp                         interfaceSupport.hpp
-classLoader.cpp                         java.hpp
-classLoader.cpp                         javaCalls.hpp
-classLoader.cpp                         javaClasses.hpp
-classLoader.cpp                         jvm_misc.hpp
-classLoader.cpp                         management.hpp
-classLoader.cpp                         oop.inline.hpp
-classLoader.cpp                         oopFactory.hpp
-classLoader.cpp                         oopMapCache.hpp
-classLoader.cpp                         os_<os_family>.inline.hpp
-classLoader.cpp                         symbolOop.hpp
-classLoader.cpp                         systemDictionary.hpp
-classLoader.cpp                         threadCritical.hpp
-classLoader.cpp                         threadService.hpp
-classLoader.cpp                         timer.hpp
-classLoader.cpp                         universe.inline.hpp
-classLoader.cpp                         vmSymbols.hpp
-
-classLoader.hpp                         classFileParser.hpp
-classLoader.hpp                         perfData.hpp
-
-classLoadingService.cpp                 allocation.hpp
-classLoadingService.cpp                 classLoadingService.hpp
-classLoadingService.cpp                 dtrace.hpp
-classLoadingService.cpp                 memoryService.hpp
-classLoadingService.cpp                 mutexLocker.hpp
-classLoadingService.cpp                 oop.inline.hpp
-classLoadingService.cpp                 systemDictionary.hpp
-classLoadingService.cpp                 universe.hpp
-
-classLoadingService.hpp                 growableArray.hpp
-classLoadingService.hpp                 handles.hpp
-classLoadingService.hpp                 perfData.hpp
-
-classify.cpp                            classify.hpp
-classify.cpp                            systemDictionary.hpp
-
-classify.hpp                            oop.inline.hpp
-
-codeBlob.cpp                            allocation.inline.hpp
-codeBlob.cpp                            bytecode.hpp
-codeBlob.cpp                            codeBlob.hpp
-codeBlob.cpp                            codeCache.hpp
-codeBlob.cpp                            disassembler.hpp
-codeBlob.cpp                            forte.hpp
-codeBlob.cpp                            handles.inline.hpp
-codeBlob.cpp                            heap.hpp
-codeBlob.cpp                            interfaceSupport.hpp
-codeBlob.cpp                            memoryService.hpp
-codeBlob.cpp                            mutexLocker.hpp
-codeBlob.cpp                            nativeInst_<arch>.hpp
-codeBlob.cpp                            oop.inline.hpp
-codeBlob.cpp                            relocInfo.hpp
-codeBlob.cpp                            safepoint.hpp
-codeBlob.cpp                            sharedRuntime.hpp
-codeBlob.cpp                            vframe.hpp
-
-codeBlob.hpp                            codeBuffer.hpp
-codeBlob.hpp                            frame.hpp
-codeBlob.hpp                            handles.hpp
-codeBlob.hpp                            oopMap.hpp
-
-codeBuffer.cpp                          codeBuffer.hpp
-codeBuffer.cpp                          copy.hpp
-codeBuffer.cpp                          disassembler.hpp
-
-codeBuffer.hpp                          assembler.hpp
-codeBuffer.hpp                          oopRecorder.hpp
-codeBuffer.hpp                          relocInfo.hpp
-
-codeBuffer_<arch>.hpp                   generate_platform_dependent_include
-
-codeCache.cpp                           allocation.inline.hpp
-codeCache.cpp                           codeBlob.hpp
-codeCache.cpp                           codeCache.hpp
-codeCache.cpp                           dependencies.hpp
-codeCache.cpp                           gcLocker.hpp
-codeCache.cpp                           handles.inline.hpp
-codeCache.cpp                           icache.hpp
-codeCache.cpp                           iterator.hpp
-codeCache.cpp                           java.hpp
-codeCache.cpp                           markSweep.hpp
-codeCache.cpp                           memoryService.hpp
-codeCache.cpp                           methodOop.hpp
-codeCache.cpp                           mutexLocker.hpp
-codeCache.cpp                           nmethod.hpp
-codeCache.cpp                           objArrayOop.hpp
-codeCache.cpp                           oop.inline.hpp
-codeCache.cpp                           pcDesc.hpp
-codeCache.cpp                           resourceArea.hpp
-codeCache.cpp                           xmlstream.hpp
-
-codeCache.hpp                           allocation.hpp
-codeCache.hpp                           codeBlob.hpp
-codeCache.hpp                           heap.hpp
-codeCache.hpp                           instanceKlass.hpp
-codeCache.hpp                           oopsHierarchy.hpp
-
-collectorPolicy.cpp                     adaptiveSizePolicy.hpp
-collectorPolicy.cpp                     arguments.hpp
-collectorPolicy.cpp                     cardTableRS.hpp
-collectorPolicy.cpp                     collectorPolicy.hpp
-collectorPolicy.cpp                     gcLocker.inline.hpp
-collectorPolicy.cpp                     genCollectedHeap.hpp
-collectorPolicy.cpp                     gcPolicyCounters.hpp
-collectorPolicy.cpp                     generationSpec.hpp
-collectorPolicy.cpp                     globals_extension.hpp
-collectorPolicy.cpp                     handles.inline.hpp
-collectorPolicy.cpp                     java.hpp
-collectorPolicy.cpp                     space.hpp
-collectorPolicy.cpp                     thread_<os_family>.inline.hpp
-collectorPolicy.cpp                     universe.hpp
-collectorPolicy.cpp                     vmGCOperations.hpp
-collectorPolicy.cpp                     vmThread.hpp
-
-collectorPolicy.hpp                     barrierSet.hpp
-collectorPolicy.hpp                     genRemSet.hpp
-collectorPolicy.hpp                     permGen.hpp
-
-compactPermGen.hpp                      generation.hpp
-compactPermGen.hpp                      permGen.hpp
-
-compactingPermGenGen.cpp                compactingPermGenGen.hpp
-compactingPermGenGen.cpp                filemap.hpp
-compactingPermGenGen.cpp                genOopClosures.inline.hpp
-compactingPermGenGen.cpp                generation.inline.hpp
-compactingPermGenGen.cpp                generationSpec.hpp
-compactingPermGenGen.cpp                java.hpp
-compactingPermGenGen.cpp                oop.inline.hpp
-compactingPermGenGen.cpp                symbolTable.hpp
-compactingPermGenGen.cpp                systemDictionary.hpp
-
-compactingPermGenGen.hpp                generationCounters.hpp
-compactingPermGenGen.hpp                space.hpp
-
-compilationPolicy.cpp                   compilationPolicy.hpp
-compilationPolicy.cpp                   compiledIC.hpp
-compilationPolicy.cpp                   compilerOracle.hpp
-compilationPolicy.cpp                   events.hpp
-compilationPolicy.cpp                   frame.hpp
-compilationPolicy.cpp                   globalDefinitions.hpp
-compilationPolicy.cpp                   handles.inline.hpp
-compilationPolicy.cpp                   interpreter.hpp
-compilationPolicy.cpp                   methodDataOop.hpp
-compilationPolicy.cpp                   methodOop.hpp
-compilationPolicy.cpp                   nativeLookup.hpp
-compilationPolicy.cpp                   nmethod.hpp
-compilationPolicy.cpp                   oop.inline.hpp
-compilationPolicy.cpp                   rframe.hpp
-compilationPolicy.cpp			scopeDesc.hpp
-compilationPolicy.cpp                   simpleThresholdPolicy.hpp
-compilationPolicy.cpp                   stubRoutines.hpp
-compilationPolicy.cpp                   thread.hpp
-compilationPolicy.cpp                   timer.hpp
-compilationPolicy.cpp                   vframe.hpp
-compilationPolicy.cpp                   vm_operations.hpp
-
-compilationPolicy.hpp                   allocation.hpp
-compilationPolicy.hpp                   compileBroker.hpp
-compilationPolicy.hpp                   growableArray.hpp
-compilationPolicy.hpp                   nmethod.hpp
-compilationPolicy.hpp                   vm_operations.hpp
-
-compileBroker.cpp                       allocation.inline.hpp
-compileBroker.cpp                       arguments.hpp
-compileBroker.cpp                       codeCache.hpp
-compileBroker.cpp                       compilationPolicy.hpp
-compileBroker.cpp                       compileBroker.hpp
-compileBroker.cpp                       compileLog.hpp
-compileBroker.cpp                       compilerOracle.hpp
-compileBroker.cpp                       dtrace.hpp
-compileBroker.cpp                       init.hpp
-compileBroker.cpp                       interfaceSupport.hpp
-compileBroker.cpp                       javaCalls.hpp
-compileBroker.cpp                       linkResolver.hpp
-compileBroker.cpp                       methodDataOop.hpp
-compileBroker.cpp                       methodOop.hpp
-compileBroker.cpp                       nativeLookup.hpp
-compileBroker.cpp                       oop.inline.hpp
-compileBroker.cpp                       os.hpp
-compileBroker.cpp                       sharedRuntime.hpp
-compileBroker.cpp                       sweeper.hpp
-compileBroker.cpp                       systemDictionary.hpp
-compileBroker.cpp                       vmSymbols.hpp
-
-compileBroker.hpp                       abstractCompiler.hpp
-compileBroker.hpp                       compilerInterface.hpp
-compileBroker.hpp                       perfData.hpp
-
-compileLog.cpp                          allocation.inline.hpp
-compileLog.cpp                          ciMethod.hpp
-compileLog.cpp                          compileLog.hpp
-compileLog.cpp                          methodOop.hpp
-compileLog.cpp                          mutexLocker.hpp
-compileLog.cpp                          os.hpp
-
-compileLog.hpp                          xmlstream.hpp
-
-compiledIC.cpp                          codeCache.hpp
-compiledIC.cpp                          compiledIC.hpp
-compiledIC.cpp                          events.hpp
-compiledIC.cpp                          icBuffer.hpp
-compiledIC.cpp                          icache.hpp
-compiledIC.cpp                          interpreter.hpp
-compiledIC.cpp                          linkResolver.hpp
-compiledIC.cpp                          methodOop.hpp
-compiledIC.cpp                          nmethod.hpp
-compiledIC.cpp                          oop.inline.hpp
-compiledIC.cpp                          oopFactory.hpp
-compiledIC.cpp                          sharedRuntime.hpp
-compiledIC.cpp                          stubRoutines.hpp
-compiledIC.cpp                          symbolOop.hpp
-compiledIC.cpp                          systemDictionary.hpp
-compiledIC.cpp                          vtableStubs.hpp
-
-compiledIC.hpp                          compiledICHolderKlass.hpp
-compiledIC.hpp                          compiledICHolderOop.hpp
-compiledIC.hpp                          klassOop.hpp
-compiledIC.hpp                          linkResolver.hpp
-compiledIC.hpp                          nativeInst_<arch>.hpp
-
-compiledICHolderKlass.cpp               collectedHeap.hpp
-compiledICHolderKlass.cpp               collectedHeap.inline.hpp
-compiledICHolderKlass.cpp               compiledICHolderKlass.hpp
-compiledICHolderKlass.cpp               handles.inline.hpp
-compiledICHolderKlass.cpp               javaClasses.hpp
-compiledICHolderKlass.cpp               markSweep.inline.hpp
-compiledICHolderKlass.cpp               oop.inline.hpp
-compiledICHolderKlass.cpp               oop.inline2.hpp
-compiledICHolderKlass.cpp               permGen.hpp
-compiledICHolderKlass.cpp               universe.inline.hpp
-
-compiledICHolderKlass.hpp               compiledICHolderOop.hpp
-compiledICHolderKlass.hpp               klass.hpp
-compiledICHolderKlass.hpp               methodOop.hpp
-
-compiledICHolderOop.cpp                 compiledICHolderOop.hpp
-
-compiledICHolderOop.hpp                 oop.hpp
-
-compilerInterface.hpp                   ciArray.hpp
-compilerInterface.hpp                   ciArrayKlass.hpp
-compilerInterface.hpp                   ciArrayKlassKlass.hpp
-compilerInterface.hpp                   ciCallProfile.hpp
-compilerInterface.hpp                   ciConstant.hpp
-compilerInterface.hpp                   ciEnv.hpp
-compilerInterface.hpp                   ciExceptionHandler.hpp
-compilerInterface.hpp                   ciField.hpp
-compilerInterface.hpp                   ciFlags.hpp
-compilerInterface.hpp                   ciInstance.hpp
-compilerInterface.hpp                   ciInstanceKlass.hpp
-compilerInterface.hpp                   ciInstanceKlassKlass.hpp
-compilerInterface.hpp                   ciKlass.hpp
-compilerInterface.hpp                   ciKlassKlass.hpp
-compilerInterface.hpp                   ciMethod.hpp
-compilerInterface.hpp                   ciMethodKlass.hpp
-compilerInterface.hpp                   ciNullObject.hpp
-compilerInterface.hpp                   ciObjArray.hpp
-compilerInterface.hpp                   ciObjArrayKlass.hpp
-compilerInterface.hpp                   ciObjArrayKlassKlass.hpp
-compilerInterface.hpp                   ciObject.hpp
-compilerInterface.hpp                   ciSignature.hpp
-compilerInterface.hpp                   ciStreams.hpp
-compilerInterface.hpp                   ciSymbol.hpp
-compilerInterface.hpp                   ciSymbolKlass.hpp
-compilerInterface.hpp                   ciTypeArray.hpp
-compilerInterface.hpp                   ciTypeArrayKlass.hpp
-compilerInterface.hpp                   ciTypeArrayKlassKlass.hpp
-
-compilerOracle.cpp                      allocation.inline.hpp
-compilerOracle.cpp                      compilerOracle.hpp
-compilerOracle.cpp                      handles.inline.hpp
-compilerOracle.cpp                      jniHandles.hpp
-compilerOracle.cpp                      klass.hpp
-compilerOracle.cpp                      methodOop.hpp
-compilerOracle.cpp                      oop.inline.hpp
-compilerOracle.cpp                      oopFactory.hpp
-compilerOracle.cpp                      resourceArea.hpp
-compilerOracle.cpp                      symbolOop.hpp
-
-compilerOracle.hpp                      allocation.hpp
-compilerOracle.hpp                      oopsHierarchy.hpp
-
-compressedStream.cpp                    compressedStream.hpp
-compressedStream.cpp                    ostream.hpp
-
-compressedStream.hpp                    allocation.hpp
-
-constMethodKlass.cpp                    constMethodKlass.hpp
-constMethodKlass.cpp                    constMethodOop.hpp
-constMethodKlass.cpp                    gcLocker.hpp
-constMethodKlass.cpp                    handles.inline.hpp
-constMethodKlass.cpp                    interpreter.hpp
-constMethodKlass.cpp                    markSweep.inline.hpp
-constMethodKlass.cpp                    oop.inline.hpp
-constMethodKlass.cpp                    oop.inline2.hpp
-constMethodKlass.cpp                    resourceArea.hpp
-
-constMethodKlass.hpp                    oop.hpp
-constMethodKlass.hpp                    klass.hpp
-constMethodKlass.hpp                    orderAccess.hpp
-
-constMethodOop.cpp                      constMethodOop.hpp
-constMethodOop.cpp                      methodOop.hpp
-
-constMethodOop.hpp                      oop.hpp
-constMethodOop.hpp                      typeArrayOop.hpp
-
-constantPoolKlass.cpp                   collectedHeap.inline.hpp
-constantPoolKlass.cpp                   constantPoolKlass.hpp
-constantPoolKlass.cpp                   constantPoolOop.hpp
-constantPoolKlass.cpp                   handles.inline.hpp
-constantPoolKlass.cpp                   javaClasses.hpp
-constantPoolKlass.cpp                   markSweep.inline.hpp
-constantPoolKlass.cpp                   oop.inline.hpp
-constantPoolKlass.cpp                   oop.inline2.hpp
-constantPoolKlass.cpp                   oopFactory.hpp
-constantPoolKlass.cpp                   permGen.hpp
-constantPoolKlass.cpp                   symbolOop.hpp
-constantPoolKlass.cpp                   thread_<os_family>.inline.hpp
-constantPoolKlass.cpp                   universe.inline.hpp
-
-constantPoolKlass.hpp                   arrayKlass.hpp
-constantPoolKlass.hpp                   instanceKlass.hpp
-
-constantPoolOop.cpp                     constantPoolOop.hpp
-constantPoolOop.cpp                     fieldType.hpp
-constantPoolOop.cpp                     init.hpp
-constantPoolOop.cpp                     instanceKlass.hpp
-constantPoolOop.cpp                     javaClasses.hpp
-constantPoolOop.cpp                     linkResolver.hpp
-constantPoolOop.cpp                     objArrayKlass.hpp
-constantPoolOop.cpp                     oop.inline.hpp
-constantPoolOop.cpp                     oopFactory.hpp
-constantPoolOop.cpp                     signature.hpp
-constantPoolOop.cpp                     symbolTable.hpp
-constantPoolOop.cpp                     systemDictionary.hpp
-constantPoolOop.cpp                     universe.inline.hpp
-constantPoolOop.cpp                     vframe.hpp
-constantPoolOop.cpp                     vmSymbols.hpp
-
-constantPoolOop.hpp                     arrayOop.hpp
-constantPoolOop.hpp                     bytes_<arch>.hpp
-constantPoolOop.hpp                     constantTag.hpp
-constantPoolOop.hpp                     cpCacheOop.hpp
-constantPoolOop.hpp                     typeArrayOop.hpp
-
-constantTag.cpp                         constantTag.hpp
-
-constantTag.hpp                         jvm.h
-constantTag.hpp                         top.hpp
-
-copy.cpp                                copy.hpp
-copy.cpp                                sharedRuntime.hpp
-
-copy.hpp                                stubRoutines.hpp
-
-copy_<arch>.hpp                         generate_platform_dependent_include
-
-copy_<os_arch>.inline.hpp               generate_platform_dependent_include
-
-cpCacheKlass.cpp                        bytecodes.hpp
-cpCacheKlass.cpp                        collectedHeap.hpp
-cpCacheKlass.cpp                        constantPoolOop.hpp
-cpCacheKlass.cpp                        cpCacheKlass.hpp
-cpCacheKlass.cpp                        genOopClosures.inline.hpp
-cpCacheKlass.cpp                        handles.inline.hpp
-cpCacheKlass.cpp                        javaClasses.hpp
-cpCacheKlass.cpp                        markSweep.inline.hpp
-cpCacheKlass.cpp                        oop.inline.hpp
-cpCacheKlass.cpp                        permGen.hpp
-
-cpCacheKlass.hpp                        arrayKlass.hpp
-cpCacheKlass.hpp                        cpCacheOop.hpp
-cpCacheKlass.hpp                        instanceKlass.hpp
-
-cpCacheOop.cpp                          cpCacheOop.hpp
-cpCacheOop.cpp                          handles.inline.hpp
-cpCacheOop.cpp                          interpreter.hpp
-cpCacheOop.cpp                          jvmtiRedefineClassesTrace.hpp
-cpCacheOop.cpp                          markSweep.inline.hpp
-cpCacheOop.cpp                          objArrayOop.hpp
-cpCacheOop.cpp                          oop.inline.hpp
-cpCacheOop.cpp                          rewriter.hpp
-cpCacheOop.cpp                          universe.inline.hpp
-
-cpCacheOop.hpp                          allocation.hpp
-cpCacheOop.hpp                          array.hpp
-cpCacheOop.hpp                          arrayOop.hpp
-cpCacheOop.hpp                          bytecodes.hpp
-
-cppInterpreter.cpp                      bytecodeInterpreter.hpp
-cppInterpreter.cpp                      interpreter.hpp
-cppInterpreter.cpp                      interpreterGenerator.hpp
-cppInterpreter.cpp                      interpreterRuntime.hpp
-
-cppInterpreter.hpp                      abstractInterpreter.hpp
-
-cppInterpreter_<arch>.cpp               arguments.hpp
-cppInterpreter_<arch>.cpp               arrayOop.hpp
-cppInterpreter_<arch>.cpp               assembler.hpp
-cppInterpreter_<arch>.cpp               bytecodeHistogram.hpp
-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
-cppInterpreter_<arch>.cpp               jvmtiExport.hpp
-cppInterpreter_<arch>.cpp               jvmtiThreadState.hpp
-cppInterpreter_<arch>.cpp               methodDataOop.hpp
-cppInterpreter_<arch>.cpp               methodOop.hpp
-cppInterpreter_<arch>.cpp               oop.inline.hpp
-cppInterpreter_<arch>.cpp               sharedRuntime.hpp
-cppInterpreter_<arch>.cpp               stubRoutines.hpp
-cppInterpreter_<arch>.cpp               synchronizer.hpp
-cppInterpreter_<arch>.cpp               cppInterpreter.hpp
-cppInterpreter_<arch>.cpp               timer.hpp
-cppInterpreter_<arch>.cpp               vframeArray.hpp
-
-cppInterpreter_<arch>.hpp          generate_platform_dependent_include
-
-cppInterpreterGenerator_<arch>.hpp generate_platform_dependent_include
-
-debug.cpp                               arguments.hpp
-debug.cpp                               bytecodeHistogram.hpp
-debug.cpp                               codeCache.hpp
-debug.cpp                               collectedHeap.hpp
-debug.cpp                               compileBroker.hpp
-debug.cpp                               defaultStream.hpp
-debug.cpp                               disassembler.hpp
-debug.cpp                               events.hpp
-debug.cpp                               frame.hpp
-debug.cpp                               heapDumper.hpp
-debug.cpp                               icBuffer.hpp
-debug.cpp                               interpreter.hpp
-debug.cpp                               java.hpp
-debug.cpp                               markSweep.hpp
-debug.cpp                               nmethod.hpp
-debug.cpp                               oop.inline.hpp
-debug.cpp                               os_<os_family>.inline.hpp
-debug.cpp                               privilegedStack.hpp
-debug.cpp                               resourceArea.hpp
-debug.cpp                               sharedRuntime.hpp
-debug.cpp                               stubCodeGenerator.hpp
-debug.cpp                               stubRoutines.hpp
-debug.cpp                               systemDictionary.hpp
-debug.cpp                               thread_<os_family>.inline.hpp
-debug.cpp                               top.hpp
-debug.cpp                               universe.hpp
-debug.cpp                               vframe.hpp
-debug.cpp                               vmError.hpp
-debug.cpp                               vtableStubs.hpp
-
-debug.hpp                               globalDefinitions.hpp
-
-debugInfo.cpp                           debugInfo.hpp
-debugInfo.cpp                           debugInfoRec.hpp
-debugInfo.cpp                           handles.inline.hpp
-debugInfo.cpp                           nmethod.hpp
-
-debugInfo.hpp                           compressedStream.hpp
-debugInfo.hpp                           growableArray.hpp
-debugInfo.hpp                           location.hpp
-debugInfo.hpp                           nmethod.hpp
-debugInfo.hpp                           oopRecorder.hpp
-debugInfo.hpp                           stackValue.hpp
-
-debugInfoRec.cpp                        debugInfoRec.hpp
-debugInfoRec.cpp                        jvmtiExport.hpp
-debugInfoRec.cpp                        scopeDesc.hpp
-
-debugInfoRec.hpp                        ciClassList.hpp
-debugInfoRec.hpp                        ciInstanceKlass.hpp
-debugInfoRec.hpp                        ciMethod.hpp
-debugInfoRec.hpp                        debugInfo.hpp
-debugInfoRec.hpp                        growableArray.hpp
-debugInfoRec.hpp                        location.hpp
-debugInfoRec.hpp                        oop.hpp
-debugInfoRec.hpp                        oopMap.hpp
-debugInfoRec.hpp                        pcDesc.hpp
-
-debug_<arch>.cpp                        codeCache.hpp
-debug_<arch>.cpp                        debug.hpp
-debug_<arch>.cpp                        frame.hpp
-debug_<arch>.cpp                        init.hpp
-debug_<arch>.cpp                        nmethod.hpp
-debug_<arch>.cpp                        os.hpp
-debug_<arch>.cpp                        top.hpp
-
-defNewGeneration.cpp                    collectorCounters.hpp
-defNewGeneration.cpp                    copy.hpp
-defNewGeneration.cpp                    defNewGeneration.inline.hpp
-defNewGeneration.cpp                    gcLocker.inline.hpp
-defNewGeneration.cpp                    gcPolicyCounters.hpp
-defNewGeneration.cpp                    genCollectedHeap.hpp
-defNewGeneration.cpp                    genOopClosures.inline.hpp
-defNewGeneration.cpp                    generationSpec.hpp
-defNewGeneration.cpp                    instanceRefKlass.hpp
-defNewGeneration.cpp                    iterator.hpp
-defNewGeneration.cpp                    java.hpp
-defNewGeneration.cpp                    oop.inline.hpp
-defNewGeneration.cpp                    referencePolicy.hpp
-defNewGeneration.cpp                    space.inline.hpp
-defNewGeneration.cpp                    spaceDecorator.hpp
-defNewGeneration.cpp                    stack.inline.hpp
-defNewGeneration.cpp                    thread_<os_family>.inline.hpp
-
-defNewGeneration.hpp                    ageTable.hpp
-defNewGeneration.hpp                    cSpaceCounters.hpp
-defNewGeneration.hpp                    generation.inline.hpp
-defNewGeneration.hpp                    generationCounters.hpp
-defNewGeneration.hpp                    stack.hpp
-
-defNewGeneration.inline.hpp             cardTableRS.hpp
-defNewGeneration.inline.hpp             defNewGeneration.hpp
-defNewGeneration.inline.hpp             space.hpp
-
-defaultStream.hpp                       xmlstream.hpp
-
-deoptimization.cpp                      allocation.inline.hpp
-deoptimization.cpp                      biasedLocking.hpp
-deoptimization.cpp                      bytecode.hpp
-deoptimization.cpp			compilationPolicy.hpp
-deoptimization.cpp                      debugInfoRec.hpp
-deoptimization.cpp                      deoptimization.hpp
-deoptimization.cpp                      events.hpp
-deoptimization.cpp                      interfaceSupport.hpp
-deoptimization.cpp                      interpreter.hpp
-deoptimization.cpp                      jvmtiThreadState.hpp
-deoptimization.cpp                      methodOop.hpp
-deoptimization.cpp                      nmethod.hpp
-deoptimization.cpp                      oop.inline.hpp
-deoptimization.cpp                      oopFactory.hpp
-deoptimization.cpp                      oopMapCache.hpp
-deoptimization.cpp                      pcDesc.hpp
-deoptimization.cpp                      resourceArea.hpp
-deoptimization.cpp                      scopeDesc.hpp
-deoptimization.cpp                      sharedRuntime.hpp
-deoptimization.cpp                      signature.hpp
-deoptimization.cpp                      stubRoutines.hpp
-deoptimization.cpp                      systemDictionary.hpp
-deoptimization.cpp                      thread.hpp
-deoptimization.cpp                      vframe.hpp
-deoptimization.cpp                      vframeArray.hpp
-deoptimization.cpp                      vframe_hp.hpp
-deoptimization.cpp                      vmreg_<arch>.inline.hpp
-deoptimization.cpp                      xmlstream.hpp
-
-deoptimization.hpp                      allocation.hpp
-deoptimization.hpp                      frame.inline.hpp
-
-depChecker_<arch>.cpp                   depChecker_<arch>.hpp
-depChecker_<arch>.cpp                   disassembler.hpp
-depChecker_<arch>.cpp                   hpi.hpp
-
-dependencies.cpp                        ciArrayKlass.hpp
-dependencies.cpp                        ciEnv.hpp
-dependencies.cpp                        ciKlass.hpp
-dependencies.cpp                        ciMethod.hpp
-dependencies.cpp                        compileLog.hpp
-dependencies.cpp                        copy.hpp
-dependencies.cpp                        dependencies.hpp
-dependencies.cpp                        handles.inline.hpp
-dependencies.cpp                        oop.inline.hpp
-
-dependencies.hpp                        ciKlass.hpp
-dependencies.hpp                        compressedStream.hpp
-dependencies.hpp                        growableArray.hpp
-dependencies.hpp                        nmethod.hpp
-
-dictionary.cpp                          classLoadingService.hpp
-dictionary.cpp                          dictionary.hpp
-dictionary.cpp                          hashtable.inline.hpp
-dictionary.cpp                          jvmtiRedefineClassesTrace.hpp
-dictionary.cpp                          oop.inline.hpp
-dictionary.cpp                          systemDictionary.hpp
-
-dictionary.hpp                          hashtable.hpp
-dictionary.hpp                          instanceKlass.hpp
-dictionary.hpp                          oop.hpp
-dictionary.hpp                          systemDictionary.hpp
-
-disassembler_<arch>.hpp                 generate_platform_dependent_include
-
-disassembler.cpp                        cardTableModRefBS.hpp
-disassembler.cpp                        codeCache.hpp
-disassembler.cpp                        collectedHeap.hpp
-disassembler.cpp                        depChecker_<arch>.hpp
-disassembler.cpp                        disassembler.hpp
-disassembler.cpp                        fprofiler.hpp
-disassembler.cpp                        handles.inline.hpp
-disassembler.cpp                        hpi.hpp
-disassembler.cpp                        javaClasses.hpp
-disassembler.cpp                        stubCodeGenerator.hpp
-disassembler.cpp                        stubRoutines.hpp
-
-disassembler.hpp                        globals.hpp
-disassembler.hpp                        os_<os_family>.inline.hpp
-
-dtraceAttacher.cpp                      codeCache.hpp
-dtraceAttacher.cpp                      deoptimization.hpp
-dtraceAttacher.cpp                      dtraceAttacher.hpp
-dtraceAttacher.cpp                      resourceArea.hpp
-dtraceAttacher.cpp                      vmThread.hpp
-dtraceAttacher.cpp                      vm_operations.hpp
-
-dtraceJSDT.cpp                          allocation.hpp
-dtraceJSDT.cpp                          codeBlob.hpp
-dtraceJSDT.cpp                          dtraceJSDT.hpp
-dtraceJSDT.cpp                          exceptions.hpp
-dtraceJSDT.cpp                          globalDefinitions.hpp
-dtraceJSDT.cpp                          javaClasses.hpp
-dtraceJSDT.cpp                          jniHandles.hpp
-dtraceJSDT.cpp                          jvm.h
-dtraceJSDT.cpp                          os.hpp
-dtraceJSDT.cpp                          utf8.hpp
-
-dtraceJSDT.hpp                          nativeInst_<arch>.hpp
-dtraceJSDT.hpp                          nmethod.hpp
-
-dtraceJSDT_<os_family>.cpp              allocation.hpp
-dtraceJSDT_<os_family>.cpp              codeBlob.hpp
-dtraceJSDT_<os_family>.cpp              dtraceJSDT.hpp
-dtraceJSDT_<os_family>.cpp              globalDefinitions.hpp
-dtraceJSDT_<os_family>.cpp              javaClasses.hpp
-dtraceJSDT_<os_family>.cpp              jniHandles.hpp
-dtraceJSDT_<os_family>.cpp              jvm.h
-dtraceJSDT_<os_family>.cpp              os.hpp
-dtraceJSDT_<os_family>.cpp              signature.hpp
-
-// dump is jck optional, put cpp deps in includeDB_features
-
-events.cpp                              allocation.inline.hpp
-events.cpp                              events.hpp
-events.cpp                              mutexLocker.hpp
-events.cpp                              osThread.hpp
-events.cpp                              threadLocalStorage.hpp
-events.cpp                              thread_<os_family>.inline.hpp
-events.cpp                              timer.hpp
-
-events.hpp                              allocation.hpp
-events.hpp                              top.hpp
-
-evmCompat.cpp                           debug.hpp
-
-exceptionHandlerTable.cpp               allocation.inline.hpp
-exceptionHandlerTable.cpp               exceptionHandlerTable.hpp
-exceptionHandlerTable.cpp               nmethod.hpp
-
-exceptionHandlerTable.hpp               allocation.hpp
-exceptionHandlerTable.hpp               methodOop.hpp
-
-exceptions.cpp                          compileBroker.hpp
-exceptions.cpp                          events.hpp
-exceptions.cpp                          exceptions.hpp
-exceptions.cpp                          init.hpp
-exceptions.cpp                          java.hpp
-exceptions.cpp                          javaCalls.hpp
-exceptions.cpp                          oop.inline.hpp
-exceptions.cpp                          systemDictionary.hpp
-exceptions.cpp                          threadCritical.hpp
-exceptions.cpp                          thread_<os_family>.inline.hpp
-exceptions.cpp                          vmSymbols.hpp
-
-exceptions.hpp                          allocation.hpp
-exceptions.hpp                          oopsHierarchy.hpp
-exceptions.hpp                          sizes.hpp
-
-fieldDescriptor.cpp                     fieldDescriptor.hpp
-fieldDescriptor.cpp                     handles.inline.hpp
-fieldDescriptor.cpp                     instanceKlass.hpp
-fieldDescriptor.cpp                     resourceArea.hpp
-fieldDescriptor.cpp                     signature.hpp
-fieldDescriptor.cpp                     systemDictionary.hpp
-fieldDescriptor.cpp                     universe.inline.hpp
-fieldDescriptor.cpp                     vmSymbols.hpp
-
-fieldDescriptor.hpp                     accessFlags.hpp
-fieldDescriptor.hpp                     constantPoolOop.hpp
-fieldDescriptor.hpp                     constantTag.hpp
-fieldDescriptor.hpp                     fieldType.hpp
-fieldDescriptor.hpp                     klassOop.hpp
-fieldDescriptor.hpp                     oop.inline.hpp
-fieldDescriptor.hpp                     symbolOop.hpp
-
-fieldType.cpp                           fieldType.hpp
-fieldType.cpp                           oop.inline.hpp
-fieldType.cpp                           oopFactory.hpp
-fieldType.cpp                           signature.hpp
-fieldType.cpp                           systemDictionary.hpp
-fieldType.cpp                           typeArrayKlass.hpp
-
-fieldType.hpp                           allocation.hpp
-fieldType.hpp                           symbolOop.hpp
-
-filemap.cpp                             arguments.hpp
-filemap.cpp                             classLoader.hpp
-filemap.cpp                             defaultStream.hpp
-filemap.cpp                             filemap.hpp
-filemap.cpp                             hpi_<os_family>.hpp
-filemap.cpp                             java.hpp
-filemap.cpp                             os.hpp
-filemap.cpp                             symbolTable.hpp
-
-filemap.hpp                             compactingPermGenGen.hpp
-filemap.hpp                             space.hpp
-
-// forte is jck optional, put cpp deps in includeDB_features
-// fprofiler is jck optional, put cpp deps in includeDB_features
-
-fprofiler.hpp                           thread_<os_family>.inline.hpp
-fprofiler.hpp                           timer.hpp
-
-frame.cpp                               collectedHeap.inline.hpp
-frame.cpp                               frame.inline.hpp
-frame.cpp                               handles.inline.hpp
-frame.cpp                               interpreter.hpp
-frame.cpp                               javaCalls.hpp
-frame.cpp                               markOop.hpp
-frame.cpp                               methodDataOop.hpp
-frame.cpp                               methodOop.hpp
-frame.cpp                               monitorChunk.hpp
-frame.cpp                               nativeInst_<arch>.hpp
-frame.cpp                               oop.inline.hpp
-frame.cpp                               oop.inline2.hpp
-frame.cpp                               oopMapCache.hpp
-frame.cpp                               resourceArea.hpp
-frame.cpp                               sharedRuntime.hpp
-frame.cpp                               signature.hpp
-frame.cpp                               stubCodeGenerator.hpp
-frame.cpp                               stubRoutines.hpp
-frame.cpp                               universe.inline.hpp
-
-frame.hpp                               assembler.hpp
-frame.hpp                               basicLock.hpp
-frame.hpp                               methodOop.hpp
-frame.hpp                               monitorChunk.hpp
-frame.hpp                               registerMap.hpp
-frame.hpp                               top.hpp
-
-frame.inline.hpp                        bytecodeInterpreter.hpp
-frame.inline.hpp                        bytecodeInterpreter.inline.hpp
-frame.inline.hpp                        frame.hpp
-frame.inline.hpp                        interpreter.hpp
-frame.inline.hpp                        jniTypes_<arch>.hpp
-frame.inline.hpp                        methodOop.hpp
-frame.inline.hpp                        signature.hpp
-
-frame_<arch>.cpp                        frame.inline.hpp
-frame_<arch>.cpp                        handles.inline.hpp
-frame_<arch>.cpp                        interpreter.hpp
-frame_<arch>.cpp                        javaCalls.hpp
-frame_<arch>.cpp                        markOop.hpp
-frame_<arch>.cpp                        methodOop.hpp
-frame_<arch>.cpp                        monitorChunk.hpp
-frame_<arch>.cpp                        oop.inline.hpp
-frame_<arch>.cpp                        resourceArea.hpp
-frame_<arch>.cpp                        signature.hpp
-frame_<arch>.cpp                        stubCodeGenerator.hpp
-frame_<arch>.cpp                        stubRoutines.hpp
-frame_<arch>.cpp                        vmreg_<arch>.inline.hpp
-
-frame_<arch>.hpp                        generate_platform_dependent_include
-frame_<arch>.hpp                        synchronizer.hpp
-frame_<arch>.hpp                        top.hpp
-
-frame_<arch>.inline.hpp                 generate_platform_dependent_include
-
-gcLocker.cpp                            gcLocker.inline.hpp
-gcLocker.cpp                            sharedHeap.hpp
-gcLocker.cpp                            resourceArea.hpp
-
-gcLocker.hpp                            collectedHeap.hpp
-gcLocker.hpp                            genCollectedHeap.hpp
-gcLocker.hpp                            oop.hpp
-gcLocker.hpp                            os_<os_family>.inline.hpp
-gcLocker.hpp                            thread_<os_family>.inline.hpp
-gcLocker.hpp                            universe.hpp
-
-gcLocker.inline.hpp                     gcLocker.hpp
-
-genCollectedHeap.cpp                    aprofiler.hpp
-genCollectedHeap.cpp                    biasedLocking.hpp
-genCollectedHeap.cpp                    collectedHeap.inline.hpp
-genCollectedHeap.cpp                    collectorCounters.hpp
-genCollectedHeap.cpp                    compactPermGen.hpp
-genCollectedHeap.cpp                    filemap.hpp
-genCollectedHeap.cpp                    fprofiler.hpp
-genCollectedHeap.cpp                    gcLocker.inline.hpp
-genCollectedHeap.cpp                    genCollectedHeap.hpp
-genCollectedHeap.cpp                    genOopClosures.inline.hpp
-genCollectedHeap.cpp                    generation.inline.hpp
-genCollectedHeap.cpp                    generationSpec.hpp
-genCollectedHeap.cpp                    handles.hpp
-genCollectedHeap.cpp                    handles.inline.hpp
-genCollectedHeap.cpp                    icBuffer.hpp
-genCollectedHeap.cpp                    java.hpp
-genCollectedHeap.cpp                    memoryService.hpp
-genCollectedHeap.cpp                    oop.inline.hpp
-genCollectedHeap.cpp                    oop.inline2.hpp
-genCollectedHeap.cpp                    permGen.hpp
-genCollectedHeap.cpp                    resourceArea.hpp
-genCollectedHeap.cpp                    sharedHeap.hpp
-genCollectedHeap.cpp                    space.hpp
-genCollectedHeap.cpp                    symbolTable.hpp
-genCollectedHeap.cpp                    systemDictionary.hpp
-genCollectedHeap.cpp                    vmError.hpp
-genCollectedHeap.cpp                    vmGCOperations.hpp
-genCollectedHeap.cpp                    vmSymbols.hpp
-genCollectedHeap.cpp                    vmThread.hpp
-genCollectedHeap.cpp                    workgroup.hpp
-
-genCollectedHeap.hpp                    adaptiveSizePolicy.hpp
-genCollectedHeap.hpp                    collectorPolicy.hpp
-genCollectedHeap.hpp                    generation.hpp
-genCollectedHeap.hpp                    sharedHeap.hpp
-
-genMarkSweep.cpp                        codeCache.hpp
-genMarkSweep.cpp                        collectedHeap.inline.hpp
-genMarkSweep.cpp                        copy.hpp
-genMarkSweep.cpp                        events.hpp
-genMarkSweep.cpp                        fprofiler.hpp
-genMarkSweep.cpp                        genCollectedHeap.hpp
-genMarkSweep.cpp                        genMarkSweep.hpp
-genMarkSweep.cpp                        genOopClosures.inline.hpp
-genMarkSweep.cpp                        generation.inline.hpp
-genMarkSweep.cpp                        handles.inline.hpp
-genMarkSweep.cpp                        icBuffer.hpp
-genMarkSweep.cpp                        instanceRefKlass.hpp
-genMarkSweep.cpp                        javaClasses.hpp
-genMarkSweep.cpp                        jvmtiExport.hpp
-genMarkSweep.cpp                        modRefBarrierSet.hpp
-genMarkSweep.cpp                        oop.inline.hpp
-genMarkSweep.cpp                        referencePolicy.hpp
-genMarkSweep.cpp                        space.hpp
-genMarkSweep.cpp                        symbolTable.hpp
-genMarkSweep.cpp                        synchronizer.hpp
-genMarkSweep.cpp                        systemDictionary.hpp
-genMarkSweep.cpp                        thread_<os_family>.inline.hpp
-genMarkSweep.cpp                        vmSymbols.hpp
-genMarkSweep.cpp                        vmThread.hpp
-
-genMarkSweep.hpp                        markSweep.hpp
-
-genOopClosures.hpp                      iterator.hpp
-genOopClosures.hpp                      oop.hpp
-
-genOopClosures.inline.hpp               cardTableRS.hpp
-genOopClosures.inline.hpp               defNewGeneration.hpp
-genOopClosures.inline.hpp               genCollectedHeap.hpp
-genOopClosures.inline.hpp               genOopClosures.hpp
-genOopClosures.inline.hpp               genRemSet.hpp
-genOopClosures.inline.hpp               generation.hpp
-genOopClosures.inline.hpp               sharedHeap.hpp
-genOopClosures.inline.hpp               space.hpp
-
-genRemSet.cpp                           cardTableRS.hpp
-genRemSet.cpp                           genRemSet.hpp
-
-genRemSet.hpp                           oop.hpp
-
-generateOopMap.cpp                      bitMap.inline.hpp
-generateOopMap.cpp                      bytecodeStream.hpp
-generateOopMap.cpp                      generateOopMap.hpp
-generateOopMap.cpp                      handles.inline.hpp
-generateOopMap.cpp                      java.hpp
-generateOopMap.cpp                      oop.inline.hpp
-generateOopMap.cpp                      relocator.hpp
-generateOopMap.cpp                      symbolOop.hpp
-
-generateOopMap.hpp                      allocation.inline.hpp
-generateOopMap.hpp                      bytecodeStream.hpp
-generateOopMap.hpp                      methodOop.hpp
-generateOopMap.hpp                      oopsHierarchy.hpp
-generateOopMap.hpp                      signature.hpp
-generateOopMap.hpp                      universe.inline.hpp
-
-generation.cpp                          allocation.inline.hpp
-generation.cpp                          blockOffsetTable.inline.hpp
-generation.cpp                          cardTableRS.hpp
-generation.cpp                          collectedHeap.inline.hpp
-generation.cpp                          copy.hpp
-generation.cpp                          events.hpp
-generation.cpp                          gcLocker.inline.hpp
-generation.cpp                          genCollectedHeap.hpp
-generation.cpp                          genMarkSweep.hpp
-generation.cpp                          genOopClosures.hpp
-generation.cpp                          genOopClosures.inline.hpp
-generation.cpp                          generation.hpp
-generation.cpp                          generation.inline.hpp
-generation.cpp                          java.hpp
-generation.cpp                          oop.inline.hpp
-generation.cpp                          spaceDecorator.hpp
-generation.cpp                          space.inline.hpp
-
-generation.hpp                          allocation.hpp
-generation.hpp                          collectorCounters.hpp
-generation.hpp                          memRegion.hpp
-generation.hpp                          mutex.hpp
-generation.hpp                          perfData.hpp
-generation.hpp                          referenceProcessor.hpp
-generation.hpp                          universe.hpp
-generation.hpp                          virtualspace.hpp
-generation.hpp                          watermark.hpp
-
-generation.inline.hpp                   genCollectedHeap.hpp
-generation.inline.hpp                   generation.hpp
-generation.inline.hpp                   space.hpp
-
-genOopClosures.hpp                      oop.hpp
-
-generationSpec.cpp                      compactPermGen.hpp
-generationSpec.cpp                      defNewGeneration.hpp
-generationSpec.cpp                      filemap.hpp
-generationSpec.cpp                      genRemSet.hpp
-generationSpec.cpp                      generationSpec.hpp
-generationSpec.cpp                      java.hpp
-generationSpec.cpp                      tenuredGeneration.hpp
-
-generationSpec.hpp                      generation.hpp
-generationSpec.hpp                      permGen.hpp
-
-globalDefinitions.cpp                   globalDefinitions.hpp
-globalDefinitions.cpp                   os.hpp
-globalDefinitions.cpp                   top.hpp
-
-globalDefinitions.hpp                   globalDefinitions_<compiler>.hpp
-globalDefinitions.hpp                   macros.hpp
-
-globalDefinitions_<arch>.hpp            generate_platform_dependent_include
-
-globalDefinitions_<compiler>.hpp        jni.h
-
-globals.cpp                             allocation.inline.hpp
-globals.cpp                             arguments.hpp
-globals.cpp                             globals.hpp
-globals.cpp                             globals_extension.hpp
-globals.cpp                             oop.inline.hpp
-globals.cpp                             ostream.hpp
-globals.cpp                             top.hpp
-
-globals.hpp                             debug.hpp
-globals.hpp                             globals_<arch>.hpp
-globals.hpp                             globals_<os_arch>.hpp
-globals.hpp                             globals_<os_family>.hpp
-
-globals_extension.hpp                   globals.hpp
-globals_extension.hpp                   top.hpp
-
-growableArray.cpp                       growableArray.hpp
-growableArray.cpp                       resourceArea.hpp
-growableArray.cpp                       thread_<os_family>.inline.hpp
-
-growableArray.hpp                       allocation.hpp
-growableArray.hpp                       allocation.inline.hpp
-growableArray.hpp                       debug.hpp
-growableArray.hpp                       globalDefinitions.hpp
-growableArray.hpp                       top.hpp
-
-handles.cpp                             allocation.inline.hpp
-handles.cpp                             handles.inline.hpp
-handles.cpp                             oop.inline.hpp
-handles.cpp                             os_<os_family>.inline.hpp
-handles.cpp                             thread_<os_family>.inline.hpp
-
-handles.hpp                             klass.hpp
-handles.hpp                             klassOop.hpp
-handles.hpp                             top.hpp
-
-handles.inline.hpp                      handles.hpp
-handles.inline.hpp                      thread_<os_family>.inline.hpp
-
-hashtable.cpp                           allocation.inline.hpp
-hashtable.cpp                           dtrace.hpp
-hashtable.cpp                           hashtable.hpp
-hashtable.cpp                           hashtable.inline.hpp
-hashtable.cpp                           oop.inline.hpp
-hashtable.cpp                           resourceArea.hpp
-hashtable.cpp                           safepoint.hpp
-
-hashtable.hpp                           allocation.hpp
-hashtable.hpp                           handles.hpp
-hashtable.hpp                           oop.hpp
-hashtable.hpp                           symbolOop.hpp
-
-hashtable.inline.hpp                    allocation.inline.hpp
-hashtable.inline.hpp                    hashtable.hpp
-
-heap.cpp                                heap.hpp
-heap.cpp                                oop.inline.hpp
-heap.cpp                                os.hpp
-
-heap.hpp                                allocation.hpp
-heap.hpp                                virtualspace.hpp
-
-// heapDumper is jck optional, put cpp deps in includeDB_features
-
-heapDumper.hpp                          allocation.hpp
-heapDumper.hpp                          klassOop.hpp
-heapDumper.hpp                          oop.hpp
-heapDumper.hpp                          os.hpp
-
-// heapInspection is jck optional, put cpp deps in includeDB_features
-
-heapInspection.hpp                      allocation.inline.hpp
-heapInspection.hpp                      oop.inline.hpp
-
-histogram.cpp                           histogram.hpp
-histogram.cpp                           oop.inline.hpp
-
-histogram.hpp                           allocation.hpp
-histogram.hpp                           growableArray.hpp
-histogram.hpp                           os.hpp
-histogram.hpp                           os_<os_family>.inline.hpp
-
-hpi.cpp                                 hpi.hpp
-hpi.cpp                                 jvm.h
-
-hpi.hpp                                 globalDefinitions.hpp
-hpi.hpp                                 hpi_imported.h
-hpi.hpp                                 os.hpp
-hpi.hpp                                 top.hpp
-
-hpi_<os_family>.cpp                     hpi.hpp
-hpi_<os_family>.cpp                     oop.inline.hpp
-hpi_<os_family>.cpp                     os.hpp
-
-hpi_imported.h                          jni.h
-
-icBuffer.cpp                            assembler_<arch>.inline.hpp
-icBuffer.cpp                            collectedHeap.inline.hpp
-icBuffer.cpp                            compiledIC.hpp
-icBuffer.cpp                            icBuffer.hpp
-icBuffer.cpp                            interpreter.hpp
-icBuffer.cpp                            linkResolver.hpp
-icBuffer.cpp                            methodOop.hpp
-icBuffer.cpp                            mutexLocker.hpp
-icBuffer.cpp                            nmethod.hpp
-icBuffer.cpp                            oop.inline.hpp
-icBuffer.cpp                            oop.inline2.hpp
-icBuffer.cpp                            resourceArea.hpp
-icBuffer.cpp                            scopeDesc.hpp
-icBuffer.cpp                            stubRoutines.hpp
-icBuffer.cpp                            universe.inline.hpp
-
-icBuffer.hpp                            allocation.hpp
-icBuffer.hpp                            bytecodes.hpp
-icBuffer.hpp                            stubs.hpp
-
-icBuffer_<arch>.cpp                     assembler.hpp
-icBuffer_<arch>.cpp                     assembler_<arch>.inline.hpp
-icBuffer_<arch>.cpp                     bytecodes.hpp
-icBuffer_<arch>.cpp                     collectedHeap.inline.hpp
-icBuffer_<arch>.cpp                     icBuffer.hpp
-icBuffer_<arch>.cpp                     nativeInst_<arch>.hpp
-icBuffer_<arch>.cpp                     oop.inline.hpp
-icBuffer_<arch>.cpp                     oop.inline2.hpp
-icBuffer_<arch>.cpp                     resourceArea.hpp
-
-icache.cpp                              icache.hpp
-icache.cpp                              resourceArea.hpp
-
-icache.hpp                              allocation.hpp
-icache.hpp                              stubCodeGenerator.hpp
-
-icache_<arch>.cpp                       assembler_<arch>.inline.hpp
-icache_<arch>.cpp                       icache.hpp
-
-icache_<arch>.hpp                       generate_platform_dependent_include
-
-init.cpp                                bytecodes.hpp
-init.cpp                                collectedHeap.hpp
-init.cpp                                handles.inline.hpp
-init.cpp                                icBuffer.hpp
-init.cpp                                icache.hpp
-init.cpp                                init.hpp
-init.cpp                                methodHandles.hpp
-init.cpp                                safepoint.hpp
-init.cpp                                sharedRuntime.hpp
-init.cpp                                universe.hpp
-
-init.hpp                                top.hpp
-
-instanceKlass.cpp                       collectedHeap.inline.hpp
-instanceKlass.cpp                       compileBroker.hpp
-instanceKlass.cpp                       dtrace.hpp
-instanceKlass.cpp                       fieldDescriptor.hpp
-instanceKlass.cpp                       genOopClosures.inline.hpp
-instanceKlass.cpp                       handles.inline.hpp
-instanceKlass.cpp                       instanceKlass.hpp
-instanceKlass.cpp                       instanceOop.hpp
-instanceKlass.cpp                       javaCalls.hpp
-instanceKlass.cpp                       javaClasses.hpp
-instanceKlass.cpp                       jvmti.h
-instanceKlass.cpp                       jvmtiExport.hpp
-instanceKlass.cpp                       jvmtiRedefineClassesTrace.hpp
-instanceKlass.cpp                       markSweep.inline.hpp
-instanceKlass.cpp                       methodOop.hpp
-instanceKlass.cpp                       mutexLocker.hpp
-instanceKlass.cpp                       objArrayKlassKlass.hpp
-instanceKlass.cpp                       oop.inline.hpp
-instanceKlass.cpp                       oopFactory.hpp
-instanceKlass.cpp                       oopMapCache.hpp
-instanceKlass.cpp                       permGen.hpp
-instanceKlass.cpp                       rewriter.hpp
-instanceKlass.cpp                       symbolOop.hpp
-instanceKlass.cpp                       systemDictionary.hpp
-instanceKlass.cpp                       threadService.hpp
-instanceKlass.cpp                       thread_<os_family>.inline.hpp
-instanceKlass.cpp                       verifier.hpp
-instanceKlass.cpp                       vmSymbols.hpp
-
-instanceKlass.hpp                       accessFlags.hpp
-instanceKlass.hpp                       bitMap.inline.hpp
-instanceKlass.hpp                       constMethodOop.hpp
-instanceKlass.hpp                       constantPoolOop.hpp
-instanceKlass.hpp                       handles.hpp
-instanceKlass.hpp                       instanceOop.hpp
-instanceKlass.hpp                       klassOop.hpp
-instanceKlass.hpp                       klassVtable.hpp
-instanceKlass.hpp                       objArrayOop.hpp
-instanceKlass.hpp                       os.hpp
-
-instanceKlassKlass.cpp                  collectedHeap.inline.hpp
-instanceKlassKlass.cpp                  constantPoolOop.hpp
-instanceKlassKlass.cpp                  fieldDescriptor.hpp
-instanceKlassKlass.cpp                  gcLocker.hpp
-instanceKlassKlass.cpp                  instanceKlass.hpp
-instanceKlassKlass.cpp                  instanceKlassKlass.hpp
-instanceKlassKlass.cpp                  instanceRefKlass.hpp
-instanceKlassKlass.cpp                  javaClasses.hpp
-instanceKlassKlass.cpp                  jvmtiExport.hpp
-instanceKlassKlass.cpp                  markSweep.inline.hpp
-instanceKlassKlass.cpp                  objArrayKlassKlass.hpp
-instanceKlassKlass.cpp                  objArrayOop.hpp
-instanceKlassKlass.cpp                  oop.inline.hpp
-instanceKlassKlass.cpp                  oop.inline2.hpp
-instanceKlassKlass.cpp                  oopMapCache.hpp
-instanceKlassKlass.cpp                  symbolOop.hpp
-instanceKlassKlass.cpp                  systemDictionary.hpp
-instanceKlassKlass.cpp                  typeArrayOop.hpp
-
-instanceKlassKlass.hpp                  klassKlass.hpp
-
-instanceOop.cpp                         instanceOop.hpp
-
-instanceOop.hpp                         oop.hpp
-
-instanceRefKlass.cpp                    collectedHeap.hpp
-instanceRefKlass.cpp                    collectedHeap.inline.hpp
-instanceRefKlass.cpp                    genCollectedHeap.hpp
-instanceRefKlass.cpp                    genOopClosures.inline.hpp
-instanceRefKlass.cpp                    instanceRefKlass.hpp
-instanceRefKlass.cpp                    javaClasses.hpp
-instanceRefKlass.cpp                    markSweep.inline.hpp
-instanceRefKlass.cpp                    oop.inline.hpp
-instanceRefKlass.cpp                    preserveException.hpp
-instanceRefKlass.cpp                    systemDictionary.hpp
-
-instanceRefKlass.hpp                    instanceKlass.hpp
-
-interfaceSupport.cpp                    collectedHeap.hpp
-interfaceSupport.cpp                    collectedHeap.inline.hpp
-interfaceSupport.cpp                    genCollectedHeap.hpp
-interfaceSupport.cpp                    init.hpp
-interfaceSupport.cpp                    interfaceSupport.hpp
-interfaceSupport.cpp                    markSweep.hpp
-interfaceSupport.cpp                    preserveException.hpp
-interfaceSupport.cpp                    resourceArea.hpp
-interfaceSupport.cpp                    threadLocalStorage.hpp
-interfaceSupport.cpp                    vframe.hpp
-
-interfaceSupport.hpp                    gcLocker.hpp
-interfaceSupport.hpp                    globalDefinitions.hpp
-interfaceSupport.hpp                    handles.inline.hpp
-interfaceSupport.hpp                    mutexLocker.hpp
-interfaceSupport.hpp                    orderAccess.hpp
-interfaceSupport.hpp                    os.hpp
-interfaceSupport.hpp                    preserveException.hpp
-interfaceSupport.hpp                    safepoint.hpp
-interfaceSupport.hpp                    thread_<os_family>.inline.hpp
-interfaceSupport.hpp                    top.hpp
-interfaceSupport.hpp                    vmThread.hpp
-
-interfaceSupport_<os_family>.hpp        generate_platform_dependent_include
-
-interp_masm_<arch_model>.cpp            arrayOop.hpp
-interp_masm_<arch_model>.cpp            basicLock.hpp
-interp_masm_<arch_model>.cpp            biasedLocking.hpp
-interp_masm_<arch_model>.cpp            interp_masm_<arch_model>.hpp
-interp_masm_<arch_model>.cpp            interpreterRuntime.hpp
-interp_masm_<arch_model>.cpp            interpreter.hpp
-interp_masm_<arch_model>.cpp            jvmtiExport.hpp
-interp_masm_<arch_model>.cpp            jvmtiRedefineClassesTrace.hpp
-interp_masm_<arch_model>.cpp            jvmtiThreadState.hpp
-interp_masm_<arch_model>.cpp            markOop.hpp
-interp_masm_<arch_model>.cpp            methodDataOop.hpp
-interp_masm_<arch_model>.cpp            methodOop.hpp
-interp_masm_<arch_model>.cpp            sharedRuntime.hpp
-interp_masm_<arch_model>.cpp            thread_<os_family>.inline.hpp
-
-interp_masm_<arch_model>.hpp            assembler_<arch>.inline.hpp
-interp_masm_<arch_model>.hpp            invocationCounter.hpp
-
-interpreter.cpp                         allocation.inline.hpp
-interpreter.cpp                         arrayOop.hpp
-interpreter.cpp                         assembler.hpp
-interpreter.cpp                         bytecodeHistogram.hpp
-interpreter.cpp                         bytecodeInterpreter.hpp
-interpreter.cpp                         forte.hpp
-interpreter.cpp                         handles.inline.hpp
-interpreter.cpp                         interpreter.hpp
-interpreter.cpp                         interpreterRuntime.hpp
-interpreter.cpp                         interpreter.hpp
-interpreter.cpp                         jvmtiExport.hpp
-interpreter.cpp                         methodDataOop.hpp
-interpreter.cpp                         methodOop.hpp
-interpreter.cpp                         oop.inline.hpp
-interpreter.cpp                         resourceArea.hpp
-interpreter.cpp                         sharedRuntime.hpp
-interpreter.cpp                         stubRoutines.hpp
-interpreter.cpp                         templateTable.hpp
-interpreter.cpp                         timer.hpp
-
-interpreter.hpp                         cppInterpreter.hpp
-interpreter.hpp                         stubs.hpp
-interpreter.hpp                         templateInterpreter.hpp
-
-interpreterRT_<arch_model>.cpp          allocation.inline.hpp
-interpreterRT_<arch_model>.cpp          handles.inline.hpp
-interpreterRT_<arch_model>.cpp          icache.hpp
-interpreterRT_<arch_model>.cpp          interfaceSupport.hpp
-interpreterRT_<arch_model>.cpp          interpreterRuntime.hpp
-interpreterRT_<arch_model>.cpp          interpreter.hpp
-interpreterRT_<arch_model>.cpp          methodOop.hpp
-interpreterRT_<arch_model>.cpp          oop.inline.hpp
-interpreterRT_<arch_model>.cpp          signature.hpp
-interpreterRT_<arch_model>.cpp          universe.inline.hpp
-
-interpreterRT_<arch>.hpp                allocation.hpp
-interpreterRT_<arch>.hpp                generate_platform_dependent_include
-
-interpreterRuntime.cpp                  biasedLocking.hpp
-interpreterRuntime.cpp                  collectedHeap.hpp
-interpreterRuntime.cpp                  compileBroker.hpp
-interpreterRuntime.cpp                  compilationPolicy.hpp
-interpreterRuntime.cpp                  constantPoolOop.hpp
-interpreterRuntime.cpp                  cpCacheOop.hpp
-interpreterRuntime.cpp                  deoptimization.hpp
-interpreterRuntime.cpp                  events.hpp
-interpreterRuntime.cpp                  fieldDescriptor.hpp
-interpreterRuntime.cpp                  handles.inline.hpp
-interpreterRuntime.cpp                  instanceKlass.hpp
-interpreterRuntime.cpp                  interfaceSupport.hpp
-interpreterRuntime.cpp                  interpreterRuntime.hpp
-interpreterRuntime.cpp                  interpreter.hpp
-interpreterRuntime.cpp                  java.hpp
-interpreterRuntime.cpp                  jfieldIDWorkaround.hpp
-interpreterRuntime.cpp                  jvmtiExport.hpp
-interpreterRuntime.cpp                  linkResolver.hpp
-interpreterRuntime.cpp                  methodDataOop.hpp
-interpreterRuntime.cpp                  nativeLookup.hpp
-interpreterRuntime.cpp                  objArrayKlass.hpp
-interpreterRuntime.cpp                  oop.inline.hpp
-interpreterRuntime.cpp                  oopFactory.hpp
-interpreterRuntime.cpp                  osThread.hpp
-interpreterRuntime.cpp                  sharedRuntime.hpp
-interpreterRuntime.cpp                  stubRoutines.hpp
-interpreterRuntime.cpp                  symbolOop.hpp
-interpreterRuntime.cpp                  synchronizer.hpp
-interpreterRuntime.cpp                  systemDictionary.hpp
-interpreterRuntime.cpp                  templateTable.hpp
-interpreterRuntime.cpp                  threadCritical.hpp
-interpreterRuntime.cpp                  universe.inline.hpp
-interpreterRuntime.cpp                  vmSymbols.hpp
-interpreterRuntime.cpp                  vm_version_<arch>.hpp
-
-interpreterRuntime.hpp                  bytecode.hpp
-interpreterRuntime.hpp                  frame.inline.hpp
-interpreterRuntime.hpp                  linkResolver.hpp
-interpreterRuntime.hpp                  methodOop.hpp
-interpreterRuntime.hpp                  signature.hpp
-interpreterRuntime.hpp                  thread_<os_family>.inline.hpp
-interpreterRuntime.hpp                  top.hpp
-interpreterRuntime.hpp                  universe.hpp
-
-interpreter_<arch_model>.cpp            arguments.hpp
-interpreter_<arch_model>.cpp            arrayOop.hpp
-interpreter_<arch_model>.cpp            assembler.hpp
-interpreter_<arch_model>.cpp            bytecodeHistogram.hpp
-interpreter_<arch_model>.cpp            debug.hpp
-interpreter_<arch_model>.cpp            deoptimization.hpp
-interpreter_<arch_model>.cpp            frame.inline.hpp
-interpreter_<arch_model>.cpp            interpreterRuntime.hpp
-interpreter_<arch_model>.cpp            interpreter.hpp
-interpreter_<arch_model>.cpp            interpreterGenerator.hpp
-interpreter_<arch_model>.cpp            jvmtiExport.hpp
-interpreter_<arch_model>.cpp            jvmtiThreadState.hpp
-interpreter_<arch_model>.cpp            methodDataOop.hpp
-interpreter_<arch_model>.cpp            methodHandles.hpp
-interpreter_<arch_model>.cpp            methodOop.hpp
-interpreter_<arch_model>.cpp            oop.inline.hpp
-interpreter_<arch_model>.cpp            sharedRuntime.hpp
-interpreter_<arch_model>.cpp            stubRoutines.hpp
-interpreter_<arch_model>.cpp            synchronizer.hpp
-interpreter_<arch_model>.cpp            templateTable.hpp
-interpreter_<arch_model>.cpp            timer.hpp
-interpreter_<arch_model>.cpp            vframeArray.hpp
-
-interpreter_<arch>.hpp                  generate_platform_dependent_include
-
-interpreterGenerator.hpp                cppInterpreter.hpp
-interpreterGenerator.hpp                cppInterpreterGenerator.hpp
-interpreterGenerator.hpp                templateInterpreter.hpp
-interpreterGenerator.hpp                templateInterpreterGenerator.hpp
-
-interpreterGenerator_<arch>.hpp         generate_platform_dependent_include
-
-invocationCounter.cpp                   frame.hpp
-invocationCounter.cpp                   handles.inline.hpp
-invocationCounter.cpp                   invocationCounter.hpp
-
-invocationCounter.hpp                   allocation.hpp
-invocationCounter.hpp                   exceptions.hpp
-invocationCounter.hpp                   handles.hpp
-
-intHisto.cpp				intHisto.hpp
-
-intHisto.hpp				allocation.hpp
-intHisto.hpp                            growableArray.hpp
-
-iterator.cpp                            iterator.hpp
-iterator.cpp                            oop.inline.hpp
-
-iterator.hpp                            allocation.hpp
-iterator.hpp                            memRegion.hpp
-iterator.hpp                            prefetch.hpp
-iterator.hpp                            top.hpp
-
-java.cpp                                aprofiler.hpp
-java.cpp                                arguments.hpp
-java.cpp                                biasedLocking.hpp
-java.cpp                                bytecodeHistogram.hpp
-java.cpp                                classLoader.hpp
-java.cpp                                codeCache.hpp
-java.cpp                                compilationPolicy.hpp
-java.cpp                                compileBroker.hpp
-java.cpp                                compilerOracle.hpp
-java.cpp                                constantPoolOop.hpp
-java.cpp                                dtrace.hpp
-java.cpp                                fprofiler.hpp
-java.cpp                                genCollectedHeap.hpp
-java.cpp                                generateOopMap.hpp
-java.cpp                                globalDefinitions.hpp
-java.cpp                                histogram.hpp
-java.cpp                                init.hpp
-java.cpp                                instanceKlass.hpp
-java.cpp                                instanceKlassKlass.hpp
-java.cpp                                instanceOop.hpp
-java.cpp                                interfaceSupport.hpp
-java.cpp                                java.hpp
-java.cpp                                jvmtiExport.hpp
-java.cpp                                memprofiler.hpp
-java.cpp                                methodOop.hpp
-java.cpp                                objArrayOop.hpp
-java.cpp                                oop.inline.hpp
-java.cpp                                oopFactory.hpp
-java.cpp                                sharedRuntime.hpp
-java.cpp                                statSampler.hpp
-java.cpp                                symbolOop.hpp
-java.cpp                                symbolTable.hpp
-java.cpp                                systemDictionary.hpp
-java.cpp                                task.hpp
-java.cpp                                thread_<os_family>.inline.hpp
-java.cpp                                timer.hpp
-java.cpp                                universe.hpp
-java.cpp                                vmError.hpp
-java.cpp                                vm_operations.hpp
-java.cpp                                vm_version_<arch>.hpp
-
-java.hpp                                os.hpp
-
-javaAssertions.cpp                      allocation.inline.hpp
-javaAssertions.cpp                      handles.inline.hpp
-javaAssertions.cpp                      javaAssertions.hpp
-javaAssertions.cpp                      javaClasses.hpp
-javaAssertions.cpp                      oop.inline.hpp
-javaAssertions.cpp                      oopFactory.hpp
-javaAssertions.cpp                      systemDictionary.hpp
-javaAssertions.cpp                      vmSymbols.hpp
-
-javaAssertions.hpp                      exceptions.hpp
-javaAssertions.hpp                      objArrayOop.hpp
-javaAssertions.hpp                      ostream.hpp
-javaAssertions.hpp                      typeArrayOop.hpp
-
-javaCalls.cpp                           compilationPolicy.hpp
-javaCalls.cpp                           compileBroker.hpp
-javaCalls.cpp                           handles.inline.hpp
-javaCalls.cpp                           interfaceSupport.hpp
-javaCalls.cpp                           interpreter.hpp
-javaCalls.cpp                           javaCalls.hpp
-javaCalls.cpp                           jniCheck.hpp
-javaCalls.cpp                           linkResolver.hpp
-javaCalls.cpp                           mutexLocker.hpp
-javaCalls.cpp                           nmethod.hpp
-javaCalls.cpp                           oop.inline.hpp
-javaCalls.cpp                           signature.hpp
-javaCalls.cpp                           stubRoutines.hpp
-javaCalls.cpp                           systemDictionary.hpp
-javaCalls.cpp                           thread_<os_family>.inline.hpp
-javaCalls.cpp                           universe.inline.hpp
-javaCalls.cpp                           vmSymbols.hpp
-javaCalls.hpp                           allocation.hpp
-
-javaCalls.hpp                           handles.hpp
-javaCalls.hpp                           javaFrameAnchor.hpp
-javaCalls.hpp                           jniTypes_<arch>.hpp
-javaCalls.hpp                           methodOop.hpp
-javaCalls.hpp                           thread_<os_family>.inline.hpp
-javaCalls.hpp                           vmThread.hpp
-
-javaClasses.cpp                         debugInfo.hpp
-javaClasses.cpp                         fieldDescriptor.hpp
-javaClasses.cpp                         handles.inline.hpp
-javaClasses.cpp                         instanceKlass.hpp
-javaClasses.cpp                         interfaceSupport.hpp
-javaClasses.cpp                         interpreter.hpp
-javaClasses.cpp                         java.hpp
-javaClasses.cpp                         javaCalls.hpp
-javaClasses.cpp                         javaClasses.hpp
-javaClasses.cpp                         klass.hpp
-javaClasses.cpp                         klassOop.hpp
-javaClasses.cpp                         methodOop.hpp
-javaClasses.cpp                         oopFactory.hpp
-javaClasses.cpp                         pcDesc.hpp
-javaClasses.cpp                         preserveException.hpp
-javaClasses.cpp                         resourceArea.hpp
-javaClasses.cpp                         safepoint.hpp
-javaClasses.cpp                         symbolOop.hpp
-javaClasses.cpp                         symbolTable.hpp
-javaClasses.cpp                         thread_<os_family>.inline.hpp
-javaClasses.cpp                         typeArrayOop.hpp
-javaClasses.cpp                         universe.inline.hpp
-javaClasses.cpp                         vframe.hpp
-javaClasses.cpp                         vmSymbols.hpp
-
-javaClasses.hpp                         jvmti.h
-javaClasses.hpp                         oop.hpp
-javaClasses.hpp                         os.hpp
-javaClasses.hpp                         systemDictionary.hpp
-javaClasses.hpp                         utf8.hpp
-
-javaFrameAnchor.hpp                     globalDefinitions.hpp
-javaFrameAnchor.hpp                     orderAccess_<os_arch>.inline.hpp
-
-javaFrameAnchor_<arch>.hpp              generate_platform_dependent_include
-
-jni.cpp                                 allocation.inline.hpp
-jni.cpp                                 classLoader.hpp
-jni.cpp                                 compilationPolicy.hpp
-jni.cpp                                 defaultStream.hpp
-jni.cpp                                 dtrace.hpp
-jni.cpp                                 events.hpp
-jni.cpp                                 fieldDescriptor.hpp
-jni.cpp                                 fprofiler.hpp
-jni.cpp                                 gcLocker.inline.hpp
-jni.cpp                                 handles.inline.hpp
-jni.cpp                                 histogram.hpp
-jni.cpp                                 instanceKlass.hpp
-jni.cpp                                 instanceOop.hpp
-jni.cpp                                 interfaceSupport.hpp
-jni.cpp                                 java.hpp
-jni.cpp                                 javaCalls.hpp
-jni.cpp                                 javaClasses.hpp
-jni.cpp                                 jfieldIDWorkaround.hpp
-jni.cpp                                 jni.h
-jni.cpp                                 jniCheck.hpp
-jni.cpp                                 jniFastGetField.hpp
-jni.cpp                                 jniTypes_<arch>.hpp
-jni.cpp                                 jvm.h
-jni.cpp                                 jvm_misc.hpp
-jni.cpp                                 jvmtiExport.hpp
-jni.cpp                                 jvmtiThreadState.hpp
-jni.cpp                                 linkResolver.hpp
-jni.cpp                                 markOop.hpp
-jni.cpp                                 methodOop.hpp
-jni.cpp                                 objArrayKlass.hpp
-jni.cpp                                 objArrayOop.hpp
-jni.cpp                                 oop.inline.hpp
-jni.cpp                                 oopFactory.hpp
-jni.cpp                                 os_<os_family>.inline.hpp
-jni.cpp                                 reflection.hpp
-jni.cpp                                 runtimeService.hpp
-jni.cpp                                 sharedRuntime.hpp
-jni.cpp                                 signature.hpp
-jni.cpp                                 symbolOop.hpp
-jni.cpp                                 symbolTable.hpp
-jni.cpp                                 systemDictionary.hpp
-jni.cpp                                 thread_<os_family>.inline.hpp
-jni.cpp                                 typeArrayKlass.hpp
-jni.cpp                                 typeArrayOop.hpp
-jni.cpp                                 universe.inline.hpp
-jni.cpp                                 vmSymbols.hpp
-jni.cpp                                 vm_operations.hpp
-
-// jniCheck is jck optional, put cpp deps in includeDB_features
-
-jniFastGetField.cpp                     jniFastGetField.hpp
-
-jniFastGetField.hpp                     allocation.hpp
-jniFastGetField.hpp                     jvm_misc.hpp
-
-jniFastGetField_<arch_model>.cpp        assembler_<arch>.inline.hpp
-jniFastGetField_<arch_model>.cpp        jniFastGetField.hpp
-jniFastGetField_<arch_model>.cpp        jvm_misc.hpp
-jniFastGetField_<arch_model>.cpp        resourceArea.hpp
-jniFastGetField_<arch_model>.cpp        safepoint.hpp
-
-jniHandles.cpp                          jniHandles.hpp
-jniHandles.cpp                          mutexLocker.hpp
-jniHandles.cpp                          oop.inline.hpp
-jniHandles.cpp                          systemDictionary.hpp
-jniHandles.cpp                          thread_<os_family>.inline.hpp
-
-jniHandles.hpp                          handles.hpp
-jniHandles.hpp                          top.hpp
-
-jniPeriodicChecker.cpp                  allocation.inline.hpp
-jniPeriodicChecker.cpp                  jniPeriodicChecker.hpp
-jniPeriodicChecker.cpp                  task.hpp
-
-jniTypes_<arch>.hpp                     allocation.hpp
-jniTypes_<arch>.hpp                     jni.h
-jniTypes_<arch>.hpp                     oop.hpp
-
-jni_<arch>.h                            generate_platform_dependent_include
-
-jvm.cpp                                 arguments.hpp
-jvm.cpp                                 attachListener.hpp
-jvm.cpp                                 classLoader.hpp
-jvm.cpp                                 collectedHeap.inline.hpp
-jvm.cpp                                 copy.hpp
-jvm.cpp                                 defaultStream.hpp
-jvm.cpp                                 dtrace.hpp
-jvm.cpp                                 dtraceJSDT.hpp
-jvm.cpp                                 events.hpp
-jvm.cpp                                 handles.inline.hpp
-jvm.cpp                                 histogram.hpp
-jvm.cpp                                 hpi.hpp
-jvm.cpp                                 hpi_<os_family>.hpp
-jvm.cpp                                 init.hpp
-jvm.cpp                                 instanceKlass.hpp
-jvm.cpp                                 interfaceSupport.hpp
-jvm.cpp                                 java.hpp
-jvm.cpp                                 javaAssertions.hpp
-jvm.cpp                                 javaCalls.hpp
-jvm.cpp                                 javaClasses.hpp
-jvm.cpp                                 jfieldIDWorkaround.hpp
-jvm.cpp                                 jvm.h
-jvm.cpp                                 jvm_<os_family>.h
-jvm.cpp                                 jvm_misc.hpp
-jvm.cpp                                 jvmtiExport.hpp
-jvm.cpp                                 jvmtiThreadState.hpp
-jvm.cpp                                 management.hpp
-jvm.cpp                                 nativeLookup.hpp
-jvm.cpp                                 objArrayKlass.hpp
-jvm.cpp                                 oopFactory.hpp
-jvm.cpp                                 os.hpp
-jvm.cpp                                 perfData.hpp
-jvm.cpp                                 privilegedStack.hpp
-jvm.cpp                                 reflection.hpp
-jvm.cpp                                 symbolTable.hpp
-jvm.cpp                                 systemDictionary.hpp
-jvm.cpp                                 threadService.hpp
-jvm.cpp                                 top.hpp
-jvm.cpp                                 universe.inline.hpp
-jvm.cpp                                 utf8.hpp
-jvm.cpp                                 vframe.hpp
-jvm.cpp                                 vmSymbols.hpp
-jvm.cpp                                 vm_operations.hpp
-
-jvm.h                                   globalDefinitions.hpp
-jvm.h                                   jni.h
-jvm.h                                   jvm_<os_family>.h
-jvm.h                                   reflectionCompat.hpp
-
-jvm_<os_family>.cpp                     interfaceSupport.hpp
-jvm_<os_family>.cpp                     jvm.h
-jvm_<os_family>.cpp                     osThread.hpp
-
-jvm_misc.hpp                            handles.hpp
-jvm_misc.hpp                            jni.h
-
-jvmtiExport.hpp                         allocation.hpp
-jvmtiExport.hpp                         globalDefinitions.hpp
-jvmtiExport.hpp                         growableArray.hpp
-jvmtiExport.hpp                         handles.hpp
-jvmtiExport.hpp                         iterator.hpp
-jvmtiExport.hpp                         jvmti.h
-jvmtiExport.hpp                         jvmticmlr.h
-jvmtiExport.hpp                         oop.hpp
-jvmtiExport.hpp                         oopsHierarchy.hpp
-
-jvmtiThreadState.hpp                    allocation.hpp
-jvmtiThreadState.hpp                    allocation.inline.hpp
-jvmtiThreadState.hpp                    growableArray.hpp
-jvmtiThreadState.hpp                    jvmti.h
-jvmtiThreadState.hpp                    jvmtiEventController.hpp
-jvmtiThreadState.hpp                    thread.hpp
-
-klass.cpp                               atomic.hpp
-klass.cpp                               collectedHeap.inline.hpp
-klass.cpp                               instanceKlass.hpp
-klass.cpp                               klass.inline.hpp
-klass.cpp                               klassOop.hpp
-klass.cpp                               oop.inline.hpp
-klass.cpp                               oop.inline2.hpp
-klass.cpp                               oopFactory.hpp
-klass.cpp                               resourceArea.hpp
-klass.cpp                               systemDictionary.hpp
-klass.cpp                               vmSymbols.hpp
-
-klass.hpp                               accessFlags.hpp
-klass.hpp                               genOopClosures.hpp
-klass.hpp                               iterator.hpp
-klass.hpp                               klassOop.hpp
-klass.hpp                               klassPS.hpp
-klass.hpp                               memRegion.hpp
-klass.hpp                               oop.hpp
-klass.hpp                               specialized_oop_closures.hpp
-
-klass.inline.hpp                        klass.hpp
-klass.inline.hpp                        markOop.hpp
-
-klassKlass.cpp                          collectedHeap.hpp
-klassKlass.cpp                          collectedHeap.inline.hpp
-klassKlass.cpp                          constantPoolKlass.hpp
-klassKlass.cpp                          handles.inline.hpp
-klassKlass.cpp                          instanceKlass.hpp
-klassKlass.cpp                          instanceOop.hpp
-klassKlass.cpp                          klassKlass.hpp
-klassKlass.cpp                          klassOop.hpp
-klassKlass.cpp                          markSweep.inline.hpp
-klassKlass.cpp                          methodKlass.hpp
-klassKlass.cpp                          objArrayKlass.hpp
-klassKlass.cpp                          oop.inline.hpp
-klassKlass.cpp                          oop.inline2.hpp
-klassKlass.cpp                          oopFactory.hpp
-klassKlass.cpp                          permGen.hpp
-klassKlass.cpp                          symbolKlass.hpp
-klassKlass.cpp                          symbolOop.hpp
-klassKlass.cpp                          typeArrayKlass.hpp
-
-klassKlass.hpp                          klass.hpp
-klassKlass.hpp                          klassOop.hpp
-klassKlass.hpp                          oopFactory.hpp
-
-klassOop.cpp                            klassOop.hpp
-
-klassOop.hpp                            oop.hpp
-
-klassVtable.cpp                         arguments.hpp
-klassVtable.cpp                         copy.hpp
-klassVtable.cpp                         gcLocker.hpp
-klassVtable.cpp                         handles.inline.hpp
-klassVtable.cpp                         instanceKlass.hpp
-klassVtable.cpp                         jvmtiRedefineClassesTrace.hpp
-klassVtable.cpp                         klassOop.hpp
-klassVtable.cpp                         klassVtable.hpp
-klassVtable.cpp                         markSweep.inline.hpp
-klassVtable.cpp                         methodOop.hpp
-klassVtable.cpp                         objArrayOop.hpp
-klassVtable.cpp                         oop.inline.hpp
-klassVtable.cpp                         resourceArea.hpp
-klassVtable.cpp                         systemDictionary.hpp
-klassVtable.cpp                         universe.inline.hpp
-klassVtable.cpp                         vmSymbols.hpp
-
-klassVtable.hpp                         allocation.hpp
-klassVtable.hpp                         growableArray.hpp
-klassVtable.hpp                         handles.hpp
-klassVtable.hpp                         oopsHierarchy.hpp
-
-linkResolver.cpp                        bytecode.hpp
-linkResolver.cpp                        collectedHeap.inline.hpp
-linkResolver.cpp                        compilationPolicy.hpp
-linkResolver.cpp                        compileBroker.hpp
-linkResolver.cpp                        fieldDescriptor.hpp
-linkResolver.cpp                        frame.inline.hpp
-linkResolver.cpp                        handles.inline.hpp
-linkResolver.cpp                        instanceKlass.hpp
-linkResolver.cpp                        interpreterRuntime.hpp
-linkResolver.cpp                        linkResolver.hpp
-linkResolver.cpp                        methodHandles.hpp
-linkResolver.cpp                        nativeLookup.hpp
-linkResolver.cpp                        objArrayOop.hpp
-linkResolver.cpp                        reflection.hpp
-linkResolver.cpp                        resourceArea.hpp
-linkResolver.cpp                        signature.hpp
-linkResolver.cpp                        systemDictionary.hpp
-linkResolver.cpp                        thread_<os_family>.inline.hpp
-linkResolver.cpp                        universe.inline.hpp
-linkResolver.cpp                        vmSymbols.hpp
-linkResolver.cpp                        vmThread.hpp
-
-linkResolver.hpp                        methodOop.hpp
-linkResolver.hpp                        top.hpp
-
-liveRange.hpp                           copy.hpp
-
-loaderConstraints.cpp                   handles.inline.hpp
-loaderConstraints.cpp                   hashtable.inline.hpp
-loaderConstraints.cpp                   loaderConstraints.hpp
-loaderConstraints.cpp                   oop.inline.hpp
-loaderConstraints.cpp                   resourceArea.hpp
-loaderConstraints.cpp                   safepoint.hpp
-
-loaderConstraints.hpp                   dictionary.hpp
-loaderConstraints.hpp                   placeholders.hpp
-loaderConstraints.hpp                   hashtable.hpp
-
-location.cpp                            debugInfo.hpp
-location.cpp                            location.hpp
-
-location.hpp                            allocation.hpp
-location.hpp                            assembler.hpp
-location.hpp                            vmreg.hpp
-
-lowMemoryDetector.cpp                   interfaceSupport.hpp
-lowMemoryDetector.cpp                   java.hpp
-lowMemoryDetector.cpp                   javaCalls.hpp
-lowMemoryDetector.cpp                   lowMemoryDetector.hpp
-lowMemoryDetector.cpp                   management.hpp
-lowMemoryDetector.cpp                   mutex.hpp
-lowMemoryDetector.cpp                   mutexLocker.hpp
-lowMemoryDetector.cpp                   oop.inline.hpp
-lowMemoryDetector.cpp                   systemDictionary.hpp
-lowMemoryDetector.cpp                   vmSymbols.hpp
-
-lowMemoryDetector.hpp                   allocation.hpp
-lowMemoryDetector.hpp                   memoryPool.hpp
-lowMemoryDetector.hpp                   memoryService.hpp
-
-management.cpp                          arguments.hpp
-management.cpp                          classLoadingService.hpp
-management.cpp                          compileBroker.hpp
-management.cpp                          handles.inline.hpp
-management.cpp                          heapDumper.hpp
-management.cpp                          interfaceSupport.hpp
-management.cpp                          iterator.hpp
-management.cpp                          javaCalls.hpp
-management.cpp                          jniHandles.hpp
-management.cpp                          klass.hpp
-management.cpp                          klassOop.hpp
-management.cpp                          lowMemoryDetector.hpp
-management.cpp                          management.hpp
-management.cpp                          memoryManager.hpp
-management.cpp                          memoryPool.hpp
-management.cpp                          memoryService.hpp
-management.cpp                          objArrayKlass.hpp
-management.cpp                          oop.inline.hpp
-management.cpp                          oopFactory.hpp
-management.cpp                          os.hpp
-management.cpp                          resourceArea.hpp
-management.cpp                          runtimeService.hpp
-management.cpp                          systemDictionary.hpp
-management.cpp                          threadService.hpp
-
-management.hpp                          allocation.hpp
-management.hpp                          handles.hpp
-management.hpp                          jmm.h
-management.hpp                          timer.hpp
-
-markOop.cpp                             markOop.hpp
-markOop.cpp                             thread_<os_family>.inline.hpp
-
-markOop.hpp                             oop.hpp
-
-markOop.inline.hpp                      globals.hpp
-markOop.inline.hpp                      klass.hpp
-markOop.inline.hpp                      klassOop.hpp
-markOop.inline.hpp                      markOop.hpp
-
-markSweep.cpp                           compileBroker.hpp
-markSweep.cpp                           methodDataOop.hpp
-markSweep.cpp				objArrayKlass.inline.hpp
-
-markSweep.hpp                           collectedHeap.hpp
-markSweep.hpp				taskqueue.hpp
-
-memRegion.cpp                           globals.hpp
-memRegion.cpp                           memRegion.hpp
-
-memRegion.hpp                           allocation.hpp
-memRegion.hpp                           debug.hpp
-memRegion.hpp                           globalDefinitions.hpp
-
-memoryManager.cpp                       systemDictionary.hpp
-memoryManager.cpp                       vmSymbols.hpp
-memoryManager.cpp                       dtrace.hpp
-memoryManager.cpp                       handles.inline.hpp
-memoryManager.cpp                       javaCalls.hpp
-memoryManager.cpp                       lowMemoryDetector.hpp
-memoryManager.cpp                       management.hpp
-memoryManager.cpp                       memoryManager.hpp
-memoryManager.cpp                       memoryPool.hpp
-memoryManager.cpp                       memoryService.hpp
-memoryManager.cpp                       oop.inline.hpp
-
-memoryManager.hpp                       allocation.hpp
-memoryManager.hpp                       memoryUsage.hpp
-memoryManager.hpp                       timer.hpp
-
-memoryPool.cpp                          systemDictionary.hpp
-memoryPool.cpp                          vmSymbols.hpp
-memoryPool.cpp                          handles.inline.hpp
-memoryPool.cpp                          javaCalls.hpp
-memoryPool.cpp                          lowMemoryDetector.hpp
-memoryPool.cpp                          management.hpp
-memoryPool.cpp                          memoryManager.hpp
-memoryPool.cpp                          memoryPool.hpp
-memoryPool.cpp                          oop.inline.hpp
-
-memoryPool.hpp                          defNewGeneration.hpp
-memoryPool.hpp                          heap.hpp
-memoryPool.hpp                          memoryUsage.hpp
-memoryPool.hpp                          mutableSpace.hpp
-memoryPool.hpp                          space.hpp
-
-memoryService.cpp                       classLoadingService.hpp
-memoryService.cpp                       collectorPolicy.hpp
-memoryService.cpp                       defNewGeneration.hpp
-memoryService.cpp                       genCollectedHeap.hpp
-memoryService.cpp                       generation.hpp
-memoryService.cpp                       generationSpec.hpp
-memoryService.cpp                       growableArray.hpp
-memoryService.cpp                       heap.hpp
-memoryService.cpp                       javaCalls.hpp
-memoryService.cpp                       lowMemoryDetector.hpp
-memoryService.cpp                       management.hpp
-memoryService.cpp                       memRegion.hpp
-memoryService.cpp                       memoryManager.hpp
-memoryService.cpp                       memoryPool.hpp
-memoryService.cpp                       memoryService.hpp
-memoryService.cpp                       mutableSpace.hpp
-memoryService.cpp                       oop.inline.hpp
-memoryService.cpp                       permGen.hpp
-memoryService.cpp                       systemDictionary.hpp
-memoryService.cpp                       tenuredGeneration.hpp
-memoryService.cpp                       vmSymbols.hpp
-
-memoryService.hpp                       allocation.hpp
-memoryService.hpp                       generation.hpp
-memoryService.hpp                       handles.hpp
-memoryService.hpp                       memoryUsage.hpp
-
-memoryUsage.hpp                         globalDefinitions.hpp
-
-memprofiler.cpp                         codeCache.hpp
-memprofiler.cpp                         collectedHeap.inline.hpp
-memprofiler.cpp                         generation.hpp
-memprofiler.cpp                         handles.inline.hpp
-memprofiler.cpp                         jniHandles.hpp
-memprofiler.cpp                         memprofiler.hpp
-memprofiler.cpp                         mutexLocker.hpp
-memprofiler.cpp                         oopMapCache.hpp
-memprofiler.cpp                         os.hpp
-memprofiler.cpp                         permGen.hpp
-memprofiler.cpp                         resourceArea.hpp
-memprofiler.cpp                         systemDictionary.hpp
-memprofiler.cpp                         task.hpp
-memprofiler.cpp                         thread_<os_family>.inline.hpp
-memprofiler.cpp                         vmThread.hpp
-
-methodComparator.cpp                    globalDefinitions.hpp
-methodComparator.cpp                    handles.inline.hpp
-methodComparator.cpp                    jvmtiRedefineClassesTrace.hpp
-methodComparator.cpp                    methodComparator.hpp
-methodComparator.cpp                    oop.inline.hpp
-methodComparator.cpp                    symbolOop.hpp
-
-methodComparator.hpp                    bytecodeStream.hpp
-methodComparator.hpp                    constantPoolOop.hpp
-methodComparator.hpp                    methodOop.hpp
-
-methodDataKlass.cpp                     collectedHeap.inline.hpp
-methodDataKlass.cpp                     gcLocker.hpp
-methodDataKlass.cpp                     handles.inline.hpp
-methodDataKlass.cpp                     klassOop.hpp
-methodDataKlass.cpp                     markSweep.inline.hpp
-methodDataKlass.cpp                     methodDataKlass.hpp
-methodDataKlass.cpp                     methodDataOop.hpp
-methodDataKlass.cpp                     oop.inline.hpp
-methodDataKlass.cpp                     oop.inline2.hpp
-methodDataKlass.cpp                     resourceArea.hpp
-methodDataKlass.cpp                     universe.inline.hpp
-
-methodDataKlass.hpp                     klass.hpp
-
-methodDataOop.cpp                       bytecode.hpp
-methodDataOop.cpp                       bytecodeStream.hpp
-methodDataOop.cpp                       compilationPolicy.hpp
-methodDataOop.cpp                       deoptimization.hpp
-methodDataOop.cpp                       handles.inline.hpp
-methodDataOop.cpp                       linkResolver.hpp
-methodDataOop.cpp                       markSweep.inline.hpp
-methodDataOop.cpp                       methodDataOop.hpp
-methodDataOop.cpp                       oop.inline.hpp
-methodDataOop.cpp                       systemDictionary.hpp
-
-methodDataOop.hpp                       bytecodes.hpp
-methodDataOop.hpp                       oop.hpp
-methodDataOop.hpp                       orderAccess.hpp
-methodDataOop.hpp                       universe.hpp
-methodDataOop.hpp                       methodOop.hpp
-
-methodHandleWalk.hpp                    methodHandles.hpp
-
-methodHandleWalk.cpp                    methodHandleWalk.hpp
-methodHandleWalk.cpp                    oopFactory.hpp
-methodHandleWalk.cpp                    rewriter.hpp
-
-methodHandles.hpp                       frame.inline.hpp
-methodHandles.hpp                       globals.hpp
-methodHandles.hpp                       interfaceSupport.hpp
-methodHandles.hpp                       javaClasses.hpp
-methodHandles.hpp                       no_precompiled_headers
-methodHandles.hpp                       vmSymbols.hpp
-
-methodHandles.cpp                       allocation.inline.hpp
-methodHandles.cpp                       interpreter.hpp
-methodHandles.cpp                       javaCalls.hpp
-methodHandles.cpp                       methodHandles.hpp
-methodHandles.cpp                       oopFactory.hpp
-methodHandles.cpp                       reflection.hpp
-methodHandles.cpp                       signature.hpp
-methodHandles.cpp                       stubRoutines.hpp
-methodHandles.cpp                       symbolTable.hpp
-
-methodHandles_<arch>.cpp                allocation.inline.hpp
-methodHandles_<arch>.cpp                interpreter.hpp
-methodHandles_<arch>.cpp                methodHandles.hpp
-
-methodKlass.cpp                         collectedHeap.inline.hpp
-methodKlass.cpp                         constMethodKlass.hpp
-methodKlass.cpp                         gcLocker.hpp
-methodKlass.cpp                         handles.inline.hpp
-methodKlass.cpp                         interpreter.hpp
-methodKlass.cpp                         javaClasses.hpp
-methodKlass.cpp                         klassOop.hpp
-methodKlass.cpp                         markSweep.inline.hpp
-methodKlass.cpp                         methodDataOop.hpp
-methodKlass.cpp                         methodKlass.hpp
-methodKlass.cpp                         oop.inline.hpp
-methodKlass.cpp                         oop.inline2.hpp
-methodKlass.cpp                         resourceArea.hpp
-methodKlass.cpp                         symbolOop.hpp
-methodKlass.cpp                         universe.inline.hpp
-
-methodKlass.hpp                         klass.hpp
-methodKlass.hpp                         klassOop.hpp
-methodKlass.hpp                         methodOop.hpp
-
-methodLiveness.cpp                      allocation.inline.hpp
-methodLiveness.cpp                      bitMap.inline.hpp
-methodLiveness.cpp                      bytecode.hpp
-methodLiveness.cpp                      bytecodes.hpp
-methodLiveness.cpp                      ciMethod.hpp
-methodLiveness.cpp                      ciMethodBlocks.hpp
-methodLiveness.cpp                      ciStreams.hpp
-methodLiveness.cpp                      methodLiveness.hpp
-
-methodLiveness.hpp                      bitMap.hpp
-methodLiveness.hpp                      growableArray.hpp
-
-methodOop.cpp                           arguments.hpp
-methodOop.cpp                           bytecodeStream.hpp
-methodOop.cpp                           bytecodeTracer.hpp
-methodOop.cpp                           bytecodes.hpp
-methodOop.cpp                           collectedHeap.inline.hpp
-methodOop.cpp				compilationPolicy.hpp
-methodOop.cpp                           debugInfoRec.hpp
-methodOop.cpp                           frame.inline.hpp
-methodOop.cpp                           gcLocker.hpp
-methodOop.cpp                           gcTaskThread.hpp
-methodOop.cpp                           generation.hpp
-methodOop.cpp                           handles.inline.hpp
-methodOop.cpp                           interpreter.hpp
-methodOop.cpp                           jvmtiExport.hpp
-methodOop.cpp                           klassOop.hpp
-methodOop.cpp                           methodDataOop.hpp
-methodOop.cpp                           methodHandleWalk.hpp
-methodOop.cpp                           methodOop.hpp
-methodOop.cpp                           nativeLookup.hpp
-methodOop.cpp                           oop.inline.hpp
-methodOop.cpp                           oopFactory.hpp
-methodOop.cpp                           oopMapCache.hpp
-methodOop.cpp                           relocator.hpp
-methodOop.cpp                           sharedRuntime.hpp
-methodOop.cpp                           signature.hpp
-methodOop.cpp                           symbolOop.hpp
-methodOop.cpp                           systemDictionary.hpp
-methodOop.cpp                           xmlstream.hpp
-
-methodOop.hpp                           accessFlags.hpp
-methodOop.hpp                           compressedStream.hpp
-methodOop.hpp                           constMethodOop.hpp
-methodOop.hpp                           constantPoolOop.hpp
-methodOop.hpp                           growableArray.hpp
-methodOop.hpp                           instanceKlass.hpp
-methodOop.hpp                           invocationCounter.hpp
-methodOop.hpp                           oop.hpp
-methodOop.hpp                           oopMap.hpp
-methodOop.hpp                           typeArrayOop.hpp
-methodOop.hpp                           vmSymbols.hpp
-
-modRefBarrierSet.hpp                    barrierSet.hpp
-
-monitorChunk.cpp                        allocation.inline.hpp
-monitorChunk.cpp                        monitorChunk.hpp
-monitorChunk.cpp                        oop.inline.hpp
-
-monitorChunk.hpp                        synchronizer.hpp
-
-mutex.cpp                               events.hpp
-mutex.cpp                               mutex.hpp
-mutex.cpp                               mutex_<os_family>.inline.hpp
-mutex.cpp                               osThread.hpp
-mutex.cpp                               thread_<os_family>.inline.hpp
-
-mutex.hpp                               allocation.hpp
-mutex.hpp                               histogram.hpp
-mutex.hpp                               os.hpp
-
-mutexLocker.cpp                         mutexLocker.hpp
-mutexLocker.cpp                         safepoint.hpp
-mutexLocker.cpp                         threadLocalStorage.hpp
-mutexLocker.cpp                         thread_<os_family>.inline.hpp
-mutexLocker.cpp                         vmThread.hpp
-
-mutexLocker.hpp                         allocation.hpp
-mutexLocker.hpp                         mutex.hpp
-mutexLocker.hpp                         os_<os_family>.inline.hpp
-
-mutex_<os_family>.cpp                   events.hpp
-mutex_<os_family>.cpp                   interfaceSupport.hpp
-mutex_<os_family>.cpp                   mutex.hpp
-mutex_<os_family>.cpp                   mutex_<os_family>.inline.hpp
-mutex_<os_family>.cpp                   thread_<os_family>.inline.hpp
-
-mutex_<os_family>.inline.hpp            interfaceSupport.hpp
-mutex_<os_family>.inline.hpp            os_<os_family>.inline.hpp
-mutex_<os_family>.inline.hpp            thread_<os_family>.inline.hpp
-
-nativeInst_<arch>.cpp                   assembler_<arch>.inline.hpp
-nativeInst_<arch>.cpp                   handles.hpp
-nativeInst_<arch>.cpp                   nativeInst_<arch>.hpp
-nativeInst_<arch>.cpp                   oop.inline.hpp
-nativeInst_<arch>.cpp                   ostream.hpp
-nativeInst_<arch>.cpp                   resourceArea.hpp
-nativeInst_<arch>.cpp                   sharedRuntime.hpp
-nativeInst_<arch>.cpp                   stubRoutines.hpp
-
-nativeInst_<arch>.hpp                   allocation.hpp
-nativeInst_<arch>.hpp                   assembler.hpp
-nativeInst_<arch>.hpp                   icache.hpp
-nativeInst_<arch>.hpp                   os.hpp
-nativeInst_<arch>.hpp                   top.hpp
-
-nativeLookup.cpp                        arguments.hpp
-nativeLookup.cpp                        handles.inline.hpp
-nativeLookup.cpp                        hpi.hpp
-nativeLookup.cpp                        instanceKlass.hpp
-nativeLookup.cpp                        javaCalls.hpp
-nativeLookup.cpp                        javaClasses.hpp
-nativeLookup.cpp                        jvm_misc.hpp
-nativeLookup.cpp                        methodOop.hpp
-nativeLookup.cpp                        nativeLookup.hpp
-nativeLookup.cpp                        oop.inline.hpp
-nativeLookup.cpp                        oopFactory.hpp
-nativeLookup.cpp                        os_<os_family>.inline.hpp
-nativeLookup.cpp                        resourceArea.hpp
-nativeLookup.cpp                        sharedRuntime.hpp
-nativeLookup.cpp                        signature.hpp
-nativeLookup.cpp                        symbolOop.hpp
-nativeLookup.cpp                        systemDictionary.hpp
-nativeLookup.cpp                        universe.inline.hpp
-nativeLookup.cpp                        vmSymbols.hpp
-
-nativeLookup.hpp                        handles.hpp
-nativeLookup.hpp                        top.hpp
-
-nmethod.cpp                             abstractCompiler.hpp
-nmethod.cpp                             bytecode.hpp
-nmethod.cpp                             codeCache.hpp
-nmethod.cpp                             compileLog.hpp
-nmethod.cpp                             compiledIC.hpp
-nmethod.cpp                             compilerOracle.hpp
-nmethod.cpp                             disassembler.hpp
-nmethod.cpp                             dtrace.hpp
-nmethod.cpp                             events.hpp
-nmethod.cpp                             jvmtiRedefineClassesTrace.hpp
-nmethod.cpp                             methodDataOop.hpp
-nmethod.cpp                             nmethod.hpp
-nmethod.cpp                             scopeDesc.hpp
-nmethod.cpp                             sharedRuntime.hpp
-nmethod.cpp                             sweeper.hpp
-nmethod.cpp                             xmlstream.hpp
-
-nmethod.hpp                             codeBlob.hpp
-nmethod.hpp                             pcDesc.hpp
-
-numberSeq.cpp				debug.hpp
-numberSeq.cpp				numberSeq.hpp
-numberSeq.cpp				globalDefinitions.hpp
-numberSeq.cpp				allocation.inline.hpp
-
-objArrayKlass.cpp                       collectedHeap.inline.hpp
-objArrayKlass.cpp                       copy.hpp
-objArrayKlass.cpp                       genOopClosures.inline.hpp
-objArrayKlass.cpp                       handles.inline.hpp
-objArrayKlass.cpp                       instanceKlass.hpp
-objArrayKlass.cpp                       markSweep.inline.hpp
-objArrayKlass.cpp                       mutexLocker.hpp
-objArrayKlass.cpp                       objArrayKlass.hpp
-objArrayKlass.cpp                       objArrayKlass.inline.hpp
-objArrayKlass.cpp                       objArrayKlassKlass.hpp
-objArrayKlass.cpp                       objArrayOop.hpp
-objArrayKlass.cpp                       oop.inline.hpp
-objArrayKlass.cpp                       oop.inline2.hpp
-objArrayKlass.cpp                       resourceArea.hpp
-objArrayKlass.cpp                       symbolOop.hpp
-objArrayKlass.cpp                       systemDictionary.hpp
-objArrayKlass.cpp                       universe.inline.hpp
-objArrayKlass.cpp                       vmSymbols.hpp
-
-objArrayKlass.hpp                       arrayKlass.hpp
-objArrayKlass.hpp                       instanceKlass.hpp
-objArrayKlass.hpp                       specialized_oop_closures.hpp
-
-objArrayKlass.inline.hpp		objArrayKlass.hpp
-
-objArrayKlassKlass.cpp                  collectedHeap.inline.hpp
-objArrayKlassKlass.cpp                  instanceKlass.hpp
-objArrayKlassKlass.cpp                  javaClasses.hpp
-objArrayKlassKlass.cpp                  markSweep.inline.hpp
-objArrayKlassKlass.cpp                  objArrayKlassKlass.hpp
-objArrayKlassKlass.cpp                  oop.inline.hpp
-objArrayKlassKlass.cpp                  oop.inline2.hpp
-objArrayKlassKlass.cpp                  systemDictionary.hpp
-
-objArrayKlassKlass.hpp                  arrayKlassKlass.hpp
-objArrayKlassKlass.hpp                  objArrayKlass.hpp
-
-objArrayOop.cpp                         objArrayKlass.hpp
-objArrayOop.cpp                         objArrayOop.hpp
-objArrayOop.cpp                         oop.inline.hpp
-
-objArrayOop.hpp                         arrayOop.hpp
-
-objectMonitor.cpp                       dtrace.hpp
-objectMonitor.cpp                       handles.inline.hpp
-objectMonitor.cpp                       interfaceSupport.hpp
-objectMonitor.cpp                       markOop.hpp
-objectMonitor.cpp                       mutexLocker.hpp
-objectMonitor.cpp                       objectMonitor.hpp
-objectMonitor.cpp                       objectMonitor.inline.hpp
-objectMonitor.cpp                       oop.inline.hpp
-objectMonitor.cpp                       osThread.hpp
-objectMonitor.cpp                       os_<os_family>.inline.hpp
-objectMonitor.cpp                       preserveException.hpp
-objectMonitor.cpp                       resourceArea.hpp
-objectMonitor.cpp                       stubRoutines.hpp
-objectMonitor.cpp                       thread.hpp
-objectMonitor.cpp                       thread_<os_family>.inline.hpp
-objectMonitor.cpp                       threadService.hpp
-objectMonitor.cpp                       vmSymbols.hpp
-
-objectMonitor.hpp                       os.hpp
-objectMonitor.hpp                       perfData.hpp
-
-oop.cpp                                 copy.hpp
-oop.cpp                                 handles.inline.hpp
-oop.cpp                                 javaClasses.hpp
-oop.cpp                                 oop.inline.hpp
-oop.cpp                                 thread_<os_family>.inline.hpp
-
-oop.hpp                                 iterator.hpp
-oop.hpp                                 memRegion.hpp
-oop.hpp                                 specialized_oop_closures.hpp
-oop.hpp                                 top.hpp
-
-oop.inline.hpp                          ageTable.hpp
-oop.inline.hpp                          arrayKlass.hpp
-oop.inline.hpp                          arrayOop.hpp
-oop.inline.hpp                          atomic.hpp
-oop.inline.hpp                          barrierSet.inline.hpp
-oop.inline.hpp                          bytes_<arch>.hpp
-oop.inline.hpp                          cardTableModRefBS.hpp
-oop.inline.hpp                          collectedHeap.inline.hpp
-oop.inline.hpp                          compactingPermGenGen.hpp
-oop.inline.hpp                          genCollectedHeap.hpp
-oop.inline.hpp                          generation.hpp
-oop.inline.hpp                          klass.hpp
-oop.inline.hpp                          klassOop.hpp
-oop.inline.hpp                          markOop.inline.hpp
-oop.inline.hpp                          markSweep.inline.hpp
-oop.inline.hpp                          oop.hpp
-oop.inline.hpp                          os.hpp
-oop.inline.hpp                          permGen.hpp
-oop.inline.hpp                          specialized_oop_closures.hpp
-
-oop.inline2.hpp                         collectedHeap.hpp
-oop.inline2.hpp                         generation.hpp
-oop.inline2.hpp                         oop.hpp
-oop.inline2.hpp                         permGen.hpp
-oop.inline2.hpp                         universe.hpp
-
-oopFactory.cpp                          collectedHeap.inline.hpp
-oopFactory.cpp                          compiledICHolderKlass.hpp
-oopFactory.cpp                          constMethodKlass.hpp
-oopFactory.cpp                          constantPoolKlass.hpp
-oopFactory.cpp                          cpCacheKlass.hpp
-oopFactory.cpp                          instanceKlass.hpp
-oopFactory.cpp                          instanceKlassKlass.hpp
-oopFactory.cpp                          instanceOop.hpp
-oopFactory.cpp                          javaClasses.hpp
-oopFactory.cpp                          klassKlass.hpp
-oopFactory.cpp                          klassOop.hpp
-oopFactory.cpp                          methodDataKlass.hpp
-oopFactory.cpp                          methodKlass.hpp
-oopFactory.cpp                          objArrayOop.hpp
-oopFactory.cpp                          oop.inline.hpp
-oopFactory.cpp                          oopFactory.hpp
-oopFactory.cpp                          resourceArea.hpp
-oopFactory.cpp                          symbolTable.hpp
-oopFactory.cpp                          systemDictionary.hpp
-oopFactory.cpp                          universe.inline.hpp
-oopFactory.cpp                          vmSymbols.hpp
-
-oopFactory.hpp                          growableArray.hpp
-oopFactory.hpp                          klassOop.hpp
-oopFactory.hpp                          objArrayKlass.hpp
-oopFactory.hpp                          oop.hpp
-oopFactory.hpp                          symbolTable.hpp
-oopFactory.hpp                          systemDictionary.hpp
-oopFactory.hpp                          typeArrayKlass.hpp
-oopFactory.hpp                          universe.hpp
-
-oopMap.cpp                              allocation.inline.hpp
-oopMap.cpp                              codeBlob.hpp
-oopMap.cpp                              codeCache.hpp
-oopMap.cpp                              collectedHeap.hpp
-oopMap.cpp                              frame.inline.hpp
-oopMap.cpp                              nmethod.hpp
-oopMap.cpp                              oopMap.hpp
-oopMap.cpp                              resourceArea.hpp
-oopMap.cpp                              scopeDesc.hpp
-oopMap.cpp                              signature.hpp
-
-oopMap.hpp                              allocation.hpp
-oopMapCache.cpp                         jvmtiRedefineClassesTrace.hpp
-oopMap.hpp                              compressedStream.hpp
-oopMap.hpp                              growableArray.hpp
-oopMap.hpp                              vmreg.hpp
-
-oopMapCache.cpp                         allocation.inline.hpp
-oopMapCache.cpp                         jvmtiRedefineClassesTrace.hpp
-oopMapCache.cpp                         handles.inline.hpp
-oopMapCache.cpp                         oop.inline.hpp
-oopMapCache.cpp                         oopMapCache.hpp
-oopMapCache.cpp                         resourceArea.hpp
-oopMapCache.cpp                         signature.hpp
-
-oopMapCache.hpp                         generateOopMap.hpp
-
-oopRecorder.cpp                         allocation.inline.hpp
-oopRecorder.cpp                         oop.inline.hpp
-oopRecorder.cpp                         oopRecorder.hpp
-
-oopRecorder.hpp                         growableArray.hpp
-oopRecorder.hpp                         handles.hpp
-
-oopsHierarchy.cpp                       collectedHeap.hpp
-oopsHierarchy.cpp                       collectedHeap.inline.hpp
-oopsHierarchy.cpp                       globalDefinitions.hpp
-oopsHierarchy.cpp                       oopsHierarchy.hpp
-oopsHierarchy.cpp                       thread.hpp
-oopsHierarchy.cpp                       thread_<os_family>.inline.hpp
-
-orderAccess.cpp                         orderAccess.hpp
-orderAccess.cpp                         stubRoutines.hpp
-orderAccess.cpp                         thread.hpp
-
-orderAccess.hpp                         allocation.hpp
-orderAccess.hpp                         os.hpp
-
-orderAccess_<os_arch>.inline.hpp        orderAccess.hpp
-orderAccess_<os_arch>.inline.hpp        vm_version_<arch>.hpp
-
-os.cpp                                  allocation.inline.hpp
-os.cpp                                  arguments.hpp
-os.cpp                                  attachListener.hpp
-os.cpp                                  classLoader.hpp
-os.cpp                                  defaultStream.hpp
-os.cpp                                  events.hpp
-os.cpp                                  frame.inline.hpp
-os.cpp                                  hpi.hpp
-os.cpp					icBuffer.hpp
-os.cpp                                  interfaceSupport.hpp
-os.cpp                                  interpreter.hpp
-os.cpp                                  java.hpp
-os.cpp                                  javaCalls.hpp
-os.cpp                                  javaClasses.hpp
-os.cpp                                  jvm.h
-os.cpp                                  jvm_misc.hpp
-os.cpp                                  mutexLocker.hpp
-os.cpp                                  oop.inline.hpp
-os.cpp                                  os.hpp
-os.cpp                                  os_<os_family>.inline.hpp
-os.cpp	                                privilegedStack.hpp
-os.cpp                                  stubRoutines.hpp
-os.cpp                                  systemDictionary.hpp
-os.cpp                                  threadService.hpp
-os.cpp                                  thread_<os_family>.inline.hpp
-os.cpp                                  vmGCOperations.hpp
-os.cpp                                  vmSymbols.hpp
-os.cpp                                  vtableStubs.hpp
-
-os.hpp                                  atomic.hpp
-os.hpp                                  extendedPC.hpp
-os.hpp                                  handles.hpp
-os.hpp                                  jvmti.h
-os.hpp                                  top.hpp
-
-os_<os_arch>.cpp                        allocation.inline.hpp
-os_<os_arch>.cpp                        arguments.hpp
-os_<os_arch>.cpp                        assembler_<arch>.inline.hpp
-os_<os_arch>.cpp                        classLoader.hpp
-os_<os_arch>.cpp                        events.hpp
-os_<os_arch>.cpp                        extendedPC.hpp
-os_<os_arch>.cpp                        frame.inline.hpp
-os_<os_arch>.cpp                        hpi.hpp
-os_<os_arch>.cpp                        icBuffer.hpp
-os_<os_arch>.cpp                        interfaceSupport.hpp
-os_<os_arch>.cpp                        interpreter.hpp
-os_<os_arch>.cpp                        java.hpp
-os_<os_arch>.cpp                        javaCalls.hpp
-os_<os_arch>.cpp                        jniFastGetField.hpp
-os_<os_arch>.cpp                        jvm.h
-os_<os_arch>.cpp                        jvm_<os_family>.h
-os_<os_arch>.cpp                        jvm_misc.hpp
-os_<os_arch>.cpp                        mutexLocker.hpp
-os_<os_arch>.cpp                        mutex_<os_family>.inline.hpp
-os_<os_arch>.cpp                        nativeInst_<arch>.hpp
-os_<os_arch>.cpp                        no_precompiled_headers
-os_<os_arch>.cpp                        osThread.hpp
-os_<os_arch>.cpp                        os_share_<os_family>.hpp
-os_<os_arch>.cpp                        sharedRuntime.hpp
-os_<os_arch>.cpp                        stubRoutines.hpp
-os_<os_arch>.cpp                        systemDictionary.hpp
-os_<os_arch>.cpp                        thread_<os_family>.inline.hpp
-os_<os_arch>.cpp                        timer.hpp
-os_<os_arch>.cpp                        vmError.hpp
-os_<os_arch>.cpp                        vmSymbols.hpp
-os_<os_arch>.cpp                        vtableStubs.hpp
-
-os_<os_arch>.hpp                        generate_platform_dependent_include
-
-os_<os_family>.cpp                      allocation.inline.hpp
-os_<os_family>.cpp                      arguments.hpp
-os_<os_family>.cpp                      assembler_<arch>.inline.hpp
-os_<os_family>.cpp                      attachListener.hpp
-os_<os_family>.cpp                      classLoader.hpp
-os_<os_family>.cpp                      compileBroker.hpp
-os_<os_family>.cpp                      defaultStream.hpp
-os_<os_family>.cpp                      events.hpp
-os_<os_family>.cpp                      extendedPC.hpp
-os_<os_family>.cpp                      filemap.hpp
-os_<os_family>.cpp                      globals.hpp
-os_<os_family>.cpp                      growableArray.hpp
-os_<os_family>.cpp                      hpi.hpp
-os_<os_family>.cpp                      icBuffer.hpp
-os_<os_family>.cpp                      interfaceSupport.hpp
-os_<os_family>.cpp                      interpreter.hpp
-os_<os_family>.cpp                      java.hpp
-os_<os_family>.cpp                      javaCalls.hpp
-os_<os_family>.cpp                      jniFastGetField.hpp
-os_<os_family>.cpp                      jvm.h
-os_<os_family>.cpp                      jvm_<os_family>.h
-os_<os_family>.cpp                      jvm_misc.hpp
-os_<os_family>.cpp                      mutexLocker.hpp
-os_<os_family>.cpp                      mutex_<os_family>.inline.hpp
-os_<os_family>.cpp                      nativeInst_<arch>.hpp
-os_<os_family>.cpp                      no_precompiled_headers
-os_<os_family>.cpp                      objectMonitor.hpp
-os_<os_family>.cpp                      oop.inline.hpp
-os_<os_family>.cpp                      osThread.hpp
-os_<os_family>.cpp                      os_share_<os_family>.hpp
-os_<os_family>.cpp                      perfMemory.hpp
-os_<os_family>.cpp                      runtimeService.hpp
-os_<os_family>.cpp                      sharedRuntime.hpp
-os_<os_family>.cpp                      statSampler.hpp
-os_<os_family>.cpp                      stubRoutines.hpp
-os_<os_family>.cpp                      systemDictionary.hpp
-os_<os_family>.cpp                      threadCritical.hpp
-os_<os_family>.cpp                      thread_<os_family>.inline.hpp
-os_<os_family>.cpp                      timer.hpp
-os_<os_family>.cpp                      vmError.hpp
-os_<os_family>.cpp                      vmSymbols.hpp
-os_<os_family>.cpp                      vtableStubs.hpp
-
-os_<os_family>.hpp                      generate_platform_dependent_include
-
-os_<os_family>.inline.hpp               atomic.hpp
-os_<os_family>.inline.hpp               atomic_<os_arch>.inline.hpp
-os_<os_family>.inline.hpp               orderAccess_<os_arch>.inline.hpp
-os_<os_family>.inline.hpp               os.hpp
-
-osThread.cpp                            oop.inline.hpp
-osThread.cpp                            osThread.hpp
-
-osThread.hpp                            frame.hpp
-osThread.hpp                            handles.hpp
-osThread.hpp                            hpi.hpp
-osThread.hpp                            javaFrameAnchor.hpp
-osThread.hpp                            objectMonitor.hpp
-osThread.hpp                            top.hpp
-
-osThread_<os_family>.cpp                assembler_<arch>.inline.hpp
-osThread_<os_family>.cpp                atomic.hpp
-osThread_<os_family>.cpp                handles.inline.hpp
-osThread_<os_family>.cpp                mutexLocker.hpp
-osThread_<os_family>.cpp                no_precompiled_headers
-osThread_<os_family>.cpp                os.hpp
-osThread_<os_family>.cpp                osThread.hpp
-osThread_<os_family>.cpp                safepoint.hpp
-osThread_<os_family>.cpp                vmThread.hpp
-
-osThread_<os_family>.hpp                generate_platform_dependent_include
-
-ostream.cpp                             arguments.hpp
-ostream.cpp                             compileLog.hpp
-ostream.cpp                             defaultStream.hpp
-ostream.cpp                             oop.inline.hpp
-ostream.cpp                             os_<os_family>.inline.hpp
-ostream.cpp                             hpi.hpp
-ostream.cpp                             hpi_<os_family>.hpp
-ostream.cpp                             ostream.hpp
-ostream.cpp                             top.hpp
-ostream.cpp                             xmlstream.hpp
-
-ostream.hpp                             allocation.hpp
-ostream.hpp                             timer.hpp
-
-// include thread.hpp to prevent cyclic includes
-park.cpp                                thread.hpp
-
-park.hpp                                debug.hpp
-park.hpp                                globalDefinitions.hpp
-
-pcDesc.cpp                              debugInfoRec.hpp
-pcDesc.cpp                              nmethod.hpp
-pcDesc.cpp                              pcDesc.hpp
-pcDesc.cpp                              resourceArea.hpp
-pcDesc.cpp                              scopeDesc.hpp
-
-pcDesc.hpp                              allocation.hpp
-
-perf.cpp                                allocation.inline.hpp
-perf.cpp                                interfaceSupport.hpp
-perf.cpp                                jni.h
-perf.cpp                                jvm.h
-perf.cpp                                oop.inline.hpp
-perf.cpp                                perfData.hpp
-perf.cpp                                perfMemory.hpp
-perf.cpp                                resourceArea.hpp
-perf.cpp                                vmSymbols.hpp
-
-perfData.cpp                            exceptions.hpp
-perfData.cpp                            globalDefinitions.hpp
-perfData.cpp                            handles.inline.hpp
-perfData.cpp                            java.hpp
-perfData.cpp                            mutex.hpp
-perfData.cpp                            mutexLocker.hpp
-perfData.cpp                            oop.inline.hpp
-perfData.cpp                            os.hpp
-perfData.cpp                            perfData.hpp
-perfData.cpp                            vmSymbols.hpp
-
-perfData.hpp                            allocation.inline.hpp
-perfData.hpp                            growableArray.hpp
-perfData.hpp                            perfMemory.hpp
-perfData.hpp                            timer.hpp
-
-perfMemory.cpp                          allocation.inline.hpp
-perfMemory.cpp                          arguments.hpp
-perfMemory.cpp                          globalDefinitions.hpp
-perfMemory.cpp                          java.hpp
-perfMemory.cpp                          mutex.hpp
-perfMemory.cpp                          mutexLocker.hpp
-perfMemory.cpp                          os.hpp
-perfMemory.cpp                          perfData.hpp
-perfMemory.cpp                          perfMemory.hpp
-perfMemory.cpp                          statSampler.hpp
-
-perfMemory.hpp                          exceptions.hpp
-
-perfMemory_<os_family>.cpp              allocation.inline.hpp
-perfMemory_<os_family>.cpp              exceptions.hpp
-perfMemory_<os_family>.cpp              handles.inline.hpp
-perfMemory_<os_family>.cpp              oop.inline.hpp
-perfMemory_<os_family>.cpp              os_<os_family>.inline.hpp
-perfMemory_<os_family>.cpp              perfMemory.hpp
-perfMemory_<os_family>.cpp              resourceArea.hpp
-perfMemory_<os_family>.cpp              vmSymbols.hpp
-
-permGen.cpp                             blockOffsetTable.inline.hpp
-permGen.cpp                             cSpaceCounters.hpp
-permGen.cpp                             collectedHeap.inline.hpp
-permGen.cpp                             compactPermGen.hpp
-permGen.cpp                             genCollectedHeap.hpp
-permGen.cpp                             generation.inline.hpp
-permGen.cpp                             java.hpp
-permGen.cpp                             oop.inline.hpp
-permGen.cpp                             permGen.hpp
-permGen.cpp                             universe.hpp
-permGen.cpp                             gcLocker.hpp
-permGen.cpp                             gcLocker.inline.hpp
-permGen.cpp                             vmGCOperations.hpp
-permGen.cpp                             vmThread.hpp
-
-permGen.hpp                             gcCause.hpp
-permGen.hpp                             generation.hpp
-permGen.hpp                             handles.hpp
-permGen.hpp                             iterator.hpp
-permGen.hpp                             mutexLocker.hpp
-permGen.hpp                             virtualspace.hpp
-
-placeholders.cpp                        fieldType.hpp
-placeholders.cpp                        hashtable.inline.hpp
-placeholders.cpp                        oop.inline.hpp
-placeholders.cpp                        placeholders.hpp
-placeholders.cpp                        systemDictionary.hpp
-
-placeholders.hpp                        hashtable.hpp
-
-prefetch.hpp                            allocation.hpp
-
-prefetch_<os_arch>.inline.hpp           prefetch.hpp
-
-preserveException.cpp                   handles.inline.hpp
-preserveException.cpp                   preserveException.hpp
-
-preserveException.hpp                   handles.hpp
-preserveException.hpp                   thread_<os_family>.inline.hpp
-
-privilegedStack.cpp                     allocation.inline.hpp
-privilegedStack.cpp                     instanceKlass.hpp
-privilegedStack.cpp                     methodOop.hpp
-privilegedStack.cpp                     oop.inline.hpp
-privilegedStack.cpp                     privilegedStack.hpp
-privilegedStack.cpp                     vframe.hpp
-
-privilegedStack.hpp                     allocation.hpp
-privilegedStack.hpp                     growableArray.hpp
-privilegedStack.hpp                     oopsHierarchy.hpp
-privilegedStack.hpp                     vframe.hpp
-
-referencePolicy.cpp                     arguments.hpp
-referencePolicy.cpp                     globals.hpp
-referencePolicy.cpp                     javaClasses.hpp
-referencePolicy.cpp                     referencePolicy.hpp
-referencePolicy.cpp                     universe.hpp
-
-referenceProcessor.cpp                  collectedHeap.hpp
-referenceProcessor.cpp                  collectedHeap.inline.hpp
-referenceProcessor.cpp                  java.hpp
-referenceProcessor.cpp                  javaClasses.hpp
-referenceProcessor.cpp                  jniHandles.hpp
-referenceProcessor.cpp                  oop.inline.hpp
-referenceProcessor.cpp                  referencePolicy.hpp
-referenceProcessor.cpp                  referenceProcessor.hpp
-referenceProcessor.cpp                  systemDictionary.hpp
-
-referenceProcessor.hpp                  instanceRefKlass.hpp
-referenceProcessor.hpp                  referencePolicy.hpp
-
-reflection.cpp                          arguments.hpp
-reflection.cpp                          handles.inline.hpp
-reflection.cpp                          instanceKlass.hpp
-reflection.cpp                          javaCalls.hpp
-reflection.cpp                          javaClasses.hpp
-reflection.cpp                          jvm.h
-reflection.cpp                          linkResolver.hpp
-reflection.cpp                          methodHandleWalk.hpp
-reflection.cpp                          objArrayKlass.hpp
-reflection.cpp                          objArrayOop.hpp
-reflection.cpp                          oopFactory.hpp
-reflection.cpp                          reflection.hpp
-reflection.cpp                          reflectionUtils.hpp
-reflection.cpp                          resourceArea.hpp
-reflection.cpp                          signature.hpp
-reflection.cpp                          symbolTable.hpp
-reflection.cpp                          systemDictionary.hpp
-reflection.cpp                          universe.inline.hpp
-reflection.cpp                          verifier.hpp
-reflection.cpp                          vframe.hpp
-reflection.cpp                          vmSymbols.hpp
-
-reflection.hpp                          accessFlags.hpp
-reflection.hpp                          fieldDescriptor.hpp
-reflection.hpp                          growableArray.hpp
-reflection.hpp                          oop.hpp
-reflection.hpp                          reflectionCompat.hpp
-
-reflectionUtils.cpp                     javaClasses.hpp
-reflectionUtils.cpp                     reflectionUtils.hpp
-reflectionUtils.cpp                     universe.inline.hpp
-
-reflectionUtils.hpp                     accessFlags.hpp
-reflectionUtils.hpp                     allocation.hpp
-reflectionUtils.hpp                     globalDefinitions.hpp
-reflectionUtils.hpp                     handles.inline.hpp
-reflectionUtils.hpp                     instanceKlass.hpp
-reflectionUtils.hpp                     objArrayOop.hpp
-reflectionUtils.hpp                     oopsHierarchy.hpp
-reflectionUtils.hpp                     reflection.hpp
-
-register.cpp                            register.hpp
-
-register.hpp                            top.hpp
-
-register_<arch>.cpp                     register_<arch>.hpp
-
-register_<arch>.hpp                     register.hpp
-register_<arch>.hpp                     vm_version_<arch>.hpp
-
-registerMap.hpp                         globalDefinitions.hpp
-registerMap.hpp                         register_<arch>.hpp
-registerMap.hpp                         vmreg.hpp
-
-registerMap_<arch>.hpp                  generate_platform_dependent_include
-
-register_definitions_<arch>.cpp         assembler.hpp
-register_definitions_<arch>.cpp         interp_masm_<arch_model>.hpp
-register_definitions_<arch>.cpp         register.hpp
-register_definitions_<arch>.cpp         register_<arch>.hpp
-
-relocInfo.cpp                           assembler_<arch>.inline.hpp
-relocInfo.cpp                           compiledIC.hpp
-relocInfo.cpp                           copy.hpp
-relocInfo.cpp                           nativeInst_<arch>.hpp
-relocInfo.cpp                           nmethod.hpp
-relocInfo.cpp                           relocInfo.hpp
-relocInfo.cpp                           resourceArea.hpp
-relocInfo.cpp                           stubCodeGenerator.hpp
-
-relocInfo.hpp                           allocation.hpp
-relocInfo.hpp                           top.hpp
-
-relocInfo_<arch>.cpp                    assembler.inline.hpp
-relocInfo_<arch>.cpp                    assembler_<arch>.inline.hpp
-relocInfo_<arch>.cpp                    nativeInst_<arch>.hpp
-relocInfo_<arch>.cpp                    oop.inline.hpp
-relocInfo_<arch>.cpp                    relocInfo.hpp
-relocInfo_<arch>.cpp                    safepoint.hpp
-
-relocInfo_<arch>.hpp                    generate_platform_dependent_include
-
-relocator.cpp                           bytecodes.hpp
-relocator.cpp                           handles.inline.hpp
-relocator.cpp                           oop.inline.hpp
-relocator.cpp                           oopFactory.hpp
-relocator.cpp                           relocator.hpp
-relocator.cpp                           stackMapTableFormat.hpp
-relocator.cpp                           universe.inline.hpp
-
-relocator.hpp                           bytecodes.hpp
-relocator.hpp                           bytes_<arch>.hpp
-relocator.hpp                           methodOop.hpp
-
-resolutionErrors.cpp                    handles.inline.hpp
-resolutionErrors.cpp                    hashtable.inline.hpp
-resolutionErrors.cpp                    oop.inline.hpp
-resolutionErrors.cpp                    resolutionErrors.hpp
-resolutionErrors.cpp                    resourceArea.hpp
-resolutionErrors.cpp                    safepoint.hpp
-
-resolutionErrors.hpp                    constantPoolOop.hpp
-resolutionErrors.hpp                    hashtable.hpp
-
-resourceArea.cpp                        allocation.inline.hpp
-resourceArea.cpp                        mutexLocker.hpp
-resourceArea.cpp                        resourceArea.hpp
-resourceArea.cpp                        thread_<os_family>.inline.hpp
-
-resourceArea.hpp                        allocation.hpp
-resourceArea.hpp                        thread_<os_family>.inline.hpp
-
-// restore is jck optional, put cpp deps in includeDB_features
-
-rewriter.cpp                            bytecodes.hpp
-rewriter.cpp                            gcLocker.hpp
-rewriter.cpp                            generateOopMap.hpp
-rewriter.cpp                            interpreter.hpp
-rewriter.cpp                            methodComparator.hpp
-rewriter.cpp                            objArrayOop.hpp
-rewriter.cpp                            oop.inline.hpp
-rewriter.cpp                            oopFactory.hpp
-rewriter.cpp                            resourceArea.hpp
-rewriter.cpp                            rewriter.hpp
-
-rewriter.hpp                            allocation.hpp
-rewriter.hpp                            growableArray.hpp
-rewriter.hpp                            handles.inline.hpp
-
-rframe.cpp                              frame.inline.hpp
-rframe.cpp                              interpreter.hpp
-rframe.cpp                              oop.inline.hpp
-rframe.cpp                              rframe.hpp
-rframe.cpp                              symbolOop.hpp
-rframe.cpp                              vframe.hpp
-rframe.cpp                              vframe_hp.hpp
-
-rframe.hpp                              allocation.hpp
-rframe.hpp                              frame.inline.hpp
-
-runtimeService.cpp                      attachListener.hpp
-runtimeService.cpp                      classLoader.hpp
-runtimeService.cpp                      dtrace.hpp
-runtimeService.cpp                      exceptions.hpp
-runtimeService.cpp                      management.hpp
-runtimeService.cpp                      runtimeService.hpp
-
-runtimeService.hpp                      perfData.hpp
-runtimeService.hpp                      timer.hpp
-
-safepoint.cpp                           codeCache.hpp
-safepoint.cpp                           collectedHeap.hpp
-safepoint.cpp                           compilationPolicy.hpp
-safepoint.cpp                           deoptimization.hpp
-safepoint.cpp                           events.hpp
-safepoint.cpp                           frame.inline.hpp
-safepoint.cpp                           icBuffer.hpp
-safepoint.cpp                           interfaceSupport.hpp
-safepoint.cpp                           interpreter.hpp
-safepoint.cpp                           mutexLocker.hpp
-safepoint.cpp                           nativeInst_<arch>.hpp
-safepoint.cpp                           nmethod.hpp
-safepoint.cpp                           oop.inline.hpp
-safepoint.cpp                           osThread.hpp
-safepoint.cpp                           pcDesc.hpp
-safepoint.cpp                           resourceArea.hpp
-safepoint.cpp                           runtimeService.hpp
-safepoint.cpp                           safepoint.hpp
-safepoint.cpp                           scopeDesc.hpp
-safepoint.cpp                           signature.hpp
-safepoint.cpp                           stubCodeGenerator.hpp
-safepoint.cpp                           stubRoutines.hpp
-safepoint.cpp                           sweeper.hpp
-safepoint.cpp                           symbolOop.hpp
-safepoint.cpp                           synchronizer.hpp
-safepoint.cpp                           systemDictionary.hpp
-safepoint.cpp                           thread_<os_family>.inline.hpp
-safepoint.cpp                           universe.inline.hpp
-safepoint.cpp                           vmreg_<arch>.inline.hpp
-
-safepoint.hpp                           allocation.hpp
-safepoint.hpp                           assembler.hpp
-safepoint.hpp                           extendedPC.hpp
-safepoint.hpp                           nmethod.hpp
-safepoint.hpp                           os.hpp
-safepoint.hpp                           ostream.hpp
-
-scopeDesc.cpp                           debugInfoRec.hpp
-scopeDesc.cpp                           handles.inline.hpp
-scopeDesc.cpp                           oop.inline.hpp
-scopeDesc.cpp                           pcDesc.hpp
-scopeDesc.cpp                           resourceArea.hpp
-scopeDesc.cpp                           scopeDesc.hpp
-
-scopeDesc.hpp                           debugInfo.hpp
-scopeDesc.hpp                           growableArray.hpp
-scopeDesc.hpp                           methodOop.hpp
-scopeDesc.hpp                           pcDesc.hpp
-
-// serialize is jck optional, put cpp deps in includeDB_features
-
-serviceUtil.hpp                         objArrayOop.hpp
-serviceUtil.hpp                         systemDictionary.hpp
-
-sharedHeap.cpp                          codeCache.hpp
-sharedHeap.cpp                          collectedHeap.inline.hpp
-sharedHeap.cpp                          copy.hpp
-sharedHeap.cpp                          fprofiler.hpp
-sharedHeap.cpp                          java.hpp
-sharedHeap.cpp                          management.hpp
-sharedHeap.cpp                          oop.inline.hpp
-sharedHeap.cpp                          sharedHeap.hpp
-sharedHeap.cpp                          symbolTable.hpp
-sharedHeap.cpp                          systemDictionary.hpp
-sharedHeap.cpp                          workgroup.hpp
-
-sharedHeap.hpp                          collectedHeap.hpp
-sharedHeap.hpp                          generation.hpp
-sharedHeap.hpp                          permGen.hpp
-
-sharedRuntime.cpp                       abstractCompiler.hpp
-sharedRuntime.cpp                       arguments.hpp
-sharedRuntime.cpp                       biasedLocking.hpp
-sharedRuntime.cpp                       compileBroker.hpp
-sharedRuntime.cpp                       compiledIC.hpp
-sharedRuntime.cpp                       compilerOracle.hpp
-sharedRuntime.cpp                       copy.hpp
-sharedRuntime.cpp                       dtrace.hpp
-sharedRuntime.cpp                       events.hpp
-sharedRuntime.cpp                       forte.hpp
-sharedRuntime.cpp                       gcLocker.inline.hpp
-sharedRuntime.cpp                       handles.inline.hpp
-sharedRuntime.cpp                       hashtable.inline.hpp
-sharedRuntime.cpp                       init.hpp
-sharedRuntime.cpp                       interfaceSupport.hpp
-sharedRuntime.cpp                       interpreterRuntime.hpp
-sharedRuntime.cpp                       interpreter.hpp
-sharedRuntime.cpp                       javaCalls.hpp
-sharedRuntime.cpp                       jvmtiExport.hpp
-sharedRuntime.cpp                       methodHandles.hpp
-sharedRuntime.cpp                       jvmtiRedefineClassesTrace.hpp
-sharedRuntime.cpp                       nativeInst_<arch>.hpp
-sharedRuntime.cpp                       nativeLookup.hpp
-sharedRuntime.cpp                       oop.inline.hpp
-sharedRuntime.cpp                       scopeDesc.hpp
-sharedRuntime.cpp                       sharedRuntime.hpp
-sharedRuntime.cpp                       stubRoutines.hpp
-sharedRuntime.cpp                       systemDictionary.hpp
-sharedRuntime.cpp                       universe.inline.hpp
-sharedRuntime.cpp                       vframe.hpp
-sharedRuntime.cpp                       vframeArray.hpp
-sharedRuntime.cpp                       vmSymbols.hpp
-sharedRuntime.cpp                       vmreg_<arch>.inline.hpp
-sharedRuntime.cpp                       vtableStubs.hpp
-sharedRuntime.cpp                       xmlstream.hpp
-
-sharedRuntime.hpp                       allocation.hpp
-sharedRuntime.hpp                       bytecodeHistogram.hpp
-sharedRuntime.hpp                       bytecodeTracer.hpp
-sharedRuntime.hpp                       hashtable.hpp
-sharedRuntime.hpp                       linkResolver.hpp
-sharedRuntime.hpp                       resourceArea.hpp
-sharedRuntime.hpp                       threadLocalStorage.hpp
-
-sharedRuntime_<arch_model>.cpp          assembler.hpp
-sharedRuntime_<arch_model>.cpp          assembler_<arch>.inline.hpp
-sharedRuntime_<arch_model>.cpp          compiledICHolderOop.hpp
-sharedRuntime_<arch_model>.cpp          debugInfoRec.hpp
-sharedRuntime_<arch_model>.cpp          icBuffer.hpp
-sharedRuntime_<arch_model>.cpp          interpreter.hpp
-sharedRuntime_<arch_model>.cpp          jvmtiRedefineClassesTrace.hpp
-sharedRuntime_<arch_model>.cpp          sharedRuntime.hpp
-sharedRuntime_<arch_model>.cpp          vframeArray.hpp
-sharedRuntime_<arch_model>.cpp          vmreg_<arch>.inline.hpp
-sharedRuntime_<arch_model>.cpp          vtableStubs.hpp
-
-sharedRuntimeTrans.cpp                  interfaceSupport.hpp
-sharedRuntimeTrans.cpp                  jni.h
-sharedRuntimeTrans.cpp                  sharedRuntime.hpp
-
-sharedRuntimeTrig.cpp                   interfaceSupport.hpp
-sharedRuntimeTrig.cpp                   jni.h
-sharedRuntimeTrig.cpp                   sharedRuntime.hpp
-
-signature.cpp                           instanceKlass.hpp
-signature.cpp                           oop.inline.hpp
-signature.cpp                           oopFactory.hpp
-signature.cpp                           signature.hpp
-signature.cpp                           symbolOop.hpp
-signature.cpp                           symbolTable.hpp
-signature.cpp                           systemDictionary.hpp
-signature.cpp                           typeArrayKlass.hpp
-
-signature.hpp                           allocation.hpp
-signature.hpp                           methodOop.hpp
-signature.hpp                           top.hpp
-
-simpleThresholdPolicy.cpp               arguments.hpp
-simpleThresholdPolicy.cpp               compileBroker.hpp
-simpleThresholdPolicy.cpp               resourceArea.hpp
-simpleThresholdPolicy.cpp               simpleThresholdPolicy.hpp
-simpleThresholdPolicy.cpp               simpleThresholdPolicy.inline.hpp
-
-simpleThresholdPolicy.hpp               compilationPolicy.hpp
-simpleThresholdPolicy.hpp               globalDefinitions.hpp
-simpleThresholdPolicy.hpp               methodDataOop.hpp
-simpleThresholdPolicy.hpp               nmethod.hpp
-
-sizes.cpp                               sizes.hpp
-
-sizes.hpp                               allocation.hpp
-sizes.hpp                               globalDefinitions.hpp
-
-space.cpp                               blockOffsetTable.inline.hpp
-space.cpp                               copy.hpp
-space.cpp                               defNewGeneration.hpp
-space.cpp                               genCollectedHeap.hpp
-space.cpp                               globalDefinitions.hpp
-space.cpp                               java.hpp
-space.cpp                               liveRange.hpp
-space.cpp                               markSweep.hpp
-space.cpp                               oop.inline.hpp
-space.cpp                               oop.inline2.hpp
-space.cpp                               safepoint.hpp
-space.cpp                               space.hpp
-space.cpp                               space.inline.hpp
-space.cpp                               spaceDecorator.hpp
-space.cpp                               systemDictionary.hpp
-space.cpp                               universe.inline.hpp
-space.cpp                               vmSymbols.hpp
-
-space.hpp                               allocation.hpp
-space.hpp                               blockOffsetTable.hpp
-space.hpp                               cardTableModRefBS.hpp
-space.hpp                               iterator.hpp
-space.hpp                               markOop.hpp
-space.hpp                               memRegion.hpp
-space.hpp                               mutexLocker.hpp
-space.hpp                               os_<os_family>.inline.hpp
-space.hpp                               prefetch.hpp
-space.hpp                               watermark.hpp
-space.hpp                               workgroup.hpp
-
-space.inline.hpp                        collectedHeap.hpp
-space.inline.hpp                        safepoint.hpp
-space.inline.hpp                        space.hpp
-space.inline.hpp                        universe.hpp
-
-spaceDecorator.hpp                      globalDefinitions.hpp
-spaceDecorator.hpp                      mutableSpace.hpp
-spaceDecorator.hpp                      space.hpp
-
-spaceDecorator.cpp                      copy.hpp
-spaceDecorator.cpp                      spaceDecorator.hpp
-spaceDecorator.cpp                      space.inline.hpp
-
-specialized_oop_closures.cpp            ostream.hpp
-specialized_oop_closures.cpp            specialized_oop_closures.hpp
-
-specialized_oop_closures.hpp            atomic.hpp
-
-stack.hpp                               allocation.inline.hpp
-
-stack.inline.hpp                        stack.hpp
-
-stackMapFrame.cpp                       globalDefinitions.hpp
-stackMapFrame.cpp                       handles.inline.hpp
-stackMapFrame.cpp                       oop.inline.hpp
-stackMapFrame.cpp                       resourceArea.hpp
-stackMapFrame.cpp                       stackMapFrame.hpp
-stackMapFrame.cpp                       symbolOop.hpp
-stackMapFrame.cpp                       verifier.hpp
-
-stackMapFrame.hpp                       exceptions.hpp
-stackMapFrame.hpp                       handles.hpp
-stackMapFrame.hpp                       methodOop.hpp
-stackMapFrame.hpp                       signature.hpp
-stackMapFrame.hpp                       verificationType.hpp
-stackMapFrame.hpp                       verifier.hpp
-
-stackMapTable.cpp                       fieldType.hpp
-stackMapTable.cpp                       handles.inline.hpp
-stackMapTable.cpp                       oop.inline.hpp
-stackMapTable.cpp                       resourceArea.hpp
-stackMapTable.cpp                       stackMapTable.hpp
-stackMapTable.cpp                       verifier.hpp
-
-stackMapTable.hpp                       allocation.hpp
-stackMapTable.hpp                       bytes_<arch>.hpp
-stackMapTable.hpp                       constantPoolOop.hpp
-stackMapTable.hpp                       globalDefinitions.hpp
-stackMapTable.hpp                       methodOop.hpp
-stackMapTable.hpp                       stackMapFrame.hpp
-
-stackMapTableFormat.hpp                 verificationType.hpp
-
-stackValue.cpp                          debugInfo.hpp
-stackValue.cpp                          frame.inline.hpp
-stackValue.cpp                          handles.inline.hpp
-stackValue.cpp                          oop.inline.hpp
-stackValue.cpp                          stackValue.hpp
-
-stackValue.hpp                          handles.hpp
-stackValue.hpp                          location.hpp
-stackValue.hpp                          top.hpp
-
-stackValueCollection.cpp                jniTypes_<arch>.hpp
-stackValueCollection.cpp                stackValueCollection.hpp
-
-stackValueCollection.hpp                allocation.hpp
-stackValueCollection.hpp                growableArray.hpp
-stackValueCollection.hpp                stackValue.hpp
-
-statSampler.cpp                         allocation.inline.hpp
-statSampler.cpp                         arguments.hpp
-statSampler.cpp                         java.hpp
-statSampler.cpp                         javaCalls.hpp
-statSampler.cpp                         oop.inline.hpp
-statSampler.cpp                         os.hpp
-statSampler.cpp                         resourceArea.hpp
-statSampler.cpp                         statSampler.hpp
-statSampler.cpp                         systemDictionary.hpp
-statSampler.cpp                         vmSymbols.hpp
-statSampler.cpp                         vm_version_<arch>.hpp
-
-statSampler.hpp                         perfData.hpp
-statSampler.hpp                         task.hpp
-
-stubCodeGenerator.cpp                   assembler_<arch>.inline.hpp
-stubCodeGenerator.cpp                   disassembler.hpp
-stubCodeGenerator.cpp                   forte.hpp
-stubCodeGenerator.cpp                   oop.inline.hpp
-stubCodeGenerator.cpp                   stubCodeGenerator.hpp
-
-stubCodeGenerator.hpp                   allocation.hpp
-stubCodeGenerator.hpp                   assembler.hpp
-
-stubGenerator_<arch_model>.cpp          assembler.hpp
-stubGenerator_<arch_model>.cpp          assembler_<arch>.inline.hpp
-stubGenerator_<arch_model>.cpp          frame.inline.hpp
-stubGenerator_<arch_model>.cpp          handles.inline.hpp
-stubGenerator_<arch_model>.cpp          instanceOop.hpp
-stubGenerator_<arch_model>.cpp          interpreter.hpp
-stubGenerator_<arch_model>.cpp          methodHandles.hpp
-stubGenerator_<arch_model>.cpp          methodOop.hpp
-stubGenerator_<arch_model>.cpp          nativeInst_<arch>.hpp
-stubGenerator_<arch_model>.cpp          objArrayKlass.hpp
-stubGenerator_<arch_model>.cpp          oop.inline.hpp
-stubGenerator_<arch_model>.cpp          sharedRuntime.hpp
-stubGenerator_<arch_model>.cpp          stubCodeGenerator.hpp
-stubGenerator_<arch_model>.cpp          stubRoutines.hpp
-stubGenerator_<arch_model>.cpp          thread_<os_family>.inline.hpp
-stubGenerator_<arch_model>.cpp          top.hpp
-
-stubRoutines.cpp                        codeBuffer.hpp
-stubRoutines.cpp                        copy.hpp
-stubRoutines.cpp                        interfaceSupport.hpp
-stubRoutines.cpp                        oop.inline.hpp
-stubRoutines.cpp                        resourceArea.hpp
-stubRoutines.cpp                        sharedRuntime.hpp
-stubRoutines.cpp                        stubRoutines.hpp
-stubRoutines.cpp                        timer.hpp
-
-stubRoutines.hpp                        allocation.hpp
-stubRoutines.hpp                        codeBlob.hpp
-stubRoutines.hpp                        frame.hpp
-stubRoutines.hpp                        mutexLocker.hpp
-stubRoutines.hpp                        nativeInst_<arch>.hpp
-stubRoutines.hpp                        stubCodeGenerator.hpp
-stubRoutines.hpp                        top.hpp
-
-stubRoutines_<arch_model>.cpp           deoptimization.hpp
-stubRoutines_<arch_model>.cpp           frame.inline.hpp
-stubRoutines_<arch_model>.cpp           stubRoutines.hpp
-stubRoutines_<arch_model>.cpp           thread_<os_family>.inline.hpp
-
-stubRoutines_<arch_model>.hpp           generate_platform_dependent_include
-
-stubRoutines_<os_family>.cpp            os.hpp
-stubRoutines_<os_family>.cpp            stubRoutines.hpp
-
-stubs.cpp                               allocation.inline.hpp
-stubs.cpp                               codeBlob.hpp
-stubs.cpp                               mutexLocker.hpp
-stubs.cpp                               oop.inline.hpp
-stubs.cpp                               stubs.hpp
-
-stubs.hpp                               allocation.hpp
-stubs.hpp                               os_<os_family>.inline.hpp
-
-sweeper.cpp                             atomic.hpp
-sweeper.cpp                             codeCache.hpp
-sweeper.cpp				compilationPolicy.hpp
-sweeper.cpp                             compileBroker.hpp
-sweeper.cpp                             events.hpp
-sweeper.cpp                             methodOop.hpp
-sweeper.cpp                             mutexLocker.hpp
-sweeper.cpp                             nmethod.hpp
-sweeper.cpp                             os.hpp
-sweeper.cpp                             resourceArea.hpp
-sweeper.cpp                             sweeper.hpp
-sweeper.cpp                             vm_operations.hpp
-sweeper.cpp                             xmlstream.hpp
-
-symbolKlass.cpp                         gcLocker.hpp
-symbolKlass.cpp                         handles.inline.hpp
-symbolKlass.cpp                         oop.inline.hpp
-symbolKlass.cpp                         symbolKlass.hpp
-symbolKlass.cpp                         symbolOop.hpp
-symbolKlass.cpp                         symbolTable.hpp
-
-symbolKlass.hpp                         typeArrayKlass.hpp
-
-symbolOop.cpp                           oop.inline.hpp
-symbolOop.cpp                           symbolOop.hpp
-
-symbolOop.hpp                           typeArrayOop.hpp
-symbolOop.hpp                           utf8.hpp
-
-symbolTable.cpp                         collectedHeap.inline.hpp
-symbolTable.cpp                         filemap.hpp
-symbolTable.cpp                         gcLocker.inline.hpp
-symbolTable.cpp                         hashtable.inline.hpp
-symbolTable.cpp                         javaClasses.hpp
-symbolTable.cpp                         mutexLocker.hpp
-symbolTable.cpp                         oop.inline.hpp
-symbolTable.cpp                         oop.inline2.hpp
-symbolTable.cpp                         symbolKlass.hpp
-symbolTable.cpp                         symbolTable.hpp
-symbolTable.cpp                         systemDictionary.hpp
-
-symbolTable.hpp                         allocation.inline.hpp
-symbolTable.hpp                         hashtable.hpp
-symbolTable.hpp                         symbolOop.hpp
-
-synchronizer.cpp                        biasedLocking.hpp
-synchronizer.cpp                        dtrace.hpp
-synchronizer.cpp                        events.hpp
-synchronizer.cpp                        handles.inline.hpp
-synchronizer.cpp                        interfaceSupport.hpp
-synchronizer.cpp                        markOop.hpp
-synchronizer.cpp                        mutexLocker.hpp
-synchronizer.cpp                        objectMonitor.hpp
-synchronizer.cpp                        objectMonitor.inline.hpp
-synchronizer.cpp                        oop.inline.hpp
-synchronizer.cpp                        osThread.hpp
-synchronizer.cpp                        os_<os_family>.inline.hpp
-synchronizer.cpp                        preserveException.hpp
-synchronizer.cpp                        resourceArea.hpp
-synchronizer.cpp                        stubRoutines.hpp
-synchronizer.cpp                        synchronizer.hpp
-synchronizer.cpp                        thread_<os_family>.inline.hpp
-synchronizer.cpp                        vmSymbols.hpp
-
-synchronizer.hpp                        basicLock.hpp
-synchronizer.hpp                        handles.hpp
-synchronizer.hpp                        markOop.hpp
-synchronizer.hpp                        perfData.hpp
-synchronizer.hpp                        top.hpp
-
-systemDictionary.cpp                    biasedLocking.hpp
-systemDictionary.cpp                    bytecodeStream.hpp
-systemDictionary.cpp                    classLoadingService.hpp
-systemDictionary.cpp                    dictionary.hpp
-systemDictionary.cpp                    fieldType.hpp
-systemDictionary.cpp                    gcLocker.hpp
-systemDictionary.cpp                    handles.inline.hpp
-systemDictionary.cpp                    instanceKlass.hpp
-systemDictionary.cpp                    instanceRefKlass.hpp
-systemDictionary.cpp                    interpreter.hpp
-systemDictionary.cpp                    java.hpp
-systemDictionary.cpp                    javaCalls.hpp
-systemDictionary.cpp                    javaClasses.hpp
-systemDictionary.cpp                    jvmtiEnvBase.hpp
-systemDictionary.cpp                    klass.inline.hpp
-systemDictionary.cpp                    loaderConstraints.hpp
-systemDictionary.cpp                    methodDataOop.hpp
-systemDictionary.cpp                    methodHandles.hpp
-systemDictionary.cpp                    mutexLocker.hpp
-systemDictionary.cpp                    objArrayKlass.hpp
-systemDictionary.cpp                    oop.inline.hpp
-systemDictionary.cpp                    oop.inline2.hpp
-systemDictionary.cpp                    oopFactory.hpp
-systemDictionary.cpp                    placeholders.hpp
-systemDictionary.cpp                    resolutionErrors.hpp
-systemDictionary.cpp                    signature.hpp
-systemDictionary.cpp                    systemDictionary.hpp
-systemDictionary.cpp                    threadService.hpp
-systemDictionary.cpp                    typeArrayKlass.hpp
-systemDictionary.cpp                    vmSymbols.hpp
-
-systemDictionary.hpp                    classFileStream.hpp
-systemDictionary.hpp                    classLoader.hpp
-systemDictionary.hpp                    hashtable.hpp
-systemDictionary.hpp                    java.hpp
-systemDictionary.hpp                    objArrayOop.hpp
-systemDictionary.hpp                    reflectionUtils.hpp
-systemDictionary.hpp                    symbolOop.hpp
-
-task.cpp                                allocation.hpp
-task.cpp                                init.hpp
-task.cpp                                os_<os_family>.inline.hpp
-task.cpp                                task.hpp
-task.cpp                                thread_<os_family>.inline.hpp
-task.cpp                                timer.hpp
-
-task.hpp                                top.hpp
-
-taskqueue.cpp                           debug.hpp
-taskqueue.cpp				oop.inline.hpp
-taskqueue.cpp                           os.hpp
-taskqueue.cpp                           stack.inline.hpp
-taskqueue.cpp                           taskqueue.hpp
-taskqueue.cpp                           thread_<os_family>.inline.hpp
-
-taskqueue.hpp                           allocation.hpp
-taskqueue.hpp                           allocation.inline.hpp
-taskqueue.hpp                           mutex.hpp
-taskqueue.hpp                           orderAccess_<os_arch>.inline.hpp
-taskqueue.hpp				stack.hpp
-
-templateInterpreter.cpp                 interpreter.hpp
-templateInterpreter.cpp                 interpreterGenerator.hpp
-templateInterpreter.cpp                 interpreterRuntime.hpp
-templateInterpreter.cpp                 templateTable.hpp
-
-templateInterpreter.hpp                 abstractInterpreter.hpp
-templateInterpreter.hpp                 templateTable.hpp
-
-templateInterpreter_<arch_model>.cpp    arguments.hpp
-templateInterpreter_<arch_model>.cpp    arrayOop.hpp
-templateInterpreter_<arch_model>.cpp    assembler.hpp
-templateInterpreter_<arch_model>.cpp    bytecodeHistogram.hpp
-templateInterpreter_<arch_model>.cpp    debug.hpp
-templateInterpreter_<arch_model>.cpp    deoptimization.hpp
-templateInterpreter_<arch_model>.cpp    frame.inline.hpp
-templateInterpreter_<arch_model>.cpp    interpreterRuntime.hpp
-templateInterpreter_<arch_model>.cpp    interpreter.hpp
-templateInterpreter_<arch_model>.cpp    interpreterGenerator.hpp
-templateInterpreter_<arch_model>.cpp    jvmtiExport.hpp
-templateInterpreter_<arch_model>.cpp    jvmtiThreadState.hpp
-templateInterpreter_<arch_model>.cpp    methodDataOop.hpp
-templateInterpreter_<arch_model>.cpp    methodOop.hpp
-templateInterpreter_<arch_model>.cpp    oop.inline.hpp
-templateInterpreter_<arch_model>.cpp    sharedRuntime.hpp
-templateInterpreter_<arch_model>.cpp    stubRoutines.hpp
-templateInterpreter_<arch_model>.cpp    synchronizer.hpp
-templateInterpreter_<arch_model>.cpp    templateTable.hpp
-templateInterpreter_<arch_model>.cpp    timer.hpp
-templateInterpreter_<arch_model>.cpp    vframeArray.hpp
-
-templateInterpreter_<arch>.hpp          generate_platform_dependent_include
-
-templateInterpreterGenerator_<arch>.hpp generate_platform_dependent_include
-
-templateTable.cpp                       collectedHeap.hpp
-templateTable.cpp                       templateTable.hpp
-templateTable.cpp                       timer.hpp
-
-templateTable.hpp                       allocation.hpp
-templateTable.hpp                       bytecodes.hpp
-templateTable.hpp                       frame.hpp
-templateTable.hpp                       interp_masm_<arch_model>.hpp
-
-templateTable_<arch_model>.cpp          interpreterRuntime.hpp
-templateTable_<arch_model>.cpp          interpreter.hpp
-templateTable_<arch_model>.cpp          methodDataOop.hpp
-templateTable_<arch_model>.cpp          methodHandles.hpp
-templateTable_<arch_model>.cpp          objArrayKlass.hpp
-templateTable_<arch_model>.cpp          oop.inline.hpp
-templateTable_<arch_model>.cpp          sharedRuntime.hpp
-templateTable_<arch_model>.cpp          stubRoutines.hpp
-templateTable_<arch_model>.cpp          synchronizer.hpp
-templateTable_<arch_model>.cpp          templateTable.hpp
-templateTable_<arch_model>.cpp          universe.inline.hpp
-
-templateTable_<arch_model>.hpp          generate_platform_dependent_include
-
-tenuredGeneration.cpp                   allocation.inline.hpp
-tenuredGeneration.cpp                   blockOffsetTable.inline.hpp
-tenuredGeneration.cpp                   collectorCounters.hpp
-tenuredGeneration.cpp                   generation.inline.hpp
-tenuredGeneration.cpp                   generationSpec.hpp
-tenuredGeneration.cpp                   java.hpp
-tenuredGeneration.cpp                   oop.inline.hpp
-tenuredGeneration.cpp                   parGCAllocBuffer.hpp
-tenuredGeneration.cpp                   space.hpp
-tenuredGeneration.cpp                   tenuredGeneration.hpp
-
-tenuredGeneration.hpp                   cSpaceCounters.hpp
-tenuredGeneration.hpp                   gcStats.hpp
-tenuredGeneration.hpp                   generation.hpp
-tenuredGeneration.hpp                   generationCounters.hpp
-
-thread.cpp                              aprofiler.hpp
-thread.cpp                              arguments.hpp
-thread.cpp                              attachListener.hpp
-thread.cpp                              biasedLocking.hpp
-thread.cpp                              classLoader.hpp
-thread.cpp                              compileBroker.hpp
-thread.cpp                              defaultStream.hpp
-thread.cpp                              deoptimization.hpp
-thread.cpp                              dtrace.hpp
-thread.cpp                              events.hpp
-thread.cpp                              fprofiler.hpp
-thread.cpp                              frame.inline.hpp
-thread.cpp                              gcTaskManager.hpp
-thread.cpp                              hpi.hpp
-thread.cpp                              init.hpp
-thread.cpp                              instanceKlass.hpp
-thread.cpp                              interfaceSupport.hpp
-thread.cpp                              interpreter.hpp
-thread.cpp                              interpreter.hpp
-thread.cpp                              java.hpp
-thread.cpp                              javaCalls.hpp
-thread.cpp                              javaClasses.hpp
-thread.cpp                              jniPeriodicChecker.hpp
-thread.cpp                              jvm_misc.hpp
-thread.cpp                              jvmtiExport.hpp
-thread.cpp                              jvmtiThreadState.hpp
-thread.cpp                              linkResolver.hpp
-thread.cpp                              management.hpp
-thread.cpp                              memprofiler.hpp
-thread.cpp                              mutexLocker.hpp
-thread.cpp                              objArrayOop.hpp
-thread.cpp                              objectMonitor.hpp
-thread.cpp                              oop.inline.hpp
-thread.cpp                              oopFactory.hpp
-thread.cpp                              osThread.hpp
-thread.cpp                              os_<os_family>.inline.hpp
-thread.cpp                              preserveException.hpp
-thread.cpp                              privilegedStack.hpp
-thread.cpp                              safepoint.hpp
-thread.cpp                              scopeDesc.hpp
-thread.cpp                              sharedRuntime.hpp
-thread.cpp                              statSampler.hpp
-thread.cpp                              stubRoutines.hpp
-thread.cpp                              symbolOop.hpp
-thread.cpp                              systemDictionary.hpp
-thread.cpp                              task.hpp
-thread.cpp                              threadCritical.hpp
-thread.cpp                              threadLocalStorage.hpp
-thread.cpp                              threadService.hpp
-thread.cpp                              thread_<os_family>.inline.hpp
-thread.cpp                              universe.inline.hpp
-thread.cpp                              vframe.hpp
-thread.cpp                              vframeArray.hpp
-thread.cpp                              vframe_hp.hpp
-thread.cpp                              vmSymbols.hpp
-thread.cpp                              vmThread.hpp
-thread.cpp                              vm_operations.hpp
-
-thread.hpp                              allocation.hpp
-thread.hpp                              exceptions.hpp
-thread.hpp                              frame.hpp
-thread.hpp                              javaFrameAnchor.hpp
-thread.hpp                              jni.h
-thread.hpp                              jniHandles.hpp
-thread.hpp                              jvmtiExport.hpp
-thread.hpp                              mutexLocker.hpp
-thread.hpp                              oop.hpp
-thread.hpp                              os.hpp
-thread.hpp                              osThread.hpp
-thread.hpp                              park.hpp
-thread.hpp                              safepoint.hpp
-thread.hpp                              stubRoutines.hpp
-thread.hpp                              threadLocalAllocBuffer.hpp
-thread.hpp                              threadLocalStorage.hpp
-thread.hpp                              top.hpp
-thread.hpp                              unhandledOops.hpp
-
-thread_<os_arch>.cpp                    frame.inline.hpp
-thread_<os_arch>.cpp                    thread_<os_family>.inline.hpp
-
-thread_<os_arch>.hpp                    generate_platform_dependent_include
-
-thread_<os_family>.inline.hpp           atomic.hpp
-thread_<os_family>.inline.hpp           atomic_<os_arch>.inline.hpp
-thread_<os_family>.inline.hpp           orderAccess_<os_arch>.inline.hpp
-thread_<os_family>.inline.hpp           prefetch.hpp
-thread_<os_family>.inline.hpp           prefetch_<os_arch>.inline.hpp
-thread_<os_family>.inline.hpp           thread.hpp
-thread_<os_family>.inline.hpp           threadLocalStorage.hpp
-
-threadCritical.hpp                      allocation.hpp
-
-threadCritical_<os_family>.cpp          threadCritical.hpp
-threadCritical_<os_family>.cpp          thread_<os_family>.inline.hpp
-
-threadLS_<os_arch>.cpp                  threadLocalStorage.hpp
-threadLS_<os_arch>.cpp                  thread_<os_family>.inline.hpp
-
-threadLS_<os_arch>.hpp                  generate_platform_dependent_include
-
-threadLocalAllocBuffer.cpp              copy.hpp
-threadLocalAllocBuffer.cpp              genCollectedHeap.hpp
-threadLocalAllocBuffer.cpp              oop.inline.hpp
-threadLocalAllocBuffer.cpp              resourceArea.hpp
-threadLocalAllocBuffer.cpp              threadLocalAllocBuffer.inline.hpp
-threadLocalAllocBuffer.cpp              thread_<os_family>.inline.hpp
-threadLocalAllocBuffer.cpp              universe.inline.hpp
-
-threadLocalAllocBuffer.hpp              gcUtil.hpp
-threadLocalAllocBuffer.hpp              perfData.hpp
-threadLocalAllocBuffer.hpp              typeArrayOop.hpp
-
-threadLocalAllocBuffer.inline.hpp       atomic.hpp
-threadLocalAllocBuffer.inline.hpp       collectedHeap.hpp
-threadLocalAllocBuffer.inline.hpp       copy.hpp
-threadLocalAllocBuffer.inline.hpp       threadLocalAllocBuffer.hpp
-
-threadLocalStorage.cpp                  os_<os_family>.inline.hpp
-threadLocalStorage.cpp                  threadLocalStorage.hpp
-threadLocalStorage.cpp                  thread_<os_family>.inline.hpp
-
-threadLocalStorage.hpp                  gcUtil.hpp
-threadLocalStorage.hpp                  os.hpp
-threadLocalStorage.hpp                  top.hpp
-
-threadService.cpp                       allocation.hpp
-threadService.cpp                       handles.inline.hpp
-threadService.cpp                       heapInspection.hpp
-threadService.cpp                       init.hpp
-threadService.cpp                       instanceKlass.hpp
-threadService.cpp                       oop.inline.hpp
-threadService.cpp                       oopFactory.hpp
-threadService.cpp                       systemDictionary.hpp
-threadService.cpp                       thread.hpp
-threadService.cpp                       threadService.hpp
-threadService.cpp                       vframe.hpp
-threadService.cpp                       vmThread.hpp
-threadService.cpp                       vm_operations.hpp
-
-threadService.hpp                       handles.hpp
-threadService.hpp                       init.hpp
-threadService.hpp                       javaClasses.hpp
-threadService.hpp                       jniHandles.hpp
-threadService.hpp                       management.hpp
-threadService.hpp                       objectMonitor.hpp
-threadService.hpp                       objectMonitor.inline.hpp
-threadService.hpp                       perfData.hpp
-threadService.hpp                       serviceUtil.hpp
-
-timer.cpp                               oop.inline.hpp
-timer.cpp                               os_<os_family>.inline.hpp
-timer.cpp                               ostream.hpp
-timer.cpp                               timer.hpp
-
-timer.hpp                               globalDefinitions.hpp
-
-top.hpp                                 debug.hpp
-top.hpp                                 exceptions.hpp
-top.hpp                                 globalDefinitions.hpp
-top.hpp                                 globals.hpp
-top.hpp                                 macros.hpp
-top.hpp                                 oopsHierarchy.hpp
-top.hpp                                 ostream.hpp
-top.hpp                                 sizes.hpp
-
-typeArrayKlass.cpp                      collectedHeap.hpp
-typeArrayKlass.cpp                      collectedHeap.inline.hpp
-typeArrayKlass.cpp                      handles.inline.hpp
-typeArrayKlass.cpp                      instanceKlass.hpp
-typeArrayKlass.cpp                      klassOop.hpp
-typeArrayKlass.cpp                      objArrayKlassKlass.hpp
-typeArrayKlass.cpp                      oop.inline.hpp
-typeArrayKlass.cpp                      resourceArea.hpp
-typeArrayKlass.cpp                      systemDictionary.hpp
-typeArrayKlass.cpp                      typeArrayKlass.hpp
-typeArrayKlass.cpp                      typeArrayOop.hpp
-typeArrayKlass.cpp                      universe.hpp
-typeArrayKlass.cpp                      universe.inline.hpp
-typeArrayKlass.cpp                      vmSymbols.hpp
-
-typeArrayKlass.hpp                      arrayKlass.hpp
-
-typeArrayKlassKlass.cpp                 handles.inline.hpp
-typeArrayKlassKlass.cpp                 javaClasses.hpp
-typeArrayKlassKlass.cpp                 oop.inline.hpp
-typeArrayKlassKlass.cpp                 typeArrayKlassKlass.hpp
-
-typeArrayKlassKlass.hpp                 arrayKlassKlass.hpp
-typeArrayKlassKlass.hpp                 typeArrayKlass.hpp
-
-typeArrayOop.cpp                        oop.inline.hpp
-typeArrayOop.cpp                        typeArrayOop.hpp
-
-typeArrayOop.hpp                        arrayOop.hpp
-typeArrayOop.hpp                        orderAccess_<os_arch>.inline.hpp
-typeArrayOop.hpp                        typeArrayKlass.hpp
-
-unhandledOops.cpp                       collectedHeap.hpp
-unhandledOops.cpp                       gcLocker.inline.hpp
-unhandledOops.cpp                       globalDefinitions.hpp
-unhandledOops.cpp                       oop.inline.hpp
-unhandledOops.cpp                       thread.hpp
-unhandledOops.cpp                       unhandledOops.hpp
-unhandledOops.cpp                       universe.hpp
-
-universe.cpp                            aprofiler.hpp
-universe.cpp                            arguments.hpp
-universe.cpp                            arrayKlassKlass.hpp
-universe.cpp                            cardTableModRefBS.hpp
-universe.cpp                            classLoader.hpp
-universe.cpp                            codeCache.hpp
-universe.cpp                            collectedHeap.inline.hpp
-universe.cpp                            compiledICHolderKlass.hpp
-universe.cpp                            constMethodKlass.hpp
-universe.cpp                            constantPoolKlass.hpp
-universe.cpp                            constantPoolOop.hpp
-universe.cpp                            copy.hpp
-universe.cpp                            cpCacheKlass.hpp
-universe.cpp                            cpCacheOop.hpp
-universe.cpp                            deoptimization.hpp
-universe.cpp                            dependencies.hpp
-universe.cpp                            events.hpp
-universe.cpp                            filemap.hpp
-universe.cpp                            fprofiler.hpp
-universe.cpp                            gcLocker.inline.hpp
-universe.cpp                            genCollectedHeap.hpp
-universe.cpp                            genRemSet.hpp
-universe.cpp                            generation.hpp
-universe.cpp                            handles.inline.hpp
-universe.cpp                            hashtable.inline.hpp
-universe.cpp                            instanceKlass.hpp
-universe.cpp                            instanceKlassKlass.hpp
-universe.cpp                            instanceRefKlass.hpp
-universe.cpp                            interpreter.hpp
-universe.cpp                            java.hpp
-universe.cpp                            javaCalls.hpp
-universe.cpp                            javaClasses.hpp
-universe.cpp                            jvmtiRedefineClassesTrace.hpp
-universe.cpp                            klassKlass.hpp
-universe.cpp                            klassOop.hpp
-universe.cpp                            memoryService.hpp
-universe.cpp                            methodDataKlass.hpp
-universe.cpp                            methodKlass.hpp
-universe.cpp                            objArrayKlassKlass.hpp
-universe.cpp                            oop.inline.hpp
-universe.cpp                            oopFactory.hpp
-universe.cpp                            permGen.hpp
-universe.cpp                            preserveException.hpp
-universe.cpp                            sharedRuntime.hpp
-universe.cpp                            space.hpp
-universe.cpp                            symbolKlass.hpp
-universe.cpp                            symbolTable.hpp
-universe.cpp                            synchronizer.hpp
-universe.cpp                            systemDictionary.hpp
-universe.cpp                            thread_<os_family>.inline.hpp
-universe.cpp                            timer.hpp
-universe.cpp                            typeArrayKlass.hpp
-universe.cpp                            typeArrayKlassKlass.hpp
-universe.cpp                            universe.hpp
-universe.cpp                            universe.inline.hpp
-universe.cpp                            vmSymbols.hpp
-universe.cpp                            vm_operations.hpp
-
-universe.hpp                            growableArray.hpp
-universe.hpp                            handles.hpp
-
-universe.inline.hpp                     universe.hpp
-
-unsafe.cpp                              allocation.inline.hpp
-unsafe.cpp                              copy.hpp
-unsafe.cpp                              dtrace.hpp
-unsafe.cpp                              globals.hpp
-unsafe.cpp                              interfaceSupport.hpp
-unsafe.cpp                              jni.h
-unsafe.cpp                              jvm.h
-unsafe.cpp                              reflection.hpp
-unsafe.cpp                              reflectionCompat.hpp
-unsafe.cpp                              synchronizer.hpp
-unsafe.cpp                              threadService.hpp
-unsafe.cpp                              vmSymbols.hpp
-
-utf8.cpp                                utf8.hpp
-
-utf8.hpp                                allocation.hpp
-utf8.hpp                                top.hpp
-
-verificationType.cpp                    symbolTable.hpp
-verificationType.cpp                    verificationType.hpp
-
-verificationType.hpp                    allocation.hpp
-verificationType.hpp                    handles.hpp
-verificationType.hpp                    instanceKlass.hpp
-verificationType.hpp                    oop.inline.hpp
-verificationType.hpp                    signature.hpp
-verificationType.hpp                    symbolOop.hpp
-verificationType.hpp                    systemDictionary.hpp
-
-verifier.cpp                            bytecodeStream.hpp
-verifier.cpp                            bytes_<arch>.hpp
-verifier.cpp                            classFileStream.hpp
-verifier.cpp                            fieldDescriptor.hpp
-verifier.cpp                            handles.inline.hpp
-verifier.cpp                            hpi.hpp
-verifier.cpp                            instanceKlass.hpp
-verifier.cpp                            interfaceSupport.hpp
-verifier.cpp                            javaCalls.hpp
-verifier.cpp                            javaClasses.hpp
-verifier.cpp                            jvm.h
-verifier.cpp                            oop.inline.hpp
-verifier.cpp                            oopFactory.hpp
-verifier.cpp                            orderAccess.hpp
-verifier.cpp                            os.hpp
-verifier.cpp                            resourceArea.hpp
-verifier.cpp                            stackMapTable.hpp
-verifier.cpp                            systemDictionary.hpp
-verifier.cpp                            typeArrayOop.hpp
-verifier.cpp                            verifier.hpp
-verifier.cpp                            vmSymbols.hpp
-
-verifier.hpp                            exceptions.hpp
-verifier.hpp                            gcLocker.hpp
-verifier.hpp                            handles.hpp
-verifier.hpp                            klass.hpp
-verifier.hpp                            methodOop.hpp
-verifier.hpp                            verificationType.hpp
-
-vframe.cpp                              codeCache.hpp
-vframe.cpp                              debugInfoRec.hpp
-vframe.cpp                              handles.inline.hpp
-vframe.cpp                              instanceKlass.hpp
-vframe.cpp                              interpreter.hpp
-vframe.cpp                              javaClasses.hpp
-vframe.cpp                              nmethod.hpp
-vframe.cpp                              objectMonitor.hpp
-vframe.cpp                              objectMonitor.inline.hpp
-vframe.cpp                              oop.inline.hpp
-vframe.cpp                              oopMapCache.hpp
-vframe.cpp                              pcDesc.hpp
-vframe.cpp                              resourceArea.hpp
-vframe.cpp                              scopeDesc.hpp
-vframe.cpp                              signature.hpp
-vframe.cpp                              stubRoutines.hpp
-vframe.cpp                              synchronizer.hpp
-vframe.cpp                              systemDictionary.hpp
-vframe.cpp                              vframe.hpp
-vframe.cpp                              vframeArray.hpp
-vframe.cpp                              vframe_hp.hpp
-vframe.cpp                              vmSymbols.hpp
-
-vframe.hpp                              debugInfo.hpp
-vframe.hpp                              debugInfoRec.hpp
-vframe.hpp                              frame.hpp
-vframe.hpp                              frame.inline.hpp
-vframe.hpp                              growableArray.hpp
-vframe.hpp                              location.hpp
-vframe.hpp                              oop.hpp
-vframe.hpp                              stackValue.hpp
-vframe.hpp                              stackValueCollection.hpp
-
-vframeArray.cpp                         allocation.inline.hpp
-vframeArray.cpp                         events.hpp
-vframeArray.cpp                         handles.inline.hpp
-vframeArray.cpp                         interpreter.hpp
-vframeArray.cpp                         jvmtiThreadState.hpp
-vframeArray.cpp                         methodDataOop.hpp
-vframeArray.cpp                         monitorChunk.hpp
-vframeArray.cpp                         oop.inline.hpp
-vframeArray.cpp                         resourceArea.hpp
-vframeArray.cpp                         sharedRuntime.hpp
-vframeArray.cpp                         universe.inline.hpp
-vframeArray.cpp                         vframe.hpp
-vframeArray.cpp                         vframeArray.hpp
-vframeArray.cpp                         vframe_hp.hpp
-vframeArray.cpp                         vmSymbols.hpp
-
-vframeArray.hpp                         arrayOop.hpp
-vframeArray.hpp                         deoptimization.hpp
-vframeArray.hpp                         frame.inline.hpp
-vframeArray.hpp                         growableArray.hpp
-vframeArray.hpp                         monitorChunk.hpp
-
-vframe_hp.cpp                           basicLock.hpp
-vframe_hp.cpp                           codeCache.hpp
-vframe_hp.cpp                           debugInfoRec.hpp
-vframe_hp.cpp                           handles.inline.hpp
-vframe_hp.cpp                           instanceKlass.hpp
-vframe_hp.cpp                           interpreter.hpp
-vframe_hp.cpp                           monitorChunk.hpp
-vframe_hp.cpp                           nmethod.hpp
-vframe_hp.cpp                           oop.inline.hpp
-vframe_hp.cpp                           oopMapCache.hpp
-vframe_hp.cpp                           pcDesc.hpp
-vframe_hp.cpp                           scopeDesc.hpp
-vframe_hp.cpp                           signature.hpp
-vframe_hp.cpp                           stubRoutines.hpp
-vframe_hp.cpp                           vframeArray.hpp
-vframe_hp.cpp                           vframe_hp.hpp
-
-vframe_hp.hpp                           vframe.hpp
-
-virtualspace.cpp                        markOop.hpp
-virtualspace.cpp                        oop.inline.hpp
-virtualspace.cpp                        os_<os_family>.inline.hpp
-virtualspace.cpp                        virtualspace.hpp
-
-virtualspace.hpp                        allocation.hpp
-
-vmError.cpp                             arguments.hpp
-vmError.cpp                             collectedHeap.hpp
-vmError.cpp                             compileBroker.hpp
-vmError.cpp                             debug.hpp
-vmError.cpp                             defaultStream.hpp
-vmError.cpp                             frame.inline.hpp
-vmError.cpp                             init.hpp
-vmError.cpp                             os.hpp
-vmError.cpp                             thread.hpp
-vmError.cpp                             top.hpp
-vmError.cpp                             vmError.hpp
-vmError.cpp                             vmThread.hpp
-vmError.cpp                             vm_operations.hpp
-
-vmError.hpp                             globalDefinitions.hpp
-
-vmError_<os_family>.cpp                 arguments.hpp
-vmError_<os_family>.cpp                 os.hpp
-vmError_<os_family>.cpp                 thread.hpp
-vmError_<os_family>.cpp                 vmError.hpp
-
-// vmStructs is jck optional, put cpp deps in includeDB_features
-
-vmStructs.hpp                           debug.hpp
-
-vmSymbols.cpp                           handles.inline.hpp
-vmSymbols.cpp                           oop.inline.hpp
-vmSymbols.cpp                           oopFactory.hpp
-vmSymbols.cpp                           vmSymbols.hpp
-vmSymbols.cpp                           xmlstream.hpp
-
-vmSymbols.hpp                           symbolOop.hpp
-
-vmThread.cpp                            collectedHeap.hpp
-vmThread.cpp                            compileBroker.hpp
-vmThread.cpp                            dtrace.hpp
-vmThread.cpp                            events.hpp
-vmThread.cpp                            interfaceSupport.hpp
-vmThread.cpp                            methodOop.hpp
-vmThread.cpp                            mutexLocker.hpp
-vmThread.cpp                            oop.inline.hpp
-vmThread.cpp                            os.hpp
-vmThread.cpp                            resourceArea.hpp
-vmThread.cpp                            runtimeService.hpp
-vmThread.cpp                            thread_<os_family>.inline.hpp
-vmThread.cpp                            vmThread.hpp
-vmThread.cpp                            vm_operations.hpp
-vmThread.cpp                            xmlstream.hpp
-
-vmThread.hpp                            perfData.hpp
-vmThread.hpp                            thread_<os_family>.inline.hpp
-vmThread.hpp                            vm_operations.hpp
-
-vm_operations.cpp                       arguments.hpp
-vm_operations.cpp                       compileBroker.hpp
-vm_operations.cpp                       compilerOracle.hpp
-vm_operations.cpp                       deoptimization.hpp
-vm_operations.cpp                       interfaceSupport.hpp
-vm_operations.cpp                       isGCActiveMark.hpp
-vm_operations.cpp                       resourceArea.hpp
-vm_operations.cpp                       sweeper.hpp
-vm_operations.cpp                       threadService.hpp
-vm_operations.cpp                       thread_<os_family>.inline.hpp
-vm_operations.cpp                       vmSymbols.hpp
-vm_operations.cpp                       vm_operations.hpp
-
-vm_operations.hpp                       allocation.hpp
-vm_operations.hpp                       javaClasses.hpp
-vm_operations.hpp                       oop.hpp
-vm_operations.hpp                       thread.hpp
-vm_operations.hpp                       top.hpp
-
-vm_version.cpp                          arguments.hpp
-vm_version.cpp                          oop.inline.hpp
-vm_version.cpp                          universe.hpp
-vm_version.cpp                          vm_version_<arch>.hpp
-
-vm_version.hpp                          allocation.hpp
-vm_version.hpp                          ostream.hpp
-
-vm_version_<arch>.cpp                   assembler_<arch>.inline.hpp
-vm_version_<arch>.cpp                   java.hpp
-vm_version_<arch>.cpp                   os_<os_family>.inline.hpp
-vm_version_<arch>.cpp                   resourceArea.hpp
-vm_version_<arch>.cpp                   stubCodeGenerator.hpp
-vm_version_<arch>.cpp                   vm_version_<arch>.hpp
-
-vm_version_<arch>.hpp                   globals_extension.hpp
-vm_version_<arch>.hpp                   vm_version.hpp
-
-vm_version_<os_arch>.cpp                os.hpp
-vm_version_<os_arch>.cpp                vm_version_<arch>.hpp
-
-vmreg.cpp                               assembler.hpp
-vmreg.cpp                               vmreg.hpp
-
-vmreg.hpp                               allocation.hpp
-vmreg.hpp                               globalDefinitions.hpp
-vmreg.hpp                               register_<arch>.hpp
-
-vmreg_<arch>.cpp                        assembler.hpp
-vmreg_<arch>.cpp                        vmreg.hpp
-
-vmreg_<arch>.hpp                        generate_platform_dependent_include
-
-vtableStubs.cpp                         allocation.inline.hpp
-vtableStubs.cpp                         disassembler.hpp
-vtableStubs.cpp                         forte.hpp
-vtableStubs.cpp                         handles.inline.hpp
-vtableStubs.cpp                         instanceKlass.hpp
-vtableStubs.cpp                         jvmtiExport.hpp
-vtableStubs.cpp                         klassVtable.hpp
-vtableStubs.cpp                         oop.inline.hpp
-vtableStubs.cpp                         mutexLocker.hpp
-vtableStubs.cpp                         resourceArea.hpp
-vtableStubs.cpp                         sharedRuntime.hpp
-vtableStubs.cpp                         vtableStubs.hpp
-
-vtableStubs.hpp                         allocation.hpp
-
-vtableStubs_<arch_model>.cpp            assembler.hpp
-vtableStubs_<arch_model>.cpp            assembler_<arch>.inline.hpp
-vtableStubs_<arch_model>.cpp            instanceKlass.hpp
-vtableStubs_<arch_model>.cpp            interp_masm_<arch_model>.hpp
-vtableStubs_<arch_model>.cpp            klassVtable.hpp
-vtableStubs_<arch_model>.cpp            resourceArea.hpp
-vtableStubs_<arch_model>.cpp            sharedRuntime.hpp
-vtableStubs_<arch_model>.cpp            vmreg_<arch>.inline.hpp
-vtableStubs_<arch_model>.cpp            vtableStubs.hpp
-
-watermark.hpp                           allocation.hpp
-watermark.hpp                           globalDefinitions.hpp
-
-workgroup.cpp                           allocation.hpp
-workgroup.cpp                           allocation.inline.hpp
-workgroup.cpp                           os.hpp
-workgroup.cpp                           workgroup.hpp
-
-workgroup.hpp                           taskqueue.hpp
-
-workgroup.hpp                           thread_<os_family>.inline.hpp
-
-xmlstream.cpp                           allocation.hpp
-xmlstream.cpp                           allocation.inline.hpp
-xmlstream.cpp                           deoptimization.hpp
-xmlstream.cpp                           methodDataOop.hpp
-xmlstream.cpp                           methodOop.hpp
-xmlstream.cpp                           nmethod.hpp
-xmlstream.cpp                           oop.inline.hpp
-xmlstream.cpp                           vmThread.hpp
-xmlstream.cpp                           xmlstream.hpp
-
-xmlstream.hpp                           handles.hpp
-xmlstream.hpp                           ostream.hpp
--- a/src/share/vm/includeDB_features	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,333 +0,0 @@
-//
-// 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.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//  
-//
-
-attachListener.cpp                      arguments.hpp
-attachListener.cpp                      attachListener.hpp
-attachListener.cpp                      globals.hpp
-attachListener.cpp                      heapDumper.hpp
-attachListener.cpp                      java.hpp
-attachListener.cpp                      javaCalls.hpp
-attachListener.cpp                      javaClasses.hpp
-attachListener.cpp                      jvmtiExport.hpp
-attachListener.cpp                      os.hpp
-attachListener.cpp                      resourceArea.hpp
-attachListener.cpp                      systemDictionary.hpp
-attachListener.cpp                      vmGCOperations.hpp
-
-attachListener_<os_family>.cpp          attachListener.hpp
-attachListener_<os_family>.cpp          dtraceAttacher.hpp
-attachListener_<os_family>.cpp          interfaceSupport.hpp
-attachListener_<os_family>.cpp          os.hpp
-
-dump.cpp                                classify.hpp
-dump.cpp                                copy.hpp
-dump.cpp                                filemap.hpp
-dump.cpp                                javaCalls.hpp
-dump.cpp                                javaClasses.hpp
-dump.cpp                                loaderConstraints.hpp
-dump.cpp                                methodDataOop.hpp
-dump.cpp                                oop.inline.hpp
-dump.cpp                                oopFactory.hpp
-dump.cpp                                resourceArea.hpp
-dump.cpp                                signature.hpp
-dump.cpp                                spaceDecorator.hpp
-dump.cpp                                symbolTable.hpp
-dump.cpp                                systemDictionary.hpp
-dump.cpp                                vmThread.hpp
-dump.cpp                                vm_operations.hpp
-
-dump_<arch_model>.cpp                   assembler_<arch>.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
-forte.cpp                               forte.hpp
-forte.cpp                               oop.inline.hpp
-forte.cpp                               oop.inline2.hpp
-forte.cpp                               pcDesc.hpp
-forte.cpp                               space.hpp
-forte.cpp                               thread.hpp
-forte.cpp                               universe.inline.hpp
-forte.cpp                               vframe.hpp
-forte.cpp                               vframeArray.hpp
-
-fprofiler.cpp                           allocation.inline.hpp
-fprofiler.cpp                           classLoader.hpp
-fprofiler.cpp                           collectedHeap.inline.hpp
-fprofiler.cpp                           deoptimization.hpp
-fprofiler.cpp                           fprofiler.hpp
-fprofiler.cpp                           interpreter.hpp
-fprofiler.cpp                           macros.hpp
-fprofiler.cpp                           mutexLocker.hpp
-fprofiler.cpp                           oop.inline.hpp
-fprofiler.cpp                           oop.inline2.hpp
-fprofiler.cpp                           stubCodeGenerator.hpp
-fprofiler.cpp                           stubRoutines.hpp
-fprofiler.cpp                           symbolOop.hpp
-fprofiler.cpp                           task.hpp
-fprofiler.cpp                           universe.inline.hpp
-fprofiler.cpp                           vframe.hpp
-fprofiler.cpp                           vtableStubs.hpp
-
-heapDumper.cpp                          genCollectedHeap.hpp
-heapDumper.cpp                          heapDumper.hpp 
-heapDumper.cpp                          javaCalls.hpp
-heapDumper.cpp                          jniHandles.hpp
-heapDumper.cpp                          objArrayKlass.hpp
-heapDumper.cpp                          ostream.hpp
-heapDumper.cpp                          reflectionUtils.hpp
-heapDumper.cpp                          symbolTable.hpp
-heapDumper.cpp                          systemDictionary.hpp
-heapDumper.cpp                          threadService.hpp
-heapDumper.cpp                          universe.hpp
-heapDumper.cpp                          vframe.hpp
-heapDumper.cpp                          vmGCOperations.hpp
-heapDumper.cpp                          vmSymbols.hpp
-heapDumper.cpp                          vmThread.hpp
-heapDumper.cpp                          vm_operations.hpp
-
-heapInspection.cpp                      collectedHeap.hpp
-heapInspection.cpp                      genCollectedHeap.hpp
-heapInspection.cpp                      globalDefinitions.hpp
-heapInspection.cpp                      heapInspection.hpp
-heapInspection.cpp                      klassOop.hpp
-heapInspection.cpp                      os.hpp
-heapInspection.cpp                      resourceArea.hpp
-
-javaCalls.cpp                           jniCheck.hpp
-
-jniCheck.cpp                            fieldDescriptor.hpp
-jniCheck.cpp                            handles.hpp
-jniCheck.cpp                            instanceKlass.hpp
-jniCheck.cpp                            interfaceSupport.hpp
-jniCheck.cpp                            jfieldIDWorkaround.hpp
-jniCheck.cpp                            jni.h
-jniCheck.cpp                            jniCheck.hpp
-jniCheck.cpp                            jniTypes_<arch>.hpp
-jniCheck.cpp                            jvm_misc.hpp
-jniCheck.cpp                            oop.inline.hpp
-jniCheck.cpp                            symbolOop.hpp
-jniCheck.cpp                            systemDictionary.hpp
-jniCheck.cpp                            thread.hpp
-jniCheck.cpp                            vmSymbols.hpp
-
-jvmtiCodeBlobEvents.cpp                 codeBlob.hpp
-jvmtiCodeBlobEvents.cpp                 codeCache.hpp
-jvmtiCodeBlobEvents.cpp                 handles.hpp
-jvmtiCodeBlobEvents.cpp                 handles.inline.hpp
-jvmtiCodeBlobEvents.cpp                 jvmtiCodeBlobEvents.hpp
-jvmtiCodeBlobEvents.cpp                 jvmtiExport.hpp
-jvmtiCodeBlobEvents.cpp                 oop.inline.hpp
-jvmtiCodeBlobEvents.cpp                 resourceArea.hpp
-jvmtiCodeBlobEvents.cpp                 scopeDesc.hpp
-jvmtiCodeBlobEvents.cpp                 vmThread.hpp
-
-jvmtiCodeBlobEvents.hpp                 jvmti.h
-
-jvmtiExtensions.cpp                     jvmtiExport.hpp
-jvmtiExtensions.cpp                     jvmtiExtensions.hpp
-
-jvmtiExtensions.hpp                     allocation.hpp
-jvmtiExtensions.hpp                     jvmti.h
-jvmtiExtensions.hpp                     jvmtiEnv.hpp
-
-jvmtiImpl.cpp                           deoptimization.hpp
-jvmtiImpl.cpp                           exceptions.hpp
-jvmtiImpl.cpp                           handles.hpp
-jvmtiImpl.cpp                           handles.inline.hpp
-jvmtiImpl.cpp                           instanceKlass.hpp
-jvmtiImpl.cpp                           interfaceSupport.hpp
-jvmtiImpl.cpp                           interpreter.hpp
-jvmtiImpl.cpp                           javaCalls.hpp
-jvmtiImpl.cpp                           jvmtiAgentThread.hpp
-jvmtiImpl.cpp                           jvmtiEnv.hpp
-jvmtiImpl.cpp                           jvmtiEventController.inline.hpp
-jvmtiImpl.cpp                           jvmtiImpl.hpp
-jvmtiImpl.cpp                           jvmtiRedefineClasses.hpp
-jvmtiImpl.cpp                           resourceArea.hpp
-jvmtiImpl.cpp                           signature.hpp
-jvmtiImpl.cpp                           systemDictionary.hpp
-jvmtiImpl.cpp                           thread_<os_family>.inline.hpp
-jvmtiImpl.cpp                           vframe.hpp
-jvmtiImpl.cpp                           vframe_hp.hpp
-jvmtiImpl.cpp                           vm_operations.hpp
-
-jvmtiImpl.hpp                           jvmti.h
-jvmtiImpl.hpp                           jvmtiEnvThreadState.hpp
-jvmtiImpl.hpp                           jvmtiEventController.hpp
-jvmtiImpl.hpp                           jvmtiTrace.hpp
-jvmtiImpl.hpp                           jvmtiUtil.hpp
-jvmtiImpl.hpp                           objArrayOop.hpp
-jvmtiImpl.hpp                           stackValueCollection.hpp
-jvmtiImpl.hpp                           systemDictionary.hpp
-jvmtiImpl.hpp                           vm_operations.hpp
-
-jvmtiRawMonitor.cpp                     interfaceSupport.hpp
-jvmtiRawMonitor.cpp                     jvmtiRawMonitor.hpp
-jvmtiRawMonitor.cpp                     thread.hpp
-
-jvmtiRawMonitor.hpp                     growableArray.hpp
-jvmtiRawMonitor.hpp                     objectMonitor.hpp
-
-jvmtiTagMap.cpp                         biasedLocking.hpp
-jvmtiTagMap.cpp                         javaCalls.hpp
-jvmtiTagMap.cpp                         jniHandles.hpp
-jvmtiTagMap.cpp                         jvmtiEnv.hpp
-jvmtiTagMap.cpp                         jvmtiEventController.hpp
-jvmtiTagMap.cpp                         jvmtiEventController.inline.hpp
-jvmtiTagMap.cpp                         jvmtiExport.hpp
-jvmtiTagMap.cpp                         jvmtiImpl.hpp
-jvmtiTagMap.cpp                         jvmtiTagMap.hpp
-jvmtiTagMap.cpp                         mutex.hpp
-jvmtiTagMap.cpp                         mutexLocker.hpp
-jvmtiTagMap.cpp                         objArrayKlass.hpp
-jvmtiTagMap.cpp                         oop.inline2.hpp
-jvmtiTagMap.cpp                         reflectionUtils.hpp
-jvmtiTagMap.cpp                         serviceUtil.hpp
-jvmtiTagMap.cpp                         symbolTable.hpp
-jvmtiTagMap.cpp                         systemDictionary.hpp
-jvmtiTagMap.cpp                         vframe.hpp
-jvmtiTagMap.cpp                         vmSymbols.hpp
-jvmtiTagMap.cpp                         vmThread.hpp
-jvmtiTagMap.cpp                         vm_operations.hpp
-
-jvmtiTagMap.hpp                         allocation.hpp
-jvmtiTagMap.hpp                         collectedHeap.hpp
-jvmtiTagMap.hpp                         genCollectedHeap.hpp
-jvmtiTagMap.hpp                         jvmti.h
-jvmtiTagMap.hpp                         jvmtiEnv.hpp
-jvmtiTagMap.hpp                         universe.hpp
-
-jvmtiTrace.cpp                          jvmtiEnv.hpp
-jvmtiTrace.cpp                          jvmtiTrace.hpp
-
-jvmtiTrace.hpp                          jvmti.h
-jvmtiTrace.hpp                          jvmtiEnvThreadState.hpp
-jvmtiTrace.hpp                          jvmtiEventController.hpp
-jvmtiTrace.hpp                          jvmtiUtil.hpp
-jvmtiTrace.hpp                          objArrayOop.hpp
-jvmtiTrace.hpp                          stackValueCollection.hpp
-jvmtiTrace.hpp                          systemDictionary.hpp
-jvmtiTrace.hpp                          vm_operations.hpp
-
-restore.cpp                             filemap.hpp
-restore.cpp                             hashtable.inline.hpp
-restore.cpp                             oop.inline.hpp
-restore.cpp                             symbolTable.hpp
-restore.cpp                             systemDictionary.hpp
-
-serialize.cpp                           classify.hpp
-serialize.cpp                           codeCache.hpp
-serialize.cpp                           compactingPermGenGen.hpp
-serialize.cpp                           compiledICHolderOop.hpp
-serialize.cpp                           methodDataOop.hpp
-serialize.cpp                           objArrayOop.hpp
-serialize.cpp                           oop.inline.hpp
-serialize.cpp                           symbolTable.hpp
-serialize.cpp                           systemDictionary.hpp
-
-vmStructs.cpp                           arguments.hpp
-vmStructs.cpp                           arrayKlass.hpp
-vmStructs.cpp                           arrayKlassKlass.hpp
-vmStructs.cpp                           arrayOop.hpp
-vmStructs.cpp                           bytecodes.hpp
-vmStructs.cpp                           bytecodeInterpreter.hpp
-vmStructs.cpp                           cardTableRS.hpp
-vmStructs.cpp                           codeBlob.hpp
-vmStructs.cpp                           codeCache.hpp
-vmStructs.cpp                           collectedHeap.hpp
-vmStructs.cpp                           compactPermGen.hpp
-vmStructs.cpp                           compiledICHolderKlass.hpp
-vmStructs.cpp                           compiledICHolderOop.hpp
-vmStructs.cpp                           compressedStream.hpp
-vmStructs.cpp                           constMethodKlass.hpp
-vmStructs.cpp                           constMethodOop.hpp
-vmStructs.cpp                           constantPoolKlass.hpp
-vmStructs.cpp                           constantPoolOop.hpp
-vmStructs.cpp                           cpCacheKlass.hpp
-vmStructs.cpp                           cpCacheOop.hpp
-vmStructs.cpp                           defNewGeneration.hpp
-vmStructs.cpp                           dictionary.hpp
-vmStructs.cpp                           freeBlockDictionary.hpp
-vmStructs.cpp                           genCollectedHeap.hpp
-vmStructs.cpp                           generation.hpp
-vmStructs.cpp                           generationSpec.hpp
-vmStructs.cpp                           globalDefinitions.hpp
-vmStructs.cpp                           globals.hpp
-vmStructs.cpp                           hashtable.hpp
-vmStructs.cpp                           heap.hpp
-vmStructs.cpp                           immutableSpace.hpp
-vmStructs.cpp                           instanceKlass.hpp
-vmStructs.cpp                           instanceKlassKlass.hpp
-vmStructs.cpp                           instanceOop.hpp
-vmStructs.cpp                           interpreter.hpp
-vmStructs.cpp                           java.hpp
-vmStructs.cpp                           javaCalls.hpp
-vmStructs.cpp                           javaClasses.hpp
-vmStructs.cpp                           jvmtiAgentThread.hpp
-vmStructs.cpp                           klass.hpp
-vmStructs.cpp                           klassOop.hpp
-vmStructs.cpp                           loaderConstraints.hpp
-vmStructs.cpp                           location.hpp
-vmStructs.cpp                           markOop.hpp
-vmStructs.cpp                           markSweep.hpp
-vmStructs.cpp                           methodDataKlass.hpp
-vmStructs.cpp                           methodDataOop.hpp
-vmStructs.cpp                           methodKlass.hpp
-vmStructs.cpp                           methodOop.hpp
-vmStructs.cpp                           mutableSpace.hpp
-vmStructs.cpp                           nmethod.hpp
-vmStructs.cpp                           objArrayKlass.hpp
-vmStructs.cpp                           objArrayKlassKlass.hpp
-vmStructs.cpp                           objArrayOop.hpp
-vmStructs.cpp                           oop.inline.hpp
-vmStructs.cpp                           oopMap.hpp
-vmStructs.cpp                           pcDesc.hpp
-vmStructs.cpp                           perfMemory.hpp
-vmStructs.cpp                           permGen.hpp
-vmStructs.cpp                           placeholders.hpp
-vmStructs.cpp                           sharedRuntime.hpp
-vmStructs.cpp                           space.hpp
-vmStructs.cpp                           stubRoutines.hpp
-vmStructs.cpp                           stubs.hpp
-vmStructs.cpp                           symbolKlass.hpp
-vmStructs.cpp                           symbolOop.hpp
-vmStructs.cpp                           symbolTable.hpp
-vmStructs.cpp                           systemDictionary.hpp
-vmStructs.cpp                           tenuredGeneration.hpp
-vmStructs.cpp                           thread_<os_family>.inline.hpp
-vmStructs.cpp                           typeArrayKlass.hpp
-vmStructs.cpp                           typeArrayKlassKlass.hpp
-vmStructs.cpp                           typeArrayOop.hpp
-vmStructs.cpp                           universe.hpp
-vmStructs.cpp                           virtualspace.hpp
-vmStructs.cpp                           vmStructs.hpp
-vmStructs.cpp                           vmStructs_<arch>.hpp
-vmStructs.cpp                           vmStructs_<os_arch>.hpp
-vmStructs.cpp                           vmreg.hpp
-vmStructs.cpp                           watermark.hpp
-
-vmStructs.hpp                           debug.hpp
--- a/src/share/vm/includeDB_gc	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-//
-// Copyright (c) 2001, 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.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//  
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-collectedHeap.cpp                       collectedHeap.hpp
-collectedHeap.cpp                       collectedHeap.inline.hpp
-collectedHeap.cpp                       heapDumper.hpp
-collectedHeap.cpp                       init.hpp
-collectedHeap.cpp                       oop.inline.hpp
-collectedHeap.cpp                       systemDictionary.hpp
-collectedHeap.cpp                       thread_<os_family>.inline.hpp
-collectedHeap.cpp                       vmGCOperations.hpp
-
-collectedHeap.hpp                       allocation.hpp
-collectedHeap.hpp                       barrierSet.hpp
-collectedHeap.hpp                       gcCause.hpp
-collectedHeap.hpp                       handles.hpp
-collectedHeap.hpp                       perfData.hpp
-collectedHeap.hpp                       safepoint.hpp
-
-collectedHeap.inline.hpp                arrayOop.hpp
-collectedHeap.inline.hpp                collectedHeap.hpp
-collectedHeap.inline.hpp                copy.hpp
-collectedHeap.inline.hpp                jvmtiExport.hpp
-collectedHeap.inline.hpp                lowMemoryDetector.hpp
-collectedHeap.inline.hpp                sharedRuntime.hpp
-collectedHeap.inline.hpp                thread.hpp
-collectedHeap.inline.hpp                threadLocalAllocBuffer.inline.hpp
-collectedHeap.inline.hpp                universe.hpp
-collectedHeap.inline.hpp                thread_<os_family>.inline.hpp
-collectedHeap.inline.hpp                sharedRuntime.hpp
-
-gcCause.hpp                             allocation.hpp
-
-gcCause.cpp                             gcCause.hpp
--- a/src/share/vm/includeDB_gc_parallel	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-//
-// Copyright (c) 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.
-//   
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//  
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//   
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//  
-
-arguments.cpp                           compactibleFreeListSpace.hpp
-
-assembler_<arch>.cpp                    g1SATBCardTableModRefBS.hpp
-assembler_<arch>.cpp                    g1CollectedHeap.inline.hpp
-assembler_<arch>.cpp                    heapRegion.hpp
-
-collectorPolicy.cpp                     cmsAdaptiveSizePolicy.hpp
-collectorPolicy.cpp                     cmsGCAdaptivePolicyCounters.hpp
-
-compiledICHolderKlass.cpp               oop.pcgc.inline.hpp
-
-constantPoolKlass.cpp                   cardTableRS.hpp
-constantPoolKlass.cpp                   oop.pcgc.inline.hpp
-constantPoolKlass.cpp                   psPromotionManager.inline.hpp
-constantPoolKlass.cpp                   psScavenge.inline.hpp
-constantPoolKlass.cpp                   parOopClosures.inline.hpp
-
-constantPoolKlass.cpp                   cardTableRS.hpp
-constantPoolKlass.cpp                   oop.pcgc.inline.hpp
-constantPoolKlass.cpp                   psPromotionManager.inline.hpp
-constantPoolKlass.cpp                   psScavenge.inline.hpp
-constantPoolKlass.cpp                   parOopClosures.inline.hpp
-
-cpCacheKlass.cpp                        cardTableRS.hpp
-cpCacheKlass.cpp                        oop.pcgc.inline.hpp
-cpCacheKlass.cpp                        psPromotionManager.inline.hpp
-cpCacheKlass.cpp                        psScavenge.inline.hpp
-cpCacheKlass.cpp                        parOopClosures.inline.hpp
-
-genCollectedHeap.cpp                    concurrentMarkSweepThread.hpp
-genCollectedHeap.cpp                    vmCMSOperations.hpp
-
-generationSpec.cpp                      asParNewGeneration.hpp
-generationSpec.cpp                      cmsPermGen.hpp
-generationSpec.cpp                      parNewGeneration.hpp
-
-heapDumper.cpp                          parallelScavengeHeap.hpp
-
-heapInspection.cpp                      parallelScavengeHeap.hpp
-
-instanceKlass.cpp                       heapRegionSeq.inline.hpp
-instanceKlass.cpp                       g1CollectedHeap.inline.hpp
-instanceKlass.cpp                       g1OopClosures.inline.hpp
-instanceKlass.cpp                       oop.pcgc.inline.hpp
-instanceKlass.cpp                       psPromotionManager.inline.hpp
-instanceKlass.cpp                       psScavenge.inline.hpp
-instanceKlass.cpp                       parOopClosures.inline.hpp
-
-instanceKlassKlass.cpp                  cardTableRS.hpp
-instanceKlassKlass.cpp                  oop.pcgc.inline.hpp
-instanceKlassKlass.cpp                  psPromotionManager.inline.hpp
-instanceKlassKlass.cpp                  psScavenge.inline.hpp
-instanceKlassKlass.cpp                  parOopClosures.inline.hpp
-
-instanceRefKlass.cpp                    heapRegionSeq.inline.hpp
-instanceRefKlass.cpp                    g1CollectedHeap.inline.hpp
-instanceRefKlass.cpp                    g1OopClosures.inline.hpp
-instanceRefKlass.cpp                    oop.pcgc.inline.hpp
-instanceRefKlass.cpp                    psPromotionManager.inline.hpp
-instanceRefKlass.cpp                    psScavenge.inline.hpp
-instanceRefKlass.cpp                    parOopClosures.inline.hpp
-
-java.cpp                                concurrentMarkSweepThread.hpp
-java.cpp                                psScavenge.hpp
-java.cpp                                psScavenge.inline.hpp
-
-jvmtiExport.cpp                         psMarkSweep.hpp
-
-jvmtiTagMap.cpp                         parallelScavengeHeap.hpp
-
-klassKlass.cpp                          oop.pcgc.inline.hpp
-
-klass.hpp                               cmsOopClosures.hpp
-klass.hpp                               parOopClosures.hpp
-
-memoryPool.hpp                          compactibleFreeListSpace.hpp
-
-memoryService.cpp                       cmsPermGen.hpp
-memoryService.cpp                       concurrentMarkSweepGeneration.hpp
-memoryService.cpp                       g1CollectedHeap.inline.hpp
-memoryService.cpp                       parNewGeneration.hpp
-memoryService.cpp                       parallelScavengeHeap.hpp
-memoryService.cpp                       psMemoryPool.hpp
-memoryService.cpp                       psOldGen.hpp
-memoryService.cpp                       psPermGen.hpp
-memoryService.cpp                       psYoungGen.hpp
-
-methodDataKlass.cpp                     oop.pcgc.inline.hpp
-methodDataKlass.cpp                     psScavenge.inline.hpp
-
-objArrayKlass.cpp                       heapRegionSeq.inline.hpp
-objArrayKlass.cpp                       g1CollectedHeap.inline.hpp
-objArrayKlass.cpp                       g1OopClosures.inline.hpp
-objArrayKlass.cpp                       oop.pcgc.inline.hpp
-objArrayKlass.cpp                       psCompactionManager.hpp
-objArrayKlass.cpp                       psPromotionManager.inline.hpp
-objArrayKlass.cpp                       psScavenge.inline.hpp
-objArrayKlass.cpp                       parOopClosures.inline.hpp
-
-objArrayKlass.inline.hpp		psCompactionManager.inline.hpp
-objArrayKlass.inline.hpp		psParallelCompact.hpp
-
-oop.pcgc.inline.hpp                     parNewGeneration.hpp
-oop.pcgc.inline.hpp                     parallelScavengeHeap.hpp
-oop.pcgc.inline.hpp                     psCompactionManager.hpp
-oop.pcgc.inline.hpp                     psParallelCompact.hpp
-oop.pcgc.inline.hpp                     psScavenge.hpp
-oop.pcgc.inline.hpp                     psScavenge.inline.hpp
-
-oop.psgc.inline.hpp                     parallelScavengeHeap.hpp
-oop.psgc.inline.hpp                     psScavenge.hpp
-oop.psgc.inline.hpp                     psScavenge.inline.hpp
-
-psMemoryPool.cpp                        handles.inline.hpp
-psMemoryPool.cpp                        javaCalls.hpp
-psMemoryPool.cpp                        lowMemoryDetector.hpp
-psMemoryPool.cpp                        management.hpp
-psMemoryPool.cpp                        memoryManager.hpp
-psMemoryPool.cpp                        oop.inline.hpp
-psMemoryPool.cpp                        psMemoryPool.hpp
-psMemoryPool.cpp                        psPermGen.hpp
-psMemoryPool.cpp                        systemDictionary.hpp
-psMemoryPool.cpp                        vmSymbols.hpp
-
-psMemoryPool.hpp                        defNewGeneration.hpp
-psMemoryPool.hpp                        heap.hpp
-psMemoryPool.hpp                        memoryUsage.hpp
-psMemoryPool.hpp                        memoryPool.hpp
-psMemoryPool.hpp                        mutableSpace.hpp
-psMemoryPool.hpp                        psOldGen.hpp
-psMemoryPool.hpp                        psYoungGen.hpp
-psMemoryPool.hpp                        space.hpp
-
-safepoint.cpp                           concurrentGCThread.hpp
-safepoint.cpp                           concurrentMarkSweepThread.hpp
-
-thread.cpp                              concurrentMarkSweepThread.hpp
-thread.cpp                              pcTasks.hpp
-
-thread.hpp                              dirtyCardQueue.hpp
-thread.hpp                              satbQueue.hpp
-
-universe.cpp                            parallelScavengeHeap.hpp
-universe.cpp                            cmsCollectorPolicy.hpp
-universe.cpp                            cmsAdaptiveSizePolicy.hpp
-
-vmStructs.cpp                           asPSOldGen.hpp            
-vmStructs.cpp                           asPSYoungGen.hpp
-vmStructs.cpp                           cmsPermGen.hpp
-vmStructs.cpp                           compactibleFreeListSpace.hpp
-vmStructs.cpp                           concurrentMarkSweepGeneration.hpp
-vmStructs.cpp                           concurrentMarkSweepThread.hpp
-vmStructs.cpp                           parNewGeneration.hpp
-vmStructs.cpp                           parallelScavengeHeap.hpp   
-vmStructs.cpp                           psOldGen.hpp
-vmStructs.cpp                           psPermGen.hpp
-vmStructs.cpp                           psVirtualspace.hpp
-vmStructs.cpp                           psYoungGen.hpp
-vmStructs.cpp                           vmStructs_cms.hpp
-vmStructs.cpp                           vmStructs_parallelgc.hpp
-vmStructs.cpp                           vmStructs_parNew.hpp
--- a/src/share/vm/includeDB_jvmti	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-//
-// 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.
-//
-// This code is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// version 2 for more details (a copy is included in the LICENSE file that
-// accompanied this code).
-//
-// You should have received a copy of the GNU General Public License version
-// 2 along with this work; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//  
-//
-
-jvmtiAgentThread.hpp                    jvmtiEnv.hpp
-
-jvmtiClassFileReconstituter.cpp         bytecodeStream.hpp
-jvmtiClassFileReconstituter.cpp         bytes_<arch>.hpp
-jvmtiClassFileReconstituter.cpp         jvmtiClassFileReconstituter.hpp
-jvmtiClassFileReconstituter.cpp         symbolTable.hpp
-jvmtiClassFileReconstituter.cpp         signature.hpp
-
-jvmtiClassFileReconstituter.hpp         jvmtiEnv.hpp
-
-// jvmtiCodeBlobEvents is jck optional, please put deps in includeDB_features
-
-jvmtiEnter.cpp                          jvmtiEnter.hpp
-jvmtiEnter.cpp                          jvmtiRawMonitor.hpp
-jvmtiEnter.cpp                          jvmtiUtil.hpp
-
-jvmtiEnter.hpp                          interfaceSupport.hpp
-jvmtiEnter.hpp                          jvmtiEnv.hpp
-jvmtiEnter.hpp                          jvmtiImpl.hpp
-jvmtiEnter.hpp                          resourceArea.hpp
-jvmtiEnter.hpp                          systemDictionary.hpp
-
-jvmtiEnterTrace.cpp                     jvmtiEnter.hpp
-jvmtiEnterTrace.cpp                     jvmtiRawMonitor.hpp
-jvmtiEnterTrace.cpp                     jvmtiUtil.hpp
-
-jvmtiEnv.cpp                            arguments.hpp
-jvmtiEnv.cpp                            bytecodeStream.hpp
-jvmtiEnv.cpp                            cpCacheOop.hpp
-jvmtiEnv.cpp                            deoptimization.hpp
-jvmtiEnv.cpp                            exceptions.hpp
-jvmtiEnv.cpp                            instanceKlass.hpp
-jvmtiEnv.cpp                            interfaceSupport.hpp
-jvmtiEnv.cpp                            interpreter.hpp
-jvmtiEnv.cpp                            javaCalls.hpp
-jvmtiEnv.cpp                            jfieldIDWorkaround.hpp
-jvmtiEnv.cpp                            jniCheck.hpp
-jvmtiEnv.cpp                            jvm_misc.hpp
-jvmtiEnv.cpp                            jvmtiAgentThread.hpp
-jvmtiEnv.cpp                            jvmtiClassFileReconstituter.hpp
-jvmtiEnv.cpp                            jvmtiCodeBlobEvents.hpp
-jvmtiEnv.cpp                            jvmtiEnv.hpp
-jvmtiEnv.cpp                            jvmtiExtensions.hpp
-jvmtiEnv.cpp                            jvmtiGetLoadedClasses.hpp
-jvmtiEnv.cpp                            jvmtiImpl.hpp
-jvmtiEnv.cpp                            jvmtiManageCapabilities.hpp
-jvmtiEnv.cpp                            jvmtiRawMonitor.hpp
-jvmtiEnv.cpp                            jvmtiRedefineClasses.hpp
-jvmtiEnv.cpp                            jvmtiTagMap.hpp
-jvmtiEnv.cpp                            jvmtiThreadState.inline.hpp
-jvmtiEnv.cpp                            jvmtiUtil.hpp
-jvmtiEnv.cpp                            osThread.hpp
-jvmtiEnv.cpp                            preserveException.hpp
-jvmtiEnv.cpp                            reflectionUtils.hpp
-jvmtiEnv.cpp                            resourceArea.hpp
-jvmtiEnv.cpp                            signature.hpp
-jvmtiEnv.cpp                            systemDictionary.hpp
-jvmtiEnv.cpp                            threadService.hpp
-jvmtiEnv.cpp                            thread_<os_family>.inline.hpp
-jvmtiEnv.cpp                            universe.inline.hpp
-jvmtiEnv.cpp                            vframe.hpp
-jvmtiEnv.cpp                            vmSymbols.hpp
-jvmtiEnv.cpp                            vmThread.hpp
-
-jvmtiEnv.hpp                            jvmtiEnvBase.hpp
-
-jvmtiEnvBase.cpp                        biasedLocking.hpp
-jvmtiEnvBase.cpp                        deoptimization.hpp
-jvmtiEnvBase.cpp                        interfaceSupport.hpp
-jvmtiEnvBase.cpp                        jfieldIDWorkaround.hpp
-jvmtiEnvBase.cpp                        jvmtiEnv.hpp
-jvmtiEnvBase.cpp                        jvmtiEnvBase.hpp
-jvmtiEnvBase.cpp                        jvmtiEventController.inline.hpp
-jvmtiEnvBase.cpp                        jvmtiExtensions.hpp
-jvmtiEnvBase.cpp                        jvmtiImpl.hpp
-jvmtiEnvBase.cpp                        jvmtiManageCapabilities.hpp
-jvmtiEnvBase.cpp                        jvmtiTagMap.hpp
-jvmtiEnvBase.cpp                        jvmtiThreadState.inline.hpp
-jvmtiEnvBase.cpp                        objArrayKlass.hpp
-jvmtiEnvBase.cpp                        objArrayOop.hpp
-jvmtiEnvBase.cpp                        objectMonitor.hpp
-jvmtiEnvBase.cpp                        objectMonitor.inline.hpp
-jvmtiEnvBase.cpp                        signature.hpp
-jvmtiEnvBase.cpp                        systemDictionary.hpp
-jvmtiEnvBase.cpp                        vframe.hpp
-jvmtiEnvBase.cpp                        vframe_hp.hpp
-jvmtiEnvBase.cpp                        vmThread.hpp
-jvmtiEnvBase.cpp                        vm_operations.hpp
-
-jvmtiEnvBase.hpp                        classLoader.hpp
-jvmtiEnvBase.hpp                        fieldDescriptor.hpp
-jvmtiEnvBase.hpp                        frame.hpp
-jvmtiEnvBase.hpp                        growableArray.hpp
-jvmtiEnvBase.hpp                        handles.inline.hpp
-jvmtiEnvBase.hpp                        jvmtiEnvThreadState.hpp
-jvmtiEnvBase.hpp                        jvmtiEventController.hpp
-jvmtiEnvBase.hpp                        jvmtiThreadState.hpp
-jvmtiEnvBase.hpp                        thread.hpp
-jvmtiEnvBase.hpp                        vm_operations.hpp
-
-jvmtiEnvThreadState.cpp                 handles.hpp
-jvmtiEnvThreadState.cpp                 handles.inline.hpp
-jvmtiEnvThreadState.cpp                 interfaceSupport.hpp
-jvmtiEnvThreadState.cpp                 interpreter.hpp
-jvmtiEnvThreadState.cpp                 javaCalls.hpp
-jvmtiEnvThreadState.cpp                 jvmtiEnv.hpp
-jvmtiEnvThreadState.cpp                 jvmtiEnvThreadState.hpp
-jvmtiEnvThreadState.cpp                 jvmtiEventController.inline.hpp
-jvmtiEnvThreadState.cpp                 jvmtiImpl.hpp
-jvmtiEnvThreadState.cpp                 resourceArea.hpp
-jvmtiEnvThreadState.cpp                 signature.hpp
-jvmtiEnvThreadState.cpp                 systemDictionary.hpp
-jvmtiEnvThreadState.cpp                 vframe.hpp
-jvmtiEnvThreadState.cpp                 vm_operations.hpp
-
-jvmtiEnvThreadState.hpp                 allocation.hpp
-jvmtiEnvThreadState.hpp                 allocation.inline.hpp
-jvmtiEnvThreadState.hpp                 globalDefinitions.hpp
-jvmtiEnvThreadState.hpp                 growableArray.hpp
-jvmtiEnvThreadState.hpp                 instanceKlass.hpp
-jvmtiEnvThreadState.hpp                 jvmti.h
-jvmtiEnvThreadState.hpp                 jvmtiEventController.hpp
-
-jvmtiEventController.cpp                frame.hpp
-jvmtiEventController.cpp                interpreter.hpp
-jvmtiEventController.cpp                jvmtiEnv.hpp
-jvmtiEventController.cpp                jvmtiEventController.hpp
-jvmtiEventController.cpp                jvmtiEventController.inline.hpp
-jvmtiEventController.cpp                jvmtiExport.hpp
-jvmtiEventController.cpp                jvmtiImpl.hpp
-jvmtiEventController.cpp                jvmtiThreadState.inline.hpp
-jvmtiEventController.cpp                resourceArea.hpp
-jvmtiEventController.cpp                thread.hpp
-jvmtiEventController.cpp                vframe.hpp
-jvmtiEventController.cpp                vframe_hp.hpp
-jvmtiEventController.cpp                vmThread.hpp
-jvmtiEventController.cpp                vm_operations.hpp
-
-jvmtiEventController.hpp                allocation.hpp
-jvmtiEventController.hpp                allocation.inline.hpp
-jvmtiEventController.hpp                globalDefinitions.hpp
-jvmtiEventController.hpp                jvmti.h
-
-jvmtiEventController.inline.hpp         jvmtiEventController.hpp
-jvmtiEventController.inline.hpp         jvmtiImpl.hpp
-jvmtiEventController.inline.hpp         jvmtiUtil.hpp
-
-jvmtiExport.cpp                         arguments.hpp
-jvmtiExport.cpp                         attachListener.hpp
-jvmtiExport.cpp                         handles.hpp
-jvmtiExport.cpp                         interfaceSupport.hpp
-jvmtiExport.cpp                         interpreter.hpp
-jvmtiExport.cpp                         jvmtiCodeBlobEvents.hpp
-jvmtiExport.cpp                         jvmtiEnv.hpp
-jvmtiExport.cpp                         jvmtiEventController.hpp
-jvmtiExport.cpp                         jvmtiEventController.inline.hpp
-jvmtiExport.cpp                         jvmtiExport.hpp
-jvmtiExport.cpp                         jvmtiImpl.hpp
-jvmtiExport.cpp                         jvmtiManageCapabilities.hpp
-jvmtiExport.cpp                         jvmtiRawMonitor.hpp
-jvmtiExport.cpp                         jvmtiTagMap.hpp
-jvmtiExport.cpp                         jvmtiThreadState.inline.hpp
-jvmtiExport.cpp                         nmethod.hpp
-jvmtiExport.cpp                         objArrayKlass.hpp
-jvmtiExport.cpp                         objArrayOop.hpp
-jvmtiExport.cpp                         objectMonitor.hpp
-jvmtiExport.cpp                         objectMonitor.inline.hpp
-jvmtiExport.cpp                         pcDesc.hpp
-jvmtiExport.cpp                         resourceArea.hpp
-jvmtiExport.cpp                         scopeDesc.hpp
-jvmtiExport.cpp                         serviceUtil.hpp
-jvmtiExport.cpp                         systemDictionary.hpp
-jvmtiExport.cpp                         thread.hpp
-jvmtiExport.cpp                         vframe.hpp
-
-// jvmtiExtensions is jck optional, please put deps in includeDB_features
-
-jvmtiGetLoadedClasses.cpp               jvmtiGetLoadedClasses.hpp
-jvmtiGetLoadedClasses.cpp               systemDictionary.hpp
-jvmtiGetLoadedClasses.cpp               thread.hpp
-jvmtiGetLoadedClasses.cpp               universe.inline.hpp
-
-jvmtiGetLoadedClasses.hpp               jvmtiEnv.hpp
-
-// jvmtiImpl is jck optional, please put deps in includeDB_features
-
-jvmtiManageCapabilities.cpp             jvmtiEnv.hpp
-jvmtiManageCapabilities.cpp             jvmtiExport.hpp
-jvmtiManageCapabilities.cpp             jvmtiManageCapabilities.hpp
- 
-jvmtiManageCapabilities.hpp             allocation.hpp
-jvmtiManageCapabilities.hpp             jvmti.h
-
-// jvmtiRawMonitor is jck optional, please put deps in includeDB_features
-
-jvmtiRedefineClasses.cpp                bitMap.inline.hpp
-jvmtiRedefineClasses.cpp                codeCache.hpp
-jvmtiRedefineClasses.cpp                deoptimization.hpp
-jvmtiRedefineClasses.cpp                gcLocker.hpp
-jvmtiRedefineClasses.cpp                jvmtiImpl.hpp
-jvmtiRedefineClasses.cpp                jvmtiRedefineClasses.hpp
-jvmtiRedefineClasses.cpp                klassVtable.hpp
-jvmtiRedefineClasses.cpp                methodComparator.hpp
-jvmtiRedefineClasses.cpp                oopMapCache.hpp
-jvmtiRedefineClasses.cpp                relocator.hpp
-jvmtiRedefineClasses.cpp                rewriter.hpp
-jvmtiRedefineClasses.cpp                systemDictionary.hpp
-jvmtiRedefineClasses.cpp                universe.inline.hpp
-jvmtiRedefineClasses.cpp                verifier.hpp
-
-jvmtiRedefineClasses.hpp                jvmtiEnv.hpp
-jvmtiRedefineClasses.hpp                jvmtiRedefineClassesTrace.hpp
-jvmtiRedefineClasses.hpp                objArrayKlass.hpp
-jvmtiRedefineClasses.hpp                objArrayOop.hpp
-jvmtiRedefineClasses.hpp                oopFactory.hpp
-jvmtiRedefineClasses.hpp                resourceArea.hpp
-jvmtiRedefineClasses.hpp                vm_operations.hpp
-
-// jvmtiTagMap is jck optional, please put deps in includeDB_features
-// jvmtiTrace is jck optional, please put deps in includeDB_features
-
-jvmtiThreadState.cpp                    gcLocker.hpp
-jvmtiThreadState.cpp                    jvmtiEnv.hpp
-jvmtiThreadState.cpp                    jvmtiEventController.inline.hpp
-jvmtiThreadState.cpp                    jvmtiImpl.hpp
-jvmtiThreadState.cpp                    jvmtiThreadState.inline.hpp
-jvmtiThreadState.cpp                    resourceArea.hpp
-jvmtiThreadState.cpp                    vframe.hpp
-
-jvmtiThreadState.inline.hpp             jvmtiEnvThreadState.hpp
-jvmtiThreadState.inline.hpp             jvmtiThreadState.hpp
-
-jvmtiUtil.cpp                           exceptions.hpp
-jvmtiUtil.cpp                           handles.hpp
-jvmtiUtil.cpp                           handles.inline.hpp
-jvmtiUtil.cpp                           interfaceSupport.hpp
-jvmtiUtil.cpp                           jvmtiUtil.hpp
-jvmtiUtil.cpp                           vm_operations.hpp
-
-jvmtiUtil.hpp                           jvmti.h
-jvmtiUtil.hpp                           jvmtiEventController.hpp
-jvmtiUtil.hpp                           resourceArea.hpp
--- a/src/share/vm/includeDB_shark	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,371 +0,0 @@
-//
-// Copyright (c) 1999, 2007, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.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
-
-disassembler.cpp                        sharkEntry.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/src/share/vm/includeDB_zero	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-//
-// Copyright (c) 2001, 2009, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-// or visit www.oracle.com if you need additional information or have any
-// questions.
-//  
-//
-
-// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
-
-cppInterpreter_<arch>.cpp               stack_<arch>.inline.hpp
-
-entryFrame_<arch>.hpp                   javaCalls.hpp
-entryFrame_<arch>.hpp                   stack_<arch>.hpp
-
-fakeStubFrame_<arch>.hpp                stack_<arch>.hpp
-
-frame.hpp                               stack_<arch>.hpp
-
-frame.inline.hpp                        fakeStubFrame_<arch>.hpp
-frame.inline.hpp                        entryFrame_<arch>.hpp
-frame.inline.hpp                        interpreterFrame_<arch>.hpp
-frame.inline.hpp                        sharkFrame_<arch>.hpp
-
-frame_<arch>.cpp                        interpreterRuntime.hpp
-frame_<arch>.cpp                        scopeDesc.hpp
-
-interpreter.hpp                         entry_<arch>.hpp
-
-interpreterFrame_<arch>.hpp             bytecodeInterpreter.hpp
-interpreterFrame_<arch>.hpp             methodOop.hpp
-interpreterFrame_<arch>.hpp             stack_<arch>.hpp
-interpreterFrame_<arch>.hpp             thread.hpp
-
-interpreterRT_<arch>.cpp                stack_<arch>.inline.hpp
-
-sharkFrame_<arch>.hpp                   methodOop.hpp
-sharkFrame_<arch>.hpp                   stack_<arch>.hpp
-
-stack_<arch>.hpp                        sizes.hpp
-
-stack_<arch>.inline.hpp                 stack_<arch>.hpp
-stack_<arch>.inline.hpp                 thread.hpp
-
-stack_<arch>.cpp                        interpreterRuntime.hpp
-stack_<arch>.cpp                        stack_<arch>.hpp
-stack_<arch>.cpp                        stack_<arch>.inline.hpp
-
-stubGenerator_<arch>.cpp                stack_<arch>.inline.hpp
-
-thread.hpp                              stack_<arch>.hpp
--- a/src/share/vm/interpreter/abstractInterpreter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/abstractInterpreter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,35 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
+#define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
+
+#include "code/stubs.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "interp_masm_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "interp_masm_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "interp_masm_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "interp_masm_zero.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // This file contains the platform-independent parts
 // of the abstract interpreter and the abstract interpreter generator.
 
@@ -256,3 +285,5 @@
  public:
   AbstractInterpreterGenerator(StubQueue* _code);
 };
+
+#endif // SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
--- a/src/share/vm/interpreter/bytecode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,15 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecode.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/fieldType.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/signature.hpp"
 
 // Implementation of Bytecode
 
--- a/src/share/vm/interpreter/bytecode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,22 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_BYTECODE_HPP
+#define SHARE_VM_INTERPRETER_BYTECODE_HPP
+
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+#include "oops/methodOop.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 // Base class for different kinds of abstractions working
 // relative to an objects 'this' pointer.
 
@@ -431,3 +447,5 @@
   DEBUG_ONLY(b->verify());
   return b;
 }
+
+#endif // SHARE_VM_INTERPRETER_BYTECODE_HPP
--- a/src/share/vm/interpreter/bytecodeHistogram.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeHistogram.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_bytecodeHistogram.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/os.hpp"
+#include "utilities/growableArray.hpp"
 
 // ------------------------------------------------------------------------------------------------
 // Non-product code
--- a/src/share/vm/interpreter/bytecodeHistogram.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeHistogram.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_BYTECODEHISTOGRAM_HPP
+#define SHARE_VM_INTERPRETER_BYTECODEHISTOGRAM_HPP
+
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+
 // BytecodeCounter counts the number of bytecodes executed
 
 class BytecodeCounter: AllStatic {
@@ -90,3 +96,5 @@
   // Profile printing
   static void print(float cutoff = 0.01F)   PRODUCT_RETURN;   // cutoff in percent
 };
+
+#endif // SHARE_VM_INTERPRETER_BYTECODEHISTOGRAM_HPP
--- a/src/share/vm/interpreter/bytecodeInterpreter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,10 +22,46 @@
  *
  */
 
+// no precompiled headers
+#include "classfile/vmSymbols.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/bytecodeInterpreter.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/threadCritical.hpp"
+#include "utilities/exceptions.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "orderAccess_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "orderAccess_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "orderAccess_linux_zero.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "orderAccess_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "orderAccess_solaris_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "orderAccess_windows_x86.inline.hpp"
+#endif
+
 
 // no precompiled headers
-#include "incls/_bytecodeInterpreter.cpp.incl"
-
 #ifdef CC_INTERP
 
 /*
@@ -1287,12 +1323,7 @@
           jfloat f;
           jdouble r;
           f = STACK_FLOAT(-1);
-#ifdef IA64
-          // IA64 gcc bug
-          r = ( f == 0.0f ) ? (jdouble) f : (jdouble) f + ia64_double_zero;
-#else
           r = (jdouble) f;
-#endif
           MORE_STACK(-1); // POP
           SET_STACK_DOUBLE(r, 1);
           UPDATE_PC_AND_TOS_AND_CONTINUE(1, 2);
--- a/src/share/vm/interpreter/bytecodeInterpreter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeInterpreter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,26 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP
+#define SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/globals.hpp"
+#include "utilities/globalDefinitions.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 #ifdef CC_INTERP
 
 // CVM definitions find hotspot equivalents...
@@ -558,8 +578,19 @@
 #endif // PRODUCT
 
     // Platform fields/methods
-# include "incls/_bytecodeInterpreter_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "bytecodeInterpreter_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytecodeInterpreter_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytecodeInterpreter_zero.hpp"
+#endif
+
 
 }; // BytecodeInterpreter
 
 #endif // CC_INTERP
+
+#endif // SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP
--- a/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP
+#define SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP
+
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "runtime/stubRoutines.hpp"
+
 // This file holds platform-independent bodies of inline functions for the C++ based interpreter
 
 #ifdef CC_INTERP
@@ -37,5 +43,16 @@
 #endif
 
 // Platform dependent data manipulation
-# include "incls/_bytecodeInterpreter_pd.inline.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "bytecodeInterpreter_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytecodeInterpreter_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytecodeInterpreter_zero.inline.hpp"
+#endif
+
 #endif // CC_INTERP
+
+#endif // SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP
--- a/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!-- 
-     Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+     Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
      This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 <xsl:template match="processcode">
 <xsl:text>
 #define VM_JVMTI
-#include "bytecodeInterpreter.cpp"
+#include "interpreter/bytecodeInterpreter.cpp"
 </xsl:text>
 <xsl:text disable-output-escaping = "yes">
 
--- a/src/share/vm/interpreter/bytecodeStream.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeStream.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_bytecodeStream.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "interpreter/bytecodes.hpp"
 
 Bytecodes::Code RawBytecodeStream::raw_next_special(Bytecodes::Code code) {
   assert(!is_last_bytecode(), "should have been checked");
--- a/src/share/vm/interpreter/bytecodeStream.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeStream.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,22 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP
+#define SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP
+
+#include "interpreter/bytecode.hpp"
+#include "memory/allocation.hpp"
+#include "oops/methodOop.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 // A BytecodeStream is used for fast iteration over the bytecodes
 // of a methodOop.
 //
@@ -214,3 +230,5 @@
                                                    return bytecode()->get_index_u4(raw_code()); }
   bool            has_index_u4() const           { return bytecode()->has_index_u4(raw_code()); }
 };
+
+#endif // SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP
--- a/src/share/vm/interpreter/bytecodeTracer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeTracer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodeTracer.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/bytecodeTracer.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/timer.hpp"
 
 
 #ifndef PRODUCT
@@ -337,6 +346,7 @@
     break;
   case JVM_CONSTANT_NameAndType:
   case JVM_CONSTANT_InvokeDynamic:
+  case JVM_CONSTANT_InvokeDynamicTrans:
     has_klass = false;
     break;
   default:
--- a/src/share/vm/interpreter/bytecodeTracer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodeTracer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_BYTECODETRACER_HPP
+#define SHARE_VM_INTERPRETER_BYTECODETRACER_HPP
+
+#include "memory/allocation.hpp"
+
 // The BytecodeTracer is a helper class used by the interpreter for run-time
 // bytecode tracing. If bytecode tracing is turned on, trace() will be called
 // for each bytecode.
@@ -56,3 +61,5 @@
 };
 
 #endif // !PRODUCT
+
+#endif // SHARE_VM_INTERPRETER_BYTECODETRACER_HPP
--- a/src/share/vm/interpreter/bytecodes.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodes.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodes.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodOop.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
 
 
 #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
--- a/src/share/vm/interpreter/bytecodes.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/bytecodes.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_BYTECODES_HPP
+#define SHARE_VM_INTERPRETER_BYTECODES_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/top.hpp"
+
 // Bytecodes specifies all bytecodes used in the VM and
 // provides utility functions to get bytecode attributes.
 
@@ -279,7 +285,16 @@
     _shouldnotreachhere,      // For debugging
 
     // Platform specific JVM bytecodes
-    #include "incls/_bytecodes_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "bytecodes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytecodes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytecodes_zero.hpp"
+#endif
+
 
     number_of_codes
   };
@@ -394,3 +409,5 @@
   // Initialization
   static void        initialize     ();
 };
+
+#endif // SHARE_VM_INTERPRETER_BYTECODES_HPP
--- a/src/share/vm/interpreter/cppInterpreter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/cppInterpreter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
 
 #ifdef CC_INTERP
 # define __ _masm->
--- a/src/share/vm/interpreter/cppInterpreter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/cppInterpreter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP
+#define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP
+
+#include "interpreter/abstractInterpreter.hpp"
+
 #ifdef CC_INTERP
 
 // This file contains the platform-independent parts
@@ -76,8 +81,19 @@
   static address    return_entry  (TosState state, int length);
   static address    deopt_entry   (TosState state, int length);
 
-#include "incls/_cppInterpreter_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "cppInterpreter_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "cppInterpreter_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "cppInterpreter_zero.hpp"
+#endif
+
 
 };
 
 #endif // CC_INTERP
+
+#endif // SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP
--- a/src/share/vm/interpreter/cppInterpreterGenerator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/cppInterpreterGenerator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP
+#define SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP
+
 // This file contains the platform-independent parts
 // of the template interpreter generator.
 
@@ -41,7 +44,18 @@
  public:
   CppInterpreterGenerator(StubQueue* _code);
 
-   #include "incls/_cppInterpreterGenerator_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "cppInterpreterGenerator_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "cppInterpreterGenerator_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "cppInterpreterGenerator_zero.hpp"
+#endif
+
 };
 
 #endif // CC_INTERP
+
+#endif // SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP
--- a/src/share/vm/interpreter/interpreter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/interpreter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/forte.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
 
 # define __ _masm->
 
--- a/src/share/vm/interpreter/interpreter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/interpreter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_INTERPRETER_HPP
+#define SHARE_VM_INTERPRETER_INTERPRETER_HPP
+
+#include "code/stubs.hpp"
+#include "interpreter/cppInterpreter.hpp"
+#include "interpreter/templateInterpreter.hpp"
+#ifdef ZERO
+#ifdef TARGET_ARCH_zero
+# include "entry_zero.hpp"
+#endif
+#endif
+
 // This file contains the platform-independent parts
 // of the interpreter and the interpreter generator.
 
@@ -131,5 +143,16 @@
   public:
   // Debugging/printing
   static InterpreterCodelet* codelet_containing(address pc)     { return (InterpreterCodelet*)_code->stub_containing(pc); }
-#include "incls/_interpreter_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "interpreter_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "interpreter_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "interpreter_zero.hpp"
+#endif
+
 };
+
+#endif // SHARE_VM_INTERPRETER_INTERPRETER_HPP
--- a/src/share/vm/interpreter/interpreterGenerator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/interpreterGenerator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP
+#define SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP
+
+#include "interpreter/cppInterpreter.hpp"
+#include "interpreter/cppInterpreterGenerator.hpp"
+#include "interpreter/templateInterpreter.hpp"
+#include "interpreter/templateInterpreterGenerator.hpp"
+
 // This file contains the platform-independent parts
 // of the interpreter generator.
 
@@ -33,6 +41,17 @@
 
 InterpreterGenerator(StubQueue* _code);
 
-#include "incls/_interpreterGenerator_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "interpreterGenerator_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "interpreterGenerator_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "interpreterGenerator_zero.hpp"
+#endif
+
 
 };
+
+#endif // SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP
--- a/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,52 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRuntime.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileBroker.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/cpCacheOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/jfieldIDWorkaround.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/threadCritical.hpp"
+#include "utilities/events.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vm_version_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vm_version_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vm_version_zero.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 class UnlockFlagSaver {
   private:
@@ -1149,9 +1193,20 @@
       method->set_signature_handler(_handlers->at(handler_index));
     }
   }
+#ifdef ASSERT
+  int handler_index, fingerprint_index;
+  {
+    // '_handlers' and '_fingerprints' are 'GrowableArray's and are NOT synchronized
+    // in any way if accessed from multiple threads. To avoid races with another
+    // thread which may change the arrays in the above, mutex protected block, we
+    // have to protect this read access here with the same mutex as well!
+    MutexLocker mu(SignatureHandlerLibrary_lock);
+    handler_index = _handlers->find(method->signature_handler());
+    fingerprint_index = _fingerprints->find(Fingerprinter(method).fingerprint());
+  }
   assert(method->signature_handler() == Interpreter::slow_signature_handler() ||
-         _handlers->find(method->signature_handler()) == _fingerprints->find(Fingerprinter(method).fingerprint()),
-         "sanity check");
+         handler_index == fingerprint_index, "sanity check");
+#endif
 }
 
 
--- a/src/share/vm/interpreter/interpreterRuntime.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/interpreterRuntime.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,26 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP
+#define SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP
+
+#include "interpreter/bytecode.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/universe.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // The InterpreterRuntime is called by the interpreter for everything
 // that cannot/should not be dealt with in assembly and needs C support.
 
@@ -128,7 +148,16 @@
 #endif
 
   // Platform dependent stuff
-  #include "incls/_interpreterRT_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "interpreterRT_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "interpreterRT_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "interpreterRT_zero.hpp"
+#endif
+
 
   // Interpreter's frequency counter overflow
   static nmethod* frequency_counter_overflow(JavaThread* thread, address branch_bcp);
@@ -163,3 +192,5 @@
  public:
   static void add(methodHandle method);
 };
+
+#endif // SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP
--- a/src/share/vm/interpreter/invocationCounter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/invocationCounter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_invocationCounter.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/invocationCounter.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/handles.inline.hpp"
 
 
 // Implementation of InvocationCounter
--- a/src/share/vm/interpreter/invocationCounter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/invocationCounter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_INVOCATIONCOUNTER_HPP
+#define SHARE_VM_INTERPRETER_INVOCATIONCOUNTER_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/handles.hpp"
+#include "utilities/exceptions.hpp"
+
 // InvocationCounters are used to trigger actions when a limit (threshold) is reached.
 // For different states, different limits and actions can be defined in the initialization
 // routine of InvocationCounters.
@@ -134,3 +141,5 @@
   set(state(), new_count);
 }
 
+
+#endif // SHARE_VM_INTERPRETER_INVOCATIONCOUNTER_HPP
--- a/src/share/vm/interpreter/linkResolver.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/linkResolver.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,36 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_linkResolver.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileBroker.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "prims/methodHandles.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 //------------------------------------------------------------------------------------------------------------------------
 // Implementation of FieldAccessInfo
--- a/src/share/vm/interpreter/linkResolver.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/linkResolver.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_LINKRESOLVER_HPP
+#define SHARE_VM_INTERPRETER_LINKRESOLVER_HPP
+
+#include "oops/methodOop.hpp"
+#include "utilities/top.hpp"
+
 // All the necessary definitions for run-time link resolution.
 
 // LinkInfo & its subclasses provide all the information gathered
@@ -174,3 +180,5 @@
 
   static void resolve_invoke         (CallInfo& result, Handle recv, constantPoolHandle pool, int index, Bytecodes::Code byte, TRAPS);
 };
+
+#endif // SHARE_VM_INTERPRETER_LINKRESOLVER_HPP
--- a/src/share/vm/interpreter/oopMapCache.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/oopMapCache.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_oopMapCache.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/signature.hpp"
 
 class OopMapCacheEntry: private InterpreterOopMap {
   friend class InterpreterOopMap;
--- a/src/share/vm/interpreter/oopMapCache.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/oopMapCache.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_OOPMAPCACHE_HPP
+#define SHARE_VM_INTERPRETER_OOPMAPCACHE_HPP
+
+#include "oops/generateOopMap.hpp"
+#include "runtime/mutex.hpp"
+
 // A Cache for storing (method, bci) -> oopMap.
 // The memory management system uses the cache when locating object
 // references in an interpreted frame.
@@ -188,3 +194,5 @@
   // Returns total no. of bytes allocated as part of OopMapCache's
   static long memory_usage()                     PRODUCT_RETURN0;
 };
+
+#endif // SHARE_VM_INTERPRETER_OOPMAPCACHE_HPP
--- a/src/share/vm/interpreter/rewriter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/rewriter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_rewriter.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/rewriter.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/generateOopMap.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodComparator.hpp"
 
 // Computes a CPC map (new_index -> original_index) for constant pool entries
 // that are referred to by the interpreter at runtime via the constant pool cache.
@@ -43,6 +52,7 @@
       case JVM_CONSTANT_MethodHandle      : // fall through
       case JVM_CONSTANT_MethodType        : // fall through
       case JVM_CONSTANT_InvokeDynamic     : // fall through
+      case JVM_CONSTANT_InvokeDynamicTrans: // fall through
         add_cp_cache_entry(i);
         break;
     }
@@ -52,6 +62,7 @@
             "all cp cache indexes fit in a u2");
 
   _have_invoke_dynamic = ((tag_mask & (1 << JVM_CONSTANT_InvokeDynamic)) != 0);
+  _have_invoke_dynamic |= ((tag_mask & (1 << JVM_CONSTANT_InvokeDynamicTrans)) != 0);
 }
 
 
@@ -65,7 +76,7 @@
       oopFactory::new_constantPoolCache(length, methodOopDesc::IsUnsafeConc, CHECK);
   cache->initialize(_cp_cache_map);
 
-  // Don't bother to the next pass if there is no JVM_CONSTANT_InvokeDynamic.
+  // Don't bother with the next pass if there is no JVM_CONSTANT_InvokeDynamic.
   if (_have_invoke_dynamic) {
     for (int i = 0; i < length; i++) {
       int pool_index = cp_cache_entry_pool_index(i);
--- a/src/share/vm/interpreter/rewriter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/rewriter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_REWRITER_HPP
+#define SHARE_VM_INTERPRETER_REWRITER_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/growableArray.hpp"
+
 // The Rewriter adds caches to the constant pool and rewrites bytecode indices
 // pointing into the constant pool for better interpreter performance.
 
@@ -94,3 +101,5 @@
     _secondary_entry_tag = nth_bit(30)
   };
 };
+
+#endif // SHARE_VM_INTERPRETER_REWRITER_HPP
--- a/src/share/vm/interpreter/templateInterpreter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/templateInterpreter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_templateInterpreter.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterGenerator.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
 
 #ifndef CC_INTERP
 
--- a/src/share/vm/interpreter/templateInterpreter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/templateInterpreter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP
+#define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP
+
+#include "interpreter/abstractInterpreter.hpp"
+#include "interpreter/templateTable.hpp"
+
 // This file contains the platform-independent parts
 // of the template interpreter and the template interpreter generator.
 
@@ -177,8 +183,19 @@
   // Compute the address for reexecution
   static address deopt_reexecute_entry(methodOop method, address bcp);
 
-#include "incls/_templateInterpreter_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "templateInterpreter_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "templateInterpreter_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "templateInterpreter_zero.hpp"
+#endif
+
 
 };
 
 #endif // !CC_INTERP
+
+#endif // SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP
--- a/src/share/vm/interpreter/templateInterpreterGenerator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/templateInterpreterGenerator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP
+#define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP
+
 // This file contains the platform-independent parts
 // of the template interpreter generator.
 
@@ -84,8 +87,19 @@
  public:
   TemplateInterpreterGenerator(StubQueue* _code);
 
-  #include "incls/_templateInterpreterGenerator_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "templateInterpreterGenerator_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "templateInterpreterGenerator_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "templateInterpreterGenerator_zero.hpp"
+#endif
+
 
 };
 
 #endif // !CC_INTERP
+
+#endif // SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP
--- a/src/share/vm/interpreter/templateTable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/templateTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_templateTable.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/templateTable.hpp"
+#include "runtime/timer.hpp"
 
 
 #ifdef CC_INTERP
--- a/src/share/vm/interpreter/templateTable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/interpreter/templateTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,25 @@
  *
  */
 
+#ifndef SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
+#define SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
+
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/frame.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "interp_masm_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "interp_masm_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "interp_masm_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "interp_masm_zero.hpp"
+#endif
+
 #ifndef CC_INTERP
 // All the necessary definitions used for (bytecode) template generation. Instead of
 // spreading the implementation functionality for each bytecode in the interpreter
@@ -333,6 +352,20 @@
   static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
 
   // Platform specifics
-  #include "incls/_templateTable_pd.hpp.incl"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "templateTable_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "templateTable_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "templateTable_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "templateTable_zero.hpp"
+#endif
+
 };
 #endif /* !CC_INTERP */
+
+#endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
--- a/src/share/vm/libadt/dict.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/dict.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,13 @@
  *
  */
 
-// Dictionaries - An Abstract Data Type
+#include "precompiled.hpp"
+#include "libadt/dict.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/thread.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_dict.cpp.incl"
+// Dictionaries - An Abstract Data Type
 
 // %%%%% includes not needed with AVM framework - Ungar
 
--- a/src/share/vm/libadt/dict.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/dict.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#ifndef _DICT_
-#define _DICT_
+#ifndef SHARE_VM_LIBADT_DICT_HPP
+#define SHARE_VM_LIBADT_DICT_HPP
+
+#include "libadt/port.hpp"
+
 // Dictionaries - An Abstract Data Type
 //INTERFACE
 class ostream;
@@ -114,4 +117,4 @@
   int test(void) { return _i<_d->_size;} // Test for end of iteration
 };
 
-#endif // _DICT_
+#endif // SHARE_VM_LIBADT_DICT_HPP
--- a/src/share/vm/libadt/port.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/port.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,15 +22,15 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "libadt/port.hpp"
+
 // Code for portable compiling
 
 #ifdef __GNUC__
 #pragma implementation
 #endif
 
-#include "incls/_precompiled.incl"
-#include "incls/_port.cpp.incl"
-
 // %%%%% includes not needed with AVM framework - Ungar
 // #include "port.hpp"
 
--- a/src/share/vm/libadt/port.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/port.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#ifndef _PORT_
-#define _PORT_
+#ifndef SHARE_VM_LIBADT_PORT_HPP
+#define SHARE_VM_LIBADT_PORT_HPP
+
+#include "utilities/top.hpp"
+
 // Typedefs for portable compiling
 
 #if defined(__GNUC__)
@@ -204,4 +207,4 @@
 extern uint32 heap_totalmem;      // Current total memory allocation
 extern uint32 heap_highwater;     // Highwater mark to date for memory usage
 
-#endif // _PORT_
+#endif // SHARE_VM_LIBADT_PORT_HPP
--- a/src/share/vm/libadt/set.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/set.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,11 @@
  *
  */
 
-// Sets - An Abstract Data Type
+#include "precompiled.hpp"
+#include "libadt/set.hpp"
+#include "memory/allocation.inline.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_set.cpp.incl"
+// Sets - An Abstract Data Type
 
 // %%%%% includes not needed with AVM framework - Ungar
 // #include "port.hpp"
--- a/src/share/vm/libadt/set.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/set.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,14 @@
  *
  */
 
-#ifndef _SET_
-#define _SET_
+#ifndef SHARE_VM_LIBADT_SET_HPP
+#define SHARE_VM_LIBADT_SET_HPP
+
+#include "libadt/port.hpp"
+#include "memory/allocation.hpp"
+
 // Sets - An Abstract Data Type
 
-// Should not manually include these in AVM framework. %%%%% - Ungar
-// #ifndef _PORT_
-// #include "port.hpp"
-// #endif // _PORT_
 //INTERFACE
 
 class SparseSet;
@@ -248,4 +248,4 @@
   int test(void) { return impl->test(); }
 };
 
-#endif // _SET_
+#endif // SHARE_VM_LIBADT_SET_HPP
--- a/src/share/vm/libadt/vectset.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/vectset.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,11 @@
  *
  */
 
-// Vector Sets - An Abstract Data Type
+#include "precompiled.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.inline.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_vectset.cpp.incl"
+// Vector Sets - An Abstract Data Type
 
 // %%%%% includes not needed with AVM framework - Ungar
 // #include "port.hpp"
@@ -248,13 +249,13 @@
   const VectorSet &s = *(set.asVectorSet());
 
   // NOTE: The intersection is never any larger than the smallest set.
-  register uint small = ((size<s.size)?size:s.size);
-  register uint32 *u1 = data;   // Pointer to the destination data
-  register uint32 *u2 = s.data; // Pointer to the source data
-  for( uint i=0; i<small; i++)  // For data in set
-    if( *u1++ & *u2++ )         // If any elements in common
-      return 0;                 // Then not disjoint
-  return 1;                     // Else disjoint
+  register uint small_size = ((size<s.size)?size:s.size);
+  register uint32 *u1 = data;        // Pointer to the destination data
+  register uint32 *u2 = s.data;      // Pointer to the source data
+  for( uint i=0; i<small_size; i++)  // For data in set
+    if( *u1++ & *u2++ )              // If any elements in common
+      return 0;                      // Then not disjoint
+  return 1;                          // Else disjoint
 }
 
 //------------------------------operator<--------------------------------------
--- a/src/share/vm/libadt/vectset.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/libadt/vectset.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#ifndef _VECTOR_SET_
-#define _VECTOR_SET_
+#ifndef SHARE_VM_LIBADT_VECTSET_HPP
+#define SHARE_VM_LIBADT_VECTSET_HPP
+
+#include "libadt/set.hpp"
+
 // Vector Sets - An Abstract Data Type
 //INTERFACE
 
@@ -173,4 +176,4 @@
   int test(void) { return ((VSetI_*)impl)->test(); }
 };
 
-#endif // _VECTOR_SET_
+#endif // SHARE_VM_LIBADT_VECTSET_HPP
--- a/src/share/vm/memory/allocation.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/allocation.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,23 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_allocation.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/os.hpp"
+#include "runtime/task.hpp"
+#include "runtime/threadCritical.hpp"
+#include "utilities/ostream.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 void* CHeapObj::operator new(size_t size){
   return (void *) AllocateHeap(size, "CHeapObj-new");
@@ -58,7 +73,7 @@
 void ResourceObj::operator delete(void* p) {
   assert(((ResourceObj *)p)->allocated_on_C_heap(),
          "delete only allowed for C_HEAP objects");
-  DEBUG_ONLY(((ResourceObj *)p)->_allocation = (uintptr_t)badHeapOopVal;)
+  DEBUG_ONLY(((ResourceObj *)p)->_allocation_t[0] = (uintptr_t)badHeapOopVal;)
   FreeHeap(p);
 }
 
@@ -68,43 +83,73 @@
     uintptr_t allocation = (uintptr_t)res;
     assert((allocation & allocation_mask) == 0, "address should be aligned to 4 bytes at least");
     assert(type <= allocation_mask, "incorrect allocation type");
-    ((ResourceObj *)res)->_allocation = ~(allocation + type);
+    ResourceObj* resobj = (ResourceObj *)res;
+    resobj->_allocation_t[0] = ~(allocation + type);
+    if (type != STACK_OR_EMBEDDED) {
+      // Called from operator new() and CollectionSetChooser(),
+      // set verification value.
+      resobj->_allocation_t[1] = (uintptr_t)&(resobj->_allocation_t[1]) + type;
+    }
 }
 
 ResourceObj::allocation_type ResourceObj::get_allocation_type() const {
-    assert(~(_allocation | allocation_mask) == (uintptr_t)this, "lost resource object");
-    return (allocation_type)((~_allocation) & allocation_mask);
+    assert(~(_allocation_t[0] | allocation_mask) == (uintptr_t)this, "lost resource object");
+    return (allocation_type)((~_allocation_t[0]) & allocation_mask);
+}
+
+bool ResourceObj::is_type_set() const {
+    allocation_type type = (allocation_type)(_allocation_t[1] & allocation_mask);
+    return get_allocation_type()  == type &&
+           (_allocation_t[1] - type) == (uintptr_t)(&_allocation_t[1]);
 }
 
 ResourceObj::ResourceObj() { // default constructor
-    if (~(_allocation | allocation_mask) != (uintptr_t)this) {
+    if (~(_allocation_t[0] | allocation_mask) != (uintptr_t)this) {
+      // Operator new() is not called for allocations
+      // on stack and for embedded objects.
       set_allocation_type((address)this, STACK_OR_EMBEDDED);
-    } else if (allocated_on_stack()) {
-      // For some reason we got a value which looks like an allocation on stack.
-      // Pass if it is really allocated on stack.
-      assert(Thread::current()->on_local_stack((address)this),"should be on stack");
+    } else if (allocated_on_stack()) { // STACK_OR_EMBEDDED
+      // For some reason we got a value which resembles
+      // an embedded or stack object (operator new() does not
+      // set such type). Keep it since it is valid value
+      // (even if it was garbage).
+      // Ignore garbage in other fields.
+    } else if (is_type_set()) {
+      // Operator new() was called and type was set.
+      assert(!allocated_on_stack(),
+             err_msg("not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
+                     this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
     } else {
-      assert(allocated_on_res_area() || allocated_on_C_heap() || allocated_on_arena(),
-             "allocation_type should be set by operator new()");
+      // Operator new() was not called.
+      // Assume that it is embedded or stack object.
+      set_allocation_type((address)this, STACK_OR_EMBEDDED);
     }
+    _allocation_t[1] = 0; // Zap verification value
 }
 
 ResourceObj::ResourceObj(const ResourceObj& r) { // default copy constructor
     // Used in ClassFileParser::parse_constant_pool_entries() for ClassFileStream.
+    // Note: garbage may resembles valid value.
+    assert(~(_allocation_t[0] | allocation_mask) != (uintptr_t)this || !is_type_set(),
+           err_msg("embedded or stack only, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
+                   this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
     set_allocation_type((address)this, STACK_OR_EMBEDDED);
+    _allocation_t[1] = 0; // Zap verification value
 }
 
 ResourceObj& ResourceObj::operator=(const ResourceObj& r) { // default copy assignment
     // Used in InlineTree::ok_to_inline() for WarmCallInfo.
-    assert(allocated_on_stack(), "copy only into local");
-    // Keep current _allocation value;
+    assert(allocated_on_stack(),
+           err_msg("copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
+                   this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
+    // Keep current _allocation_t value;
     return *this;
 }
 
 ResourceObj::~ResourceObj() {
     // allocated_on_C_heap() also checks that encoded (in _allocation) address == this.
-    if (!allocated_on_C_heap()) {  // ResourceObj::delete() zaps _allocation for C_heap.
-      _allocation = (uintptr_t)badHeapOopVal; // zap type
+    if (!allocated_on_C_heap()) { // ResourceObj::delete() will zap _allocation for C_heap.
+      _allocation_t[0] = (uintptr_t)badHeapOopVal; // zap type
     }
 }
 #endif // ASSERT
--- a/src/share/vm/memory/allocation.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/allocation.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_ALLOCATION_HPP
+#define SHARE_VM_MEMORY_ALLOCATION_HPP
+
+#include "runtime/globals.hpp"
+#include "utilities/globalDefinitions.hpp"
+#ifdef COMPILER1
+#include "c1/c1_globals.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/c2_globals.hpp"
+#endif
+
 #define ARENA_ALIGN_M1 (((size_t)(ARENA_AMALLOC_ALIGNMENT)) - 1)
 #define ARENA_ALIGN_MASK (~((size_t)ARENA_ALIGN_M1))
 #define ARENA_ALIGN(x) ((((size_t)(x)) + ARENA_ALIGN_M1) & ARENA_ALIGN_MASK)
@@ -325,7 +337,9 @@
   // When this object is allocated on stack the new() operator is not
   // called but garbage on stack may look like a valid allocation_type.
   // Store negated 'this' pointer when new() is called to distinguish cases.
-  uintptr_t _allocation;
+  // Use second array's element for verification value to distinguish garbage.
+  uintptr_t _allocation_t[2];
+  bool is_type_set() const;
  public:
   allocation_type get_allocation_type() const;
   bool allocated_on_stack()    const { return get_allocation_type() == STACK_OR_EMBEDDED; }
@@ -419,3 +433,5 @@
   ReallocMark()   PRODUCT_RETURN;
   void check()    PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_MEMORY_ALLOCATION_HPP
--- a/src/share/vm/memory/allocation.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/allocation.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_ALLOCATION_INLINE_HPP
+#define SHARE_VM_MEMORY_ALLOCATION_INLINE_HPP
+
+#include "runtime/os.hpp"
+
 // Explicit C-heap memory management
 
 void trace_heap_malloc(size_t size, const char* name, void *p);
@@ -57,3 +62,5 @@
   #endif
   os::free(p);
 }
+
+#endif // SHARE_VM_MEMORY_ALLOCATION_INLINE_HPP
--- a/src/share/vm/memory/barrierSet.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/barrierSet.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_barrierSet.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/barrierSet.inline.hpp"
+#include "memory/universe.hpp"
 
 // count is number of array elements being written
 void BarrierSet::static_write_ref_array_pre(HeapWord* start, size_t count) {
--- a/src/share/vm/memory/barrierSet.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/barrierSet.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_BARRIERSET_HPP
+#define SHARE_VM_MEMORY_BARRIERSET_HPP
+
+#include "memory/memRegion.hpp"
+#include "oops/oopsHierarchy.hpp"
+
 // This class provides the interface between a barrier implementation and
 // the rest of the system.
 
@@ -170,3 +176,5 @@
   virtual bool is_aligned(HeapWord* addr) = 0;
 
 };
+
+#endif // SHARE_VM_MEMORY_BARRIERSET_HPP
--- a/src/share/vm/memory/barrierSet.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/barrierSet.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_BARRIERSET_INLINE_HPP
+#define SHARE_VM_MEMORY_BARRIERSET_INLINE_HPP
+
+#include "memory/barrierSet.hpp"
+#include "memory/cardTableModRefBS.hpp"
+
 // Inline functions of BarrierSet, which de-virtualize certain
 // performance-critical calls when the barrier is the most common
 // card-table kind.
@@ -77,3 +83,5 @@
     write_region_work(mr);
   }
 }
+
+#endif // SHARE_VM_MEMORY_BARRIERSET_INLINE_HPP
--- a/src/share/vm/memory/blockOffsetTable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/blockOffsetTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_blockOffsetTable.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/iterator.hpp"
+#include "memory/space.inline.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 //////////////////////////////////////////////////////////////////////
 // BlockOffsetSharedArray
--- a/src/share/vm/memory/blockOffsetTable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/blockOffsetTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_BLOCKOFFSETTABLE_HPP
+#define SHARE_VM_MEMORY_BLOCKOFFSETTABLE_HPP
+
+#include "memory/memRegion.hpp"
+#include "runtime/virtualspace.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // The CollectedHeap type requires subtypes to implement a method
 // "block_start".  For some subtypes, notably generational
 // systems using card-table-based write barriers, the efficiency of this
@@ -561,3 +568,5 @@
   // Debugging support
   virtual size_t last_active_index() const;
 };
+
+#endif // SHARE_VM_MEMORY_BLOCKOFFSETTABLE_HPP
--- a/src/share/vm/memory/blockOffsetTable.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/blockOffsetTable.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_BLOCKOFFSETTABLE_INLINE_HPP
+#define SHARE_VM_MEMORY_BLOCKOFFSETTABLE_INLINE_HPP
+
+#include "memory/blockOffsetTable.hpp"
+#include "memory/space.hpp"
+#include "runtime/safepoint.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#endif
+
 //////////////////////////////////////////////////////////////////////////
 // BlockOffsetTable inlines
 //////////////////////////////////////////////////////////////////////////
@@ -88,3 +98,5 @@
     }
   }
 }
+
+#endif // SHARE_VM_MEMORY_BLOCKOFFSETTABLE_INLINE_HPP
--- a/src/share/vm/memory/cardTableModRefBS.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/cardTableModRefBS.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,13 +22,26 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/sharedHeap.hpp"
+#include "memory/space.hpp"
+#include "memory/space.inline.hpp"
+#include "memory/universe.hpp"
+#include "runtime/java.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/virtualspace.hpp"
+#ifdef COMPILER1
+#include "c1/c1_LIR.hpp"
+#include "c1/c1_LIRGenerator.hpp"
+#endif
+
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
 // enumeration.)
 
-# include "incls/_precompiled.incl"
-# include "incls/_cardTableModRefBS.cpp.incl"
-
 size_t CardTableModRefBS::cards_required(size_t covered_words)
 {
   // Add one for a guard card, used to detect errors.
--- a/src/share/vm/memory/cardTableModRefBS.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/cardTableModRefBS.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
+#define SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
+
+#include "memory/modRefBarrierSet.hpp"
+#include "oops/oop.hpp"
+#include "oops/oop.inline2.hpp"
+
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
 // enumeration.)
@@ -490,3 +497,5 @@
 
   void set_CTRS(CardTableRS* rs) { _rs = rs; }
 };
+
+#endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
--- a/src/share/vm/memory/cardTableRS.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/cardTableRS.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_cardTableRS.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generation.hpp"
+#include "memory/space.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/os.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/concurrentMark.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 CardTableRS::CardTableRS(MemRegion whole_heap,
                          int max_covered_regions) :
--- a/src/share/vm/memory/cardTableRS.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/cardTableRS.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_CARDTABLERS_HPP
+#define SHARE_VM_MEMORY_CARDTABLERS_HPP
+
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/genRemSet.hpp"
+#include "memory/memRegion.hpp"
+
 class Space;
 class OopsInGenClosure;
 class DirtyCardToOopClosure;
@@ -158,3 +165,5 @@
   }
 
 };
+
+#endif // SHARE_VM_MEMORY_CARDTABLERS_HPP
--- a/src/share/vm/memory/classify.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/classify.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_classify.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/classify.hpp"
 
 
 const char* ClassifyObjectClosure::object_type_name[number_object_types] = {
--- a/src/share/vm/memory/classify.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/classify.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_CLASSIFY_HPP
+#define SHARE_VM_MEMORY_CLASSIFY_HPP
+
+#include "oops/oop.inline.hpp"
+
 typedef enum oop_type {
   unknown_type,
   instance_type,
@@ -90,3 +95,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_MEMORY_CLASSIFY_HPP
--- a/src/share/vm/memory/collectorPolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/collectorPolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,35 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_collectorPolicy.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/space.hpp"
+#include "memory/universe.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/globals_extension.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
+#endif
 
 // CollectorPolicy methods.
 
@@ -658,7 +685,7 @@
       result = expand_heap_and_allocate(size, is_tlab);
     }
     return result;   // could be null if we are out of space
-  } else if (!gch->incremental_collection_will_fail()) {
+  } else if (!gch->incremental_collection_will_fail(false /* don't consult_young */)) {
     // Do an incremental collection.
     gch->do_collection(false            /* full */,
                        false            /* clear_all_soft_refs */,
@@ -666,6 +693,9 @@
                        is_tlab          /* is_tlab */,
                        number_of_generations() - 1 /* max_level */);
   } else {
+    if (Verbose && PrintGCDetails) {
+      gclog_or_tty->print(" :: Trying full because partial may fail :: ");
+    }
     // Try a full collection; see delta for bug id 6266275
     // for the original code and why this has been simplified
     // with from-space allocation criteria modified and
--- a/src/share/vm/memory/collectorPolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/collectorPolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_COLLECTORPOLICY_HPP
+#define SHARE_VM_MEMORY_COLLECTORPOLICY_HPP
+
+#include "memory/barrierSet.hpp"
+#include "memory/genRemSet.hpp"
+#include "memory/permGen.hpp"
+
 // This class (or more correctly, subtypes of this class)
 // are used to define global garbage collector attributes.
 // This includes initialization of generations and any other
@@ -334,3 +341,5 @@
 
   void initialize_gc_policy_counters();
 };
+
+#endif // SHARE_VM_MEMORY_COLLECTORPOLICY_HPP
--- a/src/share/vm/memory/compactPermGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/compactPermGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_COMPACTPERMGEN_HPP
+#define SHARE_VM_MEMORY_COMPACTPERMGEN_HPP
+
+#include "memory/generation.hpp"
+#include "memory/permGen.hpp"
+
 class ContigPermSpace;
 class CardTableModRefBS;
 class CompactingPermGenGen;
@@ -46,3 +52,5 @@
   Generation* as_gen() const { return _gen; }
 
 };
+
+#endif // SHARE_VM_MEMORY_COMPACTPERMGEN_HPP
--- a/src/share/vm/memory/compactingPermGenGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/compactingPermGenGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_compactingPermGenGen.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/filemap.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/generationSpec.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
+#endif
 
 
 // An ObjectClosure helper: Recursively adjust all pointers in an object
--- a/src/share/vm/memory/compactingPermGenGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/compactingPermGenGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
+#define SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
+
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/space.hpp"
+
 // All heaps contains a "permanent generation," containing permanent
 // (reflective) objects.  This is like a regular generation in some ways,
 // but unlike one in others, and so is split apart.
@@ -247,3 +253,5 @@
   // or if the remapping has already been done by a prior call.
   static bool remap_shared_readonly_as_readwrite();
 };
+
+#endif // SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
--- a/src/share/vm/memory/defNewGeneration.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/defNewGeneration.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,32 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_defNewGeneration.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "gc_implementation/shared/gcPolicyCounters.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/defNewGeneration.inline.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/iterator.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/space.inline.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/stack.inline.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 //
 // DefNewGeneration functions.
@@ -459,16 +483,17 @@
 // so we try to allocate the from-space, too.
 HeapWord* DefNewGeneration::allocate_from_space(size_t size) {
   HeapWord* result = NULL;
-  if (PrintGC && Verbose) {
+  if (Verbose && PrintGCDetails) {
     gclog_or_tty->print("DefNewGeneration::allocate_from_space(%u):"
-                  "  will_fail: %s"
-                  "  heap_lock: %s"
-                  "  free: " SIZE_FORMAT,
-                  size,
-               GenCollectedHeap::heap()->incremental_collection_will_fail() ? "true" : "false",
-               Heap_lock->is_locked() ? "locked" : "unlocked",
-               from()->free());
-    }
+                        "  will_fail: %s"
+                        "  heap_lock: %s"
+                        "  free: " SIZE_FORMAT,
+                        size,
+                        GenCollectedHeap::heap()->incremental_collection_will_fail(false /* don't consult_young */) ?
+                          "true" : "false",
+                        Heap_lock->is_locked() ? "locked" : "unlocked",
+                        from()->free());
+  }
   if (should_allocate_from_space() || GC_locker::is_active_and_needs_gc()) {
     if (Heap_lock->owned_by_self() ||
         (SafepointSynchronize::is_at_safepoint() &&
@@ -510,6 +535,9 @@
   // from this generation, pass on collection; let the next generation
   // do it.
   if (!collection_attempt_is_safe()) {
+    if (Verbose && PrintGCDetails) {
+      gclog_or_tty->print(" :: Collection attempt not safe :: ");
+    }
     gch->set_incremental_collection_failed(); // Slight lie: we did not even attempt one
     return;
   }
@@ -656,23 +684,28 @@
   _preserved_marks_of_objs.clear(true);
 }
 
+void DefNewGeneration::preserve_mark(oop obj, markOop m) {
+  assert(promotion_failed() && m->must_be_preserved_for_promotion_failure(obj),
+         "Oversaving!");
+  _objs_with_preserved_marks.push(obj);
+  _preserved_marks_of_objs.push(m);
+}
+
 void DefNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) {
   if (m->must_be_preserved_for_promotion_failure(obj)) {
-    _objs_with_preserved_marks.push(obj);
-    _preserved_marks_of_objs.push(m);
+    preserve_mark(obj, m);
   }
 }
 
 void DefNewGeneration::handle_promotion_failure(oop old) {
-  preserve_mark_if_necessary(old, old->mark());
-  if (!_promotion_failed && PrintPromotionFailure) {
+  if (PrintPromotionFailure && !_promotion_failed) {
     gclog_or_tty->print(" (promotion failure size = " SIZE_FORMAT ") ",
                         old->size());
   }
-
+  _promotion_failed = true;
+  preserve_mark_if_necessary(old, old->mark());
   // forward to self
   old->forward_to(old);
-  _promotion_failed = true;
 
   _promo_failure_scan_stack.push(old);
 
@@ -797,6 +830,9 @@
 
 bool DefNewGeneration::collection_attempt_is_safe() {
   if (!to()->is_empty()) {
+    if (Verbose && PrintGCDetails) {
+      gclog_or_tty->print(" :: to is not empty :: ");
+    }
     return false;
   }
   if (_next_gen == NULL) {
@@ -819,10 +855,18 @@
   GenCollectedHeap* gch = GenCollectedHeap::heap();
   if (full) {
     DEBUG_ONLY(seen_incremental_collection_failed = false;)
-    if (!collection_attempt_is_safe()) {
+    if (!collection_attempt_is_safe() && !_eden_space->is_empty()) {
+      if (Verbose && PrintGCDetails) {
+        gclog_or_tty->print("DefNewEpilogue: cause(%s), full, not safe, set_failed, set_alloc_from, clear_seen",
+                            GCCause::to_string(gch->gc_cause()));
+      }
       gch->set_incremental_collection_failed(); // Slight lie: a full gc left us in that state
       set_should_allocate_from_space(); // we seem to be running out of space
     } else {
+      if (Verbose && PrintGCDetails) {
+        gclog_or_tty->print("DefNewEpilogue: cause(%s), full, safe, clear_failed, clear_alloc_from, clear_seen",
+                            GCCause::to_string(gch->gc_cause()));
+      }
       gch->clear_incremental_collection_failed(); // We just did a full collection
       clear_should_allocate_from_space(); // if set
     }
@@ -836,9 +880,20 @@
     // a full collection in between.
     if (!seen_incremental_collection_failed &&
         gch->incremental_collection_failed()) {
+      if (Verbose && PrintGCDetails) {
+        gclog_or_tty->print("DefNewEpilogue: cause(%s), not full, not_seen_failed, failed, set_seen_failed",
+                            GCCause::to_string(gch->gc_cause()));
+      }
       seen_incremental_collection_failed = true;
     } else if (seen_incremental_collection_failed) {
-      assert(!gch->incremental_collection_failed(), "Twice in a row");
+      if (Verbose && PrintGCDetails) {
+        gclog_or_tty->print("DefNewEpilogue: cause(%s), not full, seen_failed, will_clear_seen_failed",
+                            GCCause::to_string(gch->gc_cause()));
+      }
+      assert(gch->gc_cause() == GCCause::_scavenge_alot ||
+             (gch->gc_cause() == GCCause::_java_lang_system_gc && UseConcMarkSweepGC && ExplicitGCInvokesConcurrent) ||
+             !gch->incremental_collection_failed(),
+             "Twice in a row");
       seen_incremental_collection_failed = false;
     }
 #endif // ASSERT
--- a/src/share/vm/memory/defNewGeneration.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/defNewGeneration.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_HPP
+#define SHARE_VM_MEMORY_DEFNEWGENERATION_HPP
+
+#include "gc_implementation/shared/ageTable.hpp"
+#include "gc_implementation/shared/cSpaceCounters.hpp"
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/generation.inline.hpp"
+#include "utilities/stack.hpp"
+
 class EdenSpace;
 class ContiguousSpace;
 class ScanClosure;
@@ -76,6 +85,7 @@
   // Preserve the mark of "obj", if necessary, in preparation for its mark
   // word being overwritten with a self-forwarding-pointer.
   void   preserve_mark_if_necessary(oop obj, markOop m);
+  void   preserve_mark(oop obj, markOop m);    // work routine used by the above
 
   // Together, these keep <object with a preserved mark, mark value> pairs.
   // They should always contain the same number of elements.
@@ -346,3 +356,5 @@
   // Scavenge support
   void swap_spaces();
 };
+
+#endif // SHARE_VM_MEMORY_DEFNEWGENERATION_HPP
--- a/src/share/vm/memory/defNewGeneration.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/defNewGeneration.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
+#define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
+
+#include "memory/cardTableRS.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/space.hpp"
+
 // Methods of protected closure types
 
 template <class T>
@@ -79,3 +86,5 @@
     _rs->inline_write_ref_field_gc(p, obj);
   }
 }
+
+#endif // SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
--- a/src/share/vm/memory/dump.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/dump.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,23 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dump.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/loaderConstraints.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/classify.hpp"
+#include "memory/filemap.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/copy.hpp"
 
 
 // Closure to set up the fingerprint field for all methods.
@@ -1350,7 +1365,7 @@
   ResourceMark rm;
 
   // Preload classes to be shared.
-  // Should use some hpi:: method rather than fopen() here. aB.
+  // Should use some os:: method rather than fopen() here. aB.
   // Construct the path to the class list (in jre/lib)
   // Walk up two directories from the location of the VM and
   // optionally tack on "lib" (depending on platform)
@@ -1489,7 +1504,7 @@
 
   } else {
     char errmsg[JVM_MAXPATHLEN];
-    hpi::lasterror(errmsg, JVM_MAXPATHLEN);
+    os::lasterror(errmsg, JVM_MAXPATHLEN);
     tty->print_cr("Loading classlist failed: %s", errmsg);
     exit(1);
   }
--- a/src/share/vm/memory/filemap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/filemap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_filemap.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/symbolTable.hpp"
+#include "memory/filemap.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/java.hpp"
+#include "runtime/os.hpp"
+#include "utilities/defaultStream.hpp"
+
 # include <sys/stat.h>
 # include <errno.h>
 
--- a/src/share/vm/memory/filemap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/filemap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_FILEMAP_HPP
+#define SHARE_VM_MEMORY_FILEMAP_HPP
+
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/space.hpp"
+
 // Layout of the file:
 //  header: dump of archive instance plus versioning info, datestamp, etc.
 //   [magic # = 0xF00BABA2]
@@ -137,3 +143,5 @@
   // Return true if given address is in the mapped shared space.
   bool is_in_shared_space(const void* p);
 };
+
+#endif // SHARE_VM_MEMORY_FILEMAP_HPP
--- a/src/share/vm/memory/gcLocker.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/gcLocker.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_gcLocker.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/sharedHeap.hpp"
 
 volatile jint GC_locker::_jni_lock_count = 0;
 volatile jint GC_locker::_lock_count     = 0;
--- a/src/share/vm/memory/gcLocker.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/gcLocker.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,26 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GCLOCKER_HPP
+#define SHARE_VM_MEMORY_GCLOCKER_HPP
+
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
+
 // The direct lock/unlock calls do not force a collection if an unlock
 // decrements the count to zero. Avoid calling these if at all possible.
 
@@ -310,3 +330,5 @@
   ~No_Alloc_Verifier() {}
 #endif
 };
+
+#endif // SHARE_VM_MEMORY_GCLOCKER_HPP
--- a/src/share/vm/memory/gcLocker.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/gcLocker.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP
+#define SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP
+
+#include "memory/gcLocker.hpp"
+
 inline bool GC_locker::is_active() {
   return _lock_count > 0 || _jni_lock_count > 0;
 }
@@ -70,3 +75,5 @@
     }
   }
 }
+
+#endif // SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP
--- a/src/share/vm/memory/genCollectedHeap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genCollectedHeap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,41 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_genCollectedHeap.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/compactPermGen.hpp"
+#include "memory/filemap.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/permGen.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/sharedHeap.hpp"
+#include "memory/space.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/aprofiler.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/vmThread.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/vmError.hpp"
+#include "utilities/workgroup.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
+#endif
 
 GenCollectedHeap* GenCollectedHeap::_gch;
 NOT_PRODUCT(size_t GenCollectedHeap::_skip_header_HeapWords = 0;)
@@ -902,7 +935,7 @@
 void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs,
                                           int max_level) {
   int local_max_level;
-  if (!incremental_collection_will_fail() &&
+  if (!incremental_collection_will_fail(false /* don't consult_young */) &&
       gc_cause() == GCCause::_gc_locker) {
     local_max_level = 0;
   } else {
@@ -918,7 +951,7 @@
   // A scavenge may not have been attempted, or may have
   // been attempted and failed, because the old gen was too full
   if (local_max_level == 0 && gc_cause() == GCCause::_gc_locker &&
-      incremental_collection_will_fail()) {
+      incremental_collection_will_fail(false /* don't consult_young */)) {
     if (PrintGCDetails) {
       gclog_or_tty->print_cr("GC locker: Trying a full collection "
                              "because scavenge failed");
--- a/src/share/vm/memory/genCollectedHeap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genCollectedHeap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
+#define SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
+
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "memory/generation.hpp"
+#include "memory/sharedHeap.hpp"
+
 class SubTasksDone;
 
 // A "GenCollectedHeap" is a SharedHeap that uses generational
@@ -469,13 +477,17 @@
   bool no_allocs_since_save_marks(int level);
 
   // Returns true if an incremental collection is likely to fail.
-  bool incremental_collection_will_fail() {
+  // We optionally consult the young gen, if asked to do so;
+  // otherwise we base our answer on whether the previous incremental
+  // collection attempt failed with no corrective action as of yet.
+  bool incremental_collection_will_fail(bool consult_young) {
     // Assumes a 2-generation system; the first disjunct remembers if an
     // incremental collection failed, even when we thought (second disjunct)
     // that it would not.
     assert(heap()->collector_policy()->is_two_generation_policy(),
            "the following definition may not be suitable for an n(>2)-generation system");
-    return incremental_collection_failed() || !get_gen(0)->collection_attempt_is_safe();
+    return incremental_collection_failed() ||
+           (consult_young && !get_gen(0)->collection_attempt_is_safe());
   }
 
   // If a generation bails out of an incremental collection,
@@ -535,3 +547,5 @@
 public:
   virtual void preload_and_dump(TRAPS) KERNEL_RETURN;
 };
+
+#endif // SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
--- a/src/share/vm/memory/genMarkSweep.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genMarkSweep.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,39 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_genMarkSweep.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genMarkSweep.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/modRefBarrierSet.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/space.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/events.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
   bool clear_all_softrefs) {
--- a/src/share/vm/memory/genMarkSweep.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genMarkSweep.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENMARKSWEEP_HPP
+#define SHARE_VM_MEMORY_GENMARKSWEEP_HPP
+
+#include "gc_implementation/shared/markSweep.hpp"
+
 class GenMarkSweep : public MarkSweep {
   friend class VM_MarkSweep;
   friend class G1MarkSweep;
@@ -44,3 +49,5 @@
   static void allocate_stacks();
   static void deallocate_stacks();
 };
+
+#endif // SHARE_VM_MEMORY_GENMARKSWEEP_HPP
--- a/src/share/vm/memory/genOopClosures.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genOopClosures.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
+#define SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
+
+#include "memory/iterator.hpp"
+#include "oops/oop.hpp"
+
 class Generation;
 class HeapWord;
 class CardTableRS;
@@ -176,3 +182,5 @@
   virtual void do_oop(narrowOop* p);
   static VerifyOopClosure verify_oop;
 };
+
+#endif // SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
--- a/src/share/vm/memory/genOopClosures.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genOopClosures.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENOOPCLOSURES_INLINE_HPP
+#define SHARE_VM_MEMORY_GENOOPCLOSURES_INLINE_HPP
+
+#include "memory/cardTableRS.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.hpp"
+#include "memory/genRemSet.hpp"
+#include "memory/generation.hpp"
+#include "memory/sharedHeap.hpp"
+#include "memory/space.hpp"
+
 inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
   OopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
   set_generation(gen);
@@ -122,3 +134,5 @@
 
 inline void ScanWeakRefClosure::do_oop_nv(oop* p)       { ScanWeakRefClosure::do_oop_work(p); }
 inline void ScanWeakRefClosure::do_oop_nv(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); }
+
+#endif // SHARE_VM_MEMORY_GENOOPCLOSURES_INLINE_HPP
--- a/src/share/vm/memory/genRemSet.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genRemSet.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,14 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/genRemSet.hpp"
+
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
 // enumeration.)
 
-# include "incls/_precompiled.incl"
-# include "incls/_genRemSet.cpp.incl"
-
 uintx GenRemSet::max_alignment_constraint(Name nm) {
   switch (nm) {
   case GenRemSet::CardTable:
--- a/src/share/vm/memory/genRemSet.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genRemSet.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENREMSET_HPP
+#define SHARE_VM_MEMORY_GENREMSET_HPP
+
+#include "oops/oop.hpp"
+
 // A GenRemSet provides ways of iterating over pointers accross generations.
 // (This is especially useful for older-to-younger.)
 
@@ -133,3 +138,5 @@
   // perm gen as well.
   virtual void invalidate_or_clear(Generation* gen, bool younger, bool perm) = 0;
 };
+
+#endif // SHARE_VM_MEMORY_GENREMSET_HPP
--- a/src/share/vm/memory/genRemSet.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/genRemSet.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENREMSET_INLINE_HPP
+#define SHARE_VM_MEMORY_GENREMSET_INLINE_HPP
+
 // Inline functions of GenRemSet, which de-virtualize this
 // performance-critical call when when the rem set is the most common
 // card-table kind.
@@ -33,3 +36,5 @@
     write_ref_field_gc_work(field, new_val);
   }
 }
+
+#endif // SHARE_VM_MEMORY_GENREMSET_INLINE_HPP
--- a/src/share/vm/memory/generation.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/generation.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,24 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_generation.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genMarkSweep.hpp"
+#include "memory/genOopClosures.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/generation.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/events.hpp"
 
 Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
   _level(level),
--- a/src/share/vm/memory/generation.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/generation.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,19 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENERATION_HPP
+#define SHARE_VM_MEMORY_GENERATION_HPP
+
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "memory/allocation.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/referenceProcessor.hpp"
+#include "memory/universe.hpp"
+#include "memory/watermark.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/perfData.hpp"
+#include "runtime/virtualspace.hpp"
+
 // A Generation models a heap area for similarly-aged objects.
 // It will contain one ore more spaces holding the actual objects.
 //
@@ -740,3 +753,5 @@
   virtual void verify(bool allow_dirty);
   virtual void print_on(outputStream* st) const;
 };
+
+#endif // SHARE_VM_MEMORY_GENERATION_HPP
--- a/src/share/vm/memory/generation.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/generation.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENERATION_INLINE_HPP
+#define SHARE_VM_MEMORY_GENERATION_INLINE_HPP
+
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generation.hpp"
+#include "memory/space.hpp"
+
 bool OneContigSpaceCardGeneration::is_in(const void* p) const {
   return the_space()->is_in(p);
 }
@@ -63,3 +70,5 @@
 bool OneContigSpaceCardGeneration::block_is_obj(const HeapWord* addr) const {
   return addr < the_space()->top();
 }
+
+#endif // SHARE_VM_MEMORY_GENERATION_INLINE_HPP
--- a/src/share/vm/memory/generationSpec.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/generationSpec.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_generationSpec.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/compactPermGen.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/filemap.hpp"
+#include "memory/genRemSet.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/tenuredGeneration.hpp"
+#include "runtime/java.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
+#include "gc_implementation/parNew/asParNewGeneration.hpp"
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#endif
 
 Generation* GenerationSpec::init(ReservedSpace rs, int level,
                                  GenRemSet* remset) {
--- a/src/share/vm/memory/generationSpec.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/generationSpec.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_GENERATIONSPEC_HPP
+#define SHARE_VM_MEMORY_GENERATIONSPEC_HPP
+
+#include "memory/generation.hpp"
+#include "memory/permGen.hpp"
+
 // The specification of a generation.  This class also encapsulates
 // some generation-specific behavior.  This is done here rather than as a
 // virtual function of Generation because these methods are needed in
@@ -120,3 +126,5 @@
   size_t misc_code_size() const { return _misc_code_size; }
   bool enable_shared_spaces()    const { return _enable_shared_spaces; }
 };
+
+#endif // SHARE_VM_MEMORY_GENERATIONSPEC_HPP
--- a/src/share/vm/memory/heap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/heap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_heap.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/heap.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/os.hpp"
 
 
 size_t CodeHeap::header_size() {
--- a/src/share/vm/memory/heap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/heap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_HEAP_HPP
+#define SHARE_VM_MEMORY_HEAP_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/virtualspace.hpp"
+
 // Blocks
 
 class HeapBlock VALUE_OBJ_CLASS_SPEC {
@@ -160,3 +166,5 @@
   void verify();
   void print()  PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_MEMORY_HEAP_HPP
--- a/src/share/vm/memory/heapInspection.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/heapInspection.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_heapInspection.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/heapInspection.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/klassOop.hpp"
+#include "runtime/os.hpp"
+#include "utilities/globalDefinitions.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#endif
 
 // HeapInspection
 
--- a/src/share/vm/memory/heapInspection.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/heapInspection.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_HEAPINSPECTION_HPP
+#define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
+
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+
 #ifndef SERVICES_KERNEL
 
 
@@ -130,3 +136,5 @@
   static void heap_inspection(outputStream* st, bool need_prologue) KERNEL_RETURN;
   static void find_instances_at_safepoint(klassOop k, GrowableArray<oop>* result) KERNEL_RETURN;
 };
+
+#endif // SHARE_VM_MEMORY_HEAPINSPECTION_HPP
--- a/src/share/vm/memory/iterator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/iterator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_iterator.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/iterator.hpp"
+#include "oops/oop.inline.hpp"
 
 #ifdef ASSERT
 bool OopClosure::_must_remember_klasses = false;
--- a/src/share/vm/memory/iterator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/iterator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_ITERATOR_HPP
+#define SHARE_VM_MEMORY_ITERATOR_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/memRegion.hpp"
+#include "runtime/prefetch.hpp"
+#include "utilities/top.hpp"
+
 // The following classes are C++ `closures` for iterating over objects, roots and spaces
 
 class CodeBlob;
@@ -325,3 +333,5 @@
   }
 };
 #endif  // ASSERT
+
+#endif // SHARE_VM_MEMORY_ITERATOR_HPP
--- a/src/share/vm/memory/memRegion.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/memRegion.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,13 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "memory/memRegion.hpp"
+#include "runtime/globals.hpp"
+
 // A very simple data structure representing a contigous word-aligned
 // region of address space.
 
-#include "incls/_precompiled.incl"
-#include "incls/_memRegion.cpp.incl"
-
 MemRegion MemRegion::intersection(const MemRegion mr2) const {
   MemRegion res;
   HeapWord* res_start = MAX2(start(), mr2.start());
--- a/src/share/vm/memory/memRegion.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/memRegion.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_MEMREGION_HPP
+#define SHARE_VM_MEMORY_MEMREGION_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // A very simple data structure representing a contigous region
 // region of address space.
 
@@ -104,3 +111,5 @@
 
   void  operator delete(void* p) {} // nothing to do
 };
+
+#endif // SHARE_VM_MEMORY_MEMREGION_HPP
--- a/src/share/vm/memory/modRefBarrierSet.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/modRefBarrierSet.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_MODREFBARRIERSET_HPP
+#define SHARE_VM_MEMORY_MODREFBARRIERSET_HPP
+
+#include "memory/barrierSet.hpp"
+
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
 // enumeration), using a card table.
@@ -111,3 +116,5 @@
 #endif
 
 };
+
+#endif // SHARE_VM_MEMORY_MODREFBARRIERSET_HPP
--- a/src/share/vm/memory/oopFactory.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/oopFactory.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,28 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_oopFactory.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/compiledICHolderKlass.hpp"
+#include "oops/constMethodKlass.hpp"
+#include "oops/constantPoolKlass.hpp"
+#include "oops/cpCacheKlass.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceKlassKlass.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/klassKlass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodDataKlass.hpp"
+#include "oops/methodKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 
 
 typeArrayOop oopFactory::new_charArray(const char* utf8_str, TRAPS) {
--- a/src/share/vm/memory/oopFactory.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/oopFactory.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_OOPFACTORY_HPP
+#define SHARE_VM_MEMORY_OOPFACTORY_HPP
+
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/universe.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "utilities/growableArray.hpp"
+
 // oopFactory is a class used for creating new objects.
 
 class vframeArray;
@@ -126,3 +138,5 @@
   // For compiled ICs
   static compiledICHolderOop new_compiledICHolder(methodHandle method, KlassHandle klass, TRAPS);
 };
+
+#endif // SHARE_VM_MEMORY_OOPFACTORY_HPP
--- a/src/share/vm/memory/permGen.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/permGen.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_permGen.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/cSpaceCounters.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/compactPermGen.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/permGen.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/vmThread.hpp"
 
 HeapWord* PermGen::request_expand_and_allocate(Generation* gen, size_t size,
                                                GCCause::Cause prev_cause) {
--- a/src/share/vm/memory/permGen.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/permGen.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_PERMGEN_HPP
+#define SHARE_VM_MEMORY_PERMGEN_HPP
+
+#include "gc_interface/gcCause.hpp"
+#include "memory/generation.hpp"
+#include "memory/iterator.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/virtualspace.hpp"
+
 // All heaps contains a "permanent generation," containing permanent
 // (reflective) objects.  This is like a regular generation in some ways,
 // but unlike one in others, and so is split apart.
@@ -84,3 +94,5 @@
     g->update_counters();
   }
 };
+
+#endif // SHARE_VM_MEMORY_PERMGEN_HPP
--- a/src/share/vm/memory/referencePolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/referencePolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_referencePolicy.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/universe.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/globals.hpp"
 
 LRUCurrentHeapPolicy::LRUCurrentHeapPolicy() {
   setup();
--- a/src/share/vm/memory/referencePolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/referencePolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_REFERENCEPOLICY_HPP
+#define SHARE_VM_MEMORY_REFERENCEPOLICY_HPP
+
 // referencePolicy is used to determine when soft reference objects
 // should be cleared.
 
@@ -66,3 +69,5 @@
   void setup();
   bool should_clear_reference(oop p);
 };
+
+#endif // SHARE_VM_MEMORY_REFERENCEPOLICY_HPP
--- a/src/share/vm/memory/referenceProcessor.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/referenceProcessor.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_referenceProcessor.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/referencePolicy.hpp"
+#include "memory/referenceProcessor.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/jniHandles.hpp"
 
 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL;
 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy      = NULL;
@@ -762,9 +770,8 @@
   // loop over the lists
   for (int i = 0; i < _max_num_q * subclasses_of_ref; i++) {
     if (TraceReferenceGC && PrintGCDetails && ((i % _max_num_q) == 0)) {
-      gclog_or_tty->print_cr(
-        "\nAbandoning %s discovered list",
-        list_name(i));
+      gclog_or_tty->print_cr("\nAbandoning %s discovered list",
+                             list_name(i));
     }
     abandon_partial_discovered_list(_discoveredSoftRefs[i]);
   }
@@ -1051,9 +1058,7 @@
     // During a multi-threaded discovery phase,
     // each thread saves to its "own" list.
     Thread* thr = Thread::current();
-    assert(thr->is_GC_task_thread(),
-           "Dubious cast from Thread* to WorkerThread*?");
-    id = ((WorkerThread*)thr)->id();
+    id = thr->as_Worker_thread()->id();
   } else {
     // single-threaded discovery, we save in round-robin
     // fashion to each of the lists.
@@ -1087,8 +1092,7 @@
       ShouldNotReachHere();
   }
   if (TraceReferenceGC && PrintGCDetails) {
-    gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT,
-      id, list);
+    gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, list);
   }
   return list;
 }
@@ -1127,6 +1131,11 @@
     if (_discovered_list_needs_barrier) {
       _bs->write_ref_field((void*)discovered_addr, current_head);
     }
+
+    if (TraceReferenceGC) {
+      gclog_or_tty->print_cr("Enqueued reference (mt) (" INTPTR_FORMAT ": %s)",
+                             obj, obj->blueprint()->internal_name());
+    }
   } else {
     // If retest was non NULL, another thread beat us to it:
     // The reference has already been discovered...
@@ -1137,6 +1146,20 @@
   }
 }
 
+#ifndef PRODUCT
+// Non-atomic (i.e. concurrent) discovery might allow us
+// to observe j.l.References with NULL referents, being those
+// cleared concurrently by mutators during (or after) discovery.
+void ReferenceProcessor::verify_referent(oop obj) {
+  bool da = discovery_is_atomic();
+  oop referent = java_lang_ref_Reference::referent(obj);
+  assert(da ? referent->is_oop() : referent->is_oop_or_null(),
+         err_msg("Bad referent " INTPTR_FORMAT " found in Reference "
+                 INTPTR_FORMAT " during %satomic discovery ",
+                 (intptr_t)referent, (intptr_t)obj, da ? "" : "non-"));
+}
+#endif
+
 // We mention two of several possible choices here:
 // #0: if the reference object is not in the "originating generation"
 //     (or part of the heap being collected, indicated by our "span"
@@ -1187,14 +1210,8 @@
   // We only enqueue references whose referents are not (yet) strongly
   // reachable.
   if (is_alive_non_header() != NULL) {
-    oop referent = java_lang_ref_Reference::referent(obj);
-    // In the case of non-concurrent discovery, the last
-    // disjunct below should hold. It may not hold in the
-    // case of concurrent discovery because mutators may
-    // concurrently clear() a Reference.
-    assert(UseConcMarkSweepGC || UseG1GC || referent != NULL,
-           "Refs with null referents already filtered");
-    if (is_alive_non_header()->do_object_b(referent)) {
+    verify_referent(obj);
+    if (is_alive_non_header()->do_object_b(java_lang_ref_Reference::referent(obj))) {
       return false;  // referent is reachable
     }
   }
@@ -1231,20 +1248,20 @@
       // Check assumption that an object is not potentially
       // discovered twice except by concurrent collectors that potentially
       // trace the same Reference object twice.
-      assert(UseConcMarkSweepGC,
-             "Only possible with an incremental-update concurrent collector");
+      assert(UseConcMarkSweepGC || UseG1GC,
+             "Only possible with a concurrent marking collector");
       return true;
     }
   }
 
   if (RefDiscoveryPolicy == ReferentBasedDiscovery) {
-    oop referent = java_lang_ref_Reference::referent(obj);
-    assert(referent->is_oop(), "bad referent");
+    verify_referent(obj);
     // enqueue if and only if either:
     // reference is in our span or
     // we are an atomic collector and referent is in our span
     if (_span.contains(obj_addr) ||
-        (discovery_is_atomic() && _span.contains(referent))) {
+        (discovery_is_atomic() &&
+         _span.contains(java_lang_ref_Reference::referent(obj)))) {
       // should_enqueue = true;
     } else {
       return false;
@@ -1285,26 +1302,14 @@
     }
     list->set_head(obj);
     list->inc_length(1);
-  }
 
-  // In the MT discovery case, it is currently possible to see
-  // the following message multiple times if several threads
-  // discover a reference about the same time. Only one will
-  // however have actually added it to the disocvered queue.
-  // One could let add_to_discovered_list_mt() return an
-  // indication for success in queueing (by 1 thread) or
-  // failure (by all other threads), but I decided the extra
-  // code was not worth the effort for something that is
-  // only used for debugging support.
-  if (TraceReferenceGC) {
-    oop referent = java_lang_ref_Reference::referent(obj);
-    if (PrintGCDetails) {
+    if (TraceReferenceGC) {
       gclog_or_tty->print_cr("Enqueued reference (" INTPTR_FORMAT ": %s)",
-                             obj, obj->blueprint()->internal_name());
+                                obj, obj->blueprint()->internal_name());
     }
-    assert(referent->is_oop(), "Enqueued a bad referent");
   }
   assert(obj->is_oop(), "Enqueued a bad reference");
+  verify_referent(obj);
   return true;
 }
 
--- a/src/share/vm/memory/referenceProcessor.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/referenceProcessor.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_REFERENCEPROCESSOR_HPP
+#define SHARE_VM_MEMORY_REFERENCEPROCESSOR_HPP
+
+#include "memory/referencePolicy.hpp"
+#include "oops/instanceRefKlass.hpp"
+
 // ReferenceProcessor class encapsulates the per-"collector" processing
 // of java.lang.Reference objects for GC. The interface is useful for supporting
 // a generational abstraction, in particular when there are multiple
@@ -339,6 +345,7 @@
 
   // debugging
   void verify_no_references_recorded() PRODUCT_RETURN;
+  void verify_referent(oop obj)        PRODUCT_RETURN;
   static void verify();
 
   // clear the discovered lists (unlinking each entry).
@@ -542,3 +549,5 @@
   oop                 _sentinel_ref;
   int                 _n_queues;
 };
+
+#endif // SHARE_VM_MEMORY_REFERENCEPROCESSOR_HPP
--- a/src/share/vm/memory/resourceArea.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/resourceArea.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_resourceArea.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/mutexLocker.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 //------------------------------ResourceMark-----------------------------------
 debug_only(int ResourceArea::_warned;)      // to suppress multiple warnings
--- a/src/share/vm/memory/resourceArea.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/resourceArea.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_RESOURCEAREA_HPP
+#define SHARE_VM_MEMORY_RESOURCEAREA_HPP
+
+#include "memory/allocation.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // The resource area holds temporary data structures in the VM.
 // The actual allocation areas are thread local. Typical usage:
 //
@@ -224,3 +238,5 @@
   void free_malloced_objects()                                         PRODUCT_RETURN;
   size_t size_in_bytes()       NOT_PRODUCT({ return _size_in_bytes; }) PRODUCT_RETURN0;
 };
+
+#endif // SHARE_VM_MEMORY_RESOURCEAREA_HPP
--- a/src/share/vm/memory/restore.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/restore.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_restore.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/filemap.hpp"
+#include "oops/oop.inline.hpp"
+#include "utilities/hashtable.inline.hpp"
 
 
 // Closure for serializing initialization data in from a data area
--- a/src/share/vm/memory/serialize.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/serialize.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_serialize.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "memory/classify.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 
 
 // Serialize out the block offset shared array for the shared spaces.
--- a/src/share/vm/memory/sharedHeap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/sharedHeap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_sharedHeap.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/sharedHeap.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/java.hpp"
+#include "services/management.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/workgroup.hpp"
 
 SharedHeap* SharedHeap::_sh;
 
--- a/src/share/vm/memory/sharedHeap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/sharedHeap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_SHAREDHEAP_HPP
+#define SHARE_VM_MEMORY_SHAREDHEAP_HPP
+
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/generation.hpp"
+#include "memory/permGen.hpp"
+
 // A "SharedHeap" is an implementation of a java heap for HotSpot.  This
 // is an abstract class: there may be many different kinds of heaps.  This
 // class defines the functions that a heap must implement, and contains
@@ -285,3 +292,5 @@
                              size_t bytes_after,
                              size_t capacity);
 };
+
+#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
--- a/src/share/vm/memory/space.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/space.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,24 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_space.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_implementation/shared/liveRange.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/space.hpp"
+#include "memory/space.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/java.hpp"
+#include "runtime/safepoint.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 void SpaceMemRegionOopsIterClosure::do_oop(oop* p)       { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
 void SpaceMemRegionOopsIterClosure::do_oop(narrowOop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
--- a/src/share/vm/memory/space.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/space.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,29 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_SPACE_HPP
+#define SHARE_VM_MEMORY_SPACE_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/blockOffsetTable.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/iterator.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/watermark.hpp"
+#include "oops/markOop.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/prefetch.hpp"
+#include "utilities/workgroup.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+
 // A space is an abstraction for the "storage units" backing
 // up the generation abstraction. It includes specific
 // implementations for keeping track of free and used space,
@@ -1107,3 +1130,5 @@
   ContigPermSpace(BlockOffsetSharedArray* sharedOffsetArray, MemRegion mr) :
     OffsetTableContigSpace(sharedOffsetArray, mr) {}
 };
+
+#endif // SHARE_VM_MEMORY_SPACE_HPP
--- a/src/share/vm/memory/space.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/space.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_SPACE_INLINE_HPP
+#define SHARE_VM_MEMORY_SPACE_INLINE_HPP
+
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/space.hpp"
+#include "memory/universe.hpp"
+#include "runtime/safepoint.hpp"
+
 inline HeapWord* Space::block_start(const void* p) {
   return block_start_const(p);
 }
@@ -71,3 +79,5 @@
   assert(new_limit <= top(), "uninitialized objects in the safe range");
   _concurrent_iteration_safe_limit = new_limit;
 }
+
+#endif // SHARE_VM_MEMORY_SPACE_INLINE_HPP
--- a/src/share/vm/memory/specialized_oop_closures.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/specialized_oop_closures.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_specialized_oop_closures.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/specialized_oop_closures.hpp"
+#include "utilities/ostream.hpp"
 
 // For keeping stats on effectiveness.
 #ifndef PRODUCT
--- a/src/share/vm/memory/specialized_oop_closures.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/specialized_oop_closures.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
+#define SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
+
+#include "runtime/atomic.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
+#endif
+
 // The following OopClosure types get specialized versions of
 // "oop_oop_iterate" that invoke the closures' do_oop methods
 // non-virtually, using a mechanism defined in this file.  Extend these
@@ -251,3 +259,5 @@
 
 #endif  // ENABLE_SPECIALIZATION_STATS
 #endif  // !PRODUCT
+
+#endif // SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
--- a/src/share/vm/memory/tenuredGeneration.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/tenuredGeneration.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_tenuredGeneration.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/parNew/parGCAllocBuffer.hpp"
+#include "gc_implementation/shared/collectorCounters.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/space.hpp"
+#include "memory/tenuredGeneration.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/java.hpp"
 
 TenuredGeneration::TenuredGeneration(ReservedSpace rs,
                                      size_t initial_byte_size, int level,
--- a/src/share/vm/memory/tenuredGeneration.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/tenuredGeneration.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_TENUREDGENERATION_HPP
+#define SHARE_VM_MEMORY_TENUREDGENERATION_HPP
+
+#include "gc_implementation/shared/cSpaceCounters.hpp"
+#include "gc_implementation/shared/gcStats.hpp"
+#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/generation.hpp"
+
 // TenuredGeneration models the heap containing old (promoted/tenured) objects.
 
 class ParGCAllocBufferWithBOT;
@@ -105,3 +113,5 @@
 
   void verify_alloc_buffers_clean();
 };
+
+#endif // SHARE_VM_MEMORY_TENUREDGENERATION_HPP
--- a/src/share/vm/memory/threadLocalAllocBuffer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,24 @@
  *
  */
 
-// Thread-Local Edens support
+#include "precompiled.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/threadLocalAllocBuffer.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "utilities/copy.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
-# include "incls/_precompiled.incl"
-# include "incls/_threadLocalAllocBuffer.cpp.incl"
+// Thread-Local Edens support
 
 // static member initialization
 unsigned         ThreadLocalAllocBuffer::_target_refills = 0;
--- a/src/share/vm/memory/threadLocalAllocBuffer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/threadLocalAllocBuffer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_THREADLOCALALLOCBUFFER_HPP
+#define SHARE_VM_MEMORY_THREADLOCALALLOCBUFFER_HPP
+
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "runtime/perfData.hpp"
+
 class GlobalTLABStats;
 
 // ThreadLocalAllocBuffer: a descriptor for thread-local storage used by
@@ -255,3 +262,5 @@
     _max_slow_allocations    = MAX2(_max_slow_allocations, value);
   }
 };
+
+#endif // SHARE_VM_MEMORY_THREADLOCALALLOCBUFFER_HPP
--- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_THREADLOCALALLOCBUFFER_INLINE_HPP
+#define SHARE_VM_MEMORY_THREADLOCALALLOCBUFFER_INLINE_HPP
+
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/threadLocalAllocBuffer.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/copy.hpp"
+
 inline HeapWord* ThreadLocalAllocBuffer::allocate(size_t size) {
   invariants();
   HeapWord* obj = top();
@@ -93,3 +102,5 @@
                         obj_size, free(), refill_waste_limit());
   }
 }
+
+#endif // SHARE_VM_MEMORY_THREADLOCALALLOCBUFFER_INLINE_HPP
--- a/src/share/vm/memory/universe.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/universe.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,80 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_universe.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
+#include "code/dependencies.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/filemap.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genRemSet.hpp"
+#include "memory/generation.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/permGen.hpp"
+#include "memory/space.hpp"
+#include "memory/universe.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/arrayKlassKlass.hpp"
+#include "oops/compiledICHolderKlass.hpp"
+#include "oops/constMethodKlass.hpp"
+#include "oops/constantPoolKlass.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/cpCacheKlass.hpp"
+#include "oops/cpCacheOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceKlassKlass.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/klassKlass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodDataKlass.hpp"
+#include "oops/methodKlass.hpp"
+#include "oops/objArrayKlassKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolKlass.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "oops/typeArrayKlassKlass.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/aprofiler.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/events.hpp"
+#include "utilities/hashtable.inline.hpp"
+#include "utilities/preserveException.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#endif
 
 // Known objects
 klassOop Universe::_boolArrayKlassObj                 = NULL;
@@ -864,7 +936,8 @@
     // compressed oops for pstack code.
     if (PrintCompressedOopsMode) {
       tty->cr();
-      tty->print("heap address: "PTR_FORMAT, Universe::heap()->base());
+      tty->print("heap address: " PTR_FORMAT ", size: " SIZE_FORMAT " MB",
+                 Universe::heap()->base(), Universe::heap()->reserved_region().byte_size()/M);
     }
     if ((uint64_t)Universe::heap()->reserved_region().end() > OopEncodingHeapMax) {
       // Can't reserve heap below 32Gb.
@@ -945,6 +1018,7 @@
 extern void initialize_converter_functions();
 
 bool universe_post_init() {
+  assert(!is_init_completed(), "Error: initialization not yet completed!");
   Universe::_fully_initialized = true;
   EXCEPTION_MARK;
   { ResourceMark rm;
--- a/src/share/vm/memory/universe.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/universe.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_UNIVERSE_HPP
+#define SHARE_VM_MEMORY_UNIVERSE_HPP
+
+#include "runtime/handles.hpp"
+#include "utilities/growableArray.hpp"
+
 // Universe is a name space holding known system classes and objects in the VM.
 //
 // Loaded classes are accessible through the SystemDictionary.
@@ -461,3 +467,5 @@
     size_t bytesize() { return _bytesize; }
     oop    get_oop()  { return _oop; }
 };
+
+#endif // SHARE_VM_MEMORY_UNIVERSE_HPP
--- a/src/share/vm/memory/universe.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/universe.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP
+#define SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP
+
+#include "memory/universe.hpp"
+
 // Check whether an element of a typeArrayOop with the given type must be
 // aligned 0 mod 8.  The typeArrayOop itself must be aligned at least this
 // strongly.
@@ -35,3 +40,5 @@
 inline bool Universe::field_type_should_be_aligned(BasicType type) {
   return type == T_DOUBLE || type == T_LONG;
 }
+
+#endif // SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP
--- a/src/share/vm/memory/watermark.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/memory/watermark.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_MEMORY_WATERMARK_HPP
+#define SHARE_VM_MEMORY_WATERMARK_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // A water mark points into a space and is used during GC to keep track of
 // progress.
 
@@ -51,3 +57,5 @@
 inline bool operator!=(const WaterMark& x, const WaterMark& y) {
   return !(x == y);
 }
+
+#endif // SHARE_VM_MEMORY_WATERMARK_HPP
--- a/src/share/vm/oops/arrayKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/arrayKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_arrayKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "jvmtifiles/jvmti.h"
+#include "memory/gcLocker.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/arrayKlass.hpp"
+#include "oops/arrayKlassKlass.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 
 int arrayKlass::object_size(int header_size) const {
   // size of an array klass object
--- a/src/share/vm/oops/arrayKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/arrayKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_ARRAYKLASS_HPP
+#define SHARE_VM_OOPS_ARRAYKLASS_HPP
+
+#include "memory/universe.hpp"
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/klassVtable.hpp"
+
 // arrayKlass is the abstract baseclass for all array classes
 
 class arrayKlass: public Klass {
@@ -127,3 +135,5 @@
   // Verification
   void oop_verify_on(oop obj, outputStream* st);
 };
+
+#endif // SHARE_VM_OOPS_ARRAYKLASS_HPP
--- a/src/share/vm/oops/arrayKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/arrayKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_arrayKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "oops/arrayKlassKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 
 
 klassOop arrayKlassKlass::create_klass(TRAPS) {
--- a/src/share/vm/oops/arrayKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/arrayKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_ARRAYKLASSKLASS_HPP
+#define SHARE_VM_OOPS_ARRAYKLASSKLASS_HPP
+
+#include "oops/arrayKlass.hpp"
+#include "oops/klassKlass.hpp"
+
 // arrayKlassKlass is the abstract baseclass for all array class classes
 
 class arrayKlassKlass : public klassKlass {
@@ -63,3 +69,5 @@
   const char* internal_name() const;
   void oop_verify_on(oop obj, outputStream* st);
 };
+
+#endif // SHARE_VM_OOPS_ARRAYKLASSKLASS_HPP
--- a/src/share/vm/oops/arrayOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/arrayOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_arrayOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
 
 // <<this page is intentionally left blank>>
--- a/src/share/vm/oops/arrayOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/arrayOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_ARRAYOOP_HPP
+#define SHARE_VM_OOPS_ARRAYOOP_HPP
+
+#include "memory/universe.inline.hpp"
+#include "oops/oop.hpp"
+
 // arrayOopDesc is the abstract baseclass for all arrays.  It doesn't
 // declare pure virtual to enforce this because that would allocate a vtbl
 // in each instance, which we don't want.
@@ -113,3 +119,5 @@
     return max_element_words / words_per_element;
   }
 };
+
+#endif // SHARE_VM_OOPS_ARRAYOOP_HPP
--- a/src/share/vm/oops/compiledICHolderKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/compiledICHolderKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_compiledICHolderKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/permGen.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/compiledICHolderKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/handles.inline.hpp"
+#ifndef SERIALGC
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 klassOop compiledICHolderKlass::create_klass(TRAPS) {
   compiledICHolderKlass o;
--- a/src/share/vm/oops/compiledICHolderKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/compiledICHolderKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_COMPILEDICHOLDERKLASS_HPP
+#define SHARE_VM_OOPS_COMPILEDICHOLDERKLASS_HPP
+
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/klass.hpp"
+#include "oops/methodOop.hpp"
+
 class CMSIsAliveClosure;
 
 // a compiledICHolderKlass is the klass of a compiledICHolderOop
@@ -77,3 +84,5 @@
   void oop_verify_on(oop obj, outputStream* st);
 
 };
+
+#endif // SHARE_VM_OOPS_COMPILEDICHOLDERKLASS_HPP
--- a/src/share/vm/oops/compiledICHolderOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/compiledICHolderOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_compiledICHolderOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/compiledICHolderOop.hpp"
 
 // <<this page is intentionally left blank>>
--- a/src/share/vm/oops/compiledICHolderOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/compiledICHolderOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
+#define SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
+
+#include "oops/oop.hpp"
+
 // A compiledICHolderOop is a helper object for the inline cache implementation.
 // It holds an intermediate value (method+klass pair) used when converting from
 // compiled to an interpreted call.
@@ -54,3 +59,5 @@
   oop* adr_holder_method() const      { return (oop*)&_holder_method; }
   oop* adr_holder_klass() const       { return (oop*)&_holder_klass; }
 };
+
+#endif // SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
--- a/src/share/vm/oops/constMethodKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constMethodKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_constMethodKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/constMethodKlass.hpp"
+#include "oops/constMethodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/handles.inline.hpp"
 
 
 klassOop constMethodKlass::create_klass(TRAPS) {
--- a/src/share/vm/oops/constMethodKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constMethodKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_CONSTMETHODKLASS_HPP
+#define SHARE_VM_OOPS_CONSTMETHODKLASS_HPP
+
+#include "oops/klass.hpp"
+#include "oops/oop.hpp"
+#include "runtime/orderAccess.hpp"
+
 // A constMethodKlass is the klass of a constMethodOop
 
 class constMethodKlass : public Klass {
@@ -87,3 +94,5 @@
   bool oop_partially_loaded(oop obj) const;
   void oop_set_partially_loaded(oop obj);
 };
+
+#endif // SHARE_VM_OOPS_CONSTMETHODKLASS_HPP
--- a/src/share/vm/oops/constMethodOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constMethodOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_constMethodOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/constMethodOop.hpp"
+#include "oops/methodOop.hpp"
 
 // Static initialization
 const u2 constMethodOopDesc::MAX_IDNUM   = 0xFFFE;
--- a/src/share/vm/oops/constMethodOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constMethodOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_CONSTMETHODOOP_HPP
+#define SHARE_VM_OOPS_CONSTMETHODOOP_HPP
+
+#include "oops/oop.hpp"
+#include "oops/typeArrayOop.hpp"
+
 // An constMethodOop represents portions of a Java method which
 // do not vary.
 //
@@ -301,3 +307,5 @@
   u2* last_u2_element() const
                                          { return (u2*)constMethod_end() - 1; }
 };
+
+#endif // SHARE_VM_OOPS_CONSTMETHODOOP_HPP
--- a/src/share/vm/oops/constantPoolKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constantPoolKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,35 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_constantPoolKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/permGen.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/constantPoolKlass.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.inline.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/parNew/parOopClosures.inline.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "memory/cardTableRS.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 constantPoolOop constantPoolKlass::allocate(int length, bool is_conc_safe, TRAPS) {
   int size = constantPoolOopDesc::object_size(length);
@@ -372,6 +399,7 @@
       case JVM_CONSTANT_MethodType :
         st->print("signature_index=%d", cp->method_type_index_at(index));
         break;
+      case JVM_CONSTANT_InvokeDynamicTrans :
       case JVM_CONSTANT_InvokeDynamic :
         {
           st->print("bootstrap_method_index=%d", cp->invoke_dynamic_bootstrap_method_ref_index_at(index));
--- a/src/share/vm/oops/constantPoolKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constantPoolKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_CONSTANTPOOLKLASS_HPP
+#define SHARE_VM_OOPS_CONSTANTPOOLKLASS_HPP
+
+#include "oops/arrayKlass.hpp"
+#include "oops/instanceKlass.hpp"
+
 // A constantPoolKlass is the klass of a constantPoolOop
 
 class constantPoolKlass : public Klass {
@@ -79,3 +85,5 @@
   static void preload_and_initialize_all_classes(oop constant_pool, TRAPS);
 #endif
 };
+
+#endif // SHARE_VM_OOPS_CONSTANTPOOLKLASS_HPP
--- a/src/share/vm/oops/constantPoolOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constantPoolOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_constantPoolOop.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/fieldType.hpp"
+#include "runtime/init.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframe.hpp"
 
 void constantPoolOopDesc::set_flag_at(FlagBit fb) {
   const int MAX_STATE_CHANGES = 2;
@@ -901,7 +915,8 @@
   {
     int k1 = method_type_index_at(index1);
     int k2 = cp2->method_type_index_at(index2);
-    if (k1 == k2) {
+    bool match = compare_entry_to(k1, cp2, k2, CHECK_false);
+    if (match) {
       return true;
     }
   } break;
@@ -913,28 +928,33 @@
     if (k1 == k2) {
       int i1 = method_handle_index_at(index1);
       int i2 = cp2->method_handle_index_at(index2);
-      if (i1 == i2) {
+      bool match = compare_entry_to(i1, cp2, i2, CHECK_false);
+      if (match) {
         return true;
       }
     }
   } break;
 
   case JVM_CONSTANT_InvokeDynamic:
+  case JVM_CONSTANT_InvokeDynamicTrans:
   {
-    int op_count = multi_operand_count_at(index1);
-    if (op_count == cp2->multi_operand_count_at(index2)) {
-      bool all_equal = true;
-      for (int op_i = 0; op_i < op_count; op_i++) {
-        int k1 = multi_operand_ref_at(index1, op_i);
-        int k2 = cp2->multi_operand_ref_at(index2, op_i);
-        if (k1 != k2) {
-          all_equal = false;
-          break;
-        }
+    int k1 = invoke_dynamic_bootstrap_method_ref_index_at(index1);
+    int k2 = cp2->invoke_dynamic_bootstrap_method_ref_index_at(index2);
+    bool match = compare_entry_to(k1, cp2, k2, CHECK_false);
+    if (!match)  return false;
+    k1 = invoke_dynamic_name_and_type_ref_index_at(index1);
+    k2 = cp2->invoke_dynamic_name_and_type_ref_index_at(index2);
+    match = compare_entry_to(k1, cp2, k2, CHECK_false);
+    if (!match)  return false;
+    int argc = invoke_dynamic_argument_count_at(index1);
+    if (argc == cp2->invoke_dynamic_argument_count_at(index2)) {
+      for (int j = 0; j < argc; j++) {
+        k1 = invoke_dynamic_argument_index_at(index1, j);
+        k2 = cp2->invoke_dynamic_argument_index_at(index2, j);
+        match = compare_entry_to(k1, cp2, k2, CHECK_false);
+        if (!match)  return false;
       }
-      if (all_equal) {
-        return true;           // got through loop; all elements equal
-      }
+      return true;           // got through loop; all elements equal
     }
   } break;
 
@@ -970,44 +990,18 @@
 } // end compare_entry_to()
 
 
-// Grow this->operands() to the indicated length, unless it is already at least that long.
-void constantPoolOopDesc::multi_operand_buffer_grow(int min_length, TRAPS) {
-  int old_length = multi_operand_buffer_fill_pointer();
-  if (old_length >= min_length)  return;
-  int new_length = min_length;
-  assert(new_length > _multi_operand_buffer_fill_pointer_offset, "");
-  typeArrayHandle new_operands = oopFactory::new_permanent_intArray(new_length, CHECK);
-  if (operands() == NULL) {
-    new_operands->int_at_put(_multi_operand_buffer_fill_pointer_offset, old_length);
-  } else {
-    // copy fill pointer and everything else
-    for (int i = 0; i < old_length; i++) {
-      new_operands->int_at_put(i, operands()->int_at(i));
-    }
-  }
-  set_operands(new_operands());
-}
-
-
 // Copy this constant pool's entries at start_i to end_i (inclusive)
 // to the constant pool to_cp's entries starting at to_i. A total of
 // (end_i - start_i) + 1 entries are copied.
-void constantPoolOopDesc::copy_cp_to(int start_i, int end_i,
+void constantPoolOopDesc::copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int end_i,
        constantPoolHandle to_cp, int to_i, TRAPS) {
 
   int dest_i = to_i;  // leave original alone for debug purposes
 
-  if (operands() != NULL) {
-    // pre-grow the target CP's operand buffer
-    int nops = this->multi_operand_buffer_fill_pointer();
-    nops   += to_cp->multi_operand_buffer_fill_pointer();
-    to_cp->multi_operand_buffer_grow(nops, CHECK);
-  }
+  for (int src_i = start_i; src_i <= end_i; /* see loop bottom */ ) {
+    copy_entry_to(from_cp, src_i, to_cp, dest_i, CHECK);
 
-  for (int src_i = start_i; src_i <= end_i; /* see loop bottom */ ) {
-    copy_entry_to(src_i, to_cp, dest_i, CHECK);
-
-    switch (tag_at(src_i).value()) {
+    switch (from_cp->tag_at(src_i).value()) {
     case JVM_CONSTANT_Double:
     case JVM_CONSTANT_Long:
       // double and long take two constant pool entries
@@ -1022,30 +1016,81 @@
       break;
     }
   }
+
+  int from_oplen = operand_array_length(from_cp->operands());
+  int old_oplen  = operand_array_length(to_cp->operands());
+  if (from_oplen != 0) {
+    // append my operands to the target's operands array
+    if (old_oplen == 0) {
+      to_cp->set_operands(from_cp->operands());  // reuse; do not merge
+    } else {
+      int old_len  = to_cp->operands()->length();
+      int from_len = from_cp->operands()->length();
+      int old_off  = old_oplen * sizeof(u2);
+      int from_off = from_oplen * sizeof(u2);
+      typeArrayHandle new_operands = oopFactory::new_permanent_shortArray(old_len + from_len, CHECK);
+      int fillp = 0, len = 0;
+      // first part of dest
+      Copy::conjoint_memory_atomic(to_cp->operands()->short_at_addr(0),
+                                   new_operands->short_at_addr(fillp),
+                                   (len = old_off) * sizeof(u2));
+      fillp += len;
+      // first part of src
+      Copy::conjoint_memory_atomic(to_cp->operands()->short_at_addr(0),
+                                   new_operands->short_at_addr(fillp),
+                                   (len = from_off) * sizeof(u2));
+      fillp += len;
+      // second part of dest
+      Copy::conjoint_memory_atomic(to_cp->operands()->short_at_addr(old_off),
+                                   new_operands->short_at_addr(fillp),
+                                   (len = old_len - old_off) * sizeof(u2));
+      fillp += len;
+      // second part of src
+      Copy::conjoint_memory_atomic(to_cp->operands()->short_at_addr(from_off),
+                                   new_operands->short_at_addr(fillp),
+                                   (len = from_len - from_off) * sizeof(u2));
+      fillp += len;
+      assert(fillp == new_operands->length(), "");
+
+      // Adjust indexes in the first part of the copied operands array.
+      for (int j = 0; j < from_oplen; j++) {
+        int offset = operand_offset_at(new_operands(), old_oplen + j);
+        assert(offset == operand_offset_at(from_cp->operands(), j), "correct copy");
+        offset += old_len;  // every new tuple is preceded by old_len extra u2's
+        operand_offset_at_put(new_operands(), old_oplen + j, offset);
+      }
+
+      // replace target operands array with combined array
+      to_cp->set_operands(new_operands());
+    }
+  }
+
 } // end copy_cp_to()
 
 
 // Copy this constant pool's entry at from_i to the constant pool
 // to_cp's entry at to_i.
-void constantPoolOopDesc::copy_entry_to(int from_i, constantPoolHandle to_cp,
-       int to_i, TRAPS) {
+void constantPoolOopDesc::copy_entry_to(constantPoolHandle from_cp, int from_i,
+                                        constantPoolHandle to_cp, int to_i,
+                                        TRAPS) {
 
-  switch (tag_at(from_i).value()) {
+  int tag = from_cp->tag_at(from_i).value();
+  switch (tag) {
   case JVM_CONSTANT_Class:
   {
-    klassOop k = klass_at(from_i, CHECK);
+    klassOop k = from_cp->klass_at(from_i, CHECK);
     to_cp->klass_at_put(to_i, k);
   } break;
 
   case JVM_CONSTANT_ClassIndex:
   {
-    jint ki = klass_index_at(from_i);
+    jint ki = from_cp->klass_index_at(from_i);
     to_cp->klass_index_at_put(to_i, ki);
   } break;
 
   case JVM_CONSTANT_Double:
   {
-    jdouble d = double_at(from_i);
+    jdouble d = from_cp->double_at(from_i);
     to_cp->double_at_put(to_i, d);
     // double takes two constant pool entries so init second entry's tag
     to_cp->tag_at_put(to_i + 1, JVM_CONSTANT_Invalid);
@@ -1053,33 +1098,33 @@
 
   case JVM_CONSTANT_Fieldref:
   {
-    int class_index = uncached_klass_ref_index_at(from_i);
-    int name_and_type_index = uncached_name_and_type_ref_index_at(from_i);
+    int class_index = from_cp->uncached_klass_ref_index_at(from_i);
+    int name_and_type_index = from_cp->uncached_name_and_type_ref_index_at(from_i);
     to_cp->field_at_put(to_i, class_index, name_and_type_index);
   } break;
 
   case JVM_CONSTANT_Float:
   {
-    jfloat f = float_at(from_i);
+    jfloat f = from_cp->float_at(from_i);
     to_cp->float_at_put(to_i, f);
   } break;
 
   case JVM_CONSTANT_Integer:
   {
-    jint i = int_at(from_i);
+    jint i = from_cp->int_at(from_i);
     to_cp->int_at_put(to_i, i);
   } break;
 
   case JVM_CONSTANT_InterfaceMethodref:
   {
-    int class_index = uncached_klass_ref_index_at(from_i);
-    int name_and_type_index = uncached_name_and_type_ref_index_at(from_i);
+    int class_index = from_cp->uncached_klass_ref_index_at(from_i);
+    int name_and_type_index = from_cp->uncached_name_and_type_ref_index_at(from_i);
     to_cp->interface_method_at_put(to_i, class_index, name_and_type_index);
   } break;
 
   case JVM_CONSTANT_Long:
   {
-    jlong l = long_at(from_i);
+    jlong l = from_cp->long_at(from_i);
     to_cp->long_at_put(to_i, l);
     // long takes two constant pool entries so init second entry's tag
     to_cp->tag_at_put(to_i + 1, JVM_CONSTANT_Invalid);
@@ -1087,39 +1132,39 @@
 
   case JVM_CONSTANT_Methodref:
   {
-    int class_index = uncached_klass_ref_index_at(from_i);
-    int name_and_type_index = uncached_name_and_type_ref_index_at(from_i);
+    int class_index = from_cp->uncached_klass_ref_index_at(from_i);
+    int name_and_type_index = from_cp->uncached_name_and_type_ref_index_at(from_i);
     to_cp->method_at_put(to_i, class_index, name_and_type_index);
   } break;
 
   case JVM_CONSTANT_NameAndType:
   {
-    int name_ref_index = name_ref_index_at(from_i);
-    int signature_ref_index = signature_ref_index_at(from_i);
+    int name_ref_index = from_cp->name_ref_index_at(from_i);
+    int signature_ref_index = from_cp->signature_ref_index_at(from_i);
     to_cp->name_and_type_at_put(to_i, name_ref_index, signature_ref_index);
   } break;
 
   case JVM_CONSTANT_String:
   {
-    oop s = string_at(from_i, CHECK);
+    oop s = from_cp->string_at(from_i, CHECK);
     to_cp->string_at_put(to_i, s);
   } break;
 
   case JVM_CONSTANT_StringIndex:
   {
-    jint si = string_index_at(from_i);
+    jint si = from_cp->string_index_at(from_i);
     to_cp->string_index_at_put(to_i, si);
   } break;
 
   case JVM_CONSTANT_UnresolvedClass:
   {
-    symbolOop k = unresolved_klass_at(from_i);
+    symbolOop k = from_cp->unresolved_klass_at(from_i);
     to_cp->unresolved_klass_at_put(to_i, k);
   } break;
 
   case JVM_CONSTANT_UnresolvedClassInError:
   {
-    symbolOop k = unresolved_klass_at(from_i);
+    symbolOop k = from_cp->unresolved_klass_at(from_i);
     to_cp->unresolved_klass_at_put(to_i, k);
     to_cp->tag_at_put(to_i, JVM_CONSTANT_UnresolvedClassInError);
   } break;
@@ -1127,51 +1172,42 @@
 
   case JVM_CONSTANT_UnresolvedString:
   {
-    symbolOop s = unresolved_string_at(from_i);
+    symbolOop s = from_cp->unresolved_string_at(from_i);
     to_cp->unresolved_string_at_put(to_i, s);
   } break;
 
   case JVM_CONSTANT_Utf8:
   {
-    symbolOop s = symbol_at(from_i);
+    symbolOop s = from_cp->symbol_at(from_i);
     to_cp->symbol_at_put(to_i, s);
   } break;
 
   case JVM_CONSTANT_MethodType:
   {
-    jint k = method_type_index_at(from_i);
+    jint k = from_cp->method_type_index_at(from_i);
     to_cp->method_type_index_at_put(to_i, k);
   } break;
 
   case JVM_CONSTANT_MethodHandle:
   {
-    int k1 = method_handle_ref_kind_at(from_i);
-    int k2 = method_handle_index_at(from_i);
+    int k1 = from_cp->method_handle_ref_kind_at(from_i);
+    int k2 = from_cp->method_handle_index_at(from_i);
     to_cp->method_handle_index_at_put(to_i, k1, k2);
   } break;
 
+  case JVM_CONSTANT_InvokeDynamicTrans:
+  {
+    int k1 = from_cp->invoke_dynamic_bootstrap_method_ref_index_at(from_i);
+    int k2 = from_cp->invoke_dynamic_name_and_type_ref_index_at(from_i);
+    to_cp->invoke_dynamic_trans_at_put(to_i, k1, k2);
+  } break;
+
   case JVM_CONSTANT_InvokeDynamic:
   {
-    int op_count = multi_operand_count_at(from_i);
-    int fillp = to_cp->multi_operand_buffer_fill_pointer();
-    int to_op_base = fillp - _multi_operand_count_offset;  // fillp is count offset; get to base
-    to_cp->multi_operand_buffer_grow(to_op_base + op_count, CHECK);
-    to_cp->operands()->int_at_put(fillp++, op_count);
-    assert(fillp == to_op_base + _multi_operand_base_offset, "just wrote count, will now write args");
-    for (int op_i = 0; op_i < op_count; op_i++) {
-      int op = multi_operand_ref_at(from_i, op_i);
-      to_cp->operands()->int_at_put(fillp++, op);
-    }
-    assert(fillp <= to_cp->operands()->length(), "oob");
-    to_cp->set_multi_operand_buffer_fill_pointer(fillp);
-    to_cp->invoke_dynamic_at_put(to_i, to_op_base, op_count);
-#ifdef ASSERT
-    int k1 = invoke_dynamic_bootstrap_method_ref_index_at(from_i);
-    int k2 = invoke_dynamic_name_and_type_ref_index_at(from_i);
-    int k3 = invoke_dynamic_argument_count_at(from_i);
-    assert(to_cp->check_invoke_dynamic_at(to_i, k1, k2, k3),
-           "indy structure is OK");
-#endif //ASSERT
+    int k1 = from_cp->invoke_dynamic_bootstrap_specifier_index(from_i);
+    int k2 = from_cp->invoke_dynamic_name_and_type_ref_index_at(from_i);
+    k1 += operand_array_length(to_cp->operands());  // to_cp might already have operands
+    to_cp->invoke_dynamic_at_put(to_i, k1, k2);
   } break;
 
   // Invalid is used as the tag for the second constant pool entry
@@ -1181,7 +1217,6 @@
 
   default:
   {
-    jbyte bad_value = tag_at(from_i).value(); // leave a breadcrumb
     ShouldNotReachHere();
   } break;
   }
@@ -1392,8 +1427,9 @@
       return 5;
 
     case JVM_CONSTANT_InvokeDynamic:
-      // u1 tag, u2 bsm, u2 nt, u2 argc, u2 argv[argc]
-      return 7 + 2 * invoke_dynamic_argument_count_at(idx);
+    case JVM_CONSTANT_InvokeDynamicTrans:
+      // u1 tag, u2 bsm, u2 nt
+      return 5;
 
     case JVM_CONSTANT_Long:
     case JVM_CONSTANT_Double:
@@ -1606,19 +1642,15 @@
         DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1));
         break;
       }
+      case JVM_CONSTANT_InvokeDynamicTrans:
       case JVM_CONSTANT_InvokeDynamic: {
-        *bytes = JVM_CONSTANT_InvokeDynamic;
-        idx1 = invoke_dynamic_bootstrap_method_ref_index_at(idx);
-        idx2 = invoke_dynamic_name_and_type_ref_index_at(idx);
-        int argc = invoke_dynamic_argument_count_at(idx);
+        *bytes = tag;
+        idx1 = extract_low_short_from_int(*int_at_addr(idx));
+        idx2 = extract_high_short_from_int(*int_at_addr(idx));
+        assert(idx2 == invoke_dynamic_name_and_type_ref_index_at(idx), "correct half of u4");
         Bytes::put_Java_u2((address) (bytes+1), idx1);
         Bytes::put_Java_u2((address) (bytes+3), idx2);
-        Bytes::put_Java_u2((address) (bytes+5), argc);
-        for (int arg_i = 0; arg_i < argc; arg_i++) {
-          int arg = invoke_dynamic_argument_index_at(idx, arg_i);
-          Bytes::put_Java_u2((address) (bytes+7+2*arg_i), arg);
-        }
-        DBG(printf("JVM_CONSTANT_InvokeDynamic: %hd %hd [%d]", idx1, idx2, argc));
+        DBG(printf("JVM_CONSTANT_InvokeDynamic: %hd %hd", idx1, idx2));
         break;
       }
     }
--- a/src/share/vm/oops/constantPoolOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/constantPoolOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,23 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_CONSTANTPOOLOOP_HPP
+#define SHARE_VM_OOPS_CONSTANTPOOLOOP_HPP
+
+#include "oops/arrayOop.hpp"
+#include "oops/cpCacheOop.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "utilities/constantTag.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 // A constantPool is an array containing class constants as described in the
 // class file.
 //
@@ -162,28 +179,16 @@
     *int_at_addr(which) = ref_index;
   }
 
-  void invoke_dynamic_at_put(int which, int operand_base, int operand_count) {
+  void invoke_dynamic_at_put(int which, int bootstrap_specifier_index, int name_and_type_index) {
     tag_at_put(which, JVM_CONSTANT_InvokeDynamic);
-    *int_at_addr(which) = operand_base;  // this is the real information
+    *int_at_addr(which) = ((jint) name_and_type_index<<16) | bootstrap_specifier_index;
   }
-#ifdef ASSERT
-  bool check_invoke_dynamic_at(int which,
-                               int bootstrap_method_index,
-                               int name_and_type_index,
-                               int argument_count) {
-    assert(invoke_dynamic_bootstrap_method_ref_index_at(which) == bootstrap_method_index,
-           "already stored by caller");
-    assert(invoke_dynamic_name_and_type_ref_index_at(which) == name_and_type_index,
-           "already stored by caller");
-    assert(invoke_dynamic_argument_count_at(which) == argument_count,
-           "consistent argument count");
-    if (argument_count != 0) {
-      invoke_dynamic_argument_index_at(which, 0);
-      invoke_dynamic_argument_index_at(which, argument_count - 1);
-    }
-    return true;
+
+  void invoke_dynamic_trans_at_put(int which, int bootstrap_method_index, int name_and_type_index) {
+    tag_at_put(which, JVM_CONSTANT_InvokeDynamicTrans);
+    *int_at_addr(which) = ((jint) name_and_type_index<<16) | bootstrap_method_index;
+    assert(AllowTransitionalJSR292, "");
   }
-#endif //ASSERT
 
   // Temporary until actual use
   void unresolved_string_at_put(int which, symbolOop s) {
@@ -426,75 +431,90 @@
     return symbol_at(sym);
   }
 
- private:
-  // some nodes (InvokeDynamic) have a variable number of operands, each a u2 value
-  enum { _multi_operand_count_offset = -1,
-         _multi_operand_base_offset  = 0,
-         _multi_operand_buffer_fill_pointer_offset = 0  // shared at front of operands array
-  };
-  int multi_operand_buffer_length() {
-    return operands() == NULL ? 0 : operands()->length();
-  }
-  int multi_operand_buffer_fill_pointer() {
-    return operands() == NULL
-      ? _multi_operand_buffer_fill_pointer_offset + 1
-      : operands()->int_at(_multi_operand_buffer_fill_pointer_offset);
-  }
-  void multi_operand_buffer_grow(int min_length, TRAPS);
-  void set_multi_operand_buffer_fill_pointer(int fillp) {
-    assert(operands() != NULL, "");
-    operands()->int_at_put(_multi_operand_buffer_fill_pointer_offset, fillp);
-  }
-  int multi_operand_base_at(int which) {
+  int invoke_dynamic_name_and_type_ref_index_at(int which) {
     assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
-    int op_base = *int_at_addr(which);
-    assert(op_base > _multi_operand_buffer_fill_pointer_offset, "Corrupted operand base");
-    return op_base;
+    return extract_high_short_from_int(*int_at_addr(which));
   }
-  int multi_operand_count_at(int which) {
-    int op_base = multi_operand_base_at(which);
-    assert((uint)(op_base + _multi_operand_count_offset) < (uint)operands()->length(), "oob");
-    int count = operands()->int_at(op_base + _multi_operand_count_offset);
-    return count;
+  int invoke_dynamic_bootstrap_specifier_index(int which) {
+    assert(tag_at(which).value() == JVM_CONSTANT_InvokeDynamic, "Corrupted constant pool");
+    return extract_low_short_from_int(*int_at_addr(which));
+  }
+  int invoke_dynamic_operand_base(int which) {
+    int bootstrap_specifier_index = invoke_dynamic_bootstrap_specifier_index(which);
+    return operand_offset_at(operands(), bootstrap_specifier_index);
   }
-  int multi_operand_ref_at(int which, int i) {
-    int op_base = multi_operand_base_at(which);
-    assert((uint)i < (uint)multi_operand_count_at(which), "oob");
-    assert((uint)(op_base + _multi_operand_base_offset + i) < (uint)operands()->length(), "oob");
-    return operands()->int_at(op_base + _multi_operand_base_offset + i);
+  // The first part of the operands array consists of an index into the second part.
+  // Extract a 32-bit index value from the first part.
+  static int operand_offset_at(typeArrayOop operands, int bootstrap_specifier_index) {
+    int n = (bootstrap_specifier_index * 2);
+    assert(n >= 0 && n+2 <= operands->length(), "oob");
+    // The first 32-bit index points to the beginning of the second part
+    // of the operands array.  Make sure this index is in the first part.
+    DEBUG_ONLY(int second_part = build_int_from_shorts(operands->short_at(0),
+                                                       operands->short_at(1)));
+    assert(second_part == 0 || n+2 <= second_part, "oob (2)");
+    int offset = build_int_from_shorts(operands->short_at(n+0),
+                                       operands->short_at(n+1));
+    // The offset itself must point into the second part of the array.
+    assert(offset == 0 || offset >= second_part && offset <= operands->length(), "oob (3)");
+    return offset;
   }
-  void set_multi_operand_ref_at(int which, int i, int ref) {
-    DEBUG_ONLY(multi_operand_ref_at(which, i));  // trigger asserts
-    int op_base = multi_operand_base_at(which);
-    operands()->int_at_put(op_base + _multi_operand_base_offset + i, ref);
+  static void operand_offset_at_put(typeArrayOop operands, int bootstrap_specifier_index, int offset) {
+    int n = bootstrap_specifier_index * 2;
+    assert(n >= 0 && n+2 <= operands->length(), "oob");
+    operands->short_at_put(n+0, extract_low_short_from_int(offset));
+    operands->short_at_put(n+1, extract_high_short_from_int(offset));
+  }
+  static int operand_array_length(typeArrayOop operands) {
+    if (operands == NULL || operands->length() == 0)  return 0;
+    int second_part = operand_offset_at(operands, 0);
+    return (second_part / 2);
   }
 
- public:
-  // layout of InvokeDynamic:
+#ifdef ASSERT
+  // operand tuples fit together exactly, end to end
+  static int operand_limit_at(typeArrayOop operands, int bootstrap_specifier_index) {
+    int nextidx = bootstrap_specifier_index + 1;
+    if (nextidx == operand_array_length(operands))
+      return operands->length();
+    else
+      return operand_offset_at(operands, nextidx);
+  }
+  int invoke_dynamic_operand_limit(int which) {
+    int bootstrap_specifier_index = invoke_dynamic_bootstrap_specifier_index(which);
+    return operand_limit_at(operands(), bootstrap_specifier_index);
+  }
+#endif //ASSERT
+
+  // layout of InvokeDynamic bootstrap method specifier (in second part of operands array):
   enum {
          _indy_bsm_offset  = 0,  // CONSTANT_MethodHandle bsm
-         _indy_nt_offset   = 1,  // CONSTANT_NameAndType descr
-         _indy_argc_offset = 2,  // u2 argc
-         _indy_argv_offset = 3   // u2 argv[argc]
+         _indy_argc_offset = 1,  // u2 argc
+         _indy_argv_offset = 2   // u2 argv[argc]
   };
   int invoke_dynamic_bootstrap_method_ref_index_at(int which) {
     assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
-    return multi_operand_ref_at(which, _indy_bsm_offset);
-  }
-  int invoke_dynamic_name_and_type_ref_index_at(int which) {
-    assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
-    return multi_operand_ref_at(which, _indy_nt_offset);
+    if (tag_at(which).value() == JVM_CONSTANT_InvokeDynamicTrans)
+      return extract_low_short_from_int(*int_at_addr(which));
+    int op_base = invoke_dynamic_operand_base(which);
+    return operands()->short_at(op_base + _indy_bsm_offset);
   }
   int invoke_dynamic_argument_count_at(int which) {
     assert(tag_at(which).is_invoke_dynamic(), "Corrupted constant pool");
-    int argc = multi_operand_ref_at(which, _indy_argc_offset);
-    DEBUG_ONLY(int op_count = multi_operand_count_at(which));
-    assert(_indy_argv_offset + argc == op_count, "consistent inner and outer counts");
+    if (tag_at(which).value() == JVM_CONSTANT_InvokeDynamicTrans)
+      return 0;
+    int op_base = invoke_dynamic_operand_base(which);
+    int argc = operands()->short_at(op_base + _indy_argc_offset);
+    DEBUG_ONLY(int end_offset = op_base + _indy_argv_offset + argc;
+               int next_offset = invoke_dynamic_operand_limit(which));
+    assert(end_offset == next_offset, "matched ending");
     return argc;
   }
   int invoke_dynamic_argument_index_at(int which, int j) {
-    assert((uint)j < (uint)invoke_dynamic_argument_count_at(which), "oob");
-    return multi_operand_ref_at(which, _indy_argv_offset + j);
+    int op_base = invoke_dynamic_operand_base(which);
+    DEBUG_ONLY(int argc = operands()->short_at(op_base + _indy_argc_offset));
+    assert((uint)j < (uint)argc, "oob");
+    return operands()->short_at(op_base + _indy_argv_offset + j);
   }
 
   // The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve,
@@ -642,9 +662,12 @@
  public:
   // Merging constantPoolOop support:
   bool compare_entry_to(int index1, constantPoolHandle cp2, int index2, TRAPS);
-  void copy_cp_to(int start_i, int end_i, constantPoolHandle to_cp, int to_i,
-    TRAPS);
-  void copy_entry_to(int from_i, constantPoolHandle to_cp, int to_i, TRAPS);
+  void copy_cp_to(int start_i, int end_i, constantPoolHandle to_cp, int to_i, TRAPS) {
+    constantPoolHandle h_this(THREAD, this);
+    copy_cp_to_impl(h_this, start_i, end_i, to_cp, to_i, THREAD);
+  }
+  static void copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int end_i, constantPoolHandle to_cp, int to_i, TRAPS);
+  static void copy_entry_to(constantPoolHandle from_cp, int from_i, constantPoolHandle to_cp, int to_i, TRAPS);
   int  find_matching_entry(int pattern_i, constantPoolHandle search_cp, TRAPS);
   int  orig_length() const                { return _orig_length; }
   void set_orig_length(int orig_length)   { _orig_length = orig_length; }
@@ -765,3 +788,5 @@
     delete _buckets;
   }
 }; // End SymbolHashMap class
+
+#endif // SHARE_VM_OOPS_CONSTANTPOOLOOP_HPP
--- a/src/share/vm/oops/cpCacheKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/cpCacheKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,24 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cpCacheKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/permGen.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/cpCacheKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parNew/parOopClosures.inline.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "memory/cardTableRS.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 
 int constantPoolCacheKlass::oop_size(oop obj) const {
--- a/src/share/vm/oops/cpCacheKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/cpCacheKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_CPCACHEKLASS_HPP
+#define SHARE_VM_OOPS_CPCACHEKLASS_HPP
+
+#include "oops/arrayKlass.hpp"
+#include "oops/cpCacheOop.hpp"
+#include "oops/instanceKlass.hpp"
+
 class constantPoolCacheKlass: public Klass {
   juint    _alloc_size;        // allocation profiling support
  public:
@@ -69,3 +76,5 @@
   const char* internal_name() const;
   void oop_verify_on(oop obj, outputStream* st);
 };
+
+#endif // SHARE_VM_OOPS_CPCACHEKLASS_HPP
--- a/src/share/vm/oops/cpCacheOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/cpCacheOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_cpCacheOop.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/rewriter.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/cpCacheOop.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/handles.inline.hpp"
 
 
 // Implememtation of ConstantPoolCacheEntry
--- a/src/share/vm/oops/cpCacheOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/cpCacheOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_CPCACHEOOP_HPP
+#define SHARE_VM_OOPS_CPCACHEOOP_HPP
+
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+#include "oops/arrayOop.hpp"
+#include "utilities/array.hpp"
+
 // A ConstantPoolCacheEntry describes an individual entry of the constant
 // pool cache. There's 2 principal kinds of entries: field entries for in-
 // stance & static field access, and method entries for invokes. Some of
@@ -406,3 +414,5 @@
   void adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
                              int methods_length, bool * trace_name_printed);
 };
+
+#endif // SHARE_VM_OOPS_CPCACHEOOP_HPP
--- a/src/share/vm/oops/generateOopMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/generateOopMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "oops/generateOopMap.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/relocator.hpp"
+#include "utilities/bitMap.inline.hpp"
+
 //
 //
 // Compute stack layouts for each instruction in method.
@@ -85,9 +95,6 @@
 //
 // (Note this comment is borrowed form the original author of the algorithm)
 
-#include "incls/_precompiled.incl"
-#include "incls/_generateOopMap.cpp.incl"
-
 // ComputeCallStack
 //
 // Specialization of SignatureIterator - compute the effects of a call
--- a/src/share/vm/oops/generateOopMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/generateOopMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_GENERATEOOPMAP_HPP
+#define SHARE_VM_OOPS_GENERATEOOPMAP_HPP
+
+#include "interpreter/bytecodeStream.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/signature.hpp"
+
 // Forward definition
 class MethodOopMap;
 class GenerateOopMap;
@@ -557,3 +567,5 @@
 
   // Call compute_map(CHECK) to generate info.
 };
+
+#endif // SHARE_VM_OOPS_GENERATEOOPMAP_HPP
--- a/src/share/vm/oops/instanceKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,56 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_instanceKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/verifier.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileBroker.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "interpreter/rewriter.hpp"
+#include "jvmtifiles/jvmti.h"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/permGen.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlassKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "services/threadService.hpp"
+#include "utilities/dtrace.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "gc_implementation/parNew/parOopClosures.inline.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Compiler.hpp"
+#endif
 
 #ifdef DTRACE_ENABLED
 
--- a/src/share/vm/oops/instanceKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_INSTANCEKLASS_HPP
+#define SHARE_VM_OOPS_INSTANCEKLASS_HPP
+
+#include "oops/constMethodOop.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/klassVtable.hpp"
+#include "oops/objArrayOop.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/os.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/bitMap.inline.hpp"
+
 // An instanceKlass is the VM level representation of a Java class.
 // It contains all information needed for at class at execution runtime.
 
@@ -1017,3 +1031,5 @@
   // of the klass. Returns NULL if there are no more previous versions.
   PreviousVersionInfo* next_previous_version();
 };
+
+#endif // SHARE_VM_OOPS_INSTANCEKLASS_HPP
--- a/src/share/vm/oops/instanceKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,32 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_instanceKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/gcLocker.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceKlassKlass.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/objArrayKlassKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/symbolOop.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parNew/parOopClosures.inline.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "memory/cardTableRS.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 klassOop instanceKlassKlass::create_klass(TRAPS) {
   instanceKlassKlass o;
--- a/src/share/vm/oops/instanceKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_INSTANCEKLASSKLASS_HPP
+#define SHARE_VM_OOPS_INSTANCEKLASSKLASS_HPP
+
+#include "oops/klassKlass.hpp"
+
 // An instanceKlassKlass is the klass of an instanceKlass
 
 class instanceKlassKlass : public klassKlass {
@@ -83,3 +88,5 @@
   bool oop_partially_loaded(oop obj) const;
   void oop_set_partially_loaded(oop obj);
 };
+
+#endif // SHARE_VM_OOPS_INSTANCEKLASSKLASS_HPP
--- a/src/share/vm/oops/instanceOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_instanceOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/instanceOop.hpp"
 
 // <<this page is intentionally left blank>>
--- a/src/share/vm/oops/instanceOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_INSTANCEOOP_HPP
+#define SHARE_VM_OOPS_INSTANCEOOP_HPP
+
+#include "oops/oop.hpp"
+
 // An instanceOop is an instance of a Java Class
 // Evaluating "new HashTable()" will create an instanceOop.
 
@@ -43,3 +48,5 @@
             (offset-base_in_bytes) < nonstatic_field_size * heapOopSize);
   }
 };
+
+#endif // SHARE_VM_OOPS_INSTANCEOOP_HPP
--- a/src/share/vm/oops/instanceRefKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceRefKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,27 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_instanceRefKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "oops/instanceRefKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "utilities/preserveException.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "gc_implementation/parNew/parOopClosures.inline.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 template <class T>
 static void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
@@ -438,6 +457,12 @@
   }
 }
 
+bool instanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
+  if (java_lang_ref_Reference::pending_list_lock() == NULL) return false;
+  Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock());
+  return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock);
+}
+
 void instanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) {
   // we may enter this with pending exception set
   PRESERVE_EXCEPTION_MARK;  // exceptions are never thrown, needed for TRAPS argument
--- a/src/share/vm/oops/instanceRefKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/instanceRefKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
+#define SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
+
+#include "oops/instanceKlass.hpp"
+
 // An instanceRefKlass is a specialized instanceKlass for Java
 // classes that are subclasses of java/lang/ref/Reference.
 //
@@ -84,6 +89,7 @@
 
   static void release_and_notify_pending_list_lock(BasicLock *pending_list_basic_lock);
   static void acquire_pending_list_lock(BasicLock *pending_list_basic_lock);
+  static bool owns_pending_list_lock(JavaThread* thread);
 
   // Update non-static oop maps so 'referent', 'nextPending' and
   // 'discovered' will look like non-oops
@@ -93,3 +99,5 @@
   // Verification
   void oop_verify_on(oop obj, outputStream* st);
 };
+
+#endif // SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
--- a/src/share/vm/oops/klass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_klass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klass.inline.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/atomic.hpp"
 
 
 bool Klass::is_subclass_of(klassOop k) const {
--- a/src/share/vm/oops/klass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,24 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_KLASS_HPP
+#define SHARE_VM_OOPS_KLASS_HPP
+
+#include "memory/genOopClosures.hpp"
+#include "memory/iterator.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/specialized_oop_closures.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/klassPS.hpp"
+#include "oops/oop.hpp"
+#include "runtime/orderAccess.hpp"
+#include "utilities/accessFlags.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
+#include "gc_implementation/g1/g1OopClosures.hpp"
+#include "gc_implementation/parNew/parOopClosures.hpp"
+#endif
+
 // A Klass is the part of the klassOop that provides:
 //  1: language level class object (method dictionary etc.)
 //  2: provide vm dispatch behavior for the object
@@ -799,3 +817,5 @@
   void verify_vtable_index(int index);
 #endif
 };
+
+#endif // SHARE_VM_OOPS_KLASS_HPP
--- a/src/share/vm/oops/klass.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klass.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_KLASS_INLINE_HPP
+#define SHARE_VM_OOPS_KLASS_INLINE_HPP
+
+#include "oops/klass.hpp"
+#include "oops/markOop.hpp"
+
 inline void Klass::set_prototype_header(markOop header) {
   assert(!header->has_bias_pattern() || oop_is_instance(), "biased locking currently only supported for Java instances");
   _prototype_header = header;
 }
+
+#endif // SHARE_VM_OOPS_KLASS_INLINE_HPP
--- a/src/share/vm/oops/klassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,28 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_klassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/permGen.hpp"
+#include "oops/constantPoolKlass.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/klassKlass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/symbolKlass.hpp"
+#include "oops/symbolOop.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "runtime/handles.inline.hpp"
+#ifndef SERIALGC
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 int klassKlass::oop_size(oop obj) const {
   assert (obj->is_klass(), "must be a klassOop");
--- a/src/share/vm/oops/klassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_KLASSKLASS_HPP
+#define SHARE_VM_OOPS_KLASSKLASS_HPP
+
+#include "memory/oopFactory.hpp"
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+
 // A klassKlass serves as the fix point of the klass chain.
 // The klass of klassKlass is itself.
 
@@ -75,3 +82,5 @@
   const char* internal_name() const;
   void oop_verify_on(oop obj, outputStream* st);
 };
+
+#endif // SHARE_VM_OOPS_KLASSKLASS_HPP
--- a/src/share/vm/oops/klassOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klassOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,6 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_klassOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/klassOop.hpp"
+
--- a/src/share/vm/oops/klassOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klassOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_KLASSOOP_HPP
+#define SHARE_VM_OOPS_KLASSOOP_HPP
+
+#include "oops/oop.hpp"
+
 // A klassOop is the C++ equivalent of a Java class.
 // Part of a klassOopDesc is a Klass which handle the
 // dispatching for the C++ method calls.
@@ -42,3 +47,5 @@
   // returns the Klass part containing dispatching behavior
   Klass* klass_part()                            { return (Klass*)((address)this + klass_part_offset_in_bytes()); }
 };
+
+#endif // SHARE_VM_OOPS_KLASSOOP_HPP
--- a/src/share/vm/oops/klassPS.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klassPS.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,9 @@
  * questions.
  *
  */
-#ifndef KLASS_PS_H
-#define KLASS_PS_H
+
+#ifndef SHARE_VM_OOPS_KLASSPS_HPP
+#define SHARE_VM_OOPS_KLASSPS_HPP
 
   // Expands to Parallel Scavenge and Parallel Old declarations
 
@@ -52,4 +53,4 @@
 #define PARALLEL_GC_DECLS_PV
 #endif // SERIALGC
 
-#endif // KLASS_PS_H
+#endif // SHARE_VM_OOPS_KLASSPS_HPP
--- a/src/share/vm/oops/klassVtable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klassVtable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,23 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_klassVtable.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/klassVtable.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/copy.hpp"
 
 inline instanceKlass* klassVtable::ik() const {
   Klass* k = _klass()->klass_part();
@@ -503,18 +518,21 @@
 bool klassVtable::is_miranda(methodOop m, objArrayOop class_methods, klassOop super) {
   symbolOop name = m->name();
   symbolOop signature = m->signature();
+
   if (instanceKlass::find_method(class_methods, name, signature) == NULL) {
-     // did not find it in the method table of the current class
+    // did not find it in the method table of the current class
     if (super == NULL) {
       // super doesn't exist
       return true;
-    } else {
-      if (instanceKlass::cast(super)->lookup_method(name, signature) == NULL) {
-        // super class hierarchy does not implement it
-        return true;
-      }
+    }
+
+    methodOop mo = instanceKlass::cast(super)->lookup_method(name, signature);
+    if (mo == NULL || mo->access_flags().is_private() ) {
+      // super class hierarchy does not implement it or protection is different
+      return true;
     }
   }
+
   return false;
 }
 
--- a/src/share/vm/oops/klassVtable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/klassVtable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_KLASSVTABLE_HPP
+#define SHARE_VM_OOPS_KLASSVTABLE_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/handles.hpp"
+#include "utilities/growableArray.hpp"
+
 // A klassVtable abstracts the variable-length vtable that is embedded in instanceKlass
 // and arrayKlass.  klassVtable objects are used just as convenient transient accessors to the vtable,
 // not to actually hold the vtable data.
@@ -319,3 +327,5 @@
 
   static void update_stats(int size) PRODUCT_RETURN NOT_PRODUCT({ _total_classes++; _total_size += size; })
 };
+
+#endif // SHARE_VM_OOPS_KLASSVTABLE_HPP
--- a/src/share/vm/oops/markOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/markOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_markOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/markOop.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 void markOopDesc::print_on(outputStream* st) const {
--- a/src/share/vm/oops/markOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/markOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_MARKOOP_HPP
+#define SHARE_VM_OOPS_MARKOOP_HPP
+
+#include "oops/oop.hpp"
+
 // The markOop describes the header of an object.
 //
 // Note that the mark is not a real oop but just a word.
@@ -406,3 +411,5 @@
   }
 #endif // _LP64
 };
+
+#endif // SHARE_VM_OOPS_MARKOOP_HPP
--- a/src/share/vm/oops/markOop.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/markOop.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,15 @@
  *
  */
 
-// Should this header be preserved during GC?
+#ifndef SHARE_VM_OOPS_MARKOOP_INLINE_HPP
+#define SHARE_VM_OOPS_MARKOOP_INLINE_HPP
+
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/markOop.hpp"
+#include "runtime/globals.hpp"
+
+// Should this header be preserved during GC (when biased locking is enabled)?
 inline bool markOopDesc::must_be_preserved_with_bias(oop obj_containing_mark) const {
   assert(UseBiasedLocking, "unexpected");
   if (has_bias_pattern()) {
@@ -39,14 +47,15 @@
   return (!is_unlocked() || !has_no_hash());
 }
 
+// Should this header be preserved during GC?
 inline bool markOopDesc::must_be_preserved(oop obj_containing_mark) const {
   if (!UseBiasedLocking)
     return (!is_unlocked() || !has_no_hash());
   return must_be_preserved_with_bias(obj_containing_mark);
 }
 
-// Should this header (including its age bits) be preserved in the
-// case of a promotion failure during scavenge?
+// Should this header be preserved in the case of a promotion failure
+// during scavenge (when biased locking is enabled)?
 inline bool markOopDesc::must_be_preserved_with_bias_for_promotion_failure(oop obj_containing_mark) const {
   assert(UseBiasedLocking, "unexpected");
   // We don't explicitly save off the mark words of biased and
@@ -62,18 +71,20 @@
       prototype_for_object(obj_containing_mark)->has_bias_pattern()) {
     return true;
   }
-  return (this != prototype());
+  return (!is_unlocked() || !has_no_hash());
 }
 
+// Should this header be preserved in the case of a promotion failure
+// during scavenge?
 inline bool markOopDesc::must_be_preserved_for_promotion_failure(oop obj_containing_mark) const {
   if (!UseBiasedLocking)
-    return (this != prototype());
+    return (!is_unlocked() || !has_no_hash());
   return must_be_preserved_with_bias_for_promotion_failure(obj_containing_mark);
 }
 
 
-// Should this header (including its age bits) be preserved in the
-// case of a scavenge in which CMS is the old generation?
+// Same as must_be_preserved_with_bias_for_promotion_failure() except that
+// it takes a klassOop argument, instead of the object of which this is the mark word.
 inline bool markOopDesc::must_be_preserved_with_bias_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const {
   assert(UseBiasedLocking, "unexpected");
   // CMS scavenges preserve mark words in similar fashion to promotion failures; see above
@@ -81,11 +92,14 @@
       klass_of_obj_containing_mark->klass_part()->prototype_header()->has_bias_pattern()) {
     return true;
   }
-  return (this != prototype());
+  return (!is_unlocked() || !has_no_hash());
 }
+
+// Same as must_be_preserved_for_promotion_failure() except that
+// it takes a klassOop argument, instead of the object of which this is the mark word.
 inline bool markOopDesc::must_be_preserved_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const {
   if (!UseBiasedLocking)
-    return (this != prototype());
+    return (!is_unlocked() || !has_no_hash());
   return must_be_preserved_with_bias_for_cms_scavenge(klass_of_obj_containing_mark);
 }
 
@@ -96,3 +110,5 @@
 #endif
   return obj->klass()->klass_part()->prototype_header();
 }
+
+#endif // SHARE_VM_OOPS_MARKOOP_INLINE_HPP
--- a/src/share/vm/oops/methodDataKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodDataKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_methodDataKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodDataKlass.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/handles.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 klassOop methodDataKlass::create_klass(TRAPS) {
   methodDataKlass o;
--- a/src/share/vm/oops/methodDataKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodDataKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_METHODDATAKLASS_HPP
+#define SHARE_VM_OOPS_METHODDATAKLASS_HPP
+
+#include "oops/klass.hpp"
+
 // a methodDataKlass is the klass of a methodDataOop
 
 class methodDataKlass : public Klass {
@@ -82,3 +87,5 @@
   const char* internal_name() const;
   void oop_verify_on(oop obj, outputStream* st);
 };
+
+#endif // SHARE_VM_OOPS_METHODDATAKLASS_HPP
--- a/src/share/vm/oops/methodDataOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodDataOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_methodDataOop.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/handles.inline.hpp"
 
 // ==================================================================
 // DataLayout
--- a/src/share/vm/oops/methodDataOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodDataOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_METHODDATAOOP_HPP
+#define SHARE_VM_OOPS_METHODDATAOOP_HPP
+
+#include "interpreter/bytecodes.hpp"
+#include "memory/universe.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.hpp"
+#include "runtime/orderAccess.hpp"
+
 class BytecodeStream;
 
 // The MethodData object collects counts and other profile information
@@ -1490,3 +1499,5 @@
   // verification
   void verify_data_on(outputStream* st);
 };
+
+#endif // SHARE_VM_OOPS_METHODDATAOOP_HPP
--- a/src/share/vm/oops/methodKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_methodKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/constMethodKlass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.inline.hpp"
 
 klassOop methodKlass::create_klass(TRAPS) {
   methodKlass o;
--- a/src/share/vm/oops/methodKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_METHODKLASS_HPP
+#define SHARE_VM_OOPS_METHODKLASS_HPP
+
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodOop.hpp"
+
 // a methodKlass is the klass of a methodOop
 
 class methodKlass : public Klass {
@@ -81,3 +88,5 @@
   bool oop_partially_loaded(oop obj) const;
   void oop_set_partially_loaded(oop obj);
 };
+
+#endif // SHARE_VM_OOPS_METHODKLASS_HPP
--- a/src/share/vm/oops/methodOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,34 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_methodOop.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/debugInfoRec.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "interpreter/bytecodeTracer.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/generation.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/methodHandleWalk.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/relocator.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/xmlstream.hpp"
 
 
 // Implementation of methodOopDesc
@@ -283,6 +309,12 @@
 // Build a methodDataOop object to hold information about this method
 // collected in the interpreter.
 void methodOopDesc::build_interpreter_method_data(methodHandle method, TRAPS) {
+  // Do not profile method if current thread holds the pending list lock,
+  // which avoids deadlock for acquiring the MethodData_lock.
+  if (instanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
+    return;
+  }
+
   // Grab a lock here to prevent multiple
   // methodDataOops from being created.
   MutexLocker ml(MethodData_lock, THREAD);
--- a/src/share/vm/oops/methodOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/methodOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_METHODOOP_HPP
+#define SHARE_VM_OOPS_METHODOOP_HPP
+
+#include "classfile/vmSymbols.hpp"
+#include "code/compressedStream.hpp"
+#include "compiler/oopMap.hpp"
+#include "interpreter/invocationCounter.hpp"
+#include "oops/constMethodOop.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/growableArray.hpp"
+
 // A methodOop represents a Java method.
 //
 // Memory layout (each line represents a word). Note that most applications load thousands of methods,
@@ -784,3 +799,5 @@
   void set(methodOop method);
   void clear(methodOop method);
 };
+
+#endif // SHARE_VM_OOPS_METHODOOP_HPP
--- a/src/share/vm/oops/objArrayKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/objArrayKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,36 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_objArrayKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayKlass.inline.hpp"
+#include "oops/objArrayKlassKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "utilities/copy.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "gc_implementation/parNew/parOopClosures.inline.hpp"
+#include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
+#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#endif
 
 int objArrayKlass::oop_size(oop obj) const {
   assert(obj->is_objArray(), "must be object array");
--- a/src/share/vm/oops/objArrayKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/objArrayKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OBJARRAYKLASS_HPP
+#define SHARE_VM_OOPS_OBJARRAYKLASS_HPP
+
+#include "memory/specialized_oop_closures.hpp"
+#include "oops/arrayKlass.hpp"
+#include "oops/instanceKlass.hpp"
+
 // objArrayKlass is the klass for objArrays
 
 class objArrayKlass : public arrayKlass {
@@ -140,3 +147,5 @@
   void oop_verify_old_oop(oop obj, oop* p, bool allow_dirty);
   void oop_verify_old_oop(oop obj, narrowOop* p, bool allow_dirty);
 };
+
+#endif // SHARE_VM_OOPS_OBJARRAYKLASS_HPP
--- a/src/share/vm/oops/objArrayKlass.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/objArrayKlass.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP
+#define SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP
+
+#include "oops/objArrayKlass.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#endif
+
 void objArrayKlass::oop_follow_contents(oop obj, int index) {
   if (UseCompressedOops) {
     objarray_follow_contents<narrowOop>(obj, index);
@@ -87,3 +96,5 @@
   }
 }
 #endif // #ifndef SERIALGC
+
+#endif // SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP
--- a/src/share/vm/oops/objArrayKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/objArrayKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_objArrayKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayKlassKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
 
 klassOop objArrayKlassKlass::create_klass(TRAPS) {
   objArrayKlassKlass o;
--- a/src/share/vm/oops/objArrayKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/objArrayKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OBJARRAYKLASSKLASS_HPP
+#define SHARE_VM_OOPS_OBJARRAYKLASSKLASS_HPP
+
+#include "oops/arrayKlassKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+
 // The objArrayKlassKlass is klass for all objArrayKlass'
 
 class objArrayKlassKlass : public arrayKlassKlass {
@@ -76,3 +82,5 @@
   void oop_verify_on(oop obj, outputStream* st);
 
 };
+
+#endif // SHARE_VM_OOPS_OBJARRAYKLASSKLASS_HPP
--- a/src/share/vm/oops/objArrayOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/objArrayOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_objArrayOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 
 #define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)                    \
                                                                                    \
--- a/src/share/vm/oops/objArrayOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/objArrayOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OBJARRAYOOP_HPP
+#define SHARE_VM_OOPS_OBJARRAYOOP_HPP
+
+#include "oops/arrayOop.hpp"
+
 // An objArrayOop is an array containing oops.
 // Evaluating "String arg[10]" will create an objArrayOop.
 
@@ -110,3 +115,5 @@
   ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayOop_OOP_ITERATE_DECL)
   ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayOop_OOP_ITERATE_DECL)
 };
+
+#endif // SHARE_VM_OOPS_OBJARRAYOOP_HPP
--- a/src/share/vm/oops/oop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_oop.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/copy.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 bool always_do_update_barrier = false;
 
--- a/src/share/vm/oops/oop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OOP_HPP
+#define SHARE_VM_OOPS_OOP_HPP
+
+#include "memory/iterator.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/specialized_oop_closures.hpp"
+#include "utilities/top.hpp"
+
 // oopDesc is the top baseclass for objects classes.  The {name}Desc classes describe
 // the format of Java objects so the fields can be accessed from C++.
 // oopDesc is abstract.
@@ -30,12 +38,12 @@
 // no virtual functions allowed
 
 // store into oop with store check
-template <class T> inline void oop_store(T* p, oop v);
-template <class T> inline void oop_store(volatile T* p, oop v);
+template <class T> void oop_store(T* p, oop v);
+template <class T> void oop_store(volatile T* p, oop v);
 
 // store into oop without store check
-template <class T> inline void oop_store_without_check(T* p, oop v);
-template <class T> inline void oop_store_without_check(volatile T* p, oop v);
+template <class T> void oop_store_without_check(T* p, oop v);
+template <class T> void oop_store_without_check(volatile T* p, oop v);
 
 extern bool always_do_update_barrier;
 
@@ -403,3 +411,5 @@
   static int klass_offset_in_bytes()   { return offset_of(oopDesc, _metadata._klass); }
   static int klass_gap_offset_in_bytes();
 };
+
+#endif // SHARE_VM_OOPS_OOP_HPP
--- a/src/share/vm/oops/oop.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oop.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,37 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OOP_INLINE_HPP
+#define SHARE_VM_OOPS_OOP_INLINE_HPP
+
+#include "gc_implementation/shared/ageTable.hpp"
+#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/barrierSet.inline.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generation.hpp"
+#include "memory/permGen.hpp"
+#include "memory/specialized_oop_closures.hpp"
+#include "oops/arrayKlass.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/markOop.inline.hpp"
+#include "oops/oop.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 // Implementation of all inlined member functions defined in oop.hpp
 // We need a separate file to avoid circular references
 
@@ -746,3 +777,5 @@
 inline bool oopDesc::is_shared_readwrite() const {
   return CompactingPermGenGen::is_shared_readwrite(this);
 }
+
+#endif // SHARE_VM_OOPS_OOP_INLINE_HPP
--- a/src/share/vm/oops/oop.inline2.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oop.inline2.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OOP_INLINE2_HPP
+#define SHARE_VM_OOPS_OOP_INLINE2_HPP
+
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/generation.hpp"
+#include "memory/permGen.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.hpp"
+
 // Implementation of all inlined member functions defined in oop.hpp
 // We need a separate file to avoid circular references
 
@@ -38,3 +47,5 @@
 inline bool oopDesc::is_scavengable() const {
   return Universe::heap()->is_scavengable(this);
 }
+
+#endif // SHARE_VM_OOPS_OOP_INLINE2_HPP
--- a/src/share/vm/oops/oop.pcgc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oop.pcgc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP
+#define SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
+#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#endif
+
 inline void oopDesc::update_contents(ParCompactionManager* cm) {
   // The klass field must be updated before anything else
   // can be done.
@@ -106,12 +118,15 @@
   assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable");
   assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this.");
 
-  while (!is_forwarded()) {
+  while (!oldMark->is_marked()) {
     curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark);
+    assert(is_forwarded(), "object should have been forwarded");
     if (curMark == oldMark) {
-      assert(is_forwarded(), "the CAS should have succeeded.");
       return NULL;
     }
+    // If the CAS was unsuccessful then curMark->is_marked()
+    // should return true as another thread has CAS'd in another
+    // forwarding pointer.
     oldMark = curMark;
   }
   return forwardee();
@@ -133,3 +148,5 @@
     PSParallelCompact::adjust_pointer(klass_addr(), beg_addr, end_addr);
   }
 }
+
+#endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP
--- a/src/share/vm/oops/oop.psgc.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oop.psgc.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OOP_PSGC_INLINE_HPP
+#define SHARE_VM_OOPS_OOP_PSGC_INLINE_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#endif
+
 // ParallelScavengeHeap methods
 
 inline void oopDesc::push_contents(PSPromotionManager* pm) {
@@ -32,3 +41,5 @@
   }
   // Else skip it.  The typeArrayKlass in the header never needs scavenging.
 }
+
+#endif // SHARE_VM_OOPS_OOP_PSGC_INLINE_HPP
--- a/src/share/vm/oops/oopsHierarchy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oopsHierarchy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_oopsHierarchy.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/globalDefinitions.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 #ifdef CHECK_UNHANDLED_OOPS
 
--- a/src/share/vm/oops/oopsHierarchy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/oopsHierarchy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_OOPSHIERARCHY_HPP
+#define SHARE_VM_OOPS_OOPSHIERARCHY_HPP
+
+#include "runtime/globals.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // OBJECT hierarchy
 // This hierarchy is a representation hierarchy, i.e. if A is a superclass
 // of B, A's representation is a prefix of B's representation.
@@ -186,3 +192,5 @@
 class   constantPoolCacheKlass;
 class   symbolKlass;
 class   compiledICHolderKlass;
+
+#endif // SHARE_VM_OOPS_OOPSHIERARCHY_HPP
--- a/src/share/vm/oops/symbolKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/symbolKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_symbolKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "memory/gcLocker.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolKlass.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.inline.hpp"
 
 symbolOop symbolKlass::allocate_symbol(u1* name, int len, TRAPS) {
   // Don't allow symbol oops to be created which cannot fit in a symbolOop.
--- a/src/share/vm/oops/symbolKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/symbolKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_SYMBOLKLASS_HPP
+#define SHARE_VM_OOPS_SYMBOLKLASS_HPP
+
+#include "oops/typeArrayKlass.hpp"
+
 // a symbolKlass is the klass for a symbolOop
 
 class symbolKlass : public Klass {
@@ -72,3 +77,5 @@
 #endif //PRODUCT
   const char* internal_name() const;
 };
+
+#endif // SHARE_VM_OOPS_SYMBOLKLASS_HPP
--- a/src/share/vm/oops/symbolOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/symbolOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_symbolOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
 
 
 // ------------------------------------------------------------------
--- a/src/share/vm/oops/symbolOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/symbolOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_SYMBOLOOP_HPP
+#define SHARE_VM_OOPS_SYMBOLOOP_HPP
+
+#include "oops/typeArrayOop.hpp"
+#include "utilities/utf8.hpp"
+
 // A symbolOop is a canonicalized string.
 // All symbolOops reside in global symbolTable.
 // See oopFactory::new_symbol for how to allocate a symbolOop
@@ -129,3 +135,5 @@
  return (((uintptr_t)this < (uintptr_t)other) ? -1
    : ((uintptr_t)this == (uintptr_t) other) ? 0 : 1);
 }
+
+#endif // SHARE_VM_OOPS_SYMBOLOOP_HPP
--- a/src/share/vm/oops/typeArrayKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/typeArrayKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_typeArrayKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/objArrayKlassKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "runtime/handles.inline.hpp"
 
 bool typeArrayKlass::compute_is_subtype_of(klassOop k) {
   if (!k->klass_part()->oop_is_typeArray()) {
--- a/src/share/vm/oops/typeArrayKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/typeArrayKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_TYPEARRAYKLASS_HPP
+#define SHARE_VM_OOPS_TYPEARRAYKLASS_HPP
+
+#include "oops/arrayKlass.hpp"
+
 // A typeArrayKlass is the klass of a typeArray
 // It contains the type and size of the elements
 
@@ -105,3 +110,5 @@
  public:
   const char* internal_name() const;
 };
+
+#endif // SHARE_VM_OOPS_TYPEARRAYKLASS_HPP
--- a/src/share/vm/oops/typeArrayKlassKlass.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/typeArrayKlassKlass.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_typeArrayKlassKlass.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/typeArrayKlassKlass.hpp"
+#include "runtime/handles.inline.hpp"
 
 klassOop typeArrayKlassKlass::create_klass(TRAPS) {
   typeArrayKlassKlass o;
--- a/src/share/vm/oops/typeArrayKlassKlass.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/typeArrayKlassKlass.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_TYPEARRAYKLASSKLASS_HPP
+#define SHARE_VM_OOPS_TYPEARRAYKLASSKLASS_HPP
+
+#include "oops/arrayKlassKlass.hpp"
+#include "oops/typeArrayKlass.hpp"
+
 // A typeArrayKlassKlass is the klass of a typeArrayKlass
 
 class typeArrayKlassKlass : public arrayKlassKlass {
@@ -56,3 +62,5 @@
 
   const char* internal_name() const;
 };
+
+#endif // SHARE_VM_OOPS_TYPEARRAYKLASSKLASS_HPP
--- a/src/share/vm/oops/typeArrayOop.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/typeArrayOop.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_typeArrayOop.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/typeArrayOop.hpp"
 
 // <<this page is intentionally left blank>>
--- a/src/share/vm/oops/typeArrayOop.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/oops/typeArrayOop.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,30 @@
  *
  */
 
+#ifndef SHARE_VM_OOPS_TYPEARRAYOOP_HPP
+#define SHARE_VM_OOPS_TYPEARRAYOOP_HPP
+
+#include "oops/arrayOop.hpp"
+#include "oops/typeArrayKlass.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "orderAccess_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "orderAccess_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "orderAccess_linux_zero.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "orderAccess_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "orderAccess_solaris_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "orderAccess_windows_x86.inline.hpp"
+#endif
+
 // A typeArrayOop is an array containing basic types (non oop elements).
 // It is used for arrays of {characters, singles, doubles, bytes, shorts, integers, longs}
 #include <limits.h>
@@ -141,3 +165,5 @@
     return object_size(tk->layout_helper(), length());
   }
 };
+
+#endif // SHARE_VM_OOPS_TYPEARRAYOOP_HPP
--- a/src/share/vm/opto/addnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/addnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,17 @@
  *
  */
 
-// Portions of code courtesy of Clifford Click
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_addnode.cpp.incl"
+// Portions of code courtesy of Clifford Click
 
 #define MAXFLOAT        ((float)3.40282346638528860e+38)
 
--- a/src/share/vm/opto/addnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/addnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_ADDNODE_HPP
+#define SHARE_VM_OPTO_ADDNODE_HPP
+
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 class PhaseTransform;
@@ -241,3 +248,5 @@
   virtual uint ideal_reg() const { return Op_RegI; }
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 };
+
+#endif // SHARE_VM_OPTO_ADDNODE_HPP
--- a/src/share/vm/opto/adlcVMDeps.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/adlcVMDeps.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_ADLCVMDEPS_HPP
+#define SHARE_VM_OPTO_ADLCVMDEPS_HPP
+
+// adlcVMDeps.hpp is used by both adlc and vm builds.
+// Only include allocation.hpp when we're not building adlc.
+#ifndef SHARE_VM_ADLC_ARENA_HPP
+#include "memory/allocation.hpp"
+#endif
+
 // Declare commonly known constant and data structures between the
 // ADLC and the VM
 //
@@ -42,3 +51,5 @@
   static const char* oop_reloc_type()  { return "relocInfo::oop_type"; }
   static const char* none_reloc_type() { return "relocInfo::none"; }
 };
+
+#endif // SHARE_VM_OPTO_ADLCVMDEPS_HPP
--- a/src/share/vm/opto/block.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/block.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,20 @@
  *
  */
 
-// Optimization - Graph Style
+#include "precompiled.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/block.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/rootnode.hpp"
+#include "utilities/copy.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_block.cpp.incl"
+// Optimization - Graph Style
 
 
 //-----------------------------------------------------------------------------
--- a/src/share/vm/opto/block.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/block.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_BLOCK_HPP
+#define SHARE_VM_OPTO_BLOCK_HPP
+
+#include "opto/multnode.hpp"
+#include "opto/node.hpp"
+#include "opto/phase.hpp"
+
 // Optimization - Graph Style
 
 class Block;
@@ -716,3 +723,5 @@
   void reorder_traces(int count);
   void union_traces(Trace* from, Trace* to);
 };
+
+#endif // SHARE_VM_OPTO_BLOCK_HPP
--- a/src/share/vm/opto/buildOopMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/buildOopMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_buildOopMap.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/oopMap.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/phase.hpp"
+#include "opto/regalloc.hpp"
+#include "opto/rootnode.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vmreg_zero.inline.hpp"
+#endif
 
 // The functions in this file builds OopMaps after all scheduling is done.
 //
--- a/src/share/vm/opto/bytecodeInfo.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/bytecodeInfo.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,15 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodeInfo.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileLog.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "opto/callGenerator.hpp"
+#include "opto/parse.hpp"
+#include "runtime/handles.inline.hpp"
 
 //=============================================================================
 //------------------------------InlineTree-------------------------------------
--- a/src/share/vm/opto/c2_globals.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/c2_globals.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_c2_globals.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/c2_globals.hpp"
 
 C2_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_EXPERIMENTAL_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
--- a/src/share/vm/opto/c2_globals.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/c2_globals.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,26 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_C2_GLOBALS_HPP
+#define SHARE_VM_OPTO_C2_GLOBALS_HPP
+
+#include "runtime/globals.hpp"
+#ifdef TARGET_ARCH_x86
+# include "c2_globals_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c2_globals_sparc.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "c2_globals_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "c2_globals_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "c2_globals_windows.hpp"
+#endif
+
 //
 // Defines all globals flags used by the server compiler.
 //
@@ -264,6 +284,9 @@
   develop(bool, SparcV9RegsHiBitsZero, true,                                \
           "Assume Sparc V9 I&L registers on V8+ systems are zero-extended") \
                                                                             \
+  product(bool, UseRDPCForConstantTableBase, false,                         \
+          "Use Sparc RDPC instruction for the constant table base.")        \
+                                                                            \
   develop(intx, PrintIdealGraphLevel, 0,                                    \
           "Print ideal graph to XML file / network interface. "             \
           "By default attempts to connect to the visualizer on a socket.")  \
@@ -438,3 +461,5 @@
           "Allow back branches to be fall throughs in the block layour")    \
 
 C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG)
+
+#endif // SHARE_VM_OPTO_C2_GLOBALS_HPP
--- a/src/share/vm/opto/c2compiler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/c2compiler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_c2compiler.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/c2compiler.hpp"
+#include "opto/runtime.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
 
 
 volatile int C2Compiler::_runtimes = uninitialized;
--- a/src/share/vm/opto/c2compiler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/c2compiler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_C2COMPILER_HPP
+#define SHARE_VM_OPTO_C2COMPILER_HPP
+
+#include "compiler/abstractCompiler.hpp"
+
 class C2Compiler : public AbstractCompiler {
 private:
 
@@ -55,3 +60,5 @@
   // Print compilation timers and statistics
   void print_timers();
 };
+
+#endif // SHARE_VM_OPTO_C2COMPILER_HPP
--- a/src/share/vm/opto/callGenerator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/callGenerator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_callGenerator.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/bcEscapeAnalyzer.hpp"
+#include "ci/ciCPCache.hpp"
+#include "ci/ciMethodHandle.hpp"
+#include "classfile/javaClasses.hpp"
+#include "compiler/compileLog.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callGenerator.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/parse.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
 
 CallGenerator::CallGenerator(ciMethod* method) {
   _method = method;
--- a/src/share/vm/opto/callGenerator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/callGenerator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_CALLGENERATOR_HPP
+#define SHARE_VM_OPTO_CALLGENERATOR_HPP
+
+#include "opto/callnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/type.hpp"
+#include "runtime/deoptimization.hpp"
+
 //---------------------------CallGenerator-------------------------------------
 // The subclasses of this class handle generation of ideal nodes for
 // call sites and method entry points.
@@ -281,3 +289,5 @@
   int count_all() const;
 #endif
 };
+
+#endif // SHARE_VM_OPTO_CALLGENERATOR_HPP
--- a/src/share/vm/opto/callnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/callnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,24 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "ci/bcEscapeAnalyzer.hpp"
+#include "compiler/oopMap.hpp"
+#include "opto/callnode.hpp"
+#include "opto/escape.hpp"
+#include "opto/locknode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/parse.hpp"
+#include "opto/regalloc.hpp"
+#include "opto/regmask.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_callnode.cpp.incl"
-
 //=============================================================================
 uint StartNode::size_of() const { return sizeof(*this); }
 uint StartNode::cmp( const Node &n ) const
--- a/src/share/vm/opto/callnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/callnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_CALLNODE_HPP
+#define SHARE_VM_OPTO_CALLNODE_HPP
+
+#include "opto/connode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/multnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
@@ -938,3 +948,5 @@
   // unlock is never a safepoint
   virtual bool        guaranteed_safepoint()  { return false; }
 };
+
+#endif // SHARE_VM_OPTO_CALLNODE_HPP
--- a/src/share/vm/opto/cfgnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/cfgnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,25 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "opto/addnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/regmask.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_cfgnode.cpp.incl"
-
 //=============================================================================
 //------------------------------Value------------------------------------------
 // Compute the type of the RegionNode.
--- a/src/share/vm/opto/cfgnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/cfgnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_CFGNODE_HPP
+#define SHARE_VM_OPTO_CFGNODE_HPP
+
+#include "opto/multnode.hpp"
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
@@ -519,3 +527,5 @@
   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 #endif
 };
+
+#endif // SHARE_VM_OPTO_CFGNODE_HPP
--- a/src/share/vm/opto/chaitin.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/chaitin.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,23 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_chaitin.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "compiler/oopMap.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/block.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/coalesce.hpp"
+#include "opto/connode.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/indexSet.hpp"
+#include "opto/machnode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/rootnode.hpp"
 
 //=============================================================================
 
@@ -1767,7 +1782,7 @@
   for(uint i2 = 1; i2 < _maxlrg; i2++ ) {
     tty->print("L%d: ",i2);
     if( i2 < _ifg->_maxlrg ) lrgs(i2).dump( );
-    else tty->print("new LRG");
+    else tty->print_cr("new LRG");
   }
   tty->print_cr("");
 
@@ -1978,7 +1993,7 @@
 }
 
 //------------------------------dump_lrg---------------------------------------
-void PhaseChaitin::dump_lrg( uint lidx ) const {
+void PhaseChaitin::dump_lrg( uint lidx, bool defs_only ) const {
   tty->print_cr("---dump of L%d---",lidx);
 
   if( _ifg ) {
@@ -1987,9 +2002,11 @@
       return;
     }
     tty->print("L%d: ",lidx);
-    lrgs(lidx).dump( );
+    if( lidx < _ifg->_maxlrg ) lrgs(lidx).dump( );
+    else tty->print_cr("new LRG");
   }
-  if( _ifg ) {    tty->print("Neighbors: %d - ", _ifg->neighbor_cnt(lidx));
+  if( _ifg && lidx < _ifg->_maxlrg) {
+    tty->print("Neighbors: %d - ", _ifg->neighbor_cnt(lidx));
     _ifg->neighbors(lidx)->dump();
     tty->cr();
   }
@@ -2009,16 +2026,18 @@
         dump(n);
         continue;
       }
-      uint cnt = n->req();
-      for( uint k = 1; k < cnt; k++ ) {
-        Node *m = n->in(k);
-        if (!m)  continue;  // be robust in the dumper
-        if( Find_const(m) == lidx ) {
-          if( !dump_once++ ) {
-            tty->cr();
-            b->dump_head( &_cfg._bbs );
+      if (!defs_only) {
+        uint cnt = n->req();
+        for( uint k = 1; k < cnt; k++ ) {
+          Node *m = n->in(k);
+          if (!m)  continue;  // be robust in the dumper
+          if( Find_const(m) == lidx ) {
+            if( !dump_once++ ) {
+              tty->cr();
+              b->dump_head( &_cfg._bbs );
+            }
+            dump(n);
           }
-          dump(n);
         }
       }
     }
--- a/src/share/vm/opto/chaitin.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/chaitin.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,19 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_CHAITIN_HPP
+#define SHARE_VM_OPTO_CHAITIN_HPP
+
+#include "code/vmreg.hpp"
+#include "libadt/port.hpp"
+#include "memory/resourceArea.hpp"
+#include "opto/connode.hpp"
+#include "opto/live.hpp"
+#include "opto/matcher.hpp"
+#include "opto/phase.hpp"
+#include "opto/regalloc.hpp"
+#include "opto/regmask.hpp"
+
 class LoopTree;
 class MachCallNode;
 class MachSafePointNode;
@@ -499,7 +512,11 @@
   void dump( const Block * b ) const;
   void dump_degree_lists() const;
   void dump_simplified() const;
-  void dump_lrg( uint lidx ) const;
+  void dump_lrg( uint lidx, bool defs_only) const;
+  void dump_lrg( uint lidx) const {
+    // dump defs and uses by default
+    dump_lrg(lidx, false);
+  }
   void dump_bb( uint pre_order ) const;
 
   // Verify that base pointers and derived pointers are still sane
@@ -519,3 +536,5 @@
   friend class PhaseAggressiveCoalesce;
   friend class PhaseConservativeCoalesce;
 };
+
+#endif // SHARE_VM_OPTO_CHAITIN_HPP
--- a/src/share/vm/opto/classes.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/classes.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,22 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_classes.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/locknode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/multnode.hpp"
+#include "opto/node.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/subnode.hpp"
+#include "opto/vectornode.hpp"
 
 // ----------------------------------------------------------------------------
 // Build a table of virtual functions to map from Nodes to dense integer
--- a/src/share/vm/opto/coalesce.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/coalesce.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_coalesce.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/block.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/coalesce.hpp"
+#include "opto/connode.hpp"
+#include "opto/indexSet.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/regmask.hpp"
 
 //=============================================================================
 //------------------------------reset_uf_map-----------------------------------
--- a/src/share/vm/opto/coalesce.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/coalesce.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_COALESCE_HPP
+#define SHARE_VM_OPTO_COALESCE_HPP
+
+#include "opto/phase.hpp"
+
 class LoopTree;
 class LRG;
 class LRG_List;
@@ -107,3 +112,5 @@
 
   void update_ifg(uint lr1, uint lr2, IndexSet *n_lr1, IndexSet *n_lr2);
 };
+
+#endif // SHARE_VM_OPTO_COALESCE_HPP
--- a/src/share/vm/opto/compile.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/compile.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,70 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_compile.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/exceptionHandlerTable.hpp"
+#include "code/nmethod.hpp"
+#include "compiler/compileLog.hpp"
+#include "compiler/oopMap.hpp"
+#include "opto/addnode.hpp"
+#include "opto/block.hpp"
+#include "opto/c2compiler.hpp"
+#include "opto/callGenerator.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/compile.hpp"
+#include "opto/connode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/escape.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/macro.hpp"
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/output.hpp"
+#include "opto/parse.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/stringopts.hpp"
+#include "opto/type.hpp"
+#include "opto/vectornode.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/copy.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
+
+
+// -------------------- Compile::mach_constant_base_node -----------------------
+// Constant table base node singleton.
+MachConstantBaseNode* Compile::mach_constant_base_node() {
+  if (_mach_constant_base_node == NULL) {
+    _mach_constant_base_node = new (C) MachConstantBaseNode();
+    _mach_constant_base_node->add_req(C->root());
+  }
+  return _mach_constant_base_node;
+}
+
 
 /// Support for intrinsics.
 
@@ -382,13 +444,14 @@
 }
 
 
-void Compile::init_scratch_buffer_blob() {
-  if( scratch_buffer_blob() != NULL )  return;
+void Compile::init_scratch_buffer_blob(int const_size) {
+  if (scratch_buffer_blob() != NULL)  return;
 
   // Construct a temporary CodeBuffer to have it construct a BufferBlob
   // Cache this BufferBlob for this compile.
   ResourceMark rm;
-  int size = (MAX_inst_size + MAX_stubs_size + MAX_const_size);
+  _scratch_const_size = const_size;
+  int size = (MAX_inst_size + MAX_stubs_size + _scratch_const_size);
   BufferBlob* blob = BufferBlob::create("Compile::scratch_buffer", size);
   // Record the buffer blob for next time.
   set_scratch_buffer_blob(blob);
@@ -405,9 +468,19 @@
 }
 
 
+void Compile::clear_scratch_buffer_blob() {
+  assert(scratch_buffer_blob(), "no BufferBlob set");
+  set_scratch_buffer_blob(NULL);
+  set_scratch_locs_memory(NULL);
+}
+
+
 //-----------------------scratch_emit_size-------------------------------------
 // Helper function that computes size by emitting code
 uint Compile::scratch_emit_size(const Node* n) {
+  // Start scratch_emit_size section.
+  set_in_scratch_emit_size(true);
+
   // Emit into a trash buffer and count bytes emitted.
   // This is a pretty expensive way to compute a size,
   // but it works well enough if seldom used.
@@ -426,13 +499,20 @@
   address blob_end   = (address)locs_buf;
   assert(blob->content_contains(blob_end), "sanity");
   CodeBuffer buf(blob_begin, blob_end - blob_begin);
-  buf.initialize_consts_size(MAX_const_size);
+  buf.initialize_consts_size(_scratch_const_size);
   buf.initialize_stubs_size(MAX_stubs_size);
   assert(locs_buf != NULL, "sanity");
-  int lsize = MAX_locs_size / 2;
-  buf.insts()->initialize_shared_locs(&locs_buf[0],     lsize);
-  buf.stubs()->initialize_shared_locs(&locs_buf[lsize], lsize);
+  int lsize = MAX_locs_size / 3;
+  buf.consts()->initialize_shared_locs(&locs_buf[lsize * 0], lsize);
+  buf.insts()->initialize_shared_locs( &locs_buf[lsize * 1], lsize);
+  buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize);
+
+  // Do the emission.
   n->emit(buf, this->regalloc());
+
+  // End scratch_emit_size section.
+  set_in_scratch_emit_size(false);
+
   return buf.insts_size();
 }
 
@@ -466,10 +546,13 @@
                   _orig_pc_slot(0),
                   _orig_pc_slot_offset_in_bytes(0),
                   _has_method_handle_invokes(false),
+                  _mach_constant_base_node(NULL),
                   _node_bundling_limit(0),
                   _node_bundling_base(NULL),
                   _java_calls(0),
                   _inner_loops(0),
+                  _scratch_const_size(-1),
+                  _in_scratch_emit_size(false),
 #ifndef PRODUCT
                   _trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")),
                   _printer(IdealGraphPrinter::printer()),
@@ -503,7 +586,7 @@
   if (ProfileTraps) {
     // Make sure the method being compiled gets its own MDO,
     // so we can at least track the decompile_count().
-    method()->build_method_data();
+    method()->ensure_method_data();
   }
 
   Init(::AliasLevel);
@@ -733,6 +816,7 @@
     _failure_reason(NULL),
     _code_buffer("Compile::Fill_buffer"),
     _has_method_handle_invokes(false),
+    _mach_constant_base_node(NULL),
     _node_bundling_limit(0),
     _node_bundling_base(NULL),
     _java_calls(0),
@@ -2812,3 +2896,207 @@
     _log->done("phase nodes='%d'", C->unique());
   }
 }
+
+//=============================================================================
+// Two Constant's are equal when the type and the value are equal.
+bool Compile::Constant::operator==(const Constant& other) {
+  if (type()          != other.type()         )  return false;
+  if (can_be_reused() != other.can_be_reused())  return false;
+  // For floating point values we compare the bit pattern.
+  switch (type()) {
+  case T_FLOAT:   return (_value.i == other._value.i);
+  case T_LONG:
+  case T_DOUBLE:  return (_value.j == other._value.j);
+  case T_OBJECT:
+  case T_ADDRESS: return (_value.l == other._value.l);
+  case T_VOID:    return (_value.l == other._value.l);  // jump-table entries
+  default: ShouldNotReachHere();
+  }
+  return false;
+}
+
+// Emit constants grouped in the following order:
+static BasicType type_order[] = {
+  T_FLOAT,    // 32-bit
+  T_OBJECT,   // 32 or 64-bit
+  T_ADDRESS,  // 32 or 64-bit
+  T_DOUBLE,   // 64-bit
+  T_LONG,     // 64-bit
+  T_VOID,     // 32 or 64-bit (jump-tables are at the end of the constant table for code emission reasons)
+  T_ILLEGAL
+};
+
+static int type_to_size_in_bytes(BasicType t) {
+  switch (t) {
+  case T_LONG:    return sizeof(jlong  );
+  case T_FLOAT:   return sizeof(jfloat );
+  case T_DOUBLE:  return sizeof(jdouble);
+    // We use T_VOID as marker for jump-table entries (labels) which
+    // need an interal word relocation.
+  case T_VOID:
+  case T_ADDRESS:
+  case T_OBJECT:  return sizeof(jobject);
+  }
+
+  ShouldNotReachHere();
+  return -1;
+}
+
+void Compile::ConstantTable::calculate_offsets_and_size() {
+  int size = 0;
+  for (int t = 0; type_order[t] != T_ILLEGAL; t++) {
+    BasicType type = type_order[t];
+
+    for (int i = 0; i < _constants.length(); i++) {
+      Constant con = _constants.at(i);
+      if (con.type() != type)  continue;  // Skip other types.
+
+      // Align size for type.
+      int typesize = type_to_size_in_bytes(con.type());
+      size = align_size_up(size, typesize);
+
+      // Set offset.
+      con.set_offset(size);
+      _constants.at_put(i, con);
+
+      // Add type size.
+      size = size + typesize;
+    }
+  }
+
+  // Align size up to the next section start (which is insts; see
+  // CodeBuffer::align_at_start).
+  assert(_size == -1, "already set?");
+  _size = align_size_up(size, CodeEntryAlignment);
+
+  if (Matcher::constant_table_absolute_addressing) {
+    set_table_base_offset(0);  // No table base offset required
+  } else {
+    if (UseRDPCForConstantTableBase) {
+      // table base offset is set in MachConstantBaseNode::emit
+    } else {
+      // When RDPC is not used, the table base is set into the middle of
+      // the constant table.
+      int half_size = _size / 2;
+      assert(half_size * 2 == _size, "sanity");
+      set_table_base_offset(-half_size);
+    }
+  }
+}
+
+void Compile::ConstantTable::emit(CodeBuffer& cb) {
+  MacroAssembler _masm(&cb);
+  for (int t = 0; type_order[t] != T_ILLEGAL; t++) {
+    BasicType type = type_order[t];
+
+    for (int i = 0; i < _constants.length(); i++) {
+      Constant con = _constants.at(i);
+      if (con.type() != type)  continue;  // Skip other types.
+
+      address constant_addr;
+      switch (con.type()) {
+      case T_LONG:   constant_addr = _masm.long_constant(  con.get_jlong()  ); break;
+      case T_FLOAT:  constant_addr = _masm.float_constant( con.get_jfloat() ); break;
+      case T_DOUBLE: constant_addr = _masm.double_constant(con.get_jdouble()); break;
+      case T_OBJECT: {
+        jobject obj = con.get_jobject();
+        int oop_index = _masm.oop_recorder()->find_index(obj);
+        constant_addr = _masm.address_constant((address) obj, oop_Relocation::spec(oop_index));
+        break;
+      }
+      case T_ADDRESS: {
+        address addr = (address) con.get_jobject();
+        constant_addr = _masm.address_constant(addr);
+        break;
+      }
+      // We use T_VOID as marker for jump-table entries (labels) which
+      // need an interal word relocation.
+      case T_VOID: {
+        // Write a dummy word.  The real value is filled in later
+        // in fill_jump_table_in_constant_table.
+        address addr = (address) con.get_jobject();
+        constant_addr = _masm.address_constant(addr);
+        break;
+      }
+      default: ShouldNotReachHere();
+      }
+      assert(constant_addr != NULL, "consts section too small");
+      assert((constant_addr - _masm.code()->consts()->start()) == con.offset(), err_msg("must be: %d == %d", constant_addr - _masm.code()->consts()->start(), con.offset()));
+    }
+  }
+}
+
+int Compile::ConstantTable::find_offset(Constant& con) const {
+  int idx = _constants.find(con);
+  assert(idx != -1, "constant must be in constant table");
+  int offset = _constants.at(idx).offset();
+  assert(offset != -1, "constant table not emitted yet?");
+  return offset;
+}
+
+void Compile::ConstantTable::add(Constant& con) {
+  if (con.can_be_reused()) {
+    int idx = _constants.find(con);
+    if (idx != -1 && _constants.at(idx).can_be_reused()) {
+      return;
+    }
+  }
+  (void) _constants.append(con);
+}
+
+Compile::Constant Compile::ConstantTable::add(BasicType type, jvalue value) {
+  Constant con(type, value);
+  add(con);
+  return con;
+}
+
+Compile::Constant Compile::ConstantTable::add(MachOper* oper) {
+  jvalue value;
+  BasicType type = oper->type()->basic_type();
+  switch (type) {
+  case T_LONG:    value.j = oper->constantL(); break;
+  case T_FLOAT:   value.f = oper->constantF(); break;
+  case T_DOUBLE:  value.d = oper->constantD(); break;
+  case T_OBJECT:
+  case T_ADDRESS: value.l = (jobject) oper->constant(); break;
+  default: ShouldNotReachHere();
+  }
+  return add(type, value);
+}
+
+Compile::Constant Compile::ConstantTable::allocate_jump_table(MachConstantNode* n) {
+  jvalue value;
+  // We can use the node pointer here to identify the right jump-table
+  // as this method is called from Compile::Fill_buffer right before
+  // the MachNodes are emitted and the jump-table is filled (means the
+  // MachNode pointers do not change anymore).
+  value.l = (jobject) n;
+  Constant con(T_VOID, value, false);  // Labels of a jump-table cannot be reused.
+  for (uint i = 0; i < n->outcnt(); i++) {
+    add(con);
+  }
+  return con;
+}
+
+void Compile::ConstantTable::fill_jump_table(CodeBuffer& cb, MachConstantNode* n, GrowableArray<Label*> labels) const {
+  // If called from Compile::scratch_emit_size do nothing.
+  if (Compile::current()->in_scratch_emit_size())  return;
+
+  assert(labels.is_nonempty(), "must be");
+  assert((uint) labels.length() == n->outcnt(), err_msg("must be equal: %d == %d", labels.length(), n->outcnt()));
+
+  // Since MachConstantNode::constant_offset() also contains
+  // table_base_offset() we need to subtract the table_base_offset()
+  // to get the plain offset into the constant table.
+  int offset = n->constant_offset() - table_base_offset();
+
+  MacroAssembler _masm(&cb);
+  address* jump_table_base = (address*) (_masm.code()->consts()->start() + offset);
+
+  for (int i = 0; i < labels.length(); i++) {
+    address* constant_addr = &jump_table_base[i];
+    assert(*constant_addr == (address) n, "all jump-table entries must contain node pointer");
+    *constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr);
+    cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type);
+  }
+}
--- a/src/share/vm/opto/compile.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/compile.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,24 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_COMPILE_HPP
+#define SHARE_VM_OPTO_COMPILE_HPP
+
+#include "asm/codeBuffer.hpp"
+#include "ci/compilerInterface.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/exceptionHandlerTable.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "libadt/dict.hpp"
+#include "libadt/port.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/resourceArea.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/phase.hpp"
+#include "opto/regmask.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/vmThread.hpp"
+
 class Block;
 class Bundle;
 class C2Compiler;
@@ -30,7 +48,10 @@
 class InlineTree;
 class Int_Array;
 class Matcher;
+class MachConstantNode;
+class MachConstantBaseNode;
 class MachNode;
+class MachOper;
 class MachSafePointNode;
 class Node;
 class Node_Array;
@@ -121,6 +142,81 @@
     trapHistLength = methodDataOopDesc::_trap_hist_limit
   };
 
+  // Constant entry of the constant table.
+  class Constant {
+  private:
+    BasicType _type;
+    jvalue    _value;
+    int       _offset;         // offset of this constant (in bytes) relative to the constant table base.
+    bool      _can_be_reused;  // true (default) if the value can be shared with other users.
+
+  public:
+    Constant() : _type(T_ILLEGAL), _offset(-1), _can_be_reused(true) { _value.l = 0; }
+    Constant(BasicType type, jvalue value, bool can_be_reused = true) :
+      _type(type),
+      _value(value),
+      _offset(-1),
+      _can_be_reused(can_be_reused)
+    {}
+
+    bool operator==(const Constant& other);
+
+    BasicType type()      const    { return _type; }
+
+    jlong   get_jlong()   const    { return _value.j; }
+    jfloat  get_jfloat()  const    { return _value.f; }
+    jdouble get_jdouble() const    { return _value.d; }
+    jobject get_jobject() const    { return _value.l; }
+
+    int         offset()  const    { return _offset; }
+    void    set_offset(int offset) {        _offset = offset; }
+
+    bool    can_be_reused() const  { return _can_be_reused; }
+  };
+
+  // Constant table.
+  class ConstantTable {
+  private:
+    GrowableArray<Constant> _constants;          // Constants of this table.
+    int                     _size;               // Size in bytes the emitted constant table takes (including padding).
+    int                     _table_base_offset;  // Offset of the table base that gets added to the constant offsets.
+
+  public:
+    ConstantTable() :
+      _size(-1),
+      _table_base_offset(-1)  // We can use -1 here since the constant table is always bigger than 2 bytes (-(size / 2), see MachConstantBaseNode::emit).
+    {}
+
+    int size() const { assert(_size != -1, "size not yet calculated"); return _size; }
+
+    void set_table_base_offset(int x)  { assert(_table_base_offset == -1, "set only once");                        _table_base_offset = x; }
+    int      table_base_offset() const { assert(_table_base_offset != -1, "table base offset not yet set"); return _table_base_offset; }
+
+    void emit(CodeBuffer& cb);
+
+    // Returns the offset of the last entry (the top) of the constant table.
+    int  top_offset() const { assert(_constants.top().offset() != -1, "constant not yet bound"); return _constants.top().offset(); }
+
+    void calculate_offsets_and_size();
+    int  find_offset(Constant& con) const;
+
+    void     add(Constant& con);
+    Constant add(BasicType type, jvalue value);
+    Constant add(MachOper* oper);
+    Constant add(jfloat f) {
+      jvalue value; value.f = f;
+      return add(T_FLOAT, value);
+    }
+    Constant add(jdouble d) {
+      jvalue value; value.d = d;
+      return add(T_DOUBLE, value);
+    }
+
+    // Jump table
+    Constant allocate_jump_table(MachConstantNode* n);
+    void         fill_jump_table(CodeBuffer& cb, MachConstantNode* n, GrowableArray<Label*> labels) const;
+  };
+
  private:
   // Fixed parameters to this compilation.
   const int             _compile_id;
@@ -194,6 +290,11 @@
   Node*                 _recent_alloc_obj;
   Node*                 _recent_alloc_ctl;
 
+  // Constant table
+  ConstantTable         _constant_table;        // The constant table for this compile.
+  MachConstantBaseNode* _mach_constant_base_node;  // Constant table base node singleton.
+
+
   // Blocked array of debugging and profiling information,
   // tracked per node.
   enum { _log2_node_notes_block_size = 8,
@@ -254,6 +355,8 @@
   static int            _CompiledZap_count;     // counter compared against CompileZap[First/Last]
   BufferBlob*           _scratch_buffer_blob;   // For temporary code buffers.
   relocInfo*            _scratch_locs_memory;   // For temporary code buffers.
+  int                   _scratch_const_size;    // For temporary code buffers.
+  bool                  _in_scratch_emit_size;  // true when in scratch_emit_size.
 
  public:
   // Accessors
@@ -436,6 +539,12 @@
                                                   _recent_alloc_obj = obj;
                                                 }
 
+  // Constant table
+  ConstantTable&   constant_table() { return _constant_table; }
+
+  MachConstantBaseNode*     mach_constant_base_node();
+  bool                  has_mach_constant_base_node() const { return _mach_constant_base_node != NULL; }
+
   // Handy undefined Node
   Node*             top() const                 { return _top; }
 
@@ -587,13 +696,16 @@
   Dependencies*     dependencies()              { return env()->dependencies(); }
   static int        CompiledZap_count()         { return _CompiledZap_count; }
   BufferBlob*       scratch_buffer_blob()       { return _scratch_buffer_blob; }
-  void         init_scratch_buffer_blob();
+  void         init_scratch_buffer_blob(int const_size);
+  void        clear_scratch_buffer_blob();
   void          set_scratch_buffer_blob(BufferBlob* b) { _scratch_buffer_blob = b; }
   relocInfo*        scratch_locs_memory()       { return _scratch_locs_memory; }
   void          set_scratch_locs_memory(relocInfo* b)  { _scratch_locs_memory = b; }
 
   // emit to scratch blob, report resulting size
   uint              scratch_emit_size(const Node* n);
+  void       set_in_scratch_emit_size(bool x)   {        _in_scratch_emit_size = x; }
+  bool           in_scratch_emit_size() const   { return _in_scratch_emit_size;     }
 
   enum ScratchBufferBlob {
     MAX_inst_size       = 1024,
@@ -674,7 +786,7 @@
   void Fill_buffer();
 
   // Determine which variable sized branches can be shortened
-  void Shorten_branches(Label *labels, int& code_size, int& reloc_size, int& stub_size, int& const_size);
+  void Shorten_branches(Label *labels, int& code_size, int& reloc_size, int& stub_size);
 
   // Compute the size of first NumberOfLoopInstrToAlign instructions
   // at the head of a loop.
@@ -777,3 +889,5 @@
   // Definitions of pd methods
   static void pd_compiler2_init();
 };
+
+#endif // SHARE_VM_OPTO_COMPILE_HPP
--- a/src/share/vm/opto/connode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/connode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,19 @@
  *
  */
 
-// Optimization - Graph Style
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/connode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_connode.cpp.incl"
+// Optimization - Graph Style
 
 //=============================================================================
 //------------------------------hash-------------------------------------------
--- a/src/share/vm/opto/connode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/connode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_CONNODE_HPP
+#define SHARE_VM_OPTO_CONNODE_HPP
+
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 class PhaseTransform;
 class MachNode;
 
@@ -695,3 +702,5 @@
   PopCountLNode(Node* in1) : CountBitsNode(in1) {}
   virtual int Opcode() const;
 };
+
+#endif // SHARE_VM_OPTO_CONNODE_HPP
--- a/src/share/vm/opto/divnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/divnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,12 +22,21 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_divnode.cpp.incl"
 #include <math.h>
 
 //----------------------magic_int_divide_constants-----------------------------
--- a/src/share/vm/opto/divnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/divnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_DIVNODE_HPP
+#define SHARE_VM_OPTO_DIVNODE_HPP
+
+#include "opto/multnode.hpp"
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
@@ -175,3 +183,5 @@
   // Make a divmod and associated projections from a div or mod.
   static DivModLNode* make(Compile* C, Node* div_or_mod);
 };
+
+#endif // SHARE_VM_OPTO_DIVNODE_HPP
--- a/src/share/vm/opto/doCall.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/doCall.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,23 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_doCall.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciCPCache.hpp"
+#include "ci/ciCallSite.hpp"
+#include "ci/ciMethodHandle.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileLog.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callGenerator.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/parse.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #ifndef PRODUCT
 void trace_type_profile(ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) {
--- a/src/share/vm/opto/domgraph.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/domgraph.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,18 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.hpp"
+#include "opto/block.hpp"
+#include "opto/machnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/rootnode.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_domgraph.cpp.incl"
-
 //------------------------------Tarjan-----------------------------------------
 // A data structure that holds all the information needed to find dominators.
 struct Tarjan {
--- a/src/share/vm/opto/escape.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/escape.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_escape.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/bcEscapeAnalyzer.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.hpp"
+#include "opto/c2compiler.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/escape.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/rootnode.hpp"
 
 void PointsToNode::add_edge(uint targIdx, PointsToNode::EdgeType et) {
   uint v = (targIdx << EdgeShift) + ((uint) et);
--- a/src/share/vm/opto/escape.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/escape.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_ESCAPE_HPP
+#define SHARE_VM_OPTO_ESCAPE_HPP
+
+#include "opto/addnode.hpp"
+#include "opto/node.hpp"
+#include "utilities/growableArray.hpp"
+
 //
 // Adaptation for C2 of the escape analysis algorithm described in:
 //
@@ -364,3 +371,5 @@
   void dump();
 #endif
 };
+
+#endif // SHARE_VM_OPTO_ESCAPE_HPP
--- a/src/share/vm/opto/gcm.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/gcm.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,36 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/block.hpp"
+#include "opto/c2compiler.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/deoptimization.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_gcm.cpp.incl"
-
 // To avoid float value underflow
 #define MIN_BLOCK_FREQUENCY 1.e-35f
 
@@ -66,7 +89,7 @@
   assert(in0 != NULL, "Only control-dependent");
   const Node *p = in0->is_block_proj();
   if (p != NULL && p != n) {    // Control from a block projection?
-    assert(!n->pinned() || n->is_SafePointScalarObject(), "only SafePointScalarObject pinned node is expected here");
+    assert(!n->pinned() || n->is_MachConstantBase() || n->is_SafePointScalarObject(), "only pinned MachConstantBase or SafePointScalarObject node is expected here");
     // Find trailing Region
     Block *pb = _bbs[in0->_idx]; // Block-projection already has basic block
     uint j = 0;
--- a/src/share/vm/opto/generateOptoStub.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/generateOptoStub.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_generateOptoStub.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/connode.hpp"
+#include "opto/locknode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/node.hpp"
+#include "opto/parse.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/type.hpp"
 
 //--------------------gen_stub-------------------------------
 void GraphKit::gen_stub(address C_function,
--- a/src/share/vm/opto/graphKit.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/graphKit.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,23 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_graphKit.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "opto/addnode.hpp"
+#include "opto/graphKit.hpp"
+#include "opto/idealKit.hpp"
+#include "opto/locknode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/parse.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 //----------------------------GraphKit-----------------------------------------
 // Main utility constructor.
@@ -569,7 +584,8 @@
       const TypePtr* adr_typ = ex_con->add_offset(offset);
 
       Node *adr = basic_plus_adr(ex_node, ex_node, offset);
-      Node *store = store_oop_to_object(control(), ex_node, adr, adr_typ, null(), ex_con, T_OBJECT);
+      const TypeOopPtr* val_type = TypeOopPtr::make_from_klass(env()->String_klass());
+      Node *store = store_oop_to_object(control(), ex_node, adr, adr_typ, null(), val_type, T_OBJECT);
 
       add_exception_state(make_exception_state(ex_node));
       return;
@@ -1825,7 +1841,7 @@
 
   // Note:  If ProfileTraps is true, and if a deopt. actually
   // occurs here, the runtime will make sure an MDO exists.  There is
-  // no need to call method()->build_method_data() at this point.
+  // no need to call method()->ensure_method_data() at this point.
 
 #ifdef ASSERT
   if (!must_throw) {
--- a/src/share/vm/opto/graphKit.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/graphKit.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,22 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_GRAPHKIT_HPP
+#define SHARE_VM_OPTO_GRAPHKIT_HPP
+
+#include "ci/ciEnv.hpp"
+#include "ci/ciMethodData.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/divnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
+#include "opto/type.hpp"
+#include "runtime/deoptimization.hpp"
+
 class FastLockNode;
 class FastUnlockNode;
 class IdealKit;
@@ -824,3 +840,5 @@
   PreserveReexecuteState(GraphKit* kit);
   ~PreserveReexecuteState();
 };
+
+#endif // SHARE_VM_OPTO_GRAPHKIT_HPP
--- a/src/share/vm/opto/idealGraphPrinter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/idealGraphPrinter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_idealGraphPrinter.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/machnode.hpp"
+#include "opto/parse.hpp"
+#include "runtime/threadCritical.hpp"
 
 #ifndef PRODUCT
 
--- a/src/share/vm/opto/idealGraphPrinter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/idealGraphPrinter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP
+#define SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP
+
+#include "libadt/dict.hpp"
+#include "libadt/vectset.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/ostream.hpp"
+#include "utilities/xmlstream.hpp"
+
 #ifndef PRODUCT
 
 class Compile;
@@ -140,3 +149,5 @@
 };
 
 #endif
+
+#endif // SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP
--- a/src/share/vm/opto/idealKit.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/idealKit.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_idealKit.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/idealKit.hpp"
+#include "opto/runtime.hpp"
 
 // Static initialization
 
--- a/src/share/vm/opto/idealKit.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/idealKit.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_IDEALKIT_HPP
+#define SHARE_VM_OPTO_IDEALKIT_HPP
+
+#include "opto/addnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
+#include "opto/type.hpp"
+
 //-----------------------------------------------------------------------------
 //----------------------------IdealKit-----------------------------------------
 // Set of utilities for creating control flow and scalar SSA data flow.
@@ -228,3 +240,5 @@
                       Node* parm1 = NULL,
                       Node* parm2 = NULL);
 };
+
+#endif // SHARE_VM_OPTO_IDEALKIT_HPP
--- a/src/share/vm/opto/ifg.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/ifg.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_ifg.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/oopMap.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/block.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/coalesce.hpp"
+#include "opto/connode.hpp"
+#include "opto/indexSet.hpp"
+#include "opto/machnode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/opcodes.hpp"
 
 #define EXACT_PRESSURE 1
 
--- a/src/share/vm/opto/ifnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/ifnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,19 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_ifnode.cpp.incl"
-
 
 extern int explicit_null_checks_elided;
 
--- a/src/share/vm/opto/indexSet.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/indexSet.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,17 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/compile.hpp"
+#include "opto/indexSet.hpp"
+#include "opto/regmask.hpp"
+
 // This file defines the IndexSet class, a set of sparse integer indices.
 // This data structure is used by the compiler in its liveness analysis and
 // during register allocation.  It also defines an iterator for this class.
 
-#include "incls/_precompiled.incl"
-#include "incls/_indexSet.cpp.incl"
-
 //-------------------------------- Initializations ------------------------------
 
 IndexSet::BitBlock  IndexSet::_empty_block     = IndexSet::BitBlock();
--- a/src/share/vm/opto/indexSet.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/indexSet.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_INDEXSET_HPP
+#define SHARE_VM_OPTO_INDEXSET_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/resourceArea.hpp"
+#include "opto/compile.hpp"
+#include "opto/regmask.hpp"
+
 // This file defines the IndexSet class, a set of sparse integer indices.
 // This data structure is used by the compiler in its liveness analysis and
 // during register allocation.
@@ -459,3 +467,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_OPTO_INDEXSET_HPP
--- a/src/share/vm/opto/lcm.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/lcm.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,10 +22,28 @@
  *
  */
 
-// Optimization - Graph Style
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/block.hpp"
+#include "opto/c2compiler.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/runtime.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
 
-#include "incls/_precompiled.incl"
-#include "incls/_lcm.cpp.incl"
+// Optimization - Graph Style
 
 //------------------------------implicit_null_check----------------------------
 // Detect implicit-null-check opportunities.  Basically, find NULL checks
--- a/src/share/vm/opto/library_call.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/library_call.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_library_call.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileLog.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callGenerator.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/idealKit.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/parse.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 class LibraryIntrinsic : public InlineCallGenerator {
   // Extend the set of intrinsics known to the runtime:
--- a/src/share/vm/opto/live.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/live.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_live.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/callnode.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/live.hpp"
+#include "opto/machnode.hpp"
 
 
 
--- a/src/share/vm/opto/live.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/live.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_LIVE_HPP
+#define SHARE_VM_OPTO_LIVE_HPP
+
+#include "libadt/port.hpp"
+#include "libadt/vectset.hpp"
+#include "opto/block.hpp"
+#include "opto/indexSet.hpp"
+#include "opto/phase.hpp"
+#include "opto/regmask.hpp"
+
 class Block;
 class LRG_List;
 class PhaseCFG;
@@ -72,3 +82,5 @@
   void stats(uint iters) const;
 #endif
 };
+
+#endif // SHARE_VM_OPTO_LIVE_HPP
--- a/src/share/vm/opto/locknode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/locknode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_locknode.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/locknode.hpp"
+#include "opto/parse.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
 
 //=============================================================================
 const RegMask &BoxLockNode::in_RegMask(uint i) const {
--- a/src/share/vm/opto/locknode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/locknode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,25 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_LOCKNODE_HPP
+#define SHARE_VM_OPTO_LOCKNODE_HPP
+
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/subnode.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
+
 //------------------------------BoxLockNode------------------------------------
 class BoxLockNode : public Node {
 public:
@@ -100,3 +119,5 @@
   const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;}
 
 };
+
+#endif // SHARE_VM_OPTO_LOCKNODE_HPP
--- a/src/share/vm/opto/loopTransform.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/loopTransform.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_loopTransform.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
 
 //------------------------------is_loop_exit-----------------------------------
 // Given an IfNode, return the loop-exiting projection or NULL if both
--- a/src/share/vm/opto/loopUnswitch.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/loopUnswitch.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_loopUnswitch.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/connode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/rootnode.hpp"
 
 //================= Loop Unswitching =====================
 //
--- a/src/share/vm/opto/loopnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/loopnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_loopnode.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethodData.hpp"
+#include "compiler/compileLog.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/superword.hpp"
 
 //=============================================================================
 //------------------------------is_loop_iv-------------------------------------
--- a/src/share/vm/opto/loopnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/loopnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_LOOPNODE_HPP
+#define SHARE_VM_OPTO_LOOPNODE_HPP
+
+#include "opto/cfgnode.hpp"
+#include "opto/multnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
+#include "opto/type.hpp"
+
 class CmpNode;
 class CountedLoopEndNode;
 class CountedLoopNode;
@@ -1015,3 +1024,5 @@
 
   IdealLoopTree* current() { return _curnt; }  // Return current value of iterator.
 };
+
+#endif // SHARE_VM_OPTO_LOOPNODE_HPP
--- a/src/share/vm/opto/loopopts.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/loopopts.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,15 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_loopopts.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/subnode.hpp"
 
 //=============================================================================
 //------------------------------split_thru_phi---------------------------------
--- a/src/share/vm/opto/machnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/machnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_machnode.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "opto/machnode.hpp"
+#include "opto/regalloc.hpp"
 
 //=============================================================================
 // Return the value requested
@@ -487,6 +489,20 @@
 }
 #endif
 
+
+//=============================================================================
+int MachConstantNode::constant_offset() {
+  int offset = _constant.offset();
+  // Bind the offset lazily.
+  if (offset == -1) {
+    Compile::ConstantTable& constant_table = Compile::current()->constant_table();
+    offset = constant_table.table_base_offset() + constant_table.find_offset(_constant);
+    _constant.set_offset(offset);
+  }
+  return offset;
+}
+
+
 //=============================================================================
 #ifndef PRODUCT
 void MachNullCheckNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
--- a/src/share/vm/opto/machnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/machnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_MACHNODE_HPP
+#define SHARE_VM_OPTO_MACHNODE_HPP
+
+#include "opto/callnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/multnode.hpp"
+#include "opto/node.hpp"
+#include "opto/regmask.hpp"
+
 class BufferBlob;
 class CodeBuffer;
 class JVMState;
@@ -222,9 +231,6 @@
   // Return number of relocatable values contained in this instruction
   virtual int   reloc() const { return 0; }
 
-  // Return number of words used for double constants in this instruction
-  virtual int   const_size() const { return 0; }
-
   // Hash and compare over operands.  Used to do GVN on machine Nodes.
   virtual uint  hash() const;
   virtual uint  cmp( const Node &n ) const;
@@ -339,6 +345,65 @@
 #endif
 };
 
+//------------------------------MachConstantBaseNode--------------------------
+// Machine node that represents the base address of the constant table.
+class MachConstantBaseNode : public MachIdealNode {
+public:
+  static const RegMask& _out_RegMask;  // We need the out_RegMask statically in MachConstantNode::in_RegMask().
+
+public:
+  MachConstantBaseNode() : MachIdealNode() {
+    init_class_id(Class_MachConstantBase);
+  }
+  virtual const class Type* bottom_type() const { return TypeRawPtr::NOTNULL; }
+  virtual uint ideal_reg() const { return Op_RegP; }
+  virtual uint oper_input_base() const { return 1; }
+
+  virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const;
+  virtual uint size(PhaseRegAlloc* ra_) const;
+  virtual bool pinned() const { return UseRDPCForConstantTableBase; }
+
+  static const RegMask& static_out_RegMask() { return _out_RegMask; }
+  virtual const RegMask& out_RegMask() const { return static_out_RegMask(); }
+
+#ifndef PRODUCT
+  virtual const char* Name() const { return "MachConstantBaseNode"; }
+  virtual void format(PhaseRegAlloc*, outputStream* st) const;
+#endif
+};
+
+//------------------------------MachConstantNode-------------------------------
+// Machine node that holds a constant which is stored in the constant table.
+class MachConstantNode : public MachNode {
+protected:
+  Compile::Constant _constant;  // This node's constant.
+
+public:
+  MachConstantNode() : MachNode() {
+    init_class_id(Class_MachConstant);
+  }
+
+  virtual void eval_constant(Compile* C) {
+#ifdef ASSERT
+    tty->print("missing MachConstantNode eval_constant function: ");
+    dump();
+#endif
+    ShouldNotCallThis();
+  }
+
+  virtual const RegMask &in_RegMask(uint idx) const {
+    if (idx == mach_constant_base_node_input())
+      return MachConstantBaseNode::static_out_RegMask();
+    return MachNode::in_RegMask(idx);
+  }
+
+  // Input edge of MachConstantBaseNode.
+  uint mach_constant_base_node_input() const { return req() - 1; }
+
+  int  constant_offset();
+  int  constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
+};
+
 //------------------------------MachUEPNode-----------------------------------
 // Machine Unvalidated Entry Point Node
 class MachUEPNode : public MachIdealNode {
@@ -828,3 +893,5 @@
   virtual void ext_format(PhaseRegAlloc *ra, const MachNode *node, int idx, outputStream *st) const { int_format( ra, node, st ); }
 #endif
 };
+
+#endif // SHARE_VM_OPTO_MACHNODE_HPP
--- a/src/share/vm/opto/macro.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/macro.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,25 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_macro.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "libadt/vectset.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/connode.hpp"
+#include "opto/locknode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/macro.hpp"
+#include "opto/memnode.hpp"
+#include "opto/node.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+#include "opto/type.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 
 //
--- a/src/share/vm/opto/macro.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/macro.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_MACRO_HPP
+#define SHARE_VM_OPTO_MACRO_HPP
+
+#include "opto/phase.hpp"
+
 class  AllocateNode;
 class  AllocateArrayNode;
 class  CallNode;
@@ -116,3 +121,5 @@
   bool expand_macro_nodes();
 
 };
+
+#endif // SHARE_VM_OPTO_MACRO_HPP
--- a/src/share/vm/opto/matcher.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/matcher.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,33 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_matcher.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/regmask.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/type.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
 
 OptoReg::Name OptoReg::c_frame_pointer;
 
--- a/src/share/vm/opto/matcher.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/matcher.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_MATCHER_HPP
+#define SHARE_VM_OPTO_MATCHER_HPP
+
+#include "libadt/vectset.hpp"
+#include "memory/resourceArea.hpp"
+#include "opto/node.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/regmask.hpp"
+
 class Compile;
 class Node;
 class MachNode;
@@ -356,6 +365,10 @@
   // registers?  True for Intel but false for most RISCs
   static const bool clone_shift_expressions;
 
+  // Should constant table entries be accessed with loads using
+  // absolute addressing?  True for x86 but false for most RISCs.
+  static const bool constant_table_absolute_addressing;
+
   static bool narrow_oop_use_complex_address();
 
   // Generate implicit null check for narrow oops if it can fold
@@ -447,3 +460,5 @@
   }
 #endif
 };
+
+#endif // SHARE_VM_OPTO_MATCHER_HPP
--- a/src/share/vm/opto/memnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/memnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,27 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "compiler/compileLog.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "opto/addnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/compile.hpp"
+#include "opto/connode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/regmask.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_memnode.cpp.incl"
-
 static Node *step_through_mergemem(PhaseGVN *phase, MergeMemNode *mmem,  const TypePtr *tp, const TypePtr *adr_check, outputStream *st);
 
 //=============================================================================
@@ -3585,10 +3599,12 @@
     intptr_t size_limit = phase->find_intptr_t_con(size_in_bytes, max_jint);
     if (zeroes_done + BytesPerLong >= size_limit) {
       assert(allocation() != NULL, "");
-      Node* klass_node = allocation()->in(AllocateNode::KlassNode);
-      ciKlass* k = phase->type(klass_node)->is_klassptr()->klass();
-      if (zeroes_done == k->layout_helper())
-        zeroes_done = size_limit;
+      if (allocation()->Opcode() == Op_Allocate) {
+        Node* klass_node = allocation()->in(AllocateNode::KlassNode);
+        ciKlass* k = phase->type(klass_node)->is_klassptr()->klass();
+        if (zeroes_done == k->layout_helper())
+          zeroes_done = size_limit;
+      }
     }
     if (zeroes_done < size_limit) {
       rawmem = ClearArrayNode::clear_memory(rawctl, rawmem, rawptr,
--- a/src/share/vm/opto/memnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/memnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_MEMNODE_HPP
+#define SHARE_VM_OPTO_MEMNODE_HPP
+
+#include "opto/multnode.hpp"
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 class MultiNode;
@@ -1250,3 +1258,5 @@
   virtual uint match_edge(uint idx) const { return idx==2; }
   virtual const Type *bottom_type() const { return ( AllocatePrefetchStyle == 3 ) ? Type::MEMORY : Type::ABIO; }
 };
+
+#endif // SHARE_VM_OPTO_MEMNODE_HPP
--- a/src/share/vm/opto/mulnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/mulnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,16 @@
  *
  */
 
-// Portions of code courtesy of Clifford Click
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
 
-#include "incls/_precompiled.incl"
-#include "incls/_mulnode.cpp.incl"
+// Portions of code courtesy of Clifford Click
 
 
 //=============================================================================
--- a/src/share/vm/opto/mulnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/mulnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_MULNODE_HPP
+#define SHARE_VM_OPTO_MULNODE_HPP
+
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 class PhaseTransform;
@@ -255,3 +262,5 @@
   const Type *bottom_type() const { return TypeLong::LONG; }
   virtual uint ideal_reg() const { return Op_RegL; }
 };
+
+#endif // SHARE_VM_OPTO_MULNODE_HPP
--- a/src/share/vm/opto/multnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/multnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_multnode.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/matcher.hpp"
+#include "opto/multnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/regmask.hpp"
+#include "opto/type.hpp"
 
 //=============================================================================
 //------------------------------MultiNode--------------------------------------
--- a/src/share/vm/opto/multnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/multnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_MULTNODE_HPP
+#define SHARE_VM_OPTO_MULTNODE_HPP
+
+#include "opto/node.hpp"
+
 class Matcher;
 class ProjNode;
 
@@ -82,3 +87,5 @@
   virtual void dump_spec(outputStream *st) const;
 #endif
 };
+
+#endif // SHARE_VM_OPTO_MULTNODE_HPP
--- a/src/share/vm/opto/node.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/node.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_node.cpp.incl"
+#include "precompiled.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/regmask.hpp"
+#include "opto/type.hpp"
+#include "utilities/copy.hpp"
 
 class RegMask;
 // #include "phase.hpp"
--- a/src/share/vm/opto/node.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/node.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_NODE_HPP
+#define SHARE_VM_OPTO_NODE_HPP
+
+#include "libadt/port.hpp"
+#include "libadt/vectset.hpp"
+#include "opto/compile.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
@@ -73,6 +81,8 @@
 class MachCallNode;
 class MachCallRuntimeNode;
 class MachCallStaticJavaNode;
+class MachConstantBaseNode;
+class MachConstantNode;
 class MachIfNode;
 class MachNode;
 class MachNullCheckNode;
@@ -558,10 +568,12 @@
               DEFINE_CLASS_ID(MachCallDynamicJava,  MachCallJava, 1)
             DEFINE_CLASS_ID(MachCallRuntime,      MachCall, 1)
               DEFINE_CLASS_ID(MachCallLeaf,         MachCallRuntime, 0)
-      DEFINE_CLASS_ID(MachSpillCopy, Mach, 1)
-      DEFINE_CLASS_ID(MachNullCheck, Mach, 2)
-      DEFINE_CLASS_ID(MachIf,        Mach, 3)
-      DEFINE_CLASS_ID(MachTemp,      Mach, 4)
+      DEFINE_CLASS_ID(MachSpillCopy,    Mach, 1)
+      DEFINE_CLASS_ID(MachNullCheck,    Mach, 2)
+      DEFINE_CLASS_ID(MachIf,           Mach, 3)
+      DEFINE_CLASS_ID(MachTemp,         Mach, 4)
+      DEFINE_CLASS_ID(MachConstantBase, Mach, 5)
+      DEFINE_CLASS_ID(MachConstant,     Mach, 6)
 
     DEFINE_CLASS_ID(Proj,  Node, 2)
       DEFINE_CLASS_ID(CatchProj, Proj, 0)
@@ -726,6 +738,8 @@
   DEFINE_CLASS_QUERY(MachCallLeaf)
   DEFINE_CLASS_QUERY(MachCallRuntime)
   DEFINE_CLASS_QUERY(MachCallStaticJava)
+  DEFINE_CLASS_QUERY(MachConstantBase)
+  DEFINE_CLASS_QUERY(MachConstant)
   DEFINE_CLASS_QUERY(MachIf)
   DEFINE_CLASS_QUERY(MachNullCheck)
   DEFINE_CLASS_QUERY(MachReturn)
@@ -1554,3 +1568,5 @@
   virtual void dump_spec(outputStream *st) const;
 #endif
 };
+
+#endif // SHARE_VM_OPTO_NODE_HPP
--- a/src/share/vm/opto/opcodes.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/opcodes.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,8 @@
  *
  */
 
+// no precompiled headers
+
 // ----------------------------------------------------------------------------
 // Build a table of class names as strings.  Used both for debugging printouts
 // and in the ADL machine descriptions.
--- a/src/share/vm/opto/opcodes.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/opcodes.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_OPCODES_HPP
+#define SHARE_VM_OPTO_OPCODES_HPP
+
 // Build a big enum of class names to give them dense integer indices
 #define macro(x) Op_##x,
 enum Opcodes {
@@ -42,3 +45,5 @@
 
 // Table of names, indexed by Opcode
 extern const char *NodeClassNames[];
+
+#endif // SHARE_VM_OPTO_OPCODES_HPP
--- a/src/share/vm/opto/optoreg.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/optoreg.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_OPTOREG_HPP
+#define SHARE_VM_OPTO_OPTOREG_HPP
+
 //------------------------------OptoReg----------------------------------------
 // We eventually need Registers for the Real World.  Registers are essentially
 // non-SSA names.  A Register is represented as a number.  Non-regular values
@@ -192,3 +195,5 @@
   OptoRegPair(OptoReg::Name f) { _second = OptoReg::Bad; _first = f; }
   OptoRegPair() { _second = OptoReg::Bad; _first = OptoReg::Bad; }
 };
+
+#endif // SHARE_VM_OPTO_OPTOREG_HPP
--- a/src/share/vm/opto/output.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/output.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,24 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_output.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.inline.hpp"
+#include "code/debugInfo.hpp"
+#include "code/debugInfoRec.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/oopMap.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/locknode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/output.hpp"
+#include "opto/regalloc.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+#include "opto/type.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/xmlstream.hpp"
 
 extern uint size_java_to_interp();
 extern uint reloc_java_to_interp();
@@ -45,11 +61,6 @@
   // RootNode goes
   assert( _cfg->_broot->_nodes.size() == 0, "" );
 
-  // Initialize the space for the BufferBlob used to find and verify
-  // instruction size in MachNode::emit_size()
-  init_scratch_buffer_blob();
-  if (failing())  return; // Out of memory
-
   // The number of new nodes (mostly MachNop) is proportional to
   // the number of java calls and inner loops which are aligned.
   if ( C->check_node_count((NodeLimitFudgeFactor + C->java_calls()*3 +
@@ -317,7 +328,7 @@
 //----------------------Shorten_branches---------------------------------------
 // The architecture description provides short branch variants for some long
 // branch instructions. Replace eligible long branches with short branches.
-void Compile::Shorten_branches(Label *labels, int& code_size, int& reloc_size, int& stub_size, int& const_size) {
+void Compile::Shorten_branches(Label *labels, int& code_size, int& reloc_size, int& stub_size) {
 
   // fill in the nop array for bundling computations
   MachNode *_nop_list[Bundle::_nop_count];
@@ -337,12 +348,11 @@
   // Size in bytes of all relocation entries, including those in local stubs.
   // Start with 2-bytes of reloc info for the unvalidated entry point
   reloc_size = 1;          // Number of relocation entries
-  const_size = 0;          // size of fp constants in words
 
   // Make three passes.  The first computes pessimistic blk_starts,
-  // relative jmp_end, reloc_size and const_size information.
-  // The second performs short branch substitution using the pessimistic
-  // sizing. The third inserts nops where needed.
+  // relative jmp_end and reloc_size information.  The second performs
+  // short branch substitution using the pessimistic sizing.  The
+  // third inserts nops where needed.
 
   Node *nj; // tmp
 
@@ -365,7 +375,6 @@
         MachNode *mach = nj->as_Mach();
         blk_size += (mach->alignment_required() - 1) * relocInfo::addr_unit(); // assume worst case padding
         reloc_size += mach->reloc();
-        const_size += mach->const_size();
         if( mach->is_MachCall() ) {
           MachCallNode *mcall = mach->as_MachCall();
           // This destination address is NOT PC-relative
@@ -382,10 +391,6 @@
           if (min_offset_from_last_call == 0) {
             blk_size += nop_size;
           }
-        } else if (mach->ideal_Opcode() == Op_Jump) {
-          const_size += b->_num_succs; // Address table size
-          // The size is valid even for 64 bit since it is
-          // multiplied by 2*jintSize on this method exit.
         }
       }
       min_offset_from_last_call += inst_size;
@@ -546,10 +551,6 @@
   // a relocation index.
   // The CodeBuffer will expand the locs array if this estimate is too low.
   reloc_size   *= 10 / sizeof(relocInfo);
-
-  // Adjust const_size to number of bytes
-  const_size   *= 2*jintSize; // both float and double take two words per entry
-
 }
 
 //------------------------------FillLocArray-----------------------------------
@@ -1086,10 +1087,39 @@
     blk_labels[i].init();
   }
 
+  if (has_mach_constant_base_node()) {
+    // Fill the constant table.
+    // Note:  This must happen before Shorten_branches.
+    for (i = 0; i < _cfg->_num_blocks; i++) {
+      Block* b = _cfg->_blocks[i];
+
+      for (uint j = 0; j < b->_nodes.size(); j++) {
+        Node* n = b->_nodes[j];
+
+        // If the node is a MachConstantNode evaluate the constant
+        // value section.
+        if (n->is_MachConstant()) {
+          MachConstantNode* machcon = n->as_MachConstant();
+          machcon->eval_constant(C);
+        }
+      }
+    }
+
+    // Calculate the offsets of the constants and the size of the
+    // constant table (including the padding to the next section).
+    constant_table().calculate_offsets_and_size();
+    const_req = constant_table().size();
+  }
+
+  // Initialize the space for the BufferBlob used to find and verify
+  // instruction size in MachNode::emit_size()
+  init_scratch_buffer_blob(const_req);
+  if (failing())  return; // Out of memory
+
   // If this machine supports different size branch offsets, then pre-compute
   // the length of the blocks
   if( _matcher->is_short_branch_offset(-1, 0) ) {
-    Shorten_branches(blk_labels, code_req, locs_req, stub_req, const_req);
+    Shorten_branches(blk_labels, code_req, locs_req, stub_req);
     labels_not_set = false;
   }
 
@@ -1105,12 +1135,12 @@
     code_req = const_req = stub_req = exception_handler_req = deopt_handler_req = 0x10;  // force expansion
 
   int total_req =
+    const_req +
     code_req +
     pad_req +
     stub_req +
     exception_handler_req +
-    deopt_handler_req +              // deopt handler
-    const_req;
+    deopt_handler_req;               // deopt handler
 
   if (has_method_handle_invokes())
     total_req += deopt_handler_req;  // deopt MH handler
@@ -1164,6 +1194,11 @@
 
   NonSafepointEmitter non_safepoints(this);  // emit non-safepoints lazily
 
+  // Emit the constant table.
+  if (has_mach_constant_base_node()) {
+    constant_table().emit(*cb);
+  }
+
   // ------------------
   // Now fill in the code buffer
   Node *delay_slot = NULL;
@@ -1180,12 +1215,13 @@
       cb->flush_bundle(true);
 
     // Define the label at the beginning of the basic block
-    if( labels_not_set )
-      MacroAssembler(cb).bind( blk_labels[b->_pre_order] );
-
-    else
-      assert( blk_labels[b->_pre_order].loc_pos() == cb->insts_size(),
-              "label position does not match code offset" );
+    if (labels_not_set) {
+      MacroAssembler(cb).bind(blk_labels[b->_pre_order]);
+    } else {
+      assert(blk_labels[b->_pre_order].loc_pos() == cb->insts_size(),
+             err_msg("label position does not match code offset: %d != %d",
+                     blk_labels[b->_pre_order].loc_pos(), cb->insts_size()));
+    }
 
     uint last_inst = b->_nodes.size();
 
@@ -1702,9 +1738,17 @@
   // Create a data structure for all the scheduling information
   Scheduling scheduling(Thread::current()->resource_area(), *this);
 
+  // Initialize the space for the BufferBlob used to find and verify
+  // instruction size in MachNode::emit_size()
+  init_scratch_buffer_blob(MAX_const_size);
+  if (failing())  return;  // Out of memory
+
   // Walk backwards over each basic block, computing the needed alignment
   // Walk over all the basic blocks
   scheduling.DoScheduling();
+
+  // Clear the BufferBlob used for scheduling.
+  clear_scratch_buffer_blob();
 }
 
 //------------------------------ComputeLocalLatenciesForward-------------------
--- a/src/share/vm/opto/output.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/output.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,24 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_OUTPUT_HPP
+#define SHARE_VM_OPTO_OUTPUT_HPP
+
+#include "opto/block.hpp"
+#include "opto/node.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
+
 class Arena;
 class Bundle;
 class Block;
@@ -213,3 +231,5 @@
 #endif
 
 };
+
+#endif // SHARE_VM_OPTO_OUTPUT_HPP
--- a/src/share/vm/opto/parse.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/parse.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_PARSE_HPP
+#define SHARE_VM_OPTO_PARSE_HPP
+
+#include "ci/ciMethodData.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "compiler/methodLiveness.hpp"
+#include "libadt/vectset.hpp"
+#include "oops/generateOopMap.hpp"
+#include "opto/graphKit.hpp"
+#include "opto/subnode.hpp"
+
 class BytecodeParseHistogram;
 class InlineTree;
 class Parse;
@@ -567,3 +578,5 @@
   void dump_bci(int bci);
 #endif
 };
+
+#endif // SHARE_VM_OPTO_PARSE_HPP
--- a/src/share/vm/opto/parse1.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/parse1.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_parse1.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "oops/methodOop.hpp"
+#include "opto/addnode.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/locknode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/parse.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "utilities/copy.hpp"
 
 // Static array so we can figure out which bytecodes stop us from compiling
 // the most. Some of the non-static variables are needed in bytecodeInfo.cpp
--- a/src/share/vm/opto/parse2.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/parse2.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,23 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_parse2.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethodData.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileLog.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/universe.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/parse.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 extern int explicit_null_checks_inserted,
            explicit_null_checks_elided;
--- a/src/share/vm/opto/parse3.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/parse3.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_parse3.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "opto/addnode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/parse.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/handles.inline.hpp"
 
 //=============================================================================
 // Helper methods for _get* and _put* bytecodes
--- a/src/share/vm/opto/parseHelper.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/parseHelper.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_parseHelper.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "compiler/compileLog.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "opto/addnode.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/parse.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 //------------------------------make_dtrace_method_entry_exit ----------------
 // Dtrace -- record entry or exit of a method if compiled with dtrace support
--- a/src/share/vm/opto/phase.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/phase.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_phase.cpp.incl"
+#include "precompiled.hpp"
+#include "code/nmethod.hpp"
+#include "compiler/compileBroker.hpp"
+#include "opto/compile.hpp"
+#include "opto/node.hpp"
+#include "opto/phase.hpp"
 
 #ifndef PRODUCT
 int Phase::_total_bytes_compiled = 0;
--- a/src/share/vm/opto/phase.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/phase.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_PHASE_HPP
+#define SHARE_VM_OPTO_PHASE_HPP
+
+#include "libadt/port.hpp"
+#include "runtime/timer.hpp"
+
 class Compile;
 
 //------------------------------Phase------------------------------------------
@@ -109,3 +115,5 @@
   static void print_timers();
 #endif
 };
+
+#endif // SHARE_VM_OPTO_PHASE_HPP
--- a/src/share/vm/opto/phaseX.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/phaseX.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_phaseX.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/block.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/machnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/regalloc.hpp"
+#include "opto/rootnode.hpp"
 
 //=============================================================================
 #define NODE_HASH_MINIMUM_SIZE    255
--- a/src/share/vm/opto/phaseX.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/phaseX.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_PHASEX_HPP
+#define SHARE_VM_OPTO_PHASEX_HPP
+
+#include "libadt/dict.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/resourceArea.hpp"
+#include "opto/memnode.hpp"
+#include "opto/node.hpp"
+#include "opto/phase.hpp"
+#include "opto/type.hpp"
+
 class Compile;
 class ConINode;
 class ConLNode;
@@ -535,3 +546,5 @@
   static void print_statistics();
 #endif
 };
+
+#endif // SHARE_VM_OPTO_PHASEX_HPP
--- a/src/share/vm/opto/postaloc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/postaloc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_postaloc.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/machnode.hpp"
 
 // see if this register kind does not requires two registers
 static bool is_single_register(uint x) {
@@ -198,6 +200,19 @@
   // then reloaded BUT survives in a register the whole way.
   Node *val = skip_copies(n->in(k));
 
+  if (val == x && nk_idx != 0 &&
+      regnd[nk_reg] != NULL && regnd[nk_reg] != x &&
+      n2lidx(x) == n2lidx(regnd[nk_reg])) {
+    // When rematerialzing nodes and stretching lifetimes, the
+    // allocator will reuse the original def for multidef LRG instead
+    // of the current reaching def because it can't know it's safe to
+    // do so.  After allocation completes if they are in the same LRG
+    // then it should use the current reaching def instead.
+    n->set_req(k, regnd[nk_reg]);
+    blk_adjust += yank_if_dead(val, current_block, &value, &regnd);
+    val = skip_copies(n->in(k));
+  }
+
   if( val == x ) return blk_adjust; // No progress?
 
   bool single = is_single_register(val->ideal_reg());
--- a/src/share/vm/opto/reg_split.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/reg_split.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_reg_split.cpp.incl"
+#include "precompiled.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/c2compiler.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/machnode.hpp"
 
 //------------------------------Split--------------------------------------
 // Walk the graph in RPO and for each lrg which spills, propagate reaching
@@ -1231,6 +1239,7 @@
   // Cycle through this block's predecessors, collecting Reaches
   // info for each spilled LRG and update edges.
   // Walk the phis list to patch inputs, split phis, and name phis
+  uint lrgs_before_phi_split = maxlrg;
   for( insidx = 0; insidx < phis->size(); insidx++ ) {
     Node *phi = phis->at(insidx);
     assert(phi->is_Phi(),"This list must only contain Phi Nodes");
@@ -1265,7 +1274,16 @@
       assert( def, "must have reaching def" );
       // If input up/down sense and reg-pressure DISagree
       if( def->rematerialize() ) {
-        def = split_Rematerialize( def, pred, pred->end_idx(), maxlrg, splits, slidx, lrg2reach, Reachblock, false );
+        // Place the rematerialized node above any MSCs created during
+        // phi node splitting.  end_idx points at the insertion point
+        // so look at the node before it.
+        int insert = pred->end_idx();
+        while (insert >= 1 &&
+               pred->_nodes[insert - 1]->is_SpillCopy() &&
+               Find(pred->_nodes[insert - 1]) >= lrgs_before_phi_split) {
+          insert--;
+        }
+        def = split_Rematerialize( def, pred, insert, maxlrg, splits, slidx, lrg2reach, Reachblock, false );
         if( !def ) return 0;    // Bail out
       }
       // Update the Phi's input edge array
--- a/src/share/vm/opto/regalloc.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/regalloc.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_regalloc.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/regalloc.hpp"
 
 static const int NodeRegsOverflowSize = 200;
 
--- a/src/share/vm/opto/regalloc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/regalloc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_REGALLOC_HPP
+#define SHARE_VM_OPTO_REGALLOC_HPP
+
+#include "code/vmreg.hpp"
+#include "opto/block.hpp"
+#include "opto/matcher.hpp"
+#include "opto/phase.hpp"
+
 class Node;
 class Matcher;
 class PhaseCFG;
@@ -131,3 +139,5 @@
   static void print_statistics();
 #endif
 };
+
+#endif // SHARE_VM_OPTO_REGALLOC_HPP
--- a/src/share/vm/opto/regmask.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/regmask.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_regmask.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/compile.hpp"
+#include "opto/regmask.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
 
 #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */
 
--- a/src/share/vm/opto/regmask.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/regmask.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,25 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_REGMASK_HPP
+#define SHARE_VM_OPTO_REGMASK_HPP
+
+#include "code/vmreg.hpp"
+#include "libadt/port.hpp"
+#include "opto/optoreg.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/adGlobals_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/adGlobals_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/adGlobals_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/adGlobals_zero.hpp"
+#endif
+
 // Some fun naming (textual) substitutions:
 //
 // RegMask::get_low_elem() ==> RegMask::find_first_elem()
@@ -262,3 +281,5 @@
 
 // Do not use this constant directly in client code!
 #undef RM_SIZE
+
+#endif // SHARE_VM_OPTO_REGMASK_HPP
--- a/src/share/vm/opto/rootnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/rootnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_rootnode.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/regmask.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/subnode.hpp"
+#include "opto/type.hpp"
 
 //------------------------------Ideal------------------------------------------
 // Remove dead inputs
--- a/src/share/vm/opto/rootnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/rootnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_ROOTNODE_HPP
+#define SHARE_VM_OPTO_ROOTNODE_HPP
+
+#include "opto/loopnode.hpp"
+
 //------------------------------RootNode---------------------------------------
 // The one-and-only before-all-else and after-all-else RootNode.  The RootNode
 // represents what happens if the user runs the whole program repeatedly.  The
@@ -60,3 +65,5 @@
   virtual uint ideal_reg() const { return NotAMachineReg; }
   virtual uint match_edge(uint idx) const { return 0; }
 };
+
+#endif // SHARE_VM_OPTO_ROOTNODE_HPP
--- a/src/share/vm/opto/runtime.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/runtime.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,64 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_runtime.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/compiledIC.hpp"
+#include "code/icBuffer.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "compiler/oopMap.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/graphKit.hpp"
+#include "opto/machnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/subnode.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
+#include "runtime/vframe_hp.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/preserveException.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
 
 
 // For debugging purposes:
--- a/src/share/vm/opto/runtime.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/runtime.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_RUNTIME_HPP
+#define SHARE_VM_OPTO_RUNTIME_HPP
+
+#include "code/codeBlob.hpp"
+#include "opto/machnode.hpp"
+#include "opto/type.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/vframe.hpp"
+
 //------------------------------OptoRuntime------------------------------------
 // Opto compiler runtime routines
 //
@@ -298,3 +308,5 @@
  static void          print_named_counters();
 
 };
+
+#endif // SHARE_VM_OPTO_RUNTIME_HPP
--- a/src/share/vm/opto/split_if.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/split_if.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,11 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_split_if.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/callnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/loopnode.hpp"
 
 
 //------------------------------split_thru_region------------------------------
--- a/src/share/vm/opto/stringopts.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/stringopts.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stringopts.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callGenerator.hpp"
+#include "opto/callnode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/graphKit.hpp"
+#include "opto/idealKit.hpp"
+#include "opto/rootnode.hpp"
+#include "opto/runtime.hpp"
+#include "opto/stringopts.hpp"
+#include "opto/subnode.hpp"
 
 #define __ kit.
 
--- a/src/share/vm/opto/stringopts.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/stringopts.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_STRINGOPTS_HPP
+#define SHARE_VM_OPTO_STRINGOPTS_HPP
+
+#include "opto/node.hpp"
+#include "opto/phaseX.hpp"
+
 class StringConcat;
 
 class PhaseStringOpts : public Phase {
@@ -81,3 +87,5 @@
  public:
   PhaseStringOpts(PhaseGVN* gvn, Unique_Node_List* worklist);
 };
+
+#endif // SHARE_VM_OPTO_STRINGOPTS_HPP
--- a/src/share/vm/opto/subnode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/subnode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,12 +22,25 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/cfgnode.hpp"
+#include "opto/connode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_subnode.cpp.incl"
 #include "math.h"
 
 //=============================================================================
--- a/src/share/vm/opto/subnode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/subnode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_SUBNODE_HPP
+#define SHARE_VM_OPTO_SUBNODE_HPP
+
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 //------------------------------SUBNode----------------------------------------
@@ -529,3 +536,5 @@
   const Type *bottom_type() const { return TypeInt::SHORT; }
   virtual uint ideal_reg() const { return Op_RegI; }
 };
+
+#endif // SHARE_VM_OPTO_SUBNODE_HPP
--- a/src/share/vm/opto/superword.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/superword.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -21,8 +21,19 @@
  * questions.
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_superword.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "libadt/vectset.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/addnode.hpp"
+#include "opto/callnode.hpp"
+#include "opto/divnode.hpp"
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/mulnode.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/superword.hpp"
+#include "opto/vectornode.hpp"
 
 //
 //                  S U P E R W O R D   T R A N S F O R M
--- a/src/share/vm/opto/superword.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/superword.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,16 @@
  * questions.
  */
 
+#ifndef SHARE_VM_OPTO_SUPERWORD_HPP
+#define SHARE_VM_OPTO_SUPERWORD_HPP
+
+#include "opto/connode.hpp"
+#include "opto/loopnode.hpp"
+#include "opto/node.hpp"
+#include "opto/phaseX.hpp"
+#include "opto/vectornode.hpp"
+#include "utilities/growableArray.hpp"
+
 //
 //                  S U P E R W O R D   T R A N S F O R M
 //
@@ -507,3 +517,5 @@
 
   static const OrderedPair initial;
 };
+
+#endif // SHARE_VM_OPTO_SUPERWORD_HPP
--- a/src/share/vm/opto/type.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/type.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,28 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "compiler/compileLog.hpp"
+#include "libadt/dict.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "opto/matcher.hpp"
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+#include "opto/type.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 
-#include "incls/_precompiled.incl"
-#include "incls/_type.cpp.incl"
-
 // Dictionary of types shared among compilations.
 Dict* Type::_shared_type_dict = NULL;
 
--- a/src/share/vm/opto/type.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/type.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_OPTO_TYPE_HPP
+#define SHARE_VM_OPTO_TYPE_HPP
+
+#include "libadt/port.hpp"
+#include "opto/adlcVMDeps.hpp"
+#include "runtime/handles.hpp"
+
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
@@ -1288,3 +1295,5 @@
 #define ConvX2L(x)   ConvI2L(x)
 
 #endif
+
+#endif // SHARE_VM_OPTO_TYPE_HPP
--- a/src/share/vm/opto/vectornode.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/vectornode.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,10 @@
  * questions.
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_vectornode.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "opto/connode.hpp"
+#include "opto/vectornode.hpp"
 
 //------------------------------VectorNode--------------------------------------
 
--- a/src/share/vm/opto/vectornode.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/opto/vectornode.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,14 @@
  * questions.
  */
 
+#ifndef SHARE_VM_OPTO_VECTORNODE_HPP
+#define SHARE_VM_OPTO_VECTORNODE_HPP
+
+#include "opto/matcher.hpp"
+#include "opto/memnode.hpp"
+#include "opto/node.hpp"
+#include "opto/opcodes.hpp"
+
 //------------------------------VectorNode--------------------------------------
 // Vector Operation
 class VectorNode : public Node {
@@ -1132,3 +1140,5 @@
   virtual const Type *bottom_type() const { return Type::DOUBLE; }
   virtual uint ideal_reg() const { return Op_RegD; }
 };
+
+#endif // SHARE_VM_OPTO_VECTORNODE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/precompiled.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,331 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+// Precompiled headers are turned off for Sun Studion,
+// or if the user passes USE_PRECOMPILED_HEADER=0 to the makefiles.
+#ifndef DONT_USE_PRECOMPILED_HEADER
+
+# include "asm/assembler.hpp"
+# include "asm/assembler.inline.hpp"
+# include "asm/codeBuffer.hpp"
+# include "asm/register.hpp"
+# include "ci/ciArray.hpp"
+# include "ci/ciArrayKlass.hpp"
+# include "ci/ciClassList.hpp"
+# include "ci/ciConstant.hpp"
+# include "ci/ciConstantPoolCache.hpp"
+# include "ci/ciEnv.hpp"
+# include "ci/ciExceptionHandler.hpp"
+# include "ci/ciField.hpp"
+# include "ci/ciFlags.hpp"
+# include "ci/ciInstance.hpp"
+# include "ci/ciInstanceKlass.hpp"
+# include "ci/ciInstanceKlassKlass.hpp"
+# include "ci/ciKlass.hpp"
+# include "ci/ciKlassKlass.hpp"
+# include "ci/ciMethod.hpp"
+# include "ci/ciNullObject.hpp"
+# include "ci/ciObjArrayKlass.hpp"
+# include "ci/ciObject.hpp"
+# include "ci/ciObjectFactory.hpp"
+# include "ci/ciSignature.hpp"
+# include "ci/ciStreams.hpp"
+# include "ci/ciSymbol.hpp"
+# include "ci/ciType.hpp"
+# include "ci/ciTypeArrayKlass.hpp"
+# include "ci/ciUtilities.hpp"
+# include "ci/compilerInterface.hpp"
+# include "classfile/classFileParser.hpp"
+# include "classfile/classFileStream.hpp"
+# include "classfile/classLoader.hpp"
+# include "classfile/javaClasses.hpp"
+# include "classfile/symbolTable.hpp"
+# include "classfile/systemDictionary.hpp"
+# include "classfile/vmSymbols.hpp"
+# include "code/codeBlob.hpp"
+# include "code/codeCache.hpp"
+# include "code/compressedStream.hpp"
+# include "code/debugInfo.hpp"
+# include "code/debugInfoRec.hpp"
+# include "code/dependencies.hpp"
+# include "code/exceptionHandlerTable.hpp"
+# include "code/jvmticmlr.h"
+# include "code/location.hpp"
+# include "code/nmethod.hpp"
+# include "code/oopRecorder.hpp"
+# include "code/pcDesc.hpp"
+# include "code/relocInfo.hpp"
+# include "code/stubs.hpp"
+# include "code/vmreg.hpp"
+# include "compiler/disassembler.hpp"
+# include "compiler/methodLiveness.hpp"
+# include "compiler/oopMap.hpp"
+# include "gc_implementation/shared/adaptiveSizePolicy.hpp"
+# include "gc_implementation/shared/ageTable.hpp"
+# include "gc_implementation/shared/allocationStats.hpp"
+# include "gc_implementation/shared/cSpaceCounters.hpp"
+# include "gc_implementation/shared/collectorCounters.hpp"
+# include "gc_implementation/shared/gSpaceCounters.hpp"
+# include "gc_implementation/shared/gcStats.hpp"
+# include "gc_implementation/shared/gcUtil.hpp"
+# include "gc_implementation/shared/generationCounters.hpp"
+# include "gc_implementation/shared/immutableSpace.hpp"
+# include "gc_implementation/shared/markSweep.hpp"
+# include "gc_implementation/shared/markSweep.inline.hpp"
+# include "gc_implementation/shared/mutableSpace.hpp"
+# include "gc_implementation/shared/spaceCounters.hpp"
+# include "gc_implementation/shared/spaceDecorator.hpp"
+# include "gc_interface/collectedHeap.hpp"
+# include "gc_interface/collectedHeap.inline.hpp"
+# include "gc_interface/gcCause.hpp"
+# include "interpreter/abstractInterpreter.hpp"
+# include "interpreter/bytecode.hpp"
+# include "interpreter/bytecodeHistogram.hpp"
+# include "interpreter/bytecodeInterpreter.hpp"
+# include "interpreter/bytecodeInterpreter.inline.hpp"
+# include "interpreter/bytecodeTracer.hpp"
+# include "interpreter/bytecodes.hpp"
+# include "interpreter/cppInterpreter.hpp"
+# include "interpreter/interpreter.hpp"
+# include "interpreter/invocationCounter.hpp"
+# include "interpreter/linkResolver.hpp"
+# include "interpreter/templateInterpreter.hpp"
+# include "interpreter/templateTable.hpp"
+# include "jvmtifiles/jvmti.h"
+# include "memory/allocation.hpp"
+# include "memory/allocation.inline.hpp"
+# include "memory/barrierSet.hpp"
+# include "memory/barrierSet.inline.hpp"
+# include "memory/blockOffsetTable.hpp"
+# include "memory/blockOffsetTable.inline.hpp"
+# include "memory/cardTableModRefBS.hpp"
+# include "memory/collectorPolicy.hpp"
+# include "memory/compactingPermGenGen.hpp"
+# include "memory/defNewGeneration.hpp"
+# include "memory/gcLocker.hpp"
+# include "memory/genCollectedHeap.hpp"
+# include "memory/genOopClosures.hpp"
+# include "memory/genRemSet.hpp"
+# include "memory/generation.hpp"
+# include "memory/generation.inline.hpp"
+# include "memory/heap.hpp"
+# include "memory/iterator.hpp"
+# include "memory/memRegion.hpp"
+# include "memory/modRefBarrierSet.hpp"
+# include "memory/oopFactory.hpp"
+# include "memory/permGen.hpp"
+# include "memory/referencePolicy.hpp"
+# include "memory/referenceProcessor.hpp"
+# include "memory/resourceArea.hpp"
+# include "memory/sharedHeap.hpp"
+# include "memory/space.hpp"
+# include "memory/space.inline.hpp"
+# include "memory/specialized_oop_closures.hpp"
+# include "memory/threadLocalAllocBuffer.hpp"
+# include "memory/threadLocalAllocBuffer.inline.hpp"
+# include "memory/universe.hpp"
+# include "memory/universe.inline.hpp"
+# include "memory/watermark.hpp"
+# include "oops/arrayKlass.hpp"
+# include "oops/arrayOop.hpp"
+# include "oops/constMethodOop.hpp"
+# include "oops/constantPoolOop.hpp"
+# include "oops/cpCacheOop.hpp"
+# include "oops/instanceKlass.hpp"
+# include "oops/instanceOop.hpp"
+# include "oops/instanceRefKlass.hpp"
+# include "oops/klass.hpp"
+# include "oops/klassOop.hpp"
+# include "oops/klassPS.hpp"
+# include "oops/klassVtable.hpp"
+# include "oops/markOop.hpp"
+# include "oops/markOop.inline.hpp"
+# include "oops/methodDataOop.hpp"
+# include "oops/methodOop.hpp"
+# include "oops/objArrayKlass.hpp"
+# include "oops/objArrayOop.hpp"
+# include "oops/oop.hpp"
+# include "oops/oop.inline.hpp"
+# include "oops/oop.inline2.hpp"
+# include "oops/oopsHierarchy.hpp"
+# include "oops/symbolOop.hpp"
+# include "oops/typeArrayKlass.hpp"
+# include "oops/typeArrayOop.hpp"
+# include "prims/jni.h"
+# include "prims/jvm.h"
+# include "prims/jvmtiExport.hpp"
+# include "prims/methodHandles.hpp"
+# include "runtime/arguments.hpp"
+# include "runtime/atomic.hpp"
+# include "runtime/deoptimization.hpp"
+# include "runtime/extendedPC.hpp"
+# include "runtime/fieldDescriptor.hpp"
+# include "runtime/fieldType.hpp"
+# include "runtime/frame.hpp"
+# include "runtime/frame.inline.hpp"
+# include "runtime/globals.hpp"
+# include "runtime/globals_extension.hpp"
+# include "runtime/handles.hpp"
+# include "runtime/handles.inline.hpp"
+# include "runtime/icache.hpp"
+# include "runtime/init.hpp"
+# include "runtime/interfaceSupport.hpp"
+# include "runtime/java.hpp"
+# include "runtime/javaCalls.hpp"
+# include "runtime/javaFrameAnchor.hpp"
+# include "runtime/jniHandles.hpp"
+# include "runtime/monitorChunk.hpp"
+# include "runtime/mutex.hpp"
+# include "runtime/mutexLocker.hpp"
+# include "runtime/objectMonitor.hpp"
+# include "runtime/orderAccess.hpp"
+# include "runtime/os.hpp"
+# include "runtime/osThread.hpp"
+# include "runtime/perfData.hpp"
+# include "runtime/perfMemory.hpp"
+# include "runtime/prefetch.hpp"
+# include "runtime/reflection.hpp"
+# include "runtime/reflectionCompat.hpp"
+# include "runtime/reflectionUtils.hpp"
+# include "runtime/registerMap.hpp"
+# include "runtime/safepoint.hpp"
+# include "runtime/sharedRuntime.hpp"
+# include "runtime/signature.hpp"
+# include "runtime/stackValue.hpp"
+# include "runtime/stackValueCollection.hpp"
+# include "runtime/stubCodeGenerator.hpp"
+# include "runtime/stubRoutines.hpp"
+# include "runtime/synchronizer.hpp"
+# include "runtime/thread.hpp"
+# include "runtime/threadLocalStorage.hpp"
+# include "runtime/timer.hpp"
+# include "runtime/unhandledOops.hpp"
+# include "runtime/vframe.hpp"
+# include "runtime/virtualspace.hpp"
+# include "runtime/vmThread.hpp"
+# include "runtime/vm_operations.hpp"
+# include "runtime/vm_version.hpp"
+# include "services/lowMemoryDetector.hpp"
+# include "services/memoryPool.hpp"
+# include "services/memoryService.hpp"
+# include "services/memoryUsage.hpp"
+# include "utilities/accessFlags.hpp"
+# include "utilities/array.hpp"
+# include "utilities/bitMap.hpp"
+# include "utilities/bitMap.inline.hpp"
+# include "utilities/constantTag.hpp"
+# include "utilities/copy.hpp"
+# include "utilities/debug.hpp"
+# include "utilities/exceptions.hpp"
+# include "utilities/globalDefinitions.hpp"
+# include "utilities/growableArray.hpp"
+# include "utilities/hashtable.hpp"
+# include "utilities/histogram.hpp"
+# include "utilities/macros.hpp"
+# include "utilities/numberSeq.hpp"
+# include "utilities/ostream.hpp"
+# include "utilities/preserveException.hpp"
+# include "utilities/sizes.hpp"
+# include "utilities/taskqueue.hpp"
+# include "utilities/top.hpp"
+# include "utilities/utf8.hpp"
+# include "utilities/workgroup.hpp"
+# include "utilities/yieldingWorkgroup.hpp"
+#ifdef COMPILER2
+# include "libadt/dict.hpp"
+# include "libadt/port.hpp"
+# include "libadt/set.hpp"
+# include "libadt/vectset.hpp"
+# include "opto/addnode.hpp"
+# include "opto/adlcVMDeps.hpp"
+# include "opto/block.hpp"
+# include "opto/c2_globals.hpp"
+# include "opto/callnode.hpp"
+# include "opto/cfgnode.hpp"
+# include "opto/compile.hpp"
+# include "opto/connode.hpp"
+# include "opto/idealGraphPrinter.hpp"
+# include "opto/loopnode.hpp"
+# include "opto/machnode.hpp"
+# include "opto/matcher.hpp"
+# include "opto/memnode.hpp"
+# include "opto/mulnode.hpp"
+# include "opto/multnode.hpp"
+# include "opto/node.hpp"
+# include "opto/opcodes.hpp"
+# include "opto/optoreg.hpp"
+# include "opto/phase.hpp"
+# include "opto/phaseX.hpp"
+# include "opto/regalloc.hpp"
+# include "opto/regmask.hpp"
+# include "opto/runtime.hpp"
+# include "opto/subnode.hpp"
+# include "opto/type.hpp"
+# include "opto/vectornode.hpp"
+#endif // COMPILER2
+#ifdef COMPILER1
+# include "c1/c1_Compilation.hpp"
+# include "c1/c1_Defs.hpp"
+# include "c1/c1_FrameMap.hpp"
+# include "c1/c1_LIR.hpp"
+# include "c1/c1_MacroAssembler.hpp"
+# include "c1/c1_ValueType.hpp"
+# include "c1/c1_globals.hpp"
+#endif // COMPILER1
+#ifndef SERIALGC
+# include "gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp"
+# include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
+# include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+# include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+# include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
+# include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
+# include "gc_implementation/concurrentMarkSweep/freeList.hpp"
+# include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp"
+# include "gc_implementation/g1/dirtyCardQueue.hpp"
+# include "gc_implementation/g1/g1BlockOffsetTable.hpp"
+# include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
+# include "gc_implementation/g1/g1OopClosures.hpp"
+# include "gc_implementation/g1/g1_globals.hpp"
+# include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
+# include "gc_implementation/g1/ptrQueue.hpp"
+# include "gc_implementation/g1/satbQueue.hpp"
+# include "gc_implementation/parNew/parGCAllocBuffer.hpp"
+# include "gc_implementation/parNew/parOopClosures.hpp"
+# include "gc_implementation/parallelScavenge/objectStartArray.hpp"
+# include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
+# include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+# include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
+# include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
+# include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp"
+# include "gc_implementation/parallelScavenge/psGenerationCounters.hpp"
+# include "gc_implementation/parallelScavenge/psOldGen.hpp"
+# include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
+# include "gc_implementation/parallelScavenge/psPermGen.hpp"
+# include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+# include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+# include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
+# include "gc_implementation/shared/gcPolicyCounters.hpp"
+#endif // SERIALGC
+
+#endif // !DONT_USE_PRECOMPILED_HEADER
--- a/src/share/vm/prims/evmCompat.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/evmCompat.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,14 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "utilities/debug.hpp"
+
 // This file contains definitions for functions that exist
 // in the ExactVM, but not in HotSpot. They are stubbed out
 // here to prevent linker errors when attempting to use HotSpot
 // with the ExactVM jdk.
 
-# include "incls/_precompiled.incl"
-# include "incls/_evmCompat.cpp.incl"
-
 extern "C" void JVM_Process_DestroyProcess(void);
 extern "C" void JVM_Process_ForkAndExec(void);
 extern "C" void JVM_Process_WaitForProcessExit(void);
--- a/src/share/vm/prims/forte.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/forte.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_forte.cpp.incl"
+#include "precompiled.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/pcDesc.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/space.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "prims/forte.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
 
 // These name match the names reported by the forte quality kit
 enum {
--- a/src/share/vm/prims/forte.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/forte.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_FORTE_HPP
+#define SHARE_VM_PRIMS_FORTE_HPP
+
 // Interface to Forte support.
 
 class Forte : AllStatic {
@@ -30,3 +33,5 @@
                                                  KERNEL_RETURN;
                                                  // register internal VM stub
 };
+
+#endif // SHARE_VM_PRIMS_FORTE_HPP
--- a/src/share/vm/prims/hpi_imported.h	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * HotSpot integration note:
- *
- * This is a consolidation of these two files:
- *      src/share/hpi/export/hpi.h      1.15  99/06/18  JDK1.3 beta build I
- *      src/share/hpi/export/dll.h      1.3   98/09/15  JDK1.3 beta build I
- * from the classic VM.
- *
- * bool_t is a type in the classic VM, and we define it here,
- * but in the future this should be a jboolean.
- *
- * The files are included verbatim expect for local includes removed from hpi.h.
- */
-
-#ifndef _JAVASOFT_HPI_H_
-#define _JAVASOFT_HPI_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* A classic VMism that should become a jboolean.  Fix in 1.2.1? */
-typedef enum { HPI_FALSE = 0, HPI_TRUE = 1 } bool_t;
-
-/*
- * DLL.H: A common interface for helper DLLs loaded by the VM.
- * Each library exports the main entry point "DLL_Initialize". Through
- * that function the programmer can obtain a function pointer which has
- * type "GetInterfaceFunc." Through the function pointer the programmer
- * can obtain other interfaces supported in the DLL.
- */
-typedef jint (JNICALL * GetInterfaceFunc)
-       (void **intfP, const char *name, jint ver);
-
-jint JNICALL DLL_Initialize(GetInterfaceFunc *, void *args);
-
-
-/*
- * Host Porting Interface. This defines the "porting layer" for
- * POSIX.1 compliant operating systems.
- */
-
-/*
- * memory allocations
- */
-typedef struct {
-    /*
-     * Malloc must return a unique pointer if size == 0.
-     */
-  void *  (*Malloc)(size_t size);
-  void *  (*Realloc)(void *ptr, size_t new_size);
-    /*
-     * Free must allow ptr == NULL to be a no-op.
-     */
-  void    (*Free)(void *ptr);
-    /*
-     * Calloc must return a unique pointer for if
-     * n_item == 0 || item_size == 0.
-     */
-  void *  (*Calloc)(size_t n_item, size_t item_size);
-  char *  (*Strdup)(const char *str);
-
-  void *  (*MapMem)(size_t req_size, size_t *maped_size);
-  void *  (*UnmapMem)(void *req_addr, size_t req_size, size_t *unmap_size);
-  /*
-   * CommitMem should round the ptr down to the nearest page and
-   * round the size up to the nearest page so that the committed
-   * region is at least as large as the requested region.
-   */
-  void *  (*CommitMem)(void *ptr, size_t size, size_t *actual);
-  /*
-   * sysDecommitMem should round the ptr up to the nearest page and
-   * round the size down to the nearest page so that the decommitted
-   * region is no greater than the requested region.
-   */
-  void *  (*DecommitMem)(void *ptr, size_t size, size_t *actual);
-
-#define HPI_PAGE_ALIGNMENT          (64 * 1024)
-
-  void *  (*AllocBlock)(size_t size, void **headP);
-  void    (*FreeBlock)(void *head);
-} HPI_MemoryInterface;
-
-/*
- * dynamic linking libraries
- */
-typedef struct {
-  void   (*BuildLibName)(char *buf, int buf_len, char *path, const char *name);
-  int    (*BuildFunName)(char *name, int name_len, int arg_size, int en_idx);
-
-  void * (*LoadLibrary)(const char *name, char *err_buf, int err_buflen);
-  void   (*UnloadLibrary)(void *lib);
-  void * (*FindLibraryEntry)(void *lib, const char *name);
-} HPI_LibraryInterface;
-
-typedef void (*signal_handler_t)(int sig, void *siginfo, void *context);
-
-#define HPI_SIG_DFL (signal_handler_t)0
-#define HPI_SIG_ERR (signal_handler_t)-1
-#define HPI_SIG_IGN (signal_handler_t)1
-
-typedef struct {
-  char *name; /* name such as green/native threads. */
-  int  isMP;
-} HPI_SysInfo;
-
-typedef struct {
-  HPI_SysInfo *    (*GetSysInfo)(void);
-  long             (*GetMilliTicks)(void);
-  jlong            (*TimeMillis)(void);
-
-  signal_handler_t (*Signal)(int sig, signal_handler_t handler);
-  void             (*Raise)(int sig);
-  void             (*SignalNotify)(int sig);
-  int              (*SignalWait)(void);
-
-  int              (*Shutdown)(void);
-
-  int              (*SetLoggingLevel)(int level);
-  bool_t           (*SetMonitoringOn)(bool_t on);
-  int              (*GetLastErrorString)(char *buf, int len);
-} HPI_SystemInterface;
-
-/*
- * threads and monitors
- */
-typedef struct  sys_thread sys_thread_t;
-typedef struct  sys_mon sys_mon_t;
-
-#define HPI_OK          0
-#define HPI_ERR        -1
-#define HPI_INTRPT     -2    /* Operation was interrupted */
-#define HPI_TIMEOUT    -3    /* A timer ran out */
-#define HPI_NOMEM      -5    /* Ran out of memory */
-#define HPI_NORESOURCE -6    /* Ran out of some system resource */
-
-/* There are three basic states: RUNNABLE, MONITOR_WAIT, and CONDVAR_WAIT.
- * When the thread is suspended in any of these states, the
- * HPI_THREAD_SUSPENDED bit will be set
- */
-enum {
-    HPI_THREAD_RUNNABLE = 1,
-    HPI_THREAD_MONITOR_WAIT,
-    HPI_THREAD_CONDVAR_WAIT
-};
-
-#define HPI_MINIMUM_PRIORITY        1
-#define HPI_MAXIMUM_PRIORITY        10
-#define HPI_NORMAL_PRIORITY         5
-
-#define HPI_THREAD_SUSPENDED        0x8000
-#define HPI_THREAD_INTERRUPTED      0x4000
-
-typedef struct {
-    sys_thread_t *owner;
-    int          entry_count;
-    sys_thread_t **monitor_waiters;
-    sys_thread_t **condvar_waiters;
-    int          sz_monitor_waiters;
-    int          sz_condvar_waiters;
-    int          n_monitor_waiters;
-    int          n_condvar_waiters;
-} sys_mon_info;
-
-typedef struct {
-  int            (*ThreadBootstrap)(sys_thread_t **tidP,
-                                    sys_mon_t **qlockP,
-                                    int nReservedBytes);
-  int            (*ThreadCreate)(sys_thread_t **tidP,
-                                 long stk_size,
-                                 void (*func)(void *),
-                                 void *arg);
-  sys_thread_t * (*ThreadSelf)(void);
-  void           (*ThreadYield)(void);
-  int            (*ThreadSuspend)(sys_thread_t *tid);
-  int            (*ThreadResume)(sys_thread_t *tid);
-  int            (*ThreadSetPriority)(sys_thread_t *tid, int prio);
-  int            (*ThreadGetPriority)(sys_thread_t *tid, int *prio);
-  void *         (*ThreadStackPointer)(sys_thread_t *tid);
-  void *         (*ThreadStackTop)(sys_thread_t *tid);
-  long *         (*ThreadRegs)(sys_thread_t *tid, int *regs);
-  int            (*ThreadSingle)(void);
-  void           (*ThreadMulti)(void);
-  int            (*ThreadEnumerateOver)(int (*func)(sys_thread_t *, void *),
-                                        void *arg);
-  int            (*ThreadCheckStack)(void);
-  void           (*ThreadPostException)(sys_thread_t *tid, void *arg);
-  void           (*ThreadInterrupt)(sys_thread_t *tid);
-  int            (*ThreadIsInterrupted)(sys_thread_t *tid, int clear);
-  int            (*ThreadAlloc)(sys_thread_t **tidP);
-  int            (*ThreadFree)(void);
-  jlong          (*ThreadCPUTime)(void);
-  int            (*ThreadGetStatus)(sys_thread_t *tid, sys_mon_t **monitor);
-  void *         (*ThreadInterruptEvent)(void);
-  void *         (*ThreadNativeID)(sys_thread_t *tid);
-
-  /* These three functions are used by the CPU time profiler.
-   * sysThreadIsRunning determines whether the thread is running (not just
-   * runnable). It is only safe to call this function after calling
-   * sysThreadProfSuspend.
-   */
-  bool_t         (*ThreadIsRunning)(sys_thread_t *tid);
-  void           (*ThreadProfSuspend)(sys_thread_t *tid);
-  void           (*ThreadProfResume)(sys_thread_t *tid);
-
-  int            (*AdjustTimeSlice)(int ms);
-
-  size_t         (*MonitorSizeof)(void);
-  int            (*MonitorInit)(sys_mon_t *mid);
-  int            (*MonitorDestroy)(sys_mon_t *mid);
-  int            (*MonitorEnter)(sys_thread_t *self, sys_mon_t *mid);
-  bool_t         (*MonitorEntered)(sys_thread_t *self, sys_mon_t *mid);
-  int            (*MonitorExit)(sys_thread_t *self, sys_mon_t *mid);
-  int            (*MonitorNotify)(sys_thread_t *self, sys_mon_t *mid);
-  int            (*MonitorNotifyAll)(sys_thread_t *self, sys_mon_t *mid);
-  int            (*MonitorWait)(sys_thread_t *self, sys_mon_t *mid, jlong ms);
-  bool_t         (*MonitorInUse)(sys_mon_t *mid);
-  sys_thread_t * (*MonitorOwner)(sys_mon_t *mid);
-  int            (*MonitorGetInfo)(sys_mon_t *mid, sys_mon_info *info);
-
-} HPI_ThreadInterface;
-
-/*
- * files
- */
-
-#define HPI_FILETYPE_REGULAR    (0)
-#define HPI_FILETYPE_DIRECTORY  (1)
-#define HPI_FILETYPE_OTHER      (2)
-
-typedef struct {
-  char *         (*NativePath)(char *path);
-  int            (*FileType)(const char *path);
-  int            (*Open)(const char *name, int openMode, int filePerm);
-  int            (*Close)(int fd);
-  jlong          (*Seek)(int fd, jlong offset, int whence);
-  int            (*SetLength)(int fd, jlong length);
-  int            (*Sync)(int fd);
-  int            (*Available)(int fd, jlong *bytes);
-  size_t         (*Read)(int fd, void *buf, unsigned int nBytes);
-  size_t         (*Write)(int fd, const void *buf, unsigned int nBytes);
-  int            (*FileSizeFD)(int fd, jlong *size);
-} HPI_FileInterface;
-
-/*
- * sockets
- */
-struct sockaddr;
-struct hostent;
-
-typedef struct {
-  int              (*Close)(int fd);
-  long             (*Available)(int fd, jint *pbytes);
-  int              (*Connect)(int fd, struct sockaddr *him, int len);
-  int              (*Accept)(int fd, struct sockaddr *him, int *len);
-  int              (*SendTo)(int fd, char *buf, int len, int flags,
-                             struct sockaddr *to, int tolen);
-  int              (*RecvFrom)(int fd, char *buf, int nbytes, int flags,
-                               struct sockaddr *from, int *fromlen);
-  int              (*Listen)(int fd, long count);
-  int              (*Recv)(int fd, char *buf, int nBytes, int flags);
-  int              (*Send)(int fd, char *buf, int nBytes, int flags);
-  int              (*Timeout)(int fd, long timeout);
-  struct hostent * (*GetHostByName)(char *hostname);
-  int              (*Socket)(int domain, int type, int protocol);
-  int              (*SocketShutdown)(int fd, int howto);
-  int              (*Bind)(int fd, struct sockaddr *him, int len);
-  int              (*GetSocketName)(int fd, struct sockaddr *him, int *len);
-  int              (*GetHostName)(char *hostname, int namelen);
-  struct hostent * (*GetHostByAddr)(const char *hostname, int len, int type);
-  int              (*SocketGetOption)(int fd, int level, int optname, char *optval, int *optlen);
-  int              (*SocketSetOption)(int fd, int level, int optname, const char *optval, int optlen);
-  struct protoent * (*GetProtoByName)(char* name);
-} HPI_SocketInterface;
-
-/*
- * callbacks.
- */
-typedef struct vm_calls {
-    int    (*jio_fprintf)(FILE *fp, const char *fmt, ...);
-    void   (*panic)(const char *fmt, ...);
-    void   (*monitorRegister)(sys_mon_t *mid, char *info_str);
-
-    void   (*monitorContendedEnter)(sys_thread_t *self, sys_mon_t *mid);
-    void   (*monitorContendedEntered)(sys_thread_t *self, sys_mon_t *mid);
-    void   (*monitorContendedExit)(sys_thread_t *self, sys_mon_t *mid);
-} vm_calls_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_JAVASOFT_HPI_H_ */
--- a/src/share/vm/prims/jni.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jni.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,72 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jni.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "prims/jni.h"
+#include "prims/jniCheck.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/jfieldIDWorkaround.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/runtimeService.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/events.hpp"
+#include "utilities/histogram.hpp"
+#ifdef TARGET_ARCH_x86
+# include "jniTypes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "jniTypes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "jniTypes_zero.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 static jint CurrentVersion = JNI_VERSION_1_6;
 
@@ -2049,11 +2113,10 @@
 JNI_ENTRY(const char*, jni_GetStringUTFChars(JNIEnv *env, jstring string, jboolean *isCopy))
   JNIWrapper("GetStringUTFChars");
   DTRACE_PROBE3(hotspot_jni, GetStringUTFChars__entry, env, string, isCopy);
-  ResourceMark rm;
-  char* str = java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(string));
-  int length = (int)strlen(str);
-  char* result = AllocateHeap(length+1, "GetStringUTFChars");
-  strcpy(result, str);
+  oop java_string = JNIHandles::resolve_non_null(string);
+  size_t length = java_lang_String::utf8_length(java_string);
+  char* result = AllocateHeap(length + 1, "GetStringUTFChars");
+  java_lang_String::as_utf8_string(java_string, result, (int) length + 1);
   if (isCopy != NULL) *isCopy = JNI_TRUE;
   DTRACE_PROBE1(hotspot_jni, GetStringUTFChars__return, result);
   return result;
@@ -3194,7 +3257,6 @@
 
 
 #define JAVASTACKSIZE (400 * 1024)    /* Default size of a thread java stack */
-#define PROCSTACKSIZE 0               /* 0 means default size in HPI */
 enum { VERIFY_NONE, VERIFY_REMOTE, VERIFY_ALL };
 
 HS_DTRACE_PROBE_DECL1(hotspot_jni, GetDefaultJavaVMInitArgs__entry, void*);
--- a/src/share/vm/prims/jni.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jni.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/prims/jniCheck.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jniCheck.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,29 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jniCheck.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jni.h"
+#include "prims/jniCheck.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/jfieldIDWorkaround.hpp"
+#include "runtime/thread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "jniTypes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "jniTypes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "jniTypes_zero.hpp"
+#endif
 
 
 // Heap objects are allowed to be directly referenced only in VM code,
@@ -1267,6 +1288,9 @@
     return result;
 JNI_END
 
+// Arbitrary (but well-known) tag
+const jint STRING_TAG = 0x47114711;
+
 JNI_ENTRY_CHECKED(const jchar *,
   checked_jni_GetStringChars(JNIEnv *env,
                              jstring str,
@@ -1276,8 +1300,19 @@
       checkString(thr, str);
     )
     const jchar *result = UNCHECKED()->GetStringChars(env,str,isCopy);
+    assert (isCopy == NULL || *isCopy == JNI_TRUE, "GetStringChars didn't return a copy as expected");
+
+    size_t len = UNCHECKED()->GetStringLength(env,str) + 1; // + 1 for NULL termination
+    jint* tagLocation = (jint*) AllocateHeap(len * sizeof(jchar) + sizeof(jint), "checked_jni_GetStringChars");
+    *tagLocation = STRING_TAG;
+    jchar* newResult = (jchar*) (tagLocation + 1);
+    memcpy(newResult, result, len * sizeof(jchar));
+    // Avoiding call to UNCHECKED()->ReleaseStringChars() since that will fire unexpected dtrace probes
+    // Note that the dtrace arguments for the allocated memory will not match up with this solution.
+    FreeHeap((char*)result);
+
     functionExit(env);
-    return result;
+    return newResult;
 JNI_END
 
 JNI_ENTRY_CHECKED(void,
@@ -1288,11 +1323,17 @@
     IN_VM(
       checkString(thr, str);
     )
-    /* cannot check validity of copy, unless every request is logged by
-     * checking code.  Implementation of this check is deferred until a
-     * subsequent release.
-     */
-    UNCHECKED()->ReleaseStringChars(env,str,chars);
+    if (chars == NULL) {
+       // still do the unchecked call to allow dtrace probes
+       UNCHECKED()->ReleaseStringChars(env,str,chars);
+    }
+    else {
+       jint* tagLocation = ((jint*) chars) - 1;
+       if (*tagLocation != STRING_TAG) {
+          NativeReportJNIFatalError(thr, "ReleaseStringChars called on something not allocated by GetStringChars");
+       }
+       UNCHECKED()->ReleaseStringChars(env,str,(const jchar*)tagLocation);
+    }
     functionExit(env);
 JNI_END
 
@@ -1317,6 +1358,9 @@
     return result;
 JNI_END
 
+// Arbitrary (but well-known) tag - different than GetStringChars
+const jint STRING_UTF_TAG = 0x48124812;
+
 JNI_ENTRY_CHECKED(const char *,
   checked_jni_GetStringUTFChars(JNIEnv *env,
                                 jstring str,
@@ -1326,8 +1370,19 @@
       checkString(thr, str);
     )
     const char *result = UNCHECKED()->GetStringUTFChars(env,str,isCopy);
+    assert (isCopy == NULL || *isCopy == JNI_TRUE, "GetStringUTFChars didn't return a copy as expected");
+
+    size_t len = strlen(result) + 1; // + 1 for NULL termination
+    jint* tagLocation = (jint*) AllocateHeap(len + sizeof(jint), "checked_jni_GetStringUTFChars");
+    *tagLocation = STRING_UTF_TAG;
+    char* newResult = (char*) (tagLocation + 1);
+    strcpy(newResult, result);
+    // Avoiding call to UNCHECKED()->ReleaseStringUTFChars() since that will fire unexpected dtrace probes
+    // Note that the dtrace arguments for the allocated memory will not match up with this solution.
+    FreeHeap((char*)result);
+
     functionExit(env);
-    return result;
+    return newResult;
 JNI_END
 
 JNI_ENTRY_CHECKED(void,
@@ -1338,11 +1393,17 @@
     IN_VM(
       checkString(thr, str);
     )
-    /* cannot check validity of copy, unless every request is logged by
-     * checking code.  Implementation of this check is deferred until a
-     * subsequent release.
-     */
-    UNCHECKED()->ReleaseStringUTFChars(env,str,chars);
+    if (chars == NULL) {
+       // still do the unchecked call to allow dtrace probes
+       UNCHECKED()->ReleaseStringUTFChars(env,str,chars);
+    }
+    else {
+       jint* tagLocation = ((jint*) chars) - 1;
+       if (*tagLocation != STRING_UTF_TAG) {
+          NativeReportJNIFatalError(thr, "ReleaseStringUTFChars called on something not allocated by GetStringUTFChars");
+       }
+       UNCHECKED()->ReleaseStringUTFChars(env,str,(const char*)tagLocation);
+    }
     functionExit(env);
 JNI_END
 
--- a/src/share/vm/prims/jniCheck.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jniCheck.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JNICHECK_HPP
+#define SHARE_VM_PRIMS_JNICHECK_HPP
+
+#ifndef KERNEL
+#include "runtime/thread.hpp"
+#endif
+
 extern "C" {
   // Report a JNI failure caught by -Xcheck:jni.  Perform a core dump.
   // Note: two variations -- one to be called when in VM state (e.g. when
@@ -50,3 +57,5 @@
   static void validate_call_class(JavaThread* thr, jclass clazz, jmethodID method_id);
   static methodOop validate_jmethod_id(JavaThread* thr, jmethodID method_id);
 };
+
+#endif // SHARE_VM_PRIMS_JNICHECK_HPP
--- a/src/share/vm/prims/jniFastGetField.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jniFastGetField.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jniFastGetField.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jniFastGetField.hpp"
 
 address JNI_FastGetField::speculative_load_pclist [LIST_CAPACITY];
 address JNI_FastGetField::slowcase_entry_pclist   [LIST_CAPACITY];
--- a/src/share/vm/prims/jniFastGetField.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jniFastGetField.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JNIFASTGETFIELD_HPP
+#define SHARE_VM_PRIMS_JNIFASTGETFIELD_HPP
+
+#include "memory/allocation.hpp"
+#include "prims/jvm_misc.hpp"
+
 // Basic logic of a fast version of jni_Get<Primitive>Field:
 //
 // (See safepoint.hpp for a description of _safepoint_counter)
@@ -92,3 +98,5 @@
   // for example, for debugging purpose, in which case we need the mapping also.
   static address find_slowcase_pc(address pc);
 };
+
+#endif // SHARE_VM_PRIMS_JNIFASTGETFIELD_HPP
--- a/src/share/vm/prims/jni_md.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jni_md.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,16 @@
  */
 
 /* Switch to the correct jni_md.h file without reliance on -I options. */
-#include "incls/_jni_pd.h.incl"
+#ifdef TARGET_ARCH_x86
+# include "jni_x86.h"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "jni_sparc.h"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "jni_zero.h"
+#endif
+
 
 /*
   The local copies of JNI header files may be refreshed
--- a/src/share/vm/prims/jvm.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvm.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,57 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_jvm.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaAssertions.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/nativeLookup.hpp"
+#include "prims/privilegedStack.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/jfieldIDWorkaround.hpp"
+#include "runtime/os.hpp"
+#include "runtime/perfData.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/attachListener.hpp"
+#include "services/management.hpp"
+#include "services/threadService.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/events.hpp"
+#include "utilities/histogram.hpp"
+#include "utilities/top.hpp"
+#include "utilities/utf8.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "jvm_linux.h"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "jvm_solaris.h"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "jvm_windows.h"
+#endif
+
 #include <errno.h>
 
 HS_DTRACE_PROBE_DECL1(hotspot, thread__sleep__begin, long long);
@@ -600,7 +649,7 @@
 
 JVM_LEAF(jint, JVM_GetLastErrorString(char *buf, int len))
   JVMWrapper("JVM_GetLastErrorString");
-  return hpi::lasterror(buf, len);
+  return (jint)os::lasterror(buf, len);
 JVM_END
 
 
@@ -608,7 +657,7 @@
 
 JVM_LEAF(char*, JVM_NativePath(char* path))
   JVMWrapper2("JVM_NativePath (%s)", path);
-  return hpi::native_path(path);
+  return os::native_path(path);
 JVM_END
 
 
@@ -2434,7 +2483,7 @@
   JVMWrapper2("JVM_Open (%s)", fname);
 
   //%note jvm_r6
-  int result = hpi::open(fname, flags, mode);
+  int result = os::open(fname, flags, mode);
   if (result >= 0) {
     return result;
   } else {
@@ -2451,7 +2500,7 @@
 JVM_LEAF(jint, JVM_Close(jint fd))
   JVMWrapper2("JVM_Close (0x%x)", fd);
   //%note jvm_r6
-  return hpi::close(fd);
+  return os::close(fd);
 JVM_END
 
 
@@ -2459,7 +2508,7 @@
   JVMWrapper2("JVM_Read (0x%x)", fd);
 
   //%note jvm_r6
-  return (jint)hpi::read(fd, buf, nbytes);
+  return (jint)os::restartable_read(fd, buf, nbytes);
 JVM_END
 
 
@@ -2467,34 +2516,34 @@
   JVMWrapper2("JVM_Write (0x%x)", fd);
 
   //%note jvm_r6
-  return (jint)hpi::write(fd, buf, nbytes);
+  return (jint)os::write(fd, buf, nbytes);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Available(jint fd, jlong *pbytes))
   JVMWrapper2("JVM_Available (0x%x)", fd);
   //%note jvm_r6
-  return hpi::available(fd, pbytes);
+  return os::available(fd, pbytes);
 JVM_END
 
 
 JVM_LEAF(jlong, JVM_Lseek(jint fd, jlong offset, jint whence))
   JVMWrapper4("JVM_Lseek (0x%x, %Ld, %d)", fd, offset, whence);
   //%note jvm_r6
-  return hpi::lseek(fd, offset, whence);
+  return os::lseek(fd, offset, whence);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_SetLength(jint fd, jlong length))
   JVMWrapper3("JVM_SetLength (0x%x, %Ld)", fd, length);
-  return hpi::ftruncate(fd, length);
+  return os::ftruncate(fd, length);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Sync(jint fd))
   JVMWrapper2("JVM_Sync (0x%x)", fd);
   //%note jvm_r6
-  return hpi::fsync(fd);
+  return os::fsync(fd);
 JVM_END
 
 
@@ -3404,145 +3453,124 @@
 
 JVM_LEAF(jint, JVM_InitializeSocketLibrary())
   JVMWrapper("JVM_InitializeSocketLibrary");
-  return hpi::initialize_socket_library();
+  return 0;
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Socket(jint domain, jint type, jint protocol))
   JVMWrapper("JVM_Socket");
-  return hpi::socket(domain, type, protocol);
+  return os::socket(domain, type, protocol);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_SocketClose(jint fd))
   JVMWrapper2("JVM_SocketClose (0x%x)", fd);
   //%note jvm_r6
-  return hpi::socket_close(fd);
+  return os::socket_close(fd);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_SocketShutdown(jint fd, jint howto))
   JVMWrapper2("JVM_SocketShutdown (0x%x)", fd);
   //%note jvm_r6
-  return hpi::socket_shutdown(fd, howto);
+  return os::socket_shutdown(fd, howto);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Recv(jint fd, char *buf, jint nBytes, jint flags))
   JVMWrapper2("JVM_Recv (0x%x)", fd);
   //%note jvm_r6
-  return hpi::recv(fd, buf, nBytes, flags);
+  return os::recv(fd, buf, nBytes, flags);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Send(jint fd, char *buf, jint nBytes, jint flags))
   JVMWrapper2("JVM_Send (0x%x)", fd);
   //%note jvm_r6
-  return hpi::send(fd, buf, nBytes, flags);
+  return os::send(fd, buf, nBytes, flags);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Timeout(int fd, long timeout))
   JVMWrapper2("JVM_Timeout (0x%x)", fd);
   //%note jvm_r6
-  return hpi::timeout(fd, timeout);
+  return os::timeout(fd, timeout);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Listen(jint fd, jint count))
   JVMWrapper2("JVM_Listen (0x%x)", fd);
   //%note jvm_r6
-  return hpi::listen(fd, count);
+  return os::listen(fd, count);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Connect(jint fd, struct sockaddr *him, jint len))
   JVMWrapper2("JVM_Connect (0x%x)", fd);
   //%note jvm_r6
-  return hpi::connect(fd, him, len);
+  return os::connect(fd, him, len);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Bind(jint fd, struct sockaddr *him, jint len))
   JVMWrapper2("JVM_Bind (0x%x)", fd);
   //%note jvm_r6
-  return hpi::bind(fd, him, len);
+  return os::bind(fd, him, len);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_Accept(jint fd, struct sockaddr *him, jint *len))
   JVMWrapper2("JVM_Accept (0x%x)", fd);
   //%note jvm_r6
-  return hpi::accept(fd, him, (int *)len);
+  return os::accept(fd, him, (int *)len);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_RecvFrom(jint fd, char *buf, int nBytes, int flags, struct sockaddr *from, int *fromlen))
   JVMWrapper2("JVM_RecvFrom (0x%x)", fd);
   //%note jvm_r6
-  return hpi::recvfrom(fd, buf, nBytes, flags, from, fromlen);
+  return os::recvfrom(fd, buf, nBytes, flags, from, fromlen);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_GetSockName(jint fd, struct sockaddr *him, int *len))
   JVMWrapper2("JVM_GetSockName (0x%x)", fd);
   //%note jvm_r6
-  return hpi::get_sock_name(fd, him, len);
+  return os::get_sock_name(fd, him, len);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_SendTo(jint fd, char *buf, int len, int flags, struct sockaddr *to, int tolen))
   JVMWrapper2("JVM_SendTo (0x%x)", fd);
   //%note jvm_r6
-  return hpi::sendto(fd, buf, len, flags, to, tolen);
+  return os::sendto(fd, buf, len, flags, to, tolen);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_SocketAvailable(jint fd, jint *pbytes))
   JVMWrapper2("JVM_SocketAvailable (0x%x)", fd);
   //%note jvm_r6
-  return hpi::socket_available(fd, pbytes);
+  return os::socket_available(fd, pbytes);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen))
   JVMWrapper2("JVM_GetSockOpt (0x%x)", fd);
   //%note jvm_r6
-  return hpi::get_sock_opt(fd, level, optname, optval, optlen);
+  return os::get_sock_opt(fd, level, optname, optval, optlen);
 JVM_END
 
 
 JVM_LEAF(jint, JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen))
   JVMWrapper2("JVM_GetSockOpt (0x%x)", fd);
   //%note jvm_r6
-  return hpi::set_sock_opt(fd, level, optname, optval, optlen);
+  return os::set_sock_opt(fd, level, optname, optval, optlen);
 JVM_END
 
 JVM_LEAF(int, JVM_GetHostName(char* name, int namelen))
   JVMWrapper("JVM_GetHostName");
-  return hpi::get_host_name(name, namelen);
-JVM_END
-
-#ifdef _WINDOWS
-
-JVM_LEAF(struct hostent*, JVM_GetHostByAddr(const char* name, int len, int type))
-  JVMWrapper("JVM_GetHostByAddr");
-  return hpi::get_host_by_addr(name, len, type);
-JVM_END
-
-
-JVM_LEAF(struct hostent*, JVM_GetHostByName(char* name))
-  JVMWrapper("JVM_GetHostByName");
-  return hpi::get_host_by_name(name);
-JVM_END
-
-
-JVM_LEAF(struct protoent*, JVM_GetProtoByName(char* name))
-  JVMWrapper("JVM_GetProtoByName");
-  return hpi::get_proto_by_name(name);
-JVM_END
-
-#endif
+  return os::get_host_name(name, namelen);
+JVM_END
 
 // Library support ///////////////////////////////////////////////////////////////////////////
 
@@ -3553,7 +3581,7 @@
   void *load_result;
   {
     ThreadToNativeFromVM ttnfvm(thread);
-    load_result = hpi::dll_load(name, ebuf, sizeof ebuf);
+    load_result = os::dll_load(name, ebuf, sizeof ebuf);
   }
   if (load_result == NULL) {
     char msg[1024];
@@ -3575,13 +3603,13 @@
 
 JVM_LEAF(void, JVM_UnloadLibrary(void* handle))
   JVMWrapper("JVM_UnloadLibrary");
-  hpi::dll_unload(handle);
+  os::dll_unload(handle);
 JVM_END
 
 
 JVM_LEAF(void*, JVM_FindLibraryEntry(void* handle, const char* name))
   JVMWrapper2("JVM_FindLibraryEntry (%s)", name);
-  return hpi::dll_lookup(handle, name);
+  return os::dll_lookup(handle, name);
 JVM_END
 
 // Floating point support ////////////////////////////////////////////////////////////////////
--- a/src/share/vm/prims/jvm.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvm.h	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVM_H
+#define SHARE_VM_PRIMS_JVM_H
+
+#include "prims/jni.h"
+#include "runtime/reflectionCompat.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "jvm_linux.h"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "jvm_solaris.h"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "jvm_windows.h"
+#endif
+
 #ifndef _JAVASOFT_JVM_H_
 #define _JAVASOFT_JVM_H_
 
@@ -1048,7 +1063,8 @@
     JVM_CONSTANT_MethodHandle           = 15,  // JSR 292
     JVM_CONSTANT_MethodType             = 16,  // JSR 292
     JVM_CONSTANT_InvokeDynamicTrans     = 17,  // JSR 292, only occurs in old class files
-    JVM_CONSTANT_InvokeDynamic          = 18   // JSR 292
+    JVM_CONSTANT_InvokeDynamic          = 18,  // JSR 292
+    JVM_CONSTANT_ExternalMax            = 18   // Last tag found in classfiles
 };
 
 /* JVM_CONSTANT_MethodHandle subtypes */
@@ -1389,23 +1405,6 @@
 JNIEXPORT jint JNICALL
 JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen);
 
-/*
- * These routines are only reentrant on Windows
- */
-
-#ifdef _WINDOWS
-
-JNIEXPORT struct protoent * JNICALL
-JVM_GetProtoByName(char* name);
-
-JNIEXPORT struct hostent* JNICALL
-JVM_GetHostByAddr(const char* name, int len, int type);
-
-JNIEXPORT struct hostent* JNICALL
-JVM_GetHostByName(char* name);
-
-#endif /* _WINDOWS */
-
 JNIEXPORT int JNICALL
 JVM_GetHostName(char* name, int namelen);
 
@@ -1705,3 +1704,5 @@
 #endif /* __cplusplus */
 
 #endif /* !_JAVASOFT_JVM_H_ */
+
+#endif // SHARE_VM_PRIMS_JVM_H
--- a/src/share/vm/prims/jvm_misc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvm_misc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVM_MISC_HPP
+#define SHARE_VM_PRIMS_JVM_MISC_HPP
+
+#include "prims/jni.h"
+#include "runtime/handles.hpp"
+
 // Useful entry points shared by JNI and JVM interface.
 // We do not allow real JNI or JVM entry point to call each other.
 
@@ -87,3 +93,5 @@
 address jni_GetLongField_addr();
 address jni_GetFloatField_addr();
 address jni_GetDoubleField_addr();
+
+#endif // SHARE_VM_PRIMS_JVM_MISC_HPP
--- a/src/share/vm/prims/jvmti.xml	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmti.xml	Fri Jan 07 18:18:08 2011 +0100
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?>
 <!--
- Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -359,8 +359,8 @@
 
 <specification label="JVM(TM) Tool Interface"
         majorversion="1"
-        minorversion="1"
-        microversion="109">
+        minorversion="2"
+        microversion="1">
   <title subtitle="Version">
     <tm>JVM</tm> Tool Interface
   </title>
@@ -5649,6 +5649,45 @@
       </errors>
     </function>
 
+    <function id="GetLocalInstance" num="155" since="1.2">
+      <synopsis>Get Local Instance</synopsis>
+      <description>
+        This function can be used to retrieve the value of the local object
+        variable at slot 0 (the "<code>this</code>" object) from non-static
+        frames.  This function can retrieve the "<code>this</code>" object from
+        native method frames, whereas <code>GetLocalObject()</code> would 
+        return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases.
+      </description>
+      <origin>new</origin>
+      <capabilities>
+	<required id="can_access_local_variables"></required>
+      </capabilities>
+      <parameters>
+ 	<param id="thread">
+	  <jthread null="current" frame="frame"/>
+	  <description>
+	    The thread of the frame containing the variable's value.
+	  </description>
+	</param>
+	<param id="depth">
+	  <jframeID thread="thread"/>
+	  <description>
+	    The depth of the frame containing the variable's value.
+	  </description>
+	</param>
+	<param id="value_ptr">
+	  <outptr><jobject/></outptr>
+	    <description>
+	      On return, points to the variable's value. 
+	    </description>
+	</param>
+      </parameters>
+      <errors>
+	<error id="JVMTI_ERROR_INVALID_SLOT">
+	  If the specified frame is a static method frame.
+	</error>
+      </errors>
+    </function>
     <function id="GetLocalInt" num="22">
       <synopsis>Get Local Variable - Int</synopsis>
       <description>
--- a/src/share/vm/prims/jvmtiAgentThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiAgentThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIAGENTTHREAD_HPP
+#define SHARE_VM_PRIMS_JVMTIAGENTTHREAD_HPP
+
+#include "jvmtifiles/jvmtiEnv.hpp"
+
 //
 // class JvmtiAgentThread
 //
@@ -42,3 +47,5 @@
   static void start_function_wrapper(JavaThread *thread, TRAPS);
   void call_start_function();
 };
+
+#endif // SHARE_VM_PRIMS_JVMTIAGENTTHREAD_HPP
--- a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -21,9 +21,21 @@
  * questions.
  *
  */
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiClassFileReconstituter.cpp.incl"
 
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "prims/jvmtiClassFileReconstituter.hpp"
+#include "runtime/signature.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
 // FIXME: add Deprecated, LVT, LVTT attributes
 // FIXME: fix Synthetic attribute
 // FIXME: per Serguei, add error return handling for constantPoolOopDesc::copy_cpool_bytes()
--- a/src/share/vm/prims/jvmtiClassFileReconstituter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiClassFileReconstituter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTICLASSFILERECONSTITUTER_HPP
+#define SHARE_VM_PRIMS_JVMTICLASSFILERECONSTITUTER_HPP
+
+#include "jvmtifiles/jvmtiEnv.hpp"
+
 
 class JvmtiConstantPoolReconstituter : public StackObj {
  private:
@@ -144,3 +149,5 @@
 
   static void copy_bytecodes(methodHandle method, unsigned char* bytecodes);
 };
+
+#endif // SHARE_VM_PRIMS_JVMTICLASSFILERECONSTITUTER_HPP
--- a/src/share/vm/prims/jvmtiCodeBlobEvents.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiCodeBlobEvents.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiCodeBlobEvents.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeBlob.hpp"
+#include "code/codeCache.hpp"
+#include "code/scopeDesc.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiCodeBlobEvents.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/vmThread.hpp"
 
 // Support class to collect a list of the non-nmethod CodeBlobs in
 // the CodeCache.
--- a/src/share/vm/prims/jvmtiCodeBlobEvents.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiCodeBlobEvents.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-#ifndef _JVMTI_CODE_BLOB_EVENTS_H_
-#define _JVMTI_CODE_BLOB_EVENTS_H_
+#ifndef SHARE_VM_PRIMS_JVMTICODEBLOBEVENTS_HPP
+#define SHARE_VM_PRIMS_JVMTICODEBLOBEVENTS_HPP
+
+#ifndef JVMTI_KERNEL
+#include "jvmtifiles/jvmti.h"
+#endif
 
 // forward declaration
 class JvmtiEnv;
@@ -51,4 +55,4 @@
                                             jint *map_length);
 };
 
-#endif
+#endif // SHARE_VM_PRIMS_JVMTICODEBLOBEVENTS_HPP
--- a/src/share/vm/prims/jvmtiEnter.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnter.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,3 +21,14 @@
  * questions.
  *
  */
+
+#ifndef SHARE_VM_PRIMS_JVMTIENTER_HPP
+#define SHARE_VM_PRIMS_JVMTIENTER_HPP
+
+#include "classfile/systemDictionary.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "runtime/interfaceSupport.hpp"
+
+#endif // SHARE_VM_PRIMS_JVMTIENTER_HPP
--- a/src/share/vm/prims/jvmtiEnter.xsl	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnter.xsl	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,10 @@
 <xsl:template match="specification">
   <xsl:call-template name="sourceHeader"/>
   <xsl:text>
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiEnter.cpp.incl"
+# include "precompiled.hpp"
+# include "prims/jvmtiEnter.hpp"
+# include "prims/jvmtiRawMonitor.hpp"
+# include "prims/jvmtiUtil.hpp"
 
 </xsl:text>
 
--- a/src/share/vm/prims/jvmtiEnv.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnv.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,53 @@
  *
  */
 
-
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiEnv.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "interpreter/bytecodeStream.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/cpCacheOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "prims/jniCheck.hpp"
+#include "prims/jvm_misc.hpp"
+#include "prims/jvmtiAgentThread.hpp"
+#include "prims/jvmtiClassFileReconstituter.hpp"
+#include "prims/jvmtiCodeBlobEvents.hpp"
+#include "prims/jvmtiExtensions.hpp"
+#include "prims/jvmtiGetLoadedClasses.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiManageCapabilities.hpp"
+#include "prims/jvmtiRawMonitor.hpp"
+#include "prims/jvmtiRedefineClasses.hpp"
+#include "prims/jvmtiTagMap.hpp"
+#include "prims/jvmtiThreadState.inline.hpp"
+#include "prims/jvmtiUtil.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/jfieldIDWorkaround.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/reflectionUtils.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vmThread.hpp"
+#include "services/threadService.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/preserveException.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 
 
 #define FIXLATER 0 // REMOVE this when completed.
@@ -1752,6 +1796,29 @@
   }
 } /* end GetLocalObject */
 
+// Threads_lock NOT held, java_thread not protected by lock
+// java_thread - pre-checked
+// java_thread - unchecked
+// depth - pre-checked as non-negative
+// value - pre-checked for NULL
+jvmtiError
+JvmtiEnv::GetLocalInstance(JavaThread* java_thread, jint depth, jobject* value){
+  JavaThread* current_thread = JavaThread::current();
+  // rm object is created to clean up the javaVFrame created in
+  // doit_prologue(), but after doit() is finished with it.
+  ResourceMark rm(current_thread);
+
+  VM_GetReceiver op(java_thread, current_thread, depth);
+  VMThread::execute(&op);
+  jvmtiError err = op.result();
+  if (err != JVMTI_ERROR_NONE) {
+    return err;
+  } else {
+    *value = op.value().l;
+    return JVMTI_ERROR_NONE;
+  }
+} /* end GetLocalInstance */
+
 
 // Threads_lock NOT held, java_thread not protected by lock
 // java_thread - pre-checked
--- a/src/share/vm/prims/jvmtiEnv.xsl	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnv.xsl	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,6 @@
 <xsl:template match="specification">
   <xsl:call-template name="sourceHeader"/>
   <xsl:text>
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiEnv.cpp.incl"
 
 // end file prefix - do not modify or remove this line
 </xsl:text>
--- a/src/share/vm/prims/jvmtiEnvBase.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnvBase.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,30 @@
  * questions.
  *
  */
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiEnvBase.cpp.incl"
 
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "prims/jvmtiEnvBase.hpp"
+#include "prims/jvmtiEventController.inline.hpp"
+#include "prims/jvmtiExtensions.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiManageCapabilities.hpp"
+#include "prims/jvmtiTagMap.hpp"
+#include "prims/jvmtiThreadState.inline.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/jfieldIDWorkaround.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/objectMonitor.inline.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframe_hp.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
 
 ///////////////////////////////////////////////////////////////
 //
@@ -140,6 +161,14 @@
   return major == 1 && minor == 1;  // micro version doesn't matter here
 }
 
+bool
+JvmtiEnvBase::use_version_1_2_semantics() {
+  int major, minor, micro;
+
+  JvmtiExport::decode_version_values(_version, &major, &minor, &micro);
+  return major == 1 && minor == 2;  // micro version doesn't matter here
+}
+
 
 JvmtiEnvBase::JvmtiEnvBase(jint version) : _env_event_enable() {
   _version = version;
--- a/src/share/vm/prims/jvmtiEnvBase.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnvBase.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#ifndef _JAVA_JVMTIENVBASE_H_
-#define _JAVA_JVMTIENVBASE_H_
+#ifndef SHARE_VM_PRIMS_JVMTIENVBASE_HPP
+#define SHARE_VM_PRIMS_JVMTIENVBASE_HPP
+
+#include "classfile/classLoader.hpp"
+#include "prims/jvmtiEnvThreadState.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/growableArray.hpp"
 
 //
 // Forward Declarations
@@ -55,7 +66,8 @@
 
   enum {
     JDK15_JVMTI_VERSION = JVMTI_VERSION_1_0 +  33,  /* version: 1.0.33  */
-    JDK16_JVMTI_VERSION = JVMTI_VERSION_1_1 + 102   /* version: 1.1.102 */
+    JDK16_JVMTI_VERSION = JVMTI_VERSION_1_1 + 102,  /* version: 1.1.102 */
+    JDK17_JVMTI_VERSION = JVMTI_VERSION_1_2 +   1   /* version: 1.2.1   */
   };
 
   static jvmtiPhase  get_phase()                    { return _phase; }
@@ -125,6 +137,7 @@
 
   bool use_version_1_0_semantics();  // agent asked for version 1.0
   bool use_version_1_1_semantics();  // agent asked for version 1.1
+  bool use_version_1_2_semantics();  // agent asked for version 1.2
 
   bool is_retransformable()                        { return _is_retransformable; }
 
@@ -597,4 +610,4 @@
   jvmtiError error() { return _error;}
 };
 
-#endif   /* _JAVA_JVMTIENVBASE_H_ */
+#endif // SHARE_VM_PRIMS_JVMTIENVBASE_HPP
--- a/src/share/vm/prims/jvmtiEnvThreadState.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnvThreadState.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiEnvThreadState.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jvmtiEnvThreadState.hpp"
+#include "prims/jvmtiEventController.inline.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vm_operations.hpp"
 
 
 ///////////////////////////////////////////////////////////////
--- a/src/share/vm/prims/jvmtiEnvThreadState.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEnvThreadState.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,17 @@
  * questions.
  *
  */
-#ifndef _JAVA_JVMTIENVTHREADSTATE_H_
-#define _JAVA_JVMTIENVTHREADSTATE_H_
+
+#ifndef SHARE_VM_PRIMS_JVMTIENVTHREADSTATE_HPP
+#define SHARE_VM_PRIMS_JVMTIENVTHREADSTATE_HPP
+
+#include "jvmtifiles/jvmti.h"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/growableArray.hpp"
 
 class JvmtiEnv;
 
@@ -174,4 +183,4 @@
 
 };
 
-#endif   /* _JAVA_JVMTIENVTHREADSTATE_H_ */
+#endif // SHARE_VM_PRIMS_JVMTIENVTHREADSTATE_HPP
--- a/src/share/vm/prims/jvmtiEventController.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEventController.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiEventController.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "prims/jvmtiEventController.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiThreadState.inline.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframe_hp.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
 
 #ifdef JVMTI_TRACE
 #define EC_TRACE(out) if (JvmtiTrace::trace_event_controller()) { SafeResourceMark rm; tty->print_cr out; } while (0)
--- a/src/share/vm/prims/jvmtiEventController.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEventController.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-#ifndef _JAVA_JVMTI_EVENT_CONTROLLER_H_
-#define _JAVA_JVMTI_EVENT_CONTROLLER_H_
+#ifndef SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_HPP
+#define SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_HPP
+
+#include "jvmtifiles/jvmti.h"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 // forward declaration
 class JvmtiEventControllerPrivate;
@@ -237,4 +242,4 @@
   static void vm_death();
 };
 
-#endif   /* _JAVA_JVMTI_EVENT_CONTROLLER_H_ */
+#endif // SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_HPP
--- a/src/share/vm/prims/jvmtiEventController.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiEventController.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP
+#define SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP
+
+#include "prims/jvmtiEventController.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiUtil.hpp"
+
 // these inline functions are in a separate file to break include cycles
 
 
@@ -99,3 +106,5 @@
 inline bool JvmtiEventController::is_enabled(jvmtiEvent event_type) {
   return _universal_global_event_enabled.is_enabled(event_type);
 }
+
+#endif // SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP
--- a/src/share/vm/prims/jvmtiExport.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiExport.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,37 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiExport.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "prims/jvmtiCodeBlobEvents.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "prims/jvmtiEventController.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiManageCapabilities.hpp"
+#include "prims/jvmtiRawMonitor.hpp"
+#include "prims/jvmtiTagMap.hpp"
+#include "prims/jvmtiThreadState.inline.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/objectMonitor.inline.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vframe.hpp"
+#include "services/attachListener.hpp"
+#include "services/serviceUtil.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
+#endif
 
 #ifdef JVMTI_TRACE
 #define EVT_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_SENT) != 0) { SafeResourceMark rm; tty->print_cr out; }
@@ -325,18 +354,18 @@
   // micro version doesn't matter here (yet?)
   decode_version_values(version, &major, &minor, &micro);
   switch (major) {
-  case 1:
+    case 1:
       switch (minor) {
-      case 0:  // version 1.0.<micro> is recognized
-      case 1:  // version 1.1.<micro> is recognized
+        case 0:  // version 1.0.<micro> is recognized
+        case 1:  // version 1.1.<micro> is recognized
+        case 2:  // version 1.2.<micro> is recognized
           break;
 
-      default:
+        default:
           return JNI_EVERSION;  // unsupported minor version number
       }
       break;
-
-  default:
+    default:
       return JNI_EVERSION;  // unsupported major version number
   }
 
@@ -2269,16 +2298,16 @@
   // load it from the standard dll directory.
 
   if (is_absolute_path) {
-    library = hpi::dll_load(agent, ebuf, sizeof ebuf);
+    library = os::dll_load(agent, ebuf, sizeof ebuf);
   } else {
     // Try to load the agent from the standard dll directory
-    hpi::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), agent);
-    library = hpi::dll_load(buffer, ebuf, sizeof ebuf);
+    os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), agent);
+    library = os::dll_load(buffer, ebuf, sizeof ebuf);
     if (library == NULL) {
       // not found - try local path
       char ns[1] = {0};
-      hpi::dll_build_name(buffer, sizeof(buffer), ns, agent);
-      library = hpi::dll_load(buffer, ebuf, sizeof ebuf);
+      os::dll_build_name(buffer, sizeof(buffer), ns, agent);
+      library = os::dll_load(buffer, ebuf, sizeof ebuf);
     }
   }
 
@@ -2291,13 +2320,13 @@
     const char *on_attach_symbols[] = AGENT_ONATTACH_SYMBOLS;
     for (uint symbol_index = 0; symbol_index < ARRAY_SIZE(on_attach_symbols); symbol_index++) {
       on_attach_entry =
-        CAST_TO_FN_PTR(OnAttachEntry_t, hpi::dll_lookup(library, on_attach_symbols[symbol_index]));
+        CAST_TO_FN_PTR(OnAttachEntry_t, os::dll_lookup(library, on_attach_symbols[symbol_index]));
       if (on_attach_entry != NULL) break;
     }
 
     if (on_attach_entry == NULL) {
       // Agent_OnAttach missing - unload library
-      hpi::dll_unload(library);
+      os::dll_unload(library);
     } else {
       // Invoke the Agent_OnAttach function
       JavaThread* THREAD = JavaThread::current();
--- a/src/share/vm/prims/jvmtiExport.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiExport.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-#ifndef _JAVA_JVMTIEXPORT_H_
-#define _JAVA_JVMTIEXPORT_H_
+#ifndef SHARE_VM_PRIMS_JVMTIEXPORT_HPP
+#define SHARE_VM_PRIMS_JVMTIEXPORT_HPP
+
+#include "jvmtifiles/jvmti.h"
+#include "memory/allocation.hpp"
+#include "memory/iterator.hpp"
+#include "oops/oop.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/handles.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/growableArray.hpp"
+
+// Must be included after jvmti.h.
+#include "code/jvmticmlr.h"
 
 // Forward declarations
 
@@ -553,4 +566,4 @@
   }
 };
 
-#endif   /* _JAVA_JVMTIEXPORT_H_ */
+#endif // SHARE_VM_PRIMS_JVMTIEXPORT_HPP
--- a/src/share/vm/prims/jvmtiExtensions.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiExtensions.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiExtensions.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiExtensions.hpp"
 
 // the list of extension functions
 GrowableArray<jvmtiExtensionFunctionInfo*>* JvmtiExtensions::_ext_functions;
--- a/src/share/vm/prims/jvmtiExtensions.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiExtensions.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,14 @@
  *
  */
 
-#ifndef _JVMTI_EXTENSIONS_H_
-#define _JVMTI_EXTENSIONS_H_
+#ifndef SHARE_VM_PRIMS_JVMTIEXTENSIONS_HPP
+#define SHARE_VM_PRIMS_JVMTIEXTENSIONS_HPP
 
+#ifndef JVMTI_KERNEL
+#include "jvmtifiles/jvmti.h"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/allocation.hpp"
+#endif
 
 // JvmtiExtensions
 //
@@ -55,4 +60,4 @@
                                        jvmtiExtensionEvent callback);
 };
 
-#endif  /* _JVMTI_EXTENSIONS_H_ */
+#endif // SHARE_VM_PRIMS_JVMTIEXTENSIONS_HPP
--- a/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,12 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/universe.inline.hpp"
+#include "prims/jvmtiGetLoadedClasses.hpp"
+#include "runtime/thread.hpp"
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiGetLoadedClasses.cpp.incl"
 
 
 // The closure for GetLoadedClasses and GetClassLoaderClasses
--- a/src/share/vm/prims/jvmtiGetLoadedClasses.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiGetLoadedClasses.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIGETLOADEDCLASSES_HPP
+#define SHARE_VM_PRIMS_JVMTIGETLOADEDCLASSES_HPP
+
+#include "jvmtifiles/jvmtiEnv.hpp"
+
 class JvmtiGetLoadedClasses : AllStatic {
 public:
   static jvmtiError getLoadedClasses(JvmtiEnv *env, jint* classCountPtr, jclass** classesPtr);
   static jvmtiError getClassLoaderClasses(JvmtiEnv *env, jobject initiatingLoader,
                                           jint* classCountPtr, jclass** classesPtr);
 };
+
+#endif // SHARE_VM_PRIMS_JVMTIGETLOADEDCLASSES_HPP
--- a/src/share/vm/prims/jvmtiH.xsl	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiH.xsl	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
- Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -112,6 +112,7 @@
     JVMTI_VERSION_1   = 0x30010000,
     JVMTI_VERSION_1_0 = 0x30010000,
     JVMTI_VERSION_1_1 = 0x30010100,
+    JVMTI_VERSION_1_2 = 0x30010200,
 
     JVMTI_VERSION = 0x30000000 + (</xsl:text>
   <xsl:value-of select="//specification/@majorversion"/>
--- a/src/share/vm/prims/jvmtiHpp.xsl	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiHpp.xsl	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,13 @@
   <xsl:call-template name="includeHeader"/>
   <xsl:text>
     
+
+#ifndef GENERATED_JVMTIFILES_JVMTIENV_HPP
+#define GENERATED_JVMTIFILES_JVMTIENV_HPP
+
+#include "prims/jvmtiEnvBase.hpp"
+#include "prims/jvmtiImpl.hpp"
+
 enum {
     JVMTI_INTERNAL_CAPABILITY_COUNT = </xsl:text>
   <xsl:value-of select="count(//capabilityfield)"/>
@@ -59,6 +66,8 @@
   <xsl:apply-templates select="functionsection"/>
   <xsl:text>
 };
+
+#endif // GENERATED_JVMTIFILES_JVMTIENV_HPP
 </xsl:text>
 </xsl:template>
 
--- a/src/share/vm/prims/jvmtiImpl.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiImpl.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,35 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiImpl.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "prims/jvmtiAgentThread.hpp"
+#include "prims/jvmtiEventController.inline.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiRedefineClasses.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframe_hp.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/exceptions.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 //
 // class JvmtiAgentThread
@@ -559,7 +586,6 @@
 {
 }
 
-
 vframe *VM_GetOrSetLocal::get_vframe() {
   if (!_thread->has_last_Java_frame()) {
     return NULL;
@@ -582,7 +608,7 @@
   }
   javaVFrame *jvf = (javaVFrame*)vf;
 
-  if (!vf->is_java_frame() || jvf->method()->is_native()) {
+  if (!vf->is_java_frame()) {
     _result = JVMTI_ERROR_OPAQUE_FRAME;
     return NULL;
   }
@@ -713,6 +739,15 @@
   _jvf = get_java_vframe();
   NULL_CHECK(_jvf, false);
 
+  if (_jvf->method()->is_native()) {
+    if (getting_receiver() && !_jvf->method()->is_static()) {
+      return true;
+    } else {
+      _result = JVMTI_ERROR_OPAQUE_FRAME;
+      return false;
+    }
+  }
+
   if (!check_slot_type(_jvf)) {
     return false;
   }
@@ -754,40 +789,46 @@
     HandleMark hm;
 
     switch (_type) {
-    case T_INT:    locals->set_int_at   (_index, _value.i); break;
-    case T_LONG:   locals->set_long_at  (_index, _value.j); break;
-    case T_FLOAT:  locals->set_float_at (_index, _value.f); break;
-    case T_DOUBLE: locals->set_double_at(_index, _value.d); break;
-    case T_OBJECT: {
-      Handle ob_h(JNIHandles::resolve_external_guard(_value.l));
-      locals->set_obj_at (_index, ob_h);
-      break;
-    }
-    default: ShouldNotReachHere();
+      case T_INT:    locals->set_int_at   (_index, _value.i); break;
+      case T_LONG:   locals->set_long_at  (_index, _value.j); break;
+      case T_FLOAT:  locals->set_float_at (_index, _value.f); break;
+      case T_DOUBLE: locals->set_double_at(_index, _value.d); break;
+      case T_OBJECT: {
+        Handle ob_h(JNIHandles::resolve_external_guard(_value.l));
+        locals->set_obj_at (_index, ob_h);
+        break;
+      }
+      default: ShouldNotReachHere();
     }
     _jvf->set_locals(locals);
   } else {
-    StackValueCollection *locals = _jvf->locals();
+    if (_jvf->method()->is_native() && _jvf->is_compiled_frame()) {
+      assert(getting_receiver(), "Can only get here when getting receiver");
+      oop receiver = _jvf->fr().get_native_receiver();
+      _value.l = JNIHandles::make_local(_calling_thread, receiver);
+    } else {
+      StackValueCollection *locals = _jvf->locals();
 
-    if (locals->at(_index)->type() == T_CONFLICT) {
-      memset(&_value, 0, sizeof(_value));
-      _value.l = NULL;
-      return;
-    }
+      if (locals->at(_index)->type() == T_CONFLICT) {
+        memset(&_value, 0, sizeof(_value));
+        _value.l = NULL;
+        return;
+      }
 
-    switch (_type) {
-    case T_INT:    _value.i = locals->int_at   (_index);   break;
-    case T_LONG:   _value.j = locals->long_at  (_index);   break;
-    case T_FLOAT:  _value.f = locals->float_at (_index);   break;
-    case T_DOUBLE: _value.d = locals->double_at(_index);   break;
-    case T_OBJECT: {
-      // Wrap the oop to be returned in a local JNI handle since
-      // oops_do() no longer applies after doit() is finished.
-      oop obj = locals->obj_at(_index)();
-      _value.l = JNIHandles::make_local(_calling_thread, obj);
-      break;
-    }
-    default: ShouldNotReachHere();
+      switch (_type) {
+        case T_INT:    _value.i = locals->int_at   (_index);   break;
+        case T_LONG:   _value.j = locals->long_at  (_index);   break;
+        case T_FLOAT:  _value.f = locals->float_at (_index);   break;
+        case T_DOUBLE: _value.d = locals->double_at(_index);   break;
+        case T_OBJECT: {
+          // Wrap the oop to be returned in a local JNI handle since
+          // oops_do() no longer applies after doit() is finished.
+          oop obj = locals->obj_at(_index)();
+          _value.l = JNIHandles::make_local(_calling_thread, obj);
+          break;
+        }
+        default: ShouldNotReachHere();
+      }
     }
   }
 }
@@ -798,6 +839,10 @@
 }
 
 
+VM_GetReceiver::VM_GetReceiver(
+    JavaThread* thread, JavaThread* caller_thread, jint depth)
+    : VM_GetOrSetLocal(thread, caller_thread, depth, 0) {}
+
 /////////////////////////////////////////////////////////////////////////////////////////
 
 //
--- a/src/share/vm/prims/jvmtiImpl.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiImpl.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIIMPL_HPP
+#define SHARE_VM_PRIMS_JVMTIIMPL_HPP
+
+#ifndef JVMTI_KERNEL
+
+#include "classfile/systemDictionary.hpp"
+#include "jvmtifiles/jvmti.h"
+#include "oops/objArrayOop.hpp"
+#include "prims/jvmtiEnvThreadState.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "prims/jvmtiTrace.hpp"
+#include "prims/jvmtiUtil.hpp"
+#include "runtime/stackValueCollection.hpp"
+#include "runtime/vm_operations.hpp"
+
 //
 // Forward Declarations
 //
@@ -340,7 +355,7 @@
 // to the thread simultaneously.
 //
 class VM_GetOrSetLocal : public VM_Operation {
-private:
+ protected:
   JavaThread* _thread;
   JavaThread* _calling_thread;
   jint        _depth;
@@ -350,6 +365,10 @@
   javaVFrame* _jvf;
   bool        _set;
 
+  // It is possible to get the receiver out of a non-static native wrapper
+  // frame.  Use VM_GetReceiver to do this.
+  virtual bool getting_receiver() const { return false; }
+
   jvmtiError  _result;
 
   vframe* get_vframe();
@@ -380,6 +399,15 @@
   static bool is_assignable(const char* ty_sign, Klass* klass, Thread* thread);
 };
 
+class VM_GetReceiver : public VM_GetOrSetLocal {
+ protected:
+  virtual bool getting_receiver() const { return true; }
+
+ public:
+  VM_GetReceiver(JavaThread* thread, JavaThread* calling_thread, jint depth);
+  const char* name() const                       { return "get receiver"; }
+};
+
 
 ///////////////////////////////////////////////////////////////
 //
@@ -402,5 +430,9 @@
   static void print();
 };
 
+#endif // !JVMTI_KERNEL
+
 // Utility macro that checks for NULL pointers:
 #define NULL_CHECK(X, Y) if ((X) == NULL) { return (Y); }
+
+#endif // SHARE_VM_PRIMS_JVMTIIMPL_HPP
--- a/src/share/vm/prims/jvmtiManageCapabilities.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiManageCapabilities.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -21,9 +21,11 @@
  * questions.
  *
  */
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiManageCapabilities.cpp.incl"
 
+#include "precompiled.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiManageCapabilities.hpp"
 static const jint CAPA_SIZE = (JVMTI_INTERNAL_CAPABILITY_COUNT + 7) / 8;
 
   // capabilities which are always potentially available
--- a/src/share/vm/prims/jvmtiManageCapabilities.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiManageCapabilities.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,11 @@
  *
  */
 
-#ifndef _JAVA_JVMTI_MANAGE_CAPABILITIES_H_
-#define _JAVA_JVMTI_MANAGE_CAPABILITIES_H_
+#ifndef SHARE_VM_PRIMS_JVMTIMANAGECAPABILITIES_HPP
+#define SHARE_VM_PRIMS_JVMTIMANAGECAPABILITIES_HPP
 
-
+#include "jvmtifiles/jvmti.h"
+#include "memory/allocation.hpp"
 
 class JvmtiManageCapabilities : public AllStatic {
 
@@ -84,4 +85,4 @@
 #endif
 };
 
-#endif   /* _JAVA_JVMTI_MANAGE_CAPABILITIES_H_ */
+#endif // SHARE_VM_PRIMS_JVMTIMANAGECAPABILITIES_HPP
--- a/src/share/vm/prims/jvmtiRawMonitor.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiRawMonitor.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiRawMonitor.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvmtiRawMonitor.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/thread.hpp"
 
 GrowableArray<JvmtiRawMonitor*> *JvmtiPendingMonitors::_monitors = new (ResourceObj::C_HEAP) GrowableArray<JvmtiRawMonitor*>(1,true);
 
--- a/src/share/vm/prims/jvmtiRawMonitor.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiRawMonitor.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIRAWMONITOR_HPP
+#define SHARE_VM_PRIMS_JVMTIRAWMONITOR_HPP
+
+#ifndef JVMTI_KERNEL
+#include "runtime/objectMonitor.hpp"
+#include "utilities/growableArray.hpp"
+#endif
+
 //
 // class JvmtiRawMonitor
 //
@@ -97,3 +105,5 @@
 
   static void transition_raw_monitors();
 };
+
+#endif // SHARE_VM_PRIMS_JVMTIRAWMONITOR_HPP
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiRedefineClasses.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/verifier.hpp"
+#include "code/codeCache.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "interpreter/rewriter.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/klassVtable.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiRedefineClasses.hpp"
+#include "prims/methodComparator.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/relocator.hpp"
+#include "utilities/bitMap.inline.hpp"
 
 
 objArrayOop VM_RedefineClasses::_old_methods = NULL;
@@ -201,7 +214,7 @@
     case JVM_CONSTANT_Double:  // fall through
     case JVM_CONSTANT_Long:
     {
-      scratch_cp->copy_entry_to(scratch_i, *merge_cp_p, *merge_cp_length_p,
+      constantPoolOopDesc::copy_entry_to(scratch_cp, scratch_i, *merge_cp_p, *merge_cp_length_p,
         THREAD);
 
       if (scratch_i != *merge_cp_length_p) {
@@ -226,7 +239,7 @@
     case JVM_CONSTANT_UnresolvedClass:  // fall through
     case JVM_CONSTANT_UnresolvedString:
     {
-      scratch_cp->copy_entry_to(scratch_i, *merge_cp_p, *merge_cp_length_p,
+      constantPoolOopDesc::copy_entry_to(scratch_cp, scratch_i, *merge_cp_p, *merge_cp_length_p,
         THREAD);
 
       if (scratch_i != *merge_cp_length_p) {
@@ -1080,13 +1093,13 @@
       case JVM_CONSTANT_Long:
         // just copy the entry to *merge_cp_p, but double and long take
         // two constant pool entries
-        old_cp->copy_entry_to(old_i, *merge_cp_p, old_i, CHECK_0);
+        constantPoolOopDesc::copy_entry_to(old_cp, old_i, *merge_cp_p, old_i, CHECK_0);
         old_i++;
         break;
 
       default:
         // just copy the entry to *merge_cp_p
-        old_cp->copy_entry_to(old_i, *merge_cp_p, old_i, CHECK_0);
+        constantPoolOopDesc::copy_entry_to(old_cp, old_i, *merge_cp_p, old_i, CHECK_0);
         break;
       }
     } // end for each old_cp entry
--- a/src/share/vm/prims/jvmtiRedefineClasses.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiRedefineClasses.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIREDEFINECLASSES_HPP
+#define SHARE_VM_PRIMS_JVMTIREDEFINECLASSES_HPP
+
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/vm_operations.hpp"
+
 // Introduction:
 //
 // The RedefineClasses() API is used to change the definition of one or
@@ -487,3 +498,5 @@
   // and redefine implementation
   static bool is_modifiable_class(oop klass_mirror);
 };
+
+#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSES_HPP
--- a/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
+#define SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
+
 // RedefineClasses tracing support via the TraceRedefineClasses
 // option. A bit is assigned to each group of trace messages.
 // Groups of messages are individually selectable. We have to use
@@ -121,3 +124,5 @@
   if (RC_TRACE_ENABLED(0x00000004)) { \
     t.stop(); \
   } while (0)
+
+#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
--- a/src/share/vm/prims/jvmtiTagMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiTagMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,31 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiTagMap.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline2.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "prims/jvmtiEventController.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiTagMap.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/reflectionUtils.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/serviceUtil.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#endif
 
 // JvmtiTagHashmapEntry
 //
--- a/src/share/vm/prims/jvmtiTagMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiTagMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,17 @@
 
 // JvmtiTagMap
 
-#ifndef _JAVA_JVMTI_TAG_MAP_H_
-#define _JAVA_JVMTI_TAG_MAP_H_
+#ifndef SHARE_VM_PRIMS_JVMTITAGMAP_HPP
+#define SHARE_VM_PRIMS_JVMTITAGMAP_HPP
+
+#ifndef JVMTI_KERNEL
+#include "gc_interface/collectedHeap.hpp"
+#include "jvmtifiles/jvmti.h"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/allocation.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/universe.hpp"
+#endif
 
 // forward references
 class JvmtiTagHashmap;
@@ -132,4 +141,4 @@
   static void cms_ref_processing_epilogue();
 };
 
-#endif   /* _JAVA_JVMTI_TAG_MAP_H_ */
+#endif // SHARE_VM_PRIMS_JVMTITAGMAP_HPP
--- a/src/share/vm/prims/jvmtiThreadState.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiThreadState.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiThreadState.cpp.incl"
+#include "precompiled.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jvmtiEventController.inline.hpp"
+#include "prims/jvmtiImpl.hpp"
+#include "prims/jvmtiThreadState.inline.hpp"
+#include "runtime/vframe.hpp"
 
 // marker for when the stack depth has been reset and is now unknown.
 // any negative number would work but small ones might obscure an
--- a/src/share/vm/prims/jvmtiThreadState.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiThreadState.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,15 @@
  *
  */
 
-#ifndef _JAVA_JVMTITHREADSTATE_H_
-#define _JAVA_JVMTITHREADSTATE_H_
+#ifndef SHARE_VM_PRIMS_JVMTITHREADSTATE_HPP
+#define SHARE_VM_PRIMS_JVMTITHREADSTATE_HPP
+
+#include "jvmtifiles/jvmti.h"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/growableArray.hpp"
 
 //
 // Forward Declarations
@@ -403,4 +410,4 @@
   }
 };
 
-#endif   /* _JAVA_JVMTITHREADSTATE_H_ */
+#endif // SHARE_VM_PRIMS_JVMTITHREADSTATE_HPP
--- a/src/share/vm/prims/jvmtiThreadState.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiThreadState.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTITHREADSTATE_INLINE_HPP
+#define SHARE_VM_PRIMS_JVMTITHREADSTATE_INLINE_HPP
+
+#include "prims/jvmtiEnvThreadState.hpp"
+#include "prims/jvmtiThreadState.hpp"
+
 // JvmtiEnvThreadStateIterator implementation
 
 inline JvmtiEnvThreadStateIterator::JvmtiEnvThreadStateIterator(JvmtiThreadState* thread_state) {
@@ -60,3 +66,5 @@
 void JvmtiThreadState::set_head_env_thread_state(JvmtiEnvThreadState* ets) {
   _head_env_thread_state = ets;
 }
+
+#endif // SHARE_VM_PRIMS_JVMTITHREADSTATE_INLINE_HPP
--- a/src/share/vm/prims/jvmtiTrace.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiTrace.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiTrace.cpp.incl"
+#include "precompiled.hpp"
+#include "jvmtifiles/jvmtiEnv.hpp"
+#include "prims/jvmtiTrace.hpp"
 
 //
 // class JvmtiTrace
--- a/src/share/vm/prims/jvmtiTrace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiTrace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTITRACE_HPP
+#define SHARE_VM_PRIMS_JVMTITRACE_HPP
+
+#include "classfile/systemDictionary.hpp"
+#include "jvmtifiles/jvmti.h"
+#include "oops/objArrayOop.hpp"
+#include "prims/jvmtiEnvThreadState.hpp"
+#include "prims/jvmtiEventController.hpp"
+#include "prims/jvmtiUtil.hpp"
+#include "runtime/stackValueCollection.hpp"
+#include "runtime/vm_operations.hpp"
+
 ///////////////////////////////////////////////////////////////
 //
 // class JvmtiTrace
@@ -96,3 +108,5 @@
 };
 
 #endif /*JVMTI_TRACE */
+
+#endif // SHARE_VM_PRIMS_JVMTITRACE_HPP
--- a/src/share/vm/prims/jvmtiUtil.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiUtil.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jvmtiUtil.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvmtiUtil.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/exceptions.hpp"
+
 //
 // class JvmtiUtil
 //
--- a/src/share/vm/prims/jvmtiUtil.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/jvmtiUtil.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_JVMTIUTIL_HPP
+#define SHARE_VM_PRIMS_JVMTIUTIL_HPP
+
+#include "jvmtifiles/jvmti.h"
+#include "memory/resourceArea.hpp"
+#include "prims/jvmtiEventController.hpp"
+
 ///////////////////////////////////////////////////////////////
 //
 // class JvmtiUtil
@@ -84,3 +91,5 @@
   SafeResourceMark() : ResourceMark(safe_resource_area()) {}
 
 };
+
+#endif // SHARE_VM_PRIMS_JVMTIUTIL_HPP
--- a/src/share/vm/prims/methodComparator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/methodComparator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_methodComparator.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/methodComparator.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 BytecodeStream *MethodComparator::_s_old;
 BytecodeStream *MethodComparator::_s_new;
--- a/src/share/vm/prims/methodComparator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/methodComparator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_METHODCOMPARATOR_HPP
+#define SHARE_VM_PRIMS_METHODCOMPARATOR_HPP
+
+#include "interpreter/bytecodeStream.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/methodOop.hpp"
+
 class BciMap;
 
 // methodComparator provides an interface for determining if methods of
@@ -121,3 +128,5 @@
     else return false;
   }
 };
+
+#endif // SHARE_VM_PRIMS_METHODCOMPARATOR_HPP
--- a/src/share/vm/prims/methodHandleWalk.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/methodHandleWalk.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,13 +22,15 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "interpreter/rewriter.hpp"
+#include "memory/oopFactory.hpp"
+#include "prims/methodHandleWalk.hpp"
+
 /*
  * JSR 292 reference implementation: method handle structure analysis
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandleWalk.cpp.incl"
-
 
 // -----------------------------------------------------------------------------
 // MethodHandleChain
@@ -966,16 +968,11 @@
 
   if (tailcall) {
     // Actually, in order to make these methods more recognizable,
-    // let's put them in holder classes MethodHandle and InvokeDynamic.
-    // That way stack walkers and compiler heuristics can recognize them.
-    _target_klass = (for_invokedynamic()
-                     ? SystemDictionary::InvokeDynamic_klass()
-                     : SystemDictionary::MethodHandle_klass());
+    // let's put them in holder class MethodHandle.  That way stack
+    // walkers and compiler heuristics can recognize them.
+    _target_klass = SystemDictionary::MethodHandle_klass();
   }
 
-  // instanceKlass* ik = instanceKlass::cast(klass);
-  // tty->print_cr("MethodHandleCompiler::make_invoke: %s %s.%s%s", Bytecodes::name(op), ik->external_name(), name->as_C_string(), signature->as_C_string());
-
   // Inline the method.
   InvocationCounter* ic = m->invocation_counter();
   ic->set_carry_flag();
--- a/src/share/vm/prims/methodHandleWalk.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/methodHandleWalk.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_METHODHANDLEWALK_HPP
+#define SHARE_VM_PRIMS_METHODHANDLEWALK_HPP
+
+#include "prims/methodHandles.hpp"
+
 // Low-level parser for method handle chains.
 class MethodHandleChain : StackObj {
 public:
@@ -407,7 +412,8 @@
 
   // Tests if the given class is a MH adapter holder.
   static bool klass_is_method_handle_adapter_holder(klassOop klass) {
-    return (klass == SystemDictionary::MethodHandle_klass() ||
-            klass == SystemDictionary::InvokeDynamic_klass());
+    return (klass == SystemDictionary::MethodHandle_klass());
   }
 };
+
+#endif // SHARE_VM_PRIMS_METHODHANDLEWALK_HPP
--- a/src/share/vm/prims/methodHandles.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/methodHandles.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,13 +22,21 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubRoutines.hpp"
+
 /*
  * JSR 292 reference implementation: method handles
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles.cpp.incl"
-
 bool MethodHandles::_enabled = false; // set true after successful native linkage
 
 MethodHandleEntry* MethodHandles::_entries[MethodHandles::_EK_LIMIT] = {NULL};
@@ -477,9 +485,8 @@
   Handle polymorphic_method_type;
   bool polymorphic_signature = false;
   if ((flags & ALL_KINDS) == IS_METHOD &&
-      (defc() == SystemDictionary::InvokeDynamic_klass() ||
-       (defc() == SystemDictionary::MethodHandle_klass() &&
-        methodOopDesc::is_method_handle_invoke_name(name()))))
+      (defc() == SystemDictionary::MethodHandle_klass() &&
+       methodOopDesc::is_method_handle_invoke_name(name())))
     polymorphic_signature = true;
 
   // convert the external string or reflective type to an internal signature
--- a/src/share/vm/prims/methodHandles.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/methodHandles.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_METHODHANDLES_HPP
+#define SHARE_VM_PRIMS_METHODHANDLES_HPP
+
+#include "classfile/javaClasses.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+
 class MacroAssembler;
 class Label;
 class MethodHandleEntry;
@@ -523,3 +532,5 @@
 
   void generate();
 };
+
+#endif // SHARE_VM_PRIMS_METHODHANDLES_HPP
--- a/src/share/vm/prims/nativeLookup.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/nativeLookup.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,33 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_nativeLookup.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvm_misc.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 
 static void mangle_name_on(outputStream* st, symbolOop name, int begin, int end) {
@@ -128,7 +153,7 @@
   if (loader.is_null()) {
     entry = lookup_special_native(jni_name);
     if (entry == NULL) {
-       entry = (address) hpi::dll_lookup(os::native_java_library(), jni_name);
+       entry = (address) os::dll_lookup(os::native_java_library(), jni_name);
     }
     if (entry != NULL) {
       in_base_library = true;
@@ -155,7 +180,7 @@
     // findNative didn't find it, if there are any agent libraries look in them
     AgentLibrary* agent;
     for (agent = Arguments::agents(); agent != NULL; agent = agent->next()) {
-      entry = (address) hpi::dll_lookup(agent->os_lib(), jni_name);
+      entry = (address) os::dll_lookup(agent->os_lib(), jni_name);
       if (entry != NULL) {
         return entry;
       }
--- a/src/share/vm/prims/nativeLookup.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/nativeLookup.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_NATIVELOOKUP_HPP
+#define SHARE_VM_PRIMS_NATIVELOOKUP_HPP
+
+#include "runtime/handles.hpp"
+#include "utilities/top.hpp"
+
 // NativeLookup provides an interface for finding DLL entry points for
 // Java native functions.
 
@@ -43,3 +49,5 @@
   // Lookup native functions in base library.
   static address base_library_lookup(const char* class_name, const char* method_name, const char* signature);
 };
+
+#endif // SHARE_VM_PRIMS_NATIVELOOKUP_HPP
--- a/src/share/vm/prims/perf.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/perf.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,21 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jni.h"
+#include "prims/jvm.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/perfData.hpp"
+#include "runtime/perfMemory.hpp"
+
 /*
  *      Implementation of class sun.misc.Perf
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_perf.cpp.incl"
-
 
 #define PERF_ENTRY(result_type, header) \
   JVM_ENTRY(result_type, header)
--- a/src/share/vm/prims/privilegedStack.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/privilegedStack.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_privilegedStack.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/privilegedStack.hpp"
+#include "runtime/vframe.hpp"
 
 
 void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) {
--- a/src/share/vm/prims/privilegedStack.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/privilegedStack.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_PRIMS_PRIVILEGEDSTACK_HPP
+#define SHARE_VM_PRIMS_PRIVILEGEDSTACK_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/vframe.hpp"
+#include "utilities/growableArray.hpp"
+
 class PrivilegedElement VALUE_OBJ_CLASS_SPEC {
  private:
   klassOop  _klass;                // klass for method
@@ -41,3 +49,5 @@
   void print_on(outputStream* st) const   PRODUCT_RETURN;
   bool contains(address addr)             PRODUCT_RETURN0;
 };
+
+#endif // SHARE_VM_PRIMS_PRIVILEGEDSTACK_HPP
--- a/src/share/vm/prims/unsafe.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/prims/unsafe.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,24 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/jni.h"
+#include "prims/jvm.h"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/reflectionCompat.hpp"
+#include "runtime/synchronizer.hpp"
+#include "services/threadService.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/dtrace.hpp"
+
 /*
  *      Implementation of class sun.misc.Unsafe
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_unsafe.cpp.incl"
-
 HS_DTRACE_PROBE_DECL3(hotspot, thread__park__begin, uintptr_t, int, long long);
 HS_DTRACE_PROBE_DECL1(hotspot, thread__park__end, uintptr_t);
 HS_DTRACE_PROBE_DECL1(hotspot, thread__unpark, uintptr_t);
--- a/src/share/vm/runtime/aprofiler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/aprofiler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_aprofiler.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/permGen.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/space.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/aprofiler.hpp"
 
 
 bool AllocationProfiler::_active = false;
--- a/src/share/vm/runtime/aprofiler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/aprofiler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_APROFILER_HPP
+#define SHARE_VM_RUNTIME_APROFILER_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/universe.hpp"
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "utilities/top.hpp"
+
 // A simple allocation profiler for Java. The profiler collects and prints
 // the number and total size of instances allocated per class, including
 // array classes.
@@ -59,3 +68,5 @@
   // Print profile
   static void print(size_t cutoff);   // Cutoff in total allocation size (in words)
 };
+
+#endif // SHARE_VM_RUNTIME_APROFILER_HPP
--- a/src/share/vm/runtime/arguments.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,42 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_arguments.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaAssertions.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/referenceProcessor.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/globals_extension.hpp"
+#include "runtime/java.hpp"
+#include "services/management.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/taskqueue.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vm_version_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vm_version_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vm_version_zero.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#endif
 
 #define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
 #define DEFAULT_JAVA_LAUNCHER  "generic"
@@ -118,7 +152,6 @@
 // Initialize system properties key and value.
 void Arguments::init_system_properties() {
 
-  PropertyList_add(&_system_properties, new SystemProperty("java.vm.specification.version", "1.0", false));
   PropertyList_add(&_system_properties, new SystemProperty("java.vm.specification.name",
                                                                  "Java Virtual Machine Specification",  false));
   PropertyList_add(&_system_properties, new SystemProperty("java.vm.version", VM_Version::vm_release(),  false));
@@ -153,9 +186,23 @@
 
   // Update/Initialize System properties after JDK version number is known
 void Arguments::init_version_specific_system_properties() {
-  PropertyList_add(&_system_properties, new SystemProperty("java.vm.specification.vendor",
-        JDK_Version::is_gte_jdk17x_version() ? "Oracle Corporation" : "Sun Microsystems Inc.", false));
-  PropertyList_add(&_system_properties, new SystemProperty("java.vm.vendor", VM_Version::vm_vendor(),  false));
+  enum { bufsz = 16 };
+  char buffer[bufsz];
+  const char* spec_vendor = "Sun Microsystems Inc.";
+  uint32_t spec_version = 0;
+
+  if (JDK_Version::is_gte_jdk17x_version()) {
+    spec_vendor = "Oracle Corporation";
+    spec_version = JDK_Version::current().major_version();
+  }
+  jio_snprintf(buffer, bufsz, "1." UINT32_FORMAT, spec_version);
+
+  PropertyList_add(&_system_properties,
+      new SystemProperty("java.vm.specification.vendor",  spec_vendor, false));
+  PropertyList_add(&_system_properties,
+      new SystemProperty("java.vm.specification.version", buffer, false));
+  PropertyList_add(&_system_properties,
+      new SystemProperty("java.vm.vendor", VM_Version::vm_vendor(),  false));
 }
 
 /**
@@ -966,24 +1013,9 @@
 void Arguments::check_compressed_oops_compat() {
 #ifdef _LP64
   assert(UseCompressedOops, "Precondition");
-#  if defined(COMPILER1) && !defined(TIERED)
-  // Until c1 supports compressed oops turn them off.
-  FLAG_SET_DEFAULT(UseCompressedOops, false);
-#  else
   // Is it on by default or set on ergonomically
   bool is_on_by_default = FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops);
 
-  // Tiered currently doesn't work with compressed oops
-  if (TieredCompilation) {
-    if (is_on_by_default) {
-      FLAG_SET_DEFAULT(UseCompressedOops, false);
-      return;
-    } else {
-      vm_exit_during_initialization(
-        "Tiered compilation is not supported with compressed oops yet", NULL);
-    }
-  }
-
   // If dumping an archive or forcing its use, disable compressed oops if possible
   if (DumpSharedSpaces || RequireSharedSpaces) {
     if (is_on_by_default) {
@@ -997,9 +1029,7 @@
     // UseSharedSpaces is on by default. With compressed oops, we turn it off.
     FLAG_SET_DEFAULT(UseSharedSpaces, false);
   }
-
-#  endif // defined(COMPILER1) && !defined(TIERED)
-#endif // _LP64
+#endif
 }
 
 void Arguments::set_tiered_flags() {
@@ -1334,8 +1364,11 @@
 }
 
 inline uintx max_heap_for_compressed_oops() {
-  // Heap should be above HeapBaseMinAddress to get zero based compressed oops.
-  LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size() - HeapBaseMinAddress);
+  // Avoid sign flip.
+  if (OopEncodingHeapMax < MaxPermSize + os::vm_page_size()) {
+    return 0;
+  }
+  LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
   NOT_LP64(ShouldNotReachHere(); return 0);
 }
 
@@ -1513,7 +1546,13 @@
     }
     if (UseCompressedOops) {
       // Limit the heap size to the maximum possible when using compressed oops
-      reasonable_max = MIN2(reasonable_max, (julong)max_heap_for_compressed_oops());
+      julong max_coop_heap = (julong)max_heap_for_compressed_oops();
+      if (HeapBaseMinAddress + MaxHeapSize < max_coop_heap) {
+        // Heap should be above HeapBaseMinAddress to get zero based compressed oops
+        // but it should be not less than default MaxHeapSize.
+        max_coop_heap -= HeapBaseMinAddress;
+      }
+      reasonable_max = MIN2(reasonable_max, max_coop_heap);
     }
     reasonable_max = os::allocatable_physical_memory(reasonable_max);
 
@@ -3061,11 +3100,9 @@
   // Set flags based on ergonomics.
   set_ergonomics_flags();
 
-#ifdef _LP64
   if (UseCompressedOops) {
     check_compressed_oops_compat();
   }
-#endif
 
   // Check the GC selections again.
   if (!check_gc_consistency()) {
--- a/src/share/vm/runtime/arguments.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/arguments.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP
+#define SHARE_VM_RUNTIME_ARGUMENTS_HPP
+
+#include "runtime/java.hpp"
+#include "runtime/perfData.hpp"
+#include "utilities/top.hpp"
+
 // Arguments parses the command line and recognizes options
 
 // Invocation API hook typedefs (these should really be defined in jni.hpp)
@@ -538,3 +545,5 @@
   static char *get_kernel_properties();
 #endif // KERNEL
 };
+
+#endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP
--- a/src/share/vm/runtime/atomic.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/atomic.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,35 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_atomic.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/atomic.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "atomic_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "atomic_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "atomic_linux_zero.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "atomic_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "atomic_solaris_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "atomic_windows_x86.inline.hpp"
+#endif
 
 jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
   assert(sizeof(jbyte) == 1, "assumption.");
--- a/src/share/vm/runtime/atomic.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/atomic.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_ATOMIC_HPP
+#define SHARE_VM_RUNTIME_ATOMIC_HPP
+
+#include "memory/allocation.hpp"
+
 class Atomic : AllStatic {
  public:
   // Atomically store to a location
@@ -78,3 +83,5 @@
   static intptr_t cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value);
   static void*    cmpxchg_ptr(void*    exchange_value, volatile void*     dest, void*    compare_value);
 };
+
+#endif // SHARE_VM_RUNTIME_ATOMIC_HPP
--- a/src/share/vm/runtime/basicLock.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/basicLock.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_basicLock.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/synchronizer.hpp"
 
 void BasicLock::print_on(outputStream* st) const {
   st->print("monitor");
--- a/src/share/vm/runtime/basicLock.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/basicLock.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_BASICLOCK_HPP
+#define SHARE_VM_RUNTIME_BASICLOCK_HPP
+
+#include "oops/markOop.hpp"
+#include "runtime/handles.hpp"
+#include "utilities/top.hpp"
+
 class BasicLock VALUE_OBJ_CLASS_SPEC {
   friend class VMStructs;
  private:
@@ -70,3 +77,5 @@
   static int lock_offset_in_bytes()                   { return offset_of(BasicObjectLock, _lock); }
 };
 
+
+#endif // SHARE_VM_RUNTIME_BASICLOCK_HPP
--- a/src/share/vm/runtime/biasedLocking.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/biasedLocking.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_biasedLocking.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/klass.inline.hpp"
+#include "oops/markOop.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/task.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
 
 static bool _biased_locking_enabled = false;
 BiasedLockingCounters BiasedLocking::_counters;
--- a/src/share/vm/runtime/biasedLocking.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/biasedLocking.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_BIASEDLOCKING_HPP
+#define SHARE_VM_RUNTIME_BIASEDLOCKING_HPP
+
+#include "runtime/handles.hpp"
+#include "utilities/growableArray.hpp"
+
 // This class describes operations to implement Store-Free Biased
 // Locking. The high-level properties of the scheme are similar to
 // IBM's lock reservation, Dice-Moir-Scherer QR locks, and other biased
@@ -185,3 +191,5 @@
   static void preserve_marks();
   static void restore_marks();
 };
+
+#endif // SHARE_VM_RUNTIME_BIASEDLOCKING_HPP
--- a/src/share/vm/runtime/compilationPolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/compilationPolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,28 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_compilationPolicy.cpp.incl"
+#include "precompiled.hpp"
+#include "code/compiledIC.hpp"
+#include "code/nmethod.hpp"
+#include "code/scopeDesc.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/rframe.hpp"
+#include "runtime/simpleThresholdPolicy.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/events.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 CompilationPolicy* CompilationPolicy::_policy;
 elapsedTimer       CompilationPolicy::_accumulated_time;
--- a/src/share/vm/runtime/compilationPolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/compilationPolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_COMPILATIONPOLICY_HPP
+#define SHARE_VM_RUNTIME_COMPILATIONPOLICY_HPP
+
+#include "code/nmethod.hpp"
+#include "compiler/compileBroker.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/growableArray.hpp"
+
 // The CompilationPolicy selects which method (if any) should be compiled.
 // It also decides which methods must always be compiled (i.e., are never
 // interpreted).
@@ -126,3 +135,5 @@
 
 };
 #endif
+
+#endif // SHARE_VM_RUNTIME_COMPILATIONPOLICY_HPP
--- a/src/share/vm/runtime/deoptimization.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/deoptimization.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,57 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_deoptimization.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "interpreter/bytecode.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
+#include "runtime/vframe_hp.hpp"
+#include "utilities/events.hpp"
+#include "utilities/xmlstream.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vmreg_zero.inline.hpp"
+#endif
+#ifdef COMPILER2
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/ad_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/ad_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/ad_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/ad_zero.hpp"
+#endif
+#endif
 
 bool DeoptimizationMarker::_is_active = false;
 
--- a/src/share/vm/runtime/deoptimization.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/deoptimization.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_DEOPTIMIZATION_HPP
+#define SHARE_VM_RUNTIME_DEOPTIMIZATION_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/frame.inline.hpp"
+
 class ProfileData;
 class vframeArray;
 class MonitorValue;
@@ -348,3 +354,5 @@
   ~DeoptimizationMarker() { _is_active = false; }
   static bool is_active() { return _is_active; }
 };
+
+#endif // SHARE_VM_RUNTIME_DEOPTIMIZATION_HPP
--- a/src/share/vm/runtime/dtraceJSDT.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/dtraceJSDT.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_dtraceJSDT.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/utf8.hpp"
 
 #ifdef HAVE_DTRACE_H
 
--- a/src/share/vm/runtime/dtraceJSDT.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/dtraceJSDT.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_DTRACEJSDT_HPP
+#define SHARE_VM_RUNTIME_DTRACEJSDT_HPP
+
+#include "code/nmethod.hpp"
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+#endif
+
 class RegisteredProbes;
 typedef jlong OpaqueProbes;
 
@@ -87,3 +101,5 @@
     _nmethods[i] = nm;
   }
 };
+
+#endif // SHARE_VM_RUNTIME_DTRACEJSDT_HPP
--- a/src/share/vm/runtime/extendedPC.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/extendedPC.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_EXTENDEDPC_HPP
+#define SHARE_VM_RUNTIME_EXTENDEDPC_HPP
+
 // An ExtendedPC contains the _pc from a signal handler in a platform
 // independent way.
 
@@ -34,3 +37,5 @@
   ExtendedPC(address pc) { _pc  = pc;   }
   ExtendedPC()           { _pc  = NULL; }
 };
+
+#endif // SHARE_VM_RUNTIME_EXTENDEDPC_HPP
--- a/src/share/vm/runtime/fieldDescriptor.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/fieldDescriptor.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-#include "incls/_fieldDescriptor.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/signature.hpp"
 
 
 oop fieldDescriptor::loader() const {
--- a/src/share/vm/runtime/fieldDescriptor.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/fieldDescriptor.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_FIELDDESCRIPTOR_HPP
+#define SHARE_VM_RUNTIME_FIELDDESCRIPTOR_HPP
+
+#include "oops/constantPoolOop.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/fieldType.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/constantTag.hpp"
+
 // A fieldDescriptor describes the attributes of a single field (instance or class variable).
 // It needs the class constant pool to work (because it only holds indices into the pool
 // rather than the actual info).
@@ -90,3 +101,5 @@
   void print_on(outputStream* st) const         PRODUCT_RETURN;
   void print_on_for(outputStream* st, oop obj)  PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_RUNTIME_FIELDDESCRIPTOR_HPP
--- a/src/share/vm/runtime/fieldType.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/fieldType.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_fieldType.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "runtime/fieldType.hpp"
+#include "runtime/signature.hpp"
 
 void FieldType::skip_optional_size(symbolOop signature, int* index) {
   jchar c = signature->byte_at(*index);
--- a/src/share/vm/runtime/fieldType.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/fieldType.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_FIELDTYPE_HPP
+#define SHARE_VM_RUNTIME_FIELDTYPE_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/symbolOop.hpp"
+
 // Note: FieldType should be based on the SignatureIterator (or vice versa).
 //       In any case, this structure should be re-thought at some point.
 
@@ -50,3 +56,5 @@
   // Parse field and extract array information. Works for T_ARRAY only.
   static BasicType get_array_info(symbolOop signature, jint* dimension, symbolOop *object_key, TRAPS);
 };
+
+#endif // SHARE_VM_RUNTIME_FIELDTYPE_HPP
--- a/src/share/vm/runtime/fprofiler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/fprofiler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,24 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_fprofiler.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "code/vtableStubs.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/task.hpp"
+#include "runtime/vframe.hpp"
+#include "utilities/macros.hpp"
 
 // Static fields of FlatProfiler
 int               FlatProfiler::received_gc_ticks   = 0;
--- a/src/share/vm/runtime/fprofiler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/fprofiler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_FPROFILER_HPP
+#define SHARE_VM_RUNTIME_FPROFILER_HPP
+
+#include "runtime/timer.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // a simple flat profiler for Java
 
 
@@ -309,3 +323,5 @@
   static IntervalData* interval_data;
 #endif // FPROF_KERNEL
 };
+
+#endif // SHARE_VM_RUNTIME_FPROFILER_HPP
--- a/src/share/vm/runtime/frame.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/frame.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,36 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_frame.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/decoder.hpp"
+
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+#endif
 
 RegisterMap::RegisterMap(JavaThread *thread, bool update_map) {
   _thread         = thread;
@@ -626,7 +654,7 @@
   // names if pc is within jvm.dll or libjvm.so, because JVM only has
   // JVM_xxxx and a few other symbols in the dynamic symbol table. Do this
   // only for native libraries.
-  if (!in_vm) {
+  if (!in_vm || Decoder::can_decode_C_frame_in_vm()) {
     found = os::dll_address_to_function_name(pc, buf, buflen, &offset);
 
     if (found) {
@@ -1045,28 +1073,20 @@
   }
 }
 
-BasicLock* frame::compiled_synchronized_native_monitor(nmethod* nm) {
-  if (nm == NULL) {
-    assert(_cb != NULL && _cb->is_nmethod() &&
-           nm->method()->is_native() &&
-           nm->method()->is_synchronized(),
-           "should not call this otherwise");
-    nm = (nmethod*) _cb;
-  }
-  int byte_offset = in_bytes(nm->compiled_synchronized_native_basic_lock_sp_offset());
+BasicLock* frame::get_native_monitor() {
+  nmethod* nm = (nmethod*)_cb;
+  assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(),
+         "Should not call this unless it's a native nmethod");
+  int byte_offset = in_bytes(nm->native_basic_lock_sp_offset());
   assert(byte_offset >= 0, "should not see invalid offset");
   return (BasicLock*) &sp()[byte_offset / wordSize];
 }
 
-oop frame::compiled_synchronized_native_monitor_owner(nmethod* nm) {
-  if (nm == NULL) {
-    assert(_cb != NULL && _cb->is_nmethod() &&
-           nm->method()->is_native() &&
-           nm->method()->is_synchronized(),
-           "should not call this otherwise");
-    nm = (nmethod*) _cb;
-  }
-  int byte_offset = in_bytes(nm->compiled_synchronized_native_basic_lock_owner_sp_offset());
+oop frame::get_native_receiver() {
+  nmethod* nm = (nmethod*)_cb;
+  assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(),
+         "Should not call this unless it's a native nmethod");
+  int byte_offset = in_bytes(nm->native_receiver_sp_offset());
   assert(byte_offset >= 0, "should not see invalid offset");
   oop owner = ((oop*) sp())[byte_offset / wordSize];
   assert( Universe::heap()->is_in(owner), "bad receiver" );
--- a/src/share/vm/runtime/frame.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/frame.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,35 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_FRAME_HPP
+#define SHARE_VM_RUNTIME_FRAME_HPP
+
+#include "asm/assembler.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/registerMap.hpp"
+#include "utilities/top.hpp"
+#ifdef COMPILER2
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/adGlobals_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/adGlobals_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/adGlobals_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/adGlobals_zero.hpp"
+#endif
+#endif
+#ifdef ZERO
+#ifdef TARGET_ARCH_zero
+# include "stack_zero.hpp"
+#endif
+#endif
+
 typedef class BytecodeInterpreter* interpreterState;
 
 class CodeBlob;
@@ -225,10 +254,10 @@
 
   // Return the monitor owner and BasicLock for compiled synchronized
   // native methods so that biased locking can revoke the receiver's
-  // bias if necessary. Takes optional nmethod for this frame as
-  // argument to avoid performing repeated lookups in code cache.
-  BasicLock* compiled_synchronized_native_monitor      (nmethod* nm = NULL);
-  oop        compiled_synchronized_native_monitor_owner(nmethod* nm = NULL);
+  // bias if necessary.  This is also used by JVMTI's GetLocalInstance method
+  // (via VM_GetReceiver) to retrieve the receiver from a native wrapper frame.
+  BasicLock* get_native_monitor();
+  oop        get_native_receiver();
 
   // Find receiver for an invoke when arguments are just pushed on stack (i.e., callee stack-frame is
   // not setup)
@@ -419,7 +448,16 @@
 
   int pd_oop_map_offset_adjustment() const;
 
-# include "incls/_frame_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "frame_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "frame_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "frame_zero.hpp"
+#endif
+
 };
 
 
@@ -451,3 +489,5 @@
   frame *current()                { return &_fr; }
   RegisterMap* register_map()     { return &_reg_map; }
 };
+
+#endif // SHARE_VM_RUNTIME_FRAME_HPP
--- a/src/share/vm/runtime/frame.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/frame.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,33 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_FRAME_INLINE_HPP
+#define SHARE_VM_RUNTIME_FRAME_INLINE_HPP
+
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/bytecodeInterpreter.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/signature.hpp"
+#ifdef TARGET_ARCH_x86
+# include "jniTypes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "jniTypes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "jniTypes_zero.hpp"
+#endif
+#ifdef ZERO
+#ifdef TARGET_ARCH_zero
+# include "entryFrame_zero.hpp"
+# include "fakeStubFrame_zero.hpp"
+# include "interpreterFrame_zero.hpp"
+# include "sharkFrame_zero.hpp"
+#endif
+#endif
+
 // This file holds platform-independent bodies of inline functions for frames.
 
 // Note: The bcx usually contains the bcp; however during GC it contains the bci
@@ -52,4 +79,15 @@
 
 // here are the platform-dependent bodies:
 
-# include "incls/_frame_pd.inline.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "frame_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "frame_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "frame_zero.inline.hpp"
+#endif
+
+
+#endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP
--- a/src/share/vm/runtime/globals.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/globals.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,26 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_globals.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/globals_extension.hpp"
+#include "utilities/ostream.hpp"
+#include "utilities/top.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1_globals.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_globals.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/c2_globals.hpp"
+#endif
+#ifdef SHARK
+#include "shark/shark_globals.hpp"
+#endif
 
 
 RUNTIME_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, \
--- a/src/share/vm/runtime/globals.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/globals.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,86 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_GLOBALS_HPP
+#define SHARE_VM_RUNTIME_GLOBALS_HPP
+
+#include "utilities/debug.hpp"
+#ifdef TARGET_ARCH_x86
+# include "globals_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "globals_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "globals_zero.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "globals_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "globals_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "globals_windows.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "globals_linux_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "globals_linux_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "globals_linux_zero.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "globals_solaris_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "globals_solaris_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "globals_windows_x86.hpp"
+#endif
+#ifdef COMPILER1
+#ifdef TARGET_ARCH_x86
+# include "c1_globals_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c1_globals_sparc.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "c1_globals_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "c1_globals_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "c1_globals_windows.hpp"
+#endif
+#endif
+#ifdef COMPILER2
+#ifdef TARGET_ARCH_x86
+# include "c2_globals_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "c2_globals_sparc.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "c2_globals_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "c2_globals_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "c2_globals_windows.hpp"
+#endif
+#endif
+#ifdef SHARK
+#ifdef TARGET_ARCH_zero
+# include "shark_globals_zero.hpp"
+#endif
+#endif
+
 #if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
 define_pd_global(bool, BackgroundCompilation,        false);
 define_pd_global(bool, UseTLAB,                      false);
@@ -1203,9 +1283,6 @@
   develop(bool, TraceStartupTime, false,                                    \
           "Trace setup time")                                               \
                                                                             \
-  develop(bool, TraceHPI, false,                                            \
-          "Trace Host Porting Interface (HPI)")                             \
-                                                                            \
   product(ccstr, HPILibPath, NULL,                                          \
           "Specify alternate path to HPI library")                          \
                                                                             \
@@ -1326,6 +1403,10 @@
           "The exit of a JNI CS necessitating a scavenge also"              \
           " kicks off a bkgrd concurrent collection")                       \
                                                                             \
+  product(uintx, GCLockerEdenExpansionPercent, 5,                           \
+          "How much the GC can expand the eden by while the GC locker  "    \
+          "is active (as a percentage)")                                    \
+                                                                            \
   develop(bool, UseCMSAdaptiveFreeLists, true,                              \
           "Use Adaptive Free Lists in the CMS generation")                  \
                                                                             \
@@ -3679,3 +3760,5 @@
 RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG, DECLARE_LP64_PRODUCT_FLAG)
 
 RUNTIME_OS_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)
+
+#endif // SHARE_VM_RUNTIME_GLOBALS_HPP
--- a/src/share/vm/runtime/globals_extension.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/globals_extension.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
+#define SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
+
+#include "runtime/globals.hpp"
+#include "utilities/top.hpp"
+
 // Construct enum of Flag_<cmdline-arg> constants.
 
 // Parens left off in the following for the enum decl below.
@@ -213,3 +219,5 @@
   static bool is_ergo(CommandLineFlag flag);
   static bool is_cmdline(CommandLineFlag flag);
 };
+
+#endif // SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
--- a/src/share/vm/runtime/handles.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/handles.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_handles.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 #ifdef ASSERT
 oop* HandleArea::allocate_handle(oop obj) {
--- a/src/share/vm/runtime/handles.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/handles.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_HANDLES_HPP
+#define SHARE_VM_RUNTIME_HANDLES_HPP
+
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "utilities/top.hpp"
+
 //------------------------------------------------------------------------------------------------------------------------
 // In order to preserve oops during garbage collection, they should be
 // allocated and passed around via Handles within the VM. A handle is
@@ -354,3 +361,5 @@
   ~ResetNoHandleMark() {}
 #endif
 };
+
+#endif // SHARE_VM_RUNTIME_HANDLES_HPP
--- a/src/share/vm/runtime/handles.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/handles.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_HANDLES_INLINE_HPP
+#define SHARE_VM_RUNTIME_HANDLES_INLINE_HPP
+
+#include "runtime/handles.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // these inline functions are in a separate file to break an include cycle
 // between Thread and Handle
 
@@ -71,3 +85,5 @@
   NOT_PRODUCT(area->set_size_in_bytes(_size_in_bytes);)
   debug_only(area->_handle_mark_nesting--);
 }
+
+#endif // SHARE_VM_RUNTIME_HANDLES_INLINE_HPP
--- a/src/share/vm/runtime/hpi.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-# include "incls/_precompiled.incl"
-# include "incls/_hpi.cpp.incl"
-
-extern "C" {
-  static void unimplemented_panic(const char *fmt, ...) {
-    // mitigate testing damage from bug 6626677
-    warning("hpi::unimplemented_panic called");
-  }
-
-  static void unimplemented_monitorRegister(sys_mon_t *mid, char *info_str) {
-    Unimplemented();
-  }
-}
-
-static vm_calls_t callbacks = {
-  jio_fprintf,
-  unimplemented_panic,
-  unimplemented_monitorRegister,
-
-  NULL, // unused
-  NULL, // unused
-  NULL  // unused
-};
-
-GetInterfaceFunc        hpi::_get_interface = NULL;
-HPI_FileInterface*      hpi::_file          = NULL;
-HPI_SocketInterface*    hpi::_socket        = NULL;
-HPI_LibraryInterface*   hpi::_library       = NULL;
-HPI_SystemInterface*    hpi::_system        = NULL;
-
-jint hpi::initialize()
-{
-  initialize_get_interface(&callbacks);
-  if (_get_interface == NULL)
-    return JNI_ERR;
-
-  jint result;
-
-  result = (*_get_interface)((void **)&_file, "File", 1);
-  if (result != 0) {
-    if (TraceHPI) tty->print_cr("Can't find HPI_FileInterface");
-    return JNI_ERR;
-  }
-
-
-  result = (*_get_interface)((void **)&_library, "Library", 1);
-  if (result != 0) {
-    if (TraceHPI) tty->print_cr("Can't find HPI_LibraryInterface");
-    return JNI_ERR;
-  }
-
-  result = (*_get_interface)((void **)&_system, "System", 1);
-  if (result != 0) {
-    if (TraceHPI) tty->print_cr("Can't find HPI_SystemInterface");
-    return JNI_ERR;
-  }
-
-  return JNI_OK;
-}
-
-jint hpi::initialize_socket_library()
-{
-  if (_get_interface == NULL) {
-    if (TraceHPI) {
-      tty->print_cr("Fatal HPI error: reached initialize_socket_library with NULL _get_interface");
-    }
-    return JNI_ERR;
-  }
-
-  jint result;
-  result = (*_get_interface)((void **)&_socket, "Socket", 1);
-  if (result != 0) {
-    if (TraceHPI) tty->print_cr("Can't find HPI_SocketInterface");
-    return JNI_ERR;
-  }
-
-  return JNI_OK;
-}
--- a/src/share/vm/runtime/hpi.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-//
-// C++ wrapper to HPI.
-//
-
-class hpi : AllStatic {
-
-private:
-  static GetInterfaceFunc       _get_interface;
-  static HPI_FileInterface*     _file;
-  static HPI_SocketInterface*   _socket;
-  static HPI_LibraryInterface*  _library;
-  static HPI_SystemInterface*   _system;
-
-private:
-  static void initialize_get_interface(vm_calls_t *callbacks);
-
-public:
-  // Load and initialize everything except sockets.
-  static jint initialize();
-
-  // Socket library needs to be lazy intialized because eagerly
-  // loading Winsock is known to cause "connect to your ISP"
-  // dialog to show up.  Or so goes the legend.
-  static jint initialize_socket_library();
-
-  // HPI_FileInterface
-  static inline char*  native_path(char *path);
-  static inline int    file_type(const char *path);
-  static inline int    open(const char *name, int mode, int perm);
-  static inline int    close(int fd);
-  static inline jlong  lseek(int fd, jlong off, int whence);
-  static inline int    ftruncate(int fd, jlong length);
-  static inline int    fsync(int fd);
-  static inline int    available(int fd, jlong *bytes);
-  static inline size_t read(int fd, void *buf, unsigned int nBytes);
-  static inline size_t write(int fd, const void *buf, unsigned int nBytes);
-  static inline int    fsize(int fd, jlong *size);
-
-  // HPI_SocketInterface
-  static inline int    socket(int domain, int type, int protocol);
-  static inline int    socket_close(int fd);
-  static inline int    socket_shutdown(int fd, int howto);
-  static inline int    recv(int fd, char *buf, int nBytes, int flags);
-  static inline int    send(int fd, char *buf, int nBytes, int flags);
-  // Variant of send that doesn't support interruptible I/O
-  static inline int    raw_send(int fd, char *buf, int nBytes, int flags);
-  static inline int    timeout(int fd, long timeout);
-  static inline int    listen(int fd, int count);
-  static inline int    connect(int fd, struct sockaddr *him, int len);
-  static inline int    bind(int fd, struct sockaddr *him, int len);
-  static inline int    accept(int fd, struct sockaddr *him, int *len);
-  static inline int    recvfrom(int fd, char *buf, int nbytes, int flags,
-                                struct sockaddr *from, int *fromlen);
-  static inline int    get_sock_name(int fd, struct sockaddr *him, int *len);
-  static inline int    sendto(int fd, char *buf, int len, int flags,
-                              struct sockaddr *to, int tolen);
-  static inline int    socket_available(int fd, jint *pbytes);
-
-  static inline int    get_sock_opt(int fd, int level, int optname,
-                              char *optval, int* optlen);
-  static inline int    set_sock_opt(int fd, int level, int optname,
-                              const char *optval, int optlen);
-  static inline int    get_host_name(char* name, int namelen);
-  static inline struct hostent*  get_host_by_addr(const char* name, int len, int type);
-  static inline struct hostent*  get_host_by_name(char* name);
-  static inline struct protoent* get_proto_by_name(char* name);
-
-  // HPI_LibraryInterface
-  static inline void   dll_build_name(char *buf, int buf_len, const char* path,
-                                      const char *name);
-  static inline void*  dll_load(const char *name, char *ebuf, int ebuflen);
-  static inline void   dll_unload(void *lib);
-  static inline void*  dll_lookup(void *lib, const char *name);
-
-  // HPI_SystemInterface
-  static inline int    lasterror(char *buf, int len);
-};
-
-//
-// Macros that provide inline bodies for the functions.
-//
-
-#define HPIDECL(name, names, intf, func, ret_type, ret_fmt, arg_type, arg_print, arg)   \
-  inline ret_type hpi::name arg_type {        \
-    if (TraceHPI) {                           \
-      tty->print("hpi::" names "(");          \
-      tty->print arg_print ;                  \
-      tty->print(") = ");                     \
-    }                                         \
-    ret_type result = (*intf->func) arg ;     \
-    if (TraceHPI) {                           \
-      tty->print_cr(ret_fmt, result);         \
-    }                                         \
-    return result;                            \
-  }
-
-// Macro to facilitate moving HPI functionality into the vm.
-// See bug 6348631.  The only difference between this macro and
-// HPIDECL is that we call a vm method rather than use the HPI
-// transfer vector.  Ultimately, we'll replace HPIDECL with
-// VM_HPIDECL for all hpi methods.
-#define VM_HPIDECL(name, names, func, ret_type, ret_fmt, arg_type,arg_print, arg)   \
-  inline ret_type hpi::name arg_type {        \
-    if (TraceHPI) {                           \
-      tty->print("hpi::" names "(");          \
-      tty->print arg_print ;                  \
-      tty->print(") = ");                     \
-    }                                         \
-    ret_type result = func arg ;              \
-    if (TraceHPI) {                           \
-      tty->print_cr(ret_fmt, result);         \
-    }                                         \
-    return result;                            \
-  }
-
-#define VM_HPIDECL_VOID(name, names, func, arg_type, arg_print, arg)   \
-  inline void  hpi::name arg_type {           \
-    if (TraceHPI) {                           \
-      tty->print("hpi::" names "(");          \
-      tty->print arg_print;                   \
-      tty->print(") = ");                     \
-    }                                         \
-    func arg;                                 \
-  }
-
-#define HPIDECL_VOID(name, names, intf, func, arg_type, arg_print, arg) \
-  inline void hpi::name arg_type {            \
-    if (TraceHPI) {                           \
-      tty->print("hpi::" names "(");          \
-      tty->print arg_print ;                  \
-      tty->print_cr(") = void");              \
-    }                                         \
-    (*intf->func) arg ;                       \
-  }
-
-
-// The macro calls below realize into
-//          inline char * hpi::native_path(...) {  inlined_body; }
-// etc.
-
-// HPI_FileInterface
-
-HPIDECL(native_path, "native_path", _file, NativePath, char *, "%s",
-        (char *path),
-        ("path = %s", path),
-        (path));
-
-HPIDECL(file_type, "file_type", _file, FileType, int, "%d",
-        (const char *path),
-        ("path = %s", path),
-        (path));
-
-HPIDECL(open, "open", _file, Open, int, "%d",
-        (const char *name, int mode, int perm),
-        ("name = %s, mode = %d, perm = %d", name, mode, perm),
-        (name, mode, perm));
-
-HPIDECL(lseek, "seek", _file, Seek, jlong, "(a jlong)",
-        (int fd, jlong off, int whence),
-        ("fd = %d, off = (a jlong), whence = %d", fd, /* off, */ whence),
-        (fd, off, whence));
-
-HPIDECL(ftruncate, "ftruncate", _file, SetLength, int, "%d",
-        (int fd, jlong length),
-        ("fd = %d, length = (a jlong)", fd /*, length */),
-        (fd, length));
-
-HPIDECL(fsync, "fsync", _file, Sync, int, "%d",
-        (int fd),
-        ("fd = %d", fd),
-        (fd));
-
-HPIDECL(available, "available", _file, Available, int, "%d",
-        (int fd, jlong *bytes),
-        ("fd = %d, bytes = %p", fd, bytes),
-        (fd, bytes));
-
-HPIDECL(fsize, "fsize", _file, FileSizeFD, int, "%d",
-        (int fd, jlong *size),
-        ("fd = %d, size = %p", fd, size),
-        (fd, size));
-
-// HPI_LibraryInterface
-VM_HPIDECL_VOID(dll_build_name, "dll_build_name", os::dll_build_name,
-               (char *buf, int buf_len, const char *path, const char *name),
-               ("buf = %p, buflen = %d, path = %s, name = %s",
-                buf, buf_len, path, name),
-               (buf, buf_len, path, name));
-
-VM_HPIDECL(dll_load, "dll_load", os::dll_load,
-        void *, "(void *)%p",
-        (const char *name, char *ebuf, int ebuflen),
-        ("name = %s, ebuf = %p, ebuflen = %d", name, ebuf, ebuflen),
-        (name, ebuf, ebuflen));
-
-HPIDECL_VOID(dll_unload, "dll_unload", _library, UnloadLibrary,
-             (void *lib),
-             ("lib = %p", lib),
-             (lib));
-
-HPIDECL(dll_lookup, "dll_lookup", _library, FindLibraryEntry, void *, "%p",
-        (void *lib, const char *name),
-        ("lib = %p, name = %s", lib, name),
-        (lib, name));
-
-// HPI_SystemInterface
-HPIDECL(lasterror, "lasterror", _system, GetLastErrorString, int, "%d",
-        (char *buf, int len),
-        ("buf = %p, len = %d", buf, len),
-        (buf, len));
--- a/src/share/vm/runtime/icache.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/icache.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_icache.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/icache.hpp"
 
 // The flush stub function address
 AbstractICache::flush_icache_stub_t AbstractICache::_flush_icache_stub = NULL;
--- a/src/share/vm/runtime/icache.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/icache.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_ICACHE_HPP
+#define SHARE_VM_RUNTIME_ICACHE_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+
 // Interface for updating the instruction cache.  Whenever the VM modifies
 // code, part of the processor instruction cache potentially has to be flushed.
 
@@ -62,7 +68,16 @@
 // Must be included before the definition of ICacheStubGenerator
 // because ICacheStubGenerator uses ICache definitions.
 
-#include "incls/_icache_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "icache_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "icache_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "icache_zero.hpp"
+#endif
+
 
 
 class ICacheStubGenerator : public StubCodeGenerator {
@@ -113,3 +128,5 @@
 
   void generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub);
 };
+
+#endif // SHARE_VM_RUNTIME_ICACHE_HPP
--- a/src/share/vm/runtime/init.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/init.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_init.cpp.incl"
+#include "precompiled.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/universe.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/init.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 // Initialization done by VM thread in vm_init_globals()
 void check_ThreadShadow();
@@ -160,5 +169,6 @@
 
 
 void set_init_completed() {
+  assert(Universe::is_fully_initialized(), "Should have completed initialization");
   _init_completed = true;
 }
--- a/src/share/vm/runtime/init.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/init.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_INIT_HPP
+#define SHARE_VM_RUNTIME_INIT_HPP
+
+#include "utilities/top.hpp"
+
 // init_globals replaces C++ global objects so we can use the standard linker
 // to link Delta (which is at least twice as fast as using the GNU C++ linker).
 // Also, init.c gives explicit control over the sequence of initialization.
@@ -36,3 +41,5 @@
 
 bool is_init_completed();     // returns true when bootstrapping has completed
 void set_init_completed();    // set basic init to completed
+
+#endif // SHARE_VM_RUNTIME_INIT_HPP
--- a/src/share/vm/runtime/interfaceSupport.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/interfaceSupport.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_interfaceSupport.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "runtime/vframe.hpp"
+#include "utilities/preserveException.hpp"
 
 
 // Implementation of InterfaceSupport
--- a/src/share/vm/runtime/interfaceSupport.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/interfaceSupport.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,29 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
+#define SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
+
+#include "memory/gcLocker.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/orderAccess.hpp"
+#include "runtime/os.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/preserveException.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // Wrapper for all entry points to the virtual machine.
 // The HandleMarkCleaner is a faster version of HandleMark.
 // It relies on the fact that there is a HandleMark further
@@ -82,7 +105,16 @@
 
  public:
   // OS dependent stuff
-  #include "incls/_interfaceSupport_pd.hpp.incl"
+#ifdef TARGET_OS_FAMILY_linux
+# include "interfaceSupport_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "interfaceSupport_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "interfaceSupport_windows.hpp"
+#endif
+
 };
 
 
@@ -566,3 +598,5 @@
 
 
 #define JVM_END } }
+
+#endif // SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
--- a/src/share/vm/runtime/java.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/java.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,79 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_java.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/generateOopMap.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceKlassKlass.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/aprofiler.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/memprofiler.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/task.hpp"
+#include "runtime/timer.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/histogram.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vm_version_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vm_version_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vm_version_zero.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.hpp"
+#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Compiler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "code/compiledIC.hpp"
+#include "compiler/methodLiveness.hpp"
+#include "opto/compile.hpp"
+#include "opto/indexSet.hpp"
+#include "opto/runtime.hpp"
+#endif
 
 HS_DTRACE_PROBE_DECL(hotspot, vm__shutdown);
 
--- a/src/share/vm/runtime/java.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/java.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_JAVA_HPP
+#define SHARE_VM_RUNTIME_JAVA_HPP
+
+#include "runtime/os.hpp"
+
 // Register function to be called by before_exit
 extern "C" { void register_on_exit_function(void (*func)(void)) ;}
 
@@ -208,3 +213,5 @@
     return current().compare_major(7) >= 0;
   }
 };
+
+#endif // SHARE_VM_RUNTIME_JAVA_HPP
--- a/src/share/vm/runtime/javaCalls.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/javaCalls.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,32 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_javaCalls.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/nmethod.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jniCheck.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 // -----------------------------------------------------
 // Implementation of JavaCallWrapper
--- a/src/share/vm/runtime/javaCalls.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/javaCalls.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,33 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_JAVACALLS_HPP
+#define SHARE_VM_RUNTIME_JAVACALLS_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/javaFrameAnchor.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "jniTypes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "jniTypes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "jniTypes_zero.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call.
 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last
 // Java fp/sp. A pointer to the JavaCallWrapper is stored on the stack.
@@ -195,3 +222,5 @@
   // Low-level interface
   static void call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS);
 };
+
+#endif // SHARE_VM_RUNTIME_JAVACALLS_HPP
--- a/src/share/vm/runtime/javaFrameAnchor.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/javaFrameAnchor.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,29 @@
  * questions.
  *
  */
+
+#ifndef SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
+#define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "orderAccess_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "orderAccess_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "orderAccess_linux_zero.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "orderAccess_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "orderAccess_solaris_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "orderAccess_windows_x86.inline.hpp"
+#endif
 //
 // An object for encapsulating the machine/os dependent part of a JavaThread frame state
 //
@@ -70,7 +93,16 @@
   // and no one should look at the other fields.
   void zap(void)                                     { _last_Java_sp = NULL; }
 
-#include "incls/_javaFrameAnchor_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "javaFrameAnchor_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "javaFrameAnchor_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "javaFrameAnchor_zero.hpp"
+#endif
+
 
 public:
   JavaFrameAnchor()                              { clear(); }
@@ -84,3 +116,5 @@
   static ByteSize last_Java_pc_offset()          { return byte_offset_of(JavaFrameAnchor, _last_Java_pc); }
 
 };
+
+#endif // SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
--- a/src/share/vm/runtime/jfieldIDWorkaround.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/jfieldIDWorkaround.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_JFIELDIDWORKAROUND_HPP
+#define SHARE_VM_RUNTIME_JFIELDIDWORKAROUND_HPP
+
 class jfieldIDWorkaround: AllStatic {
   // This workaround is because JVMTI doesn't have distinct entry points
   // for methods that use static jfieldIDs and instance jfieldIDs.
@@ -157,3 +160,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_RUNTIME_JFIELDIDWORKAROUND_HPP
--- a/src/share/vm/runtime/jniHandles.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/jniHandles.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jniHandles.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/mutexLocker.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 JNIHandleBlock* JNIHandles::_global_handles       = NULL;
--- a/src/share/vm/runtime/jniHandles.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/jniHandles.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_JNIHANDLES_HPP
+#define SHARE_VM_RUNTIME_JNIHANDLES_HPP
+
+#include "runtime/handles.hpp"
+#include "utilities/top.hpp"
+
 class JNIHandleBlock;
 
 
@@ -220,3 +226,5 @@
     *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it
   }
 }
+
+#endif // SHARE_VM_RUNTIME_JNIHANDLES_HPP
--- a/src/share/vm/runtime/jniPeriodicChecker.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/jniPeriodicChecker.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_jniPeriodicChecker.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/jniPeriodicChecker.hpp"
+#include "runtime/task.hpp"
 
 
 // --------------------------------------------------------
--- a/src/share/vm/runtime/jniPeriodicChecker.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/jniPeriodicChecker.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_JNIPERIODICCHECKER_HPP
+#define SHARE_VM_RUNTIME_JNIPERIODICCHECKER_HPP
+
 class JniPeriodicCheckerTask;
 
 /*
@@ -50,3 +53,5 @@
 };
 
 void jniPeriodicChecker_exit();
+
+#endif // SHARE_VM_RUNTIME_JNIPERIODICCHECKER_HPP
--- a/src/share/vm/runtime/memprofiler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/memprofiler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,30 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_memprofiler.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/generation.hpp"
+#include "memory/permGen.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/memprofiler.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/task.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 #ifndef PRODUCT
 
--- a/src/share/vm/runtime/memprofiler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/memprofiler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_MEMPROFILER_HPP
+#define SHARE_VM_RUNTIME_MEMPROFILER_HPP
+
 // Prints periodic memory usage trace of HotSpot VM
 
 class MemProfilerTask;
@@ -40,3 +43,5 @@
   // Tester
   static bool is_active()     PRODUCT_RETURN0;
 };
+
+#endif // SHARE_VM_RUNTIME_MEMPROFILER_HPP
--- a/src/share/vm/runtime/monitorChunk.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/monitorChunk.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_monitorChunk.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/monitorChunk.hpp"
 
 MonitorChunk::MonitorChunk(int number_on_monitors) {
   _number_of_monitors = number_on_monitors;
--- a/src/share/vm/runtime/monitorChunk.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/monitorChunk.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_MONITORCHUNK_HPP
+#define SHARE_VM_RUNTIME_MONITORCHUNK_HPP
+
+#include "runtime/synchronizer.hpp"
+
 // Data structure for holding monitors for one activation during
 // deoptimization.
 
@@ -56,3 +61,5 @@
   // Tells whether the addr point into the monitors.
   bool contains(void* addr) const           { return (addr >= (void*) monitors()) && (addr <  (void*) (monitors() + number_of_monitors())); }
 };
+
+#endif // SHARE_VM_RUNTIME_MONITORCHUNK_HPP
--- a/src/share/vm/runtime/mutex.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/mutex.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,22 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_mutex.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/osThread.hpp"
+#include "utilities/events.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "mutex_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "mutex_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "mutex_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 // o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
 //
--- a/src/share/vm/runtime/mutex.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/mutex.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_MUTEX_HPP
+#define SHARE_VM_RUNTIME_MUTEX_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/os.hpp"
+#include "utilities/histogram.hpp"
+
 // The SplitWord construct allows us to colocate the contention queue
 // (cxq) with the lock-byte.  The queue elements are ParkEvents, which are
 // always aligned on 256-byte addresses - the least significant byte of
@@ -265,3 +272,5 @@
    }
 };
 
+
+#endif // SHARE_VM_RUNTIME_MUTEX_HPP
--- a/src/share/vm/runtime/mutexLocker.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/mutexLocker.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_mutexLocker.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 // Mutexes used in the VM (see comment in mutexLocker.hpp):
 //
--- a/src/share/vm/runtime/mutexLocker.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/mutexLocker.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_MUTEXLOCKER_HPP
+#define SHARE_VM_RUNTIME_MUTEXLOCKER_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/mutex.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+
 // Mutexes used in the VM.
 
 extern Mutex*   Patching_lock;                   // a lock used to guard code patching of compiled code
@@ -343,3 +358,5 @@
 };
 
 #endif
+
+#endif // SHARE_VM_RUNTIME_MUTEXLOCKER_HPP
--- a/src/share/vm/runtime/objectMonitor.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/objectMonitor.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,34 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_objectMonitor.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/objectMonitor.inline.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/thread.hpp"
+#include "services/threadService.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/preserveException.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 #if defined(__GNUC__) && !defined(IA64)
   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
--- a/src/share/vm/runtime/objectMonitor.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/objectMonitor.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
+#define SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
+
+#include "runtime/os.hpp"
+#include "runtime/park.hpp"
+#include "runtime/perfData.hpp"
+
 
 // ObjectWaiter serves as a "proxy" or surrogate thread.
 // TODO-FIXME: Eliminate ObjectWaiter and use the thread-specific
@@ -306,3 +313,5 @@
 #undef  TEVENT
 #define TEVENT(nom) {;}
 
+
+#endif // SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
--- a/src/share/vm/runtime/objectMonitor.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/objectMonitor.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_INLINE_HPP
+#define SHARE_VM_RUNTIME_OBJECTMONITOR_INLINE_HPP
+
 inline intptr_t ObjectMonitor::is_entered(TRAPS) const {
   if (THREAD == _owner || THREAD->is_lock_owned((address) _owner)) {
     return 1;
@@ -104,3 +107,5 @@
   _count = 0;
 }
 
+
+#endif // SHARE_VM_RUNTIME_OBJECTMONITOR_INLINE_HPP
--- a/src/share/vm/runtime/orderAccess.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/orderAccess.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_orderAccess.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/orderAccess.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/thread.hpp"
 
 void OrderAccess::StubRoutines_fence() {
   // Use a stub if it exists.  It may not exist during bootstrap so do
--- a/src/share/vm/runtime/orderAccess.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/orderAccess.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_ORDERACCESS_HPP
+#define SHARE_VM_RUNTIME_ORDERACCESS_HPP
+
+#include "memory/allocation.hpp"
+
 //                Memory Access Ordering Model
 //
 // This interface is based on the JSR-133 Cookbook for Compiler Writers
@@ -309,3 +314,5 @@
   // don't another way to do the inline eassembly.
   static void StubRoutines_fence();
 };
+
+#endif // SHARE_VM_RUNTIME_ORDERACCESS_HPP
--- a/src/share/vm/runtime/os.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/os.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,44 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_os.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "prims/privilegedStack.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "services/attachListener.hpp"
+#include "services/threadService.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 # include <signal.h>
 
--- a/src/share/vm/runtime/os.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/os.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,24 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_OS_HPP
+#define SHARE_VM_RUNTIME_OS_HPP
+
+#include "jvmtifiles/jvmti.h"
+#include "runtime/atomic.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/handles.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "jvm_linux.h"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "jvm_solaris.h"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "jvm_windows.h"
+#endif
+
 // os defines the interface to operating system; this includes traditional
 // OS services (time, I/O) as well as other functionality with system-
 // dependent code.
@@ -342,9 +360,6 @@
   // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
   static intx current_thread_id();
   static int current_process_id();
-  // hpi::read for calls from non native state
-  // For performance, hpi::read is only callable from _thread_in_native
-  static size_t read(int fd, void *buf, unsigned int nBytes);
   static int sleep(Thread* thread, jlong ms, bool interruptable);
   static int naked_sleep();
   static void infinite_sleep(); // never returns, use with CAUTION
@@ -400,6 +415,22 @@
   // Die immediately, no exit hook, no abort hook, no cleanup.
   static void die();
 
+  // File i/o operations
+  static const int default_file_open_flags();
+  static int open(const char *path, int oflag, int mode);
+  static int close(int fd);
+  static jlong lseek(int fd, jlong offset, int whence);
+  static char* native_path(char *path);
+  static int ftruncate(int fd, jlong length);
+  static int fsync(int fd);
+  static int available(int fd, jlong *bytes);
+
+  //File i/o operations
+
+  static size_t read(int fd, void *buf, unsigned int nBytes);
+  static size_t restartable_read(int fd, void *buf, unsigned int nBytes);
+  static size_t write(int fd, const void *buf, unsigned int nBytes);
+
   // Reading directories.
   static DIR*           opendir(const char* dirname);
   static int            readdir_buf_size(const char *path);
@@ -442,6 +473,9 @@
   // lookup symbol in a shared library
   static void* dll_lookup(void* handle, const char* name);
 
+  // Unload library
+  static void  dll_unload(void *lib);
+
   // Print out system information; they are called by fatal error handler.
   // Output format may be different on different platforms.
   static void print_os_info(outputStream* st);
@@ -456,6 +490,7 @@
   static void print_date_and_time(outputStream* st);
 
   static void print_location(outputStream* st, intptr_t x, bool verbose = false);
+  static size_t lasterror(char *buf, size_t len);
 
   // The following two functions are used by fatal error handler to trace
   // native (C) frames. They are not part of frame.hpp/frame.cpp because
@@ -483,7 +518,7 @@
   // Returns native Java library, loads if necessary
   static void*    native_java_library();
 
-  // Fills in path to jvm.dll/libjvm.so (this info used to find hpi).
+  // Fills in path to jvm.dll/libjvm.so (used by the Disassembler)
   static void     jvm_path(char *buf, jint buflen);
 
   // Returns true if we are running in a headless jre.
@@ -529,6 +564,33 @@
   static int  num_frees;              // # of calls to free
 #endif
 
+  // SocketInterface (ex HPI SocketInterface )
+  static int socket(int domain, int type, int protocol);
+  static int socket_close(int fd);
+  static int socket_shutdown(int fd, int howto);
+  static int recv(int fd, char *buf, int nBytes, int flags);
+  static int send(int fd, char *buf, int nBytes, int flags);
+  static int raw_send(int fd, char *buf, int nBytes, int flags);
+  static int timeout(int fd, long timeout);
+  static int listen(int fd, int count);
+  static int connect(int fd, struct sockaddr *him, int len);
+  static int bind(int fd, struct sockaddr *him, int len);
+  static int accept(int fd, struct sockaddr *him, int *len);
+  static int recvfrom(int fd, char *buf, int nbytes, int flags,
+                             struct sockaddr *from, int *fromlen);
+  static int get_sock_name(int fd, struct sockaddr *him, int *len);
+  static int sendto(int fd, char *buf, int len, int flags,
+                           struct sockaddr *to, int tolen);
+  static int socket_available(int fd, jint *pbytes);
+
+  static int get_sock_opt(int fd, int level, int optname,
+                           char *optval, int* optlen);
+  static int set_sock_opt(int fd, int level, int optname,
+                           const char *optval, int optlen);
+  static int get_host_name(char* name, int namelen);
+
+  static struct hostent*  get_host_by_name(char* name);
+
   // Printing 64 bit integers
   static const char* jlong_format_specifier();
   static const char* julong_format_specifier();
@@ -587,7 +649,34 @@
   static bool obsolete_option(const JavaVMOption *option);
 
   // Platform dependent stuff
-  #include "incls/_os_pd.hpp.incl"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "os_linux_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "os_linux_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "os_linux_zero.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "os_solaris_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "os_solaris_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "os_windows_x86.hpp"
+#endif
+
 
   // debugging support (mostly used by debug.cpp but also fatal error handler)
   static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address
@@ -630,3 +719,5 @@
 extern "C" int SpinPause () ;
 extern "C" int SafeFetch32 (int * adr, int errValue) ;
 extern "C" intptr_t SafeFetchN (intptr_t * adr, intptr_t errValue) ;
+
+#endif // SHARE_VM_RUNTIME_OS_HPP
--- a/src/share/vm/runtime/osThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/osThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_osThread.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/osThread.hpp"
 
 
 OSThread::OSThread(OSThreadStartFunc start_proc, void* start_parm) {
--- a/src/share/vm/runtime/osThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/osThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_OSTHREAD_HPP
+#define SHARE_VM_RUNTIME_OSTHREAD_HPP
+
+#include "runtime/frame.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/javaFrameAnchor.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "utilities/top.hpp"
+
 // The OSThread class holds OS-specific thread information.  It is equivalent
 // to the sys_thread_t structure of the classic JVM implementation.
 
@@ -91,7 +100,16 @@
   static ByteSize interrupted_offset()            { return byte_offset_of(OSThread, _interrupted); }
 
   // Platform dependent stuff
-  #include "incls/_osThread_pd.hpp.incl"
+#ifdef TARGET_OS_FAMILY_linux
+# include "osThread_linux.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "osThread_solaris.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "osThread_windows.hpp"
+#endif
+
 };
 
 
@@ -129,3 +147,5 @@
     _osthread->set_state(_old_state);
   }
 };
+
+#endif // SHARE_VM_RUNTIME_OSTHREAD_HPP
--- a/src/share/vm/runtime/park.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/park.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,9 +22,9 @@
  *
  */
 
+#include "precompiled.hpp"
+#include "runtime/thread.hpp"
 
-# include "incls/_precompiled.incl"
-# include "incls/_park.cpp.incl"
 
 
 // Lifecycle management for TSM ParkEvents.
--- a/src/share/vm/runtime/park.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/park.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -21,6 +21,12 @@
  * questions.
  *
  */
+
+#ifndef SHARE_VM_RUNTIME_PARK_HPP
+#define SHARE_VM_RUNTIME_PARK_HPP
+
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
 /*
  * Per-thread blocking support for JSR166. See the Java-level
  * Documentation for rationale. Basically, park acts like wait, unpark
@@ -167,3 +173,5 @@
     static ParkEvent * Allocate (Thread * t) ;
     static void Release (ParkEvent * e) ;
 } ;
+
+#endif // SHARE_VM_RUNTIME_PARK_HPP
--- a/src/share/vm/runtime/perfData.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/perfData.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_perfData.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/java.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/perfData.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 PerfDataList*   PerfDataManager::_all = NULL;
 PerfDataList*   PerfDataManager::_sampled = NULL;
--- a/src/share/vm/runtime/perfData.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/perfData.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_PERFDATA_HPP
+#define SHARE_VM_RUNTIME_PERFDATA_HPP
+
+#include "memory/allocation.inline.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/growableArray.hpp"
+
 /* jvmstat global and subsystem counter name space - enumeration value
  * serve as an index into the PerfDataManager::_name_space[] array
  * containing the corresponding name space string. Only the top level
@@ -957,3 +965,5 @@
       _eventp->inc();
     }
 };
+
+#endif // SHARE_VM_RUNTIME_PERFDATA_HPP
--- a/src/share/vm/runtime/perfMemory.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/perfMemory.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_perfMemory.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/java.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/perfData.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/statSampler.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 // Prefix of performance data file.
 const char               PERFDATA_NAME[] = "hsperfdata";
--- a/src/share/vm/runtime/perfMemory.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/perfMemory.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_PERFMEMORY_HPP
+#define SHARE_VM_RUNTIME_PERFMEMORY_HPP
+
+#include "utilities/exceptions.hpp"
+
 /*
  * PerfData Version Constants
  *   - Major Version - change whenever the structure of PerfDataEntry changes
@@ -160,3 +165,5 @@
 
 void perfMemory_init();
 void perfMemory_exit();
+
+#endif // SHARE_VM_RUNTIME_PERFMEMORY_HPP
--- a/src/share/vm/runtime/prefetch.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/prefetch.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_PREFETCH_HPP
+#define SHARE_VM_RUNTIME_PREFETCH_HPP
+
+#include "memory/allocation.hpp"
+
 // If calls to prefetch methods are in a loop, the loop should be cloned
 // such that if Prefetch{Scan,Copy}Interval and/or PrefetchFieldInterval
 // say not to do prefetching, these methods aren't called.  At the very
@@ -42,3 +47,5 @@
   // Prefetch anticipating write; must not fault, semantically a no-op
   static void write(void* loc, intx interval);
 };
+
+#endif // SHARE_VM_RUNTIME_PREFETCH_HPP
--- a/src/share/vm/runtime/reflection.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/reflection.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,28 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_reflection.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/verifier.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "prims/jvm.h"
+#include "prims/methodHandleWalk.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/reflection.hpp"
+#include "runtime/reflectionUtils.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframe.hpp"
 
 #define JAVA_1_5_VERSION                  49
 
--- a/src/share/vm/runtime/reflection.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/reflection.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_REFLECTION_HPP
+#define SHARE_VM_RUNTIME_REFLECTION_HPP
+
+#include "oops/oop.hpp"
+#include "runtime/fieldDescriptor.hpp"
+#include "runtime/reflectionCompat.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/growableArray.hpp"
+
 // Class Reflection contains utility methods needed for implementing the
 // reflection api.
 //
@@ -166,3 +175,5 @@
 #endif /* SUPPORT_OLD_REFLECTION */
 
 };
+
+#endif // SHARE_VM_RUNTIME_REFLECTION_HPP
--- a/src/share/vm/runtime/reflectionCompat.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/reflectionCompat.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_REFLECTIONCOMPAT_HPP
+#define SHARE_VM_RUNTIME_REFLECTIONCOMPAT_HPP
+
 // During the development of the JDK 1.4 reflection implementation
 // based on dynamic bytecode generation, it was hoped that the bulk of
 // the native code for reflection could be removed. Unfortunately
@@ -40,3 +43,5 @@
 //#ifndef PRODUCT
 # define SUPPORT_OLD_REFLECTION
 //#endif
+
+#endif // SHARE_VM_RUNTIME_REFLECTIONCOMPAT_HPP
--- a/src/share/vm/runtime/reflectionUtils.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/reflectionUtils.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_reflectionUtils.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "memory/universe.inline.hpp"
+#include "runtime/reflectionUtils.hpp"
 
 KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) {
   _klass = klass;
--- a/src/share/vm/runtime/reflectionUtils.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/reflectionUtils.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_REFLECTIONUTILS_HPP
+#define SHARE_VM_RUNTIME_REFLECTIONUTILS_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/reflection.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // A KlassStream is an abstract stream for streaming over self, superclasses
 // and (super)interfaces. Streaming is done in reverse order (subclasses first,
 // interfaces last).
@@ -209,3 +221,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_RUNTIME_REFLECTIONUTILS_HPP
--- a/src/share/vm/runtime/registerMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/registerMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_REGISTERMAP_HPP
+#define SHARE_VM_RUNTIME_REGISTERMAP_HPP
+
+#include "code/vmreg.hpp"
+#include "utilities/globalDefinitions.hpp"
+#ifdef TARGET_ARCH_x86
+# include "register_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "register_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "register_zero.hpp"
+#endif
+
 class JavaThread;
 
 //
@@ -114,5 +129,16 @@
   void print() const;
 
   // the following contains the definition of pd_xxx methods
-# include "incls/_registerMap_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "registerMap_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "registerMap_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "registerMap_zero.hpp"
+#endif
+
 };
+
+#endif // SHARE_VM_RUNTIME_REGISTERMAP_HPP
--- a/src/share/vm/runtime/relocator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/relocator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_relocator.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/stackMapTableFormat.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/relocator.hpp"
 
 #define MAX_METHOD_LENGTH  65535
 
--- a/src/share/vm/runtime/relocator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/relocator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_RELOCATOR_HPP
+#define SHARE_VM_RUNTIME_RELOCATOR_HPP
+
+#include "interpreter/bytecodes.hpp"
+#include "oops/methodOop.hpp"
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+
 // This code has been converted from the 1.1E java virtual machine
 // Thanks to the JavaTopics group for using the code
 
@@ -117,3 +132,5 @@
       _listener->relocated(bci, delta, new_code_length);
   }
 };
+
+#endif // SHARE_VM_RUNTIME_RELOCATOR_HPP
--- a/src/share/vm/runtime/rframe.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/rframe.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,9 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/rframe.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframe_hp.hpp"
 
-#include "incls/_rframe.cpp.incl"
 
 static RFrame*const  noCaller    = (RFrame*) 0x1;               // no caller (i.e., initial frame)
 static RFrame*const  noCallerYet = (RFrame*) 0x0;               // caller not yet computed
--- a/src/share/vm/runtime/rframe.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/rframe.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_RFRAME_HPP
+#define SHARE_VM_RUNTIME_RFRAME_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/frame.inline.hpp"
+
 // rframes ("recompiler frames") decorate stack frames with some extra information
 // needed by the recompiler.  The recompiler views the stack (at the time of recompilation)
 // as a list of rframes.
@@ -115,3 +121,5 @@
  public:
   void print();
 };
+
+#endif // SHARE_VM_RUNTIME_RFRAME_HPP
--- a/src/share/vm/runtime/safepoint.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/safepoint.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,61 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_safepoint.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "code/icBuffer.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/sweeper.hpp"
+#include "runtime/synchronizer.hpp"
+#include "services/runtimeService.hpp"
+#include "utilities/events.hpp"
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+# include "vmreg_zero.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/shared/concurrentGCThread.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_globals.hpp"
+#endif
 
 // --------------------------------------------------------------------------------------------------
 // Implementation of Safepoint begin/end
--- a/src/share/vm/runtime/safepoint.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/safepoint.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_SAFEPOINT_HPP
+#define SHARE_VM_RUNTIME_SAFEPOINT_HPP
+
+#include "asm/assembler.hpp"
+#include "code/nmethod.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/os.hpp"
+#include "utilities/ostream.hpp"
+
 //
 // Safepoint synchronization
 ////
@@ -232,3 +242,5 @@
 };
 
 
+
+#endif // SHARE_VM_RUNTIME_SAFEPOINT_HPP
--- a/src/share/vm/runtime/sharedRuntime.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,56 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/compiledIC.hpp"
+#include "code/scopeDesc.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/abstractCompiler.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/forte.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/methodHandles.hpp"
+#include "prims/nativeLookup.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/events.hpp"
+#include "utilities/hashtable.inline.hpp"
+#include "utilities/xmlstream.hpp"
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+# include "vmreg_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+# include "vmreg_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+# include "vmreg_zero.inline.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+
 #include <math.h>
 
 HS_DTRACE_PROBE_DECL4(hotspot, object__alloc, Thread*, char*, int, size_t);
--- a/src/share/vm/runtime/sharedRuntime.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/sharedRuntime.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,17 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_SHAREDRUNTIME_HPP
+#define SHARE_VM_RUNTIME_SHAREDRUNTIME_HPP
+
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/bytecodeTracer.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/allocation.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "utilities/hashtable.hpp"
+
 class AdapterHandlerEntry;
 class AdapterHandlerTable;
 class AdapterFingerPrint;
@@ -663,3 +674,5 @@
 #endif /* PRODUCT */
 
 };
+
+#endif // SHARE_VM_RUNTIME_SHAREDRUNTIME_HPP
--- a/src/share/vm/runtime/sharedRuntimeTrans.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/sharedRuntimeTrans.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntimeTrans.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jni.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 // This file contains copies of the fdlibm routines used by
 // StrictMath. It turns out that it is almost always required to use
--- a/src/share/vm/runtime/sharedRuntimeTrig.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/sharedRuntimeTrig.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntimeTrig.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jni.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 // This file contains copies of the fdlibm routines used by
 // StrictMath. It turns out that it is almost always required to use
--- a/src/share/vm/runtime/signature.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/signature.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_signature.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "runtime/signature.hpp"
 
 
 // Implementation of SignatureIterator
--- a/src/share/vm/runtime/signature.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/signature.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_SIGNATURE_HPP
+#define SHARE_VM_RUNTIME_SIGNATURE_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/methodOop.hpp"
+#include "utilities/top.hpp"
+
 // SignatureIterators iterate over a Java signature (or parts of it).
 // (Syntax according to: "The Java Virtual Machine Specification" by
 // Tim Lindholm & Frank Yellin; section 4.3 Descriptors; p. 89ff.)
@@ -416,3 +423,5 @@
     static ssize_t is_valid_type(const char*, ssize_t);
     static bool invalid_name_char(char);
 };
+
+#endif // SHARE_VM_RUNTIME_SIGNATURE_HPP
--- a/src/share/vm/runtime/simpleThresholdPolicy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/simpleThresholdPolicy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_simpleThresholdPolicy.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileBroker.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/simpleThresholdPolicy.hpp"
+#include "runtime/simpleThresholdPolicy.inline.hpp"
 
 // Print an event.
 void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodHandle imh,
@@ -176,11 +180,11 @@
   if (level == CompLevel_none) {
     return;
   }
-  // Check if the method can be compiled, if not - try different levels.
+  // Check if the method can be compiled. If it cannot be compiled with C1, continue profiling
+  // in the interpreter and then compile with C2 (the transition function will request that,
+  // see common() ). If the method cannot be compiled with C2 but still can with C1, compile it with
+  // pure C1.
   if (!can_be_compiled(mh, level)) {
-    if (level < CompLevel_full_optimization && can_be_compiled(mh, CompLevel_full_optimization)) {
-      compile(mh, bci, CompLevel_full_optimization, THREAD);
-    }
     if (level == CompLevel_full_optimization && can_be_compiled(mh, CompLevel_simple)) {
         compile(mh, bci, CompLevel_simple, THREAD);
     }
--- a/src/share/vm/runtime/simpleThresholdPolicy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/simpleThresholdPolicy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_HPP
+#define SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_HPP
+
+#include "code/nmethod.hpp"
+#include "oops/methodDataOop.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 class CompileTask;
 class CompileQueue;
 
@@ -105,3 +113,5 @@
   // Initialize: set compiler thread count
   virtual void initialize();
 };
+
+#endif // SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_HPP
--- a/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,8 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
+#define SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
 
 template<CompLevel level>
 bool SimpleThresholdPolicy::call_predicate_helper(int i, int b, double scale) {
@@ -62,3 +64,5 @@
   }
   return false;
 }
+
+#endif // SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
--- a/src/share/vm/runtime/stackValue.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stackValue.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_stackValue.cpp.incl"
+#include "precompiled.hpp"
+#include "code/debugInfo.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/stackValue.hpp"
 
 StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv) {
   if (sv->is_location()) {
--- a/src/share/vm/runtime/stackValue.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stackValue.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_STACKVALUE_HPP
+#define SHARE_VM_RUNTIME_STACKVALUE_HPP
+
+#include "code/location.hpp"
+#include "runtime/handles.hpp"
+#include "utilities/top.hpp"
+
 class StackValue : public ResourceObj {
  private:
   BasicType _type;
@@ -106,3 +113,5 @@
   void print_on(outputStream* st) const;
 #endif
 };
+
+#endif // SHARE_VM_RUNTIME_STACKVALUE_HPP
--- a/src/share/vm/runtime/stackValueCollection.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stackValueCollection.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_stackValueCollection.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/stackValueCollection.hpp"
+#ifdef TARGET_ARCH_x86
+# include "jniTypes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "jniTypes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "jniTypes_zero.hpp"
+#endif
 
 jint StackValueCollection::int_at(int slot) const {
   intptr_t val =  at(slot)->get_int();
--- a/src/share/vm/runtime/stackValueCollection.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stackValueCollection.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_STACKVALUECOLLECTION_HPP
+#define SHARE_VM_RUNTIME_STACKVALUECOLLECTION_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/stackValue.hpp"
+#include "utilities/growableArray.hpp"
+
 class StackValueCollection : public ResourceObj {
  private:
   GrowableArray<StackValue*>* _values;
@@ -51,3 +58,5 @@
 
   void print();
 };
+
+#endif // SHARE_VM_RUNTIME_STACKVALUECOLLECTION_HPP
--- a/src/share/vm/runtime/statSampler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/statSampler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,26 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_statSampler.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/os.hpp"
+#include "runtime/statSampler.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vm_version_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vm_version_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vm_version_zero.hpp"
+#endif
 
 // --------------------------------------------------------
 // StatSamplerTask
--- a/src/share/vm/runtime/statSampler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/statSampler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_STATSAMPLER_HPP
+#define SHARE_VM_RUNTIME_STATSAMPLER_HPP
+
+#include "runtime/perfData.hpp"
+#include "runtime/task.hpp"
+
 class StatSamplerTask;
 
 /*
@@ -60,3 +66,5 @@
 };
 
 void statSampler_exit();
+
+#endif // SHARE_VM_RUNTIME_STATSAMPLER_HPP
--- a/src/share/vm/runtime/stubCodeGenerator.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stubCodeGenerator.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubCodeGenerator.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/disassembler.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/forte.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+#endif
 
 
 // Implementation of StubCodeDesc
--- a/src/share/vm/runtime/stubCodeGenerator.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stubCodeGenerator.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_STUBCODEGENERATOR_HPP
+#define SHARE_VM_RUNTIME_STUBCODEGENERATOR_HPP
+
+#include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
+
 // All the basic framework for stubcode generation/debugging/printing.
 
 
@@ -119,3 +125,5 @@
   ~StubCodeMark();
 
 };
+
+#endif // SHARE_VM_RUNTIME_STUBCODEGENERATOR_HPP
--- a/src/share/vm/runtime/stubRoutines.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stubRoutines.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/codeBuffer.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/copy.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 
 // Implementation of StubRoutines - for a description
--- a/src/share/vm/runtime/stubRoutines.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/stubRoutines.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,25 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_STUBROUTINES_HPP
+#define SHARE_VM_RUNTIME_STUBROUTINES_HPP
+
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_ARCH_x86
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "nativeInst_zero.hpp"
+#endif
+
 // StubRoutines provides entry points to assembly routines used by
 // compiled code and the run-time system. Platform-specific entry
 // points are defined in the platform-specific inner class.
@@ -74,7 +93,19 @@
 
   // Dependencies
   friend class StubGenerator;
-  #include "incls/_stubRoutines_pd.hpp.incl"               // machine-specific parts
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "stubRoutines_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "stubRoutines_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "stubRoutines_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "stubRoutines_zero.hpp"
+#endif
+
 
   static jint    _verify_oop_count;
   static address _verify_oop_subroutine_entry;
@@ -321,3 +352,5 @@
   static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count);
   static void arrayof_oop_copy   (HeapWord* src, HeapWord* dest, size_t count);
 };
+
+#endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP
--- a/src/share/vm/runtime/sweeper.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/sweeper.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_sweeper.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "compiler/compileBroker.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/compilationPolicy.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sweeper.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/events.hpp"
+#include "utilities/xmlstream.hpp"
 
 long      NMethodSweeper::_traversals = 0;   // No. of stack traversals performed
 nmethod*  NMethodSweeper::_current = NULL;   // Current nmethod
--- a/src/share/vm/runtime/sweeper.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/sweeper.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_SWEEPER_HPP
+#define SHARE_VM_RUNTIME_SWEEPER_HPP
+
 // An NmethodSweeper is an incremental cleaner for:
 //    - cleanup inline caches
 //    - reclamation of unreferences zombie nmethods
@@ -71,3 +74,5 @@
   static void set_was_full(bool state) { _was_full = state; }
   static bool was_full() { return _was_full; }
 };
+
+#endif // SHARE_VM_RUNTIME_SWEEPER_HPP
--- a/src/share/vm/runtime/synchronizer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/synchronizer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,35 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_synchronizer.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/objectMonitor.inline.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/events.hpp"
+#include "utilities/preserveException.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 #if defined(__GNUC__) && !defined(IA64)
   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
--- a/src/share/vm/runtime/synchronizer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/synchronizer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_SYNCHRONIZER_HPP
+#define SHARE_VM_RUNTIME_SYNCHRONIZER_HPP
+
+#include "oops/markOop.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/perfData.hpp"
+#include "utilities/top.hpp"
+
 
 class ObjectMonitor;
 
@@ -153,3 +162,5 @@
   intptr_t complete_exit(TRAPS) { return  ObjectSynchronizer::complete_exit(_obj, CHECK_0); }
   void reenter(intptr_t recursion, TRAPS) { ObjectSynchronizer::reenter(_obj, recursion, CHECK); }
 };
+
+#endif // SHARE_VM_RUNTIME_SYNCHRONIZER_HPP
--- a/src/share/vm/runtime/task.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/task.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,23 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_task.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/init.hpp"
+#include "runtime/task.hpp"
+#include "runtime/timer.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 int PeriodicTask::_num_tasks = 0;
 PeriodicTask* PeriodicTask::_tasks[PeriodicTask::max_tasks];
--- a/src/share/vm/runtime/task.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/task.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_TASK_HPP
+#define SHARE_VM_RUNTIME_TASK_HPP
+
+#include "utilities/top.hpp"
+
 // A PeriodicTask has the sole purpose of executing its task
 // function with regular intervals.
 // Usage:
@@ -113,3 +118,5 @@
   // The task to perform at each period
   virtual void task() = 0;
 };
+
+#endif // SHARE_VM_RUNTIME_TASK_HPP
--- a/src/share/vm/runtime/thread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/thread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,83 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_thread.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/scopeDesc.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/linkResolver.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolOop.hpp"
+#include "prims/jvm_misc.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/privilegedStack.hpp"
+#include "runtime/aprofiler.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/jniPeriodicChecker.hpp"
+#include "runtime/memprofiler.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/task.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
+#include "runtime/vframe_hp.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/attachListener.hpp"
+#include "services/management.hpp"
+#include "services/threadService.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/events.hpp"
+#include "utilities/preserveException.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
+#include "gc_implementation/parallelScavenge/pcTasks.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Compiler.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/c2compiler.hpp"
+#include "opto/idealGraphPrinter.hpp"
+#endif
 
 #ifdef DTRACE_ENABLED
 
@@ -3159,12 +3234,6 @@
       warning("java.lang.ArithmeticException has not been initialized");
       warning("java.lang.StackOverflowError has not been initialized");
     }
-
-    if (EnableInvokeDynamic) {
-      // JSR 292: An intialized java.dyn.InvokeDynamic is required in
-      // the compiler.
-      initialize_class(vmSymbolHandles::java_dyn_InvokeDynamic(), CHECK_0);
-    }
   }
 
   // See        : bugid 4211085.
@@ -3313,7 +3382,7 @@
     const char *msg = "Could not find agent library ";
 
     if (agent->is_absolute_path()) {
-      library = hpi::dll_load(name, ebuf, sizeof ebuf);
+      library = os::dll_load(name, ebuf, sizeof ebuf);
       if (library == NULL) {
         const char *sub_msg = " in absolute path, with error: ";
         size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1;
@@ -3325,8 +3394,8 @@
       }
     } else {
       // Try to load the agent from the standard dll directory
-      hpi::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), name);
-      library = hpi::dll_load(buffer, ebuf, sizeof ebuf);
+      os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), name);
+      library = os::dll_load(buffer, ebuf, sizeof ebuf);
 #ifdef KERNEL
       // Download instrument dll
       if (library == NULL && strcmp(name, "instrument") == 0) {
@@ -3346,13 +3415,13 @@
         }
         FREE_C_HEAP_ARRAY(char, cmd);
         // when this comes back the instrument.dll should be where it belongs.
-        library = hpi::dll_load(buffer, ebuf, sizeof ebuf);
+        library = os::dll_load(buffer, ebuf, sizeof ebuf);
       }
 #endif // KERNEL
       if (library == NULL) { // Try the local directory
         char ns[1] = {0};
-        hpi::dll_build_name(buffer, sizeof(buffer), ns, name);
-        library = hpi::dll_load(buffer, ebuf, sizeof ebuf);
+        os::dll_build_name(buffer, sizeof(buffer), ns, name);
+        library = os::dll_load(buffer, ebuf, sizeof ebuf);
         if (library == NULL) {
           const char *sub_msg = " on the library path, with error: ";
           size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1;
@@ -3369,7 +3438,7 @@
 
   // Find the OnLoad function.
   for (size_t symbol_index = 0; symbol_index < num_symbol_entries; symbol_index++) {
-    on_load_entry = CAST_TO_FN_PTR(OnLoadEntry_t, hpi::dll_lookup(library, on_load_symbols[symbol_index]));
+    on_load_entry = CAST_TO_FN_PTR(OnLoadEntry_t, os::dll_lookup(library, on_load_symbols[symbol_index]));
     if (on_load_entry != NULL) break;
   }
   return on_load_entry;
@@ -3451,7 +3520,7 @@
     // Find the Agent_OnUnload function.
     for (uint symbol_index = 0; symbol_index < ARRAY_SIZE(on_unload_symbols); symbol_index++) {
       Agent_OnUnload_t unload_entry = CAST_TO_FN_PTR(Agent_OnUnload_t,
-               hpi::dll_lookup(agent->os_lib(), on_unload_symbols[symbol_index]));
+               os::dll_lookup(agent->os_lib(), on_unload_symbols[symbol_index]));
 
       // Invoke the Agent_OnUnload function
       if (unload_entry != NULL) {
@@ -3620,7 +3689,6 @@
 
 #ifndef PRODUCT
   // disable function tracing at JNI/JVM barriers
-  TraceHPI = false;
   TraceJNICalls = false;
   TraceJVMCalls = false;
   TraceRuntimeCalls = false;
--- a/src/share/vm/runtime/thread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/thread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,37 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_THREAD_HPP
+#define SHARE_VM_RUNTIME_THREAD_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/threadLocalAllocBuffer.hpp"
+#include "oops/oop.hpp"
+#include "prims/jni.h"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/javaFrameAnchor.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/park.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "runtime/unhandledOops.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/top.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/dirtyCardQueue.hpp"
+#include "gc_implementation/g1/satbQueue.hpp"
+#endif
+#ifdef ZERO
+#ifdef TARGET_ARCH_zero
+# include "stack_zero.hpp"
+#endif
+#endif
+
 class ThreadSafepointState;
 class ThreadProfiler;
 
@@ -47,6 +78,8 @@
 class ThreadClosure;
 class IdealGraphPrinter;
 
+class WorkerThread;
+
 // Class hierarchy
 // - Thread
 //   - NamedThread
@@ -258,6 +291,10 @@
   virtual bool is_Watcher_thread() const             { return false; }
   virtual bool is_ConcurrentGC_thread() const        { return false; }
   virtual bool is_Named_thread() const               { return false; }
+  virtual bool is_Worker_thread() const              { return false; }
+
+  // Casts
+  virtual WorkerThread* as_Worker_thread() const     { return NULL; }
 
   virtual char* name() const { return (char*)"Unknown thread"; }
 
@@ -597,9 +634,16 @@
 private:
   uint _id;
 public:
-  WorkerThread() : _id(0) { }
-  void set_id(uint work_id) { _id = work_id; }
-  uint id() const { return _id; }
+  WorkerThread() : _id(0)               { }
+  virtual bool is_Worker_thread() const { return true; }
+
+  virtual WorkerThread* as_Worker_thread() const {
+    assert(is_Worker_thread(), "Dubious cast to WorkerThread*?");
+    return (WorkerThread*) this;
+  }
+
+  void set_id(uint work_id)             { _id = work_id; }
+  uint id() const                       { return _id; }
 };
 
 // A single WatcherThread is used for simulating timer interrupts.
@@ -1518,7 +1562,25 @@
 #endif // !SERIALGC
 
   // Machine dependent stuff
-  #include "incls/_thread_pd.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "thread_linux_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "thread_linux_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "thread_linux_zero.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "thread_solaris_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "thread_solaris_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "thread_windows_x86.hpp"
+#endif
+
 
  public:
   void set_blocked_on_compilation(bool value) {
@@ -1776,3 +1838,5 @@
   }
 };
 
+
+#endif // SHARE_VM_RUNTIME_THREAD_HPP
--- a/src/share/vm/runtime/threadCritical.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/threadCritical.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_THREADCRITICAL_HPP
+#define SHARE_VM_RUNTIME_THREADCRITICAL_HPP
+
+#include "memory/allocation.hpp"
+
 // ThreadCritical is used to protect short non-blocking critical sections.
 // This class must use no vm facilities that require initialization.
 // It is used very early in the vm's initialization, in allocation
@@ -51,3 +56,5 @@
   ThreadCritical();
   ~ThreadCritical();
 };
+
+#endif // SHARE_VM_RUNTIME_THREADCRITICAL_HPP
--- a/src/share/vm/runtime/threadLocalStorage.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/threadLocalStorage.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_threadLocalStorage.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 // static member initialization
 int ThreadLocalStorage::_thread_index = -1;
--- a/src/share/vm/runtime/threadLocalStorage.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/threadLocalStorage.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP
+#define SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP
+
+#include "gc_implementation/shared/gcUtil.hpp"
+#include "runtime/os.hpp"
+#include "utilities/top.hpp"
+
 // Interface for thread local storage
 
 // Fast variant of ThreadLocalStorage::get_thread_slow
@@ -37,7 +44,25 @@
   static void    invalidate_all() { pd_invalidate_all(); }
 
   // Machine dependent stuff
-  #include "incls/_threadLS_pd.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "threadLS_linux_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "threadLS_linux_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "threadLS_linux_zero.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "threadLS_solaris_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "threadLS_solaris_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "threadLS_windows_x86.hpp"
+#endif
+
 
  public:
   // Accessor
@@ -61,3 +86,5 @@
   static void pd_invalidate_all();
 
 };
+
+#endif // SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP
--- a/src/share/vm/runtime/timer.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/timer.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_timer.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/ostream.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 
 void elapsedTimer::add(elapsedTimer t) {
--- a/src/share/vm/runtime/timer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/timer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_TIMER_HPP
+#define SHARE_VM_RUNTIME_TIMER_HPP
+
+#include "utilities/globalDefinitions.hpp"
+
 // Timers for simple measurement.
 
 class elapsedTimer VALUE_OBJ_CLASS_SPEC {
@@ -119,3 +124,5 @@
                outputStream *logfile = NULL);
   ~TraceCPUTime();
 };
+
+#endif // SHARE_VM_RUNTIME_TIMER_HPP
--- a/src/share/vm/runtime/unhandledOops.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/unhandledOops.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_unhandledOops.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/unhandledOops.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 #ifdef CHECK_UNHANDLED_OOPS
 const int free_list_size = 256;
--- a/src/share/vm/runtime/unhandledOops.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/unhandledOops.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,10 @@
  * questions.
  *
  */
+
+#ifndef SHARE_VM_RUNTIME_UNHANDLEDOOPS_HPP
+#define SHARE_VM_RUNTIME_UNHANDLEDOOPS_HPP
+
 #ifdef CHECK_UNHANDLED_OOPS
 
 // Detect unhanded oops in VM code
@@ -81,3 +85,5 @@
 const intptr_t BAD_OOP_ADDR =  0xfffffff1;
 #endif // _LP64
 #endif // CHECK_UNHANDLED_OOPS
+
+#endif // SHARE_VM_RUNTIME_UNHANDLEDOOPS_HPP
--- a/src/share/vm/runtime/vframe.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vframe.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,29 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vframe.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/objectMonitor.inline.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
+#include "runtime/vframe_hp.hpp"
 
 vframe::vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
 : _reg_map(reg_map), _thread(thread) {
--- a/src/share/vm/runtime/vframe.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vframe.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,19 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VFRAME_HPP
+#define SHARE_VM_RUNTIME_VFRAME_HPP
+
+#include "code/debugInfo.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/location.hpp"
+#include "oops/oop.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stackValue.hpp"
+#include "runtime/stackValueCollection.hpp"
+#include "utilities/growableArray.hpp"
+
 // vframes are virtual stack frames representing source level activations.
 // A single frame may hold several source level activations in the case of
 // optimized code. The debugging stored with the optimized code enables
@@ -508,3 +521,5 @@
   _method = method;
   _bci    = bci;
 }
+
+#endif // SHARE_VM_RUNTIME_VFRAME_HPP
--- a/src/share/vm/runtime/vframeArray.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vframeArray.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,25 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vframeArray.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vframeArray.hpp"
+#include "runtime/vframe_hp.hpp"
+#include "utilities/events.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
 
 
 int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); }
--- a/src/share/vm/runtime/vframeArray.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vframeArray.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VFRAMEARRAY_HPP
+#define SHARE_VM_RUNTIME_VFRAMEARRAY_HPP
+
+#include "oops/arrayOop.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "utilities/growableArray.hpp"
+
 // A vframeArray is an array used for momentarily storing off stack Java method activations
 // during deoptimization. Essentially it is an array of vframes where each vframe
 // data is stored off stack. This structure will never exist across a safepoint so
@@ -201,3 +210,5 @@
 #endif
 
 };
+
+#endif // SHARE_VM_RUNTIME_VFRAMEARRAY_HPP
--- a/src/share/vm/runtime/vframe_hp.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vframe_hp.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,26 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vframe_hp.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/scopeDesc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/oopMapCache.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframeArray.hpp"
+#include "runtime/vframe_hp.hpp"
+#ifdef COMPILER2
+#include "opto/matcher.hpp"
+#endif
 
 
 // ------------- compiledVFrame --------------
@@ -195,8 +213,8 @@
     GrowableArray<MonitorInfo*> *monitors = new GrowableArray<MonitorInfo*>(1);
     // Casting away const
     frame& fr = (frame&) _fr;
-    MonitorInfo* info = new MonitorInfo(fr.compiled_synchronized_native_monitor_owner(nm),
-                                        fr.compiled_synchronized_native_monitor(nm), false, false);
+    MonitorInfo* info = new MonitorInfo(
+        fr.get_native_receiver(), fr.get_native_monitor(), false, false);
     monitors->push(info);
     return monitors;
   }
--- a/src/share/vm/runtime/vframe_hp.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vframe_hp.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VFRAME_HP_HPP
+#define SHARE_VM_RUNTIME_VFRAME_HP_HPP
+
+#include "runtime/vframe.hpp"
+
 class compiledVFrame: public javaVFrame {
  public:
   // JVM state
@@ -134,3 +139,5 @@
     int               _index;
 
 };
+
+#endif // SHARE_VM_RUNTIME_VFRAME_HP_HPP
--- a/src/share/vm/runtime/virtualspace.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/virtualspace.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_virtualspace.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/markOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/virtualspace.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 
 // ReservedSpace
--- a/src/share/vm/runtime/virtualspace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/virtualspace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VIRTUALSPACE_HPP
+#define SHARE_VM_RUNTIME_VIRTUALSPACE_HPP
+
+#include "memory/allocation.hpp"
+
 // ReservedSpace is a data structure for reserving a contiguous address range.
 
 class ReservedSpace VALUE_OBJ_CLASS_SPEC {
@@ -223,3 +228,5 @@
   // Debugging
   void print() PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_RUNTIME_VIRTUALSPACE_HPP
--- a/src/share/vm/runtime/vmStructs.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vmStructs.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,152 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmStructs.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/dictionary.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/loaderConstraints.hpp"
+#include "classfile/placeholders.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeBlob.hpp"
+#include "code/codeCache.hpp"
+#include "code/compressedStream.hpp"
+#include "code/location.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "code/stubs.hpp"
+#include "code/vmreg.hpp"
+#include "compiler/oopMap.hpp"
+#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
+#include "gc_implementation/shared/immutableSpace.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableRS.hpp"
+#include "memory/compactPermGen.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generation.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/heap.hpp"
+#include "memory/permGen.hpp"
+#include "memory/space.hpp"
+#include "memory/tenuredGeneration.hpp"
+#include "memory/universe.hpp"
+#include "memory/watermark.hpp"
+#include "oops/arrayKlass.hpp"
+#include "oops/arrayKlassKlass.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/compiledICHolderKlass.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/constMethodKlass.hpp"
+#include "oops/constMethodOop.hpp"
+#include "oops/constantPoolKlass.hpp"
+#include "oops/constantPoolOop.hpp"
+#include "oops/cpCacheKlass.hpp"
+#include "oops/cpCacheOop.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/instanceKlassKlass.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataKlass.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodKlass.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayKlassKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/symbolKlass.hpp"
+#include "oops/symbolOop.hpp"
+#include "oops/typeArrayKlass.hpp"
+#include "oops/typeArrayKlassKlass.hpp"
+#include "oops/typeArrayOop.hpp"
+#include "prims/jvmtiAgentThread.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/virtualspace.hpp"
+#include "runtime/vmStructs.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/hashtable.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vmStructs_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vmStructs_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vmStructs_zero.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "vmStructs_linux_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "vmStructs_linux_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "vmStructs_linux_zero.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "vmStructs_solaris_x86.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "vmStructs_solaris_sparc.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "vmStructs_windows_x86.hpp"
+#endif
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+#include "gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp"
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/parNew/vmStructs_parNew.hpp"
+#include "gc_implementation/parallelScavenge/asPSOldGen.hpp"
+#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/matcher.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "adfiles/adGlobals_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "adfiles/adGlobals_x86_64.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_sparc
+# include "adfiles/adGlobals_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_zero
+# include "adfiles/adGlobals_zero.hpp"
+#endif
+#endif
 
 // Note: the cross-product of (c1, c2, product, nonproduct, ...),
 // (nonstatic, static), and (unchecked, checked) has not been taken.
@@ -1532,10 +1676,7 @@
   /* constantPoolOop layout enum for InvokeDynamic */                     \
   /*************************************************/                     \
                                                                           \
-  declare_constant(constantPoolOopDesc::_multi_operand_count_offset)      \
-  declare_constant(constantPoolOopDesc::_multi_operand_base_offset)       \
   declare_constant(constantPoolOopDesc::_indy_bsm_offset)                 \
-  declare_constant(constantPoolOopDesc::_indy_nt_offset)                  \
   declare_constant(constantPoolOopDesc::_indy_argc_offset)                \
   declare_constant(constantPoolOopDesc::_indy_argv_offset)                \
                                                                           \
--- a/src/share/vm/runtime/vmStructs.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vmStructs.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,16 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VMSTRUCTS_HPP
+#define SHARE_VM_RUNTIME_VMSTRUCTS_HPP
+
+#ifndef VM_STRUCTS_KERNEL
+#include "utilities/debug.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+
 // This table encapsulates the debugging information required by the
 // serviceability agent in order to run. Specifically, we need to
 // understand the layout of certain C data structures (offsets, in
@@ -119,3 +129,5 @@
   //  debug_only(static int findType(const char* typeName);)
   static int findType(const char* typeName);
 };
+
+#endif // SHARE_VM_RUNTIME_VMSTRUCTS_HPP
--- a/src/share/vm/runtime/vmThread.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vmThread.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,30 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmThread.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileBroker.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/runtimeService.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/events.hpp"
+#include "utilities/xmlstream.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 HS_DTRACE_PROBE_DECL3(hotspot, vmops__request, char *, uintptr_t, int);
 HS_DTRACE_PROBE_DECL3(hotspot, vmops__begin, char *, uintptr_t, int);
--- a/src/share/vm/runtime/vmThread.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vmThread.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VMTHREAD_HPP
+#define SHARE_VM_RUNTIME_VMTHREAD_HPP
+
+#include "runtime/perfData.hpp"
+#include "runtime/vm_operations.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 //
 // Prioritized queue of VM operations.
 //
@@ -144,3 +159,5 @@
   // Pointer to single-instance of VM thread
   static VMThread*     _vm_thread;
 };
+
+#endif // SHARE_VM_RUNTIME_VMTHREAD_HPP
--- a/src/share/vm/runtime/vm_operations.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vm_operations.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,27 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_operations.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/compilerOracle.hpp"
+#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sweeper.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/threadService.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 #define VM_OP_NAME_INITIALIZE(name) #name,
 
--- a/src/share/vm/runtime/vm_operations.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vm_operations.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VM_OPERATIONS_HPP
+#define SHARE_VM_RUNTIME_VM_OPERATIONS_HPP
+
+#include "classfile/javaClasses.hpp"
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/top.hpp"
+
 // The following classes are used for operations
 // initiated by a Java thread but that must
 // take place in the VMThread.
@@ -386,3 +395,5 @@
   VMOp_Type type() const { return VMOp_Exit; }
   void doit();
 };
+
+#endif // SHARE_VM_RUNTIME_VM_OPERATIONS_HPP
--- a/src/share/vm/runtime/vm_version.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vm_version.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/arguments.hpp"
+#ifdef TARGET_ARCH_x86
+# include "vm_version_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "vm_version_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "vm_version_zero.hpp"
+#endif
 
 const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release();
 const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string();
--- a/src/share/vm/runtime/vm_version.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/runtime/vm_version.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_RUNTIME_VM_VERSION_HPP
+#define SHARE_VM_RUNTIME_VM_VERSION_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/ostream.hpp"
+
 // VM_Version provides information about the VM.
 
 class Abstract_VM_Version: AllStatic {
@@ -88,3 +94,5 @@
   // be VM version specific.
   static unsigned int calc_parallel_worker_threads();
 };
+
+#endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
--- a/src/share/vm/services/attachListener.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/attachListener.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_attachListener.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/os.hpp"
+#include "services/attachListener.hpp"
+#include "services/heapDumper.hpp"
 
 volatile bool AttachListener::_initialized;
 
--- a/src/share/vm/services/attachListener.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/attachListener.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_ATTACHLISTENER_HPP
+#define SHARE_VM_SERVICES_ATTACHLISTENER_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/ostream.hpp"
+
 // The AttachListener thread services a queue of operations that are enqueued
 // by client tools. Each operation is identified by a name and has up to 3
 // arguments. The operation name is mapped to a function which performs the
@@ -145,3 +152,5 @@
   virtual void complete(jint result, bufferedStream* result_stream) = 0;
 };
 #endif // SERVICES_KERNEL
+
+#endif // SHARE_VM_SERVICES_ATTACHLISTENER_HPP
--- a/src/share/vm/services/classLoadingService.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/classLoadingService.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,15 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_classLoadingService.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/allocation.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "services/classLoadingService.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/dtrace.hpp"
 
 #ifdef DTRACE_ENABLED
 
--- a/src/share/vm/services/classLoadingService.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/classLoadingService.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP
+#define SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP
+
+#include "runtime/handles.hpp"
+#include "runtime/perfData.hpp"
+#include "utilities/growableArray.hpp"
+
 class instanceKlass;
 
 // VM monitoring and management support for the Class Loading subsystem
@@ -133,3 +140,5 @@
     _loaded_classes->append(h);
   }
 };
+
+#endif // SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP
--- a/src/share/vm/services/dtraceAttacher.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/dtraceAttacher.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_dtraceAttacher.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/dtraceAttacher.hpp"
 
 #ifdef SOLARIS
 
--- a/src/share/vm/services/dtraceAttacher.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/dtraceAttacher.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_DTRACEATTACHER_HPP
+#define SHARE_VM_SERVICES_DTRACEATTACHER_HPP
+
 #define DTRACE_ALLOC_PROBES    0x1
 #define DTRACE_METHOD_PROBES   0x2
 #define DTRACE_MONITOR_PROBES  0x4
@@ -44,3 +47,5 @@
   // set DTraceMonitorProbes flag
   static void set_monitor_dprobes(bool value);
 };
+
+#endif // SHARE_VM_SERVICES_DTRACEATTACHER_HPP
--- a/src/share/vm/services/g1MemoryPool.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/g1MemoryPool.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,12 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_g1MemoryPool.cpp.incl"
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "services/g1MemoryPool.hpp"
 
 G1MemoryPoolSuper::G1MemoryPoolSuper(G1CollectedHeap* g1h,
                                      const char* name,
--- a/src/share/vm/services/g1MemoryPool.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/g1MemoryPool.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_G1MEMORYPOOL_HPP
+#define SHARE_VM_SERVICES_G1MEMORYPOOL_HPP
+
+#ifndef SERIALGC
+#include "services/memoryPool.hpp"
+#include "services/memoryUsage.hpp"
+#endif
+
 class G1CollectedHeap;
 
 // This file contains the three classes that represent the memory
@@ -198,3 +206,5 @@
   }
   MemoryUsage get_memory_usage();
 };
+
+#endif // SHARE_VM_SERVICES_G1MEMORYPOOL_HPP
--- a/src/share/vm/services/heapDumper.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/heapDumper.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,26 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_heapDumper.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_implementation/shared/vmGCOperations.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/universe.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/reflectionUtils.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/heapDumper.hpp"
+#include "services/threadService.hpp"
+#include "utilities/ostream.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#endif
 
 /*
  * HPROF binary format - description copied from:
--- a/src/share/vm/services/heapDumper.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/heapDumper.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_HEAPDUMPER_HPP
+#define SHARE_VM_SERVICES_HEAPDUMPER_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/oop.hpp"
+#include "runtime/os.hpp"
+
 // HeapDumper is used to dump the java heap to file in HPROF binary format:
 //
 //  { HeapDumper dumper(true /* full GC before heap dump */);
@@ -73,3 +81,5 @@
 
   static void dump_heap_from_oome()    KERNEL_RETURN;
 };
+
+#endif // SHARE_VM_SERVICES_HEAPDUMPER_HPP
--- a/src/share/vm/services/jmm.h	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/jmm.h	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/vm/services/lowMemoryDetector.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/lowMemoryDetector.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_lowMemoryDetector.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "services/lowMemoryDetector.hpp"
+#include "services/management.hpp"
 
 LowMemoryDetectorThread* LowMemoryDetector::_detector_thread = NULL;
 volatile bool LowMemoryDetector::_enabled_for_collected_pools = false;
--- a/src/share/vm/services/lowMemoryDetector.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/lowMemoryDetector.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_LOWMEMORYDETECTOR_HPP
+#define SHARE_VM_SERVICES_LOWMEMORYDETECTOR_HPP
+
+#include "memory/allocation.hpp"
+#include "services/memoryPool.hpp"
+#include "services/memoryService.hpp"
+
 // Low Memory Detection Support
 // Two memory alarms in the JDK (we called them sensors).
 //   - Heap memory sensor
@@ -283,3 +290,5 @@
     LowMemoryDetector::enable();
   }
 };
+
+#endif // SHARE_VM_SERVICES_LOWMEMORYDETECTOR_HPP
--- a/src/share/vm/services/management.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/management.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,31 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_management.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "compiler/compileBroker.hpp"
+#include "memory/iterator.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/klass.hpp"
+#include "oops/klassOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "services/classLoadingService.hpp"
+#include "services/heapDumper.hpp"
+#include "services/lowMemoryDetector.hpp"
+#include "services/management.hpp"
+#include "services/memoryManager.hpp"
+#include "services/memoryPool.hpp"
+#include "services/memoryService.hpp"
+#include "services/runtimeService.hpp"
+#include "services/threadService.hpp"
 
 PerfVariable* Management::_begin_vm_creation_time = NULL;
 PerfVariable* Management::_end_vm_creation_time = NULL;
--- a/src/share/vm/services/management.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/management.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_MANAGEMENT_HPP
+#define SHARE_VM_SERVICES_MANAGEMENT_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/timer.hpp"
+#include "services/jmm.h"
+
 class OopClosure;
 class ThreadSnapshot;
 
@@ -104,3 +112,5 @@
   { Management::record_vm_startup_time(_begin_time, _timer.milliseconds()); }
 
 };
+
+#endif // SHARE_VM_SERVICES_MANAGEMENT_HPP
--- a/src/share/vm/services/memoryManager.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/memoryManager.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_memoryManager.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "services/lowMemoryDetector.hpp"
+#include "services/management.hpp"
+#include "services/memoryManager.hpp"
+#include "services/memoryPool.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/dtrace.hpp"
 
 HS_DTRACE_PROBE_DECL8(hotspot, mem__pool__gc__begin, char*, int, char*, int,
   size_t, size_t, size_t, size_t);
--- a/src/share/vm/services/memoryManager.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/memoryManager.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_MEMORYMANAGER_HPP
+#define SHARE_VM_SERVICES_MEMORYMANAGER_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/timer.hpp"
+#include "services/memoryUsage.hpp"
+
 // A memory manager is responsible for managing one or more memory pools.
 // The garbage collector is one type of memory managers responsible
 // for reclaiming memory occupied by unreachable objects.  A Java virtual
@@ -263,3 +270,5 @@
   MemoryManager::Name kind() { return MemoryManager::G1OldGen; }
   const char* name()         { return "G1 Old Generation"; }
 };
+
+#endif // SHARE_VM_SERVICES_MEMORYMANAGER_HPP
--- a/src/share/vm/services/memoryPool.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/memoryPool.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_memoryPool.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "services/lowMemoryDetector.hpp"
+#include "services/management.hpp"
+#include "services/memoryManager.hpp"
+#include "services/memoryPool.hpp"
 
 MemoryPool::MemoryPool(const char* name,
                        PoolType type,
--- a/src/share/vm/services/memoryPool.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/memoryPool.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,18 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_MEMORYPOOL_HPP
+#define SHARE_VM_SERVICES_MEMORYPOOL_HPP
+
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/heap.hpp"
+#include "memory/space.hpp"
+#include "services/memoryUsage.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#endif
+
 // A memory pool represents the memory area that the VM manages.
 // The Java virtual machine has at least one memory pool
 // and it may create or remove memory pools during execution.
@@ -210,3 +222,5 @@
   MemoryUsage get_memory_usage();
   size_t used_in_bytes()            { return _codeHeap->allocated_capacity(); }
 };
+
+#endif // SHARE_VM_SERVICES_MEMORYPOOL_HPP
--- a/src/share/vm/services/memoryService.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/memoryService.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,40 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_memoryService.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "memory/collectorPolicy.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/genCollectedHeap.hpp"
+#include "memory/generation.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/heap.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/permGen.hpp"
+#include "memory/tenuredGeneration.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "services/classLoadingService.hpp"
+#include "services/lowMemoryDetector.hpp"
+#include "services/management.hpp"
+#include "services/memoryManager.hpp"
+#include "services/memoryPool.hpp"
+#include "services/memoryService.hpp"
+#include "utilities/growableArray.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
+#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/parNew/parNewGeneration.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "services/g1MemoryPool.hpp"
+#include "services/psMemoryPool.hpp"
+#endif
 
 GrowableArray<MemoryPool*>* MemoryService::_pools_list =
   new (ResourceObj::C_HEAP) GrowableArray<MemoryPool*>(init_pools_list_size, true);
--- a/src/share/vm/services/memoryService.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/memoryService.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_MEMORYSERVICE_HPP
+#define SHARE_VM_SERVICES_MEMORYSERVICE_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/generation.hpp"
+#include "runtime/handles.hpp"
+#include "services/memoryUsage.hpp"
+
 // Forward declaration
 class MemoryPool;
 class MemoryManager;
@@ -200,3 +208,5 @@
   TraceMemoryManagerStats(Generation::Name kind);
   ~TraceMemoryManagerStats();
 };
+
+#endif // SHARE_VM_SERVICES_MEMORYSERVICE_HPP
--- a/src/share/vm/services/memoryUsage.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/memoryUsage.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_MEMORYUSAGE_HPP
+#define SHARE_VM_SERVICES_MEMORYUSAGE_HPP
+
+#include "utilities/globalDefinitions.hpp"
+
 // A memory usage contains the following attributes about memory usage:
 //  initSize - represents the initial amount of memory (in bytes) that
 //     the Java virtual machine requests from the operating system
@@ -75,3 +80,5 @@
   jlong committed_as_jlong() const { return convert_to_jlong(_committed); }
   jlong max_size_as_jlong()  const { return convert_to_jlong(_maxSize); }
 };
+
+#endif // SHARE_VM_SERVICES_MEMORYUSAGE_HPP
--- a/src/share/vm/services/psMemoryPool.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/psMemoryPool.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,17 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_psMemoryPool.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "gc_implementation/parallelScavenge/psPermGen.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "services/lowMemoryDetector.hpp"
+#include "services/management.hpp"
+#include "services/memoryManager.hpp"
+#include "services/psMemoryPool.hpp"
 
 PSGenerationPool::PSGenerationPool(PSOldGen* gen,
                                    const char* name,
--- a/src/share/vm/services/psMemoryPool.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/psMemoryPool.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_PSMEMORYPOOL_HPP
+#define SHARE_VM_SERVICES_PSMEMORYPOOL_HPP
+
+#ifndef SERIALGC
+#include "gc_implementation/parallelScavenge/psOldGen.hpp"
+#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
+#include "gc_implementation/shared/mutableSpace.hpp"
+#include "memory/defNewGeneration.hpp"
+#include "memory/heap.hpp"
+#include "memory/space.hpp"
+#include "services/memoryPool.hpp"
+#include "services/memoryUsage.hpp"
+#endif
+
 class PSGenerationPool : public CollectedMemoryPool {
 private:
   PSOldGen* _gen;
@@ -79,3 +93,5 @@
     return _gen->from_space()->capacity_in_bytes();
   }
 };
+
+#endif // SHARE_VM_SERVICES_PSMEMORYPOOL_HPP
--- a/src/share/vm/services/runtimeService.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/runtimeService.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,13 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_runtimeService.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/classLoader.hpp"
+#include "services/attachListener.hpp"
+#include "services/management.hpp"
+#include "services/runtimeService.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/exceptions.hpp"
 
 HS_DTRACE_PROBE_DECL(hs_private, safepoint__begin);
 HS_DTRACE_PROBE_DECL(hs_private, safepoint__end);
--- a/src/share/vm/services/runtimeService.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/runtimeService.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_RUNTIMESERVICE_HPP
+#define SHARE_VM_SERVICES_RUNTIMESERVICE_HPP
+
+#include "runtime/perfData.hpp"
+#include "runtime/timer.hpp"
+
 class RuntimeService : public AllStatic {
 private:
   static PerfCounter* _sync_time_ticks;        // Accumulated time spent getting to safepoints
@@ -57,3 +63,5 @@
   static void record_interrupted_during_count();
   static void record_thread_interrupt_signaled_count();
 };
+
+#endif // SHARE_VM_SERVICES_RUNTIMESERVICE_HPP
--- a/src/share/vm/services/serviceUtil.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/serviceUtil.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_SERVICEUTIL_HPP
+#define SHARE_VM_SERVICES_SERVICEUTIL_HPP
+
+#include "classfile/systemDictionary.hpp"
+#include "oops/objArrayOop.hpp"
+
 //
 // Serviceability utility functions.
 // (Shared by MM and JVMTI).
@@ -87,3 +93,5 @@
   };   // end of visible_oop()
 
 };
+
+#endif // SHARE_VM_SERVICES_SERVICEUTIL_HPP
--- a/src/share/vm/services/threadService.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/threadService.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,20 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_threadService.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/allocation.hpp"
+#include "memory/heapInspection.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vframe.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "services/threadService.hpp"
 
 // TODO: we need to define a naming convention for perf counters
 // to distinguish counters for:
--- a/src/share/vm/services/threadService.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/services/threadService.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,19 @@
  *
  */
 
+#ifndef SHARE_VM_SERVICES_THREADSERVICE_HPP
+#define SHARE_VM_SERVICES_THREADSERVICE_HPP
+
+#include "classfile/javaClasses.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/init.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/objectMonitor.inline.hpp"
+#include "runtime/perfData.hpp"
+#include "services/management.hpp"
+#include "services/serviceUtil.hpp"
+
 class OopClosure;
 class ThreadDumpResult;
 class ThreadStackTrace;
@@ -563,3 +576,5 @@
     }
   }
 };
+
+#endif // SHARE_VM_SERVICES_THREADSERVICE_HPP
--- a/src/share/vm/shark/llvmHeaders.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/llvmHeaders.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,9 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_LLVMHEADERS_HPP
+#define SHARE_VM_SHARK_LLVMHEADERS_HPP
+
 #ifdef assert
   #undef assert
 #endif
@@ -93,3 +96,5 @@
   #define DEBUG
   #undef SHARK_DEBUG
 #endif
+
+#endif // SHARE_VM_SHARK_LLVMHEADERS_HPP
--- a/src/share/vm/shark/llvmValue.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/llvmValue.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,13 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_LLVMVALUE_HPP
+#define SHARE_VM_SHARK_LLVMVALUE_HPP
+
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkContext.hpp"
+#include "shark/sharkType.hpp"
+
 class LLVMValue : public AllStatic {
  public:
   static llvm::ConstantInt* jbyte_constant(jbyte value)
@@ -60,3 +67,5 @@
     return llvm::ConstantInt::get(SharkType::intptr_type(), value, false);
   }
 };
+
+#endif // SHARE_VM_SHARK_LLVMVALUE_HPP
--- a/src/share/vm/shark/sharkBlock.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkBlock.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,17 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkBlock.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkBlock.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkConstant.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkValue.hpp"
+#include "shark/shark_globals.hpp"
+#include "utilities/debug.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkBlock.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkBlock.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,20 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKBLOCK_HPP
+#define SHARE_VM_SHARK_SHARKBLOCK_HPP
+
+#include "ci/ciMethod.hpp"
+#include "ci/ciStreams.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkConstant.hpp"
+#include "shark/sharkInvariants.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkValue.hpp"
+#include "utilities/debug.hpp"
+
 class SharkState;
 
 class SharkBlock : public SharkTargetInvariants {
@@ -279,3 +293,5 @@
   virtual void do_monitorenter();
   virtual void do_monitorexit();
 };
+
+#endif // SHARE_VM_SHARK_SHARKBLOCK_HPP
--- a/src/share/vm/shark/sharkBuilder.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkBuilder.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkBuilder.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethod.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/os.hpp"
+#include "runtime/synchronizer.hpp"
+#include "runtime/thread.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkContext.hpp"
+#include "shark/sharkRuntime.hpp"
+#include "utilities/debug.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkBuilder.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkBuilder.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,21 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKBUILDER_HPP
+#define SHARE_VM_SHARK_SHARKBUILDER_HPP
+
+#include "ci/ciType.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkCodeBuffer.hpp"
+#include "shark/sharkEntry.hpp"
+#include "shark/sharkType.hpp"
+#include "shark/sharkValue.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/sizes.hpp"
+
 class SharkBuilder : public llvm::IRBuilder<> {
   friend class SharkCompileInvariants;
 
@@ -207,3 +222,5 @@
   llvm::BasicBlock* CreateBlock(llvm::BasicBlock* ip,
                                 const char*       name="") const;
 };
+
+#endif // SHARE_VM_SHARK_SHARKBUILDER_HPP
--- a/src/share/vm/shark/sharkCacheDecache.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkCacheDecache.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,14 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkCacheDecache.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethod.hpp"
+#include "code/debugInfoRec.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkCacheDecache.hpp"
+#include "shark/sharkFunction.hpp"
+#include "shark/sharkState.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkCacheDecache.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkCacheDecache.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,15 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKCACHEDECACHE_HPP
+#define SHARE_VM_SHARK_SHARKCACHEDECACHE_HPP
+
+#include "ci/ciMethod.hpp"
+#include "code/debugInfoRec.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkFunction.hpp"
+#include "shark/sharkStateScanner.hpp"
+
 // Class hierarchy:
 // - SharkStateScanner
 //   - SharkCacherDecacher
@@ -415,3 +424,5 @@
  private:
   llvm::Value* CreateAddressOfOSRBufEntry(int offset, const llvm::Type* type);
 };
+
+#endif // SHARE_VM_SHARK_SHARKCACHEDECACHE_HPP
--- a/src/share/vm/shark/sharkCodeBuffer.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkCodeBuffer.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,13 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKCODEBUFFER_HPP
+#define SHARE_VM_SHARK_SHARKCODEBUFFER_HPP
+
+#include "asm/codeBuffer.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+
 class SharkCodeBuffer : public StackObj {
  public:
   SharkCodeBuffer(MacroAssembler* masm)
@@ -85,3 +92,5 @@
     return offset;
   }
 };
+
+#endif // SHARE_VM_SHARK_SHARKCODEBUFFER_HPP
--- a/src/share/vm/shark/sharkCompiler.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkCompiler.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,26 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkCompiler.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciEnv.hpp"
+#include "ci/ciMethod.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/dependencies.hpp"
+#include "code/exceptionHandlerTable.hpp"
+#include "code/oopRecorder.hpp"
+#include "compiler/abstractCompiler.hpp"
+#include "compiler/oopMap.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkCodeBuffer.hpp"
+#include "shark/sharkCompiler.hpp"
+#include "shark/sharkContext.hpp"
+#include "shark/sharkEntry.hpp"
+#include "shark/sharkFunction.hpp"
+#include "shark/sharkMemoryManager.hpp"
+#include "shark/sharkNativeWrapper.hpp"
+#include "shark/shark_globals.hpp"
+#include "utilities/debug.hpp"
 
 #include <fnmatch.h>
 
--- a/src/share/vm/shark/sharkCompiler.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkCompiler.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,16 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKCOMPILER_HPP
+#define SHARE_VM_SHARK_SHARKCOMPILER_HPP
+
+#include "ci/ciEnv.hpp"
+#include "ci/ciMethod.hpp"
+#include "compiler/abstractCompiler.hpp"
+#include "compiler/compileBroker.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkMemoryManager.hpp"
+
 class SharkContext;
 
 class SharkCompiler : public AbstractCompiler {
@@ -116,3 +126,5 @@
                             const char*     name);
   void free_queued_methods();
 };
+
+#endif // SHARE_VM_SHARK_SHARKCOMPILER_HPP
--- a/src/share/vm/shark/sharkConstant.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkConstant.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkConstant.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciStreams.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkConstant.hpp"
+#include "shark/sharkValue.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkConstant.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkConstant.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,14 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKCONSTANT_HPP
+#define SHARE_VM_SHARK_SHARKCONSTANT_HPP
+
+#include "ci/ciStreams.hpp"
+#include "memory/allocation.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkValue.hpp"
+
 class SharkConstant : public ResourceObj {
  public:
   static SharkConstant* for_ldc(ciBytecodeStream* iter);
@@ -62,3 +70,5 @@
     return _value;
   }
 };
+
+#endif // SHARE_VM_SHARK_SHARKCONSTANT_HPP
--- a/src/share/vm/shark/sharkContext.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkContext.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkContext.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/oop.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkContext.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkContext.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkContext.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKCONTEXT_HPP
+#define SHARE_VM_SHARK_SHARKCONTEXT_HPP
+
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkCompiler.hpp"
+
 // 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.
@@ -185,3 +191,5 @@
   void push_to_free_queue(llvm::Function* function);
   llvm::Function* pop_from_free_queue();
 };
+
+#endif // SHARE_VM_SHARK_SHARKCONTEXT_HPP
--- a/src/share/vm/shark/sharkEntry.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkEntry.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,11 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKENTRY_HPP
+#define SHARE_VM_SHARK_SHARKENTRY_HPP
+
+#include "shark/llvmHeaders.hpp"
+
 class SharkContext;
 
 class SharkEntry : public ZeroEntry {
@@ -56,3 +61,5 @@
     _function = function;
   }
 };
+
+#endif // SHARE_VM_SHARK_SHARKENTRY_HPP
--- a/src/share/vm/shark/sharkFunction.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkFunction.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,18 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkFunction.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkEntry.hpp"
+#include "shark/sharkFunction.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkTopLevelBlock.hpp"
+#include "shark/shark_globals.hpp"
+#include "utilities/debug.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkFunction.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkFunction.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,20 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKFUNCTION_HPP
+#define SHARE_VM_SHARK_SHARKFUNCTION_HPP
+
+#include "ci/ciEnv.hpp"
+#include "ci/ciStreams.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkContext.hpp"
+#include "shark/sharkInvariants.hpp"
+#include "shark/sharkStack.hpp"
+
 class SharkTopLevelBlock;
 class DeferredZeroCheck;
 
@@ -109,3 +123,5 @@
  private:
   void do_deferred_zero_checks();
 };
+
+#endif // SHARE_VM_SHARK_SHARKFUNCTION_HPP
--- a/src/share/vm/shark/sharkInliner.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkInliner.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,19 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkInliner.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciStreams.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+#include "shark/sharkBlock.hpp"
+#include "shark/sharkConstant.hpp"
+#include "shark/sharkInliner.hpp"
+#include "shark/sharkIntrinsics.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkValue.hpp"
+#include "shark/shark_globals.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkInliner.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkInliner.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,14 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKINLINER_HPP
+#define SHARE_VM_SHARK_SHARKINLINER_HPP
+
+#include "ci/ciMethod.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkState.hpp"
+
 class SharkInliner : public AllStatic {
  public:
   static bool attempt_inline(ciMethod* target, SharkState* state);
@@ -30,3 +38,5 @@
  private:
   static bool may_be_inlinable(ciMethod* target);
 };
+
+#endif // SHARE_VM_SHARK_SHARKINLINER_HPP
--- a/src/share/vm/shark/sharkIntrinsics.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkIntrinsics.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,13 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkIntrinsics.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciMethod.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkIntrinsics.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkValue.hpp"
+#include "shark/shark_globals.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkIntrinsics.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkIntrinsics.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,14 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKINTRINSICS_HPP
+#define SHARE_VM_SHARK_SHARKINTRINSICS_HPP
+
+#include "ci/ciMethod.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkState.hpp"
+
 class SharkIntrinsics : public SharkTargetInvariants {
  public:
   static bool is_intrinsic(ciMethod* target);
@@ -52,3 +60,5 @@
   void do_Thread_currentThread();
   void do_Unsafe_compareAndSwapInt();
 };
+
+#endif // SHARE_VM_SHARK_SHARKINTRINSICS_HPP
--- a/src/share/vm/shark/sharkInvariants.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkInvariants.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,8 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkInvariants.cpp.incl"
+#include "precompiled.hpp"
+#include "shark/sharkInvariants.hpp"
 
 int SharkTargetInvariants::count_monitors() {
   int result = 0;
--- a/src/share/vm/shark/sharkInvariants.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkInvariants.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,19 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKINVARIANTS_HPP
+#define SHARE_VM_SHARK_SHARKINVARIANTS_HPP
+
+#include "ci/ciEnv.hpp"
+#include "ci/ciInstanceKlass.hpp"
+#include "ci/ciMethod.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/dependencies.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkBuilder.hpp"
+
 // 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
@@ -165,3 +178,5 @@
     return target()->is_synchronized();
   }
 };
+
+#endif // SHARE_VM_SHARK_SHARKINVARIANTS_HPP
--- a/src/share/vm/shark/sharkMemoryManager.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkMemoryManager.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkMemoryManager.cpp.incl"
+#include "precompiled.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkEntry.hpp"
+#include "shark/sharkMemoryManager.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkMemoryManager.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkMemoryManager.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,12 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKMEMORYMANAGER_HPP
+#define SHARE_VM_SHARK_SHARKMEMORYMANAGER_HPP
+
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkEntry.hpp"
+
 // 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.
@@ -86,3 +92,5 @@
   unsigned char *allocateSpace(intptr_t Size,
                                unsigned int Alignment);
 };
+
+#endif // SHARE_VM_SHARK_SHARKMEMORYMANAGER_HPP
--- a/src/share/vm/shark/sharkNativeWrapper.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkNativeWrapper.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,10 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkNativeWrapper.cpp.incl"
+#include "precompiled.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkNativeWrapper.hpp"
+#include "shark/sharkType.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkNativeWrapper.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkNativeWrapper.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,16 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKNATIVEWRAPPER_HPP
+#define SHARE_VM_SHARK_SHARKNATIVEWRAPPER_HPP
+
+#include "runtime/handles.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkContext.hpp"
+#include "shark/sharkInvariants.hpp"
+#include "shark/sharkStack.hpp"
+
 class SharkNativeWrapper : public SharkCompileInvariants {
   friend class SharkStackWithNativeFrame;
 
@@ -180,3 +190,5 @@
       pending_exception_address(), "pending_exception");
   }
 };
+
+#endif // SHARE_VM_SHARK_SHARKNATIVEWRAPPER_HPP
--- a/src/share/vm/shark/sharkRuntime.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkRuntime.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkRuntime.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/klassOop.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/thread.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkRuntime.hpp"
+#ifdef TARGET_ARCH_zero
+# include "stack_zero.inline.hpp"
+#endif
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkRuntime.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkRuntime.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,15 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKRUNTIME_HPP
+#define SHARE_VM_SHARK_SHARKRUNTIME_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/klassOop.hpp"
+#include "runtime/thread.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+
 class SharkRuntime : public AllStatic {
   // VM calls
  public:
@@ -81,3 +90,5 @@
   static bool is_subtype_of(klassOop check_klass, klassOop object_klass);
   static int uncommon_trap(JavaThread* thread, int trap_request);
 };
+
+#endif // SHARE_VM_SHARK_SHARKRUNTIME_HPP
--- a/src/share/vm/shark/sharkStack.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkStack.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkStack.cpp.incl"
+#include "precompiled.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkFunction.hpp"
+#include "shark/sharkNativeWrapper.hpp"
+#include "shark/sharkStack.hpp"
+#include "shark/sharkType.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkStack.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkStack.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,13 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKSTACK_HPP
+#define SHARE_VM_SHARK_SHARKSTACK_HPP
+
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkInvariants.hpp"
+#include "shark/sharkType.hpp"
+
 class SharkFunction;
 class SharkNativeWrapper;
 class SharkStackWithNormalFrame;
@@ -288,3 +295,5 @@
  private:
   address interpreter_entry_point() const;
 };
+
+#endif // SHARE_VM_SHARK_SHARKSTACK_HPP
--- a/src/share/vm/shark/sharkState.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkState.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkState.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciType.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "memory/allocation.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkCacheDecache.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkTopLevelBlock.hpp"
+#include "shark/sharkType.hpp"
+#include "shark/sharkValue.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkState.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkState.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,16 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKSTATE_HPP
+#define SHARE_VM_SHARK_SHARKSTATE_HPP
+
+#include "ci/ciMethod.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkInvariants.hpp"
+#include "shark/sharkValue.hpp"
+
 class SharkState : public SharkTargetInvariants {
  public:
   SharkState(const SharkTargetInvariants* parent)
@@ -186,3 +196,5 @@
  public:
   void add_incoming(SharkState* incoming_state);
 };
+
+#endif // SHARE_VM_SHARK_SHARKSTATE_HPP
--- a/src/share/vm/shark/sharkStateScanner.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkStateScanner.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkStateScanner.cpp.incl"
+#include "precompiled.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkStateScanner.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkStateScanner.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkStateScanner.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,14 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKSTATESCANNER_HPP
+#define SHARE_VM_SHARK_SHARKSTATESCANNER_HPP
+
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkFunction.hpp"
+#include "shark/sharkInvariants.hpp"
+
 class SharkState;
 
 class SharkStateScanner : public SharkTargetInvariants {
@@ -73,3 +81,5 @@
   void stack_integrity_checks(SharkState* state) PRODUCT_RETURN;
   void locals_integrity_checks(SharkState* state) PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_SHARK_SHARKSTATESCANNER_HPP
--- a/src/share/vm/shark/sharkTopLevelBlock.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkTopLevelBlock.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,27 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkTopLevelBlock.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciField.hpp"
+#include "ci/ciInstance.hpp"
+#include "ci/ciObjArrayKlass.hpp"
+#include "ci/ciStreams.hpp"
+#include "ci/ciType.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/deoptimization.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkCacheDecache.hpp"
+#include "shark/sharkConstant.hpp"
+#include "shark/sharkInliner.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkTopLevelBlock.hpp"
+#include "shark/sharkValue.hpp"
+#include "shark/shark_globals.hpp"
+#include "utilities/debug.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkTopLevelBlock.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkTopLevelBlock.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,21 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKTOPLEVELBLOCK_HPP
+#define SHARE_VM_SHARK_SHARKTOPLEVELBLOCK_HPP
+
+#include "ci/ciStreams.hpp"
+#include "ci/ciType.hpp"
+#include "ci/ciTypeFlow.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkBlock.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkFunction.hpp"
+#include "shark/sharkState.hpp"
+#include "shark/sharkValue.hpp"
+
 class SharkTopLevelBlock : public SharkBlock {
  public:
   SharkTopLevelBlock(SharkFunction* function, ciTypeFlow::Block* ciblock)
@@ -428,3 +443,5 @@
   void do_monitorenter();
   void do_monitorexit();
 };
+
+#endif // SHARE_VM_SHARK_SHARKTOPLEVELBLOCK_HPP
--- a/src/share/vm/shark/sharkType.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkType.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,15 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKTYPE_HPP
+#define SHARE_VM_SHARK_SHARKTYPE_HPP
+
+#include "ci/ciType.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/sharkContext.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 class SharkType : public AllStatic {
  private:
   static SharkContext& context() {
@@ -110,3 +119,5 @@
     return to_arrayType(type->basic_type());
   }
 };
+
+#endif // SHARE_VM_SHARK_SHARKTYPE_HPP
--- a/src/share/vm/shark/sharkValue.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkValue.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,8 +23,12 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_sharkValue.cpp.incl"
+#include "precompiled.hpp"
+#include "ci/ciType.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkBuilder.hpp"
+#include "shark/sharkValue.hpp"
 
 using namespace llvm;
 
--- a/src/share/vm/shark/sharkValue.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/sharkValue.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,15 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARKVALUE_HPP
+#define SHARE_VM_SHARK_SHARKVALUE_HPP
+
+#include "ci/ciType.hpp"
+#include "memory/allocation.hpp"
+#include "shark/llvmHeaders.hpp"
+#include "shark/llvmValue.hpp"
+#include "shark/sharkType.hpp"
+
 // Items on the stack and in local variables are tracked using
 // SharkValue objects.
 //
@@ -330,3 +339,5 @@
 inline SharkValue* SharkValue::address_constant(int bci) {
   return new SharkAddressValue(bci);
 }
+
+#endif // SHARE_VM_SHARK_SHARKVALUE_HPP
--- a/src/share/vm/shark/shark_globals.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/shark_globals.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,7 +23,7 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_shark_globals.cpp.incl"
+#include "precompiled.hpp"
+#include "shark/shark_globals.hpp"
 
 SHARK_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
--- a/src/share/vm/shark/shark_globals.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/shark/shark_globals.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,6 +23,14 @@
  *
  */
 
+#ifndef SHARE_VM_SHARK_SHARK_GLOBALS_HPP
+#define SHARE_VM_SHARK_SHARK_GLOBALS_HPP
+
+#include "runtime/globals.hpp"
+#ifdef TARGET_ARCH_zero
+# include "shark_globals_zero.hpp"
+#endif
+
 #define SHARK_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
                                                                               \
   product(intx, MaxNodeLimit, 65000,                                          \
@@ -52,3 +60,5 @@
           "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)
+
+#endif // SHARE_VM_SHARK_SHARK_GLOBALS_HPP
--- a/src/share/vm/utilities/accessFlags.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/accessFlags.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_accessFlags.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "utilities/accessFlags.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 
 void AccessFlags::atomic_set_bits(jint bits) {
--- a/src/share/vm/utilities/accessFlags.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/accessFlags.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_ACCESSFLAGS_HPP
+#define SHARE_VM_UTILITIES_ACCESSFLAGS_HPP
+
+#include "prims/jvm.h"
+#include "utilities/top.hpp"
+
 // AccessFlags is an abstraction over Java access flags.
 
 
@@ -226,3 +232,5 @@
   af._flags = flags;
   return af;
 }
+
+#endif // SHARE_VM_UTILITIES_ACCESSFLAGS_HPP
--- a/src/share/vm/utilities/array.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/array.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,18 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_array.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/resourceArea.hpp"
+#include "utilities/array.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 #ifdef ASSERT
--- a/src/share/vm/utilities/array.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/array.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_ARRAY_HPP
+#define SHARE_VM_UTILITIES_ARRAY_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+
 // correct linkage required to compile w/o warnings
 // (must be on file level - cannot be local)
 extern "C" { typedef int (*ftype)(const void*, const void*); }
@@ -285,3 +291,5 @@
 
 define_array(boolArray, bool)          define_stack(boolStack, boolArray)
 define_array(intArray , int )          define_stack(intStack , intArray )
+
+#endif // SHARE_VM_UTILITIES_ARRAY_HPP
--- a/src/share/vm/utilities/bitMap.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/bitMap.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,19 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_bitMap.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "utilities/bitMap.inline.hpp"
+#include "utilities/copy.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 
 BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
--- a/src/share/vm/utilities/bitMap.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/bitMap.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_BITMAP_HPP
+#define SHARE_VM_UTILITIES_BITMAP_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/top.hpp"
+
 // Forward decl;
 class BitMapClosure;
 
@@ -365,3 +371,5 @@
   // return of false indicates that the bitmap iteration should terminate.
   virtual bool do_bit(BitMap::idx_t offset) = 0;
 };
+
+#endif // SHARE_VM_UTILITIES_BITMAP_HPP
--- a/src/share/vm/utilities/bitMap.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/bitMap.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
+#define SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "utilities/bitMap.hpp"
+
 #ifdef ASSERT
 inline void BitMap::verify_index(idx_t index) const {
   assert(index < _size, "BitMap index out of bounds");
@@ -319,3 +325,5 @@
 inline void BitMap2D::clear() {
   _map.clear();
 }
+
+#endif // SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
--- a/src/share/vm/utilities/constantTag.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/constantTag.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_constantTag.cpp.incl"
+#include "precompiled.hpp"
+#include "utilities/constantTag.hpp"
 
 #ifndef PRODUCT
 
@@ -93,6 +93,8 @@
       return "MethodType";
     case JVM_CONSTANT_InvokeDynamic :
       return "InvokeDynamic";
+    case JVM_CONSTANT_InvokeDynamicTrans :
+      return "InvokeDynamic/transitional";
     case JVM_CONSTANT_Object :
       return "Object";
     case JVM_CONSTANT_Utf8 :
--- a/src/share/vm/utilities/constantTag.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/constantTag.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_CONSTANTTAG_HPP
+#define SHARE_VM_UTILITIES_CONSTANTTAG_HPP
+
+#include "prims/jvm.h"
+#include "utilities/top.hpp"
+
 // constant tags in Java .class files
 
 
@@ -80,7 +86,8 @@
 
   bool is_method_type() const              { return _tag == JVM_CONSTANT_MethodType; }
   bool is_method_handle() const            { return _tag == JVM_CONSTANT_MethodHandle; }
-  bool is_invoke_dynamic() const           { return _tag == JVM_CONSTANT_InvokeDynamic; }
+  bool is_invoke_dynamic() const           { return (_tag == JVM_CONSTANT_InvokeDynamic ||
+                                                     _tag == JVM_CONSTANT_InvokeDynamicTrans); }
 
   bool is_loadable_constant() const {
     return ((_tag >= JVM_CONSTANT_Integer && _tag <= JVM_CONSTANT_String) ||
@@ -107,3 +114,5 @@
 
   void print_on(outputStream* st) const PRODUCT_RETURN;
 };
+
+#endif // SHARE_VM_UTILITIES_CONSTANTTAG_HPP
--- a/src/share/vm/utilities/copy.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/copy.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_copy.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "utilities/copy.hpp"
 
 
 // Copy bytes; larger units are filled atomically if everything is aligned.
--- a/src/share/vm/utilities/copy.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/copy.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_COPY_HPP
+#define SHARE_VM_UTILITIES_COPY_HPP
+
+#include "runtime/stubRoutines.hpp"
+
 // Assembly code for platforms that need it.
 extern "C" {
   void _Copy_conjoint_words(HeapWord* from, HeapWord* to, size_t count);
@@ -317,5 +322,16 @@
   }
 
   // Platform dependent implementations of the above methods.
-  #include "incls/_copy_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "copy_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "copy_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "copy_zero.hpp"
+#endif
+
 };
+
+#endif // SHARE_VM_UTILITIES_COPY_HPP
--- a/src/share/vm/utilities/debug.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/debug.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,46 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_debug.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "code/icBuffer.hpp"
+#include "code/nmethod.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "compiler/disassembler.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "interpreter/bytecodeHistogram.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/privilegedStack.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/java.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframe.hpp"
+#include "services/heapDumper.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#include "utilities/top.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+# include "thread_windows.inline.hpp"
+#endif
 
 #ifndef ASSERT
 #  ifdef _DEBUG
@@ -361,8 +399,14 @@
 extern "C" void disnm(intptr_t p) {
   Command c("disnm");
   CodeBlob* cb = CodeCache::find_blob((address) p);
-  cb->print();
-  Disassembler::decode(cb);
+  nmethod* nm = cb->as_nmethod_or_null();
+  if (nm) {
+    nm->print();
+    Disassembler::decode(nm);
+  } else {
+    cb->print();
+    Disassembler::decode(cb);
+  }
 }
 
 
--- a/src/share/vm/utilities/debug.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/debug.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_DEBUG_HPP
+#define SHARE_VM_UTILITIES_DEBUG_HPP
+
+#include "utilities/globalDefinitions.hpp"
+
 #include <stdarg.h>
 
 // Simple class to format the ctor arguments into a fixed-sized buffer.
@@ -169,3 +174,5 @@
 
 void pd_ps(frame f);
 void pd_obfuscate_location(char *buf, size_t buflen);
+
+#endif // SHARE_VM_UTILITIES_DEBUG_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/decoder.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "utilities/decoder.hpp"
+
+Decoder::decoder_status  Decoder::_decoder_status = Decoder::no_error;
+bool                     Decoder::_initialized = false;
+
+#ifndef _WINDOWS
+
+// Implementation of common functionalities among Solaris and Linux
+#include "utilities/elfFile.hpp"
+
+ElfFile* Decoder::_opened_elf_files = NULL;
+
+bool Decoder::can_decode_C_frame_in_vm() {
+  return true;
+}
+
+void Decoder::initialize() {
+  _initialized = true;
+}
+
+void Decoder::uninitialize() {
+  if (_opened_elf_files != NULL) {
+    delete _opened_elf_files;
+    _opened_elf_files = NULL;
+  }
+  _initialized = false;
+}
+
+Decoder::decoder_status Decoder::decode(address addr, const char* filepath, char *buf, int buflen, int *offset) {
+  if (_decoder_status != no_error) {
+    return _decoder_status;
+  }
+
+  ElfFile* file = get_elf_file(filepath);
+  if (_decoder_status != no_error) {
+    return _decoder_status;
+  }
+
+  const char* symbol = file->decode(addr, offset);
+  if (file->get_status() == out_of_memory) {
+    _decoder_status = out_of_memory;
+    return _decoder_status;
+  } else if (symbol != NULL) {
+    if (!demangle(symbol, buf, buflen)) {
+      jio_snprintf(buf, buflen, "%s", symbol);
+    }
+    return no_error;
+  } else {
+    return symbol_not_found;
+  }
+}
+
+ElfFile* Decoder::get_elf_file(const char* filepath) {
+  if (_decoder_status != no_error) {
+    return NULL;
+  }
+  ElfFile* file = _opened_elf_files;
+  while (file != NULL) {
+    if (file->same_elf_file(filepath)) {
+      return file;
+    }
+    file = file->m_next;
+  }
+
+  file = new ElfFile(filepath);
+  if (file == NULL) {
+    _decoder_status = out_of_memory;
+  }
+  if (_opened_elf_files != NULL) {
+    file->m_next = _opened_elf_files;
+  }
+
+  _opened_elf_files = file;
+  return file;
+}
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/decoder.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+
+#ifndef __DECODER_HPP
+#define __DECODER_HPP
+
+#include "memory/allocation.hpp"
+
+#ifdef _WINDOWS
+#include <windows.h>
+#include <imagehlp.h>
+
+// functions needed for decoding symbols
+typedef DWORD (WINAPI *pfn_SymSetOptions)(DWORD);
+typedef BOOL  (WINAPI *pfn_SymInitialize)(HANDLE, PCTSTR, BOOL);
+typedef BOOL  (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
+typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD);
+
+#else
+
+class ElfFile;
+
+#endif // _WINDOWS
+
+
+class Decoder: public StackObj {
+
+ public:
+  // status code for decoding native C frame
+  enum decoder_status {
+         no_error,             // successfully decoded frames
+         out_of_memory,        // out of memory
+         file_invalid,         // invalid elf file
+         file_not_found,       // could not found symbol file (on windows), such as jvm.pdb or jvm.map
+         helper_not_found,     // could not load dbghelp.dll (Windows only)
+         helper_func_error,    // decoding functions not found (Windows only)
+         helper_init_error,    // SymInitialize failed (Windows only)
+         symbol_not_found      // could not find the symbol
+  };
+
+ public:
+  Decoder() { initialize(); };
+  ~Decoder() { uninitialize(); };
+
+  static bool can_decode_C_frame_in_vm();
+
+  static void initialize();
+  static void uninitialize();
+
+#ifdef _WINDOWS
+  static decoder_status    decode(address addr, char *buf, int buflen, int *offset);
+#else
+  static decoder_status    decode(address addr, const char* filepath, char *buf, int buflen, int *offset);
+#endif
+
+  static bool              demangle(const char* symbol, char *buf, int buflen);
+
+  static decoder_status    get_status() { return _decoder_status; };
+
+#ifndef _WINDOWS
+ private:
+  static ElfFile*         get_elf_file(const char* filepath);
+#endif // _WINDOWS
+
+
+ private:
+  static decoder_status     _decoder_status;
+  static bool               _initialized;
+
+#ifdef _WINDOWS
+  static HMODULE                   _dbghelp_handle;
+  static bool                      _can_decode_in_vm;
+  static pfn_SymGetSymFromAddr64   _pfnSymGetSymFromAddr64;
+  static pfn_UndecorateSymbolName  _pfnUndecorateSymbolName;
+#else
+  static ElfFile*                  _opened_elf_files;
+#endif // _WINDOWS
+};
+
+#endif // __DECODER_HPP
--- a/src/share/vm/utilities/defaultStream.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/defaultStream.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_DEFAULTSTREAM_HPP
+#define SHARE_VM_UTILITIES_DEFAULTSTREAM_HPP
+
+#include "utilities/xmlstream.hpp"
+
 class defaultStream : public xmlTextStream {
   friend void ostream_abort();
  public:
@@ -88,3 +93,5 @@
 
   static defaultStream* instance;  // sole instance
 };
+
+#endif // SHARE_VM_UTILITIES_DEFAULTSTREAM_HPP
--- a/src/share/vm/utilities/dtrace.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/dtrace.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_DTRACE_HPP
+#define SHARE_VM_UTILITIES_DTRACE_HPP
+
 #if defined(SOLARIS) && defined(DTRACE_ENABLED)
 
 #include <sys/sdt.h>
@@ -129,3 +132,5 @@
   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))
+
+#endif // SHARE_VM_UTILITIES_DTRACE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/elfFile.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+
+#ifndef _WINDOWS
+
+#include <string.h>
+#include <stdio.h>
+#include <limits.h>
+
+#include "memory/allocation.inline.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/elfFile.hpp"
+#include "utilities/elfStringTable.hpp"
+#include "utilities/elfSymbolTable.hpp"
+
+
+ElfFile::ElfFile(const char* filepath) {
+  assert(filepath, "null file path");
+  memset(&m_elfHdr, 0, sizeof(m_elfHdr));
+  m_string_tables = NULL;
+  m_symbol_tables = NULL;
+  m_next = NULL;
+  m_status = Decoder::no_error;
+
+  int len = strlen(filepath) + 1;
+  m_filepath = NEW_C_HEAP_ARRAY(char, len);
+  if (m_filepath != NULL) {
+    strcpy((char*)m_filepath, filepath);
+    m_file = fopen(filepath, "r");
+    if (m_file != NULL) {
+      load_tables();
+    } else {
+      m_status = Decoder::file_not_found;
+    }
+  } else {
+    m_status = Decoder::out_of_memory;
+  }
+}
+
+ElfFile::~ElfFile() {
+  if (m_string_tables != NULL) {
+    delete m_string_tables;
+  }
+
+  if (m_symbol_tables != NULL) {
+    delete m_symbol_tables;
+  }
+
+  if (m_file != NULL) {
+    fclose(m_file);
+  }
+
+  if (m_filepath != NULL) {
+    FREE_C_HEAP_ARRAY(char, m_filepath);
+  }
+
+  if (m_next != NULL) {
+    delete m_next;
+  }
+};
+
+
+//Check elf header to ensure the file is valid.
+bool ElfFile::is_elf_file(Elf_Ehdr& hdr) {
+  return (ELFMAG0 == hdr.e_ident[EI_MAG0] &&
+      ELFMAG1 == hdr.e_ident[EI_MAG1] &&
+      ELFMAG2 == hdr.e_ident[EI_MAG2] &&
+      ELFMAG3 == hdr.e_ident[EI_MAG3] &&
+      ELFCLASSNONE != hdr.e_ident[EI_CLASS] &&
+      ELFDATANONE != hdr.e_ident[EI_DATA]);
+}
+
+bool ElfFile::load_tables() {
+  assert(m_file, "file not open");
+  assert(m_status == Decoder::no_error, "already in error");
+
+  // read elf file header
+  if (fread(&m_elfHdr, sizeof(m_elfHdr), 1, m_file) != 1) {
+    m_status = Decoder::file_invalid;
+    return false;
+  }
+
+  if (!is_elf_file(m_elfHdr)) {
+    m_status = Decoder::file_invalid;
+    return false;
+  }
+
+  // walk elf file's section headers, and load string tables
+  Elf_Shdr shdr;
+  if (!fseek(m_file, m_elfHdr.e_shoff, SEEK_SET)) {
+    if (m_status != Decoder::no_error) return false;
+
+    for (int index = 0; index < m_elfHdr.e_shnum; index ++) {
+      if (fread((void*)&shdr, sizeof(Elf_Shdr), 1, m_file) != 1) {
+        m_status = Decoder::file_invalid;
+        return false;
+      }
+      // string table
+      if (shdr.sh_type == SHT_STRTAB) {
+        ElfStringTable* table = new ElfStringTable(m_file, shdr, index);
+        if (table == NULL) {
+          m_status = Decoder::out_of_memory;
+          return false;
+        }
+        add_string_table(table);
+      } else if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) {
+        ElfSymbolTable* table = new ElfSymbolTable(m_file, shdr);
+        if (table == NULL) {
+          m_status = Decoder::out_of_memory;
+          return false;
+        }
+        add_symbol_table(table);
+      }
+    }
+  }
+  return true;
+}
+
+const char* ElfFile::decode(address addr, int* offset) {
+  // something already went wrong, just give up
+  if (m_status != Decoder::no_error) {
+    return NULL;
+  }
+
+  ElfSymbolTable* symbol_table = m_symbol_tables;
+  int string_table_index;
+  int pos_in_string_table;
+  int off = INT_MAX;
+  bool found_symbol = false;
+  while (symbol_table != NULL) {
+    if (Decoder::no_error == symbol_table->lookup(addr, &string_table_index, &pos_in_string_table, &off)) {
+      found_symbol = true;
+    }
+    symbol_table = symbol_table->m_next;
+  }
+  if (!found_symbol) return NULL;
+
+  ElfStringTable* string_table = get_string_table(string_table_index);
+  if (string_table == NULL) {
+    m_status = Decoder::file_invalid;
+    return NULL;
+  }
+  if (offset) *offset = off;
+  return string_table->string_at(pos_in_string_table);
+}
+
+
+void ElfFile::add_symbol_table(ElfSymbolTable* table) {
+  if (m_symbol_tables == NULL) {
+    m_symbol_tables = table;
+  } else {
+    table->m_next = m_symbol_tables;
+    m_symbol_tables = table;
+  }
+}
+
+void ElfFile::add_string_table(ElfStringTable* table) {
+  if (m_string_tables == NULL) {
+    m_string_tables = table;
+  } else {
+    table->m_next = m_string_tables;
+    m_string_tables = table;
+  }
+}
+
+ElfStringTable* ElfFile::get_string_table(int index) {
+  ElfStringTable* p = m_string_tables;
+  while (p != NULL) {
+    if (p->index() == index) return p;
+    p = p->m_next;
+  }
+  return NULL;
+}
+
+#endif // _WINDOWS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/elfFile.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef __ELF_FILE_HPP
+#define __ELF_FILE_HPP
+
+#ifndef _WINDOWS
+
+#include <elf.h>
+#include <stdio.h>
+
+#ifdef _LP64
+
+typedef Elf64_Half      Elf_Half;
+typedef Elf64_Word      Elf_Word;
+typedef Elf64_Off       Elf_Off;
+typedef Elf64_Addr      Elf_Addr;
+
+typedef Elf64_Ehdr      Elf_Ehdr;
+typedef Elf64_Shdr      Elf_Shdr;
+typedef Elf64_Sym       Elf_Sym;
+
+#define ELF_ST_TYPE ELF64_ST_TYPE
+
+#else
+
+typedef Elf32_Half      Elf_Half;
+typedef Elf32_Word      Elf_Word;
+typedef Elf32_Off       Elf_Off;
+typedef Elf32_Addr      Elf_Addr;
+
+
+typedef Elf32_Ehdr      Elf_Ehdr;
+typedef Elf32_Shdr      Elf_Shdr;
+typedef Elf32_Sym       Elf_Sym;
+
+#define ELF_ST_TYPE ELF32_ST_TYPE
+#endif
+
+#include "globalDefinitions.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/decoder.hpp"
+
+
+class ElfStringTable;
+class ElfSymbolTable;
+
+
+// On Solaris/Linux platforms, libjvm.so does contain all private symbols.
+// ElfFile is basically an elf file parser, which can lookup the symbol
+// that is the nearest to the given address.
+// Beware, this code is called from vm error reporting code, when vm is already
+// in "error" state, so there are scenarios, lookup will fail. We want this
+// part of code to be very defensive, and bait out if anything went wrong.
+
+class ElfFile: public CHeapObj {
+  friend class Decoder;
+ public:
+  ElfFile(const char* filepath);
+  ~ElfFile();
+
+  const char* decode(address addr, int* offset);
+  const char* filepath() {
+    return m_filepath;
+  }
+
+  bool same_elf_file(const char* filepath) {
+    assert(filepath, "null file path");
+    assert(m_filepath, "already out of memory");
+    return (m_filepath && !strcmp(filepath, m_filepath));
+  }
+
+  Decoder::decoder_status get_status() {
+    return m_status;
+  }
+
+ private:
+  // sanity check, if the file is a real elf file
+  bool is_elf_file(Elf_Ehdr&);
+
+  // load string tables from the elf file
+  bool load_tables();
+
+  // string tables are stored in a linked list
+  void add_string_table(ElfStringTable* table);
+
+  // symbol tables are stored in a linked list
+  void add_symbol_table(ElfSymbolTable* table);
+
+  // return a string table at specified section index
+  ElfStringTable* get_string_table(int index);
+
+  // look up an address and return the nearest symbol
+  const char* look_up(Elf_Shdr shdr, address addr, int* offset);
+
+ protected:
+    ElfFile*         m_next;
+
+ private:
+  // file
+  const char* m_filepath;
+  FILE* m_file;
+
+  // Elf header
+  Elf_Ehdr            m_elfHdr;
+
+  // symbol tables
+  ElfSymbolTable*     m_symbol_tables;
+
+  // string tables
+  ElfStringTable*     m_string_tables;
+
+  Decoder::decoder_status  m_status;
+};
+
+#endif // _WINDOWS
+
+#endif // __ELF_FILE_HPP
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/elfStringTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+
+#ifndef _WINDOWS
+
+#include "memory/allocation.inline.hpp"
+#include "utilities/elfStringTable.hpp"
+
+// We will try to load whole string table into memory if we can.
+// Otherwise, fallback to more expensive file operation.
+ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) {
+  assert(file, "null file handle");
+  m_table = NULL;
+  m_index = index;
+  m_next = NULL;
+  m_file = file;
+  m_status = Decoder::no_error;
+
+  // try to load the string table
+  long cur_offset = ftell(file);
+  m_table = (char*)NEW_C_HEAP_ARRAY(char, shdr.sh_size);
+  if (m_table != NULL) {
+    // if there is an error, mark the error
+    if (fseek(file, shdr.sh_offset, SEEK_SET) ||
+      fread((void*)m_table, shdr.sh_size, 1, file) != 1 ||
+      fseek(file, cur_offset, SEEK_SET)) {
+      m_status = Decoder::file_invalid;
+      FREE_C_HEAP_ARRAY(char, m_table);
+      m_table = NULL;
+    }
+  } else {
+    memcpy(&m_shdr, &shdr, sizeof(Elf_Shdr));
+  }
+}
+
+ElfStringTable::~ElfStringTable() {
+  if (m_table != NULL) {
+    FREE_C_HEAP_ARRAY(char, m_table);
+  }
+
+  if (m_next != NULL) {
+    delete m_next;
+  }
+}
+
+const char* ElfStringTable::string_at(int pos) {
+  if (m_status != Decoder::no_error) {
+    return NULL;
+  }
+  if (m_table != NULL) {
+    return (const char*)(m_table + pos);
+  } else {
+    long cur_pos = ftell(m_file);
+    if (cur_pos == -1 ||
+      fseek(m_file, m_shdr.sh_offset + pos, SEEK_SET) ||
+      fread(m_symbol, 1, MAX_SYMBOL_LEN, m_file) <= 0 ||
+      fseek(m_file, cur_pos, SEEK_SET)) {
+      m_status = Decoder::file_invalid;
+      return NULL;
+    }
+    return (const char*)m_symbol;
+  }
+}
+
+#endif // _WINDOWS
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/elfStringTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef __ELF_STRING_TABLE_HPP
+#define __ELF_STRING_TABLE_HPP
+
+#ifndef _WINDOWS
+
+#include "memory/allocation.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/elfFile.hpp"
+
+
+// The string table represents a string table section in an elf file.
+// Whenever there is enough memory, it will load whole string table as
+// one blob. Otherwise, it will load string from file when requested.
+
+#define MAX_SYMBOL_LEN  256
+
+class ElfStringTable: CHeapObj {
+  friend class ElfFile;
+ public:
+  ElfStringTable(FILE* file, Elf_Shdr shdr, int index);
+  ~ElfStringTable();
+
+  // section index
+  int index() { return m_index; };
+
+  // get string at specified offset
+  const char* string_at(int offset);
+
+  // get status code
+  Decoder::decoder_status get_status() { return m_status; };
+
+ protected:
+  ElfStringTable*        m_next;
+
+  // section index
+  int                      m_index;
+
+  // holds complete string table if can
+  // allocate enough memory
+  const char*              m_table;
+
+  // file contains string table
+  FILE*                    m_file;
+
+  // section header
+  Elf_Shdr                 m_shdr;
+
+  // buffer for reading individual string
+  char                     m_symbol[MAX_SYMBOL_LEN];
+
+  // error code
+  Decoder::decoder_status  m_status;
+};
+
+#endif // _WINDOWS
+
+#endif // __ELF_STRING_TABLE_HPP
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/elfSymbolTable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+
+#ifndef _WINDOWS
+
+#include "memory/allocation.inline.hpp"
+#include "utilities/elfSymbolTable.hpp"
+
+ElfSymbolTable::ElfSymbolTable(FILE* file, Elf_Shdr shdr) {
+  assert(file, "null file handle");
+  m_symbols = NULL;
+  m_next = NULL;
+  m_file = file;
+  m_status = Decoder::no_error;
+
+  // try to load the string table
+  long cur_offset = ftell(file);
+  if (cur_offset != -1) {
+    m_symbols = (Elf_Sym*)NEW_C_HEAP_ARRAY(char, shdr.sh_size);
+    if (m_symbols) {
+      if (fseek(file, shdr.sh_offset, SEEK_SET) ||
+        fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 ||
+        fseek(file, cur_offset, SEEK_SET)) {
+        m_status = Decoder::file_invalid;
+        FREE_C_HEAP_ARRAY(char, m_symbols);
+        m_symbols = NULL;
+      }
+    }
+    if (m_status == Decoder::no_error) {
+      memcpy(&m_shdr, &shdr, sizeof(Elf_Shdr));
+    }
+  } else {
+    m_status = Decoder::file_invalid;
+  }
+}
+
+ElfSymbolTable::~ElfSymbolTable() {
+  if (m_symbols != NULL) {
+    FREE_C_HEAP_ARRAY(char, m_symbols);
+  }
+
+  if (m_next != NULL) {
+    delete m_next;
+  }
+}
+
+Decoder::decoder_status ElfSymbolTable::lookup(address addr, int* stringtableIndex, int* posIndex, int* offset) {
+  assert(stringtableIndex, "null string table index pointer");
+  assert(posIndex, "null string table offset pointer");
+  assert(offset, "null offset pointer");
+
+  if (m_status != Decoder::no_error) {
+    return m_status;
+  }
+
+  address pc = 0;
+  size_t  sym_size = sizeof(Elf_Sym);
+  assert((m_shdr.sh_size % sym_size) == 0, "check size");
+  int count = m_shdr.sh_size / sym_size;
+  if (m_symbols != NULL) {
+    for (int index = 0; index < count; index ++) {
+      if (STT_FUNC == ELF_ST_TYPE(m_symbols[index].st_info)) {
+        address sym_addr = (address)m_symbols[index].st_value;
+        if (sym_addr < addr && (addr - sym_addr) < *offset) {
+          pc = (address)m_symbols[index].st_value;
+          *offset = (int)(addr - pc);
+          *posIndex = m_symbols[index].st_name;
+          *stringtableIndex = m_shdr.sh_link;
+        }
+      }
+    }
+  } else {
+    long cur_pos;
+    if ((cur_pos = ftell(m_file)) == -1 ||
+      fseek(m_file, m_shdr.sh_offset, SEEK_SET)) {
+      m_status = Decoder::file_invalid;
+      return m_status;
+    }
+
+    Elf_Sym sym;
+    for (int index = 0; index < count; index ++) {
+      if (fread(&sym, sym_size, 1, m_file) == 1) {
+        if (STT_FUNC == ELF_ST_TYPE(sym.st_info)) {
+          address sym_addr = (address)sym.st_value;
+          if (sym_addr < addr && (addr - sym_addr) < *offset) {
+            pc = (address)sym.st_value;
+            *offset = (int)(addr - pc);
+            *posIndex = sym.st_name;
+            *stringtableIndex = m_shdr.sh_link;
+          }
+        }
+      } else {
+        m_status = Decoder::file_invalid;
+        return m_status;
+      }
+    }
+    fseek(m_file, cur_pos, SEEK_SET);
+  }
+  return m_status;
+}
+
+#endif // _WINDOWS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/utilities/elfSymbolTable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef __ELF_SYMBOL_TABLE_HPP
+#define __ELF_SYMBOL_TABLE_HPP
+
+#ifndef _WINDOWS
+
+
+#include "memory/allocation.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/elfFile.hpp"
+
+/*
+ * symbol table object represents a symbol section in an elf file.
+ * Whenever possible, it will load all symbols from the corresponding section
+ * of the elf file into memory. Otherwise, it will walk the section in file
+ * to look up the symbol that nearest the given address.
+ */
+class ElfSymbolTable: public CHeapObj {
+  friend class ElfFile;
+ public:
+  ElfSymbolTable(FILE* file, Elf_Shdr shdr);
+  ~ElfSymbolTable();
+
+  // search the symbol that is nearest to the specified address.
+  Decoder::decoder_status lookup(address addr, int* stringtableIndex, int* posIndex, int* offset);
+
+  Decoder::decoder_status get_status() { return m_status; };
+
+ protected:
+  ElfSymbolTable*  m_next;
+
+  // holds a complete symbol table section if
+  // can allocate enough memory
+  Elf_Sym*            m_symbols;
+
+  // file contains string table
+  FILE*               m_file;
+
+  // section header
+  Elf_Shdr            m_shdr;
+
+  Decoder::decoder_status  m_status;
+};
+
+#endif // _WINDOWS
+
+#endif // __ELF_SYMBOL_TABLE_HPP
+
+
+
--- a/src/share/vm/utilities/events.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/events.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,22 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_events.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "runtime/timer.hpp"
+#include "utilities/events.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 #ifndef PRODUCT
--- a/src/share/vm/utilities/events.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/events.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_EVENTS_HPP
+#define SHARE_VM_UTILITIES_EVENTS_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/top.hpp"
+
 // Events and EventMark provide interfaces to log events taking place in the vm.
 // This facility is extremly useful for post-mortem debugging. The eventlog
 // often provides crucial information about events leading up to the crash.
@@ -62,3 +68,5 @@
 };
 
 int print_all_events(outputStream *st);
+
+#endif // SHARE_VM_UTILITIES_EVENTS_HPP
--- a/src/share/vm/utilities/exceptions.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/exceptions.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,26 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_exceptions.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "compiler/compileBroker.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/threadCritical.hpp"
+#include "utilities/events.hpp"
+#include "utilities/exceptions.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 
 // Implementation of ThreadShadow
--- a/src/share/vm/utilities/exceptions.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/exceptions.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_EXCEPTIONS_HPP
+#define SHARE_VM_UTILITIES_EXCEPTIONS_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "utilities/sizes.hpp"
+
 // This file provides the basic support for exception handling in the VM.
 // Note: We do not use C++ exceptions to avoid compiler dependencies and
 // unpredictable performance.
@@ -276,3 +283,5 @@
 // exceptions.
 
 #define EXCEPTION_MARK                           Thread* THREAD; ExceptionMark __em(THREAD);
+
+#endif // SHARE_VM_UTILITIES_EXCEPTIONS_HPP
--- a/src/share/vm/utilities/globalDefinitions.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/globalDefinitions.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_globalDefinitions.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/top.hpp"
+
 // Basic error support
 
 // Info for oops within a java object.  Defaults are zero so
--- a/src/share/vm/utilities/globalDefinitions.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/globalDefinitions.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,21 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
+#define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
+
+#ifdef TARGET_COMPILER_gcc
+# include "utilities/globalDefinitions_gcc.hpp"
+#endif
+#ifdef TARGET_COMPILER_visCPP
+# include "utilities/globalDefinitions_visCPP.hpp"
+#endif
+#ifdef TARGET_COMPILER_sparcWorks
+# include "utilities/globalDefinitions_sparcWorks.hpp"
+#endif
+
+#include "utilities/macros.hpp"
+
 // This file holds all globally used constants & types, class (forward)
 // declarations and a few frequently used utility functions.
 
@@ -304,7 +319,16 @@
 
 // Machine dependent stuff
 
-#include "incls/_globalDefinitions_pd.hpp.incl"
+#ifdef TARGET_ARCH_x86
+# include "globalDefinitions_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "globalDefinitions_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "globalDefinitions_zero.hpp"
+#endif
+
 
 // The byte alignment to be used by Arena::Amalloc.  See bugid 4169348.
 // Note: this value must be a power of 2
@@ -1217,3 +1241,5 @@
 # endif /* ASSERT */
 
 #define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
+
+#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
--- a/src/share/vm/utilities/globalDefinitions_gcc.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
+#define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
+
+#include "prims/jni.h"
+
 // This file holds compiler-dependent includes,
 // globally used constants & types, class (forward)
 // declarations and a few frequently used utility functions.
@@ -289,3 +294,5 @@
 # undef offsetof
 #endif
 #define offsetof(klass,field) offset_of(klass,field)
+
+#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
--- a/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP
+#define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP
+
+#include "prims/jni.h"
+
 // This file holds compiler-dependent includes,
 // globally used constants & types, class (forward)
 // declarations and a few frequently used utility functions.
@@ -263,3 +268,5 @@
 #endif // _LP64
 
 #define offset_of(klass,field) offsetof(klass,field)
+
+#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP
--- a/src/share/vm/utilities/globalDefinitions_visCPP.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/globalDefinitions_visCPP.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_VISCPP_HPP
+#define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_VISCPP_HPP
+
+#include "prims/jni.h"
+
 // This file holds compiler-dependent includes,
 // globally used constants & types, class (forward)
 // declarations and a few frequently used utility functions.
@@ -194,3 +199,5 @@
 #define FORMAT64_MODIFIER "I64"
 
 #define offset_of(klass,field) offsetof(klass,field)
+
+#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_VISCPP_HPP
--- a/src/share/vm/utilities/growableArray.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/growableArray.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,19 @@
  * questions.
  *
  */
-# include "incls/_precompiled.incl"
-# include "incls/_growableArray.cpp.incl"
 
+#include "precompiled.hpp"
+#include "memory/resourceArea.hpp"
+#include "utilities/growableArray.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 #ifdef ASSERT
 void GenericGrowableArray::set_nesting() {
   if (on_stack()) {
--- a/src/share/vm/utilities/growableArray.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/growableArray.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,15 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_GROWABLEARRAY_HPP
+#define SHARE_VM_UTILITIES_GROWABLEARRAY_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/top.hpp"
+
 // A growable array.
 
 /*************************************************************************/
@@ -360,3 +369,5 @@
     for (int i = 0; i < _len; i++) tty->print(INTPTR_FORMAT " ", *(intptr_t*)&(_data[i]));
     tty->print("}\n");
 }
+
+#endif // SHARE_VM_UTILITIES_GROWABLEARRAY_HPP
--- a/src/share/vm/utilities/hashtable.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/hashtable.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,14 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_hashtable.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
+#include "utilities/dtrace.hpp"
+#include "utilities/hashtable.hpp"
+#include "utilities/hashtable.inline.hpp"
 
 HS_DTRACE_PROBE_DECL4(hs_private, hashtable__new_entry,
   void*, unsigned int, oop, void*);
--- a/src/share/vm/utilities/hashtable.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/hashtable.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,14 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_HASHTABLE_HPP
+#define SHARE_VM_UTILITIES_HASHTABLE_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/handles.hpp"
+
 // This is a generic hashtable, designed to be used for the symbol
 // and string tables.
 //
@@ -278,3 +286,5 @@
     return hash_to_index(compute_hash(name, loader));
   }
 };
+
+#endif // SHARE_VM_UTILITIES_HASHTABLE_HPP
--- a/src/share/vm/utilities/hashtable.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/hashtable.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_HASHTABLE_INLINE_HPP
+#define SHARE_VM_UTILITIES_HASHTABLE_INLINE_HPP
+
+#include "memory/allocation.inline.hpp"
+#include "utilities/hashtable.hpp"
+
 // Inline function definitions for hashtable.hpp.
 
 
@@ -124,3 +130,5 @@
   _free_list = entry;
   --_number_of_entries;
 }
+
+#endif // SHARE_VM_UTILITIES_HASHTABLE_INLINE_HPP
--- a/src/share/vm/utilities/histogram.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/histogram.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_histogram.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "utilities/histogram.hpp"
 
 #ifdef ASSERT
 
--- a/src/share/vm/utilities/histogram.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/histogram.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,22 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_HISTOGRAM_HPP
+#define SHARE_VM_UTILITIES_HISTOGRAM_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/os.hpp"
+#include "utilities/growableArray.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+
 // This class provides a framework for collecting various statistics.
 // The current implementation is oriented towards counting invocations
 // of various types, but that can be easily changed.
@@ -89,3 +105,5 @@
 };
 
 #endif
+
+#endif // SHARE_VM_UTILITIES_HISTOGRAM_HPP
--- a/src/share/vm/utilities/intHisto.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/intHisto.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_intHisto.cpp.incl"
+#include "precompiled.hpp"
+#include "utilities/intHisto.hpp"
 
 IntHistogram::IntHistogram(int est, int max) : _max(max), _tot(0) {
   assert(0 <= est && est <= max, "Preconditions");
--- a/src/share/vm/utilities/intHisto.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/intHisto.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_INTHISTO_HPP
+#define SHARE_VM_UTILITIES_INTHISTO_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/growableArray.hpp"
+
 // This class implements a simple histogram.
 
 // A histogram summarizes a series of "measurements", each of which is
@@ -68,3 +74,5 @@
   // Print the histogram on the given output stream.
   void print_on(outputStream* st) const;
 };
+
+#endif // SHARE_VM_UTILITIES_INTHISTO_HPP
--- a/src/share/vm/utilities/macros.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/macros.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_MACROS_HPP
+#define SHARE_VM_UTILITIES_MACROS_HPP
+
 // Use this to mark code that needs to be cleaned up (for development only)
 #define NEEDS_CLEANUP
 
@@ -234,3 +237,5 @@
 #endif
 
 #define define_pd_global(type, name, value) const type pd_##name = value;
+
+#endif // SHARE_VM_UTILITIES_MACROS_HPP
--- a/src/share/vm/utilities/numberSeq.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/numberSeq.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_numberSeq.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/numberSeq.hpp"
 
 AbsSeq::AbsSeq(double alpha) :
   _num(0), _sum(0.0), _sum_of_squares(0.0),
--- a/src/share/vm/utilities/numberSeq.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/numberSeq.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_NUMBERSEQ_HPP
+#define SHARE_VM_UTILITIES_NUMBERSEQ_HPP
+
 /**
  **  This file contains a few classes that represent number sequence,
  **  x1, x2, x3, ..., xN, and can calculate their avg, max, and sd.
@@ -125,3 +128,5 @@
   // Debugging/Printing
   virtual void dump_on(outputStream* s);
 };
+
+#endif // SHARE_VM_UTILITIES_NUMBERSEQ_HPP
--- a/src/share/vm/utilities/ostream.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/ostream.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,23 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_ostream.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/arguments.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/ostream.hpp"
+#include "utilities/top.hpp"
+#include "utilities/xmlstream.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
 
 extern "C" void jio_print(const char* s); // Declarationtion of jvm method
 
@@ -860,9 +875,7 @@
 
   _socket = -1;
 
-  hpi::initialize_socket_library();
-
-  int result = hpi::socket(AF_INET, SOCK_STREAM, 0);
+  int result = os::socket(AF_INET, SOCK_STREAM, 0);
   if (result <= 0) {
     assert(false, "Socket could not be created!");
   } else {
@@ -871,12 +884,12 @@
 }
 
 int networkStream::read(char *buf, size_t len) {
-  return hpi::recv(_socket, buf, (int)len, 0);
+  return os::recv(_socket, buf, (int)len, 0);
 }
 
 void networkStream::flush() {
   if (size() != 0) {
-    int result = hpi::raw_send(_socket, (char *)base(), (int)size(), 0);
+    int result = os::raw_send(_socket, (char *)base(), (int)size(), 0);
     assert(result != -1, "connection error");
     assert(result == (int)size(), "didn't send enough data");
   }
@@ -890,7 +903,7 @@
 void networkStream::close() {
   if (_socket != -1) {
     flush();
-    hpi::socket_close(_socket);
+    os::socket_close(_socket);
     _socket = -1;
   }
 }
@@ -903,11 +916,7 @@
 
   server.sin_addr.s_addr = inet_addr(ip);
   if (server.sin_addr.s_addr == (uint32_t)-1) {
-#ifdef _WINDOWS
-    struct hostent* host = hpi::get_host_by_name((char*)ip);
-#else
-    struct hostent* host = gethostbyname(ip);
-#endif
+    struct hostent* host = os::get_host_by_name((char*)ip);
     if (host != NULL) {
       memcpy(&server.sin_addr, host->h_addr_list[0], host->h_length);
     } else {
@@ -916,7 +925,7 @@
   }
 
 
-  int result = hpi::connect(_socket, (struct sockaddr*)&server, sizeof(struct sockaddr_in));
+  int result = os::connect(_socket, (struct sockaddr*)&server, sizeof(struct sockaddr_in));
   return (result >= 0);
 }
 
--- a/src/share/vm/utilities/ostream.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/ostream.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_OSTREAM_HPP
+#define SHARE_VM_UTILITIES_OSTREAM_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/timer.hpp"
+
 // Output streams for printing
 //
 // Printing guidelines:
@@ -245,3 +251,5 @@
 };
 
 #endif
+
+#endif // SHARE_VM_UTILITIES_OSTREAM_HPP
--- a/src/share/vm/utilities/preserveException.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/preserveException.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_preserveException.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/handles.inline.hpp"
+#include "utilities/preserveException.hpp"
 
 // TODO: These three classes should be refactored
 
--- a/src/share/vm/utilities/preserveException.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/preserveException.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_PRESERVEEXCEPTION_HPP
+#define SHARE_VM_UTILITIES_PRESERVEEXCEPTION_HPP
+
+#include "runtime/handles.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // This file provides more support for exception handling; see also exceptions.hpp
 class PreserveExceptionMark {
  private:
@@ -83,3 +97,5 @@
 // use global exception mark when allowing pending exception to be set and
 // saving and restoring them
 #define PRESERVE_EXCEPTION_MARK                    Thread* THREAD; PreserveExceptionMark __em(THREAD);
+
+#endif // SHARE_VM_UTILITIES_PRESERVEEXCEPTION_HPP
--- a/src/share/vm/utilities/sizes.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/sizes.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,6 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_sizes.cpp.incl"
+#include "precompiled.hpp"
+#include "utilities/sizes.hpp"
+
--- a/src/share/vm/utilities/sizes.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/sizes.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_SIZES_HPP
+#define SHARE_VM_UTILITIES_SIZES_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/globalDefinitions.hpp"
+
 // The following two classes are used to represent 'sizes' and 'offsets' in the VM;
 // they serve as 'unit' types. ByteSize is used for sizes measured in bytes, while
 // WordSize is used for sizes measured in machine words (i.e., 32bit or 64bit words
@@ -142,3 +148,5 @@
 // Use the following #define to get C++ field member offsets
 
 #define byte_offset_of(klass,field)   in_ByteSize((int)offset_of(klass, field))
+
+#endif // SHARE_VM_UTILITIES_SIZES_HPP
--- a/src/share/vm/utilities/stack.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/stack.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -16,12 +16,17 @@
  * 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.
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_STACK_HPP
+#define SHARE_VM_UTILITIES_STACK_HPP
+
+#include "memory/allocation.inline.hpp"
+
 // Class Stack (below) grows and shrinks by linking together "segments" which
 // are allocated on demand.  Segments are arrays of the element type (E) plus an
 // extra pointer-sized field to store the segment link.  Recently emptied
@@ -202,3 +207,5 @@
 #ifdef __GNUC__
 #undef inline
 #endif // __GNUC__
+
+#endif // SHARE_VM_UTILITIES_STACK_HPP
--- a/src/share/vm/utilities/stack.inline.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/stack.inline.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -16,12 +16,17 @@
  * 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.
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_STACK_INLINE_HPP
+#define SHARE_VM_UTILITIES_STACK_INLINE_HPP
+
+#include "utilities/stack.hpp"
+
 StackBase::StackBase(size_t segment_size, size_t max_cache_size,
                      size_t max_size):
   _seg_size(segment_size),
@@ -271,3 +276,5 @@
   }
   return _cur_seg + --_cur_seg_size;
 }
+
+#endif // SHARE_VM_UTILITIES_STACK_INLINE_HPP
--- a/src/share/vm/utilities/taskqueue.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/taskqueue.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_taskqueue.cpp.incl"
+#include "precompiled.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/os.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/stack.inline.hpp"
+#include "utilities/taskqueue.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
 
 #ifdef TRACESPINNING
 uint ParallelTaskTerminator::_total_yields = 0;
--- a/src/share/vm/utilities/taskqueue.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/taskqueue.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,32 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_TASKQUEUE_HPP
+#define SHARE_VM_UTILITIES_TASKQUEUE_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/mutex.hpp"
+#include "utilities/stack.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "orderAccess_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "orderAccess_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "orderAccess_linux_zero.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "orderAccess_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "orderAccess_solaris_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "orderAccess_windows_x86.inline.hpp"
+#endif
+
 // Simple TaskQueue stats that are collected by default in debug builds.
 
 #if !defined(TASKQUEUE_STATS) && defined(ASSERT)
@@ -764,3 +790,5 @@
 typedef OverflowTaskQueue<size_t>             RegionTaskQueue;
 typedef GenericTaskQueueSet<RegionTaskQueue>  RegionTaskQueueSet;
 
+
+#endif // SHARE_VM_UTILITIES_TASKQUEUE_HPP
--- a/src/share/vm/utilities/top.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/top.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,28 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_TOP_HPP
+#define SHARE_VM_UTILITIES_TOP_HPP
+
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/globals.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+#include "utilities/ostream.hpp"
+#include "utilities/sizes.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1_globals.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_globals.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/c2_globals.hpp"
+#endif
+
 // THIS FILE IS INTESIONALLY LEFT EMPTY
 // IT IS USED TO MINIMIZE THE NUMBER OF DEPENDENCIES IN includeDB
+
+#endif // SHARE_VM_UTILITIES_TOP_HPP
--- a/src/share/vm/utilities/utf8.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/utf8.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,8 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_utf8.cpp.incl"
+#include "precompiled.hpp"
+#include "utilities/utf8.hpp"
 
 // Assume the utf8 string is in legal form and has been
 // checked in the class file parser/format checker.
--- a/src/share/vm/utilities/utf8.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/utf8.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_UTF8_HPP
+#define SHARE_VM_UTILITIES_UTF8_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/top.hpp"
+
 // Low-level interface for UTF8 strings
 
 class UTF8 : AllStatic {
@@ -74,3 +80,5 @@
   static char* as_utf8(jchar* base, int length);
   static char* as_utf8(jchar* base, int length, char* buf, int buflen);
 };
+
+#endif // SHARE_VM_UTILITIES_UTF8_HPP
--- a/src/share/vm/utilities/vmError.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/vmError.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,21 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_vmError.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/compileBroker.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/init.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vmThread.hpp"
+#include "runtime/vm_operations.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/top.hpp"
+#include "utilities/vmError.hpp"
 
 // List of environment variables that should be reported in error log file.
 const char *env_list[] = {
@@ -504,8 +517,10 @@
        if (fr.pc()) {
           st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)");
 
+          // initialize decoder to decode C frames
+          Decoder decoder;
+
           int count = 0;
-
           while (count++ < StackPrintLimit) {
              fr.print_on_error(st, buf, sizeof(buf));
              st->cr();
--- a/src/share/vm/utilities/vmError.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/vmError.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,11 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_VMERROR_HPP
+#define SHARE_VM_UTILITIES_VMERROR_HPP
+
+#include "utilities/globalDefinitions.hpp"
+
 
 class VM_ReportJavaOutOfMemory;
 
@@ -116,3 +121,5 @@
   // check to see if fatal error reporting is in progress
   static bool fatal_error_in_progress() { return first_error != NULL; }
 };
+
+#endif // SHARE_VM_UTILITIES_VMERROR_HPP
--- a/src/share/vm/utilities/workgroup.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/workgroup.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,11 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_workgroup.cpp.incl"
+#include "precompiled.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/os.hpp"
+#include "utilities/workgroup.hpp"
 
 // Definitions of WorkGang methods.
 
--- a/src/share/vm/utilities/workgroup.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/workgroup.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,20 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_WORKGROUP_HPP
+#define SHARE_VM_UTILITIES_WORKGROUP_HPP
+
+#include "utilities/taskqueue.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+
 // Forward declarations of classes defined here
 
 class WorkGang;
@@ -458,3 +472,5 @@
 
   void release_par_id(int id);
 };
+
+#endif // SHARE_VM_UTILITIES_WORKGROUP_HPP
--- a/src/share/vm/utilities/xmlstream.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/xmlstream.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_xmlstream.cpp.incl"
+#include "precompiled.hpp"
+#include "code/nmethod.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/xmlstream.hpp"
 
 void xmlStream::initialize(outputStream* out) {
   _out = out;
--- a/src/share/vm/utilities/xmlstream.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/xmlstream.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,12 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_XMLSTREAM_HPP
+#define SHARE_VM_UTILITIES_XMLSTREAM_HPP
+
+#include "runtime/handles.hpp"
+#include "utilities/ostream.hpp"
+
 class xmlStream;
 class defaultStream;
 
@@ -175,3 +181,5 @@
 extern xmlStream* xtty;
 
 // Note:  If ::xtty != NULL, ::tty == ::xtty->text().
+
+#endif // SHARE_VM_UTILITIES_XMLSTREAM_HPP
--- a/src/share/vm/utilities/yieldingWorkgroup.cpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/yieldingWorkgroup.cpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,8 +22,10 @@
  *
  */
 
-# include "incls/_precompiled.incl"
-# include "incls/_yieldingWorkgroup.cpp.incl"
+#include "precompiled.hpp"
+#ifndef SERIALGC
+#include "utilities/yieldingWorkgroup.hpp"
+#endif
 
 // Forward declaration of classes declared here.
 
--- a/src/share/vm/utilities/yieldingWorkgroup.hpp	Wed Dec 29 20:06:41 2010 +0100
+++ b/src/share/vm/utilities/yieldingWorkgroup.hpp	Fri Jan 07 18:18:08 2011 +0100
@@ -22,6 +22,13 @@
  *
  */
 
+#ifndef SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP
+#define SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP
+
+#ifndef SERIALGC
+#include "utilities/workgroup.hpp"
+#endif
+
 
 // Forward declarations
 class YieldingFlexibleWorkGang;
@@ -211,3 +218,5 @@
   friend class YieldingFlexibleGangWorker;
   void reset(); // NYI
 };
+
+#endif // SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP
--- a/test/Makefile	Wed Dec 29 20:06:41 2010 +0100
+++ b/test/Makefile	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/test/compiler/6431242/Test.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/test/compiler/6431242/Test.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/test/compiler/6857159/Test6857159.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/test/compiler/6857159/Test6857159.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/test/compiler/6877254/Test.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/test/compiler/6877254/Test.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/test/compiler/6895383/Test.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/test/compiler/6895383/Test.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/test/compiler/6896727/Test.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/test/compiler/6896727/Test.java	Fri Jan 07 18:18:08 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/test/compiler/6991596/Test6991596.java	Wed Dec 29 20:06:41 2010 +0100
+++ b/test/compiler/6991596/Test6991596.java	Fri Jan 07 18:18:08 2011 +0100
@@ -35,7 +35,7 @@
 public class Test6991596 {
     private static final Class   CLASS = Test6991596.class;
     private static final String  NAME  = "foo";
-    private static final boolean DEBUG = false;
+    private static final boolean DEBUG = System.getProperty("DEBUG", "false").equals("true");
 
     public static void main(String[] args) throws Throwable {
         testboolean();
@@ -47,7 +47,7 @@
     }
 
     // Helpers to get various methods.
-    static MethodHandle getmh1(Class ret, Class arg) {
+    static MethodHandle getmh1(Class ret, Class arg) throws NoAccessException {
         return MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(ret, arg));
     }
     static MethodHandle getmh2(MethodHandle mh1, Class ret, Class arg) {
@@ -76,38 +76,38 @@
             MethodHandle mh2 = getmh2(mh1, boolean.class, boolean.class);
             // TODO add this for all cases when the bugs are fixed.
             //MethodHandle mh3 = getmh3(mh1, boolean.class, boolean.class);
-            boolean a = mh1.<boolean>invokeExact((boolean) x);
-            boolean b = mh2.<boolean>invokeExact(x);
+            boolean a = (boolean) mh1.invokeExact((boolean) x);
+            boolean b = (boolean) mh2.invokeExact(x);
             //boolean c = mh3.<boolean>invokeExact((boolean) x);
-            assert a == b : a + " != " + b;
-            //assert c == x : c + " != " + x;
+            check(x, a, b);
+            //check(x, c, x);
         }
 
         // byte
         {
             MethodHandle mh1 = getmh1(     byte.class,    byte.class   );
             MethodHandle mh2 = getmh2(mh1, byte.class,    boolean.class);
-            byte    a = mh1.<byte>invokeExact((byte) (x ? 1 : 0));
-            byte    b = mh2.<byte>invokeExact(x);
-            assert a == b : a + " != " + b;
+            byte a = (byte) mh1.invokeExact((byte) (x ? 1 : 0));
+            byte b = (byte) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // char
         {
             MethodHandle mh1 = getmh1(     char.class, char.class);
             MethodHandle mh2 = getmh2(mh1, char.class, boolean.class);
-            char a = mh1.<char>invokeExact((char) (x ? 1 : 0));
-            char b = mh2.<char>invokeExact(x);
-            assert a == b : a + " != " + b;
+            char a = (char) mh1.invokeExact((char) (x ? 1 : 0));
+            char b = (char) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // short
         {
             MethodHandle mh1 = getmh1(     short.class, short.class);
             MethodHandle mh2 = getmh2(mh1, short.class, boolean.class);
-            short a = mh1.<short>invokeExact((short) (x ? 1 : 0));
-            short b = mh2.<short>invokeExact(x);
-            assert a == b : a + " != " + b;
+            short a = (short) mh1.invokeExact((short) (x ? 1 : 0));
+            short b = (short) mh2.invokeExact(x);
+            check(x, a, b);
         }
     }
 
@@ -134,36 +134,36 @@
         {
             MethodHandle mh1 = getmh1(     boolean.class, boolean.class);
             MethodHandle mh2 = getmh2(mh1, boolean.class, byte.class);
-            boolean a = mh1.<boolean>invokeExact((x & 1) == 1);
-            boolean b = mh2.<boolean>invokeExact(x);
-            assert a == b : a + " != " + b;
+            boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
+            boolean b = (boolean) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // byte
         {
             MethodHandle mh1 = getmh1(     byte.class, byte.class);
             MethodHandle mh2 = getmh2(mh1, byte.class, byte.class);
-            byte a = mh1.<byte>invokeExact((byte) x);
-            byte b = mh2.<byte>invokeExact(x);
-            assert a == b : a + " != " + b;
+            byte a = (byte) mh1.invokeExact((byte) x);
+            byte b = (byte) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // char
         {
             MethodHandle mh1 = getmh1(     char.class, char.class);
             MethodHandle mh2 = getmh2(mh1, char.class, byte.class);
-            char a = mh1.<char>invokeExact((char) x);
-            char b = mh2.<char>invokeExact(x);
-            assert a == b : a + " != " + b;
+            char a = (char) mh1.invokeExact((char) x);
+            char b = (char) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // short
         {
             MethodHandle mh1 = getmh1(     short.class, short.class);
             MethodHandle mh2 = getmh2(mh1, short.class, byte.class);
-            short a = mh1.<short>invokeExact((short) x);
-            short b = mh2.<short>invokeExact(x);
-            assert a == b : a + " != " + b;
+            short a = (short) mh1.invokeExact((short) x);
+            short b = (short) mh2.invokeExact(x);
+            check(x, a, b);
         }
     }
 
@@ -188,36 +188,36 @@
         {
             MethodHandle mh1 = getmh1(     boolean.class, boolean.class);
             MethodHandle mh2 = getmh2(mh1, boolean.class, char.class);
-            boolean a = mh1.<boolean>invokeExact((x & 1) == 1);
-            boolean b = mh2.<boolean>invokeExact(x);
-            assert a == b : a + " != " + b;
+            boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
+            boolean b = (boolean) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // byte
         {
             MethodHandle mh1 = getmh1(     byte.class, byte.class);
             MethodHandle mh2 = getmh2(mh1, byte.class, char.class);
-            byte a = mh1.<byte>invokeExact((byte) x);
-            byte b = mh2.<byte>invokeExact(x);
-            assert a == b : a + " != " + b;
+            byte a = (byte) mh1.invokeExact((byte) x);
+            byte b = (byte) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // char
         {
             MethodHandle mh1 = getmh1(     char.class, char.class);
             MethodHandle mh2 = getmh2(mh1, char.class, char.class);
-            char a = mh1.<char>invokeExact((char) x);
-            char b = mh2.<char>invokeExact(x);
-            assert a == b : a + " != " + b;
+            char a = (char) mh1.invokeExact((char) x);
+            char b = (char) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // short
         {
             MethodHandle mh1 = getmh1(     short.class, short.class);
             MethodHandle mh2 = getmh2(mh1, short.class, char.class);
-            short a = mh1.<short>invokeExact((short) x);
-            short b = mh2.<short>invokeExact(x);
-            assert a == b : a + " != " + b;
+            short a = (short) mh1.invokeExact((short) x);
+            short b = (short) mh2.invokeExact(x);
+            check(x, a, b);
         }
     }
 
@@ -248,36 +248,36 @@
         {
             MethodHandle mh1 = getmh1(     boolean.class, boolean.class);
             MethodHandle mh2 = getmh2(mh1, boolean.class, short.class);
-            boolean a = mh1.<boolean>invokeExact((x & 1) == 1);
-            boolean b = mh2.<boolean>invokeExact(x);
-            assert a == b : a + " != " + b;
+            boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
+            boolean b = (boolean) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // byte
         {
             MethodHandle mh1 = getmh1(     byte.class, byte.class);
             MethodHandle mh2 = getmh2(mh1, byte.class, short.class);
-            byte a = mh1.<byte>invokeExact((byte) x);
-            byte b = mh2.<byte>invokeExact(x);
-            assert a == b : a + " != " + b;
+            byte a = (byte) mh1.invokeExact((byte) x);
+            byte b = (byte) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // char
         {
             MethodHandle mh1 = getmh1(     char.class, char.class);
             MethodHandle mh2 = getmh2(mh1, char.class, short.class);
-            char a = mh1.<char>invokeExact((char) x);
-            char b = mh2.<char>invokeExact(x);
-            assert a == b : a + " != " + b;
+            char a = (char) mh1.invokeExact((char) x);
+            char b = (char) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // short
         {
             MethodHandle mh1 = getmh1(     short.class, short.class);
             MethodHandle mh2 = getmh2(mh1, short.class, short.class);
-            short a = mh1.<short>invokeExact((short) x);
-            short b = mh2.<short>invokeExact(x);
-            assert a == b : a + " != " + b;
+            short a = (short) mh1.invokeExact((short) x);
+            short b = (short) mh2.invokeExact(x);
+            check(x, a, b);
         }
     }
 
@@ -316,45 +316,46 @@
         {
             MethodHandle mh1 = getmh1(     boolean.class, boolean.class);
             MethodHandle mh2 = getmh2(mh1, boolean.class, int.class);
-            boolean a = mh1.<boolean>invokeExact((x & 1) == 1);
-            boolean b = mh2.<boolean>invokeExact(x);
-            assert a == b : a + " != " + b;
+            boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
+            boolean b = (boolean) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // byte
         {
             MethodHandle mh1 = getmh1(     byte.class, byte.class);
             MethodHandle mh2 = getmh2(mh1, byte.class, int.class);
-            byte a = mh1.<byte>invokeExact((byte) x);
-            byte b = mh2.<byte>invokeExact(x);
-            assert a == b : a + " != " + b;
+            byte a = (byte) mh1.invokeExact((byte) x);
+            byte b = (byte) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // char
         {
             MethodHandle mh1 = getmh1(     char.class, char.class);
             MethodHandle mh2 = getmh2(mh1, char.class, int.class);
-            char a = mh1.<char>invokeExact((char) x);
-            char b = mh2.<char>invokeExact(x);
-            assert a == b : a + " != " + b;
+            char a = (char) mh1.invokeExact((char) x);
+            char b = (char) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // short
         {
             MethodHandle mh1 = getmh1(     short.class, short.class);
             MethodHandle mh2 = getmh2(mh1, short.class, int.class);
-            short a = mh1.<short>invokeExact((short) x);
-            short b = mh2.<short>invokeExact(x);
+            short a = (short) mh1.invokeExact((short) x);
+            short b = (short) mh2.invokeExact(x);
             assert a == b : a + " != " + b;
+            check(x, a, b);
         }
 
         // int
         {
             MethodHandle mh1 = getmh1(     int.class, int.class);
             MethodHandle mh2 = getmh2(mh1, int.class, int.class);
-            int a = mh1.<int>invokeExact((int) x);
-            int b = mh2.<int>invokeExact(x);
-            assert a == b : a + " != " + b;
+            int a = (int) mh1.invokeExact((int) x);
+            int b = (int) mh2.invokeExact(x);
+            check(x, a, b);
         }
     }
 
@@ -395,48 +396,65 @@
         {
             MethodHandle mh1 = getmh1(     boolean.class, boolean.class);
             MethodHandle mh2 = getmh2(mh1, boolean.class, long.class);
-            boolean a = mh1.<boolean>invokeExact((x & 1L) == 1L);
-            boolean b = mh2.<boolean>invokeExact(x);
-            assert a == b : a + " != " + b;
+            boolean a = (boolean) mh1.invokeExact((x & 1L) == 1L);
+            boolean b = (boolean) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // byte
         {
             MethodHandle mh1 = getmh1(     byte.class, byte.class);
             MethodHandle mh2 = getmh2(mh1, byte.class, long.class);
-            byte a = mh1.<byte>invokeExact((byte) x);
-            byte b = mh2.<byte>invokeExact(x);
-            assert a == b : a + " != " + b;
+            byte a = (byte) mh1.invokeExact((byte) x);
+            byte b = (byte) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // char
         {
             MethodHandle mh1 = getmh1(     char.class, char.class);
             MethodHandle mh2 = getmh2(mh1, char.class, long.class);
-            char a = mh1.<char>invokeExact((char) x);
-            char b = mh2.<char>invokeExact(x);
-            assert a == b : a + " != " + b;
+            char a = (char) mh1.invokeExact((char) x);
+            char b = (char) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // short
         {
             MethodHandle mh1 = getmh1(     short.class, short.class);
             MethodHandle mh2 = getmh2(mh1, short.class, long.class);
-            short a = mh1.<short>invokeExact((short) x);
-            short b = mh2.<short>invokeExact(x);
-            assert a == b : a + " != " + b;
+            short a = (short) mh1.invokeExact((short) x);
+            short b = (short) mh2.invokeExact(x);
+            check(x, a, b);
         }
 
         // int
         {
             MethodHandle mh1 = getmh1(     int.class, int.class);
             MethodHandle mh2 = getmh2(mh1, int.class, long.class);
-            int a = mh1.<int>invokeExact((int) x);
-            int b = mh2.<int>invokeExact(x);
-            assert a == b : a + " != " + b;
+            int a = (int) mh1.invokeExact((int) x);
+            int b = (int) mh2.invokeExact(x);
+            check(x, a, b);
         }
+    }
 
-    }
+    static void check(boolean x, boolean e, boolean a) { p(z2h(x), z2h(e), z2h(a)); assert e == a : z2h(x) + ": " + z2h(e) + " != " + z2h(a); }
+    static void check(boolean x, byte    e, byte    a) { p(z2h(x), i2h(e), i2h(a)); assert e == a : z2h(x) + ": " + i2h(e) + " != " + i2h(a); }
+    static void check(boolean x, int     e, int     a) { p(z2h(x), i2h(e), i2h(a)); assert e == a : z2h(x) + ": " + i2h(e) + " != " + i2h(a); }
+
+    static void check(int     x, boolean e, boolean a) { p(i2h(x), z2h(e), z2h(a)); assert e == a : i2h(x) + ": " + z2h(e) + " != " + z2h(a); }
+    static void check(int     x, byte    e, byte    a) { p(i2h(x), i2h(e), i2h(a)); assert e == a : i2h(x) + ": " + i2h(e) + " != " + i2h(a); }
+    static void check(int     x, int     e, int     a) { p(i2h(x), i2h(e), i2h(a)); assert e == a : i2h(x) + ": " + i2h(e) + " != " + i2h(a); }
+
+    static void check(long    x, boolean e, boolean a) { p(l2h(x), z2h(e), z2h(a)); assert e == a : l2h(x) + ": " + z2h(e) + " != " + z2h(a); }
+    static void check(long    x, byte    e, byte    a) { p(l2h(x), i2h(e), i2h(a)); assert e == a : l2h(x) + ": " + i2h(e) + " != " + i2h(a); }
+    static void check(long    x, int     e, int     a) { p(l2h(x), i2h(e), i2h(a)); assert e == a : l2h(x) + ": " + i2h(e) + " != " + i2h(a); }
+
+    static void p(String x, String e, String a) { if (DEBUG)  System.out.println(x + ": expected: " + e + ", actual: " + a); }
+
+    static String z2h(boolean x) { return x ? "1" : "0"; }
+    static String i2h(int     x) { return Integer.toHexString(x); }
+    static String l2h(long    x) { return Long.toHexString(x); }
 
     // to int
     public static boolean foo(boolean i) { return i; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/7002666/Test7002666.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 7002666
+ * @summary eclipse CDT projects crash with compressed oops
+ *
+ * @run main/othervm -Xbatch -XX:CompileOnly=Test7002666.test,java/lang/reflect/Array Test7002666
+ *
+ * This will only reliably fail with a fastdebug build since it relies
+ * on seeing garbage in the heap to die.  It could be made more
+ * reliable in product mode but that would require greatly increasing
+ * the runtime.
+ */
+
+public class Test7002666 {
+    public static void main(String[] args) {
+        for (int i = 0; i < 25000; i++) {
+            Object[] a = test(Test7002666.class, new Test7002666());
+            if (a[0] != null) {
+                // The element should be null but if it's not then
+                // we've hit the bug.  This will most likely crash but
+                // at least throw an exception.
+                System.err.println(a[0]);
+                throw new InternalError(a[0].toString());
+
+            }
+        }
+    }
+    public static Object[] test(Class c, Object o) {
+        // allocate an array small enough to be trigger the bug
+        Object[] a = (Object[])java.lang.reflect.Array.newInstance(c, 1);
+        return a;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/6981737/Test6981737.java	Fri Jan 07 18:18:08 2011 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test Test6981737.java
+ * @bug 6981737
+ * @summary check for correct vm properties
+ * @run main Test6981737
+ * @author kamg
+*/
+
+public class Test6981737 {
+
+    /**
+     * Check the 'vendor' properties java.vm.specification.version
+     * property.  Before jdk7, they should be "Sun Micro..." and "1.0".
+     * In jdk7 onwards they should be "Oracle..." and "1.<major_version>"
+     */
+    public static void main(String[] args) throws Exception {
+
+        String version = verifyProperty("java.version", "[0-9]+\\.[0-9]+\\..*");
+        String major_version_spec = version.split("\\.")[1];
+        int major_version = new Integer(major_version_spec).intValue();
+
+        String vendor_re = "Oracle Corporation";
+        String vm_spec_version_re = "1\\." + major_version_spec;
+        if (major_version < 7) {
+            vendor_re = "Sun Microsystems Inc\\.";
+            vm_spec_version_re = "1\\.0";
+        }
+        verifyProperty("java.vendor", vendor_re);
+        verifyProperty("java.vm.vendor", vendor_re);
+        verifyProperty("java.vm.specification.vendor", vendor_re);
+        verifyProperty("java.specification.vendor", vendor_re);
+        verifyProperty("java.vm.specification.version", vm_spec_version_re);
+        System.out.println("PASS");
+    }
+
+    public static String verifyProperty(String name, String expected_re) {
+        String value = System.getProperty(name, "");
+        System.out.print("Checking " + name + ": \"" + value +
+          "\".matches(\"" + expected_re + "\")... ");
+        if (!value.matches(expected_re)) {
+            System.out.println("no.");
+            throw new RuntimeException("FAIL: Wrong value for " + name +
+                " property, \"" + value + "\", expected to be of form: \"" +
+                expected_re + "\"");
+        }
+        System.out.println("yes.");
+        return value;
+    }
+}