# HG changeset patch # User Thomas Wuerthinger # Date 1294420688 -3600 # Node ID 06f017f7daa7f57173aadc8b4e6e8536a4a2593d # Parent 00bc9eaf0e24b0b5c1a861b9152ca0831b297740# Parent 09d92cbb793b181b7418717cf600207b73159553 Merge. diff -r 00bc9eaf0e24 -r 06f017f7daa7 .hgtags --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/os/linux/libproc_impl.c --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/os/linux/ps_core.c --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/os/linux/ps_proc.c --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/os/linux/symtab.c --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/os/linux/symtab.h --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java --- 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; } diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java --- 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; } diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java --- 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: diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java --- 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; } diff -r 00bc9eaf0e24 -r 06f017f7daa7 agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/defs.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/hotspot_distro --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/hotspot_version --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/jprt.gmk --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/jprt.properties --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/adlc.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/amd64.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/build_vm_def.sh --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/buildtree.make --- 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 - .-b (11.0-b07) -# HOTSPOT_BUILD_VERSION - internal, PRTjob ID, JPRTjob ID +# HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty # JRE_RELEASE_VERSION - .. (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) ( \ diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/core.make --- 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_.*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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/defs.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/gcc.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/i486.make --- 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) diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/jvmti.make --- 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 \ diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/launcher.make --- 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 $@ + diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/makedeps.make --- 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= diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/mapfile-vers-debug --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/mapfile-vers-product --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/product.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/rules.make --- 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 $< diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/saproc.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/shark.make --- 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. # diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/sparc.make --- 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 - diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/sparcWorks.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/sparcv9.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/top.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/vm.make --- 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_.[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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/linux/makefiles/zero.make --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/adlc.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/amd64.make --- 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. # diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/buildtree.make --- 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 - .-b (11.0-b07) -# HOTSPOT_BUILD_VERSION - internal, PRTjob ID, JPRTjob ID +# HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty # JRE_RELEASE_VERSION - .. (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) ( \ diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/core.make --- 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_.*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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/defs.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/dtrace.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/fastdebug.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/gcc.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/i486.make --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/jvmti.make --- 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 \ diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/launcher.make --- 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 $@ + diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/makedeps.make --- 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= diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/optimized.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/product.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/rules.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/saproc.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/sparcWorks.make --- 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 # ################################################# diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/sparcv9.make --- 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") diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/top.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/solaris/makefiles/vm.make --- 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_.[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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/README --- 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 core %HotSpotWorkSpace% - To build the 'compiler2' version (debug || optimized) - %HotSpotWorkSpace%\build\windows\build compiler2 %HotSpotWorkSpace% - - where 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 (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 { } - where type is one of core, compiler1, compiler2. If you leave off the - " " 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 (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 or testlook help 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%/ (which ideally is in the path) and run -HotJava: h java (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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/build.bat --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/build_vm_def.sh --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/create.bat --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/create_obj_files.sh --- /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} diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/get_msc_ver.sh --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/adlc.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/compile.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/debug.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/defs.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/fastdebug.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/generated.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/launcher.make --- /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 $** + + diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/makedeps.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/product.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/projectcreator.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/rules.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/sanity.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/makefiles/vm.make --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/common/Makefile --- 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: diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/compiler1/Makefile --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/compiler1/vm.def --- 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). ; diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/compiler2/Makefile --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/compiler2/vm.def --- 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). ; diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/core/Makefile --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/core/vm.def --- 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). ; diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/kernel/Makefile --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/kernel/vm.def --- 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). ; diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/tiered/Makefile --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 make/windows/projectfiles/tiered/vm.def --- 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). ; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/assembler_sparc.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/assembler_sparc.hpp --- 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; // 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/assembler_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/bytecodes_sparc.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/bytecodes_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/bytes_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_Defs_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_FrameMap_sparc.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_FrameMap_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp --- 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); } } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp --- 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__)-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_LinearScan_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_LinearScan_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_Runtime1_sparc.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c1_globals_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c2_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/c2_init_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/codeBuffer_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/copy_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/cppInterpreterGenerator_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/cppInterpreter_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/cppInterpreter_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/debug_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/depChecker_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/depChecker_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/disassembler_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/dump_sparc.cpp --- 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" diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/frame_sparc.cpp --- 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()) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/frame_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/frame_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/globalDefinitions_sparc.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/globals_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/icBuffer_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/icache_sparc.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/icache_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/interp_masm_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/interp_masm_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/interpreterGenerator_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/interpreterRT_sparc.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/interpreterRT_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/interpreter_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/interpreter_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/javaFrameAnchor_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/jniFastGetField_sparc.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/jniTypes_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/jni_sparc.h --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/methodHandles_sparc.cpp --- 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: diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/nativeInst_sparc.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/nativeInst_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/registerMap_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/register_definitions_sparc.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/register_sparc.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/register_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/relocInfo_sparc.cpp --- 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()); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/relocInfo_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/runtime_sparc.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/sharedRuntime_sparc.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/sparc.ad --- 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); %} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/stubGenerator_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/stubRoutines_sparc.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/stubRoutines_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/templateInterpreterGenerator_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/templateInterpreter_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/templateInterpreter_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/templateTable_sparc.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/templateTable_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/vmStructs_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__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ /* be present there) */ + +#endif // CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/vm_version_sparc.cpp --- 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 = ""; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/vm_version_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/vmreg_sparc.cpp --- 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" diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/vmreg_sparc.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/vmreg_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/sparc/vm/vtableStubs_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/assembler_x86.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/assembler_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/assembler_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/bytecodeInterpreter_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/bytecodeInterpreter_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/bytecodeInterpreter_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/bytecodes_x86.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/bytecodes_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/bytes_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_CodeStubs_x86.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_Defs_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_FpuStackSim_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_FpuStackSim_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_FrameMap_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_FrameMap_x86.hpp --- 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 + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_LIRAssembler_x86.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_LIRAssembler_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_LIRGenerator_x86.cpp --- 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()); } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_LinearScan_x86.cpp --- 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" //---------------------------------------------------------------------- diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_LinearScan_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_MacroAssembler_x86.cpp --- 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"); } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_MacroAssembler_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_Runtime1_x86.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c1_globals_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c2_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/c2_init_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/codeBuffer_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/copy_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/cppInterpreterGenerator_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/cppInterpreter_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/cppInterpreter_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/debug_x86.cpp --- 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) {} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/depChecker_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/depChecker_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/disassembler_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/dump_x86_32.cpp --- 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" diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/dump_x86_64.cpp --- 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" diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/frame_x86.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/frame_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/frame_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/globalDefinitions_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/globals_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/icBuffer_x86.cpp --- 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 + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/icache_x86.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/icache_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interp_masm_x86_32.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interp_masm_x86_32.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interp_masm_x86_64.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interp_masm_x86_64.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interpreterGenerator_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interpreterRT_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interpreterRT_x86_32.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interpreterRT_x86_64.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interpreter_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interpreter_x86_32.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/interpreter_x86_64.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/javaFrameAnchor_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/jniFastGetField_x86_32.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/jniFastGetField_x86_64.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/jniTypes_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/jni_x86.h --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/methodHandles_x86.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/nativeInst_x86.cpp --- 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)); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/nativeInst_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/registerMap_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/register_definitions_x86.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/register_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/register_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/relocInfo_x86.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/relocInfo_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/runtime_x86_32.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/runtime_x86_64.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/sharedRuntime_x86_32.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/sharedRuntime_x86_64.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/stubGenerator_x86_32.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/stubGenerator_x86_64.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/stubRoutines_x86_32.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/stubRoutines_x86_32.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/stubRoutines_x86_64.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/stubRoutines_x86_64.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateInterpreterGenerator_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateInterpreter_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateInterpreter_x86_32.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateInterpreter_x86_64.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateTable_x86_32.cpp --- 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-> diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateTable_x86_32.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateTable_x86_64.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/templateTable_x86_64.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vmStructs_x86.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__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ /* be present there) */ + +#endif // CPU_X86_VM_VMSTRUCTS_X86_HPP diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vm_version_x86.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vm_version_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vmreg_x86.cpp --- 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" diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vmreg_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vmreg_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vtableStubs_x86_32.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/vtableStubs_x86_64.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/x86_32.ad --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/x86/vm/x86_64.ad --- 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); %} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/assembler_zero.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/assembler_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/assembler_zero.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/bytecodeInterpreter_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/bytecodeInterpreter_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/bytecodeInterpreter_zero.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/bytecodes_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/bytecodes_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/bytes_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/codeBuffer_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/copy_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/cppInterpreterGenerator_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/cppInterpreter_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/cppInterpreter_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/debug_zero.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/depChecker_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/depChecker_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/disassembler_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/disassembler_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/dump_zero.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/entryFrame_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/entry_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/fakeStubFrame_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/frame_zero.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/frame_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/frame_zero.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/globalDefinitions_zero.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 + +#endif // CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/globals_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/icBuffer_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/icache_zero.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/icache_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interp_masm_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interp_masm_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interpreterFrame_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interpreterGenerator_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interpreterRT_zero.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interpreterRT_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interpreter_zero.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/interpreter_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/javaFrameAnchor_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/jniFastGetField_zero.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/jniTypes_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/jni_zero.h --- 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. * diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/methodHandles_zero.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/nativeInst_zero.cpp --- 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() diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/nativeInst_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/registerMap_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/register_definitions_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/register_zero.cpp --- 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 = diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/register_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/relocInfo_zero.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/relocInfo_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/sharedRuntime_zero.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/sharkFrame_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/shark_globals_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/stack_zero.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/stack_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/stack_zero.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/stubGenerator_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/stubRoutines_zero.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/stubRoutines_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/templateInterpreterGenerator_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/templateInterpreter_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/templateInterpreter_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/templateTable_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/templateTable_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/vmStructs_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__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ /* be present there) */ + +#endif // CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/vm_version_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/vm_version_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/vmreg_zero.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/vmreg_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/vmreg_zero.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/cpu/zero/vm/vtableStubs_zero.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/launcher/java.c --- 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 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 - * options and prevent them from being passed to the vm; this is done - * by using the machine-dependent call - * RemovableMachineDependentOption. - */ - -#include -#include -#include - -#include -#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, "", - "([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, "", - "([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, "", - "(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= - * -Dapplication.home= - * -Djava.class.path= - * 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. - * is the directory where the application is installed. - * 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\n" -" -classpath \n" -" A %c separated list of directories, JAR archives,\n" -" and ZIP archives to search for class files.\n" -" -D=\n" -" set a system property\n" -" -verbose[:class|gc|jni]\n" -" enable verbose output\n" -" -version print product version and exit\n" -" -version:\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[:...|:]\n" -" -enableassertions[:...|:]\n" -" enable assertions\n" -" -da[:...|:]\n" -" -disableassertions[:...|:]\n" -" disable assertions\n" -" -esa | -enablesystemassertions\n" -" enable system assertions\n" -" -dsa | -disablesystemassertions\n" -" disable system assertions\n" -" -agentlib:[=]\n" -" load native agent library , e.g. -agentlib:hprof\n" -" see also, -agentlib:jdwp=help and -agentlib:hprof=help\n" -" -agentpath:[=]\n" -" load native agent library by full pathname\n" -" -javaagent:[=]\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 */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/launcher/java.h --- 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_ */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/launcher/java_md.c --- 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#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 -# include -# include -#else -# ifndef ARCH -# include -# 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 "/libjvm.so" where 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 /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 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); -} - diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/launcher/java_md.h --- 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 -#include -#include -#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 -#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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/attachListener_linux.cpp --- 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 #include diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/c1_globals_linux.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/c2_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/chaitin_linux.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/decoder_linux.cpp --- /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 + +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; +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/dtraceJSDT_linux.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/globals_linux.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/hpi_linux.cpp --- 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 -# include - -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"); -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/hpi_linux.hpp --- 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 -#include -#include -#include -#include - -// 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/interfaceSupport_linux.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/jsig.c --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/jvm_linux.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/jvm_linux.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/mutex_linux.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/mutex_linux.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/osThread_linux.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/osThread_linux.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/os_linux.cpp --- 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 @@ -59,6 +115,7 @@ # include # include # include +# include #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); } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/os_linux.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/os_linux.inline.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 +#include +#include +#include + 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/os_share_linux.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/perfMemory_linux.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/stubRoutines_linux.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/threadCritical_linux.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/thread_linux.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/linux/vm/vmError_linux.cpp --- 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 #include @@ -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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/posix/launcher/java_md.c --- /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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef GAMMA +#include "manifest_info.h" +#include "version_comp.h" +#endif + +#ifdef __linux__ +#include +#else +#include +#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 +# include +# include +#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 "/libjvm.so" where 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 /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 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 +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/posix/launcher/java_md.h --- /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 +#include +#include +#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 +#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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/posix/launcher/launcher.script --- /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 <= 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/dtrace/generateJvmOffsets.cpp --- 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 -#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) diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/dtrace/generateJvmOffsets.h --- 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 #include @@ -36,3 +39,5 @@ void gen_prologue(GEN_variant gen_var); void gen_epilogue(GEN_variant gen_var); } + +#endif // OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/dtrace/generateJvmOffsetsMain.c --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/dtrace/hotspot.d --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/dtrace/jvm_dtrace.c --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/dtrace/jvm_dtrace.h --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/dtrace/libjvm_db.h --- 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 #ifdef __cplusplus @@ -61,3 +64,5 @@ #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ + +#endif // OS_SOLARIS_DTRACE_LIBJVM_DB_H diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/launcher/java.c --- 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 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 - * options and prevent them from being passed to the vm; this is done - * by using the machine-dependent call - * RemovableMachineDependentOption. - */ - -#include -#include -#include - -#include -#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, "", - "([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, "", - "([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, "", - "(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= - * -Dapplication.home= - * -Djava.class.path= - * 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. - * is the directory where the application is installed. - * 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\n" -" -classpath \n" -" A %c separated list of directories, JAR archives,\n" -" and ZIP archives to search for class files.\n" -" -D=\n" -" set a system property\n" -" -verbose[:class|gc|jni]\n" -" enable verbose output\n" -" -version print product version and exit\n" -" -version:\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[:...|:]\n" -" -enableassertions[:...|:]\n" -" enable assertions\n" -" -da[:...|:]\n" -" -disableassertions[:...|:]\n" -" disable assertions\n" -" -esa | -enablesystemassertions\n" -" enable system assertions\n" -" -dsa | -disablesystemassertions\n" -" disable system assertions\n" -" -agentlib:[=]\n" -" load native agent library , e.g. -agentlib:hprof\n" -" see also, -agentlib:jdwp=help and -agentlib:hprof=help\n" -" -agentpath:[=]\n" -" load native agent library by full pathname\n" -" -javaagent:[=]\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 */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/launcher/java.h --- 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_ */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/launcher/java_md.c --- 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#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 -# include -# include -#else -# ifndef ARCH -# include -# 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 "/libjvm.so" where 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 /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 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); -} - diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/launcher/java_md.h --- 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 -#include -#include -#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 -#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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/attachListener_solaris.cpp --- 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 #include diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/c1_globals_solaris.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/c2_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/chaitin_solaris.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/decoder_solaris.cpp --- /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 + +bool Decoder::demangle(const char* symbol, char *buf, int buflen) { + return !cplus_demangle(symbol, buf, (size_t)buflen); +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/dtraceJSDT_solaris.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/globals_solaris.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/hpi_solaris.cpp --- 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 -# include - -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"); -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/hpi_solaris.hpp --- 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 -#include -#include -#include -#include -#include - -// 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/interfaceSupport_solaris.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/jsig.c --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/jvm_solaris.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/jvm_solaris.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/mutex_solaris.cpp --- 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" diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/mutex_solaris.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/osThread_solaris.cpp --- 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 // *************************************************************** diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/osThread_solaris.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/os_share_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/os_solaris.cpp --- 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 @@ -63,6 +115,7 @@ # include # include # include +# include # define _STRUCTURED_PROC 1 // this gets us the new structured proc interfaces of 5.6 & later # include // see comment in @@ -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); +} + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/os_solaris.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/os_solaris.inline.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 +#include +#include +#include +#include +#include +#include +#include + 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/perfMemory_solaris.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/stubRoutines_solaris.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/threadCritical_solaris.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/thread_solaris.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/solaris/vm/vmError_solaris.cpp --- 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 #include diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/launcher/java_md.c --- /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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#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 \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 "/jvm.dll" where 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 "/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 */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/launcher/java_md.h --- /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 +#include +#include +#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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/attachListener_windows.cpp --- 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 #include // SIGBREAK diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/c1_globals_windows.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/c2_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/chaitin_windows.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/decoder_windows.cpp --- /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); +} + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/dtraceJSDT_windows.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/globals_windows.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/hpi_windows.cpp --- 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; -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/hpi_windows.hpp --- 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)); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/interfaceSupport_windows.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/jvm_windows.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/jvm_windows.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/mutex_windows.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/mutex_windows.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/osThread_windows.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/osThread_windows.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/os_share_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/os_windows.cpp --- 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 @@ -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; ibKeyDown == 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; +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/os_windows.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/os_windows.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/perfMemory_windows.cpp --- 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 #include @@ -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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/stubRoutines_windows.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/threadCritical_windows.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/thread_windows.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os/windows/vm/vmError_windows.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/globals_linux_sparc.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp --- 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() { } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/vmStructs_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp --- 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]; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/bytes_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 // 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/copy_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/globals_linux_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/linux_x86_32.s --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/os_linux_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/os_linux_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/thread_linux_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/thread_linux_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/vmStructs_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/bytes_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/globals_linux_zero.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/os_linux_zero.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/os_linux_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/thread_linux_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/thread_linux_zero.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/vmStructs_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp --- 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 // For trap numbers #include // For V8 compatibility diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp --- 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 // needed first to avoid name collision for "std" with SC 5.0 -# include "incls/_os_solaris_sparc.cpp.incl" - // put OS-includes here # include # include @@ -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); } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp --- 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 // The portable TLS mechanism (get_thread_via_cache) is enough on SPARC. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/vmStructs_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp --- 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 # include diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/bytes_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/copy_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/globals_solaris_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/solaris_x86_32.il --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/solaris_x86_32.s --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/solaris_x86_64.il --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/vmStructs_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/bytes_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/copy_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/globals_windows_x86.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/os_windows_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/os_windows_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp --- 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() {} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/thread_windows_x86.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/thread_windows_x86.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/unwind_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/vmStructs_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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/ArgsParser.java --- 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.hpp os_.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 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(); - - 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_.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_.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_ 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_ 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= 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); - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/DirectoryTree.java --- 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); - } - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/DirectoryTreeNode.java --- 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; -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/FileFormatException.java --- 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); - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/FileList.java --- 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(); - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/FileName.java --- 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; - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/Macro.java --- 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; -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/MacroDefinitions.java --- 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 '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 - ); - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/MakeDeps.java --- 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 -// 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 "); - System.err.println(" -dspFileName "); - System.err.println(" -envVar "); - System.err.println(" -dllLoc "); - 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 "); - System.err.println(" -relativeInclude "); - System.err.println(" -define "); - System.err.println(" -perFileLine "); - System.err.println(" -conditionalPerFileLine "); - 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 "); - System.err.println(" -ignoreFile "); - System.err.println(" -additionalFile "); - System.err.println(" -additionalGeneratedFile " + - ""); - System.err.println(" -prelink :"); - 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); - } - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/MetroWerksMacPlatform.java --- 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"); - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/Platform.java --- 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); - } - - /**

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.

- -

It is used for precompiled header files.

- -

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.

- -

Some platforms have this program actually explictly - include the preprocessed gi file-- see includeGIInEachIncl(). -

- -

Also, some platforms need a pragma in the GI file.

*/ - 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 { - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/UnixPlatform.java --- 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; - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/Util.java --- 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 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; - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/WinGammaPlatform.java --- 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 "); - System.err.println(" -projectFileName "); - 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 "); - System.err.println(" -relativeInclude "); - System.err.println(" -define "); - System.err.println(" -startAt "); - System.err.println(" -additionalFile "); - System.err.println(" -additionalGeneratedFile " + - ""); - 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"); - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/WinGammaPlatformVC6.java --- 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; - } -} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/MakeDeps/WinGammaPlatformVC7.java --- 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(""); - 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"); - } 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"); - } - - 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 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); + } + } +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/DirectoryTreeNode.java --- /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; +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/FileFormatException.java --- /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); + } +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/Macro.java --- /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; +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/MacroDefinitions.java --- /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(); + } +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/ProjectCreator.java --- /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 "); + System.err.println(" -dspFileName "); + System.err.println(" -envVar "); + System.err.println(" -dllLoc "); + 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 "); + System.err.println(" -relativeInclude "); + System.err.println(" -define "); + System.err.println(" -perFileLine "); + System.err.println(" -conditionalPerFileLine "); + 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 "); + System.err.println(" -ignoreFile "); + System.err.println(" -additionalFile "); + System.err.println(" -additionalGeneratedFile " + + ""); + System.err.println(" -prelink :"); + 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); + } + } +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/Util.java --- /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 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; + } +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/WinGammaPlatform.java --- /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 "); + System.err.println(" -projectFileName "); + 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 "); + System.err.println(" -relativeInclude "); + System.err.println(" -define "); + System.err.println(" -startAt "); + System.err.println(" -additionalFile "); + System.err.println(" -additionalGeneratedFile " + + ""); + 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"); + } +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/WinGammaPlatformVC6.java --- /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; + } +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/ProjectCreator/WinGammaPlatformVC7.java --- /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(""); + 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 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", " ")) + } + ); + + 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", " ")) + } + ); + + 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"); + } 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"); + } + + 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 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 + * options and prevent them from being passed to the vm; this is done + * by using the machine-dependent call + * RemovableMachineDependentOption. + */ + +#include +#include +#include + +#include +#include +#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, "", + "([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, "", + "([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, "", + "(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= + * -Dapplication.home= + * -Djava.class.path= + * 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. + * is the directory where the application is installed. + * 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\n" +" -classpath \n" +" A %c separated list of directories, JAR archives,\n" +" and ZIP archives to search for class files.\n" +" -D=\n" +" set a system property\n" +" -verbose[:class|gc|jni]\n" +" enable verbose output\n" +" -version print product version and exit\n" +" -version:\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[:...|:]\n" +" -enableassertions[:...|:]\n" +" enable assertions\n" +" -da[:...|:]\n" +" -disableassertions[:...|:]\n" +" disable assertions\n" +" -esa | -enablesystemassertions\n" +" enable system assertions\n" +" -dsa | -disablesystemassertions\n" +" disable system assertions\n" +" -agentlib:[=]\n" +" load native agent library , e.g. -agentlib:hprof\n" +" see also, -agentlib:jdwp=help and -agentlib:hprof=help\n" +" -agentpath:[=]\n" +" load native agent library by full pathname\n" +" -javaagent:[=]\n" +" load Java programming language agent, see java.lang.instrument\n" +" -splash:\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 */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/launcher/java.h --- /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_ */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/launcher/jli_util.c --- /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 +#include +#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); +} diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/launcher/jli_util.h --- /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 + +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 */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/launcher/wildcard.c --- /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 +#include +#include +#include +#include +#include "java.h" /* Strictly for PATH_SEPARATOR/FILE_SEPARATOR */ +#include "jli_util.h" + +#ifdef _WIN32 +#include +#else /* Unix */ +#include +#include +#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; + +*/ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/tools/launcher/wildcard.h --- /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 */ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/adlc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/adlparse.cpp --- 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); } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/adlparse.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/archDesc.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/archDesc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/arena.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/arena.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/dfa.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/dict2.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/dict2.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/filebuff.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/filebuff.hpp --- 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 @@ -99,3 +102,5 @@ void print(ostream&); friend ostream& operator<< (ostream&, FileBuffRegion&); }; + +#endif // SHARE_VM_ADLC_FILEBUFF_HPP diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/forms.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/forms.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/formsopt.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/formsopt.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/formssel.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/formssel.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/main.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/output_c.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/adlc/output_h.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/asm/assembler.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/asm/assembler.hpp --- 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); // 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/asm/assembler.inline.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 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/asm/codeBuffer.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/asm/codeBuffer.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/asm/register.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/asm/register.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_CFGPrinter.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_CFGPrinter.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Canonicalizer.cpp --- 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 { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Canonicalizer.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_CodeStubs.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Compilation.cpp --- 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); } } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Compilation.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Compiler.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Compiler.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Defs.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_FpuStackSim.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_FrameMap.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_FrameMap.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_GraphBuilder.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_GraphBuilder.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_IR.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_IR.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Instruction.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Instruction.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_InstructionPrinter.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_InstructionPrinter.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LIR.cpp --- 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"; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LIR.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LIRAssembler.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LIRAssembler.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LIRGenerator.cpp --- 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 { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LIRGenerator.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LinearScan.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_LinearScan.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_MacroAssembler.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Optimizer.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Optimizer.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Runtime1.cpp --- 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(src_pos); narrowOop *dst_addr = objArrayOop(dst)->obj_at_addr(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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_Runtime1.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_ValueMap.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_ValueMap.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_ValueSet.cpp --- 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" + diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_ValueStack.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_ValueStack.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_ValueType.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_ValueType.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_globals.cpp --- 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) diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/c1/c1_globals.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/bcEscapeAnalyzer.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/bcEscapeAnalyzer.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciArray.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciArray.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciArrayKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciArrayKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciArrayKlassKlass.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciCPCache.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciCPCache.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciCallProfile.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciCallSite.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciCallSite.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciClassList.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciConstant.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciConstant.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciConstantPoolCache.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciConstantPoolCache.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciEnv.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciEnv.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciExceptionHandler.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciExceptionHandler.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciField.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciField.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciFlags.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciFlags.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciInstance.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciInstance.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciInstanceKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciInstanceKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciInstanceKlassKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciInstanceKlassKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciKlassKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciKlassKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethod.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethod.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodBlocks.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodBlocks.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodData.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodData.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodHandle.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodHandle.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciMethodKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciNullObject.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciNullObject.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjArray.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjArray.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjArrayKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjArrayKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjArrayKlassKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjArrayKlassKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObject.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObject.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjectFactory.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciObjectFactory.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciSignature.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciSignature.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciStreams.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciStreams.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciSymbol.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciSymbol.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciSymbolKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciSymbolKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciType.cpp --- 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]; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciType.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeArray.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeArray.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeArrayKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeArrayKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeArrayKlassKlass.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeArrayKlassKlass.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeFlow.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciTypeFlow.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciUtilities.cpp --- 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 // diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/ciUtilities.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/ci/compilerInterface.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/classFileError.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/classFileParser.cpp --- 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* operands = NULL; -#ifdef ASSERT - GrowableArray* indy_instructions = new GrowableArray(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* &operands, int op_count, TRAPS) { - if (operands == NULL) { - operands = new GrowableArray(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* 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/classFileParser.hpp --- 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* &operands, int op_count, TRAPS); - static void store_operand_array(GrowableArray* 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/classFileStream.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/classFileStream.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/classLoader.cpp --- 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 { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/classLoader.hpp --- 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 @@ -456,3 +462,5 @@ } }; + +#endif // SHARE_VM_CLASSFILE_CLASSLOADER_HPP diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/dictionary.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/dictionary.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/javaAssertions.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/javaAssertions.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/javaClasses.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/javaClasses.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/loaderConstraints.cpp --- 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)) {}; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/loaderConstraints.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/placeholders.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/placeholders.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/resolutionErrors.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/resolutionErrors.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/stackMapFrame.cpp --- 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), diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/stackMapFrame.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/stackMapTable.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/stackMapTable.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/stackMapTableFormat.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/symbolTable.cpp --- 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" // -------------------------------------------------------------------------- diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/symbolTable.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/systemDictionary.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/systemDictionary.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/verificationType.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/verificationType.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/verifier.cpp --- 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( diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/verifier.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/vmSymbols.cpp --- 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]; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/classfile/vmSymbols.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/codeBlob.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/codeBlob.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/codeCache.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/codeCache.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/compiledIC.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/compiledIC.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/compressedStream.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/compressedStream.hpp --- 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()) void write_long(jlong value); // write_signed_int() }; + +#endif // SHARE_VM_CODE_COMPRESSEDSTREAM_HPP diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/debugInfo.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/debugInfo.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/debugInfoRec.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/debugInfoRec.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/dependencies.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/dependencies.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/exceptionHandlerTable.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/exceptionHandlerTable.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/icBuffer.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/icBuffer.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/location.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/location.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/nmethod.cpp --- 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"); { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/nmethod.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/oopRecorder.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/oopRecorder.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/pcDesc.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/pcDesc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/relocInfo.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/relocInfo.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/scopeDesc.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/scopeDesc.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/stubs.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/stubs.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/vmreg.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/vmreg.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/vtableStubs.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/code/vtableStubs.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/abstractCompiler.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/abstractCompiler.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/compileBroker.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/compileBroker.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/compileLog.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/compileLog.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/compilerOracle.cpp --- 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: diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/compilerOracle.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/disassembler.cpp --- 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); } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/disassembler.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/methodLiveness.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/methodLiveness.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/oopMap.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/compiler/oopMap.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp --- 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 ======== diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp --- 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 { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/bufferingOopClosure.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/collectionSetChooser.cpp --- 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) diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/collectionSetChooser.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp --- 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). diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentMark.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentMark.hpp --- 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 CMTaskQueue; typedef GenericTaskQueueSet 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentMarkThread.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentZFThread.cpp --- 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 ======== diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/concurrentZFThread.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- 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"); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1MMUTracker.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1MMUTracker.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1MarkSweep.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1MarkSweep.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1OopClosures.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1OopClosures.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1RemSet.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1RemSet.hpp --- 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 void write_ref_nv(HeapRegion* from, T* p); - template 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 void write_ref(HeapRegion* from, T* p); + template 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 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1RemSet.inline.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 -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 -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 +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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp --- 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) : diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1_globals.cpp --- 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, \ diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1_globals.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegion.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegion.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegion.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegionSeq.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegionSeq.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/heapRegionSeq.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/ptrQueue.cpp --- 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), diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/ptrQueue.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/satbQueue.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/satbQueue.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/sparsePRT.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/sparsePRT.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/survRateGroup.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/survRateGroup.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/vm_operations_g1.cpp --- 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() { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/g1/vm_operations_g1.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep --- 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_.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_.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_.inline.hpp - -freeBlockDictionary.cpp freeBlockDictionary.hpp -freeBlockDictionary.cpp thread_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/includeDB_gc_g1 --- 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_.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_.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_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/includeDB_gc_parNew --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/includeDB_gc_parallelScavenge --- 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_.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_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/includeDB_gc_serial --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/includeDB_gc_shared --- 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_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp --- 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), diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/parNewGeneration.cpp --- 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); } } diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/parNewGeneration.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/parOopClosures.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/parOopClosures.inline.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 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parNew/vmStructs_parNew.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/generationSizer.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp --- 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) diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp --- 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" diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp --- 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"; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/ageTable.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/ageTable.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/allocationStats.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/allocationStats.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/cSpaceCounters.cpp --- 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) : diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/cSpaceCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/collectorCounters.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/collectorCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/concurrentGCThread.cpp --- 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; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/concurrentGCThread.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gSpaceCounters.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gSpaceCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp --- 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. diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcPolicyCounters.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcStats.cpp --- 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( diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcStats.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcUtil.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/gcUtil.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/generationCounters.cpp --- 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, diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/generationCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/immutableSpace.cpp --- 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(); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/immutableSpace.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/isGCActiveMark.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/liveRange.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/markSweep.cpp --- 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 MarkSweep::_marking_stack; Stack MarkSweep::_revisit_mdo_stack; diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/markSweep.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/markSweep.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/mutableSpace.cpp --- 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 && diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/mutableSpace.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/spaceCounters.cpp --- 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) : diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/spaceCounters.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/spaceDecorator.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/spaceDecorator.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/vmGCOperations.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_implementation/shared/vmGCOperations.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_interface/collectedHeap.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_interface/collectedHeap.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_interface/collectedHeap.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_interface/gcCause.cpp --- 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) { diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/gc_interface/gcCause.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_compiler1 --- 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_.cpp c1_CodeStubs.hpp -c1_CodeStubs_.cpp c1_FrameMap.hpp -c1_CodeStubs_.cpp c1_LIRAssembler.hpp -c1_CodeStubs_.cpp c1_MacroAssembler.hpp -c1_CodeStubs_.cpp c1_Runtime1.hpp -c1_CodeStubs_.cpp g1SATBCardTableModRefBS.hpp -c1_CodeStubs_.cpp nativeInst_.hpp -c1_CodeStubs_.cpp sharedRuntime.hpp -c1_CodeStubs_.cpp vmreg_.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_.hpp - -c1_Defs_.hpp generate_platform_dependent_include - -c1_FpuStackSim.hpp allocation.hpp -c1_FpuStackSim.hpp c1_FrameMap.hpp - -c1_FpuStackSim_.cpp array.hpp -c1_FpuStackSim_.cpp c1_FpuStackSim.hpp -c1_FpuStackSim_.cpp c1_FrameMap.hpp -c1_FpuStackSim_.cpp ostream.hpp - -c1_FpuStackSim_.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_.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_.cpp c1_FrameMap.hpp -c1_FrameMap_.cpp c1_LIR.hpp -c1_FrameMap_.cpp sharedRuntime.hpp -c1_FrameMap_.cpp vmreg_.inline.hpp - -c1_FrameMap_.hpp generate_platform_dependent_include - -c1_globals.cpp c1_globals.hpp - -c1_globals.hpp c1_globals_.hpp -c1_globals.hpp c1_globals_.hpp -c1_globals.hpp globals.hpp - -c1_globals_.hpp globalDefinitions.hpp -c1_globals_.hpp macros.hpp - -c1_globals_.hpp globalDefinitions.hpp -c1_globals_.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_.hpp -c1_LIRAssembler.cpp vmreg_.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_.cpp barrierSet.hpp -c1_LIRAssembler_.cpp c1_Compilation.hpp -c1_LIRAssembler_.cpp c1_LIRAssembler.hpp -c1_LIRAssembler_.cpp c1_MacroAssembler.hpp -c1_LIRAssembler_.cpp c1_Runtime1.hpp -c1_LIRAssembler_.cpp c1_ValueStack.hpp -c1_LIRAssembler_.cpp cardTableModRefBS.hpp -c1_LIRAssembler_.cpp ciArrayKlass.hpp -c1_LIRAssembler_.cpp ciInstance.hpp -c1_LIRAssembler_.cpp collectedHeap.hpp -c1_LIRAssembler_.cpp nativeInst_.hpp -c1_LIRAssembler_.cpp objArrayKlass.hpp -c1_LIRAssembler_.cpp sharedRuntime.hpp - -c1_LIRAssembler_.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_.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_Runtime1.hpp -c1_LIRGenerator_.cpp c1_ValueStack.hpp -c1_LIRGenerator_.cpp ciArray.hpp -c1_LIRGenerator_.cpp ciObjArrayKlass.hpp -c1_LIRGenerator_.cpp ciTypeArrayKlass.hpp -c1_LIRGenerator_.cpp sharedRuntime.hpp -c1_LIRGenerator_.cpp vmreg_.inline.hpp -c1_LIRGenerator_.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_.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_.cpp bitMap.inline.hpp -c1_LinearScan_.cpp c1_Instruction.hpp -c1_LinearScan_.cpp c1_LinearScan.hpp - -c1_LinearScan_.hpp generate_platform_dependent_include - -c1_MacroAssembler.hpp assembler.hpp -c1_MacroAssembler.hpp assembler_.inline.hpp - -c1_MacroAssembler_.cpp arrayOop.hpp -c1_MacroAssembler_.cpp basicLock.hpp -c1_MacroAssembler_.cpp biasedLocking.hpp -c1_MacroAssembler_.cpp c1_MacroAssembler.hpp -c1_MacroAssembler_.cpp c1_Runtime1.hpp -c1_MacroAssembler_.cpp collectedHeap.hpp -c1_MacroAssembler_.cpp interpreter.hpp -c1_MacroAssembler_.cpp markOop.hpp -c1_MacroAssembler_.cpp os.hpp -c1_MacroAssembler_.cpp stubRoutines.hpp -c1_MacroAssembler_.cpp systemDictionary.hpp - -c1_MacroAssembler_.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_.cpp c1_Defs.hpp -c1_Runtime1_.cpp c1_MacroAssembler.hpp -c1_Runtime1_.cpp c1_Runtime1.hpp -c1_Runtime1_.cpp compiledICHolderOop.hpp -c1_Runtime1_.cpp interpreter.hpp -c1_Runtime1_.cpp jvmtiExport.hpp -c1_Runtime1_.cpp nativeInst_.hpp -c1_Runtime1_.cpp oop.inline.hpp -c1_Runtime1_.cpp register_.hpp -c1_Runtime1_.cpp sharedRuntime.hpp -c1_Runtime1_.cpp signature.hpp -c1_Runtime1_.cpp vframeArray.hpp -c1_Runtime1_.cpp vmreg_.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_.cpp c1_Runtime1.hpp -frame_.cpp vframeArray.hpp - -globals.cpp c1_globals.hpp - -globals.hpp c1_globals_.hpp -globals.hpp c1_globals_.hpp - -instanceKlass.cpp c1_Compiler.hpp - -interpreter_.cpp c1_Runtime1.hpp - -java.cpp c1_Compiler.hpp -java.cpp c1_Runtime1.hpp - -nativeInst_.cpp c1_Runtime1.hpp - -oopMap.cpp c1_Defs.hpp - -os_.cpp c1_Runtime1.hpp - -os_.cpp c1_Runtime1.hpp - -safepoint.cpp c1_globals.hpp - -sharedRuntime.cpp c1_Runtime1.hpp - -sharedRuntime_.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_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_compiler2 --- 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_.cpp adGlobals_.hpp -ad_.cpp ad_.hpp -ad_.cpp allocation.inline.hpp -ad_.cpp assembler.hpp -ad_.cpp assembler_.inline.hpp -ad_.cpp biasedLocking.hpp -ad_.cpp cfgnode.hpp -ad_.cpp collectedHeap.inline.hpp -ad_.cpp compiledICHolderOop.hpp -ad_.cpp growableArray.hpp -ad_.cpp locknode.hpp -ad_.cpp markOop.hpp -ad_.cpp methodOop.hpp -ad_.cpp nativeInst_.hpp -ad_.cpp oop.inline.hpp -ad_.cpp oop.inline2.hpp -ad_.cpp opcodes.hpp -ad_.cpp regalloc.hpp -ad_.cpp regmask.hpp -ad_.cpp runtime.hpp -ad_.cpp sharedRuntime.hpp -ad_.cpp stubRoutines.hpp -ad_.cpp vmreg.hpp -ad_.cpp vmreg_.inline.hpp - -ad_.hpp addnode.hpp -ad_.hpp machnode.hpp -ad_.hpp matcher.hpp -ad_.hpp opcodes.hpp -ad_.hpp regalloc.hpp -ad_.hpp resourceArea.hpp -ad_.hpp subnode.hpp -ad_.hpp vectornode.hpp - -ad__clone.cpp ad_.hpp - -ad__expand.cpp ad_.hpp - -ad__format.cpp ad_.hpp - -ad__gen.cpp ad_.hpp -ad__gen.cpp cfgnode.hpp -ad__gen.cpp locknode.hpp - -ad__misc.cpp ad_.hpp - -ad__peephole.cpp ad_.hpp - -ad__pipeline.cpp ad_.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_.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_.hpp -c2_globals.hpp c2_globals_.hpp -c2_globals.hpp globals.hpp - -c2_globals_.hpp globalDefinitions.hpp -c2_globals_.hpp macros.hpp - -c2_globals_.hpp globalDefinitions.hpp -c2_globals_.hpp macros.hpp - -c2_init_.cpp compile.hpp -c2_init_.cpp node.hpp - -c2compiler.cpp ad_.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_.cpp chaitin.hpp -chaitin_.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_.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_.hpp - -dfa_.cpp ad_.hpp -dfa_.cpp matcher.hpp -dfa_.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_.hpp - -gcm.cpp ad_.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_.hpp -globals.hpp c2_globals_.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_.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_.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_.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_.cpp runtime.hpp - -os_.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_.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_.hpp -regmask.cpp compile.hpp -regmask.cpp regmask.hpp - -regmask.hpp adGlobals_.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_.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_.cpp adGlobals_.hpp -runtime_.cpp ad_.hpp -runtime_.cpp assembler.hpp -runtime_.cpp assembler_.inline.hpp -runtime_.cpp globalDefinitions.hpp -runtime_.cpp interfaceSupport.hpp -runtime_.cpp interpreter.hpp -runtime_.cpp nativeInst_.hpp -runtime_.cpp runtime.hpp -runtime_.cpp sharedRuntime.hpp -runtime_.cpp stubRoutines.hpp -runtime_.cpp systemDictionary.hpp -runtime_.cpp vframeArray.hpp -runtime_.cpp vmreg.hpp -runtime_.cpp vmreg_.inline.hpp - -set.cpp allocation.inline.hpp -set.cpp set.hpp - -set.hpp allocation.hpp -set.hpp port.hpp - -sharedRuntime_.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_.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_.hpp -vmStructs.cpp matcher.hpp - -vmreg.hpp adGlobals_.hpp -vmreg.hpp adlcVMDeps.hpp -vmreg.hpp ostream.hpp - -vtableStubs.cpp matcher.hpp - -vtableStubs_.cpp ad_.hpp -vtableStubs_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_core --- 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 , , ... and -// makedeps has a dependency on these platform files looking like: -// foo_.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_.hpp -abstractInterpreter.hpp stubs.hpp -abstractInterpreter.hpp thread_.inline.hpp -abstractInterpreter.hpp top.hpp -abstractInterpreter.hpp vmThread.hpp - -accessFlags.cpp accessFlags.hpp -accessFlags.cpp oop.inline.hpp -accessFlags.cpp os_.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_.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_.inline.hpp -arguments.cpp referenceProcessor.hpp -arguments.cpp taskqueue.hpp -arguments.cpp universe.inline.hpp -arguments.cpp vm_version_.hpp - -arguments.hpp java.hpp -arguments.hpp perfData.hpp -arguments.hpp top.hpp - -array.cpp array.hpp -array.cpp resourceArea.hpp -array.cpp thread_.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_.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_.hpp -assembler.hpp relocInfo.hpp -assembler.hpp top.hpp -assembler.hpp vm_version_.hpp - -assembler.inline.hpp assembler.hpp -assembler.inline.hpp codeBuffer.hpp -assembler.inline.hpp disassembler.hpp -assembler.inline.hpp threadLocalStorage.hpp - -assembler_.cpp assembler_.inline.hpp -assembler_.cpp biasedLocking.hpp -assembler_.cpp cardTableModRefBS.hpp -assembler_.cpp collectedHeap.inline.hpp -assembler_.cpp interfaceSupport.hpp -assembler_.cpp interpreter.hpp -assembler_.cpp methodHandles.hpp -assembler_.cpp objectMonitor.hpp -assembler_.cpp os.hpp -assembler_.cpp resourceArea.hpp -assembler_.cpp sharedRuntime.hpp -assembler_.cpp stubRoutines.hpp - -assembler_.hpp generate_platform_dependent_include - -assembler_.inline.hpp assembler.inline.hpp -assembler_.inline.hpp codeBuffer.hpp -assembler_.inline.hpp codeCache.hpp -assembler_.inline.hpp handles.inline.hpp - -assembler_.cpp assembler.hpp -assembler_.cpp assembler_.inline.hpp -assembler_.cpp os.hpp -assembler_.cpp threadLocalStorage.hpp - -atomic.cpp atomic.hpp -atomic.cpp atomic_.inline.hpp -atomic.cpp os_.inline.hpp - -atomic.hpp allocation.hpp - -atomic_.inline.hpp atomic.hpp -atomic_.inline.hpp os.hpp -atomic_.inline.hpp vm_version_.hpp -atomic_.inline.hpp orderAccess_.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_.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_.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_.inline.hpp -bytecodeInterpreter.cpp resourceArea.hpp -bytecodeInterpreter.cpp sharedRuntime.hpp -bytecodeInterpreter.cpp threadCritical.hpp -bytecodeInterpreter.cpp vmSymbols.hpp - -bytecodeInterpreter_.cpp assembler.hpp -bytecodeInterpreter_.cpp bytecodeInterpreter.hpp -bytecodeInterpreter_.cpp bytecodeInterpreter.inline.hpp -bytecodeInterpreter_.cpp debug.hpp -bytecodeInterpreter_.cpp deoptimization.hpp -bytecodeInterpreter_.cpp frame.inline.hpp -bytecodeInterpreter_.cpp interp_masm_.hpp -bytecodeInterpreter_.cpp interpreterRuntime.hpp -bytecodeInterpreter_.cpp interpreter.hpp -bytecodeInterpreter_.cpp jvmtiExport.hpp -bytecodeInterpreter_.cpp jvmtiThreadState.hpp -bytecodeInterpreter_.cpp methodDataOop.hpp -bytecodeInterpreter_.cpp methodOop.hpp -bytecodeInterpreter_.cpp oop.inline.hpp -bytecodeInterpreter_.cpp sharedRuntime.hpp -bytecodeInterpreter_.cpp stubRoutines.hpp -bytecodeInterpreter_.cpp synchronizer.hpp -bytecodeInterpreter_.cpp vframeArray.hpp - -bytecodeInterpreterWithChecks.cpp bytecodeInterpreter.cpp - -bytecodeInterpreter.hpp allocation.hpp -bytecodeInterpreter.hpp basicLock.hpp -bytecodeInterpreter.hpp bytes_.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_.hpp generate_platform_dependent_include - -bytecodeInterpreter_.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_.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_.hpp -bytecodes.cpp methodOop.hpp -bytecodes.cpp resourceArea.hpp - -bytecodes.hpp allocation.hpp -bytecodes.hpp top.hpp - -bytecodes_.cpp bytecodes.hpp - -bytecodes_.hpp generate_platform_dependent_include - -bytes_.hpp allocation.hpp - -bytes_.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_.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_.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_.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_.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_.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_.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_.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_.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_.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_.hpp generate_platform_dependent_include - -copy_.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_.cpp arguments.hpp -cppInterpreter_.cpp arrayOop.hpp -cppInterpreter_.cpp assembler.hpp -cppInterpreter_.cpp bytecodeHistogram.hpp -cppInterpreter_.cpp debug.hpp -cppInterpreter_.cpp deoptimization.hpp -cppInterpreter_.cpp frame.inline.hpp -cppInterpreter_.cpp interfaceSupport.hpp -cppInterpreter_.cpp interpreterRuntime.hpp -cppInterpreter_.cpp interpreter.hpp -cppInterpreter_.cpp interpreterGenerator.hpp -cppInterpreter_.cpp jvmtiExport.hpp -cppInterpreter_.cpp jvmtiThreadState.hpp -cppInterpreter_.cpp methodDataOop.hpp -cppInterpreter_.cpp methodOop.hpp -cppInterpreter_.cpp oop.inline.hpp -cppInterpreter_.cpp sharedRuntime.hpp -cppInterpreter_.cpp stubRoutines.hpp -cppInterpreter_.cpp synchronizer.hpp -cppInterpreter_.cpp cppInterpreter.hpp -cppInterpreter_.cpp timer.hpp -cppInterpreter_.cpp vframeArray.hpp - -cppInterpreter_.hpp generate_platform_dependent_include - -cppInterpreterGenerator_.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_.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_.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_.cpp codeCache.hpp -debug_.cpp debug.hpp -debug_.cpp frame.hpp -debug_.cpp init.hpp -debug_.cpp nmethod.hpp -debug_.cpp os.hpp -debug_.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_.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_.inline.hpp -deoptimization.cpp xmlstream.hpp - -deoptimization.hpp allocation.hpp -deoptimization.hpp frame.inline.hpp - -depChecker_.cpp depChecker_.hpp -depChecker_.cpp disassembler.hpp -depChecker_.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_.hpp generate_platform_dependent_include - -disassembler.cpp cardTableModRefBS.hpp -disassembler.cpp codeCache.hpp -disassembler.cpp collectedHeap.hpp -disassembler.cpp depChecker_.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_.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_.hpp -dtraceJSDT.hpp nmethod.hpp - -dtraceJSDT_.cpp allocation.hpp -dtraceJSDT_.cpp codeBlob.hpp -dtraceJSDT_.cpp dtraceJSDT.hpp -dtraceJSDT_.cpp globalDefinitions.hpp -dtraceJSDT_.cpp javaClasses.hpp -dtraceJSDT_.cpp jniHandles.hpp -dtraceJSDT_.cpp jvm.h -dtraceJSDT_.cpp os.hpp -dtraceJSDT_.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_.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_.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_.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_.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_.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_.hpp -frame.inline.hpp methodOop.hpp -frame.inline.hpp signature.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 methodOop.hpp -frame_.cpp monitorChunk.hpp -frame_.cpp oop.inline.hpp -frame_.cpp resourceArea.hpp -frame_.cpp signature.hpp -frame_.cpp stubCodeGenerator.hpp -frame_.cpp stubRoutines.hpp -frame_.cpp vmreg_.inline.hpp - -frame_.hpp generate_platform_dependent_include -frame_.hpp synchronizer.hpp -frame_.hpp top.hpp - -frame_.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_.inline.hpp -gcLocker.hpp thread_.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_.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_.hpp -globalDefinitions.hpp macros.hpp - -globalDefinitions_.hpp generate_platform_dependent_include - -globalDefinitions_.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_.hpp -globals.hpp globals_.hpp -globals.hpp globals_.hpp - -globals_extension.hpp globals.hpp -globals_extension.hpp top.hpp - -growableArray.cpp growableArray.hpp -growableArray.cpp resourceArea.hpp -growableArray.cpp thread_.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_.inline.hpp -handles.cpp thread_.inline.hpp - -handles.hpp klass.hpp -handles.hpp klassOop.hpp -handles.hpp top.hpp - -handles.inline.hpp handles.hpp -handles.inline.hpp thread_.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_.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_.cpp hpi.hpp -hpi_.cpp oop.inline.hpp -hpi_.cpp os.hpp - -hpi_imported.h jni.h - -icBuffer.cpp assembler_.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_.cpp assembler.hpp -icBuffer_.cpp assembler_.inline.hpp -icBuffer_.cpp bytecodes.hpp -icBuffer_.cpp collectedHeap.inline.hpp -icBuffer_.cpp icBuffer.hpp -icBuffer_.cpp nativeInst_.hpp -icBuffer_.cpp oop.inline.hpp -icBuffer_.cpp oop.inline2.hpp -icBuffer_.cpp resourceArea.hpp - -icache.cpp icache.hpp -icache.cpp resourceArea.hpp - -icache.hpp allocation.hpp -icache.hpp stubCodeGenerator.hpp - -icache_.cpp assembler_.inline.hpp -icache_.cpp icache.hpp - -icache_.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_.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_.inline.hpp -interfaceSupport.hpp top.hpp -interfaceSupport.hpp vmThread.hpp - -interfaceSupport_.hpp generate_platform_dependent_include - -interp_masm_.cpp arrayOop.hpp -interp_masm_.cpp basicLock.hpp -interp_masm_.cpp biasedLocking.hpp -interp_masm_.cpp interp_masm_.hpp -interp_masm_.cpp interpreterRuntime.hpp -interp_masm_.cpp interpreter.hpp -interp_masm_.cpp jvmtiExport.hpp -interp_masm_.cpp jvmtiRedefineClassesTrace.hpp -interp_masm_.cpp jvmtiThreadState.hpp -interp_masm_.cpp markOop.hpp -interp_masm_.cpp methodDataOop.hpp -interp_masm_.cpp methodOop.hpp -interp_masm_.cpp sharedRuntime.hpp -interp_masm_.cpp thread_.inline.hpp - -interp_masm_.hpp assembler_.inline.hpp -interp_masm_.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_.cpp allocation.inline.hpp -interpreterRT_.cpp handles.inline.hpp -interpreterRT_.cpp icache.hpp -interpreterRT_.cpp interfaceSupport.hpp -interpreterRT_.cpp interpreterRuntime.hpp -interpreterRT_.cpp interpreter.hpp -interpreterRT_.cpp methodOop.hpp -interpreterRT_.cpp oop.inline.hpp -interpreterRT_.cpp signature.hpp -interpreterRT_.cpp universe.inline.hpp - -interpreterRT_.hpp allocation.hpp -interpreterRT_.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_.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_.inline.hpp -interpreterRuntime.hpp top.hpp -interpreterRuntime.hpp universe.hpp - -interpreter_.cpp arguments.hpp -interpreter_.cpp arrayOop.hpp -interpreter_.cpp assembler.hpp -interpreter_.cpp bytecodeHistogram.hpp -interpreter_.cpp debug.hpp -interpreter_.cpp deoptimization.hpp -interpreter_.cpp frame.inline.hpp -interpreter_.cpp interpreterRuntime.hpp -interpreter_.cpp interpreter.hpp -interpreter_.cpp interpreterGenerator.hpp -interpreter_.cpp jvmtiExport.hpp -interpreter_.cpp jvmtiThreadState.hpp -interpreter_.cpp methodDataOop.hpp -interpreter_.cpp methodHandles.hpp -interpreter_.cpp methodOop.hpp -interpreter_.cpp oop.inline.hpp -interpreter_.cpp sharedRuntime.hpp -interpreter_.cpp stubRoutines.hpp -interpreter_.cpp synchronizer.hpp -interpreter_.cpp templateTable.hpp -interpreter_.cpp timer.hpp -interpreter_.cpp vframeArray.hpp - -interpreter_.hpp generate_platform_dependent_include - -interpreterGenerator.hpp cppInterpreter.hpp -interpreterGenerator.hpp cppInterpreterGenerator.hpp -interpreterGenerator.hpp templateInterpreter.hpp -interpreterGenerator.hpp templateInterpreterGenerator.hpp - -interpreterGenerator_.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_.inline.hpp -java.cpp timer.hpp -java.cpp universe.hpp -java.cpp vmError.hpp -java.cpp vm_operations.hpp -java.cpp vm_version_.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_.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_.hpp -javaCalls.hpp methodOop.hpp -javaCalls.hpp thread_.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_.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_.inline.hpp - -javaFrameAnchor_.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_.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_.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_.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_.cpp assembler_.inline.hpp -jniFastGetField_.cpp jniFastGetField.hpp -jniFastGetField_.cpp jvm_misc.hpp -jniFastGetField_.cpp resourceArea.hpp -jniFastGetField_.cpp safepoint.hpp - -jniHandles.cpp jniHandles.hpp -jniHandles.cpp mutexLocker.hpp -jniHandles.cpp oop.inline.hpp -jniHandles.cpp systemDictionary.hpp -jniHandles.cpp thread_.inline.hpp - -jniHandles.hpp handles.hpp -jniHandles.hpp top.hpp - -jniPeriodicChecker.cpp allocation.inline.hpp -jniPeriodicChecker.cpp jniPeriodicChecker.hpp -jniPeriodicChecker.cpp task.hpp - -jniTypes_.hpp allocation.hpp -jniTypes_.hpp jni.h -jniTypes_.hpp oop.hpp - -jni_.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_.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_.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_.h -jvm.h reflectionCompat.hpp - -jvm_.cpp interfaceSupport.hpp -jvm_.cpp jvm.h -jvm_.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_.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_.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_.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_.cpp allocation.inline.hpp -methodHandles_.cpp interpreter.hpp -methodHandles_.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_.inline.hpp -mutex.cpp osThread.hpp -mutex.cpp thread_.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_.inline.hpp -mutexLocker.cpp vmThread.hpp - -mutexLocker.hpp allocation.hpp -mutexLocker.hpp mutex.hpp -mutexLocker.hpp os_.inline.hpp - -mutex_.cpp events.hpp -mutex_.cpp interfaceSupport.hpp -mutex_.cpp mutex.hpp -mutex_.cpp mutex_.inline.hpp -mutex_.cpp thread_.inline.hpp - -mutex_.inline.hpp interfaceSupport.hpp -mutex_.inline.hpp os_.inline.hpp -mutex_.inline.hpp thread_.inline.hpp - -nativeInst_.cpp assembler_.inline.hpp -nativeInst_.cpp handles.hpp -nativeInst_.cpp nativeInst_.hpp -nativeInst_.cpp oop.inline.hpp -nativeInst_.cpp ostream.hpp -nativeInst_.cpp resourceArea.hpp -nativeInst_.cpp sharedRuntime.hpp -nativeInst_.cpp stubRoutines.hpp - -nativeInst_.hpp allocation.hpp -nativeInst_.hpp assembler.hpp -nativeInst_.hpp icache.hpp -nativeInst_.hpp os.hpp -nativeInst_.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_.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_.inline.hpp -objectMonitor.cpp preserveException.hpp -objectMonitor.cpp resourceArea.hpp -objectMonitor.cpp stubRoutines.hpp -objectMonitor.cpp thread.hpp -objectMonitor.cpp thread_.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_.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_.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_.inline.hpp - -orderAccess.cpp orderAccess.hpp -orderAccess.cpp stubRoutines.hpp -orderAccess.cpp thread.hpp - -orderAccess.hpp allocation.hpp -orderAccess.hpp os.hpp - -orderAccess_.inline.hpp orderAccess.hpp -orderAccess_.inline.hpp vm_version_.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_.inline.hpp -os.cpp privilegedStack.hpp -os.cpp stubRoutines.hpp -os.cpp systemDictionary.hpp -os.cpp threadService.hpp -os.cpp thread_.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_.cpp allocation.inline.hpp -os_.cpp arguments.hpp -os_.cpp assembler_.inline.hpp -os_.cpp classLoader.hpp -os_.cpp events.hpp -os_.cpp extendedPC.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 jniFastGetField.hpp -os_.cpp jvm.h -os_.cpp jvm_.h -os_.cpp jvm_misc.hpp -os_.cpp mutexLocker.hpp -os_.cpp mutex_.inline.hpp -os_.cpp nativeInst_.hpp -os_.cpp no_precompiled_headers -os_.cpp osThread.hpp -os_.cpp os_share_.hpp -os_.cpp sharedRuntime.hpp -os_.cpp stubRoutines.hpp -os_.cpp systemDictionary.hpp -os_.cpp thread_.inline.hpp -os_.cpp timer.hpp -os_.cpp vmError.hpp -os_.cpp vmSymbols.hpp -os_.cpp vtableStubs.hpp - -os_.hpp generate_platform_dependent_include - -os_.cpp allocation.inline.hpp -os_.cpp arguments.hpp -os_.cpp assembler_.inline.hpp -os_.cpp attachListener.hpp -os_.cpp classLoader.hpp -os_.cpp compileBroker.hpp -os_.cpp defaultStream.hpp -os_.cpp events.hpp -os_.cpp extendedPC.hpp -os_.cpp filemap.hpp -os_.cpp globals.hpp -os_.cpp growableArray.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 jniFastGetField.hpp -os_.cpp jvm.h -os_.cpp jvm_.h -os_.cpp jvm_misc.hpp -os_.cpp mutexLocker.hpp -os_.cpp mutex_.inline.hpp -os_.cpp nativeInst_.hpp -os_.cpp no_precompiled_headers -os_.cpp objectMonitor.hpp -os_.cpp oop.inline.hpp -os_.cpp osThread.hpp -os_.cpp os_share_.hpp -os_.cpp perfMemory.hpp -os_.cpp runtimeService.hpp -os_.cpp sharedRuntime.hpp -os_.cpp statSampler.hpp -os_.cpp stubRoutines.hpp -os_.cpp systemDictionary.hpp -os_.cpp threadCritical.hpp -os_.cpp thread_.inline.hpp -os_.cpp timer.hpp -os_.cpp vmError.hpp -os_.cpp vmSymbols.hpp -os_.cpp vtableStubs.hpp - -os_.hpp generate_platform_dependent_include - -os_.inline.hpp atomic.hpp -os_.inline.hpp atomic_.inline.hpp -os_.inline.hpp orderAccess_.inline.hpp -os_.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_.cpp assembler_.inline.hpp -osThread_.cpp atomic.hpp -osThread_.cpp handles.inline.hpp -osThread_.cpp mutexLocker.hpp -osThread_.cpp no_precompiled_headers -osThread_.cpp os.hpp -osThread_.cpp osThread.hpp -osThread_.cpp safepoint.hpp -osThread_.cpp vmThread.hpp - -osThread_.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_.inline.hpp -ostream.cpp hpi.hpp -ostream.cpp hpi_.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_.cpp allocation.inline.hpp -perfMemory_.cpp exceptions.hpp -perfMemory_.cpp handles.inline.hpp -perfMemory_.cpp oop.inline.hpp -perfMemory_.cpp os_.inline.hpp -perfMemory_.cpp perfMemory.hpp -perfMemory_.cpp resourceArea.hpp -perfMemory_.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_.inline.hpp prefetch.hpp - -preserveException.cpp handles.inline.hpp -preserveException.cpp preserveException.hpp - -preserveException.hpp handles.hpp -preserveException.hpp thread_.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_.cpp register_.hpp - -register_.hpp register.hpp -register_.hpp vm_version_.hpp - -registerMap.hpp globalDefinitions.hpp -registerMap.hpp register_.hpp -registerMap.hpp vmreg.hpp - -registerMap_.hpp generate_platform_dependent_include - -register_definitions_.cpp assembler.hpp -register_definitions_.cpp interp_masm_.hpp -register_definitions_.cpp register.hpp -register_definitions_.cpp register_.hpp - -relocInfo.cpp assembler_.inline.hpp -relocInfo.cpp compiledIC.hpp -relocInfo.cpp copy.hpp -relocInfo.cpp nativeInst_.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_.cpp assembler.inline.hpp -relocInfo_.cpp assembler_.inline.hpp -relocInfo_.cpp nativeInst_.hpp -relocInfo_.cpp oop.inline.hpp -relocInfo_.cpp relocInfo.hpp -relocInfo_.cpp safepoint.hpp - -relocInfo_.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_.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_.inline.hpp - -resourceArea.hpp allocation.hpp -resourceArea.hpp thread_.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_.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_.inline.hpp -safepoint.cpp universe.inline.hpp -safepoint.cpp vmreg_.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_.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_.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_.cpp assembler.hpp -sharedRuntime_.cpp assembler_.inline.hpp -sharedRuntime_.cpp compiledICHolderOop.hpp -sharedRuntime_.cpp debugInfoRec.hpp -sharedRuntime_.cpp icBuffer.hpp -sharedRuntime_.cpp interpreter.hpp -sharedRuntime_.cpp jvmtiRedefineClassesTrace.hpp -sharedRuntime_.cpp sharedRuntime.hpp -sharedRuntime_.cpp vframeArray.hpp -sharedRuntime_.cpp vmreg_.inline.hpp -sharedRuntime_.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_.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_.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_.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_.hpp - -statSampler.hpp perfData.hpp -statSampler.hpp task.hpp - -stubCodeGenerator.cpp assembler_.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_.cpp assembler.hpp -stubGenerator_.cpp assembler_.inline.hpp -stubGenerator_.cpp frame.inline.hpp -stubGenerator_.cpp handles.inline.hpp -stubGenerator_.cpp instanceOop.hpp -stubGenerator_.cpp interpreter.hpp -stubGenerator_.cpp methodHandles.hpp -stubGenerator_.cpp methodOop.hpp -stubGenerator_.cpp nativeInst_.hpp -stubGenerator_.cpp objArrayKlass.hpp -stubGenerator_.cpp oop.inline.hpp -stubGenerator_.cpp sharedRuntime.hpp -stubGenerator_.cpp stubCodeGenerator.hpp -stubGenerator_.cpp stubRoutines.hpp -stubGenerator_.cpp thread_.inline.hpp -stubGenerator_.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_.hpp -stubRoutines.hpp stubCodeGenerator.hpp -stubRoutines.hpp top.hpp - -stubRoutines_.cpp deoptimization.hpp -stubRoutines_.cpp frame.inline.hpp -stubRoutines_.cpp stubRoutines.hpp -stubRoutines_.cpp thread_.inline.hpp - -stubRoutines_.hpp generate_platform_dependent_include - -stubRoutines_.cpp os.hpp -stubRoutines_.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_.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_.inline.hpp -synchronizer.cpp preserveException.hpp -synchronizer.cpp resourceArea.hpp -synchronizer.cpp stubRoutines.hpp -synchronizer.cpp synchronizer.hpp -synchronizer.cpp thread_.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_.inline.hpp -task.cpp task.hpp -task.cpp thread_.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_.inline.hpp - -taskqueue.hpp allocation.hpp -taskqueue.hpp allocation.inline.hpp -taskqueue.hpp mutex.hpp -taskqueue.hpp orderAccess_.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_.cpp arguments.hpp -templateInterpreter_.cpp arrayOop.hpp -templateInterpreter_.cpp assembler.hpp -templateInterpreter_.cpp bytecodeHistogram.hpp -templateInterpreter_.cpp debug.hpp -templateInterpreter_.cpp deoptimization.hpp -templateInterpreter_.cpp frame.inline.hpp -templateInterpreter_.cpp interpreterRuntime.hpp -templateInterpreter_.cpp interpreter.hpp -templateInterpreter_.cpp interpreterGenerator.hpp -templateInterpreter_.cpp jvmtiExport.hpp -templateInterpreter_.cpp jvmtiThreadState.hpp -templateInterpreter_.cpp methodDataOop.hpp -templateInterpreter_.cpp methodOop.hpp -templateInterpreter_.cpp oop.inline.hpp -templateInterpreter_.cpp sharedRuntime.hpp -templateInterpreter_.cpp stubRoutines.hpp -templateInterpreter_.cpp synchronizer.hpp -templateInterpreter_.cpp templateTable.hpp -templateInterpreter_.cpp timer.hpp -templateInterpreter_.cpp vframeArray.hpp - -templateInterpreter_.hpp generate_platform_dependent_include - -templateInterpreterGenerator_.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_.hpp - -templateTable_.cpp interpreterRuntime.hpp -templateTable_.cpp interpreter.hpp -templateTable_.cpp methodDataOop.hpp -templateTable_.cpp methodHandles.hpp -templateTable_.cpp objArrayKlass.hpp -templateTable_.cpp oop.inline.hpp -templateTable_.cpp sharedRuntime.hpp -templateTable_.cpp stubRoutines.hpp -templateTable_.cpp synchronizer.hpp -templateTable_.cpp templateTable.hpp -templateTable_.cpp universe.inline.hpp - -templateTable_.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_.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_.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_.cpp frame.inline.hpp -thread_.cpp thread_.inline.hpp - -thread_.hpp generate_platform_dependent_include - -thread_.inline.hpp atomic.hpp -thread_.inline.hpp atomic_.inline.hpp -thread_.inline.hpp orderAccess_.inline.hpp -thread_.inline.hpp prefetch.hpp -thread_.inline.hpp prefetch_.inline.hpp -thread_.inline.hpp thread.hpp -thread_.inline.hpp threadLocalStorage.hpp - -threadCritical.hpp allocation.hpp - -threadCritical_.cpp threadCritical.hpp -threadCritical_.cpp thread_.inline.hpp - -threadLS_.cpp threadLocalStorage.hpp -threadLS_.cpp thread_.inline.hpp - -threadLS_.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_.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_.inline.hpp -threadLocalStorage.cpp threadLocalStorage.hpp -threadLocalStorage.cpp thread_.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_.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_.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_.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_.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_.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_.cpp arguments.hpp -vmError_.cpp os.hpp -vmError_.cpp thread.hpp -vmError_.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_.inline.hpp -vmThread.cpp vmThread.hpp -vmThread.cpp vm_operations.hpp -vmThread.cpp xmlstream.hpp - -vmThread.hpp perfData.hpp -vmThread.hpp thread_.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_.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_.hpp - -vm_version.hpp allocation.hpp -vm_version.hpp ostream.hpp - -vm_version_.cpp assembler_.inline.hpp -vm_version_.cpp java.hpp -vm_version_.cpp os_.inline.hpp -vm_version_.cpp resourceArea.hpp -vm_version_.cpp stubCodeGenerator.hpp -vm_version_.cpp vm_version_.hpp - -vm_version_.hpp globals_extension.hpp -vm_version_.hpp vm_version.hpp - -vm_version_.cpp os.hpp -vm_version_.cpp vm_version_.hpp - -vmreg.cpp assembler.hpp -vmreg.cpp vmreg.hpp - -vmreg.hpp allocation.hpp -vmreg.hpp globalDefinitions.hpp -vmreg.hpp register_.hpp - -vmreg_.cpp assembler.hpp -vmreg_.cpp vmreg.hpp - -vmreg_.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_.cpp assembler.hpp -vtableStubs_.cpp assembler_.inline.hpp -vtableStubs_.cpp instanceKlass.hpp -vtableStubs_.cpp interp_masm_.hpp -vtableStubs_.cpp klassVtable.hpp -vtableStubs_.cpp resourceArea.hpp -vtableStubs_.cpp sharedRuntime.hpp -vtableStubs_.cpp vmreg_.inline.hpp -vtableStubs_.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_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_features --- 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_.cpp attachListener.hpp -attachListener_.cpp dtraceAttacher.hpp -attachListener_.cpp interfaceSupport.hpp -attachListener_.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_.cpp assembler_.inline.hpp -dump_.cpp compactingPermGenGen.hpp -dump_.cpp generation.inline.hpp -dump_.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_.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_.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_.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_.hpp -vmStructs.cpp vmStructs_.hpp -vmStructs.cpp vmreg.hpp -vmStructs.cpp watermark.hpp - -vmStructs.hpp debug.hpp diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_gc --- 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_.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_.inline.hpp -collectedHeap.inline.hpp sharedRuntime.hpp - -gcCause.hpp allocation.hpp - -gcCause.cpp gcCause.hpp diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_gc_parallel --- 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_.cpp g1SATBCardTableModRefBS.hpp -assembler_.cpp g1CollectedHeap.inline.hpp -assembler_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_jvmti --- 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_.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_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_shark --- 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_.cpp shark_globals.hpp - -compileBroker.cpp sharkCompiler.hpp - -disassembler.cpp sharkEntry.hpp - -globals.hpp shark_globals_.hpp - -globals.cpp shark_globals.hpp - -llvmValue.hpp llvmHeaders.hpp -llvmValue.hpp sharkContext.hpp -llvmValue.hpp sharkType.hpp - -nmethod.cpp sharkCompiler.hpp - -sharedRuntime_.cpp compileBroker.hpp -sharedRuntime_.cpp sharkCompiler.hpp - -shark_globals.cpp shark_globals.hpp - -shark_globals.hpp shark_globals_.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_.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/includeDB_zero --- 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_.cpp stack_.inline.hpp - -entryFrame_.hpp javaCalls.hpp -entryFrame_.hpp stack_.hpp - -fakeStubFrame_.hpp stack_.hpp - -frame.hpp stack_.hpp - -frame.inline.hpp fakeStubFrame_.hpp -frame.inline.hpp entryFrame_.hpp -frame.inline.hpp interpreterFrame_.hpp -frame.inline.hpp sharkFrame_.hpp - -frame_.cpp interpreterRuntime.hpp -frame_.cpp scopeDesc.hpp - -interpreter.hpp entry_.hpp - -interpreterFrame_.hpp bytecodeInterpreter.hpp -interpreterFrame_.hpp methodOop.hpp -interpreterFrame_.hpp stack_.hpp -interpreterFrame_.hpp thread.hpp - -interpreterRT_.cpp stack_.inline.hpp - -sharkFrame_.hpp methodOop.hpp -sharkFrame_.hpp stack_.hpp - -stack_.hpp sizes.hpp - -stack_.inline.hpp stack_.hpp -stack_.inline.hpp thread.hpp - -stack_.cpp interpreterRuntime.hpp -stack_.cpp stack_.hpp -stack_.cpp stack_.inline.hpp - -stubGenerator_.cpp stack_.inline.hpp - -thread.hpp stack_.hpp diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/abstractInterpreter.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecode.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecode.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecodeHistogram.cpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecodeHistogram.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecodeInterpreter.cpp --- 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); diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecodeInterpreter.hpp --- 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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecodeInterpreter.inline.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 diff -r 00bc9eaf0e24 -r 06f017f7daa7 src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl --- 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 @@